-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
chore(blookbook): rename token type to standard #16286
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ export const filterTokenTransfers = ( | |
type, | ||
decimals: transfer.decimals || 0, | ||
amount: transfer.value || '', | ||
standard: transfer.type, | ||
standard: transfer.standard, | ||
}; | ||
delete tokenTransfer.value; | ||
|
||
|
@@ -309,7 +309,7 @@ export const transformTokenInfo = ( | |
): TokenInfo[] | undefined => { | ||
if (!tokens || !Array.isArray(tokens)) return undefined; | ||
const info = tokens.reduce((arr, token) => { | ||
if (token.type === 'XPUBAddress') return arr; | ||
if (token.standard === 'XPUBAddress') return arr; | ||
|
||
return arr.concat([ | ||
{ | ||
|
@@ -327,7 +327,7 @@ export const transformAddresses = ( | |
): AccountAddresses | undefined => { | ||
if (!tokens || !Array.isArray(tokens)) return undefined; | ||
const addresses = tokens.reduce((arr, t) => { | ||
if (t.type !== 'XPUBAddress') return arr; | ||
if (t.standard !== 'XPUBAddress') return arr; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit funny to have token standard There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, well XPUBAddress is there under "type" even in blockbook, alongside with ERC types... Also for me Bitcoin accounts are displayed but they are empty, so maybe that's why I didn't notice the bug, will investigate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes I know, that's fine. But if they're coming with |
||
|
||
return arr.concat([ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ export const transformTokenInfo = ( | |
} | ||
|
||
const info = tokens.map(token => ({ | ||
type: 'BLOCKFROST', | ||
standard: 'BLOCKFROST', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we wanna make the whole deprecation thing in a non-breaking way (which I don't insist on), all the currently outgoing data must be preserved and some new may be added => we want to signal that |
||
balance: token.quantity, | ||
...transformToken(token), | ||
})); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ export const transformTokenInfo = ( | |
} = tokenAccount.account.data; | ||
|
||
return { | ||
type: tokenProgramsInfo[program].tokenStandard, | ||
standard: tokenProgramsInfo[program].tokenStandard, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dtto |
||
contract: info.mint, | ||
balance: info.tokenAmount.amount, | ||
decimals: info.tokenAmount.decimals, | ||
|
@@ -171,9 +171,9 @@ export const transformTokenInfo = ( | |
balance: token.balance || '0', | ||
}); | ||
} else { | ||
const { type, contract, balance, decimals, name, symbol } = token; | ||
const { standard, contract, balance, decimals, name, symbol } = token; | ||
acc[token.contract] = { | ||
type, | ||
standard, | ||
contract, | ||
balance, | ||
decimals, | ||
|
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 believe this file should not be changed manually as it originates from Blockbook repo. Make the necessary changes in
blockbook.ts
file instead (if they're really necessary, which may not be this case; see the main comment).