@layerzerolabs/lz-solana-sdk-v2 2.3.26 → 2.3.28

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,35 @@
1
1
  # @layerzerolabs/lz-solana-sdk-v2
2
2
 
3
+ ## 2.3.28
4
+
5
+ ### Patch Changes
6
+
7
+ - 23d7ea0: endpoints, including flare mainnet
8
+ - 23d7ea0: zklink mainnet, and testnets
9
+ - 8a40261: Fix some known issues in Solana
10
+ - 23d7ea0: testnet endpoints
11
+ - Updated dependencies [23d7ea0]
12
+ - Updated dependencies [23d7ea0]
13
+ - Updated dependencies [8a40261]
14
+ - Updated dependencies [23d7ea0]
15
+ - @layerzerolabs/lz-corekit-solana@2.3.28
16
+ - @layerzerolabs/lz-definitions@2.3.28
17
+ - @layerzerolabs/lz-v2-utilities@2.3.28
18
+
19
+ ## 2.3.27
20
+
21
+ ### Patch Changes
22
+
23
+ - e382bef: Update the access property of the `hardhat-tron` package
24
+ - d41cbe9: endpoints, including flare mainnet
25
+ - d41cbe9: testnet endpoints
26
+ - Updated dependencies [e382bef]
27
+ - Updated dependencies [d41cbe9]
28
+ - Updated dependencies [d41cbe9]
29
+ - @layerzerolabs/lz-corekit-solana@2.3.27
30
+ - @layerzerolabs/lz-definitions@2.3.27
31
+ - @layerzerolabs/lz-v2-utilities@2.3.27
32
+
3
33
  ## 2.3.26
4
34
 
5
35
  ### Patch Changes
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "dvn-nethermind",
3
+ "network": "solana-mainnet",
4
+ "address": "4fs6aL12L18K5giDy9Dgxgrb3aNRYiuRV2a7JPPj3e7F",
5
+ "compatibleVersions": [
6
+ "v2"
7
+ ],
8
+ "deployer": "BmLG36ME5rcEEQ1VQvAo2WHERGw5PUBuuSn9q8a35hgx"
9
+ }
@@ -5,5 +5,5 @@
5
5
  "compatibleVersions": [
6
6
  "v2"
7
7
  ],
8
- "deployer": "2AmbLgAgTeK9Bp3bQmGnw1RkxaxmJZ23bSNDB7A3Fj5x"
8
+ "deployer": "oeYf6KAJkLYhBuR8CiGc6L4D4Xtfepr85fuDgA9kq96"
9
9
  }
package/dist/index.cjs CHANGED
@@ -20526,25 +20526,40 @@ var Oft = class {
20526
20526
  const peerInfo = await Peer.fromAccountAddress(connection, peer);
20527
20527
  peerAddr = peerInfo.address;
20528
20528
  }
