@layerzerolabs/lz-movevm-sdk-v2 3.0.85 → 3.0.86

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/dist/index.d.mts CHANGED
@@ -190,6 +190,9 @@ interface ArbitrumPriceTraits {
190
190
  arbitrumGasPerL1CalldataByte: bigint;
191
191
  }
192
192
 
193
+ declare function serializeExecutorConfig(config: ExecutorConfig): Uint8Array;
194
+ declare function deserializeExecutorConfig(data: string | Uint8Array): ExecutorConfig;
195
+
193
196
  /**
194
197
  * Deserializes the ULN configuration from a string or Uint8Array.
195
198
  *
@@ -197,6 +200,7 @@ interface ArbitrumPriceTraits {
197
200
  * @returns {UlnConfig} The deserialized ULN configuration.
198
201
  */
199
202
  declare function deserializeUlnConfig(data: string | Uint8Array): UlnConfig;
203
+ declare function serializeUlnConfig(config: UlnConfig): Uint8Array;
200
204
 
201
205
  /**
202
206
  * Serializes an array of UpdatePrice objects into a Uint8Array.
@@ -300,11 +304,14 @@ type index_ArbitrumPriceTraits = ArbitrumPriceTraits;
300
304
  type index_VERIFICATION_STATE = VERIFICATION_STATE;
301
305
  declare const index_VERIFICATION_STATE: typeof VERIFICATION_STATE;
302
306
  type index_WorkerPriceFeedConfig = WorkerPriceFeedConfig;
307
+ declare const index_deserializeExecutorConfig: typeof deserializeExecutorConfig;
303
308
  declare const index_deserializeUlnConfig: typeof deserializeUlnConfig;
309
+ declare const index_serializeExecutorConfig: typeof serializeExecutorConfig;
310
+ declare const index_serializeUlnConfig: typeof serializeUlnConfig;
304
311
  declare const index_serializeUpdatePrices: typeof serializeUpdatePrices;
305
312
  declare const index_verificationStateValueOf: typeof verificationStateValueOf;
306
313
  declare namespace index {
307
- export { type index_ArbitrumPriceTraits as ArbitrumPriceTraits, index_ConfigType as ConfigType, type index_DVNDstConfig as DVNDstConfig, type index_ExecutorConfig as ExecutorConfig, type index_ExecutorConfigResponse as ExecutorConfigResponse, type index_ExecutorDstConfig as ExecutorDstConfig, type index_Metadata as Metadata, type index_OftFeeDetail as OftFeeDetail, type index_OftLimit as OftLimit, type index_OftTokenInfo as OftTokenInfo, type index_Price as Price, type index_Timeout as Timeout, type index_UlnConfig as UlnConfig, type index_UlnConfigResponse as UlnConfigResponse, type index_UpdatePrice as UpdatePrice, index_VERIFICATION_STATE as VERIFICATION_STATE, type index_WorkerPriceFeedConfig as WorkerPriceFeedConfig, index_deserializeUlnConfig as deserializeUlnConfig, index_serializeUpdatePrices as serializeUpdatePrices, index_verificationStateValueOf as verificationStateValueOf };
314
+ export { type index_ArbitrumPriceTraits as ArbitrumPriceTraits, index_ConfigType as ConfigType, type index_DVNDstConfig as DVNDstConfig, type index_ExecutorConfig as ExecutorConfig, type index_ExecutorConfigResponse as ExecutorConfigResponse, type index_ExecutorDstConfig as ExecutorDstConfig, type index_Metadata as Metadata, type index_OftFeeDetail as OftFeeDetail, type index_OftLimit as OftLimit, type index_OftTokenInfo as OftTokenInfo, type index_Price as Price, type index_Timeout as Timeout, type index_UlnConfig as UlnConfig, type index_UlnConfigResponse as UlnConfigResponse, type index_UpdatePrice as UpdatePrice, index_VERIFICATION_STATE as VERIFICATION_STATE, type index_WorkerPriceFeedConfig as WorkerPriceFeedConfig, index_deserializeExecutorConfig as deserializeExecutorConfig, index_deserializeUlnConfig as deserializeUlnConfig, index_serializeExecutorConfig as serializeExecutorConfig, index_serializeUlnConfig as serializeUlnConfig, index_serializeUpdatePrices as serializeUpdatePrices, index_verificationStateValueOf as verificationStateValueOf };
308
315
  }
309
316
 
310
317
  /**
@@ -620,6 +627,7 @@ declare class DvnWorker<AccountType> {
620
627
  * @returns {Promise<Uint8Array>} The verify hash.
621
628
  */
622
629
  createVerifyHash(packetHeader: Uint8Array, payloadHash: Uint8Array, confirmations: bigint, target: string, vid: number, expiration: bigint): Promise<Uint8Array>;
630
+ createSetMsgLibsHash(msglibs: string[], vid: number, expiration: bigint): Promise<Uint8Array>;
623
631
  /**
624
632
  * Creates a payload for initializing the DVN contract.
625
633
  *
@@ -638,6 +646,13 @@ declare class DvnWorker<AccountType> {
638
646
  * @returns {Promise<boolean>} True if the DVN contract is initialized, false otherwise.
639
647
  */
640
648
  isInitialize(): Promise<boolean>;
