@layerzerolabs/lz-solana-sdk-v2 3.0.77 → 3.0.79

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/umi.d.mts CHANGED
@@ -90,7 +90,7 @@ declare class UlnPDA extends MessageLibPDA {
90
90
  */
91
91
  declare class OmniAppPDA {
92
92
  readonly programId: PublicKey;
93
- static REMOTE_SEED: string;
93
+ static PEER_SEED: string;
94
94
  static LZ_RECEIVE_TYPES_SEED: string;
95
95
  static LZ_COMPOSE_TYPES_SEED: string;
96
96
  constructor(programId: PublicKey);
@@ -8604,6 +8604,20 @@ declare function getExecutorProgramId(network: Network | 'default'): PublicKey;
8604
8604
  */
8605
8605
  declare function getPricefeedProgramId(network: Network | 'default'): PublicKey;
8606
8606
 
8607
+ interface NextNonceInstructionData {
8608
+ discriminator: Uint8Array;
8609
+ srcEid: number;
8610
+ sender: Uint8Array;
8611
+ receiver: PublicKey;
8612
+ }
8613
+ interface NextNonceInstructionDataArgs {
8614
+ srcEid: number;
8615
+ sender: Uint8Array;
8616
+ receiver: PublicKey;
8617
+ }
8618
+ declare function getNextNonceInstructionDataSerializer(): Serializer<NextNonceInstructionDataArgs, NextNonceInstructionData>;
8619
+ declare function nextNonce(rpc: RpcInterface | web3.Connection, payer: PublicKey | web3.PublicKey, packet: Pick<Packet$2, 'sender' | 'srcEid' | 'receiver'>, commitment?: Commitment): Promise<bigint>;
8620
+
8607
8621
  /**
8608
8622
  * This code was AUTOGENERATED using the kinobi library.
8609
8623
  * Please DO NOT EDIT THIS FILE, instead use visitors
@@ -8885,4 +8899,4 @@ interface MessageLibInterface {
8885
8899
  getSetConfigIXAccountMetaForCPI(oapp: PublicKey, eid: number, endpointProgram?: PublicKey): AccountMeta[];
8886
8900
  }
8887
8901
 
8888
- export { index as BlockedMessageLibProgram, dvn as DVNProgram, type Deployment, DvnPDA, index$f as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor as ExecutorProgram, FAUCET_URL, type LzComposeParams, type LzReceiveAccount, type LzReceiveParams, type LzReceiveParamsArgs, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, type MessageLibInterface, MessageLibPDA, MessageType, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed as PriceFeedProgram, SendHelper, SetConfigType, simpleMessageLib as SimpleMessageLibProgram, type SolanaPacketPath, type SupportedPrograms, UlnPDA, uln as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
8902
+ export { index as BlockedMessageLibProgram, dvn as DVNProgram, type Deployment, DvnPDA, index$f as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor as ExecutorProgram, FAUCET_URL, type LzComposeParams, type LzReceiveAccount, type LzReceiveParams, type LzReceiveParamsArgs, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, type MessageLibInterface, MessageLibPDA, MessageType, type NextNonceInstructionData, type NextNonceInstructionDataArgs, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed as PriceFeedProgram, SendHelper, SetConfigType, simpleMessageLib as SimpleMessageLibProgram, type SolanaPacketPath, type SupportedPrograms, UlnPDA, uln as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer, getNextNonceInstructionDataSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, nextNonce, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
package/dist/umi.d.ts CHANGED
@@ -90,7 +90,7 @@ declare class UlnPDA extends MessageLibPDA {
90
90
  */
91
91
  declare class OmniAppPDA {
92
92
  readonly programId: PublicKey;
93
- static REMOTE_SEED: string;
93
+ static PEER_SEED: string;
94
94
  static LZ_RECEIVE_TYPES_SEED: string;
95
95
  static LZ_COMPOSE_TYPES_SEED: string;
96
96
  constructor(programId: PublicKey);
@@ -8604,6 +8604,20 @@ declare function getExecutorProgramId(network: Network | 'default'): PublicKey;
8604
8604
  */
8605
8605
  declare function getPricefeedProgramId(network: Network | 'default'): PublicKey;
8606
8606
 
8607
+ interface NextNonceInstructionData {
8608
+ discriminator: Uint8Array;
8609
+ srcEid: number;
8610
+ sender: Uint8Array;
8611
+ receiver: PublicKey;
8612
+ }
8613
+ interface NextNonceInstructionDataArgs {
8614
+ srcEid: number;
8615
+ sender: Uint8Array;
8616
+ receiver: PublicKey;
8617
+ }
8618
+ declare function getNextNonceInstructionDataSerializer(): Serializer<NextNonceInstructionDataArgs, NextNonceInstructionData>;
8619
+ declare function nextNonce(rpc: RpcInterface | web3.Connection, payer: PublicKey | web3.PublicKey, packet: Pick<Packet$2, 'sender' | 'srcEid' | 'receiver'>, commitment?: Commitment): Promise<bigint>;
8620
+
8607
8621
  /**
8608
8622
  * This code was AUTOGENERATED using the kinobi library.
8609
8623
  * Please DO NOT EDIT THIS FILE, instead use visitors
@@ -8885,4 +8899,4 @@ interface MessageLibInterface {
8885
8899
  getSetConfigIXAccountMetaForCPI(oapp: PublicKey, eid: number, endpointProgram?: PublicKey): AccountMeta[];
8886
8900
  }
8887
8901
 
8888
- export { index as BlockedMessageLibProgram, dvn as DVNProgram, type Deployment, DvnPDA, index$f as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor as ExecutorProgram, FAUCET_URL, type LzComposeParams, type LzReceiveAccount, type LzReceiveParams, type LzReceiveParamsArgs, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, type MessageLibInterface, MessageLibPDA, MessageType, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed as PriceFeedProgram, SendHelper, SetConfigType, simpleMessageLib as SimpleMessageLibProgram, type SolanaPacketPath, type SupportedPrograms, UlnPDA, uln as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
8902
+ export { index as BlockedMessageLibProgram, dvn as DVNProgram, type Deployment, DvnPDA, index$f as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor as ExecutorProgram, FAUCET_URL, type LzComposeParams, type LzReceiveAccount, type LzReceiveParams, type LzReceiveParamsArgs, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, type MessageLibInterface, MessageLibPDA, MessageType, type NextNonceInstructionData, type NextNonceInstructionDataArgs, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed as PriceFeedProgram, SendHelper, SetConfigType, simpleMessageLib as SimpleMessageLibProgram, type SolanaPacketPath, type SupportedPrograms, UlnPDA, uln as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer, getNextNonceInstructionDataSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, nextNonce, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
package/dist/umi.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defaultPublicKey, deserializeAccount, publicKey, assertAccountExists, gpaBuilder, ProgramError, transactionBuilder, createNullRpc, some, createNoopSigner, isSome, isPublicKey, isPda, isSigner, publicKeyBytes } from '@metaplex-foundation/umi';
1
+ import { defaultPublicKey, deserializeAccount, publicKey, assertAccountExists, gpaBuilder, ProgramError, transactionBuilder, createNullRpc, some, createNoopSigner, isSome, isPublicKey, publicKeyBytes, isPda, isSigner } from '@metaplex-foundation/umi';
2
2
  import { mapSerializer, struct, bytes, bool, u8, u32, publicKey as publicKey$1, option, scalarEnum, u64, array, u16, dataEnum, tuple, u128, i64, base58, Endian } from '@metaplex-foundation/umi/serializers';
3
3
  import { createWeb3JsEddsa } from '@metaplex-foundation/umi-eddsa-web3js';
4
4
  import { createDefaultProgramRepository } from '@metaplex-foundation/umi-program-repository';
@@ -247,7 +247,7 @@ var _OmniAppPDA = class _OmniAppPDA {
247
247
  ]);
248
248
  }
249
249
  };
250
- _OmniAppPDA.REMOTE_SEED = "Remote";
250
+ _OmniAppPDA.PEER_SEED = "Peer";
251
251
  _OmniAppPDA.LZ_RECEIVE_TYPES_SEED = "LzReceiveTypes";
252
252
  _OmniAppPDA.LZ_COMPOSE_TYPES_SEED = "LzComposeTypes";
253
253
  var OmniAppPDA = _OmniAppPDA;
@@ -13990,6 +13990,62 @@ function getExecutorProgramId(network) {
13990
13990
  function getPricefeedProgramId(network) {
13991
13991
  return getProgramKeypair(network, "pricefeed");
13992
13992
  }
13993
+ function getNextNonceInstructionDataSerializer() {
13994
+ return mapSerializer(
13995
+ struct(
13996
+ [
13997
+ ["discriminator", bytes({ size: 8 })],
13998
+ ["srcEid", u32()],
13999
+ ["sender", bytes({ size: 32 })],
14000
+ ["receiver", publicKey$1()]
14001
+ ],
14002
+ { description: "NextNonceInstructionData" }
14003
+ ),
14004
+ (value) => ({
14005
+ ...value,
14006
+ discriminator: instructionDiscriminator("next_nonce")
14007
+ })
14008
+ );
14009
+ }
14010
+ async function nextNonce(rpc, payer, packet, commitment = "confirmed") {
14011
+ const { sender: sender_, srcEid, receiver: receiver_ } = packet;
14012
+ const receiver = new web3.PublicKey(addressToBytes32(receiver_));
14013
+ const connection = toWeb3Connection(rpc);
14014
+ const receiverInfo = await connection.getAccountInfo(receiver);
14015
+ if (receiverInfo === null) {
14016
+ throw new Error(`Receiver account not found: ${receiver.toBase58()}`);
14017
+ }
14018
+ const params = {
14019
+ srcEid,
14020
+ sender: arrayify(sender_),
14021
+ receiver: fromWeb3JsPublicKey(receiver)
14022
+ };
14023
+ const receiverProgram = receiverInfo.owner;
14024
+ const [nonceAccount] = EDDSA.findPda(fromWeb3JsPublicKey(receiverProgram), [
14025
+ Buffer.from("Nonce", "utf8"),
14026
+ publicKeyBytes(params.receiver),
14027
+ u32({ endian: Endian.Big }).serialize(srcEid),
14028
+ params.sender
14029
+ ]);
14030
+ const accounts = [
14031
+ {
14032
+ pubkey: receiver,
14033
+ isSigner: false,
14034
+ isWritable: false
14035
+ },
14036
+ {
14037
+ pubkey: toWeb3JsPublicKey(nonceAccount),
14038
+ isSigner: false,
14039
+ isWritable: true
14040
+ }
14041
+ ];
14042
+ const nextNonceIx = {
14043
+ programId: receiverProgram,
14044
+ keys: accounts,
14045
+ data: Buffer.from(getNextNonceInstructionDataSerializer().serialize(params))
14046
+ };
14047
+ return simulateWeb3JsTransaction(connection, [nextNonceIx], receiverProgram, payer, u64(), commitment);
14048
+ }
13993
14049
 
13994
14050
  // src/generated/kinobi/blocked_messagelib/index.ts
13995
14051
  var blocked_messagelib_exports = {};
@@ -14569,6 +14625,6 @@ var SetConfigType2 = /* @__PURE__ */ ((SetConfigType3) => {
14569
14625
  return SetConfigType3;
14570
14626
  })(SetConfigType2 || {});
14571
14627
 
14572
- export { blocked_messagelib_exports as BlockedMessageLibProgram, dvn_exports2 as DVNProgram, DvnPDA, dvn_exports as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint_exports as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor_exports as ExecutorProgram, FAUCET_URL, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, MessageLibPDA, MessageType, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed_exports as PriceFeedProgram, SendHelper, SetConfigType2 as SetConfigType, simple_message_lib_exports as SimpleMessageLibProgram, UlnPDA, uln_exports as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer2 as getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer2 as getLzReceiveParamsSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
14628
+ export { blocked_messagelib_exports as BlockedMessageLibProgram, dvn_exports2 as DVNProgram, DvnPDA, dvn_exports as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint_exports as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor_exports as ExecutorProgram, FAUCET_URL, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, MessageLibPDA, MessageType, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed_exports as PriceFeedProgram, SendHelper, SetConfigType2 as SetConfigType, simple_message_lib_exports as SimpleMessageLibProgram, UlnPDA, uln_exports as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer2 as getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer2 as getLzReceiveParamsSerializer, getNextNonceInstructionDataSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, nextNonce, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
14573
14629
  //# sourceMappingURL=umi.mjs.map
14574
14630
  //# sourceMappingURL=umi.mjs.map