@moonbeam-network/mrl 1.0.0-dev.224 → 1.0.0-dev.225
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.mjs +11 -10
- package/build/index.mjs.map +1 -1
- package/package.json +6 -6
package/build/index.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import { EvmService } from "@moonbeam-network/xcm-sdk";
|
|
|
17
17
|
|
|
18
18
|
// src/services/wormhole/WormholeService.ts
|
|
19
19
|
import {
|
|
20
|
+
Protocols,
|
|
20
21
|
wormholeFactory
|
|
21
22
|
} from "@moonbeam-network/xcm-builder";
|
|
22
23
|
|
|
@@ -16591,23 +16592,23 @@ var WormholeService = class _WormholeService {
|
|
|
16591
16592
|
this.#wh = wormholeFactory(chain2);
|
|
16592
16593
|
}
|
|
16593
16594
|
async createTokenTransfer(transfer) {
|
|
16594
|
-
const
|
|
16595
|
-
if (protocol ===
|
|
16595
|
+
const { token, amount, from, to, protocol, payload: payload2 } = transfer.args;
|
|
16596
|
+
if (protocol === Protocols.TokenBridge) {
|
|
16596
16597
|
return await this.#wh[transfer.func](
|
|
16597
16598
|
token,
|
|
16598
|
-
|
|
16599
|
+
amount,
|
|
16599
16600
|
from,
|
|
16600
16601
|
to,
|
|
16601
|
-
|
|
16602
|
+
protocol,
|
|
16602
16603
|
payload2
|
|
16603
16604
|
);
|
|
16604
|
-
} else if (protocol ===
|
|
16605
|
+
} else if (protocol === Protocols.AutomaticTokenBridge) {
|
|
16605
16606
|
return await this.#wh[transfer.func](
|
|
16606
16607
|
token,
|
|
16607
|
-
|
|
16608
|
+
amount,
|
|
16608
16609
|
from,
|
|
16609
16610
|
to,
|
|
16610
|
-
|
|
16611
|
+
protocol,
|
|
16611
16612
|
// For AutomaticTokenBridge, the 6th parameter is nativeGas (bigint), not payload
|
|
16612
16613
|
payload2 ? 0n : void 0
|
|
16613
16614
|
);
|
|
@@ -16616,13 +16617,13 @@ var WormholeService = class _WormholeService {
|
|
|
16616
16617
|
}
|
|
16617
16618
|
}
|
|
16618
16619
|
async getFee(transfer) {
|
|
16619
|
-
const amount = transfer.args
|
|
16620
|
+
const { amount } = transfer.args;
|
|
16620
16621
|
if (amount === 0n) {
|
|
16621
16622
|
return void 0;
|
|
16622
16623
|
}
|
|
16623
16624
|
const xfer = await this.createTokenTransfer(transfer);
|
|
16624
|
-
if (xfer.transfer.protocol ===
|
|
16625
|
-
throw new Error(
|
|
16625
|
+
if (xfer.transfer.protocol === Protocols.ExecutorTokenBridge) {
|
|
16626
|
+
throw new Error(`${Protocols.ExecutorTokenBridge} is not supported`);
|
|
16626
16627
|
}
|
|
16627
16628
|
return TokenTransfer.quoteTransfer(
|
|
16628
16629
|
this.#wh,
|