@paraspell/sdk-core 8.5.2 → 8.6.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/dist/index.cjs +960 -970
- package/dist/index.d.ts +528 -532
- package/dist/index.mjs +956 -971
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Signer, AbstractProvider } from 'ethers';
|
|
2
|
-
import { WalletClient } from 'viem';
|
|
1
|
+
import { Signer, AbstractProvider, Contract } from 'ethers';
|
|
2
|
+
import { WalletClient, GetContractReturnType, Abi } from 'viem';
|
|
3
3
|
|
|
4
4
|
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
5
5
|
api: IPolkadotApi<TApi, TRes>;
|
|
@@ -11,19 +11,19 @@ declare const ETHEREUM_JUNCTION: TJunction;
|
|
|
11
11
|
/**
|
|
12
12
|
* Supported nodes excluding relay chains and Ethereum.
|
|
13
13
|
*/
|
|
14
|
-
declare const NODE_NAMES_DOT_KSM: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "
|
|
14
|
+
declare const NODE_NAMES_DOT_KSM: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Heima", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec"];
|
|
15
15
|
/**
|
|
16
16
|
* Supported nodes including Ethereum.
|
|
17
17
|
*/
|
|
18
|
-
declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "
|
|
18
|
+
declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Heima", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "Ethereum"];
|
|
19
19
|
/**
|
|
20
20
|
* Supported nodes including relay chains and Ethereum.
|
|
21
21
|
*/
|
|
22
|
-
declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "
|
|
22
|
+
declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Heima", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "Ethereum", "Polkadot", "Kusama"];
|
|
23
23
|
/**
|
|
24
24
|
* Supported nodes including relay chains and excluding Ethereum.
|
|
25
25
|
*/
|
|
26
|
-
declare const NODES_WITH_RELAY_CHAINS_DOT_KSM: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "
|
|
26
|
+
declare const NODES_WITH_RELAY_CHAINS_DOT_KSM: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Heima", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "Polkadot", "Kusama"];
|
|
27
27
|
/**
|
|
28
28
|
* Supported XCM pallets.
|
|
29
29
|
*/
|
|
@@ -45,8 +45,8 @@ declare abstract class ParachainNode<TApi, TRes> {
|
|
|
45
45
|
transfer(options: TSendInternalOptions<TApi, TRes>): Promise<TRes>;
|
|
46
46
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
47
47
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCall;
|
|
48
|
-
createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]):
|
|
49
|
-
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination: TDestination, paraId?: number):
|
|
48
|
+
createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TXcmVersioned<TMultiAsset[]>;
|
|
49
|
+
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination: TDestination, paraId?: number): TXcmVersioned<TMultiLocation>;
|
|
50
50
|
getNativeAssetSymbol(): string;
|
|
51
51
|
protected transferToEthereum<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
52
52
|
}
|
|
@@ -148,7 +148,7 @@ declare class Interlay<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
148
148
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
declare class
|
|
151
|
+
declare class Heima<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
152
152
|
constructor();
|
|
153
153
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
154
154
|
}
|
|
@@ -255,14 +255,14 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
|
|
|
255
255
|
private getSection;
|
|
256
256
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
257
257
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
258
|
-
createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]):
|
|
258
|
+
createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TXcmVersioned<TMultiAsset[]>;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
262
262
|
constructor();
|
|
263
263
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
264
264
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
265
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]):
|
|
265
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TXcmVersioned<TMultiAsset[]>;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
declare class CoretimeKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
@@ -314,340 +314,216 @@ declare class Astar<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPo
|
|
|
314
314
|
protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
Concrete: TMultiLocation;
|
|
321
|
-
};
|
|
322
|
-
fun: {
|
|
323
|
-
Fungible: TAmount;
|
|
324
|
-
};
|
|
317
|
+
declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> {
|
|
318
|
+
constructor();
|
|
319
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
325
320
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
321
|
+
|
|
322
|
+
declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
323
|
+
constructor();
|
|
324
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
325
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
326
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation): TXcmVersioned<TMultiAsset[]>;
|
|
331
327
|
}
|
|
332
328
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
};
|
|
338
|
-
type TOverrideMultiLocationSpecifier = {
|
|
339
|
-
type: 'Override';
|
|
340
|
-
value: TMultiLocation;
|
|
341
|
-
};
|
|
342
|
-
type TCurrencySymbolValue = string | TSymbolSpecifier;
|
|
343
|
-
type TCurrencySymbol = {
|
|
344
|
-
symbol: TCurrencySymbolValue;
|
|
345
|
-
};
|
|
346
|
-
type TCurrencyCore = TCurrencySymbol | {
|
|
347
|
-
id: TCurrency;
|
|
348
|
-
} | {
|
|
349
|
-
multilocation: TMultiLocationValue;
|
|
350
|
-
};
|
|
351
|
-
type TCurrencyCoreWithFee = WithAmount<TCurrencyCore> & {
|
|
352
|
-
isFeeAsset?: boolean;
|
|
353
|
-
};
|
|
354
|
-
type TMultiAssetWithFee = TMultiAsset & {
|
|
355
|
-
isFeeAsset?: boolean;
|
|
356
|
-
};
|
|
357
|
-
type TMultiLocationValue = string | TMultiLocation | TJunction[];
|
|
358
|
-
type TMultiLocationValueWithOverride = TMultiLocationValue | TOverrideMultiLocationSpecifier;
|
|
359
|
-
type TCurrencyInputWithAmount = WithAmount<TCurrencySymbol | {
|
|
360
|
-
id: TCurrency;
|
|
361
|
-
} | {
|
|
362
|
-
multilocation: TMultiLocationValueWithOverride;
|
|
363
|
-
}> | {
|
|
364
|
-
multiasset: TMultiAssetWithFee[] | TCurrencyCoreWithFee[];
|
|
365
|
-
};
|
|
366
|
-
type TCurrencyInput = TCurrencySymbol | {
|
|
367
|
-
id: TCurrency;
|
|
368
|
-
} | {
|
|
369
|
-
multilocation: TMultiLocationValueWithOverride;
|
|
370
|
-
} | {
|
|
371
|
-
multiasset: TMultiAssetWithFee[] | TCurrencyCoreWithFee[];
|
|
372
|
-
};
|
|
373
|
-
type WithAmount<TBase> = TBase & {
|
|
374
|
-
amount: TAmount;
|
|
375
|
-
};
|
|
376
|
-
interface TCurrencySelection {
|
|
377
|
-
id: {
|
|
378
|
-
Concrete: TMultiLocation;
|
|
379
|
-
};
|
|
380
|
-
fun: {
|
|
381
|
-
Fungible: string;
|
|
382
|
-
};
|
|
329
|
+
declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
330
|
+
private static NATIVE_ASSET_ID;
|
|
331
|
+
constructor();
|
|
332
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
383
333
|
}
|
|
384
|
-
type TCurrencySelectionV4 = {
|
|
385
|
-
id: TMultiLocation;
|
|
386
|
-
fun: {
|
|
387
|
-
Fungible: string;
|
|
388
|
-
};
|
|
389
|
-
};
|
|
390
|
-
type TCurrencySelectionHeader = {
|
|
391
|
-
[key in Version]?: TCurrencySelection | TCurrencySelectionV4;
|
|
392
|
-
};
|
|
393
|
-
type TCurrencySelectionHeaderArr = {
|
|
394
|
-
[key in Version]?: [TCurrencySelection | TCurrencySelectionV4];
|
|
395
|
-
};
|
|
396
|
-
type TXcmForeignAsset = {
|
|
397
|
-
ForeignAsset: string | number | bigint | undefined;
|
|
398
|
-
};
|
|
399
|
-
type TForeignAssetId = {
|
|
400
|
-
ForeignAssetId: bigint | undefined;
|
|
401
|
-
};
|
|
402
|
-
type TForeignOrTokenAsset = TXcmForeignAsset | {
|
|
403
|
-
Token: string | undefined;
|
|
404
|
-
};
|
|
405
|
-
type TForeignOrNativeAsset = TXcmForeignAsset | 'Native';
|
|
406
|
-
type TXcmAsset = {
|
|
407
|
-
XCM: number | undefined;
|
|
408
|
-
};
|
|
409
|
-
type TMantaAsset = {
|
|
410
|
-
MantaCurrency: bigint | undefined;
|
|
411
|
-
};
|
|
412
|
-
type TNativeTokenAsset = 'NativeToken';
|
|
413
|
-
type TNodleAsset = 'NodleNative';
|
|
414
|
-
type TZeitgeistAsset = 'Ztg';
|
|
415
|
-
type TOtherReserveAsset = {
|
|
416
|
-
OtherReserve: string | bigint | undefined;
|
|
417
|
-
};
|
|
418
|
-
type TSelfReserveAsset = 'SelfReserve';
|
|
419
|
-
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
420
|
-
type TBifrostToken = {
|
|
421
|
-
Native: string;
|
|
422
|
-
} | {
|
|
423
|
-
VToken: string;
|
|
424
|
-
} | {
|
|
425
|
-
Token: string;
|
|
426
|
-
} | {
|
|
427
|
-
VSToken2: number;
|
|
428
|
-
} | {
|
|
429
|
-
VToken2: number;
|
|
430
|
-
} | {
|
|
431
|
-
Token2: number;
|
|
432
|
-
};
|
|
433
|
-
type TXTokensCurrencySelection = TCurrencySelectionHeader | TCurrencySelectionHeaderArr | TXcmForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | TBifrostToken | string | bigint | number | undefined;
|
|
434
334
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
};
|
|
440
|
-
interface TPalletMap {
|
|
441
|
-
defaultPallet: TPallet;
|
|
442
|
-
supportedPallets: TPalletDetails[];
|
|
335
|
+
declare class Shiden<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
336
|
+
constructor();
|
|
337
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
338
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
339
|
+
protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
443
340
|
}
|
|
444
|
-
type TPalletJsonMap = Record<TNodeDotKsmWithRelayChains, TPalletMap>;
|
|
445
341
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
symbol: string;
|
|
451
|
-
decimals?: number;
|
|
452
|
-
manuallyAdded?: boolean;
|
|
453
|
-
alias?: string;
|
|
454
|
-
existentialDeposit?: string;
|
|
455
|
-
};
|
|
456
|
-
type TNativeAsset = TBaseAsset & {
|
|
457
|
-
isNative: true;
|
|
458
|
-
multiLocation?: object;
|
|
459
|
-
};
|
|
460
|
-
type TForeignAsset = TBaseAsset & AtLeastOne<{
|
|
461
|
-
assetId?: string;
|
|
462
|
-
multiLocation?: object;
|
|
463
|
-
xcmInterior?: object[];
|
|
464
|
-
}>;
|
|
465
|
-
type TAsset = TNativeAsset | TForeignAsset;
|
|
466
|
-
type TNodeAssets = {
|
|
467
|
-
relayChainAssetSymbol: TRelayChainSymbol;
|
|
468
|
-
nativeAssetSymbol: string;
|
|
469
|
-
isEVM: boolean;
|
|
470
|
-
supportsDryRunApi: boolean;
|
|
471
|
-
nativeAssets: TNativeAsset[];
|
|
472
|
-
otherAssets: TForeignAsset[];
|
|
473
|
-
};
|
|
474
|
-
type TAssetJsonMap = Record<TNodeWithRelayChains, TNodeAssets>;
|
|
342
|
+
declare class Manta<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
343
|
+
constructor();
|
|
344
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
345
|
+
}
|
|
475
346
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
address: TAddress;
|
|
481
|
-
currencySelection: TCurrencySelectionHeaderArr;
|
|
482
|
-
scenario: TScenario;
|
|
483
|
-
asset: WithAmount<TAsset>;
|
|
484
|
-
destination: TDestination;
|
|
485
|
-
paraIdTo?: number;
|
|
486
|
-
overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
|
|
487
|
-
version?: Version;
|
|
488
|
-
ahAddress?: string;
|
|
489
|
-
pallet?: string;
|
|
490
|
-
method?: string;
|
|
491
|
-
};
|
|
492
|
-
type TXTokensTransferOptions<TApi, TRes> = {
|
|
493
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
494
|
-
asset: WithAmount<TAsset>;
|
|
495
|
-
addressSelection: TMultiLocationHeader;
|
|
496
|
-
fees: number;
|
|
497
|
-
scenario: TScenario;
|
|
498
|
-
origin: TNodePolkadotKusama;
|
|
499
|
-
destination: TDestination;
|
|
500
|
-
paraIdTo?: number;
|
|
501
|
-
overriddenAsset?: TMultiLocation | TMultiAsset[];
|
|
502
|
-
pallet?: string;
|
|
503
|
-
method?: string;
|
|
504
|
-
};
|
|
505
|
-
type TXTransferTransferOptions<TApi, TRes> = {
|
|
506
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
507
|
-
asset: WithAmount<TAsset>;
|
|
508
|
-
recipientAddress: TAddress;
|
|
509
|
-
origin: TNodePolkadotKusama;
|
|
510
|
-
paraId?: number;
|
|
511
|
-
destination: TDestination;
|
|
512
|
-
overriddenAsset?: TMultiLocation | TMultiAsset[];
|
|
513
|
-
pallet?: string;
|
|
514
|
-
method?: string;
|
|
515
|
-
};
|
|
516
|
-
interface IPolkadotXCMTransfer {
|
|
517
|
-
transferPolkadotXCM: <TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TRes>;
|
|
347
|
+
declare class Nodle<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
348
|
+
constructor();
|
|
349
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
350
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
518
351
|
}
|
|
519
|
-
|
|
520
|
-
|
|
352
|
+
|
|
353
|
+
declare class NeuroWeb<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
354
|
+
constructor();
|
|
355
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
521
356
|
}
|
|
522
|
-
|
|
523
|
-
|
|
357
|
+
|
|
358
|
+
declare class Pendulum<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
359
|
+
constructor();
|
|
360
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
361
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
524
362
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
V1 = "V1",
|
|
531
|
-
V2 = "V2",
|
|
532
|
-
V3 = "V3",
|
|
533
|
-
V4 = "V4"
|
|
363
|
+
|
|
364
|
+
declare class Zeitgeist<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
365
|
+
constructor();
|
|
366
|
+
private getCurrencySelection;
|
|
367
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
534
368
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
ONE = 1,
|
|
542
|
-
TWO = 2
|
|
369
|
+
|
|
370
|
+
declare class Collectives<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
371
|
+
constructor();
|
|
372
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
373
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
374
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset): TXcmVersioned<TMultiAsset[]>;
|
|
543
375
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
376
|
+
|
|
377
|
+
declare class Phala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTransferTransfer {
|
|
378
|
+
constructor();
|
|
379
|
+
transferXTransfer<TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>): TRes;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
declare class Subsocial<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
383
|
+
constructor();
|
|
384
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare class KiltSpiritnet<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
388
|
+
constructor();
|
|
389
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
390
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
declare class Curio<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
394
|
+
constructor();
|
|
395
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
declare class BridgeHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
399
|
+
constructor();
|
|
400
|
+
_assetCheckEnabled: boolean;
|
|
401
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
402
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
406
|
+
constructor();
|
|
407
|
+
_assetCheckEnabled: boolean;
|
|
408
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
409
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
declare class Mythos<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
413
|
+
constructor();
|
|
414
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
415
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
declare class Peaq<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
419
|
+
constructor();
|
|
420
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
421
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare class Polimec<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
425
|
+
constructor();
|
|
426
|
+
private getAssetMultiLocation;
|
|
427
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
428
|
+
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCall;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
declare const nodes: <TApi, TRes>() => {
|
|
432
|
+
AssetHubPolkadot: AssetHubPolkadot<TApi, TRes>;
|
|
433
|
+
Acala: Acala<TApi, TRes>;
|
|
434
|
+
Astar: Astar<TApi, TRes>;
|
|
435
|
+
Unique: Unique<TApi, TRes>;
|
|
436
|
+
Crust: Crust<TApi, TRes>;
|
|
437
|
+
BifrostPolkadot: BifrostPolkadot<TApi, TRes>;
|
|
438
|
+
BridgeHubPolkadot: BridgeHubPolkadot<TApi, TRes>;
|
|
439
|
+
BridgeHubKusama: BridgeHubKusama<TApi, TRes>;
|
|
440
|
+
Bitgreen: Bitgreen<TApi, TRes>;
|
|
441
|
+
Centrifuge: Centrifuge<TApi, TRes>;
|
|
442
|
+
ComposableFinance: ComposableFinance<TApi, TRes>;
|
|
443
|
+
Darwinia: Darwinia<TApi, TRes>;
|
|
444
|
+
Hydration: Hydration<TApi, TRes>;
|
|
445
|
+
Interlay: Interlay<TApi, TRes>;
|
|
446
|
+
Heima: Heima<TApi, TRes>;
|
|
447
|
+
Moonbeam: Moonbeam<TApi, TRes>;
|
|
448
|
+
Parallel: Parallel<TApi, TRes>;
|
|
449
|
+
AssetHubKusama: AssetHubKusama<TApi, TRes>;
|
|
450
|
+
CoretimeKusama: CoretimeKusama<TApi, TRes>;
|
|
451
|
+
CoretimePolkadot: CoretimePolkadot<TApi, TRes>;
|
|
452
|
+
Encointer: Encointer<TApi, TRes>;
|
|
453
|
+
Altair: Altair<TApi, TRes>;
|
|
454
|
+
Amplitude: Amplitude<TApi, TRes>;
|
|
455
|
+
Bajun: Bajun<TApi, TRes>;
|
|
456
|
+
Basilisk: Basilisk<TApi, TRes>;
|
|
457
|
+
BifrostKusama: BifrostKusama<TApi, TRes>;
|
|
458
|
+
Calamari: Calamari<TApi, TRes>;
|
|
459
|
+
CrustShadow: CrustShadow<TApi, TRes>;
|
|
460
|
+
Crab: Crab<TApi, TRes>;
|
|
461
|
+
Imbue: Imbue<TApi, TRes>;
|
|
462
|
+
InvArchTinker: InvArchTinker<TApi, TRes>;
|
|
463
|
+
Karura: Karura<TApi, TRes>;
|
|
464
|
+
Kintsugi: Kintsugi<TApi, TRes>;
|
|
465
|
+
Moonriver: Moonriver<TApi, TRes>;
|
|
466
|
+
ParallelHeiko: ParallelHeiko<TApi, TRes>;
|
|
467
|
+
Picasso: Picasso<TApi, TRes>;
|
|
468
|
+
Quartz: Quartz<TApi, TRes>;
|
|
469
|
+
RobonomicsKusama: RobonomicsKusama<TApi, TRes>;
|
|
470
|
+
RobonomicsPolkadot: RobonomicsPolkadot<TApi, TRes>;
|
|
471
|
+
PeoplePolkadot: PeoplePolkadot<TApi, TRes>;
|
|
472
|
+
PeopleKusama: PeopleKusama<TApi, TRes>;
|
|
473
|
+
Shiden: Shiden<TApi, TRes>;
|
|
474
|
+
Turing: Turing<TApi, TRes>;
|
|
475
|
+
Manta: Manta<TApi, TRes>;
|
|
476
|
+
Nodle: Nodle<TApi, TRes>;
|
|
477
|
+
NeuroWeb: NeuroWeb<TApi, TRes>;
|
|
478
|
+
Pendulum: Pendulum<TApi, TRes>;
|
|
479
|
+
Zeitgeist: Zeitgeist<TApi, TRes>;
|
|
480
|
+
Collectives: Collectives<TApi, TRes>;
|
|
481
|
+
Phala: Phala<TApi, TRes>;
|
|
482
|
+
Subsocial: Subsocial<TApi, TRes>;
|
|
483
|
+
KiltSpiritnet: KiltSpiritnet<TApi, TRes>;
|
|
484
|
+
Curio: Curio<TApi, TRes>;
|
|
485
|
+
Mythos: Mythos<TApi, TRes>;
|
|
486
|
+
Peaq: Peaq<TApi, TRes>;
|
|
487
|
+
Polimec: Polimec<TApi, TRes>;
|
|
629
488
|
};
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
489
|
+
|
|
490
|
+
type TRelaychain = 'Polkadot' | 'Kusama';
|
|
491
|
+
type TNode = (typeof NODE_NAMES)[number];
|
|
492
|
+
type TNodePolkadotKusama = Exclude<TNode, 'Ethereum'>;
|
|
493
|
+
type TNodeWithRelayChains = (typeof NODES_WITH_RELAY_CHAINS)[number];
|
|
494
|
+
type TNodeDotKsmWithRelayChains = Exclude<TNodeWithRelayChains, 'Ethereum'>;
|
|
495
|
+
|
|
496
|
+
type TEcosystemType = 'polkadot' | 'kusama' | 'ethereum';
|
|
497
|
+
type TRelayChainSymbol = 'DOT' | 'KSM';
|
|
498
|
+
|
|
499
|
+
type AtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
500
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
501
|
+
}[Keys];
|
|
502
|
+
type TBaseAsset = {
|
|
503
|
+
symbol: string;
|
|
504
|
+
decimals?: number;
|
|
505
|
+
manuallyAdded?: boolean;
|
|
506
|
+
alias?: string;
|
|
507
|
+
existentialDeposit?: string;
|
|
633
508
|
};
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions, TApi, TRes>;
|
|
638
|
-
type TSerializedApiCall = {
|
|
639
|
-
module: TPallet | 'Utility';
|
|
640
|
-
section: string;
|
|
641
|
-
parameters: Record<string, unknown>;
|
|
509
|
+
type TNativeAsset = TBaseAsset & {
|
|
510
|
+
isNative: true;
|
|
511
|
+
multiLocation?: object;
|
|
642
512
|
};
|
|
643
|
-
type
|
|
644
|
-
|
|
645
|
-
|
|
513
|
+
type TForeignAsset = TBaseAsset & AtLeastOne<{
|
|
514
|
+
assetId?: string;
|
|
515
|
+
multiLocation?: object;
|
|
516
|
+
}>;
|
|
517
|
+
type TAsset = TNativeAsset | TForeignAsset;
|
|
518
|
+
type TNodeAssets = {
|
|
519
|
+
relayChainAssetSymbol: TRelayChainSymbol;
|
|
520
|
+
nativeAssetSymbol: string;
|
|
521
|
+
isEVM: boolean;
|
|
522
|
+
supportsDryRunApi: boolean;
|
|
523
|
+
nativeAssets: TNativeAsset[];
|
|
524
|
+
otherAssets: TForeignAsset[];
|
|
646
525
|
};
|
|
647
|
-
type
|
|
648
|
-
type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
649
|
-
type TPolkadotXcmSection = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets';
|
|
650
|
-
type TXcmPalletSection = 'limited_teleport_assets' | 'reserve_transfer_assets' | 'limited_reserve_transfer_assets';
|
|
526
|
+
type TAssetJsonMap = Record<TNodeWithRelayChains, TNodeAssets>;
|
|
651
527
|
|
|
652
528
|
type TJunctionType = 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality' | 'GlobalConsensus';
|
|
653
529
|
type TNetworkId = string | null;
|
|
@@ -717,200 +593,297 @@ interface TMultiLocation {
|
|
|
717
593
|
parents: TStringOrNumber;
|
|
718
594
|
interior: TJunctions | 'Here';
|
|
719
595
|
}
|
|
720
|
-
type TMultiLocationHeader = {
|
|
721
|
-
[key in Version]?: TMultiLocation;
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
725
|
-
constructor();
|
|
726
|
-
private getCurrencySelection;
|
|
727
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
728
|
-
transferRelayToPara(): TSerializedApiCall;
|
|
729
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation): TCurrencySelectionHeaderArr;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
733
|
-
constructor();
|
|
734
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
735
|
-
transferRelayToPara(): TSerializedApiCall;
|
|
736
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset): TCurrencySelectionHeaderArr;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
740
|
-
private static NATIVE_ASSET_ID;
|
|
741
|
-
constructor();
|
|
742
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
declare class Shiden<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
746
|
-
constructor();
|
|
747
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
748
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
749
|
-
protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
declare class Manta<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
753
|
-
constructor();
|
|
754
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
declare class Nodle<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
758
|
-
constructor();
|
|
759
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
760
|
-
transferRelayToPara(): TSerializedApiCall;
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
declare class NeuroWeb<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
764
|
-
constructor();
|
|
765
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
declare class Pendulum<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
769
|
-
constructor();
|
|
770
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
771
|
-
transferRelayToPara(): TSerializedApiCall;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
declare class Zeitgeist<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
775
|
-
constructor();
|
|
776
|
-
private getCurrencySelection;
|
|
777
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
declare class Collectives<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
781
|
-
constructor();
|
|
782
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
783
|
-
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
784
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset): TCurrencySelectionHeaderArr;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
declare class Khala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTransferTransfer {
|
|
788
|
-
constructor();
|
|
789
|
-
transferXTransfer<TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>): TRes;
|
|
790
|
-
}
|
|
791
596
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
597
|
+
type TPallet = (typeof SUPPORTED_PALLETS)[number];
|
|
598
|
+
type TPalletDetails = {
|
|
599
|
+
name: TPallet;
|
|
600
|
+
index: number;
|
|
601
|
+
};
|
|
602
|
+
interface TPalletMap {
|
|
603
|
+
defaultPallet: TPallet;
|
|
604
|
+
supportedPallets: TPalletDetails[];
|
|
795
605
|
}
|
|
606
|
+
type TPalletJsonMap = Record<TNodeDotKsmWithRelayChains, TPalletMap>;
|
|
796
607
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
608
|
+
type TMultiAsset = TMultiAssetV3 | TMultiAssetV4;
|
|
609
|
+
interface TMultiAssetV3 {
|
|
610
|
+
id: {
|
|
611
|
+
Concrete: TMultiLocation;
|
|
612
|
+
};
|
|
613
|
+
fun: {
|
|
614
|
+
Fungible: TAmount;
|
|
615
|
+
};
|
|
800
616
|
}
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
617
|
+
interface TMultiAssetV4 {
|
|
618
|
+
id: TMultiLocation;
|
|
619
|
+
fun: {
|
|
620
|
+
Fungible: TAmount;
|
|
621
|
+
};
|
|
806
622
|
}
|
|
807
623
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
624
|
+
type TCurrency = string | number | bigint;
|
|
625
|
+
type TSymbolSpecifier = {
|
|
626
|
+
type: 'Native' | 'Foreign' | 'ForeignAbstract';
|
|
627
|
+
value: string;
|
|
628
|
+
};
|
|
629
|
+
type TOverrideMultiLocationSpecifier = {
|
|
630
|
+
type: 'Override';
|
|
631
|
+
value: TMultiLocation;
|
|
632
|
+
};
|
|
633
|
+
type TCurrencySymbolValue = string | TSymbolSpecifier;
|
|
634
|
+
type TCurrencySymbol = {
|
|
635
|
+
symbol: TCurrencySymbolValue;
|
|
636
|
+
};
|
|
637
|
+
type TCurrencyCore = TCurrencySymbol | {
|
|
638
|
+
id: TCurrency;
|
|
639
|
+
} | {
|
|
640
|
+
multilocation: TMultiLocationValue;
|
|
641
|
+
};
|
|
642
|
+
type TCurrencyCoreWithFee = WithAmount<TCurrencyCore> & {
|
|
643
|
+
isFeeAsset?: boolean;
|
|
644
|
+
};
|
|
645
|
+
type TMultiAssetWithFee = TMultiAsset & {
|
|
646
|
+
isFeeAsset?: boolean;
|
|
647
|
+
};
|
|
648
|
+
type TMultiLocationValue = string | TMultiLocation;
|
|
649
|
+
type TMultiLocationValueWithOverride = TMultiLocationValue | TOverrideMultiLocationSpecifier;
|
|
650
|
+
type TCurrencyInputWithAmount = WithAmount<TCurrencySymbol | {
|
|
651
|
+
id: TCurrency;
|
|
652
|
+
} | {
|
|
653
|
+
multilocation: TMultiLocationValueWithOverride;
|
|
654
|
+
}> | {
|
|
655
|
+
multiasset: TMultiAssetWithFee[] | TCurrencyCoreWithFee[];
|
|
656
|
+
};
|
|
657
|
+
type TCurrencyInput = TCurrencySymbol | {
|
|
658
|
+
id: TCurrency;
|
|
659
|
+
} | {
|
|
660
|
+
multilocation: TMultiLocationValueWithOverride;
|
|
661
|
+
} | {
|
|
662
|
+
multiasset: TMultiAssetWithFee[] | TCurrencyCoreWithFee[];
|
|
663
|
+
};
|
|
664
|
+
type WithAmount<TBase> = TBase & {
|
|
665
|
+
amount: TAmount;
|
|
666
|
+
};
|
|
667
|
+
type OneKey<K extends string, V = unknown> = {
|
|
668
|
+
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
669
|
+
[Q in keyof O]: O[Q];
|
|
670
|
+
} : never;
|
|
671
|
+
}[K];
|
|
672
|
+
type TXcmVersioned<T> = OneKey<Version, T>;
|
|
673
|
+
type TXcmForeignAsset = {
|
|
674
|
+
ForeignAsset: string | number | bigint | undefined;
|
|
675
|
+
};
|
|
676
|
+
type TForeignAssetId = {
|
|
677
|
+
ForeignAssetId: bigint | undefined;
|
|
678
|
+
};
|
|
679
|
+
type TForeignOrTokenAsset = TXcmForeignAsset | {
|
|
680
|
+
Token: string | undefined;
|
|
681
|
+
};
|
|
682
|
+
type TForeignOrNativeAsset = TXcmForeignAsset | 'Native';
|
|
683
|
+
type TXcmAsset = {
|
|
684
|
+
XCM: number | undefined;
|
|
685
|
+
};
|
|
686
|
+
type TMantaAsset = {
|
|
687
|
+
MantaCurrency: bigint | undefined;
|
|
688
|
+
};
|
|
689
|
+
type TNativeTokenAsset = 'NativeToken';
|
|
690
|
+
type TNodleAsset = 'NodleNative';
|
|
691
|
+
type TZeitgeistAsset = 'Ztg';
|
|
692
|
+
type TOtherReserveAsset = {
|
|
693
|
+
OtherReserve: string | bigint | undefined;
|
|
694
|
+
};
|
|
695
|
+
type TSelfReserveAsset = 'SelfReserve';
|
|
696
|
+
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
697
|
+
type TBifrostToken = {
|
|
698
|
+
Native: string;
|
|
699
|
+
} | {
|
|
700
|
+
VToken: string;
|
|
701
|
+
} | {
|
|
702
|
+
Token: string;
|
|
703
|
+
} | {
|
|
704
|
+
VSToken2: number;
|
|
705
|
+
} | {
|
|
706
|
+
VToken2: number;
|
|
707
|
+
} | {
|
|
708
|
+
Token2: number;
|
|
709
|
+
};
|
|
710
|
+
type TXTokensCurrencySelection = TXcmVersioned<TMultiLocation | TMultiAsset | TMultiAsset[]> | TXcmForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | TBifrostToken | string | bigint | number | undefined;
|
|
812
711
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
712
|
+
type TPolkadotXCMTransferOptions<TApi, TRes> = {
|
|
713
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
714
|
+
header: TXcmVersioned<TMultiLocation>;
|
|
715
|
+
addressSelection: TXcmVersioned<TMultiLocation>;
|
|
716
|
+
address: TAddress;
|
|
717
|
+
currencySelection: TXcmVersioned<TMultiAsset[]>;
|
|
718
|
+
scenario: TScenario;
|
|
719
|
+
asset: WithAmount<TAsset>;
|
|
720
|
+
destination: TDestination;
|
|
721
|
+
paraIdTo?: number;
|
|
722
|
+
overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
|
|
723
|
+
version?: Version;
|
|
724
|
+
senderAddress?: string;
|
|
725
|
+
pallet?: string;
|
|
726
|
+
method?: string;
|
|
727
|
+
};
|
|
728
|
+
type TXTokensTransferOptions<TApi, TRes> = {
|
|
729
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
730
|
+
asset: WithAmount<TAsset>;
|
|
731
|
+
addressSelection: TXcmVersioned<TMultiLocation>;
|
|
732
|
+
fees: number;
|
|
733
|
+
scenario: TScenario;
|
|
734
|
+
origin: TNodePolkadotKusama;
|
|
735
|
+
destination: TDestination;
|
|
736
|
+
paraIdTo?: number;
|
|
737
|
+
overriddenAsset?: TMultiLocation | TMultiAsset[];
|
|
738
|
+
pallet?: string;
|
|
739
|
+
method?: string;
|
|
740
|
+
};
|
|
741
|
+
type TXTransferTransferOptions<TApi, TRes> = {
|
|
742
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
743
|
+
asset: WithAmount<TAsset>;
|
|
744
|
+
recipientAddress: TAddress;
|
|
745
|
+
origin: TNodePolkadotKusama;
|
|
746
|
+
paraId?: number;
|
|
747
|
+
destination: TDestination;
|
|
748
|
+
overriddenAsset?: TMultiLocation | TMultiAsset[];
|
|
749
|
+
pallet?: string;
|
|
750
|
+
method?: string;
|
|
751
|
+
};
|
|
752
|
+
interface IPolkadotXCMTransfer {
|
|
753
|
+
transferPolkadotXCM: <TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TRes>;
|
|
818
754
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
constructor();
|
|
822
|
-
_assetCheckEnabled: boolean;
|
|
823
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
824
|
-
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
755
|
+
interface IXTokensTransfer {
|
|
756
|
+
transferXTokens: <TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>) => TRes;
|
|
825
757
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
constructor();
|
|
829
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
830
|
-
transferRelayToPara(): TSerializedApiCall;
|
|
758
|
+
interface IXTransferTransfer {
|
|
759
|
+
transferXTransfer: <TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>) => TRes;
|
|
831
760
|
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
761
|
+
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
762
|
+
/**
|
|
763
|
+
* The XCM version.
|
|
764
|
+
*/
|
|
765
|
+
declare enum Version {
|
|
766
|
+
V1 = "V1",
|
|
767
|
+
V2 = "V2",
|
|
768
|
+
V3 = "V3",
|
|
769
|
+
V4 = "V4"
|
|
837
770
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
771
|
+
/**
|
|
772
|
+
* The supported XCM versions for asset claims.
|
|
773
|
+
*/
|
|
774
|
+
type TVersionClaimAssets = Version.V3 | Version.V2;
|
|
775
|
+
declare enum Parents {
|
|
776
|
+
ZERO = 0,
|
|
777
|
+
ONE = 1,
|
|
778
|
+
TWO = 2
|
|
844
779
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
Karura: Karura<TApi, TRes>;
|
|
879
|
-
Kintsugi: Kintsugi<TApi, TRes>;
|
|
880
|
-
Moonriver: Moonriver<TApi, TRes>;
|
|
881
|
-
ParallelHeiko: ParallelHeiko<TApi, TRes>;
|
|
882
|
-
Picasso: Picasso<TApi, TRes>;
|
|
883
|
-
Quartz: Quartz<TApi, TRes>;
|
|
884
|
-
RobonomicsKusama: RobonomicsKusama<TApi, TRes>;
|
|
885
|
-
RobonomicsPolkadot: RobonomicsPolkadot<TApi, TRes>;
|
|
886
|
-
PeoplePolkadot: PeoplePolkadot<TApi, TRes>;
|
|
887
|
-
PeopleKusama: PeopleKusama<TApi, TRes>;
|
|
888
|
-
Shiden: Shiden<TApi, TRes>;
|
|
889
|
-
Turing: Turing<TApi, TRes>;
|
|
890
|
-
Manta: Manta<TApi, TRes>;
|
|
891
|
-
Nodle: Nodle<TApi, TRes>;
|
|
892
|
-
NeuroWeb: NeuroWeb<TApi, TRes>;
|
|
893
|
-
Pendulum: Pendulum<TApi, TRes>;
|
|
894
|
-
Zeitgeist: Zeitgeist<TApi, TRes>;
|
|
895
|
-
Collectives: Collectives<TApi, TRes>;
|
|
896
|
-
Khala: Khala<TApi, TRes>;
|
|
897
|
-
Phala: Phala<TApi, TRes>;
|
|
898
|
-
Subsocial: Subsocial<TApi, TRes>;
|
|
899
|
-
KiltSpiritnet: KiltSpiritnet<TApi, TRes>;
|
|
900
|
-
Curio: Curio<TApi, TRes>;
|
|
901
|
-
Mythos: Mythos<TApi, TRes>;
|
|
902
|
-
Peaq: Peaq<TApi, TRes>;
|
|
903
|
-
Polimec: Polimec<TApi, TRes>;
|
|
780
|
+
type TAmount = string | number | bigint;
|
|
781
|
+
type TAddress = string | TMultiLocation;
|
|
782
|
+
type TDestination = TNodeWithRelayChains | TMultiLocation;
|
|
783
|
+
type TRelayToParaDestination = TNodePolkadotKusama | TMultiLocation;
|
|
784
|
+
type TSendBaseOptions = {
|
|
785
|
+
/**
|
|
786
|
+
* The destination address. A SS58 or H160 format.
|
|
787
|
+
*/
|
|
788
|
+
address: TAddress;
|
|
789
|
+
/**
|
|
790
|
+
* The optional sender address. A SS58
|
|
791
|
+
*/
|
|
792
|
+
senderAddress?: string;
|
|
793
|
+
/**
|
|
794
|
+
* The destination node or multi-location
|
|
795
|
+
*/
|
|
796
|
+
destination: TDestination;
|
|
797
|
+
/**
|
|
798
|
+
* The optional destination parachain ID
|
|
799
|
+
*/
|
|
800
|
+
paraIdTo?: number;
|
|
801
|
+
/**
|
|
802
|
+
* The optional overrided XCM version
|
|
803
|
+
*/
|
|
804
|
+
version?: Version;
|
|
805
|
+
/**
|
|
806
|
+
* The optional pallet override
|
|
807
|
+
*/
|
|
808
|
+
pallet?: string;
|
|
809
|
+
/**
|
|
810
|
+
* The optional pallet method override
|
|
811
|
+
*/
|
|
812
|
+
method?: string;
|
|
904
813
|
};
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
type
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
814
|
+
/**
|
|
815
|
+
* Options for transferring from a parachain to another parachain or relay chain
|
|
816
|
+
*/
|
|
817
|
+
type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions, TApi, TRes> & {
|
|
818
|
+
/**
|
|
819
|
+
* The origin node
|
|
820
|
+
*/
|
|
821
|
+
origin: TNodeDotKsmWithRelayChains;
|
|
822
|
+
/**
|
|
823
|
+
* The currency to transfer. Either ID, symbol, multi-location, or multi-asset
|
|
824
|
+
*/
|
|
825
|
+
currency: TCurrencyInputWithAmount;
|
|
826
|
+
};
|
|
827
|
+
type TSendInternalOptions<TApi, TRes> = TSendBaseOptions & {
|
|
828
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
829
|
+
asset: WithAmount<TAsset>;
|
|
830
|
+
overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
|
|
831
|
+
};
|
|
832
|
+
type TRelayToParaBaseOptions = {
|
|
833
|
+
/**
|
|
834
|
+
* The origin node
|
|
835
|
+
*/
|
|
836
|
+
origin: TRelaychain;
|
|
837
|
+
/**
|
|
838
|
+
* The destination node or multi-location
|
|
839
|
+
*/
|
|
840
|
+
destination: TRelayToParaDestination;
|
|
841
|
+
/**
|
|
842
|
+
* The destination address. A SS58 or H160 format.
|
|
843
|
+
*/
|
|
844
|
+
address: TAddress;
|
|
845
|
+
/**
|
|
846
|
+
* The optional destination parachain ID
|
|
847
|
+
*/
|
|
848
|
+
paraIdTo?: number;
|
|
849
|
+
/**
|
|
850
|
+
* The optional overrided XCM version
|
|
851
|
+
*/
|
|
852
|
+
version?: Version;
|
|
853
|
+
/**
|
|
854
|
+
* The DOT or KSM asset to transfer
|
|
855
|
+
*/
|
|
856
|
+
asset: WithAmount<TAsset>;
|
|
857
|
+
/**
|
|
858
|
+
* The optional pallet override
|
|
859
|
+
*/
|
|
860
|
+
pallet?: string;
|
|
861
|
+
/**
|
|
862
|
+
* The optional pallet method override
|
|
863
|
+
*/
|
|
864
|
+
method?: string;
|
|
865
|
+
};
|
|
866
|
+
type TRelayToParaOverrides = {
|
|
867
|
+
section: TXcmPalletSection;
|
|
868
|
+
includeFee: boolean;
|
|
869
|
+
};
|
|
870
|
+
/**
|
|
871
|
+
* Options for transferring from a relay chain to a parachain
|
|
872
|
+
*/
|
|
873
|
+
type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions, TApi, TRes>;
|
|
874
|
+
type TSerializedApiCall = {
|
|
875
|
+
module: TPallet | 'Utility';
|
|
876
|
+
section: string;
|
|
877
|
+
parameters: Record<string, unknown>;
|
|
878
|
+
};
|
|
879
|
+
type TDestWeight = {
|
|
880
|
+
ref_time: bigint;
|
|
881
|
+
proof_size: bigint;
|
|
882
|
+
};
|
|
883
|
+
type TXTransferSection = 'transfer';
|
|
884
|
+
type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
885
|
+
type TPolkadotXcmSection = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets';
|
|
886
|
+
type TXcmPalletSection = 'limited_teleport_assets' | 'reserve_transfer_assets' | 'limited_reserve_transfer_assets';
|
|
914
887
|
|
|
915
888
|
type TEdJsonMap = Record<TNodeDotKsmWithRelayChains, string | null>;
|
|
916
889
|
|
|
@@ -997,7 +970,7 @@ type TEvmBuilderOptionsBase = {
|
|
|
997
970
|
/**
|
|
998
971
|
* The source node. Can be either 'Ethereum' or 'Moonbeam'.
|
|
999
972
|
*/
|
|
1000
|
-
from: 'Ethereum' | 'Moonbeam' | 'Moonriver';
|
|
973
|
+
from: 'Ethereum' | 'Moonbeam' | 'Moonriver' | 'Darwinia';
|
|
1001
974
|
/**
|
|
1002
975
|
* The destination node on Polkadot network.
|
|
1003
976
|
*/
|
|
@@ -1062,8 +1035,9 @@ type TBatchOptions = {
|
|
|
1062
1035
|
};
|
|
1063
1036
|
interface IFromBuilder<TApi, TRes> {
|
|
1064
1037
|
from: (node: TNodeDotKsmWithRelayChains) => IToBuilder<TApi, TRes>;
|
|
1065
|
-
claimFrom: (node: TNodeWithRelayChains) => IFungibleBuilder<TRes>;
|
|
1038
|
+
claimFrom: (node: TNodeWithRelayChains) => IFungibleBuilder<TApi, TRes>;
|
|
1066
1039
|
buildBatch: (options?: TBatchOptions) => Promise<TRes>;
|
|
1040
|
+
getApi: () => TApi;
|
|
1067
1041
|
disconnect: () => Promise<void>;
|
|
1068
1042
|
}
|
|
1069
1043
|
interface IToBuilder<TApi, TRes> {
|
|
@@ -1072,21 +1046,22 @@ interface IToBuilder<TApi, TRes> {
|
|
|
1072
1046
|
interface ICurrencyBuilder<TApi, TRes> {
|
|
1073
1047
|
currency: (currency: TCurrencyInputWithAmount) => IAddressBuilder<TApi, TRes>;
|
|
1074
1048
|
}
|
|
1075
|
-
interface IFinalBuilder<TRes> {
|
|
1049
|
+
interface IFinalBuilder<TApi, TRes> {
|
|
1076
1050
|
disconnect: () => Promise<void>;
|
|
1051
|
+
getApi: () => TApi;
|
|
1077
1052
|
build: () => Promise<TRes>;
|
|
1078
1053
|
}
|
|
1079
1054
|
interface IAddressBuilder<TApi, TRes> {
|
|
1080
|
-
address: (address: TAddress,
|
|
1055
|
+
address: (address: TAddress, senderAddress?: string) => IFinalBuilderWithOptions<TApi, TRes>;
|
|
1081
1056
|
}
|
|
1082
|
-
interface IFungibleBuilder<TRes> {
|
|
1083
|
-
fungible: (multiAssets: TMultiAsset[]) => IAccountBuilder<TRes>;
|
|
1057
|
+
interface IFungibleBuilder<TApi, TRes> {
|
|
1058
|
+
fungible: (multiAssets: TMultiAsset[]) => IAccountBuilder<TApi, TRes>;
|
|
1084
1059
|
}
|
|
1085
|
-
interface IAccountBuilder<TRes> {
|
|
1086
|
-
account: (address: TAddress) => IVersionBuilder<TRes>;
|
|
1060
|
+
interface IAccountBuilder<TApi, TRes> {
|
|
1061
|
+
account: (address: TAddress) => IVersionBuilder<TApi, TRes>;
|
|
1087
1062
|
}
|
|
1088
|
-
interface IVersionBuilder<TRes> extends IFinalBuilder<TRes> {
|
|
1089
|
-
xcmVersion: (version: TVersionClaimAssets) => IFinalBuilder<TRes>;
|
|
1063
|
+
interface IVersionBuilder<TApi, TRes> extends IFinalBuilder<TApi, TRes> {
|
|
1064
|
+
xcmVersion: (version: TVersionClaimAssets) => IFinalBuilder<TApi, TRes>;
|
|
1090
1065
|
}
|
|
1091
1066
|
interface IAddToBatchBuilder<TApi, TRes> {
|
|
1092
1067
|
addToBatch(): IFromBuilder<TApi, TRes>;
|
|
@@ -1095,6 +1070,7 @@ interface IFinalBuilderWithOptions<TApi, TRes> extends IAddToBatchBuilder<TApi,
|
|
|
1095
1070
|
xcmVersion: (version: Version) => this;
|
|
1096
1071
|
customPallet: (pallet: string, method: string) => this;
|
|
1097
1072
|
disconnect: () => Promise<void>;
|
|
1073
|
+
getApi: () => TApi;
|
|
1098
1074
|
build: () => Promise<TRes>;
|
|
1099
1075
|
dryRun: (senderAddress: string) => Promise<TDryRunResult>;
|
|
1100
1076
|
}
|
|
@@ -1230,10 +1206,6 @@ type TGetOriginFeeDetailsOptionsBase = {
|
|
|
1230
1206
|
* The destination account.
|
|
1231
1207
|
*/
|
|
1232
1208
|
accountDestination: string;
|
|
1233
|
-
/**
|
|
1234
|
-
* The AssetHub address
|
|
1235
|
-
*/
|
|
1236
|
-
ahAccount?: string;
|
|
1237
1209
|
/**
|
|
1238
1210
|
* The fee margin percentage.
|
|
1239
1211
|
*/
|
|
@@ -1287,6 +1259,12 @@ type TGetTransferableAmountOptionsBase = {
|
|
|
1287
1259
|
currency: TCurrencyCore;
|
|
1288
1260
|
};
|
|
1289
1261
|
type TGetTransferableAmountOptions<TApi, TRes> = WithApi<TGetTransferableAmountOptionsBase, TApi, TRes>;
|
|
1262
|
+
type TVerifyEdOnDestinationOptionsBase = {
|
|
1263
|
+
node: TNodeDotKsmWithRelayChains;
|
|
1264
|
+
address: string;
|
|
1265
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1266
|
+
};
|
|
1267
|
+
type TVerifyEdOnDestinationOptions<TApi, TRes> = WithApi<TVerifyEdOnDestinationOptionsBase, TApi, TRes>;
|
|
1290
1268
|
|
|
1291
1269
|
interface IPolkadotApi<TApi, TRes> {
|
|
1292
1270
|
setApi(api?: TApiOrUrl<TApi>): void;
|
|
@@ -1297,6 +1275,9 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
1297
1275
|
accountToHex(address: string, isPrefixed?: boolean): string;
|
|
1298
1276
|
callTxMethod(serializedCall: TSerializedApiCall): TRes;
|
|
1299
1277
|
callBatchMethod(calls: TRes[], mode: BatchMode): TRes;
|
|
1278
|
+
objectToHex(obj: unknown, typeName: string): Promise<string>;
|
|
1279
|
+
hexToUint8a(hex: string): Uint8Array;
|
|
1280
|
+
stringToUint8a(str: string): Uint8Array;
|
|
1300
1281
|
calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
|
|
1301
1282
|
getBalanceNative(address: string): Promise<bigint>;
|
|
1302
1283
|
getBalanceNativeAcala(address: string, symbol: string): Promise<bigint>;
|
|
@@ -1307,7 +1288,8 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
1307
1288
|
getBalanceForeignXTokens(node: TNodePolkadotKusama, address: string, asset: TAsset): Promise<bigint>;
|
|
1308
1289
|
getBalanceForeignBifrost(address: string, asset: TAsset): Promise<bigint>;
|
|
1309
1290
|
getBalanceForeignAssetsAccount(address: string, assetId: bigint | number): Promise<bigint>;
|
|
1310
|
-
|
|
1291
|
+
getFromRpc(module: string, method: string, key: string): Promise<string>;
|
|
1292
|
+
blake2AsHex(data: Uint8Array): string;
|
|
1311
1293
|
clone(): IPolkadotApi<TApi, TRes>;
|
|
1312
1294
|
createApiForNode(node: TNodeWithRelayChains): Promise<IPolkadotApi<TApi, TRes>>;
|
|
1313
1295
|
getDryRun(options: TDryRunBaseOptions<TRes>): Promise<TDryRunResult>;
|
|
@@ -1324,8 +1306,13 @@ declare const getDryRun: <TApi, TRes>(options: TDryRunOptions<TApi, TRes>) => Pr
|
|
|
1324
1306
|
|
|
1325
1307
|
declare const transferMoonbeamEvm: <TApi, TRes>({ api, from, to, signer, address, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
|
|
1326
1308
|
|
|
1309
|
+
declare const transferMoonbeamToEth: <TApi, TRes>({ api, from, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
|
|
1310
|
+
|
|
1327
1311
|
declare const getParaEthTransferFees: <TApi, TRes>(ahApi: IPolkadotApi<TApi, TRes>) => Promise<[bigint, bigint]>;
|
|
1328
1312
|
|
|
1313
|
+
declare const isEthersSigner: (signer: Signer | WalletClient) => signer is Signer;
|
|
1314
|
+
declare const isEthersContract: (contract: Contract | GetContractReturnType<Abi | readonly unknown[]>) => contract is Contract;
|
|
1315
|
+
|
|
1329
1316
|
declare const getAssetMultiLocation: (node: TNodeWithRelayChains, currency: TCurrencyInput) => TMultiLocation | null;
|
|
1330
1317
|
|
|
1331
1318
|
/**
|
|
@@ -1417,6 +1404,7 @@ declare const getAssetDecimals: (node: TNodeWithRelayChains, symbol: string) =>
|
|
|
1417
1404
|
* @returns The node name if found; otherwise, null.
|
|
1418
1405
|
*/
|
|
1419
1406
|
declare const getTNode: (paraId: number, ecosystem: TEcosystemType) => TNodeWithRelayChains | null;
|
|
1407
|
+
declare const hasDryRunSupport: (node: TNodeWithRelayChains) => boolean;
|
|
1420
1408
|
|
|
1421
1409
|
declare const getAssetBalanceInternal: <TApi, TRes>({ address, node, currency, api }: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
1422
1410
|
declare const getAssetBalance: <TApi, TRes>(options: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
@@ -1427,7 +1415,7 @@ declare const getBalanceNative: <TApi, TRes>(options: TGetBalanceNativeOptions<T
|
|
|
1427
1415
|
declare const getBalanceForeignInternal: <TApi, TRes>({ address, node, currency, api }: TGetBalanceForeignOptions<TApi, TRes>) => Promise<bigint>;
|
|
1428
1416
|
declare const getBalanceForeign: <TApi, TRes>(options: TGetBalanceForeignOptions<TApi, TRes>) => Promise<bigint>;
|
|
1429
1417
|
|
|
1430
|
-
declare const getOriginFeeDetailsInternal: <TApi, TRes>({ api, account, accountDestination,
|
|
1418
|
+
declare const getOriginFeeDetailsInternal: <TApi, TRes>({ api, account, accountDestination, currency, origin, destination, feeMarginPercentage }: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
|
|
1431
1419
|
declare const getOriginFeeDetails: <TApi, TRes>(options: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
|
|
1432
1420
|
|
|
1433
1421
|
declare const getTransferInfo: <TApi, TRes>({ origin, destination, accountOrigin, accountDestination, currency, api }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
|
|
@@ -1477,7 +1465,9 @@ declare const findBestMatches: <T extends {
|
|
|
1477
1465
|
declare const findAssetBySymbol: (node: TNodeWithRelayChains, destination: TNodeWithRelayChains | null, otherAssets: TForeignAsset[], nativeAssets: TNativeAsset[], symbol: TCurrencySymbolValue) => TAsset | undefined;
|
|
1478
1466
|
declare const findAssetById: (assets: TForeignAsset[], assetId: TCurrency) => TForeignAsset | undefined;
|
|
1479
1467
|
|
|
1480
|
-
declare const findAssetByMultiLocation: (foreignAssets: TForeignAsset[], multiLocation: string | TMultiLocation
|
|
1468
|
+
declare const findAssetByMultiLocation: (foreignAssets: TForeignAsset[], multiLocation: string | TMultiLocation) => TForeignAsset | undefined;
|
|
1469
|
+
|
|
1470
|
+
declare const verifyEdOnDestination: <TApi, TRes>(options: TVerifyEdOnDestinationOptions<TApi, TRes>) => Promise<boolean>;
|
|
1481
1471
|
|
|
1482
1472
|
/**
|
|
1483
1473
|
* Retrieves the default pallet for a specified node.
|
|
@@ -1513,7 +1503,7 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
|
|
|
1513
1503
|
private _currency;
|
|
1514
1504
|
private _paraIdTo?;
|
|
1515
1505
|
private _address;
|
|
1516
|
-
private
|
|
1506
|
+
private _senderAddress?;
|
|
1517
1507
|
private _version?;
|
|
1518
1508
|
private _pallet?;
|
|
1519
1509
|
private _method?;
|
|
@@ -1539,7 +1529,7 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
|
|
|
1539
1529
|
* @param node - The node from which to claim assets.
|
|
1540
1530
|
* @returns An instance of Builder
|
|
1541
1531
|
*/
|
|
1542
|
-
claimFrom(node: TNodeWithRelayChains): IFungibleBuilder<TRes>;
|
|
1532
|
+
claimFrom(node: TNodeWithRelayChains): IFungibleBuilder<TApi, TRes>;
|
|
1543
1533
|
/**
|
|
1544
1534
|
* Specifies the currency to be used in the transaction. Symbol, ID, multi-location or multi-asset.
|
|
1545
1535
|
*
|
|
@@ -1553,7 +1543,7 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
|
|
|
1553
1543
|
* @param address - The destination address.
|
|
1554
1544
|
* @returns An instance of Builder
|
|
1555
1545
|
*/
|
|
1556
|
-
address(address: TAddress,
|
|
1546
|
+
address(address: TAddress, senderAddress?: string): this;
|
|
1557
1547
|
/**
|
|
1558
1548
|
* Sets the XCM version to be used for the transfer.
|
|
1559
1549
|
*
|
|
@@ -1589,6 +1579,12 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
|
|
|
1589
1579
|
*/
|
|
1590
1580
|
build(): Promise<TRes>;
|
|
1591
1581
|
dryRun(senderAddress: string): Promise<TDryRunResult>;
|
|
1582
|
+
/**
|
|
1583
|
+
* Returns the API instance used by the builder.
|
|
1584
|
+
*
|
|
1585
|
+
* @returns The API instance.
|
|
1586
|
+
*/
|
|
1587
|
+
getApi(): TApi;
|
|
1592
1588
|
disconnect(): Promise<void>;
|
|
1593
1589
|
}
|
|
1594
1590
|
/**
|
|
@@ -1603,9 +1599,9 @@ declare const createX1Payload: (version: Version, junction: TJunction) => TJunct
|
|
|
1603
1599
|
|
|
1604
1600
|
declare const deepEqual: (obj1: unknown, obj2: unknown) => boolean;
|
|
1605
1601
|
|
|
1606
|
-
declare const generateAddressMultiLocationV4: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: TAddress) =>
|
|
1602
|
+
declare const generateAddressMultiLocationV4: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: TAddress) => TXcmVersioned<TMultiLocation>;
|
|
1607
1603
|
|
|
1608
|
-
declare const generateAddressPayload: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, scenario: TScenario, pallet: TPallet | null, recipientAddress: TAddress, version: Version, nodeId: number | undefined) =>
|
|
1604
|
+
declare const generateAddressPayload: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, scenario: TScenario, pallet: TPallet | null, recipientAddress: TAddress, version: Version, nodeId: number | undefined) => TXcmVersioned<TMultiLocation>;
|
|
1609
1605
|
|
|
1610
1606
|
declare const getFees: (scenario: TScenario) => number;
|
|
1611
1607
|
|
|
@@ -1760,4 +1756,4 @@ declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
|
|
|
1760
1756
|
*/
|
|
1761
1757
|
declare const getParaId: (node: TNodeWithRelayChains) => number;
|
|
1762
1758
|
|
|
1763
|
-
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type
|
|
1759
|
+
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, type OneKey, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEcosystemType, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVerifyEdOnDestinationOptions, type TVerifyEdOnDestinationOptionsBase, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TXcmVersioned, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaEthTransferFees, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasDryRunSupport, hasSupportForAsset, isEthersContract, isEthersSigner, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, validateAddress, verifyEdOnDestination };
|