Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Delegate Registry v2 (#4492)
* feat: set form.to as delegate address * feat-wip: initial split delegation UI updates to SpaceDelegatesDelegateModal * choir: Adds addDelegate, deleteDelegate, deleteAllDelegates functions * wip: updates divide equally and cleans up definition * feat: add delegates logic for Delegate Row Form * Updates clear all delegates logic * Updates x button hover * Refactor the delegation setup to be agnostic to how the data fetching and setting happens * Add delegate registry v2 reading * Add delegate registry v2 balance * Make it possible to view delegateRegistryV2 delegates * Activate the delegates sidebar link for delegate registry v2 delegations * Fix prettier problems * [delegate registry v2]Add offset/skip to delegat query * Add separate delegation UI for different delegation types * Update DELEGATE_REGISTRY_BACKEND_URL * feat: Connect the logic for setting the delegation * Update weight calculation in handleConfirm function * Add expiration time to setDelegates function and get it from the Modal * WIP: Adds Expiration field * feat: implement expiration date logic * chore: clean code * chore: remove unnecessary variables * Default expiration time to one year in the future + Some refactoring * chore: Apply PR comments * fix: adjust file imports * fix orderBy filter * format units to default to 18 decimals * bug: remove wrong percentage format * add number of delegators to read * use new api structure * fix object key reference * fix units * add fetch method * rename registry v2 -> split delegation * adjust for api changes * cleanup split delegation modal * fix address ordering * fix sub-strategy param on fetch * update read.ts to new api schema * use delegators from new api schema * update api request body to match new schema * use strategy set backendUrl if available * PR fixups * display current delegations in modal * add error if weights are over 100 * switch to using delegatePortal settings where appropriate * adds ability to clear all delegations * chore: file renaming * refactor: centralize delegation portal enabling * refactor: DRY-ing modal definition * refactor: remove redundant import * refactor: modify ref inside same function for more readability * refactor: remove redundant return * refactor: follow coding style for error arg name * refactor: remove uneeded ref * fix: remove unused function * feat: set form.to as delegate address * feat-wip: initial split delegation UI updates to SpaceDelegatesDelegateModal * choir: Adds addDelegate, deleteDelegate, deleteAllDelegates functions * wip: updates divide equally and cleans up definition * feat: add delegates logic for Delegate Row Form * Updates clear all delegates logic * Updates x button hover * Refactor the delegation setup to be agnostic to how the data fetching and setting happens * Add delegate registry v2 reading * Add delegate registry v2 balance * Make it possible to view delegateRegistryV2 delegates * Activate the delegates sidebar link for delegate registry v2 delegations * Fix prettier problems * [delegate registry v2]Add offset/skip to delegat query * Add separate delegation UI for different delegation types * Update DELEGATE_REGISTRY_BACKEND_URL * feat: Connect the logic for setting the delegation * Update weight calculation in handleConfirm function * Add expiration time to setDelegates function and get it from the Modal * WIP: Adds Expiration field * feat: implement expiration date logic * chore: clean code * chore: remove unnecessary variables * Default expiration time to one year in the future + Some refactoring * chore: Apply PR comments * fix: adjust file imports * fix orderBy filter * format units to default to 18 decimals * bug: remove wrong percentage format * add number of delegators to read * use new api structure * fix object key reference * fix units * add fetch method * rename registry v2 -> split delegation * adjust for api changes * cleanup split delegation modal * fix address ordering * fix sub-strategy param on fetch * update read.ts to new api schema * use delegators from new api schema * update api request body to match new schema * use strategy set backendUrl if available * PR fixups * display current delegations in modal * add error if weights are over 100 * switch to using delegatePortal settings where appropriate * adds ability to clear all delegations * refactor: rename file to follow convention * chore: revert back changes to .env * chore: remove redundant file * fix: use property from composable to check valid delegation portal * refactor: refactor to follow coding style * refactor: refactor to follow coding style * refactor: removed uneeded variable * fix: show notification error on tx building error * fix: only use `hasDelegationPortal` from composable to check for delegation validity * fix: fix invalid variable type * fix: fix delegate statement not loading * fix: fix content flashing * fix: fix event triggering on page quit * fix: do not return undefined delegation * add sender to delegations when power < 100, clarify language * fix: handle floats when equally distributing power * fix: hide self delegate button on split delegation * fix(ui): delegate form should start with a blank delegate field * fix: add min and max to weight * fix: ensure all addresses are unique * fix: fix missing translation text * refactor: code standard * fix: remove empty string from duplicate addresses comparison * fix: remove unused ref * chore: remove leftover code from copy/paste * fix: UI fix * remove unused function, notify on wrong network * fix: refresh delegatingTo properly on account change * fix: fix wrong comparison --------- Co-authored-by: juliopavila <[email protected]> Co-authored-by: Colin Spence <[email protected]> Co-authored-by: samepant <[email protected]> Co-authored-by: samepant <[email protected]> Co-authored-by: Wan Qi Chen <[email protected]>
- Loading branch information