649
+ createSetWorkerConfigForFeeLibRoutingOptInForUln301Payload(uln301Address: string): Promise<InputEntryFunctionData>;
650
+ /**
651
+ * Gets the opt in/out status of a worker
652
+ * @param uln301Address - The ULN 301 address
653
+ * @returns {Promise<boolean>} The opt in/out status of the worker
654
+ */
655
+ getWorkerConfigForFeeLibRoutingOptIn(uln301Address: string): Promise<boolean>;
641
656
  /**
642
657
  * Gets the destination configuration for the specified endpoint.
643
658
  *
@@ -645,6 +660,19 @@ declare class DvnWorker<AccountType> {
645
660
  * @returns {Promise<DVNDstConfig>} The destination configuration.
646
661
  */
647
662
  getDstConfig(dstEid: EndpointId): Promise<DVNDstConfig>;
663
+ /**
664
+ * Creates a payload for setting the supported message libraries.
665
+ *
666
+ * @param {string[]} msglibs - The supported message libraries.
667
+ * @returns {InputEntryFunctionData} The input entry function data.
668
+ */
669
+ createSetSupportedMsglibsPayload(msglibs: string[], expiration: number, signatures: string): InputEntryFunctionData;
670
+ /**
671
+ * Gets the supported message libraries.
672
+ *
673
+ * @returns {Promise<string[]>} The supported message libraries.
674
+ */
675
+ getSupportedMsglibs(): Promise<string[]>;
648
676
  /**
649
677
  * Creates a payload for setting the destination configuration.
650
678
  *
@@ -1116,6 +1144,13 @@ declare class Executor<AccountType> {
1116
1144
  * @returns {Promise<TransactionResponse>} The transaction response.
1117
1145
  */
1118
1146
  initialize(signer: AccountType | PrivateKey | MnemonicAndPath, roleAdmin: string, admins: string[], msgLibs: string[], feeLib: string, depositAddress?: string, gasOptions?: GasOptions): Promise<TransactionResponse>;
1147
+ createSetWorkerConfigForFeeLibRoutingOptInForUln301Payload(uln301Address: string): Promise<InputEntryFunctionData>;
1148
+ /**
1149
+ * Gets the opt in/out status of a worker
1150
+ * @param uln301Address - The ULN 301 address
1151
+ * @returns {Promise<boolean>} The opt in/out status of the worker
1152
+ */
1153
+ getWorkerConfigForFeeLibRoutingOptIn(uln301Address: string): Promise<boolean>;
1119
1154
  /**
1120
1155
  * Gets the destination configuration for the specified endpoint.
1121
1156
  *
package/dist/index.d.ts CHANGED
@@ -190,6 +190,9 @@ interface ArbitrumPriceTraits {
190
190
  arbitrumGasPerL1CalldataByte: bigint;
191
191
  }
192
192
 
193
+ declare function serializeExecutorConfig(config: ExecutorConfig): Uint8Array;
194
+ declare function deserializeExecutorConfig(data: string | Uint8Array): ExecutorConfig;
195
+
193
196
  /**
194
197
  * Deserializes the ULN configuration from a string or Uint8Array.
195
198
  *
@@ -197,6 +200,7 @@ interface ArbitrumPriceTraits {
197
200
  * @returns {UlnConfig} The deserialized ULN configuration.
198
201
  */
199
202
  declare function deserializeUlnConfig(data: string | Uint8Array): UlnConfig;
203
+ declare function serializeUlnConfig(config: UlnConfig): Uint8Array;
200
204
 
