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

Supported/unsupported coins for swap: brc20-db20 #2

Open
teebszet opened this issue Jul 28, 2023 · 1 comment
Open

Supported/unsupported coins for swap: brc20-db20 #2

teebszet opened this issue Jul 28, 2023 · 1 comment

Comments

@teebszet
Copy link

Have an issue to do with which coins we allow swaps from.

we are currently filtering coins list to swap like this:

const acceptableCoinList =
      coinsList?.filter((c) => alexSDK.getCurrencyFrom(c.principal) != null) ?? [];

in the case of brc20-db20, this passes:

alexSDK.getCurrencyFrom("SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.brc20-db20")
// brc20-db20

but if you try to run getFee or getRoute using "brc20-db20", you will get a ClarityError thrown:

decoders.js:74 Uncaught (in promise) Error: ClarityError: 2001
    at defaultErrorDecoder (decoders.js:74:1)
    at Object.decode (decoders.js:84:1)
    at _callee2$ (alex-sdk.esm.js:4018:1)
    at tryCatch (alex-sdk.esm.js:65:1)
    at Generator.<anonymous> (alex-sdk.esm.js:146:1)
    at Generator.next (alex-sdk.esm.js:90:1)
    at asyncGeneratorStep (alex-sdk.esm.js:327:1)
    at _next (alex-sdk.esm.js:346:1)
@teebszet teebszet changed the title Supported/unsupported coins for swap Supported/unsupported coins for swap: brc20-db20 Jul 28, 2023
@fiftyeightandeight
Copy link

@zhigang1992 @bolasblack this feature (of getting the list of supported tokens) was requested by others too. Think something we want to implement either as an API endpoint or as part of SDK?
Also, we don't have AMM on brc20-db20, so this shouldn't be included (though we will add one pretty soon).

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

2 participants