@moonbeam-network/xcm-builder 1.0.0-dev.213 → 1.0.0-dev.214

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, Wormhole } from '@wormhole-foundation/sdk-connect';
9
9
 
10
10
  interface ConfigBuilder<Config, Params = BuilderParams> {
11
11
  build: (params: Params) => Config;
@@ -470,7 +470,27 @@ declare function FeeBuilder(): {
470
470
  };
471
471
 
472
472
  type WormholeTransferFunctions = 'tokenTransfer';
473
- type WormholeFunctionArgs = Parameters<Wormhole<Network>[WormholeTransferFunctions]>;
473
+ type WormholeFunctionArgs = [
474
+ token: TokenId,
475
+ amount: bigint,
476
+ from: ChainAddress,
477
+ to: ChainAddress,
478
+ protocol: 'TokenBridge',
479
+ payload?: Uint8Array
480
+ ] | [
481
+ token: TokenId,
482
+ amount: bigint,
483
+ from: ChainAddress,
484
+ to: ChainAddress,
485
+ protocol: 'AutomaticTokenBridge',
486
+ nativeGas?: bigint
487
+ ] | [
488
+ token: TokenId,
489
+ amount: bigint,
490
+ from: ChainAddress,
491
+ to: ChainAddress,
492
+ protocol: 'ExecutorTokenBridge'
493
+ ];
474
494
  interface WormholeConfigConstructorParams {
475
495
  args: WormholeFunctionArgs;
476
496
  func: WormholeTransferFunctions;
@@ -486,7 +506,7 @@ declare function wormhole$1(): {
486
506
  tokenTransfer: () => MrlConfigBuilder;
487
507
  };
488
508
 
489
- declare function wormholeFactory(chain: AnyChain): Wormhole<"Mainnet" | "Testnet">;
509
+ declare function wormholeFactory(chain: AnyChain): Wormhole<"Testnet" | "Mainnet">;
490
510
 
491
511
  type MrlConfigBuilder = ConfigBuilder<ContractConfig | ExtrinsicConfig | WormholeConfig, MrlBuilderParams>;
492
512
  type MrlExecuteConfigBuilder = ConfigBuilder<ContractConfig, MrlExecuteBuilderParams>;
package/build/index.mjs CHANGED
@@ -3959,13 +3959,25 @@ function wormhole() {
3959
3959
  isDestinationMoonChain || isDestinationEvmChain ? destinationAddress : GMP_CONTRACT_ADDRESS
3960
3960
  );
3961
3961
  return new WormholeConfig({
3962
- args: [
3962
+ args: isAutomatic ? [
3963
+ whAsset,
3964
+ asset.amount,
3965
+ whSourceAddress,
3966
+ whDestinationAddress,
3967
+ "AutomaticTokenBridge"
3968
+ ] : isDestinationMoonChain || isDestinationEvmChain ? [
3969
+ whAsset,
3970
+ asset.amount,
3971
+ whSourceAddress,
3972
+ whDestinationAddress,
3973
+ "ExecutorTokenBridge"
3974
+ ] : [
3963
3975
  whAsset,
3964
3976
  asset.amount,
3965
3977
  whSourceAddress,
3966
3978
  whDestinationAddress,
3967
- isAutomatic,
3968
- isDestinationMoonChain || isDestinationEvmChain ? void 0 : getPayload({ destination, destinationAddress, moonApi })
3979
+ "TokenBridge",
3980
+ getPayload({ destination, destinationAddress, moonApi })
3969
3981
  ],
3970
3982
  func: "tokenTransfer"
3971
3983
  });