@layerzerolabs/lz-aptos-sdk-v1 2.3.21 → 2.3.23

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.mjs CHANGED
@@ -694,6 +694,9 @@ var Endpoint = class {
694
694
  };
695
695
  }
696
696
  async getOracleFee(oracleAddr, dstChainId) {
697
+ if (this.sdk.accounts.layerzero === void 0) {
698
+ throw new Error("endpoint sdk accounts layerzero is undefined when invoke getOracleFee");
699
+ }
697
700
  const resource = await this.sdk.client.getAccountResource(
698
701
  this.sdk.accounts.layerzero,
699
702
  `${this.module}::FeeStore`
@@ -710,6 +713,9 @@ var Endpoint = class {
710
713
  return BigInt(response);
711
714
  }
712
715
  async getRegisterEvents(start, limit) {
716
+ if (this.sdk.accounts.layerzero === void 0) {
717
+ throw new Error("endpoint sdk accounts layerzero is undefined when invoke getRegisterEvents");
718
+ }
713
719
  return this.sdk.client.getEventsByEventHandle(
714
720
  this.sdk.accounts.layerzero,
715
721
  `${this.module}::UaRegistry`,
@@ -1732,6 +1738,9 @@ var Executor = class {
1732
1738
  return this.sdk.sendAndConfirmTransaction(signer, transaction);
1733
1739
  }
1734
1740
  async getDefaultAdapterParams(chainId) {
1741
+ if (this.sdk.accounts.layerzero === void 0) {
1742
+ throw new Error("endpoint sdk accounts layerzero is undefined when invoke getDefaultAdapterParams");
1743
+ }
1735
1744
  const resource = await this.sdk.client.getAccountResource(
1736
1745
  this.sdk.accounts.layerzero,
1737
1746
  `${this.module}::AdapterParamsConfig`
@@ -1823,6 +1832,9 @@ var Executor = class {
1823
1832
  }
1824
1833
  async isAirdropped(guid, receiver) {
1825
1834
  try {
1835
+ if (this.sdk.accounts.layerzero === void 0) {
1836
+ throw new Error("endpoint sdk accounts layerzero is undefined when invoke isAirdropped");
1837
+ }
1826
1838
  const resource = await this.sdk.client.getAccountResource(
1827
1839
  this.sdk.accounts.layerzero,
1828
1840
  `${this.module}::JobStore`
@@ -1901,6 +1913,9 @@ var Executor = class {
1901
1913
  const uaTypeInfo = await this.sdk.LayerzeroModule.Endpoint.getUATypeInfo(
1902
1914
  aptos2.HexString.fromBuffer(packet.dst_address)
1903
1915
  );
1916
+ if (this.sdk.accounts.executor_ext === void 0) {
1917
+ throw new Error("sdk accounts executor_ext is undefined when invoked rebuildTypeArgsScript");
1918
+ }
1904
1919
  const bytecode = rebuildCompileScriptBytecode(
1905
1920
  SCRIPT_BYTECODE,
1906
1921
  [
@@ -1932,6 +1947,9 @@ var Executor = class {
1932
1947
  */
1933
1948
  async getLzReceiveTypeArguments(packet) {
1934
1949
  const bytecode = await this.rebuildTypeArgsScript(packet);
1950
+ if (this.sdk.accounts.layerzero_apps_pubkey === void 0) {
1951
+ throw new Error("sdk accounts layerzero_apps_pubkey is undefined when invoked getLzReceiveTypeArguments");
1952
+ }
1935
1953
  const typeInfos = await getLzReceiveTypeArguments(
1936
1954
  new aptos2.HexString(bytecode).toUint8Array(),
1937
1955
  this.sdk,
@@ -2045,6 +2063,9 @@ var ExecutorConfig = class {
2045
2063
  }
2046
2064
  module;
2047
2065
  async getDefaultExecutor(remoteChainId) {
2066
+ if (this.sdk.accounts.layerzero === void 0) {
2067
+ throw new Error("sdk accounts layerzero is undefined when invoke getDefaultExecutor");
2068
+ }
2048
2069
  const resource = await this.sdk.client.getAccountResource(
2049
2070
  this.sdk.accounts.layerzero,
2050
2071
  `${this.module}::ConfigStore`
@@ -2102,6 +2123,9 @@ var MsgLibAuth = class {
2102
2123
  module;
2103
2124
  moduleName;
2104
2125
  async isAllowed(msglibReceive) {
2126
+ if (this.sdk.accounts.msglib_auth === void 0) {
2127
+ throw new Error("sdk accounts msglib_auth is undefined when invoke isAllowed");
2128
+ }
2105
2129
  const resource = await this.sdk.client.getAccountResource(
2106
2130
  this.sdk.accounts.msglib_auth,
2107
2131
  `${this.module}::GlobalStore`
@@ -2142,6 +2166,9 @@ var MsgLibConfig = class {
2142
2166
  moduleName;
2143
2167
  semverModule;
2144
2168
  async getDefaultSendMsgLib(remoteChainId) {
2169
+ if (this.sdk.accounts.layerzero === void 0) {
2170
+ throw new Error("sdk accounts layerzero is undefined when invoke getDefaultSendMsgLib");
2171
+ }
2145
2172
  const resource = await this.sdk.client.getAccountResource(
2146
2173
  this.sdk.accounts.layerzero,
2147
2174
  `${this.module}::MsgLibConfig`
@@ -2168,6 +2195,9 @@ var MsgLibConfig = class {
2168
2195
  }
2169
2196
  }
2170
2197
  async getDefaultReceiveMsgLib(remoteChainId) {
2198
+ if (this.sdk.accounts.layerzero === void 0) {
2199
+ throw new Error("sdk accounts layerzero is undefined when invoke getDefaultReceiveMsgLib");
2200
+ }
2171
2201
  const resource = await this.sdk.client.getAccountResource(
2172
2202
  this.sdk.accounts.layerzero,
2173
2203
  `${this.module}::MsgLibConfig`
@@ -2235,6 +2265,9 @@ var PacketEvent = class {
2235
2265
  }
2236
2266
  module;
2237
2267
  async getInboundEvents(start, limit) {
2268
+ if (this.sdk.accounts.layerzero === void 0) {
2269
+ throw new Error("sdk accounts layerzero is undefined when invoke getInboundEvents");
2270
+ }
2238
2271
  return this.sdk.client.getEventsByEventHandle(
2239
2272
  this.sdk.accounts.layerzero,
2240
2273
  `${this.module}::EventStore`,
@@ -2243,6 +2276,9 @@ var PacketEvent = class {
2243
2276
  );
2244
2277
  }
2245
2278
  async getInboundEventCount() {
2279
+ if (this.sdk.accounts.layerzero === void 0) {
2280
+ throw new Error("sdk accounts layerzero is undefined when invoke getInboundEventCount");
2281
+ }
2246
2282
  const resource = await this.sdk.client.getAccountResource(
2247
2283
  this.sdk.accounts.layerzero,
2248
2284
  `${this.module}::EventStore`
@@ -2251,6 +2287,9 @@ var PacketEvent = class {
2251
2287
  return new BN(inbound_events.counter).toNumber();
2252
2288
  }
2253
2289
  async getOutboundEvents(start, limit) {
2290
+ if (this.sdk.accounts.layerzero === void 0) {
2291
+ throw new Error("sdk accounts layerzero is undefined when invoke getOutboundEvents");
2292
+ }
2254
2293
  return this.sdk.client.getEventsByEventHandle(
2255
2294
  this.sdk.accounts.layerzero,
2256
2295
  `${this.module}::EventStore`,
@@ -2262,6 +2301,9 @@ var PacketEvent = class {
2262
2301
  );
2263
2302
  }
2264
2303
  async getOutboundEventCount() {
2304
+ if (this.sdk.accounts.layerzero === void 0) {
2305
+ throw new Error("sdk accounts layerzero is undefined when invoke getOutboundEventCount");
2306
+ }
2265
2307
  const resource = await this.sdk.client.getAccountResource(
2266
2308
  this.sdk.accounts.layerzero,
2267
2309
  `${this.module}::EventStore`
@@ -2311,6 +2353,9 @@ var UlnConfig = class {
2311
2353
  return this.sdk.sendAndConfirmTransaction(signer, transaction);
2312
2354
  }
2313
2355
  async getChainAddressSize(remoteChainId) {
2356
+ if (this.sdk.accounts.layerzero === void 0) {
2357
+ throw new Error("sdk accounts layerzero is undefined when invoke getChainAddressSize");
2358
+ }
2314
2359
  const resource = await this.sdk.client.getAccountResource(
2315
2360
  this.sdk.accounts.layerzero,
2316
2361
  `${this.module}::ChainConfig`
@@ -2332,6 +2377,9 @@ var UlnConfig = class {
2332
2377
  }
2333
2378
  }
2334
2379
  async getDefaultAppConfig(remoteChainId, query) {
2380
+ if (this.sdk.accounts.layerzero === void 0) {
2381
+ throw new Error("sdk accounts layerzero is undefined when invoke getDefaultAppConfig");
2382
+ }
2335
2383
  const resource = await this.sdk.client.getAccountResource(
2336
2384
  this.sdk.accounts.layerzero,
2337
2385
  `${this.module}::DefaultUlnConfig`,
@@ -2367,6 +2415,9 @@ var UlnConfig = class {
2367
2415
  ...defaultConfig
2368
2416
  };
2369
2417
  try {
2418
+ if (this.sdk.accounts.layerzero === void 0) {
2419
+ throw new Error("sdk accounts layerzero is undefined when invoke getAppConfig");
2420
+ }
2370
2421
  const resource = await this.sdk.client.getAccountResource(
2371
2422
  this.sdk.accounts.layerzero,
2372
2423
  `${this.module}::UaUlnConfig`,
@@ -2418,6 +2469,9 @@ var UlnConfig = class {
2418
2469
  const config = await this.getAppConfig(uaAddress, dstChainId, query);
2419
2470
  const oracleFee = await this.sdk.LayerzeroModule.Uln.Signer.getFee(config.oracle, dstChainId, query);
2420
2471
  const relayerFee = await this.sdk.LayerzeroModule.Uln.Signer.getFee(config.relayer, dstChainId, query);
2472
+ if (this.sdk.accounts.layerzero === void 0) {
2473
+ throw new Error("sdk accounts layerzero is undefined when invoke quoteFee");
2474
+ }
2421
2475
  const treasuryConfigResource = await this.sdk.client.getAccountResource(
2422
2476
  this.sdk.accounts.layerzero,
2423
2477
  `${this.sdk.LayerzeroModule.Uln.MsgLibV1.module}::GlobalStore`,
@@ -2458,6 +2512,9 @@ var UlnReceive = class {
2458
2512
  return this.sdk.sendAndConfirmTransaction(signer, transaction);
2459
2513
  }
2460
2514
  async getProposal(oracle, hash) {
2515
+ if (this.sdk.accounts.layerzero === void 0) {
2516
+ throw new Error("sdk accounts layerzero is undefined when invoke getProposal");
2517
+ }
2461
2518
  const resource = await this.sdk.client.getAccountResource(
2462
2519
  this.sdk.accounts.layerzero,
2463
2520
  `${this.module}::ProposalStore`