@moonbeam-network/mrl 1.0.0-dev.279 → 1.0.0-dev.280
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 +6 -15
- package/build/index.mjs.map +1 -1
- package/package.json +6 -6
package/build/index.mjs
CHANGED
|
@@ -16808,7 +16808,6 @@ import {
|
|
|
16808
16808
|
} from "@moonbeam-network/xcm-builder";
|
|
16809
16809
|
import { EvmService as EvmService2 } from "@moonbeam-network/xcm-sdk";
|
|
16810
16810
|
import { EvmChain } from "@moonbeam-network/xcm-types";
|
|
16811
|
-
import { isEthAddress } from "@moonbeam-network/xcm-utils";
|
|
16812
16811
|
import { u8aToHex } from "@polkadot/util";
|
|
16813
16812
|
import { decodeAddress } from "@polkadot/util-crypto";
|
|
16814
16813
|
import { encodeFunctionData } from "viem";
|
|
@@ -16874,17 +16873,16 @@ var SnowbridgeService = class _SnowbridgeService {
|
|
|
16874
16873
|
requiresApproval
|
|
16875
16874
|
} = args;
|
|
16876
16875
|
const value = requiresApproval ? bridgeFeeAmount : amount + bridgeFeeAmount;
|
|
16877
|
-
const isEthereumDestination = isEthAddress(destinationAddress);
|
|
16878
|
-
const destination = isEthereumDestination ? { kind: 2, data: destinationAddress } : { kind: 1, data: u8aToHex(decodeAddress(destinationAddress)) };
|
|
16879
16876
|
const contractArgs = [
|
|
16880
16877
|
tokenAddress,
|
|
16881
16878
|
destinationParaId,
|
|
16882
|
-
|
|
16883
|
-
|
|
16884
|
-
|
|
16879
|
+
{
|
|
16880
|
+
kind: 1,
|
|
16881
|
+
data: u8aToHex(decodeAddress(destinationAddress))
|
|
16882
|
+
},
|
|
16883
|
+
0n,
|
|
16885
16884
|
amount
|
|
16886
16885
|
];
|
|
16887
|
-
console.log("contractArgs", contractArgs);
|
|
16888
16886
|
return new ContractConfig({
|
|
16889
16887
|
address: this.#gatewayAddress,
|
|
16890
16888
|
abi: GATEWAY_ABI,
|
|
@@ -16963,10 +16961,7 @@ var SnowbridgeService = class _SnowbridgeService {
|
|
|
16963
16961
|
// src/getTransferData/getBridgeChainData.ts
|
|
16964
16962
|
import { getBalance, getDestinationFee } from "@moonbeam-network/xcm-sdk";
|
|
16965
16963
|
import { EvmParachain, Parachain } from "@moonbeam-network/xcm-types";
|
|
16966
|
-
import {
|
|
16967
|
-
getMultilocationDerivedAddresses,
|
|
16968
|
-
isEthAddress as isEthAddress2
|
|
16969
|
-
} from "@moonbeam-network/xcm-utils";
|
|
16964
|
+
import { getMultilocationDerivedAddresses } from "@moonbeam-network/xcm-utils";
|
|
16970
16965
|
import { evmToAddress } from "@polkadot/util-crypto";
|
|
16971
16966
|
async function getBridgeChainData({
|
|
16972
16967
|
route,
|
|
@@ -17023,10 +17018,6 @@ function getBridgeChainAddress({
|
|
|
17023
17018
|
const isDestinationBridgeChain = bridgeChain.isEqual(destination);
|
|
17024
17019
|
const isSourceBridgeChain = bridgeChain.isEqual(source);
|
|
17025
17020
|
let bridgeChainAddress = isDestinationBridgeChain ? destinationAddress : sourceAddress;
|
|
17026
|
-
if (Parachain.isExactly(bridgeChain) && isEthAddress2(bridgeChainAddress)) {
|
|
17027
|
-
bridgeChainAddress = evmToAddress(bridgeChainAddress);
|
|
17028
|
-
return bridgeChainAddress;
|
|
17029
|
-
}
|
|
17030
17021
|
if (Parachain.is(source) && !isSourceBridgeChain) {
|
|
17031
17022
|
const isSourceEvmSigner = EvmParachain.is(source) && source.isEvmSigner;
|
|
17032
17023
|
const { address20: computedOriginAccount } = getMultilocationDerivedAddresses({
|