@paraspell/sdk 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -15
- package/dist/index.cjs +490 -111
- package/dist/index.d.ts +191 -153
- package/dist/index.mjs +490 -111
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,150 @@
|
|
|
1
1
|
import { ApiPromise } from '@polkadot/api';
|
|
2
2
|
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
3
3
|
|
|
4
|
+
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
5
|
+
interface PolkadotXCMTransferInput {
|
|
6
|
+
api: ApiPromise;
|
|
7
|
+
header: any;
|
|
8
|
+
addressSelection: any;
|
|
9
|
+
currencySelection: any;
|
|
10
|
+
scenario: TScenario;
|
|
11
|
+
currencySymbol: string | undefined;
|
|
12
|
+
feeAsset?: TCurrency;
|
|
13
|
+
serializedApiCallEnabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface XTokensTransferInput {
|
|
16
|
+
api: ApiPromise;
|
|
17
|
+
currency: string | undefined;
|
|
18
|
+
currencyID: string | undefined;
|
|
19
|
+
amount: string;
|
|
20
|
+
addressSelection: any;
|
|
21
|
+
fees: number;
|
|
22
|
+
scenario: TScenario;
|
|
23
|
+
origin: TNode;
|
|
24
|
+
destination?: TDestination;
|
|
25
|
+
paraIdTo?: number;
|
|
26
|
+
overridedCurrencyMultiLocation?: TMultiLocation;
|
|
27
|
+
feeAsset?: TCurrency;
|
|
28
|
+
serializedApiCallEnabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface XTransferTransferInput {
|
|
31
|
+
api: ApiPromise;
|
|
32
|
+
currency: string | undefined;
|
|
33
|
+
currencyID: string | undefined;
|
|
34
|
+
amount: string;
|
|
35
|
+
recipientAddress: TAddress;
|
|
36
|
+
origin: TNode;
|
|
37
|
+
paraId?: number;
|
|
38
|
+
destination?: TDestination;
|
|
39
|
+
overridedCurrencyMultiLocation?: TMultiLocation;
|
|
40
|
+
serializedApiCallEnabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface IPolkadotXCMTransfer {
|
|
43
|
+
transferPolkadotXCM: (input: PolkadotXCMTransferInput) => Extrinsic | TSerializedApiCall;
|
|
44
|
+
}
|
|
45
|
+
interface IXTokensTransfer {
|
|
46
|
+
transferXTokens: (input: XTokensTransferInput) => Extrinsic | TSerializedApiCall;
|
|
47
|
+
}
|
|
48
|
+
interface IXTransferTransfer {
|
|
49
|
+
transferXTransfer: (input: XTransferTransferInput) => Extrinsic | TSerializedApiCall;
|
|
50
|
+
}
|
|
51
|
+
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
52
|
+
declare enum Version {
|
|
53
|
+
V1 = "V1",
|
|
54
|
+
V2 = "V2",
|
|
55
|
+
V3 = "V3"
|
|
56
|
+
}
|
|
57
|
+
declare enum Parents {
|
|
58
|
+
ONE = 1,
|
|
59
|
+
ZERO = 0
|
|
60
|
+
}
|
|
61
|
+
type TAmount = string | number | bigint;
|
|
62
|
+
type TCurrency = string | number | bigint;
|
|
63
|
+
type TCurrencyInput = string | number | bigint | TMultiLocation;
|
|
64
|
+
type TAddress = string | TMultiLocation;
|
|
65
|
+
type TDestination = TNode | TMultiLocation;
|
|
66
|
+
interface TSendBaseOptions {
|
|
67
|
+
address: TAddress;
|
|
68
|
+
destination?: TDestination;
|
|
69
|
+
paraIdTo?: number;
|
|
70
|
+
feeAsset?: TCurrency;
|
|
71
|
+
destApiForKeepAlive?: ApiPromise;
|
|
72
|
+
}
|
|
73
|
+
interface TSendOptions extends TSendBaseOptions {
|
|
74
|
+
api?: ApiPromise;
|
|
75
|
+
origin: TNode;
|
|
76
|
+
currency: TCurrencyInput;
|
|
77
|
+
amount: TAmount;
|
|
78
|
+
}
|
|
79
|
+
interface TSendOptionsCommon extends TSendOptions {
|
|
80
|
+
serializedApiCallEnabled?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface TSendInternalOptions extends TSendBaseOptions {
|
|
83
|
+
api: ApiPromise;
|
|
84
|
+
currencySymbol: string | undefined;
|
|
85
|
+
currencyId: string | undefined;
|
|
86
|
+
amount: string;
|
|
87
|
+
overridedCurrencyMultiLocation?: TMultiLocation;
|
|
88
|
+
serializedApiCallEnabled?: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface TRelayToParaBaseOptions {
|
|
91
|
+
destination: TDestination;
|
|
92
|
+
address: TAddress;
|
|
93
|
+
paraIdTo?: number;
|
|
94
|
+
destApiForKeepAlive?: ApiPromise;
|
|
95
|
+
}
|
|
96
|
+
interface TRelayToParaOptions extends TRelayToParaBaseOptions {
|
|
97
|
+
api?: ApiPromise;
|
|
98
|
+
amount: TAmount;
|
|
99
|
+
}
|
|
100
|
+
interface TRelayToParaInternalOptions extends TRelayToParaBaseOptions {
|
|
101
|
+
api: ApiPromise;
|
|
102
|
+
amount: string;
|
|
103
|
+
}
|
|
104
|
+
interface TRelayToParaCommonOptions extends TRelayToParaOptions {
|
|
105
|
+
serializedApiCallEnabled?: boolean;
|
|
106
|
+
}
|
|
107
|
+
interface TCurrencySelection {
|
|
108
|
+
id: {
|
|
109
|
+
Concrete: TMultiLocation;
|
|
110
|
+
};
|
|
111
|
+
fun: {
|
|
112
|
+
Fungible: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
type TCurrencySelectionHeader = {
|
|
116
|
+
[key in Version]?: TCurrencySelection;
|
|
117
|
+
};
|
|
118
|
+
type TCurrencySelectionHeaderArr = {
|
|
119
|
+
[key in Version]?: [TCurrencySelection];
|
|
120
|
+
};
|
|
121
|
+
interface TSerializedApiCall {
|
|
122
|
+
module: string;
|
|
123
|
+
section: string;
|
|
124
|
+
parameters: any[];
|
|
125
|
+
}
|
|
126
|
+
interface CheckKeepAliveOptions {
|
|
127
|
+
originApi: ApiPromise;
|
|
128
|
+
address: string;
|
|
129
|
+
amount: string;
|
|
130
|
+
originNode?: TNode;
|
|
131
|
+
destApi?: ApiPromise;
|
|
132
|
+
currencySymbol?: string;
|
|
133
|
+
destNode?: TNode;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
type JunctionType = 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality' | 'GlobalConsensus';
|
|
4
137
|
type NetworkId = string | null;
|
|
5
138
|
type BodyId = string | null;
|
|
6
139
|
type BodyPart = string | null;
|
|
7
140
|
type StringOrNumber = string | number;
|
|
8
141
|
type HexString = string;
|
|
9
142
|
interface JunctionParachain {
|
|
10
|
-
Parachain: StringOrNumber;
|
|
143
|
+
Parachain: StringOrNumber | undefined;
|
|
11
144
|
}
|
|
12
145
|
interface JunctionAccountId32 {
|
|
13
146
|
AccountId32: {
|
|
14
|
-
network
|
|
147
|
+
network?: NetworkId;
|
|
15
148
|
id: HexString;
|
|
16
149
|
};
|
|
17
150
|
}
|
|
@@ -23,7 +156,7 @@ interface JunctionAccountIndex64 {
|
|
|
23
156
|
}
|
|
24
157
|
interface JunctionAccountKey20 {
|
|
25
158
|
AccountKey20: {
|
|
26
|
-
network
|
|
159
|
+
network?: NetworkId;
|
|
27
160
|
key: HexString;
|
|
28
161
|
};
|
|
29
162
|
}
|
|
@@ -51,34 +184,47 @@ interface JunctionPlurality {
|
|
|
51
184
|
interface JunctionGlobalConsensus {
|
|
52
185
|
GlobalConsensus: NetworkId;
|
|
53
186
|
}
|
|
54
|
-
type
|
|
187
|
+
type TJunction = JunctionParachain | JunctionAccountId32 | JunctionAccountIndex64 | JunctionAccountKey20 | JunctionPalletInstance | JunctionGeneralIndex | JunctionGeneralKey | JunctionOnlyChild | JunctionPlurality | JunctionGlobalConsensus;
|
|
55
188
|
interface Junctions {
|
|
56
|
-
X1?:
|
|
57
|
-
X2?: [
|
|
58
|
-
X3?: [
|
|
59
|
-
X4?: [
|
|
60
|
-
X5?: [
|
|
61
|
-
X6?: [
|
|
62
|
-
X7?: [
|
|
63
|
-
X8?: [
|
|
64
|
-
X9?: [
|
|
189
|
+
X1?: TJunction;
|
|
190
|
+
X2?: [TJunction, TJunction];
|
|
191
|
+
X3?: [TJunction, TJunction, TJunction];
|
|
192
|
+
X4?: [TJunction, TJunction, TJunction, TJunction];
|
|
193
|
+
X5?: [TJunction, TJunction, TJunction, TJunction, TJunction];
|
|
194
|
+
X6?: [TJunction, TJunction, TJunction, TJunction, TJunction, TJunction];
|
|
195
|
+
X7?: [TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction];
|
|
196
|
+
X8?: [TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction];
|
|
197
|
+
X9?: [
|
|
198
|
+
TJunction,
|
|
199
|
+
TJunction,
|
|
200
|
+
TJunction,
|
|
201
|
+
TJunction,
|
|
202
|
+
TJunction,
|
|
203
|
+
TJunction,
|
|
204
|
+
TJunction,
|
|
205
|
+
TJunction,
|
|
206
|
+
TJunction
|
|
207
|
+
];
|
|
65
208
|
X10?: [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
209
|
+
TJunction,
|
|
210
|
+
TJunction,
|
|
211
|
+
TJunction,
|
|
212
|
+
TJunction,
|
|
213
|
+
TJunction,
|
|
214
|
+
TJunction,
|
|
215
|
+
TJunction,
|
|
216
|
+
TJunction,
|
|
217
|
+
TJunction,
|
|
218
|
+
TJunction
|
|
76
219
|
];
|
|
77
220
|
}
|
|
78
221
|
interface TMultiLocation {
|
|
79
222
|
parents: StringOrNumber;
|
|
80
223
|
interior: Junctions;
|
|
81
224
|
}
|
|
225
|
+
type TMultiLocationHeader = {
|
|
226
|
+
[key in Version]?: TMultiLocation;
|
|
227
|
+
};
|
|
82
228
|
|
|
83
229
|
declare abstract class ParachainNode {
|
|
84
230
|
private readonly _node;
|
|
@@ -96,21 +242,21 @@ declare abstract class ParachainNode {
|
|
|
96
242
|
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
97
243
|
getProvider(): string;
|
|
98
244
|
createApiInstance(): Promise<ApiPromise>;
|
|
99
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version,
|
|
245
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _?: string, overridedMultiLocation?: TMultiLocation): any;
|
|
100
246
|
createPolkadotXcmHeader(scenario: TScenario, destination?: TDestination, paraId?: number): any;
|
|
101
247
|
}
|
|
102
248
|
|
|
103
|
-
declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial"];
|
|
104
|
-
declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "Polkadot", "Kusama"];
|
|
249
|
+
declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet"];
|
|
250
|
+
declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Polkadot", "Kusama"];
|
|
105
251
|
declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm", "XTransfer"];
|
|
106
252
|
|
|
107
|
-
type UpdateFunction = (name: string, index: number) => string;
|
|
108
|
-
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
109
|
-
type ExtrinsicFunction<T> = (arg: T) => Extrinsic;
|
|
110
|
-
type TRelayChainType = 'polkadot' | 'kusama';
|
|
111
|
-
type TRelayChainSymbol = 'DOT' | 'KSM';
|
|
112
253
|
type TNode = (typeof NODE_NAMES)[number];
|
|
113
254
|
type TNodeWithRelayChains = (typeof NODES_WITH_RELAY_CHAINS)[number];
|
|
255
|
+
type TNodeToAssetModuleMap = Record<TNode, string | null>;
|
|
256
|
+
|
|
257
|
+
type TRelayChainType = 'polkadot' | 'kusama';
|
|
258
|
+
type TRelayChainSymbol = 'DOT' | 'KSM';
|
|
259
|
+
|
|
114
260
|
interface TAssetDetails {
|
|
115
261
|
assetId: string;
|
|
116
262
|
symbol?: string;
|
|
@@ -129,104 +275,14 @@ interface TNodeAssets {
|
|
|
129
275
|
otherAssets: TAssetDetails[];
|
|
130
276
|
}
|
|
131
277
|
type TAssetJsonMap = Record<TNode, TNodeAssets>;
|
|
132
|
-
|
|
278
|
+
|
|
133
279
|
type TPallet = (typeof SUPPORTED_PALLETS)[number];
|
|
134
280
|
interface TPalletMap {
|
|
135
281
|
defaultPallet: TPallet;
|
|
136
282
|
supportedPallets: TPallet[];
|
|
137
283
|
}
|
|
138
284
|
type TPalletJsonMap = Record<TNode, TPalletMap>;
|
|
139
|
-
|
|
140
|
-
interface TSerializedApiCall {
|
|
141
|
-
module: string;
|
|
142
|
-
section: string;
|
|
143
|
-
parameters: any[];
|
|
144
|
-
}
|
|
145
|
-
interface XTokensTransferInput {
|
|
146
|
-
api: ApiPromise;
|
|
147
|
-
currency: string | undefined;
|
|
148
|
-
currencyID: string | undefined;
|
|
149
|
-
amount: string;
|
|
150
|
-
addressSelection: any;
|
|
151
|
-
fees: number;
|
|
152
|
-
scenario: TScenario;
|
|
153
|
-
origin: TNode;
|
|
154
|
-
destination?: TDestination;
|
|
155
|
-
paraIdTo?: number;
|
|
156
|
-
overridedCurrencyMultiLocation?: TMultiLocation;
|
|
157
|
-
serializedApiCallEnabled?: boolean;
|
|
158
|
-
}
|
|
159
|
-
interface XTransferTransferInput {
|
|
160
|
-
api: ApiPromise;
|
|
161
|
-
currency: string | undefined;
|
|
162
|
-
currencyID: string | undefined;
|
|
163
|
-
amount: string;
|
|
164
|
-
recipientAddress: TAddress;
|
|
165
|
-
origin: TNode;
|
|
166
|
-
paraId?: number;
|
|
167
|
-
destination?: TDestination;
|
|
168
|
-
overridedCurrencyMultiLocation?: TMultiLocation;
|
|
169
|
-
serializedApiCallEnabled?: boolean;
|
|
170
|
-
}
|
|
171
|
-
interface IXTokensTransfer {
|
|
172
|
-
transferXTokens: (input: XTokensTransferInput) => Extrinsic | TSerializedApiCall;
|
|
173
|
-
}
|
|
174
|
-
interface IXTransferTransfer {
|
|
175
|
-
transferXTransfer: (input: XTransferTransferInput) => Extrinsic | TSerializedApiCall;
|
|
176
|
-
}
|
|
177
|
-
interface PolkadotXCMTransferInput {
|
|
178
|
-
api: ApiPromise;
|
|
179
|
-
header: any;
|
|
180
|
-
addressSelection: any;
|
|
181
|
-
currencySelection: any;
|
|
182
|
-
scenario: TScenario;
|
|
183
|
-
currencySymbol: string | undefined;
|
|
184
|
-
serializedApiCallEnabled?: boolean;
|
|
185
|
-
}
|
|
186
|
-
type TAmount = string | number | bigint;
|
|
187
|
-
type TCurrency = string | number | bigint | TMultiLocation;
|
|
188
|
-
type TAddress = string | TMultiLocation;
|
|
189
|
-
type TDestination = TNode | TMultiLocation;
|
|
190
|
-
interface TSendBaseOptions {
|
|
191
|
-
address: TAddress;
|
|
192
|
-
destination?: TDestination;
|
|
193
|
-
paraIdTo?: number;
|
|
194
|
-
destApiForKeepAlive?: ApiPromise;
|
|
195
|
-
}
|
|
196
|
-
interface TSendOptions extends TSendBaseOptions {
|
|
197
|
-
api?: ApiPromise;
|
|
198
|
-
origin: TNode;
|
|
199
|
-
currency: TCurrency;
|
|
200
|
-
amount: TAmount;
|
|
201
|
-
}
|
|
202
|
-
interface TSendOptionsCommon extends TSendOptions {
|
|
203
|
-
serializedApiCallEnabled?: boolean;
|
|
204
|
-
}
|
|
205
|
-
interface TSendInternalOptions extends TSendBaseOptions {
|
|
206
|
-
api: ApiPromise;
|
|
207
|
-
currencySymbol: string | undefined;
|
|
208
|
-
currencyId: string | undefined;
|
|
209
|
-
amount: string;
|
|
210
|
-
overridedCurrencyMultiLocation?: TMultiLocation;
|
|
211
|
-
serializedApiCallEnabled?: boolean;
|
|
212
|
-
}
|
|
213
|
-
interface TRelayToParaBaseOptions {
|
|
214
|
-
destination: TDestination;
|
|
215
|
-
address: TAddress;
|
|
216
|
-
paraIdTo?: number;
|
|
217
|
-
destApiForKeepAlive?: ApiPromise;
|
|
218
|
-
}
|
|
219
|
-
interface TRelayToParaOptions extends TRelayToParaBaseOptions {
|
|
220
|
-
api?: ApiPromise;
|
|
221
|
-
amount: TAmount;
|
|
222
|
-
}
|
|
223
|
-
interface TRelayToParaInternalOptions extends TRelayToParaBaseOptions {
|
|
224
|
-
api: ApiPromise;
|
|
225
|
-
amount: string;
|
|
226
|
-
}
|
|
227
|
-
interface TRelayToParaCommonOptions extends TRelayToParaOptions {
|
|
228
|
-
serializedApiCallEnabled?: boolean;
|
|
229
|
-
}
|
|
285
|
+
|
|
230
286
|
interface TOpenChannelOptions {
|
|
231
287
|
api: ApiPromise;
|
|
232
288
|
origin: TNode;
|
|
@@ -234,9 +290,6 @@ interface TOpenChannelOptions {
|
|
|
234
290
|
maxSize: number;
|
|
235
291
|
maxMessageSize: number;
|
|
236
292
|
}
|
|
237
|
-
interface TOpenChannelInternalOptions extends TOpenChannelOptions {
|
|
238
|
-
serializedApiCallEnabled?: boolean;
|
|
239
|
-
}
|
|
240
293
|
interface TCloseChannelOptions {
|
|
241
294
|
api: ApiPromise;
|
|
242
295
|
origin: TNode;
|
|
@@ -246,33 +299,12 @@ interface TCloseChannelOptions {
|
|
|
246
299
|
interface TCloseChannelInternalOptions extends TCloseChannelOptions {
|
|
247
300
|
serializedApiCallEnabled?: boolean;
|
|
248
301
|
}
|
|
249
|
-
interface
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
declare enum Version {
|
|
253
|
-
V1 = "V1",
|
|
254
|
-
V3 = "V3"
|
|
255
|
-
}
|
|
256
|
-
declare enum Parents {
|
|
257
|
-
ONE = 1,
|
|
258
|
-
ZERO = 0
|
|
259
|
-
}
|
|
260
|
-
type PolkadotXCMHeader = {
|
|
261
|
-
[K in Version]?: {
|
|
262
|
-
parents: Parents;
|
|
263
|
-
interior: any;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
interface CheckKeepAliveOptions {
|
|
267
|
-
originApi: ApiPromise;
|
|
268
|
-
address: string;
|
|
269
|
-
amount: string;
|
|
270
|
-
originNode?: TNode;
|
|
271
|
-
destApi?: ApiPromise;
|
|
272
|
-
currencySymbol?: string;
|
|
273
|
-
destNode?: TNode;
|
|
302
|
+
interface TOpenChannelInternalOptions extends TOpenChannelOptions {
|
|
303
|
+
serializedApiCallEnabled?: boolean;
|
|
274
304
|
}
|
|
275
305
|
|
|
306
|
+
type TEdJsonMap = Record<TNodeWithRelayChains, string | null>;
|
|
307
|
+
|
|
276
308
|
declare const sendSerializedApiCall: (options: TSendOptions) => Promise<TSerializedApiCall>;
|
|
277
309
|
declare const send: (options: TSendOptions) => Promise<Extrinsic>;
|
|
278
310
|
declare const transferRelayToParaCommon: (options: TRelayToParaCommonOptions) => Promise<Extrinsic | TSerializedApiCall | never>;
|
|
@@ -354,14 +386,16 @@ declare class ToGeneralBuilder {
|
|
|
354
386
|
private readonly to;
|
|
355
387
|
private readonly paraIdTo?;
|
|
356
388
|
constructor(api: ApiPromise | undefined, from: TNode, to: TDestination, paraIdTo?: number);
|
|
357
|
-
currency(currency:
|
|
389
|
+
currency(currency: TCurrencyInput): AmountOrFeeAssetBuilder;
|
|
358
390
|
openChannel(): MaxSizeOpenChannelBuilder;
|
|
359
391
|
}
|
|
360
392
|
declare class FromGeneralBuilder {
|
|
361
393
|
private readonly api?;
|
|
362
394
|
private readonly from;
|
|
395
|
+
private _feeAsset?;
|
|
363
396
|
constructor(api: ApiPromise | undefined, from: TNode);
|
|
364
397
|
to(node: TDestination, paraIdTo?: number): ToGeneralBuilder;
|
|
398
|
+
feeAsset(feeAsset: TCurrency): AmountBuilder;
|
|
365
399
|
amount(amount: TAmount): AddressBuilder;
|
|
366
400
|
closeChannel(): InboundCloseChannelBuilder;
|
|
367
401
|
}
|
|
@@ -387,6 +421,10 @@ interface AddressBuilder {
|
|
|
387
421
|
interface AmountBuilder {
|
|
388
422
|
amount: (amount: TAmount) => AddressBuilder;
|
|
389
423
|
}
|
|
424
|
+
interface AmountOrFeeAssetBuilder {
|
|
425
|
+
amount: (amount: TAmount) => AddressBuilder;
|
|
426
|
+
feeAsset: (feeAsset: TCurrencyInput) => AmountBuilder;
|
|
427
|
+
}
|
|
390
428
|
|
|
391
429
|
declare const getNode: (node: TNode) => ParachainNode;
|
|
392
430
|
declare const getNodeEndpointOption: (node: TNode) => any;
|
|
@@ -416,4 +454,4 @@ declare class IncompatibleNodesError extends Error {
|
|
|
416
454
|
|
|
417
455
|
declare const getExistentialDeposit: (node: TNodeWithRelayChains) => string | null;
|
|
418
456
|
|
|
419
|
-
export { Builder, type CheckKeepAliveOptions, type Extrinsic, type
|
|
457
|
+
export { Builder, type CheckKeepAliveOptions, type Extrinsic, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionType, NODES_WITH_RELAY_CHAINS, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAssetDetails, type TAssetJsonMap, type TCloseChannelInternalOptions, type TCloseChannelOptions, type TCurrency, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TDestination, type TEdJsonMap, type TJunction, type TMultiLocation, type TMultiLocationHeader, type TNativeAssetDetails, type TNode, type TNodeAssets, type TNodeToAssetModuleMap, type TNodeWithRelayChains, type TOpenChannelInternalOptions, type TOpenChannelOptions, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaCommonOptions, type TRelayToParaInternalOptions, type TRelayToParaOptions, type TScenario, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSendOptionsCommon, type TSerializedApiCall, Version, type XTokensTransferInput, type XTransferTransferInput, index as assets, index$1 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getExistentialDeposit, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$2 as openChannels, index$3 as xcmPallet };
|