@moonbeam-network/xcm-builder 3.3.8 → 3.3.9

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
@@ -5,7 +5,7 @@ import { Struct, u128, Enum } from '@polkadot/types';
5
5
  import { Abi, PublicClient, HttpTransport } from 'viem';
6
6
  import { SubmittableExtrinsicFunction } from '@polkadot/api/types';
7
7
  import { HexString } from '@polkadot/util/types';
8
- import { Wormhole, Network } from '@wormhole-foundation/sdk-connect';
8
+ import { TokenId, ChainAddress, TokenTransfer, Wormhole } from '@wormhole-foundation/sdk-connect';
9
9
 
10
10
  interface ConfigBuilder<Config, Params = BuilderParams> {
11
11
  build: (params: Params) => Config;
@@ -472,8 +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 = Parameters<Wormhole<Network>[WormholeTransferFunctions]>;
481
+ interface WormholeFunctionArgs {
482
+ token: TokenId;
483
+ amount: bigint;
484
+ from: ChainAddress;
485
+ to: ChainAddress;
486
+ protocol: TokenTransfer.Protocol;
487
+ payload?: Uint8Array;
488
+ }
477
489
  interface WormholeConfigConstructorParams {
478
490
  args: WormholeFunctionArgs;
479
491
  func: WormholeTransferFunctions;
@@ -489,7 +501,7 @@ declare function wormhole$1(): {
489
501
  tokenTransfer: () => MrlConfigBuilder;
490
502
  };
491
503
 
492
- declare function wormholeFactory(chain: AnyChain): Wormhole<"Mainnet" | "Testnet">;
504
+ declare function wormholeFactory(chain: AnyChain): Wormhole<"Testnet" | "Mainnet">;
493
505
 
494
506
  type MrlConfigBuilder = ConfigBuilder<ContractConfig | ExtrinsicConfig | WormholeConfig, MrlBuilderParams>;
495
507
  type MrlExecuteConfigBuilder = ConfigBuilder<ContractConfig, MrlExecuteBuilderParams>;
@@ -649,4 +661,4 @@ declare function MrlBuilder(): {
649
661
 
650
662
  declare const BATCH_CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000808";
651
663
 
652
- 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,
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,