@galacticcouncil/xc-cfg 0.1.0 → 0.3.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/build/index.cjs +1 -1
- package/build/index.mjs +1 -1
- package/build/types/builders/ExtrinsicBuilder.d.ts +1 -8
- package/build/types/builders/extrinsics/utility.d.ts +1 -1
- package/build/types/builders/extrinsics/xcm/builder/buildERC20TransferFromPara.d.ts +2 -131
- package/build/types/builders/extrinsics/xcm/builder/buildParaERC20Received.d.ts +2 -76
- package/build/types/builders/extrinsics/xcm/builder/const.d.ts +6 -1
- package/build/types/builders/extrinsics/xcm/index.d.ts +0 -1
- package/build/types/builders/extrinsics/xcm/polkadotXcm.utils.d.ts +174 -228
- package/build/types/builders/extrinsics/xcm/types.d.ts +0 -4
- package/build/types/builders/extrinsics/xcm/utils/account.d.ts +16 -10
- package/build/types/builders/extrinsics/xcm/utils/guard.d.ts +1 -3
- package/build/types/builders/extrinsics/xcm/utils/instructions.d.ts +22 -36
- package/build/types/builders/extrinsics/xcm/utils/location.d.ts +5 -7
- package/build/types/builders/extrinsics/xcm/xTokens.utils.d.ts +17 -5
- package/build/types/builders/extrinsics/xcm/xTransfer.utils.d.ts +9 -2
- package/build/types/chains/polkadot/index.d.ts +1 -3
- package/build/types/clients/base.d.ts +9 -4
- package/build/types/clients/chain/assethub.d.ts +3 -3
- package/build/types/clients/chain/hydration.d.ts +4 -1
- package/package.json +3 -3
- package/build/types/builders/extrinsics/xcm/xcmPallet.d.ts +0 -11
- package/build/types/builders/extrinsics/xcm/xcmPallet.utils.d.ts +0 -24
- package/build/types/chains/polkadot/nodle.d.ts +0 -2
- package/build/types/chains/polkadot/phala.d.ts +0 -2
- package/build/types/configs/polkadot/nodle.d.ts +0 -2
- package/build/types/configs/polkadot/phala.d.ts +0 -2
- package/build/types/utils/xcm-encoder.d.ts +0 -86
|
@@ -1,66 +1,86 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Parachain, TxWeight } from '@galacticcouncil/xc-core';
|
|
2
|
+
import { Binary } from 'polkadot-api';
|
|
3
|
+
import { XcmV3Junctions, XcmV3Junction, XcmV3MultiassetFungibility, XcmV4Instruction, XcmV4AssetAssetFilter, XcmV3WeightLimit, XcmV2OriginKind } from '@galacticcouncil/descriptors';
|
|
2
4
|
import { XcmTransferType, XcmVersion } from './types';
|
|
3
5
|
export declare const toDest: (version: XcmVersion, source: Parachain, destination: Parachain) => {
|
|
4
|
-
|
|
6
|
+
type: XcmVersion;
|
|
7
|
+
value: {
|
|
5
8
|
parents: number;
|
|
6
9
|
interior: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Parachain: number;
|
|
12
|
-
GlobalConsensus?: undefined;
|
|
13
|
-
})[];
|
|
10
|
+
type: "X2";
|
|
11
|
+
value: import("polkadot-api").FixedSizeArray<2, XcmV3Junction>;
|
|
12
|
+
} & {
|
|
13
|
+
type: "X2";
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
} | {
|
|
17
|
-
|
|
17
|
+
type: XcmVersion;
|
|
18
|
+
value: {
|
|
18
19
|
parents: number;
|
|
19
|
-
interior:
|
|
20
|
+
interior: {
|
|
21
|
+
type: "Here";
|
|
22
|
+
value: undefined;
|
|
23
|
+
} & {
|
|
24
|
+
type: "Here";
|
|
25
|
+
};
|
|
20
26
|
};
|
|
21
27
|
} | {
|
|
22
|
-
|
|
28
|
+
type: XcmVersion;
|
|
29
|
+
value: {
|
|
23
30
|
parents: number;
|
|
24
31
|
interior: {
|
|
25
|
-
|
|
32
|
+
type: "X1";
|
|
33
|
+
value: XcmV3Junction;
|
|
34
|
+
} & {
|
|
35
|
+
type: "X1";
|
|
26
36
|
};
|
|
27
37
|
};
|
|
28
38
|
};
|
|
29
39
|
export declare const toBeneficiary: (version: XcmVersion, account: any) => {
|
|
30
|
-
|
|
40
|
+
type: XcmVersion;
|
|
41
|
+
value: {
|
|
31
42
|
parents: number;
|
|
32
43
|
interior: {
|
|
33
|
-
|
|
44
|
+
type: "X1";
|
|
45
|
+
value: XcmV3Junction;
|
|
46
|
+
} & {
|
|
47
|
+
type: "X1";
|
|
34
48
|
};
|
|
35
49
|
};
|
|
36
50
|
};
|
|
37
|
-
export declare const toTransferType: (version: XcmVersion, type: XcmTransferType, assetLocation: any) =>
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
export declare const toTransferType: (version: XcmVersion, type: XcmTransferType, assetLocation: any) => {
|
|
52
|
+
type: string;
|
|
53
|
+
value: {
|
|
54
|
+
type: XcmVersion;
|
|
55
|
+
value: any;
|
|
40
56
|
};
|
|
57
|
+
} | {
|
|
58
|
+
type: XcmTransferType.Teleport | XcmTransferType.LocalReserve | XcmTransferType.DestinationReserve;
|
|
59
|
+
value?: undefined;
|
|
41
60
|
};
|
|
42
61
|
export declare const toAsset: (assetLocation: object, amount: any) => {
|
|
43
62
|
id: object;
|
|
44
63
|
fun: {
|
|
45
|
-
|
|
64
|
+
type: "Fungible";
|
|
65
|
+
value: bigint;
|
|
66
|
+
} & {
|
|
67
|
+
type: "Fungible";
|
|
46
68
|
};
|
|
47
69
|
};
|
|
48
70
|
export declare const toDepositXcmOnDest: (version: XcmVersion, account: any) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
};
|
|
71
|
+
type: XcmVersion;
|
|
72
|
+
value: ({
|
|
73
|
+
type: "DepositAsset";
|
|
74
|
+
value: {
|
|
75
|
+
assets: XcmV4AssetAssetFilter;
|
|
56
76
|
beneficiary: {
|
|
57
77
|
parents: number;
|
|
58
|
-
interior:
|
|
59
|
-
X1: any;
|
|
60
|
-
};
|
|
78
|
+
interior: XcmV3Junctions;
|
|
61
79
|
};
|
|
62
80
|
};
|
|
63
|
-
}
|
|
81
|
+
} & {
|
|
82
|
+
type: "DepositAsset";
|
|
83
|
+
})[];
|
|
64
84
|
};
|
|
65
85
|
/**
|
|
66
86
|
* Instructions are executed in 2 steps:
|
|
@@ -74,98 +94,34 @@ export declare const toDepositXcmOnDest: (version: XcmVersion, account: any) =>
|
|
|
74
94
|
* @param transferAssetLocation - transfer asset xcm location
|
|
75
95
|
* @returns xcm ethereum bridge instructions
|
|
76
96
|
*/
|
|
77
|
-
export declare const toBridgeXcmOnDest: (version: XcmVersion, account: any, sender: any, transferAssetLocation:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
assets: {
|
|
97
|
-
Wild: {
|
|
98
|
-
AllOf: {
|
|
99
|
-
id: object;
|
|
100
|
-
fun: string;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
};
|
|
97
|
+
export declare const toBridgeXcmOnDest: (version: XcmVersion, account: any, sender: any, transferAssetLocation: {
|
|
98
|
+
parents: number;
|
|
99
|
+
interior: XcmV3Junctions;
|
|
100
|
+
}, messageId: any) => {
|
|
101
|
+
type: XcmVersion;
|
|
102
|
+
value: (({
|
|
103
|
+
type: "SetTopic";
|
|
104
|
+
value: import("polkadot-api").FixedSizeBinary<32>;
|
|
105
|
+
} & {
|
|
106
|
+
type: "SetTopic";
|
|
107
|
+
}) | ({
|
|
108
|
+
type: "SetAppendix";
|
|
109
|
+
value: XcmV4Instruction[];
|
|
110
|
+
} & {
|
|
111
|
+
type: "SetAppendix";
|
|
112
|
+
}) | ({
|
|
113
|
+
type: "InitiateReserveWithdraw";
|
|
114
|
+
value: {
|
|
115
|
+
assets: XcmV4AssetAssetFilter;
|
|
104
116
|
reserve: {
|
|
105
117
|
parents: number;
|
|
106
|
-
interior:
|
|
107
|
-
X1: {
|
|
108
|
-
GlobalConsensus: {
|
|
109
|
-
Ethereum: {
|
|
110
|
-
chain_id: number;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
}[];
|
|
114
|
-
};
|
|
118
|
+
interior: XcmV3Junctions;
|
|
115
119
|
};
|
|
116
|
-
xcm:
|
|
117
|
-
BuyExecution: {
|
|
118
|
-
fees: {
|
|
119
|
-
id: {
|
|
120
|
-
parents: number;
|
|
121
|
-
interior: {
|
|
122
|
-
X1: any;
|
|
123
|
-
Here?: undefined;
|
|
124
|
-
};
|
|
125
|
-
} | {
|
|
126
|
-
parents: number;
|
|
127
|
-
interior: {
|
|
128
|
-
Here: null;
|
|
129
|
-
X1?: undefined;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
fun: {
|
|
133
|
-
Fungible: number;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
weightLimit: string;
|
|
137
|
-
};
|
|
138
|
-
DepositAsset?: undefined;
|
|
139
|
-
SetTopic?: undefined;
|
|
140
|
-
} | {
|
|
141
|
-
DepositAsset: {
|
|
142
|
-
assets: {
|
|
143
|
-
Wild: {
|
|
144
|
-
AllCounted: number;
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
beneficiary: {
|
|
148
|
-
parents: number;
|
|
149
|
-
interior: {
|
|
150
|
-
X1: any;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
BuyExecution?: undefined;
|
|
155
|
-
SetTopic?: undefined;
|
|
156
|
-
} | {
|
|
157
|
-
SetTopic: string | undefined;
|
|
158
|
-
BuyExecution?: undefined;
|
|
159
|
-
DepositAsset?: undefined;
|
|
160
|
-
})[];
|
|
120
|
+
xcm: XcmV4Instruction[];
|
|
161
121
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
SetTopic: string | undefined;
|
|
166
|
-
SetAppendix?: undefined;
|
|
167
|
-
InitiateReserveWithdraw?: undefined;
|
|
168
|
-
})[];
|
|
122
|
+
} & {
|
|
123
|
+
type: "InitiateReserveWithdraw";
|
|
124
|
+
}))[];
|
|
169
125
|
};
|
|
170
126
|
/**
|
|
171
127
|
* Instructions are executed in 3 steps:
|
|
@@ -185,138 +141,128 @@ export declare const toBridgeXcmOnDest: (version: XcmVersion, account: any, send
|
|
|
185
141
|
* @param transactWeight - transact weight
|
|
186
142
|
* @returns xcm transact message instructions
|
|
187
143
|
*/
|
|
188
|
-
export declare const toTransactMessage: (version: XcmVersion, account: any, transactFeeLocation:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
BuyExecution?: undefined;
|
|
197
|
-
Transact?: undefined;
|
|
198
|
-
RefundSurplus?: undefined;
|
|
199
|
-
DepositAsset?: undefined;
|
|
200
|
-
} | {
|
|
201
|
-
BuyExecution: {
|
|
144
|
+
export declare const toTransactMessage: (version: XcmVersion, account: any, transactFeeLocation: {
|
|
145
|
+
parents: number;
|
|
146
|
+
interior: XcmV3Junctions;
|
|
147
|
+
}, transactFeeAmount: any, transactCall: Binary, transactWeight: TxWeight) => {
|
|
148
|
+
type: XcmVersion;
|
|
149
|
+
value: (({
|
|
150
|
+
type: "BuyExecution";
|
|
151
|
+
value: {
|
|
202
152
|
fees: {
|
|
203
|
-
id:
|
|
204
|
-
|
|
205
|
-
|
|
153
|
+
id: {
|
|
154
|
+
parents: number;
|
|
155
|
+
interior: XcmV3Junctions;
|
|
206
156
|
};
|
|
157
|
+
fun: XcmV3MultiassetFungibility;
|
|
207
158
|
};
|
|
208
|
-
|
|
209
|
-
};
|
|
210
|
-
WithdrawAsset?: undefined;
|
|
211
|
-
Transact?: undefined;
|
|
212
|
-
RefundSurplus?: undefined;
|
|
213
|
-
DepositAsset?: undefined;
|
|
214
|
-
} | {
|
|
215
|
-
Transact: {
|
|
216
|
-
originKind: string;
|
|
217
|
-
requireWeightAtMost: TxWeight;
|
|
218
|
-
call: {
|
|
219
|
-
encoded: `0x${string}`;
|
|
220
|
-
};
|
|
159
|
+
weight_limit: XcmV3WeightLimit;
|
|
221
160
|
};
|
|
222
|
-
|
|
223
|
-
BuyExecution
|
|
224
|
-
|
|
225
|
-
DepositAsset
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
WithdrawAsset?: undefined;
|
|
229
|
-
BuyExecution?: undefined;
|
|
230
|
-
Transact?: undefined;
|
|
231
|
-
DepositAsset?: undefined;
|
|
232
|
-
} | {
|
|
233
|
-
DepositAsset: {
|
|
234
|
-
assets: {
|
|
235
|
-
Wild: {
|
|
236
|
-
AllCounted: number;
|
|
237
|
-
};
|
|
238
|
-
};
|
|
161
|
+
} & {
|
|
162
|
+
type: "BuyExecution";
|
|
163
|
+
}) | ({
|
|
164
|
+
type: "DepositAsset";
|
|
165
|
+
value: {
|
|
166
|
+
assets: XcmV4AssetAssetFilter;
|
|
239
167
|
beneficiary: {
|
|
240
168
|
parents: number;
|
|
241
|
-
interior:
|
|
242
|
-
X1: any;
|
|
243
|
-
};
|
|
169
|
+
interior: XcmV3Junctions;
|
|
244
170
|
};
|
|
245
171
|
};
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
WithdrawAsset: {
|
|
255
|
-
id: object;
|
|
256
|
-
fun: {
|
|
257
|
-
Fungible: any;
|
|
172
|
+
} & {
|
|
173
|
+
type: "DepositAsset";
|
|
174
|
+
}) | ({
|
|
175
|
+
type: "WithdrawAsset";
|
|
176
|
+
value: {
|
|
177
|
+
id: {
|
|
178
|
+
parents: number;
|
|
179
|
+
interior: XcmV3Junctions;
|
|
258
180
|
};
|
|
181
|
+
fun: XcmV3MultiassetFungibility;
|
|
259
182
|
}[];
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
183
|
+
} & {
|
|
184
|
+
type: "WithdrawAsset";
|
|
185
|
+
}) | ({
|
|
186
|
+
type: "Transact";
|
|
187
|
+
value: {
|
|
188
|
+
origin_kind: XcmV2OriginKind;
|
|
189
|
+
require_weight_at_most: {
|
|
190
|
+
ref_time: bigint;
|
|
191
|
+
proof_size: bigint;
|
|
192
|
+
};
|
|
193
|
+
call: Binary;
|
|
194
|
+
};
|
|
195
|
+
} & {
|
|
196
|
+
type: "Transact";
|
|
197
|
+
}) | ({
|
|
198
|
+
type: "RefundSurplus";
|
|
199
|
+
value: undefined;
|
|
200
|
+
} & {
|
|
201
|
+
type: "RefundSurplus";
|
|
202
|
+
}))[];
|
|
203
|
+
};
|
|
204
|
+
export declare const toTransferMessage: (version: XcmVersion, account: any, transferAssetLocation: {
|
|
205
|
+
parents: number;
|
|
206
|
+
interior: XcmV3Junctions;
|
|
207
|
+
}, transferAssetAmount: any, transferFeeAmount: any, receiver: any) => {
|
|
208
|
+
type: XcmVersion;
|
|
209
|
+
value: (({
|
|
210
|
+
type: "BuyExecution";
|
|
211
|
+
value: {
|
|
266
212
|
fees: {
|
|
267
|
-
id:
|
|
268
|
-
|
|
269
|
-
|
|
213
|
+
id: {
|
|
214
|
+
parents: number;
|
|
215
|
+
interior: XcmV3Junctions;
|
|
270
216
|
};
|
|
217
|
+
fun: XcmV3MultiassetFungibility;
|
|
271
218
|
};
|
|
272
|
-
|
|
219
|
+
weight_limit: XcmV3WeightLimit;
|
|
273
220
|
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
DepositAsset
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
assets: {
|
|
281
|
-
id: object;
|
|
282
|
-
fun: {
|
|
283
|
-
Fungible: any;
|
|
284
|
-
};
|
|
285
|
-
}[];
|
|
221
|
+
} & {
|
|
222
|
+
type: "BuyExecution";
|
|
223
|
+
}) | ({
|
|
224
|
+
type: "DepositAsset";
|
|
225
|
+
value: {
|
|
226
|
+
assets: XcmV4AssetAssetFilter;
|
|
286
227
|
beneficiary: {
|
|
287
228
|
parents: number;
|
|
288
|
-
interior:
|
|
289
|
-
X1: any;
|
|
290
|
-
};
|
|
229
|
+
interior: XcmV3Junctions;
|
|
291
230
|
};
|
|
292
231
|
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
232
|
+
} & {
|
|
233
|
+
type: "DepositAsset";
|
|
234
|
+
}) | ({
|
|
235
|
+
type: "WithdrawAsset";
|
|
236
|
+
value: {
|
|
237
|
+
id: {
|
|
238
|
+
parents: number;
|
|
239
|
+
interior: XcmV3Junctions;
|
|
240
|
+
};
|
|
241
|
+
fun: XcmV3MultiassetFungibility;
|
|
242
|
+
}[];
|
|
243
|
+
} & {
|
|
244
|
+
type: "WithdrawAsset";
|
|
245
|
+
}) | ({
|
|
246
|
+
type: "RefundSurplus";
|
|
247
|
+
value: undefined;
|
|
248
|
+
} & {
|
|
249
|
+
type: "RefundSurplus";
|
|
250
|
+
}) | ({
|
|
251
|
+
type: "TransferAsset";
|
|
252
|
+
value: {
|
|
305
253
|
assets: {
|
|
306
|
-
|
|
307
|
-
|
|
254
|
+
id: {
|
|
255
|
+
parents: number;
|
|
256
|
+
interior: XcmV3Junctions;
|
|
308
257
|
};
|
|
309
|
-
|
|
258
|
+
fun: XcmV3MultiassetFungibility;
|
|
259
|
+
}[];
|
|
310
260
|
beneficiary: {
|
|
311
261
|
parents: number;
|
|
312
|
-
interior:
|
|
313
|
-
X1: any;
|
|
314
|
-
};
|
|
262
|
+
interior: XcmV3Junctions;
|
|
315
263
|
};
|
|
316
264
|
};
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
RefundSurplus?: undefined;
|
|
321
|
-
})[];
|
|
265
|
+
} & {
|
|
266
|
+
type: "TransferAsset";
|
|
267
|
+
}))[];
|
|
322
268
|
};
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Parachain } from '@galacticcouncil/xc-core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { FixedSizeBinary } from 'polkadot-api';
|
|
3
|
+
export declare function getExtrinsicAccount(address: string): ({
|
|
4
|
+
type: "AccountKey20";
|
|
5
|
+
value: {
|
|
6
|
+
network?: import("@galacticcouncil/descriptors").XcmV3JunctionNetworkId | undefined;
|
|
7
|
+
key: FixedSizeBinary<20>;
|
|
5
8
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
} & {
|
|
10
|
+
type: "AccountKey20";
|
|
11
|
+
}) | ({
|
|
12
|
+
type: "AccountId32";
|
|
13
|
+
value: {
|
|
14
|
+
network?: import("@galacticcouncil/descriptors").XcmV3JunctionNetworkId | undefined;
|
|
15
|
+
id: FixedSizeBinary<32>;
|
|
11
16
|
};
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
} & {
|
|
18
|
+
type: "AccountId32";
|
|
19
|
+
});
|
|
14
20
|
export declare function getDerivativeAccount(from: Parachain, fromAddress: string, to: Parachain): string;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { Asset, Parachain } from '@galacticcouncil/xc-core';
|
|
2
|
-
export declare function locationOrError(chain: Parachain, asset: Asset):
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
};
|
|
2
|
+
export declare function locationOrError(chain: Parachain, asset: Asset): import("@galacticcouncil/xc-core").XcmLocation;
|
|
@@ -1,65 +1,51 @@
|
|
|
1
|
+
import { XcmV3Junction } from '@galacticcouncil/descriptors';
|
|
1
2
|
export declare const ETHER_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2
3
|
export declare function bridgeLocation(ethChainId: number): {
|
|
3
4
|
parents: number;
|
|
4
5
|
interior: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
}[];
|
|
6
|
+
type: "X1";
|
|
7
|
+
value: XcmV3Junction;
|
|
8
|
+
} & {
|
|
9
|
+
type: "X1";
|
|
12
10
|
};
|
|
13
11
|
};
|
|
14
12
|
export declare function parachainLocation(paraId: number): {
|
|
15
13
|
parents: number;
|
|
16
14
|
interior: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
type: "X1";
|
|
16
|
+
value: XcmV3Junction;
|
|
17
|
+
} & {
|
|
18
|
+
type: "X1";
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
21
|
export declare function erc20Location(ethChainId: number, tokenAddress: string): {
|
|
23
22
|
parents: number;
|
|
24
23
|
interior: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
}[];
|
|
24
|
+
type: "X1";
|
|
25
|
+
value: XcmV3Junction;
|
|
26
|
+
} & {
|
|
27
|
+
type: "X1";
|
|
32
28
|
};
|
|
33
29
|
} | {
|
|
34
30
|
parents: number;
|
|
35
31
|
interior: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
} | {
|
|
43
|
-
AccountKey20: {
|
|
44
|
-
key: string;
|
|
45
|
-
};
|
|
46
|
-
})[];
|
|
32
|
+
type: "X2";
|
|
33
|
+
value: import("polkadot-api").FixedSizeArray<2, XcmV3Junction>;
|
|
34
|
+
} & {
|
|
35
|
+
type: "X2";
|
|
47
36
|
};
|
|
48
37
|
};
|
|
49
38
|
export declare function erc20LocationReanchored(tokenAddress: string): {
|
|
50
39
|
parents: number;
|
|
51
40
|
interior: {
|
|
52
|
-
|
|
53
|
-
X1?: undefined;
|
|
41
|
+
type: string;
|
|
54
42
|
};
|
|
55
43
|
} | {
|
|
56
44
|
parents: number;
|
|
57
45
|
interior: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}[];
|
|
63
|
-
here?: undefined;
|
|
46
|
+
type: "X1";
|
|
47
|
+
value: XcmV3Junction;
|
|
48
|
+
} & {
|
|
49
|
+
type: "X1";
|
|
64
50
|
};
|
|
65
51
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { XcmVersion } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Normalizes an asset location to the specified XCM version format
|
|
4
4
|
*
|
|
5
5
|
* @param assetLocation - asset xcm location
|
|
6
|
-
* @param version - xcm version
|
|
7
|
-
* @returns normalized
|
|
6
|
+
* @param version - target xcm version
|
|
7
|
+
* @returns normalized location
|
|
8
8
|
*/
|
|
9
|
-
export declare function getExtrinsicAssetLocation(assetLocation: Record<string, any>, version: XcmVersion):
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
export declare function getX1Junction(version: XcmVersion, junction: any): any;
|
|
9
|
+
export declare function getExtrinsicAssetLocation(assetLocation: Record<string, any>, version: XcmVersion): any;
|
|
10
|
+
export declare function normalizeLocation(assetLocation: Record<string, any>): Record<string, any>;
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
+
import { XcmV3Junction } from '@galacticcouncil/descriptors';
|
|
1
2
|
import { Parachain } from '@galacticcouncil/xc-core';
|
|
2
3
|
import { XcmVersion } from './types';
|
|
3
4
|
export declare const toDest: (version: XcmVersion, destination: Parachain, account: any) => {
|
|
4
|
-
|
|
5
|
+
type: XcmVersion;
|
|
6
|
+
value: {
|
|
5
7
|
parents: number;
|
|
6
8
|
interior: {
|
|
7
|
-
|
|
9
|
+
type: "X1";
|
|
10
|
+
value: XcmV3Junction;
|
|
11
|
+
} & {
|
|
12
|
+
type: "X1";
|
|
8
13
|
};
|
|
9
14
|
};
|
|
10
15
|
} | {
|
|
11
|
-
|
|
16
|
+
type: XcmVersion;
|
|
17
|
+
value: {
|
|
12
18
|
parents: number;
|
|
13
19
|
interior: {
|
|
14
|
-
|
|
20
|
+
type: "X2";
|
|
21
|
+
value: import("polkadot-api").FixedSizeArray<2, XcmV3Junction>;
|
|
22
|
+
} & {
|
|
23
|
+
type: "X2";
|
|
15
24
|
};
|
|
16
25
|
};
|
|
17
26
|
};
|
|
18
27
|
export declare const toAsset: (assetLocation: object, amount: any) => {
|
|
19
28
|
id: object;
|
|
20
29
|
fun: {
|
|
21
|
-
|
|
30
|
+
type: "Fungible";
|
|
31
|
+
value: bigint;
|
|
32
|
+
} & {
|
|
33
|
+
type: "Fungible";
|
|
22
34
|
};
|
|
23
35
|
};
|