@moonbeam-network/xcm-builder 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.d.ts CHANGED
@@ -472,15 +472,20 @@ declare function FeeBuilder(): {
472
472
  xcmPaymentApi: typeof xcmPaymentApi;
473
473
  };
474
474
 
475
+ declare enum Protocols {
476
+ TokenBridge = "TokenBridge",
477
+ AutomaticTokenBridge = "AutomaticTokenBridge",
478
+ ExecutorTokenBridge = "ExecutorTokenBridge"
479
+ }
475
480
  type WormholeTransferFunctions = 'tokenTransfer';
476
- type WormholeFunctionArgs = [
477
- TokenId,
478
- bigint,
479
- ChainAddress,
480
- ChainAddress,
481
- TokenTransfer.Protocol,
482
- Uint8Array?
483
- ];
481
+ interface WormholeFunctionArgs {
482
+ token: TokenId;
483
+ amount: bigint;
484
+ from: ChainAddress;
485
+ to: ChainAddress;
486
+ protocol: TokenTransfer.Protocol;
487
+ payload?: Uint8Array;
488
+ }
484
489
  interface WormholeConfigConstructorParams {
485
490
  args: WormholeFunctionArgs;
486
491
  func: WormholeTransferFunctions;
@@ -656,4 +661,4 @@ declare function MrlBuilder(): {
656
661
 
657
662
  declare const BATCH_CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000808";
658
663
 
659
- export { AssetMinBuilder, type AssetMinConfigBuilder, type AssetMinConfigBuilderParams, BATCH_CONTRACT_ABI, BATCH_CONTRACT_ADDRESS, BalanceBuilder, type BalanceBuilderParams, type BalanceConfigBuilder, type BuilderParams, type ConfigBuilder, ContractBuilder, ContractConfig, type ContractConfigBuilder, type ContractConfigConstructorParams, ERC20_ABI, type EquilibriumSystemBalanceData, type EvmFunctionArgs, EvmQueryConfig, type EvmQueryConfigParams, type EvmQueryFunctions, ExtrinsicBuilder, ExtrinsicConfig, type ExtrinsicConfigBuilder, type ExtrinsicConfigConstructorParams, FeeBuilder, type FeeConfigBuilder, type FeeConfigBuilderParams, type GetVersionedAssetId, type MoonbeamRuntimeXcmConfigAssetType, MrlBuilder, type MrlBuilderParams, type MrlConfigBuilder, type MrlExecuteBuilderParams, type MrlExecuteConfigBuilder, type PalletBalancesAccountDataOld, type Parents, type QueryConfigConstructorParams, SubstrateCallConfig, type SubstrateCallConfigConstructorParams, SubstrateQueryConfig, type TokensPalletAccountData, type Transact, WormholeConfig, type WormholeConfigConstructorParams, type WormholeFunctionArgs, type WormholeTransferFunctions, type XcmPaymentFeeProps, XcmVersion, calculateSystemAccountBalance, evm, substrate, wormhole, wormholeFactory };
664
+ export { AssetMinBuilder, type AssetMinConfigBuilder, type AssetMinConfigBuilderParams, BATCH_CONTRACT_ABI, BATCH_CONTRACT_ADDRESS, BalanceBuilder, type BalanceBuilderParams, type BalanceConfigBuilder, type BuilderParams, type ConfigBuilder, ContractBuilder, ContractConfig, type ContractConfigBuilder, type ContractConfigConstructorParams, ERC20_ABI, type EquilibriumSystemBalanceData, type EvmFunctionArgs, EvmQueryConfig, type EvmQueryConfigParams, type EvmQueryFunctions, ExtrinsicBuilder, ExtrinsicConfig, type ExtrinsicConfigBuilder, type ExtrinsicConfigConstructorParams, FeeBuilder, type FeeConfigBuilder, type FeeConfigBuilderParams, type GetVersionedAssetId, type MoonbeamRuntimeXcmConfigAssetType, MrlBuilder, type MrlBuilderParams, type MrlConfigBuilder, type MrlExecuteBuilderParams, type MrlExecuteConfigBuilder, type PalletBalancesAccountDataOld, type Parents, Protocols, type QueryConfigConstructorParams, SubstrateCallConfig, type SubstrateCallConfigConstructorParams, SubstrateQueryConfig, type TokensPalletAccountData, type Transact, WormholeConfig, type WormholeConfigConstructorParams, type WormholeFunctionArgs, type WormholeTransferFunctions, type XcmPaymentFeeProps, XcmVersion, calculateSystemAccountBalance, evm, substrate, wormhole, wormholeFactory };
package/build/index.mjs CHANGED
@@ -3999,6 +3999,12 @@ function Gmp() {
3999
3999
  import { convertAddressTo32Bytes } from "@moonbeam-network/xcm-utils";
4000
4000
 
4001
4001
  // src/mrl/providers/wormhole/wormhole/WormholeConfig.ts
4002
+ var Protocols = /* @__PURE__ */ ((Protocols2) => {
4003
+ Protocols2["TokenBridge"] = "TokenBridge";
4004
+ Protocols2["AutomaticTokenBridge"] = "AutomaticTokenBridge";
4005
+ Protocols2["ExecutorTokenBridge"] = "ExecutorTokenBridge";
4006
+ return Protocols2;
4007
+ })(Protocols || {});
4002
4008
  var WormholeConfig = class _WormholeConfig {
4003
4009
  args;
4004
4010
  func;
@@ -4077,14 +4083,14 @@ function wormhole() {
4077
4083
  isDestinationMoonChain || isDestinationEvmChain ? destinationAddress : GMP_CONTRACT_ADDRESS
4078
4084
  );
4079
4085
  return new WormholeConfig({
4080
- args: [
4081
- whAsset,
4082
- asset.amount,
4083
- whSourceAddress,
4084
- whDestinationAddress,
4085
- isAutomatic ? "AutomaticTokenBridge" : "TokenBridge",
4086
- isDestinationMoonChain || isDestinationEvmChain ? void 0 : getPayload({ destination, destinationAddress, moonApi })
4087
- ],
4086
+ args: {
4087
+ token: whAsset,
4088
+ amount: asset.amount,
4089
+ from: whSourceAddress,
4090
+ to: whDestinationAddress,
4091
+ protocol: isAutomatic ? "AutomaticTokenBridge" /* AutomaticTokenBridge */ : "TokenBridge" /* TokenBridge */,
4092
+ payload: isDestinationMoonChain || isDestinationEvmChain ? void 0 : getPayload({ destination, destinationAddress, moonApi })
4093
+ },
4088
4094
  func: "tokenTransfer"
4089
4095
  });
4090
4096
  }
@@ -5730,6 +5736,7 @@ export {
5730
5736
  ExtrinsicConfig,
5731
5737
  FeeBuilder,
5732
5738
  MrlBuilder,
5739
+ Protocols,
5733
5740
  SubstrateCallConfig,
5734
5741
  SubstrateQueryConfig,
5735
5742
  WormholeConfig,