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

Xcm #9

Merged
merged 6 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
312 changes: 312 additions & 0 deletions src/abi/xtokens_moonbeam_abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,312 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "currencyAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "destination",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "weight",
"type": "uint64"
}
],
"name": "transfer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "location",
"type": "tuple"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"internalType": "struct Xtokens.MultiAsset[]",
"name": "assets",
"type": "tuple[]"
},
{
"internalType": "uint32",
"name": "feeItem",
"type": "uint32"
},
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "destination",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "weight",
"type": "uint64"
}
],
"name": "transferMultiAssets",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "currencyAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"internalType": "struct Xtokens.Currency[]",
"name": "currencies",
"type": "tuple[]"
},
{
"internalType": "uint32",
"name": "feeItem",
"type": "uint32"
},
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "destination",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "weight",
"type": "uint64"
}
],
"name": "transferMultiCurrencies",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "asset",
"type": "tuple"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "destination",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "weight",
"type": "uint64"
}
],
"name": "transferMultiasset",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "asset",
"type": "tuple"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "destination",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "weight",
"type": "uint64"
}
],
"name": "transferMultiassetWithFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "currencyAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint8",
"name": "parents",
"type": "uint8"
},
{
"internalType": "bytes[]",
"name": "interior",
"type": "bytes[]"
}
],
"internalType": "struct Xtokens.Multilocation",
"name": "destination",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "weight",
"type": "uint64"
}
],
"name": "transferWithFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
29 changes: 29 additions & 0 deletions src/constants/assets.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
import { BN } from "bn.js";
import { BigNumber } from "ethers";
import { PARACHAINS } from "./chains";

export const REF_TIME = new BN("1000000000000");
export const PROOF_SIZE = new BN("1000000000000");

export const BigNumber0 = BigNumber.from(0);
export const BN0 = new BN("0");

export const defaultAssetConfig = {
[PARACHAINS.MOONBEAM]: [
{
address: "0xFfFFfFff1FcaCBd218EDc0EbA20Fc2308C778080",
symbol: "xcDOT",
decimals: 10,
},
{
address: "0xFfFFFfffA893AD19e540E172C10d78D4d479B5Cf",
symbol: "xcASTR",
decimals: 18,
},
],

[PARACHAINS.MOONRIVER]: [
{
address: "0xFfFFfFff1FcaCBd218EDc0EbA20Fc2308C778080",
symbol: "xcKSM",
decimals: 12,
},
{
address: "0xFFFfffFF0Ca324C842330521525E7De111F38972",
symbol: "xcSDN",
decimals: 18,
},
],
};
Loading