201
205
  /**
202
206
  * Serializes an array of UpdatePrice objects into a Uint8Array.
@@ -300,11 +304,14 @@ type index_ArbitrumPriceTraits = ArbitrumPriceTraits;
300
304
  type index_VERIFICATION_STATE = VERIFICATION_STATE;
301
305
  declare const index_VERIFICATION_STATE: typeof VERIFICATION_STATE;
302
306
  type index_WorkerPriceFeedConfig = WorkerPriceFeedConfig;
307
+ declare const index_deserializeExecutorConfig: typeof deserializeExecutorConfig;
303
308
  declare const index_deserializeUlnConfig: typeof deserializeUlnConfig;
309
+ declare const index_serializeExecutorConfig: typeof serializeExecutorConfig;
310
+ declare const index_serializeUlnConfig: typeof serializeUlnConfig;
304
311
  declare const index_serializeUpdatePrices: typeof serializeUpdatePrices;
305
312
  declare const index_verificationStateValueOf: typeof verificationStateValueOf;
306
313
  declare namespace index {
307
- export { type index_ArbitrumPriceTraits as ArbitrumPriceTraits, index_ConfigType as ConfigType, type index_DVNDstConfig as DVNDstConfig, type index_ExecutorConfig as ExecutorConfig, type index_ExecutorConfigResponse as ExecutorConfigResponse, type index_ExecutorDstConfig as ExecutorDstConfig, type index_Metadata as Metadata, type index_OftFeeDetail as OftFeeDetail, type index_OftLimit as OftLimit, type index_OftTokenInfo as OftTokenInfo, type index_Price as Price, type index_Timeout as Timeout, type index_UlnConfig as UlnConfig, type index_UlnConfigResponse as UlnConfigResponse, type index_UpdatePrice as UpdatePrice, index_VERIFICATION_STATE as VERIFICATION_STATE, type index_WorkerPriceFeedConfig as WorkerPriceFeedConfig, index_deserializeUlnConfig as deserializeUlnConfig, index_serializeUpdatePrices as serializeUpdatePrices, index_verificationStateValueOf as verificationStateValueOf };
314
+ export { type index_ArbitrumPriceTraits as ArbitrumPriceTraits, index_ConfigType as ConfigType, type index_DVNDstConfig as DVNDstConfig, type index_ExecutorConfig as ExecutorConfig, type index_ExecutorConfigResponse as ExecutorConfigResponse, type index_ExecutorDstConfig as ExecutorDstConfig, type index_Metadata as Metadata, type index_OftFeeDetail as OftFeeDetail, type index_OftLimit as OftLimit, type index_OftTokenInfo as OftTokenInfo, type index_Price as Price, type index_Timeout as Timeout, type index_UlnConfig as UlnConfig, type index_UlnConfigResponse as UlnConfigResponse, type index_UpdatePrice as UpdatePrice, index_VERIFICATION_STATE as VERIFICATION_STATE, type index_WorkerPriceFeedConfig as WorkerPriceFeedConfig, index_deserializeExecutorConfig as deserializeExecutorConfig, index_deserializeUlnConfig as deserializeUlnConfig, index_serializeExecutorConfig as serializeExecutorConfig, index_serializeUlnConfig as serializeUlnConfig, index_serializeUpdatePrices as serializeUpdatePrices, index_verificationStateValueOf as verificationStateValueOf };
308
315
  }
309
316
 
310
317
  /**
@@ -620,6 +627,7 @@ declare class DvnWorker<AccountType> {
620
627
  * @returns {Promise<Uint8Array>} The verify hash.
621
628
  */
622
629
  createVerifyHash(packetHeader: Uint8Array, payloadHash: Uint8Array, confirmations: bigint, target: string, vid: number, expiration: bigint): Promise<Uint8Array>;
630
+ createSetMsgLibsHash(msglibs: string[], vid: number, expiration: bigint): Promise<Uint8Array>;
623
631
  /**
624
632
  * Creates a payload for initializing the DVN contract.
625
633
  *
@@ -638,6 +646,13 @@ declare class DvnWorker<AccountType> {
638
646
  * @returns {Promise<boolean>} True if the DVN contract is initialized, false otherwise.
639
647
  */
640
648
  isInitialize(): Promise<boolean>;
649
+ createSetWorkerConfigForFeeLibRoutingOptInForUln301Payload(uln301Address: string): Promise<InputEntryFunctionData>;
650
+ /**
651
+ * Gets the opt in/out status of a worker
652
+ * @param uln301Address - The ULN 301 address
653
+ * @returns {Promise<boolean>} The opt in/out status of the worker
654
+ */
655
+ getWorkerConfigForFeeLibRoutingOptIn(uln301Address: string): Promise<boolean>;
641
656
  /**
642
657
  * Gets the destination configuration for the specified endpoint.
643
658
  *
@@ -645,6 +660,19 @@ declare class DvnWorker<AccountType> {
645
660
  * @returns {Promise<DVNDstConfig>} The destination configuration.
646
661
  */
647
662
  getDstConfig(dstEid: EndpointId): Promise<DVNDstConfig>;
663
+ /**
664
+ * Creates a payload for setting the supported message libraries.
665
+ *
666
+ * @param {string[]} msglibs - The supported message libraries.
667
+ * @returns {InputEntryFunctionData} The input entry function data.
668
+ */
669
+ createSetSupportedMsglibsPayload(msglibs: string[], expiration: number, signatures: string): InputEntryFunctionData;
670
+ /**
671
+ * Gets the supported message libraries.
672
+ *
673
+ * @returns {Promise<string[]>} The supported message libraries.
674
+ */
675
+ getSupportedMsglibs(): Promise<string[]>;
648
676
  /**
649
677
  * Creates a payload for setting the destination configuration.
650
678
  *
@@ -1116,6 +1144,13 @@ declare class Executor<AccountType> {
1116
1144
  * @returns {Promise<TransactionResponse>} The transaction response.
1117
1145
  */
1118
1146
  initialize(signer: AccountType | PrivateKey | MnemonicAndPath, roleAdmin: string, admins: string[], msgLibs: string[], feeLib: string, depositAddress?: string, gasOptions?: GasOptions): Promise<TransactionResponse>;
