@layerzerolabs/lz-solana-sdk-v2 3.0.67 → 3.0.68-ton.0
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.cjs +14 -13
- package/dist/umi.cjs.map +1 -1
- package/dist/umi.d.mts +3 -2
- package/dist/umi.d.ts +3 -2
- package/dist/umi.mjs +14 -14
- package/dist/umi.mjs.map +1 -1
- package/package.json +9 -9
- package/src/next_nonce.ts +2 -9
- package/src/utility.ts +14 -13
package/dist/umi.d.mts
CHANGED
|
@@ -8188,7 +8188,7 @@ declare function extractWorkerFeePaidEventByTxHash(connection: web3.Connection |
|
|
|
8188
8188
|
* @param {boolean} [unsafeParseErr=false] - Whether to parse the event even if the transaction failed. Default is false, only parse event if transaction succeeded. if true, will parse event even if transaction failed. Please set this to false if you want to ignore failed transaction and set `true` with caution as it may lead to unexpected behavior.
|
|
8189
8189
|
* @returns {Promise<E[] | null>} A promise that resolves to an array of events or null if not found.
|
|
8190
8190
|
*/
|
|
8191
|
-
declare function extractEventFromTransactionSignature<From, To extends From = From>(
|
|
8191
|
+
declare function extractEventFromTransactionSignature<From, To extends From = From>(rpc: web3.Connection | RpcInterface, _program: PublicKey | web3.PublicKey, signature: web3.TransactionSignature | web3.ParsedTransactionWithMeta | null, serializer: Serializer<From, To>, commitment?: web3.Finality | web3.GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<To[] | null>;
|
|
8192
8192
|
/**
|
|
8193
8193
|
* Generates an address lookup table.
|
|
8194
8194
|
*
|
|
@@ -8310,6 +8310,7 @@ declare function instructionDiscriminator(method: string): Buffer;
|
|
|
8310
8310
|
* @throws {Error} If the simulation fails.
|
|
8311
8311
|
*/
|
|
8312
8312
|
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>;
|
|
8313
|
+
declare function toWeb3Connection(rpc: RpcInterface | web3.Connection): web3.Connection;
|
|
8313
8314
|
|
|
8314
8315
|
/**
|
|
8315
8316
|
* Array of IDL types.
|
|
@@ -8884,4 +8885,4 @@ interface MessageLibInterface {
|
|
|
8884
8885
|
getSetConfigIXAccountMetaForCPI(oapp: PublicKey, eid: number, endpointProgram?: PublicKey): AccountMeta[];
|
|
8885
8886
|
}
|
|
8886
8887
|
|
|
8887
|
-
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, txWithAddressLookupTable, txWithNonce };
|
|
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 };
|
package/dist/umi.d.ts
CHANGED
|
@@ -8188,7 +8188,7 @@ declare function extractWorkerFeePaidEventByTxHash(connection: web3.Connection |
|
|
|
8188
8188
|
* @param {boolean} [unsafeParseErr=false] - Whether to parse the event even if the transaction failed. Default is false, only parse event if transaction succeeded. if true, will parse event even if transaction failed. Please set this to false if you want to ignore failed transaction and set `true` with caution as it may lead to unexpected behavior.
|
|
8189
8189
|
* @returns {Promise<E[] | null>} A promise that resolves to an array of events or null if not found.
|
|
8190
8190
|
*/
|
|
8191
|
-
declare function extractEventFromTransactionSignature<From, To extends From = From>(
|
|
8191
|
+
declare function extractEventFromTransactionSignature<From, To extends From = From>(rpc: web3.Connection | RpcInterface, _program: PublicKey | web3.PublicKey, signature: web3.TransactionSignature | web3.ParsedTransactionWithMeta | null, serializer: Serializer<From, To>, commitment?: web3.Finality | web3.GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<To[] | null>;
|
|
8192
8192
|
/**
|
|
8193
8193
|
* Generates an address lookup table.
|
|
8194
8194
|
*
|
|
@@ -8310,6 +8310,7 @@ declare function instructionDiscriminator(method: string): Buffer;
|
|
|
8310
8310
|
* @throws {Error} If the simulation fails.
|
|
8311
8311
|
*/
|
|
8312
8312
|
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>;
|
|
8313
|
+
declare function toWeb3Connection(rpc: RpcInterface | web3.Connection): web3.Connection;
|
|
8313
8314
|
|
|
8314
8315
|
/**
|
|
8315
8316
|
* Array of IDL types.
|
|
@@ -8884,4 +8885,4 @@ interface MessageLibInterface {
|
|
|
8884
8885
|
getSetConfigIXAccountMetaForCPI(oapp: PublicKey, eid: number, endpointProgram?: PublicKey): AccountMeta[];
|
|
8885
8886
|
}
|
|
8886
8887
|
|
|
8887
|
-
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, txWithAddressLookupTable, txWithNonce };
|
|
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 };
|
package/dist/umi.mjs
CHANGED
|
@@ -9903,7 +9903,7 @@ async function extractWorkerFeePaidEventByTxHash(connection, program, signature,
|
|
|
9903
9903
|
if (!events) return null;
|
|
9904
9904
|
return events;
|
|
9905
9905
|
}
|
|
9906
|
-
async function extractEventFromTransactionSignature(
|
|
9906
|
+
async function extractEventFromTransactionSignature(rpc, _program, signature, serializer, commitment, unsafeParseErr = false) {
|
|
9907
9907
|
let program;
|
|
9908
9908
|
if (typeof _program === "string" && isPublicKey(_program)) {
|
|
9909
9909
|
program = toWeb3JsPublicKey(_program);
|
|
@@ -9912,13 +9912,8 @@ async function extractEventFromTransactionSignature(connection, _program, signat
|
|
|
9912
9912
|
}
|
|
9913
9913
|
let tx;
|
|
9914
9914
|
if (typeof signature === "string") {
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
} else if ("connection" in connection && connection.connection instanceof web3.Connection) {
|
|
9918
|
-
tx = await connection.connection.getParsedTransaction(signature, commitment);
|
|
9919
|
-
} else {
|
|
9920
|
-
throw new Error("Invalid connection");
|
|
9921
|
-
}
|
|
9915
|
+
const connection = toWeb3Connection(rpc);
|
|
9916
|
+
tx = await connection.getParsedTransaction(signature, commitment);
|
|
9922
9917
|
} else {
|
|
9923
9918
|
tx = signature;
|
|
9924
9919
|
}
|
|
@@ -10069,12 +10064,8 @@ async function simulateWeb3JsTransaction(_connection, _instructions, _programId,
|
|
|
10069
10064
|
let connection;
|
|
10070
10065
|
if (typeof _connection === "string") {
|
|
10071
10066
|
connection = new web3.Connection(_connection, commitment);
|
|
10072
|
-
} else if (_connection instanceof web3.Connection) {
|
|
10073
|
-
connection = _connection;
|
|
10074
|
-
} else if ("connection" in _connection && _connection.connection instanceof web3.Connection) {
|
|
10075
|
-
({ connection } = _connection);
|
|
10076
10067
|
} else {
|
|
10077
|
-
|
|
10068
|
+
connection = toWeb3Connection(_connection);
|
|
10078
10069
|
}
|
|
10079
10070
|
let instructions;
|
|
10080
10071
|
if (_instructions.length === 0) {
|
|
@@ -10125,6 +10116,15 @@ async function simulateWeb3JsTransaction(_connection, _instructions, _programId,
|
|
|
10125
10116
|
return serializer.deserialize(resp, 0)[0];
|
|
10126
10117
|
}
|
|
10127
10118
|
}
|
|
10119
|
+
function toWeb3Connection(rpc) {
|
|
10120
|
+
if (rpc instanceof web3.Connection) {
|
|
10121
|
+
return rpc;
|
|
10122
|
+
} else if ("connection" in rpc && rpc.connection instanceof web3.Connection) {
|
|
10123
|
+
return rpc.connection;
|
|
10124
|
+
} else {
|
|
10125
|
+
throw new Error("Invalid connection");
|
|
10126
|
+
}
|
|
10127
|
+
}
|
|
10128
10128
|
|
|
10129
10129
|
// src/receive.ts
|
|
10130
10130
|
async function lzReceive(rpc, payer, packet, callerParams = Uint8Array.from([0, 0]), commitment = "confirmed") {
|
|
@@ -14569,6 +14569,6 @@ var SetConfigType2 = /* @__PURE__ */ ((SetConfigType3) => {
|
|
|
14569
14569
|
return SetConfigType3;
|
|
14570
14570
|
})(SetConfigType2 || {});
|
|
14571
14571
|
|
|
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, txWithAddressLookupTable, txWithNonce };
|
|
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 };
|
|
14573
14573
|
//# sourceMappingURL=umi.mjs.map
|
|
14574
14574
|
//# sourceMappingURL=umi.mjs.map
|