@layerzerolabs/lz-movevm-sdk-v2 3.0.10 → 3.0.11

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,19 @@
1
1
  # @layerzerolabs/lz-movevm-sdk-v2
2
2
 
3
+ ## 3.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 58ada0a: ReadLib1002 ethereum arb opt base
8
+ - Updated dependencies [58ada0a]
9
+ - @layerzerolabs/lz-corekit-aptos@3.0.11
10
+ - @layerzerolabs/lz-core@3.0.11
11
+ - @layerzerolabs/lz-definitions@3.0.11
12
+ - @layerzerolabs/lz-serdes@3.0.11
13
+ - @layerzerolabs/lz-utilities@3.0.11
14
+ - @layerzerolabs/lz-v2-utilities@3.0.11
15
+ - @layerzerolabs/move-definitions@3.0.11
16
+
3
17
  ## 3.0.10
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -381,13 +381,21 @@ var DvnWorker = class {
381
381
  * @param {bigint} quorum - The quorum required for DVN operations.
382
382
  * @param {string[]} msglibs - The list of message libraries.
383
383
  * @param {string} feeLib - The fee library address.
384
+ * @param {string} depositAddress - The deposit address. Defaults to the DVN address.
384
385
  * @returns {InputEntryFunctionData} The input entry function data, used to build the transaction.
385
386
  */
386
- createInitializeDVNPayload(admins, dvnSigners, quorum, msglibs, feeLib) {
387
+ createInitializeDVNPayload(admins, dvnSigners, quorum, msglibs, feeLib, depositAddress) {
387
388
  return {
388
389
  function: `${this.module[0]}::${this.module[1]}::initialize`,
389
- functionArguments: [admins, dvnSigners, quorum, msglibs, feeLib],
390
- functionArgumentTypes: ["vector<address>", "vector<vector<u8>>", "u64", "vector<address>", "address"]
390
+ functionArguments: [depositAddress ?? this.module[0], admins, dvnSigners, quorum, msglibs, feeLib],
391
+ functionArgumentTypes: [
392
+ "address",
393
+ "vector<address>",
394
+ "vector<vector<u8>>",
395
+ "u64",
396
+ "vector<address>",
397
+ "address"
398
+ ]
391
399
  };
392
400
  }
393
401
  /**
@@ -904,14 +912,16 @@ var Endpoint = class {
904
912
  }
905
913
  /**
906
914
  * Gets the registered libraries.
907
- *
915
+ * @param {number} startIndex - The start index. Default is 0.
916
+ * @param {number} length - The length. Default is 20.
908
917
  * @returns {Promise<string[]>} The list of registered libraries.
909
918
  */
910
- async getRegisteredLibraries() {
919
+ async getRegisteredLibraries(startIndex = 0, length = 20) {
911
920
  try {
912
921
  const view = await this.sdk.viewFunction({
913
922
  functionName: `${this.module[0]}::${this.module[1]}::get_registered_libraries`,
914
- functionArgs: []
923
+ functionArgs: [startIndex, length],
924
+ functionArgTypes: ["u64", "u64"]
915
925
  });
916
926
  return view[0];
917
927
  } catch (e) {
@@ -1170,13 +1180,14 @@ var Executor = class {
1170
1180
  * @param {string[]} admins - The list of admin addresses.
1171
1181
  * @param {string[]} msgLibs - The list of message libraries.
1172
1182
  * @param {string} feeLib - The fee library address.
1183
+ * @param {string} [depositAddress] - The deposit address. Defaults to the executor address.
1173
1184
  * @returns {InputEntryFunctionData} The input entry function data, used to build the transaction.
1174
1185
  */
1175
- createInitExecutorPayload(roleAdmin, admins, msgLibs, feeLib) {
1186
+ createInitExecutorPayload(roleAdmin, admins, msgLibs, feeLib, depositAddress) {
1176
1187
  return {
1177
1188
  function: `${this.module[0]}::${this.module[1]}::initialize`,
1178
- functionArguments: [roleAdmin, admins, msgLibs, feeLib],
1179
- functionArgumentTypes: ["address", "vector<address>", "vector<address>", "address"]
1189
+ functionArguments: [depositAddress ?? this.module[0], roleAdmin, admins, msgLibs, feeLib],
1190
+ functionArgumentTypes: ["address", "address", "vector<address>", "vector<address>", "address"]
1180
1191
  };
1181
1192
  }
1182
1193
  /**
@@ -1187,15 +1198,16 @@ var Executor = class {
1187
1198
  * @param {string[]} admins - The list of admin addresses.
1188
1199
  * @param {string[]} msgLibs - The list of message libraries.
1189
1200
  * @param {string} feeLib - The fee library address.
1201
+ * @param {string} [depositAddress] - The deposit address. Defaults to the executor address.
1190
1202
  * @param {GasOptions} [gasOptions] - The gas options.
1191
1203
  * @returns {Promise<TransactionResponse>} The transaction response.
1192
1204
  */
1193
- async initialize(signer, workerId, roleAdmin, admins, msgLibs, feeLib, gasOptions) {
1205
+ async initialize(signer, roleAdmin, admins, msgLibs, feeLib, depositAddress, gasOptions) {
1194
1206
  return this.sdk.sendAndConfirmTransaction(
1195
1207
  signer,
1196
1208
  `${this.module[0]}::${this.module[1]}::initialize`,
1197
- [workerId, roleAdmin, admins, msgLibs, feeLib],
1198
- ["u8", "address", "vector<address>", "vector<address>", "address"],
1209
+ [depositAddress ?? this.module[0], roleAdmin, admins, msgLibs, feeLib],
1210
+ ["address", "address", "vector<address>", "vector<address>", "address"],
1199
1211
  gasOptions
1200
1212
  );
1201
1213
  }
@@ -1760,24 +1772,6 @@ var Oft = class {
1760
1772
  });
1761
1773
  return view[0];
1762
1774
  }
1763
- /**
1764
- * Reports the number of tokens that can be claimed by the account (relevant for Coin-enabled implementations)
1765
- * location: packages/layerzero-v2/aptos/contracts/oapps/oft/sources/internal_oft/oft.move
1766
- *
1767
- * @param address account address
1768
- * @returns true or false
1769
- */
1770
- async claimable(address) {
1771
- if (await this.isCoin()) {
1772
- const view = await this.sdk.viewFunction({
1773
- functionName: `${this.module[0]}::${this.module[1]}::claimable`,
1774
- functionArgs: [address],
1775
- functionArgTypes: ["address"]
1776
- });
1777
- return BigInt(view[0]);
1778
- }
1779
- return BigInt(0);
1780
- }
1781
1775
  /**
1782
1776
  * Quote the OFT for a particular send without sending
1783
1777
  * location: packages/layerzero-v2/aptos/contracts/oapps/oft/sources/internal_oft/oft.move
@@ -1873,9 +1867,10 @@ var Oft = class {
1873
1867
  async metadata() {
1874
1868
  if (await this.isCoin()) {
1875
1869
  const implModule = await this.getImplModule();
1870
+ const coin = this.coin ?? `${implModule[0]}::${implModule[1]}::PlaceholderCoin`;
1876
1871
  const res = await this.sdk.getAccountResource({
1877
1872
  accountAddress: implModule[0],
1878
- resourceType: `0x1::coin::CoinInfo<${implModule[0]}::${implModule[1]}::Oft>`
1873
+ resourceType: `0x1::coin::CoinInfo<${coin}>`
1879
1874
  });
1880
1875
  return res;
1881
1876
  } else {
@@ -1916,25 +1911,12 @@ var Oft = class {
1916
1911
  * @returns account balance
1917
1912
  */
1918
1913
  async balanceOf(address) {
1919
- const token = await this.token();
1920
- if (await this.isCoin()) {
1921
- const implModule = await this.getImplModule();
1922
- const view = await this.sdk.viewFunction({
1923
- functionName: `0x1::coin::balance`,
1924
- functionArgs: [address],
1925
- functionArgTypes: ["address"],
1926
- typeArgs: [`${implModule[0]}::${implModule[1]}::Oft`]
1927
- });
1928
- return BigInt(view[0]);
1929
- } else {
1930
- const view = await this.sdk.viewFunction({
1931
- functionName: `0x1::primary_fungible_store::balance`,
1932
- functionArgs: [address, token],
1933
- functionArgTypes: ["address", "address"],
1934
- typeArgs: ["0x1::fungible_asset::Metadata"]
1935
- });
1936
- return BigInt(view[0]);
1937
- }
1914
+ const view = await this.sdk.viewFunction({
1915
+ functionName: `${this.module[0]}::${this.module[1]}::balance`,
1916
+ functionArgs: [address],
1917
+ functionArgTypes: ["address"]
1918
+ });
1919
+ return BigInt(view[0]);
1938
1920
  }
1939
1921
  /**
1940
1922
  * debit view
@@ -3291,6 +3273,19 @@ var Uln302 = class {
3291
3273
  }
3292
3274
  return this.parseExecutorConfig(view[0]);
3293
3275
  }
3276
+ /**
3277
+ * Gets the opt in/out status of a worker
3278
+ * @param workerAddress - The worker address
3279
+ * @returns {Promise<boolean>} The opt in/out status of the worker
3280
+ */
3281
+ async getWorkerConfigForFeeLibRoutingOptIn(workerAddress) {
3282
+ const view = await this.sdk.viewFunction({
3283
+ functionName: `${this.module[0]}::${this.module[1]}::worker_config_for_fee_lib_routing_opt_in`,
3284
+ functionArgs: [workerAddress],
3285
+ functionArgTypes: ["address"]
3286
+ });
3287
+ return view[0];
3288
+ }
3294
3289
  /**
3295
3290
  * Creates a payload for setting the default ULN send configuration.
3296
3291
  *
@@ -3345,6 +3340,17 @@ var Uln302 = class {
3345
3340
  functionArgumentTypes: ["u32", "u32", "address"]
3346
3341
  };
3347
3342
  }
3343
+ /**
3344
+ * Creates a payload for setting the worker config for fee lib routing opt in
3345
+ * @param optIn
3346
+ */
3347
+ createSetWorkerConfigForFeeLibRoutingOptInPayload(optIn) {
3348
+ return {
3349
+ function: `${this.module[0]}::${this.module[1]}::set_worker_config_for_fee_lib_routing_opt_in`,
3350
+ functionArguments: [optIn],
3351
+ functionArgumentTypes: ["bool"]
3352
+ };
3353
+ }
3348
3354
  /**
3349
3355
  * Parses the ULN configuration response.
3350
3356
  *