-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config quick select tokens for deposit/withdrawal forms #290
Conversation
d29c142
to
3b24d60
Compare
configs/mainnet.json
Outdated
"show": "brdg/4b90a8d1225d11ed7af0661ff7309714189a527302892cad03ace7615d417d38", | ||
"real" : "cgt/1" | ||
}, | ||
{ | ||
"show": "swth", | ||
"real" : "swth" | ||
}, | ||
{ | ||
"show": "eth.1.2.942d87", | ||
"real" : "eth.1.2.942d87" | ||
}, | ||
{ | ||
"show": "brdg/a02afc2c1edf77cc023eefa25fc036c184612faf9365cda9c1daa3b1675ebf8f", | ||
"real" : "brdg/a02afc2c1edf77cc023eefa25fc036c184612faf9365cda9c1daa3b1675ebf8f" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think its just a matter of label and the actual token selected. modify the field to show the label, add icon_denom
to fetch the correct icon and add quick_select_denom
to link to the intended token after selecting
would be good to add priority to the fields also so the UI can sort by priority
{
"priority": "1",
"label": "USDC",
"icon_denom": "{any usdc denom that returns the usdc icon}",
"quick_select_denom": "cgt/1",
}, {
...
}
scripts/check_configs.ts
Outdated
const duplicateRealTokens = checkDuplicateEntries(quickSelectTokens.map(token => token.real)); | ||
const invalidRealTokens = checkValidEntries(quickSelectTokens.map(token => token.real), denoms); | ||
|
||
if (duplicateQuickSelectTokens.status && duplicateQuickSelectTokens.entry) { | ||
let listOfDuplicates: string = duplicateQuickSelectTokens.entry.join(", "); | ||
console.error(`ERROR: ${network}.json has the following duplicated quick select tokens: ${listOfDuplicates}. Please make sure to input each token only once in ${network}`); | ||
return false; | ||
} | ||
|
||
if (invalidQuickSelectTokens.status && invalidQuickSelectTokens.entry) { | ||
let listOfInvalidTokens: string = invalidQuickSelectTokens.entry.join(", "); | ||
console.error(`ERROR: ${network}.json has the following invalid quick select token denoms: ${listOfInvalidTokens}. Please make sure to only input valid token denoms in ${network}`); | ||
return false; | ||
} | ||
|
||
if (duplicateRealTokens.status && duplicateRealTokens.entry) { | ||
let listOfDuplicates: string = duplicateRealTokens.entry.join(", "); | ||
console.error(`ERROR: ${network}.json has the following duplicated real tokens: ${listOfDuplicates}. Please make sure to input each token only once in ${network}`); | ||
return false; | ||
} | ||
|
||
if (invalidRealTokens.status && invalidRealTokens.entry) { | ||
let listOfInvalidTokens: string = invalidRealTokens.entry.join(", "); | ||
console.error(`ERROR: ${network}.json has the following invalid real token denoms: ${listOfInvalidTokens}. Please make sure to only input valid token denoms in ${network}`); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think just need to check if quick_select_denom
is a valid token should be sufficient. Different tokens can still point to the same selected token
i.e. USDC, axlUSDC can all point to cgt/1
but do check for duplicate labels e.g. cannot have two USDC buttons appearing
configs/devnet.json
Outdated
{ | ||
"show": "swth", | ||
"real" : "swth" | ||
}, | ||
{ | ||
"show": "usdc", | ||
"real" : "usdc" | ||
}, | ||
{ | ||
"show": "eth", | ||
"real" : "eth" | ||
}, | ||
{ | ||
"show": "dai", | ||
"real" : "dai" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update structs based on comments
configs/testnet.json
Outdated
{ | ||
"show": "swth", | ||
"real" : "swth" | ||
}, | ||
{ | ||
"show": "usdc", | ||
"real" : "usdc" | ||
}, | ||
{ | ||
"show": "eth", | ||
"real" : "eth" | ||
}, | ||
{ | ||
"show": "dai", | ||
"real" : "dai" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update structs based on comments
.github/markets/pr_template.md
Outdated
|`real` |`string` |true |The default token will be use to transfer in deposit/withdrawal | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update structs based on comments
config.schema.json
Outdated
"show": { | ||
"type": "string", | ||
"description": "Token to show on UI" | ||
}, | ||
"real": { | ||
"type": "string", | ||
"description": "Token to use in transfer" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update structs based on comments
33707fa
to
b950a0d
Compare
b950a0d
to
a836a0e
Compare
No description provided.