ChainAgnostic / caip-js

CAIP standard utils
https://www.npmjs.com/package/caip
MIT License
25 stars 10 forks source link

Fails to parse an asset ID string with no tokenId #42

Open ra-phael opened 7 months ago

ra-phael commented 7 months ago

From my understanding of CAIP-19, the tokenId suffix is optional, as in the example provided for DAI under Test Cases:

# DAI Token
eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f

However this test doesn't pass using that exact same string:

 it("should instantiate from string", async () => {
    const result = new AssetId(
      "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f"
    );
    assertInterface(result);
  });

image