@layerzerolabs/lz-movevm-sdk-v2 3.0.38 → 3.0.39

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,5 +1,17 @@
1
1
  # @layerzerolabs/lz-movevm-sdk-v2
2
2
 
3
+ ## 3.0.39
4
+
5
+ ### Patch Changes
6
+
7
+ - 7c36799: move implementation updates
8
+ - Updated dependencies [7c36799]
9
+ - @layerzerolabs/lz-definitions@3.0.39
10
+ - @layerzerolabs/lz-serdes@3.0.39
11
+ - @layerzerolabs/lz-utilities@3.0.39
12
+ - @layerzerolabs/lz-v2-utilities@3.0.39
13
+ - @layerzerolabs/move-definitions@3.0.39
14
+
3
15
  ## 3.0.38
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -639,13 +639,14 @@ var Endpoint = class {
639
639
  * @param {string} msgLibAddr - The message library address.
640
640
  * @param {Uint8Array} packetHeader - The packet header.
641
641
  * @param {Uint8Array} hash - The hash of the payload.
642
+ * @param {Uint8Array} [extraData] - The extra data.
642
643
  * @returns {InputEntryFunctionData} The input entry function data.
643
644
  */
644
- verifyPayload(msgLibAddr, packetHeader, hash) {
645
+ verifyPayload(msgLibAddr, packetHeader, hash, extraData = new Uint8Array([])) {
645
646
  return {
646
647
  function: `${this.module[0]}::${this.module[1]}::verify`,
647
- functionArguments: [msgLibAddr, packetHeader, hash],
648
- functionArgumentTypes: ["address", "vector<u8>", "vector<u8>"]
648
+ functionArguments: [msgLibAddr, packetHeader, hash, extraData],
649
+ functionArgumentTypes: ["address", "vector<u8>", "vector<u8>", "vector<u8>"]
649
650
  };
650
651
  }
651
652
  /**
@@ -655,15 +656,16 @@ var Endpoint = class {
655
656
  * @param {string} receiveLib - The receive library address.
656
657
  * @param {Uint8Array} packetHeader - The packet header.
657
658
  * @param {Uint8Array} hash - The hash of the payload.
659
+ * @param {Uint8Array} [extraData] - The extra data.
658
660
  * @param {GasOptions} [gasOptions] - The gas options.
659
661
  * @returns {Promise<TransactionResponse>} The transaction response.
660
662
  */
661
- async verify(signer, receiveLib, packetHeader, hash, gasOptions) {
663
+ async verify(signer, receiveLib, packetHeader, hash, extraData, gasOptions) {
662
664
  return this.sdk.sendAndConfirmTransaction(
663
665
  signer,
664
666
  `${this.module[0]}::${this.module[1]}::verify`,
665
- [receiveLib, packetHeader, hash],
666
- ["address", "vector<u8>", "vector<u8>"],
667
+ [receiveLib, packetHeader, hash, extraData ?? new Uint8Array([])],
668
+ ["address", "vector<u8>", "vector<u8>", "vector<u8>"],
667
669
  gasOptions
668
670
  );
669
671
  }
@@ -943,7 +945,7 @@ var Endpoint = class {
943
945
  async getDefaultSendLib(remoteChainId) {
944
946
  try {
945
947
  const view = await this.sdk.viewFunction({
946
- functionName: `${this.module[0]}::${this.module[1]}::get_default_send_lib`,
948
+ functionName: `${this.module[0]}::${this.module[1]}::get_default_send_library`,
947
949
  functionArgs: [remoteChainId],
948
950
  functionArgTypes: ["u32"]
949
951
  });
@@ -964,7 +966,7 @@ var Endpoint = class {
964
966
  async getDefaultReceiveLib(remoteChainId) {
965
967
  try {
966
968
  const view = await this.sdk.viewFunction({
967
- functionName: `${this.module[0]}::${this.module[1]}::get_default_receive_lib`,
969
+ functionName: `${this.module[0]}::${this.module[1]}::get_default_receive_library`,
968
970
  functionArgs: [remoteChainId],
969
971
  functionArgTypes: ["u32"]
970
972
  });
@@ -1744,8 +1746,20 @@ var Oft = class {
1744
1746
  this.oappCoreModule = [sdk.accounts.oft?.toString() ?? "0x0", "oapp_core"];
1745
1747
  this.oappReceiveModule = [sdk.accounts.oft?.toString() ?? "0x0", "oapp_receive"];
1746
1748
  }
1747
- getImplModule() {
1748
- return [this.sdk.accounts.oft?.toString() ?? "0x0", "oft_impl"];
1749
+ async getImplModule() {
1750
+ if (await this.isCoin()) {
1751
+ if (this.isAdapter) {
1752
+ return [this.sdk.accounts.oft?.toString() ?? "0x0", "oft_adapter_coin"];
1753
+ } else {
1754
+ return [this.sdk.accounts.oft?.toString() ?? "0x0", "oft_coin"];
1755
+ }
1756
+ } else {
1757
+ if (this.isAdapter) {
1758
+ return [this.sdk.accounts.oft?.toString() ?? "0x0", "oft_adapter_fa"];
1759
+ } else {
1760
+ return [this.sdk.accounts.oft?.toString() ?? "0x0", "oft_fa"];
1761
+ }
1762
+ }
1749
1763
  }
1750
1764
  // view functions
1751
1765
  /**
@@ -1989,7 +2003,7 @@ var Oft = class {
1989
2003
  */
1990
2004
  async metadata() {
1991
2005
  if (await this.isCoin()) {
1992
- const implModule = this.getImplModule();
2006
+ const implModule = await this.getImplModule();
1993
2007
  const coin = this.coin ?? `${implModule[0]}::${implModule[1]}::PlaceholderCoin`;
1994
2008
  const res = await this.sdk.getAccountResource({
1995
2009
  accountAddress: implModule[0],
@@ -2147,7 +2161,7 @@ var Oft = class {
2147
2161
  * @returns escrow address, or null if it is not in adapter mode
2148
2162
  */
2149
2163
  async escrowAddress() {
2150
- const implModule = this.getImplModule();
2164
+ const implModule = await this.getImplModule();
2151
2165
  if (this.isAdapter) {
2152
2166
  const view = await this.sdk.viewFunction({
2153
2167
  functionName: `${implModule[0]}::${implModule[1]}::escrow_address`,
@@ -2187,7 +2201,7 @@ var Oft = class {
2187
2201
  monitorSupply = false,
2188
2202
  tokenAddress
2189
2203
  } = tokenInfo;
2190
- const implModule = this.getImplModule();
2204
+ const implModule = await this.getImplModule();
2191
2205
  const isCoin = await this.isCoin();
2192
2206
  let params;
2193
2207
  let paramTypes;
@@ -2249,7 +2263,7 @@ var Oft = class {
2249
2263
  tokenAddress
2250
2264
  } = tokenInfo;
2251
2265
  const isCoin = await this.isCoin();
2252
- const implModule = this.getImplModule();
2266
+ const implModule = await this.getImplModule();
2253
2267
  let params;
2254
2268
  let paramTypes;
2255
2269
  if (isCoin && this.isAdapter) {