Skip to content

multiple token support #28

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

Merged
merged 5 commits into from
Jan 17, 2024
Merged
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
5 changes: 5 additions & 0 deletions .changeset/short-trees-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@valorem-labs-inc/sdk": patch
---

add WBTC and ARB tokens
4 changes: 3 additions & 1 deletion src/entities/assets/supported-asset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ describe('Asset Entity', () => {
Object.values(SUPPORTED_CHAINS).forEach(({ id }) => {
const assets = SupportedAsset.getSupportedAssetsByChainId(id);

expect(assets.length).toEqual(2);
expect(assets.length).toEqual(4);
expect(assets[0].symbol).toEqual('USDC');
expect(assets[1].symbol).toEqual('WETH');
expect(assets[2].symbol).toEqual('WBTC');
expect(assets[3].symbol).toEqual('ARB');
});
});

Expand Down
44 changes: 43 additions & 1 deletion src/entities/assets/supported-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { SupportedChainId } from '../../utils/chains';
import type { ERC20Token } from './asset';
import { Asset } from './asset';

export type SupportedAssetSymbol = 'USDC' | 'WETH';
export type SupportedAssetSymbol = 'USDC' | 'WETH' | 'WBTC' | 'ARB';

interface SupportedERC20Token extends ERC20Token {
chainId: SupportedChainId;
Expand Down Expand Up @@ -67,6 +67,20 @@ export const SUPPORTED_ASSETS: SupportedAsset[] = [
decimals: 18,
address: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',
} as const,
{
chainId: 42161,
name: 'Wrapped Bitcoin',
symbol: 'WBTC',
decimals: 8,
address: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f',
} as const,
{
chainId: 42161,
name: 'Arbitrum',
symbol: 'ARB',
decimals: 18,
address: '0x912CE59144191C1204E64559FE8253a0e49E6548',
} as const,
/* Arbitrum Sepolia */
{
chainId: 421614,
Expand All @@ -82,6 +96,20 @@ export const SUPPORTED_ASSETS: SupportedAsset[] = [
decimals: 18,
address: '0x9Eb7fE3FA85f44e74e0407d060429e5a11431f3E',
} as const,
{
chainId: 421614,
name: 'Wrapped Bitcoin',
symbol: 'WBTC',
decimals: 8,
address: '0xB5D16f8DEda771E1f6aa0Bc4c26007B16bcB8009',
} as const,
{
chainId: 421614,
name: 'Arbitrum',
symbol: 'ARB',
decimals: 18,
address: '0x998a301ed303D9b6fAc3096E27eb3FAd72379360',
} as const,
/* Foundry */
{
chainId: 31337,
Expand All @@ -97,4 +125,18 @@ export const SUPPORTED_ASSETS: SupportedAsset[] = [
decimals: 18,
address: '0x9Eb7fE3FA85f44e74e0407d060429e5a11431f3E',
} as const,
{
chainId: 31337,
name: 'Wrapped Bitcoin',
symbol: 'WBTC',
decimals: 8,
address: '0xB5D16f8DEda771E1f6aa0Bc4c26007B16bcB8009',
} as const,
{
chainId: 31337,
name: 'Arbitrum',
symbol: 'ARB',
decimals: 18,
address: '0xd20A4136D7f88dBa2ACB2C72379697CE7DD82cD0',
} as const,
].map((token) => new SupportedAsset(token));