Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/demo/partners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export default {
type: 'fiat',
color: '#7214F5'
},
nexchange: {
type: 'swap',
color: '#1D31B6'
},
paybis: {
type: 'fiat',
color: '#FFB400'
Expand Down
31 changes: 13 additions & 18 deletions src/partners/changenow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,24 +376,19 @@ function getAssetInfo(network: string, currencyCode: string): EdgeAssetInfo {
)
}

try {
const tokenId = createTokenId(
tokenType,
currencyCode.toUpperCase(),
contractAddress
)
return {
chainPluginId,
evmChainId,
tokenId
}
} catch (e) {
// If tokenId creation fails, treat as native (no log available in this sync function)
return {
chainPluginId,
evmChainId,
tokenId: null
}
// Let createTokenId throw if the contract address cannot be converted: a
// token must never be silently downgraded to a native (tokenId: null)
// mapping, which would price it with the chain's gas-token rate and
// overcount volume whenever the token is worth less than the gas token.
const tokenId = createTokenId(
tokenType,
currencyCode.toUpperCase(),
contractAddress
)
return {
chainPluginId,
evmChainId,
tokenId
}
}

Expand Down
Loading
Loading