1147
+ createSetWorkerConfigForFeeLibRoutingOptInForUln301Payload(uln301Address: string): Promise<InputEntryFunctionData>;
1148
+ /**
1149
+ * Gets the opt in/out status of a worker
1150
+ * @param uln301Address - The ULN 301 address
1151
+ * @returns {Promise<boolean>} The opt in/out status of the worker
1152
+ */
1153
+ getWorkerConfigForFeeLibRoutingOptIn(uln301Address: string): Promise<boolean>;
1119
1154
  /**
1120
1155
  * Gets the destination configuration for the specified endpoint.
1121
1156
  *
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { Deserializer, Serializer } from '@layerzerolabs/lz-serdes';
2
- import { trim0x, arrayify, ensure0x, padify } from '@layerzerolabs/lz-utilities';
3
- import { addressToBytes32, trim0x as trim0x$1 } from '@layerzerolabs/lz-v2-utilities';
1
+ import { Serializer, Deserializer } from '@layerzerolabs/lz-serdes';
2
+ import { addressToBytes32, trim0x } from '@layerzerolabs/lz-v2-utilities';
3
+ import { trim0x as trim0x$1, ensure0x, arrayify, padify } from '@layerzerolabs/lz-utilities';
4
4
  import { MoveResourceNotFoundError, MoveAbortError } from '@layerzerolabs/move-definitions';
5
5
  import * as assert from 'assert';
6
6
 
@@ -15,7 +15,10 @@ var types_exports = {};
15
15
  __export(types_exports, {
16
16
  ConfigType: () => ConfigType,
17
17
  VERIFICATION_STATE: () => VERIFICATION_STATE,
18
+ deserializeExecutorConfig: () => deserializeExecutorConfig,
18
19
  deserializeUlnConfig: () => deserializeUlnConfig,
20
+ serializeExecutorConfig: () => serializeExecutorConfig,
21
+ serializeUlnConfig: () => serializeUlnConfig,
19
22
  serializeUpdatePrices: () => serializeUpdatePrices,
20
23
  verificationStateValueOf: () => verificationStateValueOf
21
24
  });
@@ -50,11 +53,26 @@ var ConfigType = /* @__PURE__ */ ((ConfigType2) => {
50
53
  ConfigType2[ConfigType2["receiveUln"] = 3] = "receiveUln";
51
54
  return ConfigType2;
52
55
  })(ConfigType || {});
