@layerzerolabs/lz-solana-sdk-v2 3.0.105 → 3.0.106
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 +13 -0
- package/dist/umi.cjs +419 -247
- package/dist/umi.cjs.map +1 -1
- package/dist/umi.d.mts +67 -35
- package/dist/umi.d.ts +67 -35
- package/dist/umi.mjs +412 -245
- package/dist/umi.mjs.map +1 -1
- package/package.json +9 -9
- package/src/compose-types-v1.ts +85 -0
- package/src/compose-types-v2.ts +224 -0
- package/src/executor.ts +26 -64
- package/src/index.ts +2 -0
- package/src/receive-types-v2.ts +8 -1
- package/src/receive.ts +44 -111
- package/src/types.ts +62 -7
package/dist/umi.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _metaplex_foundation_umi from '@metaplex-foundation/umi';
|
|
2
|
-
import { PublicKey, Pda, Account, RpcAccount, Context, RpcGetAccountOptions, RpcGetAccountsOptions, Option, OptionOrNullable, ProgramError, Program, Signer, TransactionBuilder, ProgramRepositoryInterface, RpcInterface, ClusterFilter, WrappedInstruction, Commitment, AccountMeta, Instruction
|
|
2
|
+
import { PublicKey, Pda, Account, RpcAccount, Context, RpcGetAccountOptions, RpcGetAccountsOptions, Option, OptionOrNullable, ProgramError, Program, Signer, TransactionBuilder, ProgramRepositoryInterface, RpcInterface, ClusterFilter, WrappedInstruction, Commitment, AccountMeta, Instruction, AddressLookupTableInput, KeypairSigner } from '@metaplex-foundation/umi';
|
|
3
3
|
import { PacketV1Codec, Packet as Packet$2 } from '@layerzerolabs/lz-v2-utilities';
|
|
4
4
|
import { Serializer, GetDataEnumKindContent, GetDataEnumKind } from '@metaplex-foundation/umi/serializers';
|
|
5
5
|
import { HashSigner } from '@layerzerolabs/lz-foundation';
|
|
@@ -4827,12 +4827,12 @@ declare class DVN {
|
|
|
4827
4827
|
constructor(programId: PublicKey, rpc?: RpcInterface);
|
|
4828
4828
|
getProgram(clusterFilter?: ClusterFilter): Program;
|
|
4829
4829
|
initDVN(rpc: RpcInterface, payer: Signer, params: InitDvnInstructionArgs): Promise<WrappedInstruction>;
|
|
4830
|
-
getDigest(vid: number, instruction: Instruction
|
|
4830
|
+
getDigest(vid: number, instruction: Instruction, expiration: bigint): ExecuteTransactionDigest;
|
|
4831
4831
|
getExecuteHash(hashBytes: Buffer): PublicKey;
|
|
4832
4832
|
getHashBytes(digest: ExecuteTransactionDigest): Buffer;
|
|
4833
4833
|
invoke(rpc: RpcInterface, payer: Signer, params: {
|
|
4834
4834
|
vid: number;
|
|
4835
|
-
instruction: Instruction
|
|
4835
|
+
instruction: Instruction;
|
|
4836
4836
|
expiration: bigint;
|
|
4837
4837
|
}, sign: SignFunc): Promise<WrappedInstruction>;
|
|
4838
4838
|
setMultisigConfig(rpc: RpcInterface, payer: Signer, params: {
|
|
@@ -5879,15 +5879,19 @@ declare class Executor {
|
|
|
5879
5879
|
endpointProgram?: PublicKey;
|
|
5880
5880
|
}, commitment?: Commitment): Promise<{
|
|
5881
5881
|
signers: Signer[];
|
|
5882
|
-
instructions: Instruction
|
|
5882
|
+
instructions: Instruction[];
|
|
5883
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
5883
5884
|
}>;
|
|
5884
5885
|
compose(rpc: RpcInterface, executor: Signer, param: {
|
|
5885
5886
|
event: ComposeSentEvent;
|
|
5886
5887
|
extraData: Uint8Array;
|
|
5887
5888
|
value?: bigint;
|
|
5888
|
-
computeUnits?: number;
|
|
5889
5889
|
endpointProgram?: PublicKey;
|
|
5890
|
-
}, commitment?: Commitment): Promise<
|
|
5890
|
+
}, commitment?: Commitment): Promise<{
|
|
5891
|
+
signers: Signer[];
|
|
5892
|
+
instructions: Instruction[];
|
|
5893
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
5894
|
+
}>;
|
|
5891
5895
|
preExecute(executor: Signer, version: number, feeLimit: bigint): WrappedInstruction;
|
|
5892
5896
|
postExecute(executor: Signer, version: number): WrappedInstruction;
|
|
5893
5897
|
}
|
|
@@ -8384,7 +8388,7 @@ declare function instructionDiscriminator(method: string): Buffer;
|
|
|
8384
8388
|
* @returns {Promise<Buffer>} A promise that resolves to the simulation result.
|
|
8385
8389
|
* @throws {Error} If the simulation fails.
|
|
8386
8390
|
*/
|
|
8387
|
-
declare function simulateWeb3JsTransaction<From, To extends From = From>(_connection: string | web3.Connection | RpcInterface, _instructions: web3.TransactionInstruction[] | WrappedInstruction[] | Instruction
|
|
8391
|
+
declare function simulateWeb3JsTransaction<From, To extends From = From>(_connection: string | web3.Connection | RpcInterface, _instructions: web3.TransactionInstruction[] | WrappedInstruction[] | Instruction[], _programId: web3.PublicKey | PublicKey, _payer: web3.PublicKey | PublicKey, serializer: Serializer<From, To>, commitment?: web3.Commitment, blockhash?: web3.Blockhash, _lookupTableAddress?: web3.PublicKey | PublicKey): Promise<To>;
|
|
8388
8392
|
declare function toWeb3Connection(rpc: RpcInterface | web3.Connection): web3.Connection;
|
|
8389
8393
|
|
|
8390
8394
|
/**
|
|
@@ -8547,6 +8551,9 @@ declare const MaxExecutorOptionTypeLength = 10;
|
|
|
8547
8551
|
interface LzReceiveTypesV2Accounts {
|
|
8548
8552
|
accounts: PublicKey[];
|
|
8549
8553
|
}
|
|
8554
|
+
interface LzComposeTypesV2Accounts {
|
|
8555
|
+
accounts: PublicKey[];
|
|
8556
|
+
}
|
|
8550
8557
|
type AddressLocator = {
|
|
8551
8558
|
__kind: 'Address';
|
|
8552
8559
|
fields: [PublicKey];
|
|
@@ -8565,7 +8572,7 @@ interface AccountMetaRef {
|
|
|
8565
8572
|
pubkey: AddressLocator;
|
|
8566
8573
|
isWritable: boolean;
|
|
8567
8574
|
}
|
|
8568
|
-
type
|
|
8575
|
+
type InstructionForLzReceive = {
|
|
8569
8576
|
__kind: 'LzReceive';
|
|
8570
8577
|
accounts: AccountMetaRef[];
|
|
8571
8578
|
} | {
|
|
@@ -8574,16 +8581,33 @@ type Instruction = {
|
|
|
8574
8581
|
accounts: AccountMetaRef[];
|
|
8575
8582
|
data: Uint8Array;
|
|
8576
8583
|
};
|
|
8584
|
+
type InstructionForLzCompose = {
|
|
8585
|
+
__kind: 'LzCompose';
|
|
8586
|
+
accounts: AccountMetaRef[];
|
|
8587
|
+
} | {
|
|
8588
|
+
__kind: 'Standard';
|
|
8589
|
+
programId: PublicKey;
|
|
8590
|
+
accounts: AccountMetaRef[];
|
|
8591
|
+
data: Uint8Array;
|
|
8592
|
+
};
|
|
8577
8593
|
interface LzReceiveTypesV2Result {
|
|
8578
8594
|
contextVersion: number;
|
|
8579
8595
|
alts: PublicKey[];
|
|
8580
|
-
instructions:
|
|
8596
|
+
instructions: InstructionForLzReceive[];
|
|
8597
|
+
}
|
|
8598
|
+
interface LzComposeTypesV2Result {
|
|
8599
|
+
contextVersion: number;
|
|
8600
|
+
alts: PublicKey[];
|
|
8601
|
+
instructions: InstructionForLzCompose[];
|
|
8581
8602
|
}
|
|
8582
8603
|
declare function getAddressLocatorSerializer(): Serializer<AddressLocator, AddressLocator>;
|
|
8583
8604
|
declare function getLzReceiveTypesV2AccountsSerializer(): Serializer<LzReceiveTypesV2Accounts, LzReceiveTypesV2Accounts>;
|
|
8605
|
+
declare function getLzComposeTypesV2AccountsSerializer(): Serializer<LzComposeTypesV2Accounts, LzComposeTypesV2Accounts>;
|
|
8584
8606
|
declare function getAccountMetaRefSerializer(): Serializer<AccountMetaRef, AccountMetaRef>;
|
|
8585
|
-
declare function
|
|
8607
|
+
declare function getInstructionForLzReceiveSerializer(): Serializer<InstructionForLzReceive, InstructionForLzReceive>;
|
|
8608
|
+
declare function getInstructionForLzComposeSerializer(): Serializer<InstructionForLzCompose, InstructionForLzCompose>;
|
|
8586
8609
|
declare function getLzReceiveTypesV2ResultSerializer(): Serializer<LzReceiveTypesV2Result, LzReceiveTypesV2Result>;
|
|
8610
|
+
declare function getLzComposeTypesV2ResultSerializer(): Serializer<LzComposeTypesV2Result, LzComposeTypesV2Result>;
|
|
8587
8611
|
declare function addressLocator(kind: 'Payer'): GetDataEnumKind<AddressLocator, 'Payer'>;
|
|
8588
8612
|
declare function addressLocator(kind: 'Signer', data: GetDataEnumKindContent<AddressLocator, 'Signer'>['fields']): GetDataEnumKind<AddressLocator, 'Signer'>;
|
|
8589
8613
|
declare function addressLocator(kind: 'Address', data: GetDataEnumKindContent<AddressLocator, 'Address'>['fields']): GetDataEnumKind<AddressLocator, 'Address'>;
|
|
@@ -8592,6 +8616,22 @@ declare function isAddressLocator<K extends AddressLocator['__kind']>(kind: K, v
|
|
|
8592
8616
|
__kind: K;
|
|
8593
8617
|
};
|
|
8594
8618
|
|
|
8619
|
+
/**
|
|
8620
|
+
* Retrieves the instructions and signers required for the LzCompose instruction (V2).
|
|
8621
|
+
* This is used for lz_compose_types version 2.
|
|
8622
|
+
*/
|
|
8623
|
+
declare function buildLzComposeExecutionPlan(rpc: RpcInterface, executorProgram: PublicKey, payer: PublicKey, to: PublicKey, composerProgram: PublicKey, params: LzComposeParams, composeTypesAccounts?: LzComposeTypesV2Accounts, commitment?: Commitment): Promise<{
|
|
8624
|
+
contextVersion: number;
|
|
8625
|
+
signers: KeypairSigner[];
|
|
8626
|
+
instructions: Instruction[];
|
|
8627
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
8628
|
+
}>;
|
|
8629
|
+
/**
|
|
8630
|
+
* Fetches the metadata for lz_compose_types (versioned, V2).
|
|
8631
|
+
* This reads the PDA account and deserializes the version, alts, and accounts.
|
|
8632
|
+
*/
|
|
8633
|
+
declare function getLzComposeTypesInfo(rpc: RpcInterface, payer: PublicKey, to: PublicKey, composerProgram: PublicKey, params: LzComposeParams, commitment?: Commitment): Promise<LzComposeTypesV2Accounts>;
|
|
8634
|
+
|
|
8595
8635
|
/**
|
|
8596
8636
|
* Retrieves the instructions and signers required for the LzReceive instruction (V2).
|
|
8597
8637
|
* This is used for lz_receive_types version 2.
|
|
@@ -8599,7 +8639,8 @@ declare function isAddressLocator<K extends AddressLocator['__kind']>(kind: K, v
|
|
|
8599
8639
|
declare function buildLzReceiveExecutionPlan(rpc: RpcInterface, executorProgram: PublicKey, payer: PublicKey, receiver: PublicKey, receiverProgram: PublicKey, params: LzReceiveParams, receiveTypesAccounts?: LzReceiveTypesV2Accounts, commitment?: Commitment): Promise<{
|
|
8600
8640
|
contextVersion: number;
|
|
8601
8641
|
signers: KeypairSigner[];
|
|
8602
|
-
instructions: Instruction
|
|
8642
|
+
instructions: Instruction[];
|
|
8643
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
8603
8644
|
}>;
|
|
8604
8645
|
/**
|
|
8605
8646
|
* Fetches the metadata for lz_receive_types (versioned, V2).
|
|
@@ -8615,40 +8656,31 @@ declare function getLzReceiveTypesInfo(rpc: RpcInterface, payer: PublicKey, rece
|
|
|
8615
8656
|
* For V2: returns { signers, instructions } for multi-instruction atomic execution.
|
|
8616
8657
|
*/
|
|
8617
8658
|
declare function lzReceive(rpc: RpcInterface, payer: PublicKey, packet: Pick<Packet$2, 'message' | 'sender' | 'srcEid' | 'guid' | 'receiver' | 'nonce'>, callerParams?: Uint8Array, executorProgram?: PublicKey, commitment?: Commitment): Promise<{
|
|
8618
|
-
instruction: Instruction
|
|
8659
|
+
instruction: Instruction;
|
|
8619
8660
|
contextVersion: number;
|
|
8620
8661
|
} | ReturnType<typeof buildLzReceiveExecutionPlan>>;
|
|
8621
8662
|
/**
|
|
8622
|
-
*
|
|
8623
|
-
*
|
|
8624
|
-
* @param {Connection} connection - The Solana connection object.
|
|
8625
|
-
* @param {PublicKey} payer - The public key of the payer.
|
|
8626
|
-
* @param {ComposeSentEvent} event - The event containing the message details.
|
|
8627
|
-
* @param {Uint8Array} [extraData] - Optional extra data.
|
|
8628
|
-
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - Optional commitment or configuration.
|
|
8629
|
-
*
|
|
8630
|
-
* @returns {Promise<TransactionInstruction>} The transaction instruction.
|
|
8631
|
-
*/
|
|
8632
|
-
declare function lzCompose(rpc: RpcInterface, payer: PublicKey, event: ComposeSentEvent, extraData?: Uint8Array, commitment?: Commitment): Promise<Instruction$1>;
|
|
8633
|
-
/**
|
|
8634
|
-
* Retrieves the accounts required for the LzCompose instruction.
|
|
8663
|
+
* Unified entry point for composing a LayerZero message on Solana.
|
|
8664
|
+
* This function automatically detects the lz_compose_types version and dispatches to the correct logic.
|
|
8635
8665
|
*
|
|
8636
|
-
*
|
|
8637
|
-
*
|
|
8638
|
-
* @param {PublicKey} to - The public key of the recipient.
|
|
8639
|
-
* @param {PublicKey} composerProgram - The public key of the composer program.
|
|
8640
|
-
* @param {LzComposeParams} params - The parameters for the LzCompose instruction.
|
|
8641
|
-
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - Optional commitment or configuration.
|
|
8642
|
-
*
|
|
8643
|
-
* @returns {Promise<AccountMeta[]>} The list of account metadata.
|
|
8666
|
+
* For V1: returns a single Instruction (legacy behavior).
|
|
8667
|
+
* For V2: returns { signers, instructions } for multi-instruction atomic execution.
|
|
8644
8668
|
*/
|
|
8645
|
-
declare function
|
|
8669
|
+
declare function lzCompose(rpc: RpcInterface, payer: PublicKey, event: ComposeSentEvent, extraData?: Uint8Array, executorProgram?: PublicKey, commitment?: Commitment): Promise<{
|
|
8670
|
+
instruction: Instruction;
|
|
8671
|
+
contextVersion: number;
|
|
8672
|
+
} | ReturnType<typeof buildLzComposeExecutionPlan>>;
|
|
8646
8673
|
|
|
8647
8674
|
/**
|
|
8648
8675
|
* Get the accounts required for lz_receive by querying lz_receive_types_v1.
|
|
8649
8676
|
*/
|
|
8650
8677
|
declare function getLzReceiveAccountsFromTypesV1(rpc: RpcInterface, payer: PublicKey, receiver: PublicKey, receiverProgram: PublicKey, params: LzReceiveParams, commitment?: Commitment): Promise<AccountMeta[]>;
|
|
8651
8678
|
|
|
8679
|
+
/**
|
|
8680
|
+
* Get the accounts required for lz_compose by querying lz_compose_types_v1.
|
|
8681
|
+
*/
|
|
8682
|
+
declare function getLzComposeAccountsFromTypesV1(rpc: RpcInterface, payer: PublicKey, to: PublicKey, composerProgram: PublicKey, params: LzComposeParams, commitment?: Commitment): Promise<AccountMeta[]>;
|
|
8683
|
+
|
|
8652
8684
|
/**
|
|
8653
8685
|
* Supported programs.
|
|
8654
8686
|
*/
|
|
@@ -9031,4 +9063,4 @@ interface MessageLibInterface {
|
|
|
9031
9063
|
getSetConfigIXAccountMetaForCPI(oapp: PublicKey, eid: number, endpointProgram?: PublicKey): AccountMeta[];
|
|
9032
9064
|
}
|
|
9033
9065
|
|
|
9034
|
-
export { type AccountMetaRef, type AddressLocator, 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
|
|
9066
|
+
export { type AccountMetaRef, type AddressLocator, 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 InstructionForLzCompose, type InstructionForLzReceive, type LzComposeParams, type LzComposeTypesV2Accounts, type LzComposeTypesV2Result, type LzReceiveAccount, type LzReceiveParams, type LzReceiveParamsArgs, type LzReceiveTypesV2Accounts, type LzReceiveTypesV2Result, 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, addressLocator, buildLzComposeExecutionPlan, buildLzReceiveExecutionPlan, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getAccountMetaRefSerializer, getAddressLocatorSerializer, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getInstructionForLzComposeSerializer, getInstructionForLzReceiveSerializer, getLzComposeAccountsFromTypesV1, getLzComposeParamsSerializer, getLzComposeTypesInfo, getLzComposeTypesV2AccountsSerializer, getLzComposeTypesV2ResultSerializer, getLzReceiveAccountSerializer, getLzReceiveAccountsFromTypesV1, getLzReceiveParamsSerializer, getLzReceiveTypesInfo, getLzReceiveTypesV2AccountsSerializer, getLzReceiveTypesV2ResultSerializer, getNextNonceInstructionDataSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, isAddressLocator, lzCompose, lzReceive, messageLibs, nextNonce, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
|
package/dist/umi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _metaplex_foundation_umi from '@metaplex-foundation/umi';
|
|
2
|
-
import { PublicKey, Pda, Account, RpcAccount, Context, RpcGetAccountOptions, RpcGetAccountsOptions, Option, OptionOrNullable, ProgramError, Program, Signer, TransactionBuilder, ProgramRepositoryInterface, RpcInterface, ClusterFilter, WrappedInstruction, Commitment, AccountMeta, Instruction
|
|
2
|
+
import { PublicKey, Pda, Account, RpcAccount, Context, RpcGetAccountOptions, RpcGetAccountsOptions, Option, OptionOrNullable, ProgramError, Program, Signer, TransactionBuilder, ProgramRepositoryInterface, RpcInterface, ClusterFilter, WrappedInstruction, Commitment, AccountMeta, Instruction, AddressLookupTableInput, KeypairSigner } from '@metaplex-foundation/umi';
|
|
3
3
|
import { PacketV1Codec, Packet as Packet$2 } from '@layerzerolabs/lz-v2-utilities';
|
|
4
4
|
import { Serializer, GetDataEnumKindContent, GetDataEnumKind } from '@metaplex-foundation/umi/serializers';
|
|
5
5
|
import { HashSigner } from '@layerzerolabs/lz-foundation';
|
|
@@ -4827,12 +4827,12 @@ declare class DVN {
|
|
|
4827
4827
|
constructor(programId: PublicKey, rpc?: RpcInterface);
|
|
4828
4828
|
getProgram(clusterFilter?: ClusterFilter): Program;
|
|
4829
4829
|
initDVN(rpc: RpcInterface, payer: Signer, params: InitDvnInstructionArgs): Promise<WrappedInstruction>;
|
|
4830
|
-
getDigest(vid: number, instruction: Instruction
|
|
4830
|
+
getDigest(vid: number, instruction: Instruction, expiration: bigint): ExecuteTransactionDigest;
|
|
4831
4831
|
getExecuteHash(hashBytes: Buffer): PublicKey;
|
|
4832
4832
|
getHashBytes(digest: ExecuteTransactionDigest): Buffer;
|
|
4833
4833
|
invoke(rpc: RpcInterface, payer: Signer, params: {
|
|
4834
4834
|
vid: number;
|
|
4835
|
-
instruction: Instruction
|
|
4835
|
+
instruction: Instruction;
|
|
4836
4836
|
expiration: bigint;
|
|
4837
4837
|
}, sign: SignFunc): Promise<WrappedInstruction>;
|
|
4838
4838
|
setMultisigConfig(rpc: RpcInterface, payer: Signer, params: {
|
|
@@ -5879,15 +5879,19 @@ declare class Executor {
|
|
|
5879
5879
|
endpointProgram?: PublicKey;
|
|
5880
5880
|
}, commitment?: Commitment): Promise<{
|
|
5881
5881
|
signers: Signer[];
|
|
5882
|
-
instructions: Instruction
|
|
5882
|
+
instructions: Instruction[];
|
|
5883
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
5883
5884
|
}>;
|
|
5884
5885
|
compose(rpc: RpcInterface, executor: Signer, param: {
|
|
5885
5886
|
event: ComposeSentEvent;
|
|
5886
5887
|
extraData: Uint8Array;
|
|
5887
5888
|
value?: bigint;
|
|
5888
|
-
computeUnits?: number;
|
|
5889
5889
|
endpointProgram?: PublicKey;
|
|
5890
|
-
}, commitment?: Commitment): Promise<
|
|
5890
|
+
}, commitment?: Commitment): Promise<{
|
|
5891
|
+
signers: Signer[];
|
|
5892
|
+
instructions: Instruction[];
|
|
5893
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
5894
|
+
}>;
|
|
5891
5895
|
preExecute(executor: Signer, version: number, feeLimit: bigint): WrappedInstruction;
|
|
5892
5896
|
postExecute(executor: Signer, version: number): WrappedInstruction;
|
|
5893
5897
|
}
|
|
@@ -8384,7 +8388,7 @@ declare function instructionDiscriminator(method: string): Buffer;
|
|
|
8384
8388
|
* @returns {Promise<Buffer>} A promise that resolves to the simulation result.
|
|
8385
8389
|
* @throws {Error} If the simulation fails.
|
|
8386
8390
|
*/
|
|
8387
|
-
declare function simulateWeb3JsTransaction<From, To extends From = From>(_connection: string | web3.Connection | RpcInterface, _instructions: web3.TransactionInstruction[] | WrappedInstruction[] | Instruction
|
|
8391
|
+
declare function simulateWeb3JsTransaction<From, To extends From = From>(_connection: string | web3.Connection | RpcInterface, _instructions: web3.TransactionInstruction[] | WrappedInstruction[] | Instruction[], _programId: web3.PublicKey | PublicKey, _payer: web3.PublicKey | PublicKey, serializer: Serializer<From, To>, commitment?: web3.Commitment, blockhash?: web3.Blockhash, _lookupTableAddress?: web3.PublicKey | PublicKey): Promise<To>;
|
|
8388
8392
|
declare function toWeb3Connection(rpc: RpcInterface | web3.Connection): web3.Connection;
|
|
8389
8393
|
|
|
8390
8394
|
/**
|
|
@@ -8547,6 +8551,9 @@ declare const MaxExecutorOptionTypeLength = 10;
|
|
|
8547
8551
|
interface LzReceiveTypesV2Accounts {
|
|
8548
8552
|
accounts: PublicKey[];
|
|
8549
8553
|
}
|
|
8554
|
+
interface LzComposeTypesV2Accounts {
|
|
8555
|
+
accounts: PublicKey[];
|
|
8556
|
+
}
|
|
8550
8557
|
type AddressLocator = {
|
|
8551
8558
|
__kind: 'Address';
|
|
8552
8559
|
fields: [PublicKey];
|
|
@@ -8565,7 +8572,7 @@ interface AccountMetaRef {
|
|
|
8565
8572
|
pubkey: AddressLocator;
|
|
8566
8573
|
isWritable: boolean;
|
|
8567
8574
|
}
|
|
8568
|
-
type
|
|
8575
|
+
type InstructionForLzReceive = {
|
|
8569
8576
|
__kind: 'LzReceive';
|
|
8570
8577
|
accounts: AccountMetaRef[];
|
|
8571
8578
|
} | {
|
|
@@ -8574,16 +8581,33 @@ type Instruction = {
|
|
|
8574
8581
|
accounts: AccountMetaRef[];
|
|
8575
8582
|
data: Uint8Array;
|
|
8576
8583
|
};
|
|
8584
|
+
type InstructionForLzCompose = {
|
|
8585
|
+
__kind: 'LzCompose';
|
|
8586
|
+
accounts: AccountMetaRef[];
|
|
8587
|
+
} | {
|
|
8588
|
+
__kind: 'Standard';
|
|
8589
|
+
programId: PublicKey;
|
|
8590
|
+
accounts: AccountMetaRef[];
|
|
8591
|
+
data: Uint8Array;
|
|
8592
|
+
};
|
|
8577
8593
|
interface LzReceiveTypesV2Result {
|
|
8578
8594
|
contextVersion: number;
|
|
8579
8595
|
alts: PublicKey[];
|
|
8580
|
-
instructions:
|
|
8596
|
+
instructions: InstructionForLzReceive[];
|
|
8597
|
+
}
|
|
8598
|
+
interface LzComposeTypesV2Result {
|
|
8599
|
+
contextVersion: number;
|
|
8600
|
+
alts: PublicKey[];
|
|
8601
|
+
instructions: InstructionForLzCompose[];
|
|
8581
8602
|
}
|
|
8582
8603
|
declare function getAddressLocatorSerializer(): Serializer<AddressLocator, AddressLocator>;
|
|
8583
8604
|
declare function getLzReceiveTypesV2AccountsSerializer(): Serializer<LzReceiveTypesV2Accounts, LzReceiveTypesV2Accounts>;
|
|
8605
|
+
declare function getLzComposeTypesV2AccountsSerializer(): Serializer<LzComposeTypesV2Accounts, LzComposeTypesV2Accounts>;
|
|
8584
8606
|
declare function getAccountMetaRefSerializer(): Serializer<AccountMetaRef, AccountMetaRef>;
|
|
8585
|
-
declare function
|
|
8607
|
+
declare function getInstructionForLzReceiveSerializer(): Serializer<InstructionForLzReceive, InstructionForLzReceive>;
|
|
8608
|
+
declare function getInstructionForLzComposeSerializer(): Serializer<InstructionForLzCompose, InstructionForLzCompose>;
|
|
8586
8609
|
declare function getLzReceiveTypesV2ResultSerializer(): Serializer<LzReceiveTypesV2Result, LzReceiveTypesV2Result>;
|
|
8610
|
+
declare function getLzComposeTypesV2ResultSerializer(): Serializer<LzComposeTypesV2Result, LzComposeTypesV2Result>;
|
|
8587
8611
|
declare function addressLocator(kind: 'Payer'): GetDataEnumKind<AddressLocator, 'Payer'>;
|
|
8588
8612
|
declare function addressLocator(kind: 'Signer', data: GetDataEnumKindContent<AddressLocator, 'Signer'>['fields']): GetDataEnumKind<AddressLocator, 'Signer'>;
|
|
8589
8613
|
declare function addressLocator(kind: 'Address', data: GetDataEnumKindContent<AddressLocator, 'Address'>['fields']): GetDataEnumKind<AddressLocator, 'Address'>;
|
|
@@ -8592,6 +8616,22 @@ declare function isAddressLocator<K extends AddressLocator['__kind']>(kind: K, v
|
|
|
8592
8616
|
__kind: K;
|
|
8593
8617
|
};
|
|
8594
8618
|
|
|
8619
|
+
/**
|
|
8620
|
+
* Retrieves the instructions and signers required for the LzCompose instruction (V2).
|
|
8621
|
+
* This is used for lz_compose_types version 2.
|
|
8622
|
+
*/
|
|
8623
|
+
declare function buildLzComposeExecutionPlan(rpc: RpcInterface, executorProgram: PublicKey, payer: PublicKey, to: PublicKey, composerProgram: PublicKey, params: LzComposeParams, composeTypesAccounts?: LzComposeTypesV2Accounts, commitment?: Commitment): Promise<{
|
|
8624
|
+
contextVersion: number;
|
|
8625
|
+
signers: KeypairSigner[];
|
|
8626
|
+
instructions: Instruction[];
|
|
8627
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
8628
|
+
}>;
|
|
8629
|
+
/**
|
|
8630
|
+
* Fetches the metadata for lz_compose_types (versioned, V2).
|
|
8631
|
+
* This reads the PDA account and deserializes the version, alts, and accounts.
|
|
8632
|
+
*/
|
|
8633
|
+
declare function getLzComposeTypesInfo(rpc: RpcInterface, payer: PublicKey, to: PublicKey, composerProgram: PublicKey, params: LzComposeParams, commitment?: Commitment): Promise<LzComposeTypesV2Accounts>;
|
|
8634
|
+
|
|
8595
8635
|
/**
|
|
8596
8636
|
* Retrieves the instructions and signers required for the LzReceive instruction (V2).
|
|
8597
8637
|
* This is used for lz_receive_types version 2.
|
|
@@ -8599,7 +8639,8 @@ declare function isAddressLocator<K extends AddressLocator['__kind']>(kind: K, v
|
|
|
8599
8639
|
declare function buildLzReceiveExecutionPlan(rpc: RpcInterface, executorProgram: PublicKey, payer: PublicKey, receiver: PublicKey, receiverProgram: PublicKey, params: LzReceiveParams, receiveTypesAccounts?: LzReceiveTypesV2Accounts, commitment?: Commitment): Promise<{
|
|
8600
8640
|
contextVersion: number;
|
|
8601
8641
|
signers: KeypairSigner[];
|
|
8602
|
-
instructions: Instruction
|
|
8642
|
+
instructions: Instruction[];
|
|
8643
|
+
addressLookupTables: AddressLookupTableInput[];
|
|
8603
8644
|
}>;
|
|
8604
8645
|
/**
|
|
8605
8646
|
* Fetches the metadata for lz_receive_types (versioned, V2).
|
|
@@ -8615,40 +8656,31 @@ declare function getLzReceiveTypesInfo(rpc: RpcInterface, payer: PublicKey, rece
|
|
|
8615
8656
|
* For V2: returns { signers, instructions } for multi-instruction atomic execution.
|
|
8616
8657
|
*/
|
|
8617
8658
|
declare function lzReceive(rpc: RpcInterface, payer: PublicKey, packet: Pick<Packet$2, 'message' | 'sender' | 'srcEid' | 'guid' | 'receiver' | 'nonce'>, callerParams?: Uint8Array, executorProgram?: PublicKey, commitment?: Commitment): Promise<{
|
|
8618
|
-
instruction: Instruction
|
|
8659
|
+
instruction: Instruction;
|
|
8619
8660
|
contextVersion: number;
|
|
8620
8661
|
} | ReturnType<typeof buildLzReceiveExecutionPlan>>;
|
|
8621
8662
|
/**
|
|
8622
|
-
*
|
|
8623
|
-
*
|
|
8624
|
-
* @param {Connection} connection - The Solana connection object.
|
|
8625
|
-
* @param {PublicKey} payer - The public key of the payer.
|
|
8626
|
-
* @param {ComposeSentEvent} event - The event containing the message details.
|
|
8627
|
-
* @param {Uint8Array} [extraData] - Optional extra data.
|
|
8628
|
-
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - Optional commitment or configuration.
|
|
8629
|
-
*
|
|
8630
|
-
* @returns {Promise<TransactionInstruction>} The transaction instruction.
|
|
8631
|
-
*/
|
|
8632
|
-
declare function lzCompose(rpc: RpcInterface, payer: PublicKey, event: ComposeSentEvent, extraData?: Uint8Array, commitment?: Commitment): Promise<Instruction$1>;
|
|
8633
|
-
/**
|
|
8634
|
-
* Retrieves the accounts required for the LzCompose instruction.
|
|
8663
|
+
* Unified entry point for composing a LayerZero message on Solana.
|
|
8664
|
+
* This function automatically detects the lz_compose_types version and dispatches to the correct logic.
|
|
8635
8665
|
*
|
|
8636
|
-
*
|
|
8637
|
-
*
|
|
8638
|
-
* @param {PublicKey} to - The public key of the recipient.
|
|
8639
|
-
* @param {PublicKey} composerProgram - The public key of the composer program.
|
|
8640
|
-
* @param {LzComposeParams} params - The parameters for the LzCompose instruction.
|
|
8641
|
-
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - Optional commitment or configuration.
|
|
8642
|
-
*
|
|
8643
|
-
* @returns {Promise<AccountMeta[]>} The list of account metadata.
|
|
8666
|
+
* For V1: returns a single Instruction (legacy behavior).
|
|
8667
|
+
* For V2: returns { signers, instructions } for multi-instruction atomic execution.
|
|
8644
8668
|
*/
|
|
8645
|
-
declare function
|
|
8669
|
+
declare function lzCompose(rpc: RpcInterface, payer: PublicKey, event: ComposeSentEvent, extraData?: Uint8Array, executorProgram?: PublicKey, commitment?: Commitment): Promise<{
|
|
8670
|
+
instruction: Instruction;
|
|
8671
|
+
contextVersion: number;
|
|
8672
|
+
} | ReturnType<typeof buildLzComposeExecutionPlan>>;
|
|
8646
8673
|
|
|
8647
8674
|
/**
|
|
8648
8675
|
* Get the accounts required for lz_receive by querying lz_receive_types_v1.
|
|
8649
8676
|
*/
|
|
8650
8677
|
declare function getLzReceiveAccountsFromTypesV1(rpc: RpcInterface, payer: PublicKey, receiver: PublicKey, receiverProgram: PublicKey, params: LzReceiveParams, commitment?: Commitment): Promise<AccountMeta[]>;
|
|
8651
8678
|
|
|
8679
|
+
/**
|
|
8680
|
+
* Get the accounts required for lz_compose by querying lz_compose_types_v1.
|
|
8681
|
+
*/
|
|
8682
|
+
declare function getLzComposeAccountsFromTypesV1(rpc: RpcInterface, payer: PublicKey, to: PublicKey, composerProgram: PublicKey, params: LzComposeParams, commitment?: Commitment): Promise<AccountMeta[]>;
|
|
8683
|
+
|
|
8652
8684
|
/**
|
|
8653
8685
|
* Supported programs.
|
|
8654
8686
|
*/
|
|
@@ -9031,4 +9063,4 @@ interface MessageLibInterface {
|
|
|
9031
9063
|
getSetConfigIXAccountMetaForCPI(oapp: PublicKey, eid: number, endpointProgram?: PublicKey): AccountMeta[];
|
|
9032
9064
|
}
|
|
9033
9065
|
|
|
9034
|
-
export { type AccountMetaRef, type AddressLocator, 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
|
|
9066
|
+
export { type AccountMetaRef, type AddressLocator, 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 InstructionForLzCompose, type InstructionForLzReceive, type LzComposeParams, type LzComposeTypesV2Accounts, type LzComposeTypesV2Result, type LzReceiveAccount, type LzReceiveParams, type LzReceiveParamsArgs, type LzReceiveTypesV2Accounts, type LzReceiveTypesV2Result, 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, addressLocator, buildLzComposeExecutionPlan, buildLzReceiveExecutionPlan, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getAccountMetaRefSerializer, getAddressLocatorSerializer, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getInstructionForLzComposeSerializer, getInstructionForLzReceiveSerializer, getLzComposeAccountsFromTypesV1, getLzComposeParamsSerializer, getLzComposeTypesInfo, getLzComposeTypesV2AccountsSerializer, getLzComposeTypesV2ResultSerializer, getLzReceiveAccountSerializer, getLzReceiveAccountsFromTypesV1, getLzReceiveParamsSerializer, getLzReceiveTypesInfo, getLzReceiveTypesV2AccountsSerializer, getLzReceiveTypesV2ResultSerializer, getNextNonceInstructionDataSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, isAddressLocator, lzCompose, lzReceive, messageLibs, nextNonce, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
|