@layerzerolabs/lz-movevm-sdk-v2 3.0.111 → 3.0.112-aptos.0

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/CHANGELOG.md CHANGED
@@ -1,17 +1,5 @@
1
1
  # @layerzerolabs/lz-movevm-sdk-v2
2
2
 
3
- ## 3.0.111
4
-
5
- ### Patch Changes
6
-
7
- - e0c412c: Publish new ton packages at July 11 2025
8
- - Updated dependencies [e0c412c]
9
- - @layerzerolabs/lz-definitions@3.0.111
10
- - @layerzerolabs/lz-serdes@3.0.111
11
- - @layerzerolabs/lz-utilities@3.0.111
12
- - @layerzerolabs/lz-v2-utilities@3.0.111
13
- - @layerzerolabs/move-definitions@3.0.111
14
-
15
3
  ## 3.0.110
16
4
 
17
5
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1615,6 +1615,7 @@ var EndpointCommon = class {
1615
1615
  return view[0];
1616
1616
  }
1617
1617
  };
1618
+ var EAPTOS_V1_EXECUTOR_V2_FEE_LIB_NOT_FOUND = 1;
1618
1619
  var EEXECUTOR_DST_EID_NOT_CONFIGURED2 = 5;
1619
1620
  var EWORKER_NOT_REGISTERED2 = 16;
1620
1621
  var Executor = class {
@@ -1783,6 +1784,22 @@ var Executor = class {
1783
1784
  }
1784
1785
  throw new Error("Only supported object deployment");
1785
1786
  }
1787
+ async createRegisterAptosV1ExecutorV2Payload(aptosV1ExecutorV2Address, aptosV1ExecutorFeeLibAddress) {
1788
+ if (await this.sdk.isObjectAddress(this.module[0])) {
1789
+ const functionIdOrBytecode = registerAptosV1ExecutorV2ScriptHex(
1790
+ this.sdk.accounts.deploy_to_object,
1791
+ aptosV1ExecutorV2Address
1792
+ );
1793
+ const functionArguments = [this.module[0], aptosV1ExecutorFeeLibAddress];
1794
+ const functionArgumentTypes = ["address", "address"];
1795
+ return {
1796
+ function: functionIdOrBytecode,
1797
+ functionArguments,
1798
+ functionArgumentTypes
1799
+ };
1800
+ }
1801
+ throw new Error("Only supported object deployment");
1802
+ }
1786
1803
  /**
1787
1804
  * Gets the opt in/out status of a worker
1788
1805
  * @param uln301Address - The ULN 301 address
@@ -1796,6 +1813,22 @@ var Executor = class {
1796
1813
  });
1797
1814
  return view[0];
1798
1815
  }
1816
+ async getAptosV1ExecutorV2FeeLibrary(aptosV1ExecutorV2Address) {
1817
+ try {
1818
+ const view = await this.sdk.viewFunction({
1819
+ functionName: `${aptosV1ExecutorV2Address}::executor_registry::get_executor_fee_library`,
1820
+ functionArgs: [this.module[0]],
1821
+ functionArgTypes: ["address"]
1822
+ });
1823
+ return view[0];
1824
+ } catch (e) {
1825
+ if (e instanceof moveDefinitions.MoveAbortError && e.abortCode === EAPTOS_V1_EXECUTOR_V2_FEE_LIB_NOT_FOUND) {
1826
+ return "";
1827
+ }
1828
+ console.log(`getAptosV1ExecutorV2FeeLibrary error: ${e}`);
1829
+ throw e;
1830
+ }
1831
+ }
1799
1832
  /**
1800
1833
  * Gets the destination configuration for the specified endpoint.
1801
1834
  *
@@ -2244,6 +2277,11 @@ var setWorkerConfigForFeeLibRoutingOptInForUln301ScriptHex2 = (deployerAddressHe
2244
2277
  uln301AddressHex = lzV2Utilities.trim0x(lzUtilities.padify(uln301AddressHex));
2245
2278
  return `a11ceb0b060000000501000403040a050e0b071962087b40000001010102000100000303020002060c05010c0002060c01066d73676c6962166f626a6563745f636f64655f6465706c6f796d656e74166765745f636f64655f6f626a6563745f7369676e65722c7365745f776f726b65725f636f6e6669675f666f725f6665655f6c69625f726f7574696e675f6f70745f696e${uln301AddressHex}${deployerAddressHex}000001080b000b0111000c020e0208110102`;
2246
2279
  };
2280
+ var registerAptosV1ExecutorV2ScriptHex = (deployerAddressHex, aptosV1ExecutorV2AddressHex) => {
2281
+ aptosV1ExecutorV2AddressHex = lzV2Utilities.trim0x(lzUtilities.padify(aptosV1ExecutorV2AddressHex));
2282
+ deployerAddressHex = lzV2Utilities.trim0x(lzUtilities.padify(deployerAddressHex));
2283
+ return `a11ceb0b060000000501000403040a050e0c071a55086f40000001010102030100000303020003060c0505010c0002060c05116578656375746f725f7265676973747279166f626a6563745f636f64655f6465706c6f796d656e74166765745f636f64655f6f626a6563745f7369676e6572147365745f6578656375746f725f6665655f6c6962${aptosV1ExecutorV2AddressHex}${deployerAddressHex}000001080b000b0111000c030e030b02110102`;
2284
+ };
2247
2285
  function asciiToHex(str) {
2248
2286
  let hex = "";
2249
2287
  for (let i = 0; i < str.length; i++) {