Skip to content
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

veezywqp@uniswap/token-lists was updated to allow objects to be nested 2 levels deep as of 1.0.0-beta.26 #642

Open
Veezywqp1 opened this issue Apr 4, 2024 · 0 comments

Comments

@Veezywqp1
Copy link

          `@uniswap/token-lists` was updated to allow objects to be nested 2 levels deep as of `1.0.0-beta.26`

here is a proposed schema for representing the cross chain token info in the extensions:

bridgeInfo is an extension that contains a map of other chain ID to an object containing other token info, like so

"tokens": [
  {
    // ...
    "chainId": "<source chain id>",
    "extensions": {
      "bridgeInfo": { 
        "<destination chain id>": {
          "tokenAddress": "<token address on destination chain id>",
          "originBridgeAddress": "<optional address of the bridge contract on the source chain id>",
          "destBridgeAddress": "<optional address of the bridge contract on the destination chain id>"
        }
      }
    }
  }, 
  {
    // ...
    "chainId": "<destination chain id>",
    "extensions": {
      "bridgeInfo": { 
        "<source chain id>": {
          "tokenAddress": "<token address on source chain id>",
          "originBridgeAddress": "<optional address of the bridge contract on the destination chain id>",
          "destBridgeAddress": "<optional address of the bridge contract on the source chain id>"
        }
      }
    }
  }, 
  // ...
]

e.g.:
https://github.com/Uniswap/token-lists/blob/e2a796f3f021949b986b9ac9f84a17be92498702/test/schema/example-crosschain.tokenlist.json

Originally posted by @moodysalem in #51 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant