pendulum-chain / portal Goto Github PK
View Code? Open in Web Editor NEWThe Pendulum/Amplitude portal UI
License: GNU General Public License v3.0
The Pendulum/Amplitude portal UI
License: GNU General Public License v3.0
From this comment, we might want to introduce the types for parachain staking pallet, and others that we might benefit from.
For this we need to increment the pendulum.js dependency to the latest, and add the typing where needed.
/collators
As a PEN/AMPE holder, I should be unlock my unvested tokens from the Portal.
As a stable coin holder on Stellar network, I want to bridge my tokens to Amplitude.
\bridge
Issue
and Redeem
tab.Issue
. Show Input field and a dropdown next to it
Manually select vault
. This would be by default unchecked.i
icon.Confirm
button. On click opens-up a pop-up.I've made this transfer
I've made this transfer
pop-up closes.\transfer
pageWill update once ready
To be filled in by the tech-team.
As a 0xAmber user i should be able to to track and manage the pool deposits and withdrawals.
Currently the portal is connected to rpc.pendulumchain.tech
. Update it to rpc-amplitude.pendulumchain.tech
.
As a user connected with a wallet, show on /dashboard
my $AMPE balance (no historic data)
In this version, only the current $AMPE balance is shown, no other graphs or similar
As a portal user, i should be able to see the new branding/design for Pendulum and Amplitude.
Network
https://www.figma.com/file/5up5sghcttBogehUq4255i/App?node-id=608%3A696&t=4xmrWwmOcyeowwD8-0
As a Spacewalk bridge tester, I want to test the complete flow of the bridge UI with dummy data.
This version will use dummy data, which is defined in this ticket.
Add a notice: "This is a showcase prototype using dummy data. Spacewalk bridge is still in development."
/bridge
, show bridge UI (see wireframes below)
bridge/issue
: the Issue
(from Stellar to Amplitude)bridge/redeem
: the Redeem
(from Amplitude to Stellar)bridge/transfers
: a list of pending/completed transfersFrom
section:
Input field
to enter token amount (allow same amount of decimals as all other number fields on app)Dropdown
to select tokens (see hardcoded token list below)To
section:
Bridge
below the input form
10 USDC
)From
Stellar addressTo
Amplitude addressI've made the transfer
button, which closes the pop-upTransfers
list with the state of the transfer as Pending
From
section.
Input field
to enter token amount (allow same amount of decimals as all other number fields on app)Dropdown
to select tokens. (see hardcoded token list below)To
section.
Input field
to enter Stellar address.Bridge
button.
Transfers
list with the state of the transfer as Pending
USDC
TZS
BRL
sUSDC
sTZS
sBRL
The network on which user has funds or wishes to bridge from
The network on which user wants the funds or wishes to bridge to
The amount user would receive if the transaction is successful. For simplicity same as entered amount
Time when the transaction was executed.
Amount of the transaction done
ID of the transaction. In issue Stellar ID, In redeem Amplitude ID.
Type of transfer. Issue or Redeem.
Pending, Completed and Failed.
As $AMPE holder, I want to see the list of collators that are active on the network.
/collators
Delegate
button in front of each list itemAMPEBalance
Amount of tokens that are locked on that collator
Amount of tokens staked by the user on that specific collator
Number of delegators that have delegated to that collator
% of rewards the user would get for his delegated amount
https://www.figma.com/file/XLIKffEYnK9autHMM1YgA3/Flows?node-id=0%3A1&t=rDjECzvp3Y8Zm7gV-0
api.query.parachainStaking.candidatePool.entries()
[key, value]
key
contains the address of the collator, extract it using key.args[0].toHuman()
value
contains the remaining information, extract it using value.unwrap()
, this returns an object with the members
total
: this is the total staking amount of the collator, display in column "Total staked" (see below for how to display amounts)delegators
: an array containing information about the delegators for this collator, you only need to get the length of this array to display the number of delegatorsdelegators
array contains an entry owner
and amount
owner
entry that is equal to the account of the user, then display the amount
in the "Delegated" column (see below for how to display amounts)api.query.parachainStaking.inflationConfig()
info
, the APY is then info.collator.rewardRate.annual.toHuman()
Number(amount.divn(1000000).divn(1000)) / 1000
As a Subwallet user, I want to connect the SubWallet to portal.
/Dashboard
Connect wallet
opens a pop-upSubWallet
as an optionSubWallet
SubWallet
User cannot see the estimated rewards.
Steps to reproduce the behavior:
/collator
If the user has delegated tokens to a collators, he must be able to see the estimated rewards that he is going to recieve.
As a wrapped stable coin holder on Amplitude network, I want to bridge my tokens back to Stellar.
\bridge
Issue
and Redeem
tab.Redeem
. Show Input field and a dropdown next to it
Confirm
button. On click opens-up a pop-up.View Progress
View Progress
pop-up closes and directs you the particular transfer on \transfer
Will update once ready
To be filled in by the tech-team.
As a crowdloan contributor, I should be able to claim my rewards from the portal
\dashboard
on /amm
:
Add readme file to the repo with local setup instructions and other relevant docs
As a Stellar and Amplitude user, I should be able to track the status of my transfers on spacewalk.
\transfers
Issue Requests
and Redeem Requests
.Issue
and Redeem
respectively.Will update once ready
To be filled in by the tech-team.
The governance option on the navbar should be redirected to this link https://amplitude.polkassembly.io/
Collators table should include pagination, as shown in the designs:
<table>
component in Collators.tsx
with the paginated componentAs a portal user, I should accept the T&Cs before connecting and using it.
Add icon to the governance option in the navbar showing that it is a external link.
Svg:
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" style="fill:#000"><path d="M19.98 2.99a1 1 0 0 0-.11.01H15a1 1 0 1 0 0 2h2.586l-9.293 9.293a1 1 0 1 0 1.414 1.414L19 6.414V9a1 1 0 1 0 2 0V4.127a1 1 0 0 0-1.02-1.137zM5 3c-1.093 0-2 .907-2 2v14c0 1.093.907 2 2 2h14c1.093 0 2-.907 2-2v-6a1 1 0 1 0-2 0v6H5V5h6a1 1 0 1 0 0-2H5z"/></svg>
As a portal user, I should be able to switch between portal version's using a dropdown.
On the collator dashboard i see side scroll and the collator heading overlaps other headings
Steps to reproduce the behavior:
/collator
on portalThere should be no overlap of the headings over each other and also no side scroll, ideally the user should be able to see the entire table without scrolling.
As a AMPE holder, i should be able to see the AMPE balance in my wallet on the dashboard
On the Pendulum version of the portal, i am not able to see my delegation on the table and also the Delegate
button is not disabled even after i have delegated to one of the collator.
Steps to reproduce the behavior:
/collator
Delegate
button is enabledThe delegate button should be disabled if the user had delegated to one of the collator and also user should be able to see his delegation on the table(this is related to this #80 )
<img width=“915” alt=“Screenshot 2023-03-14 at 12 59 10 PM” src=“https://user-images.githubusercontent.com/52105313/224926760-4ae9416c-aceb-4623-9dcf-50f6a6b485ac.png”>
On /collators
:
As a developer/tester, I'd like to connect to Foucoco, the Rococo testnet version of Amplitude/Pendulum, so I can try out new features in a safe way.
portal.pendulumchain.org/foucoco/
, connect to the Foucocohostname | FQDN | Function |
---|---|---|
penrpc-roc-00 | rpc-foucoco.pendulumchain.tech | Foucoco RPC Node |
As a 0xAmber user i should be able to add and remove liquidity from the backstop pool
As $AMPE holder, I want to delegate my tokens to a collator.
\collators
Delegate
button in front of each collator item opens a pop-upBelow min. delegation
Insufficient balance
Incorrect input. Only two decimals
Delegate
button. On click.
AMPE Balance
% of rewards the user would get for his delegated amount
The minimum amount a user could delegate
https://www.figma.com/file/XLIKffEYnK9autHMM1YgA3/Flows?node-id=0%3A1&t=mZaYUhKzV4gedc0U-0
api.consts.parachainStaking.minDelegatorStake
(again, this needs to be converted to an AMPE amount)api.query.parachainStaking.inflationConfig()
info
, the APY is then info.delegator.rewardRate.annual.toHuman()
(be careful, don't use collator
but delegator
here)api.query.system.account(<delegator address (the user)>)
account
, then the available AMPE is account.data.free
(again, this needs to be converted to an AMPE amount)api.tx.parachainStaking.joinDelegators
, this function takes two arguments
Math.round
(which is still required because of numerical imprecision)As a stablecoin holder, I must be able to swap my stablecoins using 0xAmber swap UI.
/0xAmber
Swap
https://www.figma.com/file/5up5sghcttBogehUq4255i/App?node-id=995%3A866&t=PlifogyiiotFPIgN-0
As a portal user, I should be able to see the Portal T&Cs
Terms
should be linked to https://pendulumchain.org/legal/portal-terms-and-conditionsAfter connecting a wallet to the portal, and reloading the page, the wallet is automatically disconnected.
Steps to reproduce the behavior:
The expected behavior would be to have the wallet persistent after reloading the page.
Proposed solution:
We should save the global state to (and load it from) local storage. We should also add a way of disconnecting the wallet.
Add appropriate release version to sidebar
As a holder of DOT/KSM i should be able transfer my tokens to Pendulum/Amplitude.
\cross-chain
Transfer
Confirm
buttonConfirm
the on-chain transaction to be executed.As a portal user, I should be able to see the Pendulum version of the portal when i go to portal.pendulumchain.org
Currently the governance link on Pendulum version directs to this https://amplitude.polkassembly.io/
Steps to reproduce the behavior:
Clicking on Governance should redirect to https://pendulum.polkassembly.io/
As a portal user, I must be able to see the collator list with new branding/design
https://www.figma.com/file/XLIKffEYnK9autHMM1YgA3/Flows?node-id=86%3A299&t=wC9J2NkPZrSzvaHO-4
As a portal user, I should not be able to see AMM and Bridge in the side menu.
As a portal user, I should be able to see the upcoming features in the side menu with a coming soon tag.
As a user accessing the Pendulum Portal via the default URL, I should be directed to the "production" network: Pendulum.
https://portal.pendulumchain.org
, the route should default to https://portal.pendulumchain.org/pendulum
(not /amplitude
)In order to prepare for the v0.1 release, some features should be disabled/hidden:
As a portal user, I should be able to distinguish the foucoco version of the portal from others.
rpc.pendulumchain.tech
as a provider, since every time the connect()
method is called in the API, it is switching the provider, so even if we add collators as second options, they will be selected often (code)// FIXME
comment will include the ticket to fix the issue, but here or here it looks the other way around either remove the FIXME or create a ticket to fix it.@ts-ignore
and fix the type reference hereDisclaimer: I used vscode feature -> Copy as -> Remote file url. I was standing on master. If master changed from that moment, lines may not match.
As a portal visitor, I should be able to see the dashboard and the promotions campaign.
/dashboard
As $AMPE holder, I want to undelegate my tokens from a collator.
\collators
Collators
container show
Undelegate
opens a pop-upAmount Incorrect
Incorrect input. Only two decimals
Undelegate
button. On click.
Delegate
buttons of all collators and disable the Undelegate
from this specific collator.AMPE Balance
The amount delegated by the user to that collator
https://www.figma.com/file/XLIKffEYnK9autHMM1YgA3/Flows?node-id=0%3A1&t=RWBKfzuRcngaIfGY-0
Most of the technical consideration in issue 26 is also relevant for this issue.
Additionally:
api.query.parachainStaking.delegatorState(<user account address>)
value
, which contains a Boolean value.isSome
value.isSome
is true
, then the user is currently delegating, if it is false
, then the user is currently not delegatingisSome
is true, then you can call value.unwrap()
owner
: the address of the collator the user is delegating to, display nicely with toHuman
(i.e., value.unwrap().owner.toHuman()
)amount
: the delegation amount, be aware that this is the raw amount againA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.