Skip to content

Commit

Permalink
✨ (SupportedAssets): add WBTC and ARB tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
nickadamson committed Jan 12, 2024
1 parent 686354e commit d18822f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
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 @@ -68,6 +68,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 @@ -83,6 +97,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: '0xd20A4136D7f88dBa2ACB2C72379697CE7DD82cD0',
} as const,
/* Foundry */
{
chainId: 31337,
Expand All @@ -98,4 +126,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));

0 comments on commit d18822f

Please sign in to comment.