@moonbeam-network/mrl 1.0.0-dev.163 → 3.0.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.d.mts +78 -0
- package/build/index.d.ts +7 -6
- package/build/index.mjs +6 -6
- package/build/index.mjs.map +1 -1
- package/package.json +18 -24
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { SourceChainTransferData, EvmSigner } from '@moonbeam-network/xcm-sdk';
|
|
2
|
+
import * as _moonbeam_network_xcm_types from '@moonbeam-network/xcm-types';
|
|
3
|
+
import { AssetAmount, EvmParachain, AnyChain, EvmChain, 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
|
+
moonChain: MoonChainTransferData;
|
|
21
|
+
source: SourceTransferData;
|
|
22
|
+
transfer(amount: bigint | number | string, isAutomatic: boolean, signers: Signers, statusCallback?: (params: ISubmittableResult) => void, sendOnlyRemoteExecution?: boolean): Promise<string[]>;
|
|
23
|
+
}
|
|
24
|
+
interface SourceTransferData extends SourceChainTransferData {
|
|
25
|
+
destinationFeeBalance: AssetAmount;
|
|
26
|
+
moonChainFeeBalance?: AssetAmount;
|
|
27
|
+
relayerFee?: AssetAmount;
|
|
28
|
+
feeBalance: AssetAmount;
|
|
29
|
+
max: AssetAmount;
|
|
30
|
+
}
|
|
31
|
+
interface DestinationTransferData extends ChainTransferData {
|
|
32
|
+
}
|
|
33
|
+
type MoonChainTransferData = Omit<ChainTransferData, 'min'> & {
|
|
34
|
+
chain: EvmParachain;
|
|
35
|
+
address: string;
|
|
36
|
+
feeBalance: AssetAmount;
|
|
37
|
+
};
|
|
38
|
+
interface ChainTransferData {
|
|
39
|
+
chain: AnyChain;
|
|
40
|
+
balance: AssetAmount;
|
|
41
|
+
fee: AssetAmount;
|
|
42
|
+
min: AssetAmount;
|
|
43
|
+
}
|
|
44
|
+
interface ExecuteTransferData {
|
|
45
|
+
vaa: TokenTransfer.VAA;
|
|
46
|
+
tokenTransfer: TokenTransfer;
|
|
47
|
+
executeTransfer(signer: EvmSigner): Promise<string>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface WormholeExecuteTransferParams {
|
|
51
|
+
txId: string;
|
|
52
|
+
chain: EvmChain | EvmParachain;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface MrlOptions {
|
|
56
|
+
configService?: ConfigService;
|
|
57
|
+
ecosystem?: Ecosystem;
|
|
58
|
+
}
|
|
59
|
+
declare function Mrl(options?: MrlOptions): {
|
|
60
|
+
sources: AnyChain[];
|
|
61
|
+
setSource(source: string | AnyChain): {
|
|
62
|
+
destinations: AnyChain[];
|
|
63
|
+
setDestination(destination: string | AnyChain): {
|
|
64
|
+
assets: _moonbeam_network_xcm_types.Asset[];
|
|
65
|
+
setAsset(asset: string | AnyAsset): {
|
|
66
|
+
setIsAutomatic(isAutomatic: boolean): {
|
|
67
|
+
setAddresses({ sourceAddress, destinationAddress, }: {
|
|
68
|
+
sourceAddress: string;
|
|
69
|
+
destinationAddress: string;
|
|
70
|
+
}): Promise<TransferData>;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
getExecuteTransferData({ txId, chain }: WormholeExecuteTransferParams): Promise<ExecuteTransferData>;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { type ChainTransferData, type DestinationTransferData, type ExecuteTransferData, type MoonChainTransferData, Mrl, type MrlOptions, type Signers, type SourceTransferData, type TransferData };
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SourceChainTransferData, EvmSigner } from '@moonbeam-network/xcm-sdk';
|
|
2
2
|
import * as _moonbeam_network_xcm_types from '@moonbeam-network/xcm-types';
|
|
3
|
-
import { AssetAmount, AnyChain, EvmChain,
|
|
3
|
+
import { AssetAmount, EvmParachain, AnyChain, EvmChain, Ecosystem, AnyAsset } from '@moonbeam-network/xcm-types';
|
|
4
4
|
import { Signer } from '@polkadot/api/types';
|
|
5
5
|
import { IKeyringPair, ISubmittableResult } from '@polkadot/types/types';
|
|
6
6
|
import { TokenTransfer } from '@wormhole-foundation/sdk-connect';
|
|
@@ -31,6 +31,7 @@ interface SourceTransferData extends SourceChainTransferData {
|
|
|
31
31
|
interface DestinationTransferData extends ChainTransferData {
|
|
32
32
|
}
|
|
33
33
|
type MoonChainTransferData = Omit<ChainTransferData, 'min'> & {
|
|
34
|
+
chain: EvmParachain;
|
|
34
35
|
address: string;
|
|
35
36
|
feeBalance: AssetAmount;
|
|
36
37
|
};
|
|
@@ -40,13 +41,13 @@ interface ChainTransferData {
|
|
|
40
41
|
fee: AssetAmount;
|
|
41
42
|
min: AssetAmount;
|
|
42
43
|
}
|
|
43
|
-
interface
|
|
44
|
+
interface ExecuteTransferData {
|
|
44
45
|
vaa: TokenTransfer.VAA;
|
|
45
46
|
tokenTransfer: TokenTransfer;
|
|
46
|
-
|
|
47
|
+
executeTransfer(signer: EvmSigner): Promise<string>;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
interface
|
|
50
|
+
interface WormholeExecuteTransferParams {
|
|
50
51
|
txId: string;
|
|
51
52
|
chain: EvmChain | EvmParachain;
|
|
52
53
|
}
|
|
@@ -71,7 +72,7 @@ declare function Mrl(options?: MrlOptions): {
|
|
|
71
72
|
};
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
|
-
|
|
75
|
+
getExecuteTransferData({ txId, chain }: WormholeExecuteTransferParams): Promise<ExecuteTransferData>;
|
|
75
76
|
};
|
|
76
77
|
|
|
77
|
-
export { type ChainTransferData, type DestinationTransferData, type MoonChainTransferData, Mrl, type MrlOptions, type
|
|
78
|
+
export { type ChainTransferData, type DestinationTransferData, type ExecuteTransferData, type MoonChainTransferData, Mrl, type MrlOptions, type Signers, type SourceTransferData, type TransferData };
|
package/build/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
// src/mrl.ts
|
|
8
8
|
import { ConfigService, mrlRoutesMap } from "@moonbeam-network/xcm-config";
|
|
9
9
|
|
|
10
|
-
// src/getTransferData/
|
|
10
|
+
// src/getTransferData/getExecuteTransferData.ts
|
|
11
11
|
import { MrlBuilder } from "@moonbeam-network/xcm-builder";
|
|
12
12
|
import { EvmService } from "@moonbeam-network/xcm-sdk";
|
|
13
13
|
|
|
@@ -11043,8 +11043,8 @@ var WormholeService = class _WormholeService {
|
|
|
11043
11043
|
}
|
|
11044
11044
|
};
|
|
11045
11045
|
|
|
11046
|
-
// src/getTransferData/
|
|
11047
|
-
async function
|
|
11046
|
+
// src/getTransferData/getExecuteTransferData.ts
|
|
11047
|
+
async function getExecuteTransferData({
|
|
11048
11048
|
txId,
|
|
11049
11049
|
chain
|
|
11050
11050
|
}) {
|
|
@@ -11058,7 +11058,7 @@ async function getRedeemData({
|
|
|
11058
11058
|
return {
|
|
11059
11059
|
vaa,
|
|
11060
11060
|
tokenTransfer,
|
|
11061
|
-
async
|
|
11061
|
+
async executeTransfer(signer) {
|
|
11062
11062
|
const isComplete = await wh.isComplete(vaa, tokenTransfer);
|
|
11063
11063
|
if (isComplete) {
|
|
11064
11064
|
throw new Error("This transaction is already finalized in Wormhole");
|
|
@@ -11744,8 +11744,8 @@ function Mrl(options) {
|
|
|
11744
11744
|
}
|
|
11745
11745
|
};
|
|
11746
11746
|
},
|
|
11747
|
-
|
|
11748
|
-
return
|
|
11747
|
+
getExecuteTransferData({ txId, chain }) {
|
|
11748
|
+
return getExecuteTransferData({ txId, chain });
|
|
11749
11749
|
}
|
|
11750
11750
|
};
|
|
11751
11751
|
}
|