@moonbeam-network/mrl 4.2.6 → 4.3.1
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.d.mts +95 -0
- package/build/index.d.ts +1 -1
- package/build/index.mjs +149 -125
- package/build/index.mjs.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { EvmSigner, SourceChainTransferData } from '@moonbeam-network/xcm-sdk';
|
|
2
|
+
import * as _moonbeam_network_xcm_types from '@moonbeam-network/xcm-types';
|
|
3
|
+
import { AnyChain, AssetAmount, Parachain, EvmChain, EvmParachain, Ecosystem, AnyAsset } from '@moonbeam-network/xcm-types';
|
|
4
|
+
import { Signer } from '@polkadot/api/types';
|
|
5
|
+
import { IKeyringPair, ISubmittableResult } from '@polkadot/types/types';
|
|
6
|
+
import { TokenTransfer } from '@wormhole-foundation/sdk-connect';
|
|
7
|
+
import { WalletClient } from 'viem';
|
|
8
|
+
import { ConfigService } from '@moonbeam-network/xcm-config';
|
|
9
|
+
|
|
10
|
+
interface Signers {
|
|
11
|
+
evmSigner?: WalletClient;
|
|
12
|
+
polkadotSigner?: Signer | IKeyringPair;
|
|
13
|
+
}
|
|
14
|
+
interface TransferData {
|
|
15
|
+
destination: DestinationTransferData;
|
|
16
|
+
getEstimate(amount: number | string): AssetAmount;
|
|
17
|
+
isAutomaticPossible: boolean;
|
|
18
|
+
max: AssetAmount;
|
|
19
|
+
min: AssetAmount;
|
|
20
|
+
bridgeChain: BridgeChainTransferData;
|
|
21
|
+
source: SourceTransferData;
|
|
22
|
+
transfer(params: TransferParams): Promise<string[]>;
|
|
23
|
+
}
|
|
24
|
+
interface TransferParams {
|
|
25
|
+
amount: number | string;
|
|
26
|
+
isAutomatic: boolean;
|
|
27
|
+
signers: Signers;
|
|
28
|
+
statusCallback?: (status: ISubmittableResult) => void;
|
|
29
|
+
sendOnlyRemoteExecution?: boolean;
|
|
30
|
+
}
|
|
31
|
+
interface FeeWithBalance {
|
|
32
|
+
fee: AssetAmount;
|
|
33
|
+
balance: AssetAmount;
|
|
34
|
+
}
|
|
35
|
+
interface MrlExtraFees {
|
|
36
|
+
/** Deducted from source balance */
|
|
37
|
+
local?: FeeWithBalance;
|
|
38
|
+
/** Deducted from transfer amount*/
|
|
39
|
+
remote?: FeeWithBalance;
|
|
40
|
+
}
|
|
41
|
+
interface SourceTransferData extends SourceChainTransferData {
|
|
42
|
+
destinationFeeBalance: AssetAmount;
|
|
43
|
+
bridgeChainFeeBalance?: AssetAmount;
|
|
44
|
+
feeBalance: AssetAmount;
|
|
45
|
+
max: AssetAmount;
|
|
46
|
+
extraFees: MrlExtraFees;
|
|
47
|
+
}
|
|
48
|
+
interface DestinationTransferData extends ChainTransferData {
|
|
49
|
+
}
|
|
50
|
+
type BridgeChainTransferData = Omit<ChainTransferData, 'min'> & {
|
|
51
|
+
chain: Parachain;
|
|
52
|
+
address: string;
|
|
53
|
+
feeBalance: AssetAmount;
|
|
54
|
+
};
|
|
55
|
+
interface ChainTransferData {
|
|
56
|
+
chain: AnyChain;
|
|
57
|
+
balance: AssetAmount;
|
|
58
|
+
fee: AssetAmount;
|
|
59
|
+
min: AssetAmount;
|
|
60
|
+
}
|
|
61
|
+
interface ExecuteTransferData {
|
|
62
|
+
vaa: TokenTransfer.VAA;
|
|
63
|
+
tokenTransfer: TokenTransfer;
|
|
64
|
+
executeTransfer(signer: EvmSigner): Promise<string>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface WormholeExecuteTransferParams {
|
|
68
|
+
txId: string;
|
|
69
|
+
chain: EvmChain | EvmParachain;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface MrlOptions {
|
|
73
|
+
configService?: ConfigService;
|
|
74
|
+
ecosystem?: Ecosystem;
|
|
75
|
+
}
|
|
76
|
+
declare function Mrl(options?: MrlOptions): {
|
|
77
|
+
sources: AnyChain[];
|
|
78
|
+
setSource(source: string | AnyChain): {
|
|
79
|
+
destinations: AnyChain[];
|
|
80
|
+
setDestination(destination: string | AnyChain): {
|
|
81
|
+
assets: _moonbeam_network_xcm_types.Asset[];
|
|
82
|
+
setAsset(asset: string | AnyAsset): {
|
|
83
|
+
setIsAutomatic(isAutomatic: boolean): {
|
|
84
|
+
setAddresses({ sourceAddress, destinationAddress, }: {
|
|
85
|
+
sourceAddress: string;
|
|
86
|
+
destinationAddress: string;
|
|
87
|
+
}): Promise<TransferData>;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
getExecuteTransferData({ txId, chain }: WormholeExecuteTransferParams): Promise<ExecuteTransferData>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export { type BridgeChainTransferData, type ChainTransferData, type DestinationTransferData, type ExecuteTransferData, type FeeWithBalance, Mrl, type MrlExtraFees, type MrlOptions, type Signers, type SourceTransferData, type TransferData, type TransferParams };
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EvmSigner, SourceChainTransferData } from '@moonbeam-network/xcm-sdk';
|
|
2
2
|
import * as _moonbeam_network_xcm_types from '@moonbeam-network/xcm-types';
|
|
3
3
|
import { AnyChain, AssetAmount, Parachain, EvmChain, EvmParachain, Ecosystem, AnyAsset } from '@moonbeam-network/xcm-types';
|
|
4
4
|
import { Signer } from '@polkadot/api/types';
|