20529
- const msgLibProgram = await this.getSendLibraryProgram(connection, payer, dstEid);
20530
- const [endpointSettings] = this.endpoint.deriver.setting();
20531
- const packetPath = {
20532
- srcEid: 0,
20533
- dstEid,
20534
- sender: bytes.hexlify(oftConfig.toBytes()),
20535
- receiver: bytes.hexlify(peerAddr)
20536
- };
20537
- invariant5__default.default(await isAccountInitialized(connection, endpointSettings), "endpointSettings account not initialized");
20538
- invariant5__default.default(await isAccountInitialized(connection, peer), "peer account not initialized");
20539
- invariant5__default.default(await isAccountInitialized(connection, enforcedOptions), "enforcedOptions account not initialized");
20540
- invariant5__default.default(await isAccountInitialized(connection, payer), "payer account not initialized");
20541
- invariant5__default.default(
20542
- await isAccountInitialized(
20529
+ if (remainingAccounts === void 0 || remainingAccounts.length === 0) {
20530
+ const msgLibProgram = await this.getSendLibraryProgram(connection, payer, dstEid);
20531
+ const [endpointSettings] = this.endpoint.deriver.setting();
20532
+ const packetPath = {
20533
+ srcEid: 0,
20534
+ dstEid,
20535
+ sender: bytes.hexlify(oftConfig.toBytes()),
20536
+ receiver: bytes.hexlify(peerAddr)
20537
+ };
20538
+ invariant5__default.default(
20539
+ await isAccountInitialized(connection, endpointSettings),
20540
+ "endpointSettings account not initialized"
20541
+ );
20542
+ invariant5__default.default(await isAccountInitialized(connection, peer), "peer account not initialized");
20543
+ invariant5__default.default(
20544
+ await isAccountInitialized(connection, enforcedOptions),
20545
+ "enforcedOptions account not initialized"
20546
+ );
20547
+ invariant5__default.default(await isAccountInitialized(connection, payer), "payer account not initialized");
20548
+ invariant5__default.default(
20549
+ await isAccountInitialized(
20550
+ connection,
20551
+ this.endpoint.deriver.nonce(oftConfig, dstEid, Uint8Array.from(peerAddr))[0]
20552
+ ),
20553
+ "nonce account not initialized"
20554
+ );
20555
+ remainingAccounts = await this.endpoint.getSendIXAccountMetaForCPI(
20543
20556
  connection,
20544
- this.endpoint.deriver.nonce(oftConfig, dstEid, Uint8Array.from(peerAddr))[0]
20545
- ),
20546
- "nonce account not initialized"
20547
- );
20557
+ payer,
20558
+ packetPath,
20559
+ msgLibProgram,
20560
+ commitmentOrConfig
20561
+ );
20562
+ }
20548
20563
  return createSendInstruction(
20549
20564
  {
20550
20565
  signer: payer,
@@ -20558,13 +20573,7 @@ var Oft = class {
20558
20573
  eventAuthority: this.eventAuthorityPDA,
20559
20574
  program: this.program,
20560
20575
  // Get remaining accounts from msgLib(simple_msgLib or uln)
20561
- anchorRemainingAccounts: remainingAccounts ?? await this.endpoint.getSendIXAccountMetaForCPI(
20562
- connection,
20563
- payer,
20564
- packetPath,
20565
- msgLibProgram,
20566
- commitmentOrConfig
20567
- )
20576
+ anchorRemainingAccounts: remainingAccounts
20568
20577
  },
20569
20578
  {
20570
20579
  params: {
@@ -20709,7 +20718,7 @@ async function createSetPeerIx(admin, oftConfig, dstEid, peer, oftProgramId = PR
20709
20718
  {
20710
20719
  params: {
20711
20720
  dstEid,
20712
- peer
20721
+ peer: Array.from(peer)
20713
20722
  }
20714
20723
  },
20715
20724
  oftProgramId
@@ -20905,15 +20914,28 @@ async function quoteOft(connection, payer, tokenMint, dstEid, amountLd, minAmoun
20905
20914
  oftProgramId
20906
20915
  );
20907
20916
  const returnedValues = await simulateTransaction(connection, [ix], ix.programId, payer, "confirmed");
20908
- const [result] = types_exports.quoteOftResultBeet.deserialize(returnedValues, 0);
20909
- return result;
20917
+ const [resultInBeet] = types_exports.quoteOftResultBeet.deserialize(returnedValues, 0);
20918
+ return {
20919
+ oftLimits: {
20920
+ minAmountLd: BigInt(resultInBeet.oftLimits.minAmountLd.toString()),
20921
+ maxAmountLd: BigInt(resultInBeet.oftLimits.maxAmountLd.toString())
20922
+ },
20923
+ oftFeeDetails: resultInBeet.oftFeeDetails.map((fee) => ({
20924
+ feeAmountLd: BigInt(fee.feeAmountLd.toString()),
20925
+ description: fee.description
20926
+ })),
20927
+ oftReceipt: {
20928
+ amountSentLd: BigInt(resultInBeet.oftReceipt.amountSentLd.toString()),
20929
+ amountReceivedLd: BigInt(resultInBeet.oftReceipt.amountReceivedLd.toString())
20930
+ }
20931
+ };
20910
20932
  }
20911
20933
  async function quoteWithUln(connection, payer, tokenMint, dstEid, amountLd, minAmountLd, options, to, payInLzToken = false, tokenEscrow, composeMsg, peerAddr, remainingAccounts, tokenProgram = splToken.TOKEN_PROGRAM_ID, oftProgramId = PROGRAM_ID, msgLibProgram = PROGRAM_ID6, endpointProgram = PROGRAM_ID2) {
20912
20934
  const oft = new Oft(oftProgramId, endpointProgram, tokenProgram, tokenMint, tokenEscrow);
20913
20935
  const oftInstance = oft.getOftConfig();
20914
20936
  const [enforcedOptions] = oft.deriver.enforcedOptions(oftInstance, dstEid);
20915
20937
  const [peer] = oft.deriver.peer(oftInstance, dstEid);
20916
- if (peerAddr == null) {
20938
+ if (peerAddr === void 0) {
20917
20939
  const peerInfo = await accounts_exports.Peer.fromAccountAddress(connection, peer);
20918
20940
  peerAddr = peerInfo.address;
20919
20941
  }