-
Notifications
You must be signed in to change notification settings - Fork 31
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
Feat: Support assets dynamically from the backend #72
Conversation
src/coinbase/address.ts
Outdated
@@ -253,19 +272,19 @@ export class Address { | |||
* Creates a trade model for the specified amount and assets. | |||
* | |||
* @param amount - The amount of the Asset to send. | |||
* @param fromAssetId - The ID of the Asset to trade from. For Ether, eth, gwei, and wei are supported. | |||
* @param toAssetId - The ID of the Asset to trade to. For Ether, eth, gwei, and wei are supported. | |||
* @param fromAsset - The Asset to trade from. For Ether, eth, gwei, and wei are supported. |
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.
remove For Ether, eth, gwei, and wei are supported.
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.
good catch! updated.
break; | ||
case "eth": | ||
break; | ||
default: |
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.
default should be break. we are supporting more erc20s on mainnet now https://docs-cdp-developer-platform-preview.cbhq.net/wallets/docs/assets/
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.
this is only for ETH, Wei, or Gwei usage. ERC20 tokens should not be able to bypass the model.asset_id !== Coinbase.toAssetId(assetId)
guard.
765cd9c
to
788d694
Compare
What changed? Why?
This makes the SDK able to dynamically support any assets added from the backend.
Main changes
Qualified Impact