53
- function deserializeUlnConfig(data) {
56
+ function serializeExecutorConfig(config) {
57
+ const serializer = new Serializer(false);
58
+ serializer.serializeU32(config.maxMessageSize);
59
+ serializer.serializeFixedBytes(addressToBytes32(config.executorAddress));
60
+ return serializer.getBytes();
61
+ }
62
+ function deserializeExecutorConfig(data) {
54
63
  if (typeof data === "string") {
55
64
  data = Uint8Array.from(Buffer.from(trim0x(data), "hex"));
56
65
  }
57
66
  const deserializer = new Deserializer(data, false);
67
+ const maxMessageSize = deserializer.deserializeU32();
68
+ const executorAddress = Buffer.from(deserializer.deserializeFixedBytes(32)).toString("hex");
69
+ return { maxMessageSize, executorAddress };
70
+ }
71
+ function deserializeUlnConfig(data) {
72
+ if (typeof data === "string") {
73
+ data = Uint8Array.from(Buffer.from(trim0x$1(data), "hex"));
74
+ }
75
+ const deserializer = new Deserializer(data, false);
58
76
  const confirmations = deserializer.deserializeU64();
59
77
  const optionalDVNThreshold = deserializer.deserializeU8();
60
78
  const requiredDVNCount = deserializer.deserializeU8();
@@ -80,6 +98,25 @@ function deserializeUlnConfig(data) {
80
98
  useDefaultForOptionalDVNs
81
99
  };
82
100
  }
101
+ function serializeUlnConfig(config) {
102
+ const serializer = new Serializer(false);
103
+ serializer.serializeU64(config.confirmations);
104
+ serializer.serializeU8(config.optionalDVNThreshold);
105
+ const requiredDVNCount = config.requiredDVNs.length;
106
+ serializer.serializeU8(requiredDVNCount);
107
+ for (const item of config.requiredDVNs) {
108
+ serializer.serializeFixedBytes(addressToBytes32(ensure0x(item)));
109
+ }
110
+ const optionalDVNCount = config.optionalDVNs.length;
111
+ serializer.serializeU8(optionalDVNCount);
112
+ for (const item of config.optionalDVNs) {
113
+ serializer.serializeFixedBytes(addressToBytes32(ensure0x(item)));
114
+ }
115
+ serializer.serializeBool(config.useDefaultForConfirmations);
116
+ serializer.serializeBool(config.useDefaultForRequiredDVNs);
117
+ serializer.serializeBool(config.useDefaultForOptionalDVNs);
118
+ return serializer.getBytes();
119
+ }
83
120
  function serializeUpdatePrices(updatePrices) {
84
121
  const serializer = new Serializer(false);
85
122
  for (const updatePrice of updatePrices) {
@@ -353,6 +390,15 @@ var DvnWorker = class {
353
390
  const hash = view[0];
354
391
  return hash.bytes;
355
392
  }
393
+ async createSetMsgLibsHash(msglibs, vid, expiration) {
394
+ const view = await this.sdk.viewFunction({
395
+ functionName: `${this.module[0]}::hashes::create_set_msglibs_hash`,
396
+ functionArgs: [msglibs, vid, expiration],
397
+ functionArgTypes: ["vector<address>", "u32", "u64"]
398
+ });
399
+ const hash = view[0];
400
+ return hash.bytes;
401
+ }
356
402
  /**
357
403
  * Creates a payload for initializing the DVN contract.
358
404
  *
@@ -389,10 +435,10 @@ var DvnWorker = class {
389
435
  this.sdk.accounts.uln_message_lib
390
436
  );
391
437
  const adminsU8Array = new Uint8Array(
392
- admins.flatMap((admin) => Array.from(Buffer.from(trim0x$1(padify(admin)), "hex")))
438
+ admins.flatMap((admin) => Array.from(Buffer.from(trim0x(padify(admin)), "hex")))
393
439
  );
394
440
  const msgLibsU8Array = new Uint8Array(
395
- msglibs.flatMap((msgLib) => Array.from(Buffer.from(trim0x$1(padify(msgLib)), "hex")))
441
+ msglibs.flatMap((msgLib) => Array.from(Buffer.from(trim0x(padify(msgLib)), "hex")))
396
442
  );
397
443
  const dvnSignersU8Array = new Uint8Array(dvnSigners.flatMap((signer) => Array.from(signer)));
398
444
  functionArguments = [
@@ -432,6 +478,35 @@ var DvnWorker = class {
432
478
  throw e;
433
479
  }
434
480
  }
481
+ async createSetWorkerConfigForFeeLibRoutingOptInForUln301Payload(uln301Address) {
482
+ if (await this.sdk.isObjectAddress(this.module[0])) {
483
+ const functionIdOrBytecode = setWorkerConfigForFeeLibRoutingOptInForUln301ScriptHex(
484
+ this.sdk.accounts.deploy_to_object,
485
+ uln301Address
486
+ );
487
+ const functionArguments = [this.module[0]];
488
+ const functionArgumentTypes = ["address"];
489
+ return {
490
+ function: functionIdOrBytecode,
491
+ functionArguments,
492
+ functionArgumentTypes
493
+ };
494
+ }
495
+ throw new Error("Only supported object deployment");
496
+ }
497
+ /**
498
+ * Gets the opt in/out status of a worker
499
+ * @param uln301Address - The ULN 301 address
500
+ * @returns {Promise<boolean>} The opt in/out status of the worker
501
+ */
502
+ async getWorkerConfigForFeeLibRoutingOptIn(uln301Address) {
503
+ const view = await this.sdk.viewFunction({
504
+ functionName: `${uln301Address}::msglib::worker_config_for_fee_lib_routing_opt_in`,
505
+ functionArgs: [this.module[0]],
506
+ functionArgTypes: ["address"]
507
+ });
508
+ return view[0];
509
+ }
435
510
  /**
436
511
  * Gets the destination configuration for the specified endpoint.
437
512
  *
@@ -462,6 +537,39 @@ var DvnWorker = class {
462
537
  throw e;
463
538
  }
464
539
  }
540
+ /**
541
+ * Creates a payload for setting the supported message libraries.
542
+ *
543
+ * @param {string[]} msglibs - The supported message libraries.
544
+ * @returns {InputEntryFunctionData} The input entry function data.
545
+ */
546
+ createSetSupportedMsglibsPayload(msglibs, expiration, signatures) {
547
+ return {
548
+ function: `${this.module[0]}::${this.module[1]}::set_supported_msglibs`,
549
+ functionArguments: [msglibs, BigInt(expiration), arrayify(signatures)],
550
+ functionArgumentTypes: ["vector<address>", "u64", "vector<u8>"]
551
+ };
552
+ }
553
+ /**
554
+ * Gets the supported message libraries.
555
+ *
556
+ * @returns {Promise<string[]>} The supported message libraries.
557
+ */
558
+ async getSupportedMsglibs() {
559
+ try {
560
+ const view = await this.sdk.viewFunction({
561
+ functionName: `${this.module[0]}::${this.module[1]}::get_supported_msglibs`,
562
+ functionArgs: [],
563
+ functionArgTypes: []
564
+ });
565
+ return view[0];
566
+ } catch (e) {
567
+ if (e instanceof MoveAbortError && e.abortCode === EWORKER_NOT_REGISTERED) {
568
+ return [];
569
+ }
570
+ throw e;
571
+ }
572
+ }
465
573
  /**
466
574
  * Creates a payload for setting the destination configuration.
467
575
  *
@@ -595,11 +703,16 @@ var DvnWorker = class {
595
703
  };
596
704
  var initializeDvnScriptHex = (deployerAddressHex, dvnAddressHex, uln302AddressHex) => {
597
705
  const stdAddressHex = "0000000000000000000000000000000000000000000000000000000000000001";
598
- deployerAddressHex = trim0x$1(padify(deployerAddressHex));
599
- dvnAddressHex = trim0x$1(padify(dvnAddressHex));
600
- uln302AddressHex = trim0x$1(padify(uln302AddressHex));
706
+ deployerAddressHex = trim0x(padify(deployerAddressHex));
707
+ dvnAddressHex = trim0x(padify(dvnAddressHex));
708
+ uln302AddressHex = trim0x(padify(uln302AddressHex));
601
709
  return `a11ceb0b060000000701000a030a1a042402052657077d9201088f028001068f031d000000010102020303040405030400010606070101000708090002080a020003090b0200010508060c05050a020a02030a0205170c0101010303030a020a05060c0a020a0a020303030303030303030a020a050002060c05010c010203060a09000303010a0900010a02010507060c050a050a0a02030a050502060c010866726f6d5f62637306766563746f720364766e066d73676c6962166f626a6563745f636f64655f6465706c6f796d656e74166765745f636f64655f6f626a6563745f7369676e657205736c6963650a746f5f616464726573730a696e697469616c697a652c7365745f776f726b65725f636f6e6669675f666f725f6665655f6c69625f726f7574696e675f6f70745f696e${stdAddressHex}${dvnAddressHex}${uln302AddressHex}${deployerAddressHex}03082000000000000000030840000000000000000a0501000a0a020100000001b0010b000b0111000c080e080c110e0341050c170a1707001906000000000000000021041005140b11010601000000000000002707020c100600000000000000000c14090c090b1707001a0c0c0a0904250b14060100000000000000160c140527080c090a140a0c23043b0a140700180c1a0e030a1a0b1a07001638000c0f0d100b0f11024409051e0e0641050c180a1807001906000000000000000021044505490b11010601000000000000002707020c1e0600000000000000000c15090c0a0b1807001a0c0e0a0a045a0b15060100000000000000160c15055c080c0a0a150a0e2304700a150700180c1c0e060a1c0b1c07001638000c1d0d1e0b1d1102440905530e0441050c190a1907011906000000000000000021047a057e0b11010601000000000000002707030c130600000000000000000c16090c0b0b1907011a0c0d0a0b048f010b16060100000000000000160c16059101080c0b0a160a0d2304a4010a160701180c1b0e040a1b0b1b07011638000c120d130b1244080588010a110b020b100b130b050b1e0b0711030b1108110402`;
602
710
  };
711
+ var setWorkerConfigForFeeLibRoutingOptInForUln301ScriptHex = (deployerAddressHex, uln301AddressHex) => {
712
+ deployerAddressHex = trim0x(padify(deployerAddressHex));
713
+ uln301AddressHex = trim0x(padify(uln301AddressHex));
714
+ return `a11ceb0b060000000501000403040a050e0b071962087b40000001010102000100000303020002060c05010c0002060c01066d73676c6962166f626a6563745f636f64655f6465706c6f796d656e74166765745f636f64655f6f626a6563745f7369676e65722c7365745f776f726b65725f636f6e6669675f666f725f6665655f6c69625f726f7574696e675f6f70745f696e${uln301AddressHex}${deployerAddressHex}000001080b000b0111000c020e0208110102`;
715
+ };
603
716
  var Endpoint = class {
604
717
  /**
605
718
  * Creates an instance of Endpoint.
@@ -1250,7 +1363,7 @@ var Executor = class {
1250
1363
  constructor(sdk) {
1251
1364
  this.sdk = sdk;
1252
1365
  this.lzReceiveWithValueScriptHex = (oappAddressHex, lzReceiveModuleName) => {
1253
- oappAddressHex = trim0x$1(padify(oappAddressHex));
1366
+ oappAddressHex = trim0x(padify(oappAddressHex));
1254
1367
  const stdAddressHex = "0000000000000000000000000000000000000000000000000000000000000001";
1255
1368
  const modLen = lzReceiveModuleName.length;
1256
1369
  const modLenHex = modLen.toString(16).padStart(2, "0");
@@ -1258,13 +1371,13 @@ var Executor = class {
1258
1371
  const a = toUleb(245 + modLen).padStart(4, "0");
1259
1372
  const b = toUleb(442 + modLen).padStart(4, "0");
1260
1373
  const c = toUleb(602 + modLen).padStart(4, "0");
1261
- const endpointV2AddressHex = trim0x$1(this.sdk.accounts.endpoint_v2);
1262
- const endpointV2CommonAddressHex = trim0x$1(this.sdk.accounts.endpoint_v2_common);
1263
- const executorAddressHex = trim0x$1(this.sdk.accounts.executor);
1374
+ const endpointV2AddressHex = trim0x(this.sdk.accounts.endpoint_v2);
1375
+ const endpointV2CommonAddressHex = trim0x(this.sdk.accounts.endpoint_v2_common);
1376
+ const executorAddressHex = trim0x(this.sdk.accounts.executor);
1264
1377
  return `a11ceb0b0600000008010012021212032435045906055f6607c501${a}08${b}a00106${c}22000000010002010302040205020603070408010907010000000a00000411070003130000020b03040100060c050600070d070500050e080900010f0a0b01000110050b010004120c0d0003140d0e0008150f0500071610050000020409050909060c0e0a02030a020a020a02030a02020b000108010b00010801010201060a0900010100010e07060c0e0a02030e050a0202060c03010801010900010b00010900010a02010802010803070e0a020308030a020a020b0001080107060c050e0a02030a02030e66756e6769626c655f6173736574066f7074696f6e06766563746f7208656e64706f696e7407627974657333320c6e61746976655f746f6b656e10756e6976657273616c5f636f6e666967086578656375746f72${modLenHex}${modNameHex}064f7074696f6e0d46756e6769626c6541737365740869735f656d707479036569640b6e61746976655f64726f7008776974686472617704736f6d65046e6f6e6507427974657333320a746f5f627974657333320b577261707065644775696409777261705f67756964156c7a5f726563656976655f776974685f76616c75651e656d69745f6c7a5f726563656976655f76616c75655f70726f7669646564${stdAddressHex}${endpointV2AddressHex}${endpointV2CommonAddressHex}${executorAddressHex}${oappAddressHex}0520${oappAddressHex}0000012d0e08380020040c0a000a010a020a03110107000b0811020a070600000000000000002404160a000a07110338010c09051838020c090b090c0a0a010a020a030a04110611070b050b060b0a11080b0007000b010b020b030b040b07110902`;
1265
1378
  };
1266
1379
  this.lzComposeWithValueScriptHex = (oappAddressHex, lzComposeModuleName) => {
1267
- oappAddressHex = trim0x$1(padify(oappAddressHex));
1380
+ oappAddressHex = trim0x(padify(oappAddressHex));
1268
1381
  const stdAddressHex = "0000000000000000000000000000000000000000000000000000000000000001";
1269
1382
  const modLen = lzComposeModuleName.length;
1270
1383
  const modLenHex = modLen.toString(16).padStart(2, "0");
@@ -1272,9 +1385,9 @@ var Executor = class {
1272
1385
  const a = toUleb(214 + modLen).padStart(4, "0");
1273
1386
  const b = toUleb(364 + modLen).padStart(4, "0");
1274
1387
  const c = toUleb(524 + modLen).padStart(4, "0");
1275
- const endpointV2AddressHex = trim0x$1(this.sdk.accounts.endpoint_v2);
1276
- const endpointV2CommonAddressHex = trim0x$1(this.sdk.accounts.endpoint_v2_common);
1277
- const executorAddressHex = trim0x$1(this.sdk.accounts.executor);
1388
+ const endpointV2AddressHex = trim0x(this.sdk.accounts.endpoint_v2);
1389
+ const endpointV2CommonAddressHex = trim0x(this.sdk.accounts.endpoint_v2_common);
1390
+ const executorAddressHex = trim0x(this.sdk.accounts.executor);
1278
1391
  return `a11ceb0b060000000801000e020e1203202504450405494d079601${a}08${b}a00106${c}2200000001010202030204030504060107070100000008000002090000030d0700040a030400010b05060100010c02060100030e070800020f090a0006100b020005110c02000104020407060c050a020d0a020a0203030b000108010b0001080108020002060c03010801010900010b00010900010a020108030208030d010802050508020a020a020b0001080106060c05050d0a02030e66756e6769626c655f6173736574066f7074696f6e08656e64706f696e7407627974657333320c6e61746976655f746f6b656e086578656375746f72${modLenHex}${modNameHex}064f7074696f6e0d46756e6769626c654173736574135772617070656447756964416e64496e64657808776974686472617704736f6d65046e6f6e6507427974657333320a746f5f6279746573333213777261705f677569645f616e645f696e646578156c7a5f636f6d706f73655f776974685f76616c75651e656d69745f6c7a5f636f6d706f73655f76616c75655f70726f7669646564${stdAddressHex}${endpointV2AddressHex}${endpointV2CommonAddressHex}${executorAddressHex}${oappAddressHex}0520${oappAddressHex}000001210a0606000000000000000024040a0a000a06110038000c07050c38010c070b070c080a0211030a0311040c090a010b090b040b050b0811050b000b0107000b030b020b06110602`;
1279
1392
  };
1280
1393
  this.module = [sdk.accounts.executor?.toString() ?? "0x0", "executor"];
@@ -1316,10 +1429,10 @@ var Executor = class {
1316
1429
  );
1317
1430
  functionArgumentTypes = ["address", "address", "address", "vector<u8>", "vector<u8>", "address"];
1318
1431
  const adminsU8Array = new Uint8Array(
1319
- admins.flatMap((admin) => Array.from(Buffer.from(trim0x$1(padify(admin)), "hex")))
1432
+ admins.flatMap((admin) => Array.from(Buffer.from(trim0x(padify(admin)), "hex")))
1320
1433
  );
1321
1434
  const msgLibsU8Array = new Uint8Array(
1322
- msgLibs.flatMap((msgLib) => Array.from(Buffer.from(trim0x$1(padify(msgLib)), "hex")))
1435
+ msgLibs.flatMap((msgLib) => Array.from(Buffer.from(trim0x(padify(msgLib)), "hex")))
1323
1436
  );
1324
1437
  functionArguments = [
1325
1438
  this.module[0],
@@ -1366,10 +1479,10 @@ var Executor = class {
1366
1479
  );
1367
1480
  functionArgumentTypes = ["address", "address", "address", "vector<u8>", "vector<u8>", "address"];
1368
1481
  const adminsU8Array = new Uint8Array(
1369
- admins.flatMap((admin) => Array.from(Buffer.from(trim0x$1(padify(admin)), "hex")))
1482
+ admins.flatMap((admin) => Array.from(Buffer.from(trim0x(padify(admin)), "hex")))
1370
1483
  );
1371
1484
  const msgLibsU8Array = new Uint8Array(
1372
- msgLibs.flatMap((msgLib) => Array.from(Buffer.from(trim0x$1(padify(msgLib)), "hex")))
1485
+ msgLibs.flatMap((msgLib) => Array.from(Buffer.from(trim0x(padify(msgLib)), "hex")))
1373
1486
  );
1374
1487
  functionArguments = [
1375
1488
  this.module[0],
@@ -1388,6 +1501,35 @@ var Executor = class {
1388
1501
  gasOptions
1389
1502
  );
1390
1503
  }
1504
+ async createSetWorkerConfigForFeeLibRoutingOptInForUln301Payload(uln301Address) {
1505
+ if (await this.sdk.isObjectAddress(this.module[0])) {
1506
+ const functionIdOrBytecode = setWorkerConfigForFeeLibRoutingOptInForUln301ScriptHex2(
1507
+ this.sdk.accounts.deploy_to_object,
1508
+ uln301Address
1509
+ );
1510
+ const functionArguments = [this.module[0]];
1511
+ const functionArgumentTypes = ["address"];
1512
+ return {
1513
+ function: functionIdOrBytecode,
1514
+ functionArguments,
1515
+ functionArgumentTypes
1516
+ };
1517
+ }
1518
+ throw new Error("Only supported object deployment");
1519
+ }
1520
+ /**
1521
+ * Gets the opt in/out status of a worker
1522
+ * @param uln301Address - The ULN 301 address
1523
+ * @returns {Promise<boolean>} The opt in/out status of the worker
1524
+ */
1525
+ async getWorkerConfigForFeeLibRoutingOptIn(uln301Address) {
1526
+ const view = await this.sdk.viewFunction({
1527
+ functionName: `${uln301Address}::msglib::worker_config_for_fee_lib_routing_opt_in`,
1528
+ functionArgs: [this.module[0]],
1529
+ functionArgTypes: ["address"]
1530
+ });
1531
+ return view[0];
1532
+ }
1391
1533
  /**
1392
1534
  * Gets the destination configuration for the specified endpoint.
1393
1535
  *
@@ -1826,11 +1968,16 @@ var Executor = class {
1826
1968
  };
1827
1969
  var initializeExecutorScriptHex = (deployerAddressHex, executorAddressHex, uln302AddressHex) => {
1828
1970
  const stdAddressHex = "0000000000000000000000000000000000000000000000000000000000000001";
1829
- deployerAddressHex = trim0x$1(padify(deployerAddressHex));
1830
- executorAddressHex = trim0x$1(padify(executorAddressHex));
1831
- uln302AddressHex = trim0x$1(padify(uln302AddressHex));
1971
+ deployerAddressHex = trim0x(padify(deployerAddressHex));
1972
+ executorAddressHex = trim0x(padify(executorAddressHex));
1973
+ uln302AddressHex = trim0x(padify(uln302AddressHex));
1832
1974
  return `a11ceb0b060000000701000a030a1a042402052648076e970108850280010685030e000000010102020303040405030400010606070101000708090002080a020003090b0200010507060c0505050a020a0205100c010103030a020a05060c0303030303030a020a050002060c05010c010203060a09000303010a0900010a02010506060c05050a050a050502060c010866726f6d5f62637306766563746f72086578656375746f72066d73676c6962166f626a6563745f636f64655f6465706c6f796d656e74166765745f636f64655f6f626a6563745f7369676e657205736c6963650a746f5f616464726573730a696e697469616c697a652c7365745f776f726b65725f636f6e6669675f666f725f6665655f6c69625f726f7574696e675f6f70745f696e${stdAddressHex}${executorAddressHex}${uln302AddressHex}${deployerAddressHex}030820000000000000000a0501000000017b0b000b0111000c070e070c0e0e0441050c110a1107001906000000000000000021041005140b0e010601000000000000002707010c0d0600000000000000000c0f090c080b1107001a0c0a0a0804250b0f060100000000000000160c0f0527080c080a0f0a0a23043b0a0f0700180c130e040a130b1307001638000c0c0d0d0b0c11024409051e0e0541050c120a1207001906000000000000000021044505490b0e010601000000000000002707010c160600000000000000000c10090c090b1207001a0c0b0a09045a0b10060100000000000000160c10055c080c090a100a0b2304700a100700180c140e050a140b1407001638000c150d160b151102440905530a0e0b020b030b0d0b160b0611030b0e08110402`;
1833
1975
  };
1976
+ var setWorkerConfigForFeeLibRoutingOptInForUln301ScriptHex2 = (deployerAddressHex, uln301AddressHex) => {
1977
+ deployerAddressHex = trim0x(padify(deployerAddressHex));
1978
+ uln301AddressHex = trim0x(padify(uln301AddressHex));
1979
+ return `a11ceb0b060000000501000403040a050e0b071962087b40000001010102000100000303020002060c05010c0002060c01066d73676c6962166f626a6563745f636f64655f6465706c6f796d656e74166765745f636f64655f6f626a6563745f7369676e65722c7365745f776f726b65725f636f6e6669675f666f725f6665655f6c69625f726f7574696e675f6f70745f696e${uln301AddressHex}${deployerAddressHex}000001080b000b0111000c020e0208110102`;
1980
+ };
1834
1981
  function asciiToHex(str) {
1835
1982
  let hex = "";
1836
1983
  for (let i = 0; i < str.length; i++) {
@@ -2154,7 +2301,7 @@ var Oft = class {
2154
2301
  functionArgTypes: []
2155
2302
  });
2156
2303
  const supported = view[0];
2157
- this.cachedIsCoin = Buffer.from(trim0x(supported[0]), "hex").toString("utf8") === CoinStandard;
2304
+ this.cachedIsCoin = Buffer.from(trim0x$1(supported[0]), "hex").toString("utf8") === CoinStandard;
2158
2305
  }
2159
2306
  return this.cachedIsCoin;
2160
2307
  }