Skip to content

Commit

Permalink
Merge pull request #191 from interlay/feat-add-hdx
Browse files Browse the repository at this point in the history
Feat: Add HDX routes
  • Loading branch information
bvotteler authored Apr 19, 2024
2 parents be311a4 + 8adeb30 commit 37448f9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ All channels support transfers in both directions.
| parallel | INTR IBTC |
| polkadot | DOT |
| polkadot asset hub | USDT |
| hydradx | IBTC |
| hydradx | HDX IBTC |

#### Kintsugi:

Expand Down
5 changes: 5 additions & 0 deletions scripts/configs/interlay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ import-storage:
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice, usdc
- foreignAsset: 12
- free: '1000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice, hdx
- foreignAsset: 13
- free: '1000000000000000'
9 changes: 9 additions & 0 deletions src/adapters/hydradx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ import { xTokensHelper } from "../utils/xtokens-helper";
const DEST_WEIGHT = "Unlimited";

export const hydraRoutersConfig: Omit<CrossChainRouterConfigs, "from">[] = [
{
to: "interlay",
token: "HDX",
xcm: {
// recent transfer cost: 405_777_777_777 - 5x margin for fee estimate
fee: { token: "HDX", amount: "1000000000000" },
weightLimit: DEST_WEIGHT,
},
},
{
to: "interlay",
token: "IBTC",
Expand Down
11 changes: 11 additions & 0 deletions src/adapters/interlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ export const interlayRoutersConfig: Omit<CrossChainRouterConfigs, "from">[] = [
weightLimit: DEST_WEIGHT,
},
},
{
to: "hydra",
token: "HDX",
// from recent transfer: 80_376_806_468 - add 5x safety margin
xcm: {
fee: { token: "HDX", amount: "400000000000" },
weightLimit: DEST_WEIGHT,
},
},
// {
// to: "hydra",
// token: "USDC",
Expand Down Expand Up @@ -222,6 +231,7 @@ export const interlayTokensConfig: Record<
USDT: { name: "USDT", symbol: "USDT", decimals: 6, ed: "0" },
VDOT: { name: "VDOT", symbol: "VDOT", decimals: 10, ed: "0" },
BNC: { name: "BNC", symbol: "BNC", decimals: 12, ed: "0" },
HDX: { name: "HDX", symbol: "HDX", decimals: 12, ed: "0" },
},
kintsugi: {
KBTC: { name: "KBTC", symbol: "KBTC", decimals: 8, ed: "0" },
Expand Down Expand Up @@ -250,6 +260,7 @@ const INTERLAY_SUPPORTED_TOKENS: Record<string, unknown> = {
VDOT: { ForeignAsset: 3 },
BNC: { ForeignAsset: 11 },
USDC: { ForeignAsset: 12 },
HDX: { ForeignAsset: 13 },
};

const getSupportedTokens = (chainname: string): Record<string, unknown> => {
Expand Down

0 comments on commit 37448f9

Please sign in to comment.