@layerzerolabs/lz-solana-sdk-v2 2.3.24 → 2.3.25

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-solana-sdk-v2
2
2
 
3
+ ## 2.3.25
4
+
5
+ ### Patch Changes
6
+
7
+ - 003371b: endpoints, including flare mainnet
8
+ - 003371b: testnet endpoints
9
+ - Updated dependencies [003371b]
10
+ - Updated dependencies [003371b]
11
+ - @layerzerolabs/lz-corekit-solana@2.3.25
12
+ - @layerzerolabs/lz-definitions@2.3.25
13
+ - @layerzerolabs/lz-v2-utilities@2.3.25
14
+
3
15
  ## 2.3.24
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -11342,12 +11342,17 @@ __export(uln_exports, {
11342
11342
  ZeroMessageSizeError: () => ZeroMessageSizeError,
11343
11343
  accountProviders: () => accountProviders6,
11344
11344
  accounts: () => accounts_exports6,
11345
+ closeVerifyInstructionDiscriminator: () => closeVerifyInstructionDiscriminator,
11346
+ closeVerifyParamsBeet: () => closeVerifyParamsBeet,
11347
+ closeVerifyStruct: () => closeVerifyStruct,
11345
11348
  commitVerificationInstructionDiscriminator: () => commitVerificationInstructionDiscriminator,
11346
11349
  commitVerificationParamsBeet: () => commitVerificationParamsBeet,
11347
11350
  commitVerificationStruct: () => commitVerificationStruct,
11348
11351
  configBeet: () => configBeet,
11349
11352
  confirmationsBeet: () => confirmationsBeet,
11350
11353
  confirmationsDiscriminator: () => confirmationsDiscriminator,
11354
+ createCloseVerifyInstruction: () => createCloseVerifyInstruction,
11355
+ createCloseVerifyInstructionAccounts: () => createCloseVerifyInstructionAccounts,
11351
11356
  createCommitVerificationInstruction: () => createCommitVerificationInstruction,
11352
11357
  createCommitVerificationInstructionAccounts: () => createCommitVerificationInstructionAccounts,
11353
11358
  createInitConfigInstruction: () => createInitConfigInstruction3,
@@ -13465,6 +13470,7 @@ __export(executor_exports, {
13465
13470
  InsufficientBalanceError: () => InsufficientBalanceError,
13466
13471
  InvalidNativeDropReceiverError: () => InvalidNativeDropReceiverError,
13467
13472
  InvalidNativeDropRequestsLengthError: () => InvalidNativeDropRequestsLengthError,
13473
+ InvalidOwnerError: () => InvalidOwnerError,
13468
13474
  InvalidSizeError: () => InvalidSizeError,
13469
13475
  MsgLibNotAllowedError: () => MsgLibNotAllowedError2,
13470
13476
  NativeAmountExceedsCapError: () => NativeAmountExceedsCapError,
@@ -15111,8 +15117,8 @@ async function extractEventFromTransactionSignature(connection, program, signatu
15111
15117
  }
15112
15118
  const dataBuffer = Buffer.from(decoded.subarray(16, decoded.length));
15113
15119
  if (eventBeet instanceof beet201__namespace.FixableBeetArgsStruct) {
15114
- const beet300 = eventBeet.toFixedFromData(dataBuffer, 0);
15115
- events.push(beet300.read(dataBuffer, 0));
15120
+ const beet302 = eventBeet.toFixedFromData(dataBuffer, 0);
15121
+ events.push(beet302.read(dataBuffer, 0));
15116
15122
  } else {
15117
15123
  events.push(eventBeet.read(dataBuffer, 0));
15118
15124
  }
@@ -15650,6 +15656,18 @@ createErrorFromNameLookup5.set(
15650
15656
  "ExecutorIsAdmin",
15651
15657
  () => new ExecutorIsAdminError()
15652
15658
  );
15659
+ var InvalidOwnerError = class _InvalidOwnerError extends Error {
15660
+ constructor() {
15661
+ super("");
15662
+ this.code = 6017;
15663
+ this.name = "InvalidOwner";
15664
+ if (typeof Error.captureStackTrace === "function") {
15665
+ Error.captureStackTrace(this, _InvalidOwnerError);
15666
+ }
15667
+ }
15668
+ };
15669
+ createErrorFromCodeLookup5.set(6017, () => new InvalidOwnerError());
15670
+ createErrorFromNameLookup5.set("InvalidOwner", () => new InvalidOwnerError());
15653
15671
  function errorFromCode4(code) {
15654
15672
  const createError = createErrorFromCodeLookup5.get(code);
15655
15673
  return createError != null ? createError() : null;
@@ -15789,11 +15807,15 @@ var Executor = class {
15789
15807
  this.program
15790
15808
  );
15791
15809
  }
15792
- setMsglibs(owner, msglibPrograms) {
15793
- const [configAccount] = this.deriver.config();
15810
+ setMsglibByPrograms(owner, msglibPrograms) {
15811
+ this.deriver.config();
15794
15812
  const msglibPdas = msglibPrograms.map((program) => {
15795
15813
  return new MessageLibPDADeriver(program).messageLib()[0];
15796
15814
  });
15815
+ return this.setMsglibByPDAs(owner, msglibPdas);
15816
+ }
15817
+ setMsglibByPDAs(owner, msglibPDAs) {
15818
+ const [configAccount] = this.deriver.config();
15797
15819
  return createOwnerSetConfigInstruction(
15798
15820
  {
15799
15821
  owner,
@@ -15801,7 +15823,7 @@ var Executor = class {
15801
15823
  },
15802
15824
  {
15803
15825
  params: {
15804
- fields: [msglibPdas],
15826
+ fields: [msglibPDAs],
15805
15827
  __kind: "Msglibs"
15806
15828
  }
15807
15829
  },
@@ -17019,8 +17041,12 @@ function errorFromName5(name) {
17019
17041
  // src/generated/uln/instructions/index.ts
17020
17042
  var instructions_exports6 = {};
17021
17043
  __export(instructions_exports6, {
17044
+ closeVerifyInstructionDiscriminator: () => closeVerifyInstructionDiscriminator,
17045
+ closeVerifyStruct: () => closeVerifyStruct,
17022
17046
  commitVerificationInstructionDiscriminator: () => commitVerificationInstructionDiscriminator,
17023
17047
  commitVerificationStruct: () => commitVerificationStruct,
17048
+ createCloseVerifyInstruction: () => createCloseVerifyInstruction,
17049
+ createCloseVerifyInstructionAccounts: () => createCloseVerifyInstructionAccounts,
17024
17050
  createCommitVerificationInstruction: () => createCommitVerificationInstruction,
17025
17051
  createCommitVerificationInstructionAccounts: () => createCommitVerificationInstructionAccounts,
17026
17052
  createInitConfigInstruction: () => createInitConfigInstruction3,
@@ -17080,6 +17106,91 @@ __export(instructions_exports6, {
17080
17106
  withdrawRentInstructionDiscriminator: () => withdrawRentInstructionDiscriminator2,
17081
17107
  withdrawRentStruct: () => withdrawRentStruct2
17082
17108
  });
17109
+ var closeVerifyParamsBeet = new beet201__namespace.BeetArgsStruct(
17110
+ [
17111
+ ["packetHeaderHash", beet201__namespace.uniformFixedSizeArray(beet201__namespace.u8, 32)],
17112
+ ["payloadHash", beet201__namespace.uniformFixedSizeArray(beet201__namespace.u8, 32)]
17113
+ ],
17114
+ "CloseVerifyParams"
17115
+ );
17116
+
17117
+ // src/generated/uln/instructions/closeVerify.ts
17118
+ var closeVerifyStruct = new beet201__namespace.BeetArgsStruct(
17119
+ [
17120
+ ["instructionDiscriminator", beet201__namespace.uniformFixedSizeArray(beet201__namespace.u8, 8)],
17121
+ ["params", closeVerifyParamsBeet]
17122
+ ],
17123
+ "CloseVerifyInstructionArgs"
17124
+ );
17125
+ var closeVerifyInstructionDiscriminator = [
17126
+ 44,
17127
+ 133,
17128
+ 228,
17129
+ 138,
17130
+ 169,
17131
+ 242,
17132
+ 53,
17133
+ 36
17134
+ ];
17135
+ function createCloseVerifyInstruction(accounts, args, programId) {
17136
+ const [data] = closeVerifyStruct.serialize({
17137
+ instructionDiscriminator: closeVerifyInstructionDiscriminator,
17138
+ ...args
17139
+ });
17140
+ const keys = [
17141
+ {
17142
+ pubkey: accounts.dvn,
17143
+ isWritable: false,
17144
+ isSigner: true
17145
+ },
17146
+ {
17147
+ pubkey: accounts.receiver,
17148
+ isWritable: true,
17149
+ isSigner: false
17150
+ },
17151
+ {
17152
+ pubkey: accounts.confirmations,
17153
+ isWritable: true,
17154
+ isSigner: false
17155
+ }
17156
+ ];
17157
+ if (accounts.anchorRemainingAccounts != null) {
17158
+ for (const acc of accounts.anchorRemainingAccounts) {
17159
+ keys.push(acc);
17160
+ }
17161
+ }
17162
+ const ix = new web35__namespace.TransactionInstruction({
17163
+ programId,
17164
+ keys,
17165
+ data
17166
+ });
17167
+ return ix;
17168
+ }
17169
+ function createCloseVerifyInstructionAccounts(accounts, programId) {
17170
+ const keys = [
17171
+ {
17172
+ pubkey: accounts.dvn,
17173
+ isWritable: false,
17174
+ isSigner: true
17175
+ },
17176
+ {
17177
+ pubkey: accounts.receiver,
17178
+ isWritable: true,
17179
+ isSigner: false
17180
+ },
17181
+ {
17182
+ pubkey: accounts.confirmations,
17183
+ isWritable: true,
17184
+ isSigner: false
17185
+ }
17186
+ ];
17187
+ if (accounts.anchorRemainingAccounts != null) {
17188
+ for (const acc of accounts.anchorRemainingAccounts) {
17189
+ keys.push(acc);
17190
+ }
17191
+ }
17192
+ return keys;
17193
+ }
17083
17194
  var commitVerificationParamsBeet = new beet201__namespace.BeetArgsStruct(
17084
17195
  [
17085
17196
  ["packetHeader", beet201__namespace.uniformFixedSizeArray(beet201__namespace.u8, 81)],
@@ -17124,7 +17235,7 @@ function createCommitVerificationInstruction(accounts, args, programId) {
17124
17235
  },
17125
17236
  {
17126
17237
  pubkey: accounts.uln,
17127
- isWritable: true,
17238
+ isWritable: false,
17128
17239
  isSigner: false
17129
17240
  }
17130
17241
  ];
@@ -17154,7 +17265,7 @@ function createCommitVerificationInstructionAccounts(accounts, programId) {
17154
17265
  },
17155
17266
  {
17156
17267
  pubkey: accounts.uln,
17157
- isWritable: true,
17268
+ isWritable: false,
17158
17269
  isSigner: false
17159
17270
  }
17160
17271
  ];
@@ -18675,6 +18786,7 @@ function createWithdrawRentInstructionAccounts2(accounts, programId) {
18675
18786
  // src/generated/uln/types/index.ts
18676
18787
  var types_exports6 = {};
18677
18788
  __export(types_exports6, {
18789
+ closeVerifyParamsBeet: () => closeVerifyParamsBeet,
18678
18790
  commitVerificationParamsBeet: () => commitVerificationParamsBeet,
18679
18791
  configBeet: () => configBeet,
18680
18792
  executorConfigBeet: () => executorConfigBeet2,
@@ -19047,6 +19159,28 @@ var Uln = class {
19047
19159
  this.program
19048
19160
  );
19049
19161
  }
19162
+ closeVerify(dvn, receiver, packetBytes) {
19163
+ const packet = PacketV1Codec.fromBytes(packetBytes);
19164
+ const headerHash = packet.headerHash();
19165
+ const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), "hex"));
19166
+ const payloadHash = packet.payloadHash();
19167
+ const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), "hex"));
19168
+ const [confirmationsPDA] = this.deriver.confirmations(headerHashBytes, payloadHashBytes, dvn);
19169
+ return createCloseVerifyInstruction(
19170
+ {
19171
+ dvn,
19172
+ receiver,
19173
+ confirmations: confirmationsPDA
19174
+ },
19175
+ {
19176
+ params: {
19177
+ packetHeaderHash: Array.from(headerHashBytes),
19178
+ payloadHash: Array.from(payloadHashBytes)
19179
+ }
19180
+ },
19181
+ this.program
19182
+ );
19183
+ }
19050
19184
  async isDvnVerified(connection, endpointProgram, dvn, packetBytes, commitmentOrConfig = "confirmed") {
19051
19185
  const packet = PacketV1Codec.fromBytes(packetBytes);
19052
19186
  const headerHash = packet.headerHash();