@layerzerolabs/lz-solana-sdk-v2 2.3.35 → 2.3.37
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 +20 -0
- package/dist/index.cjs +22 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +16 -7
- package/dist/index.d.ts +16 -7
- package/dist/index.mjs +22 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -15981,13 +15981,22 @@ declare abstract class BaseOApp {
|
|
|
15981
15981
|
getRemote(connection: Connection, dstEid: number, commitmentOrConfig?: web3$1.Commitment | web3$1.GetAccountInfoConfig): Promise<Uint8Array | null>;
|
|
15982
15982
|
}
|
|
15983
15983
|
|
|
15984
|
-
declare function extractSentPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<PacketSentEvent[] | null>;
|
|
15985
|
-
declare function extractVerifiedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<PacketVerifiedEvent[] | null>;
|
|
15986
|
-
declare function extractReceivedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<PacketDeliveredEvent[] | null>;
|
|
15987
|
-
declare function extractComposeSentEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<ComposeSentEvent[] | null>;
|
|
15988
|
-
declare function extractComposeDeliveredEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<ComposeDeliveredEvent[] | null>;
|
|
15989
|
-
declare function extractWorkerFeePaidEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<FeesPaidEvent[] | null>;
|
|
15990
|
-
|
|
15984
|
+
declare function extractSentPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<PacketSentEvent[] | null>;
|
|
15985
|
+
declare function extractVerifiedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<PacketVerifiedEvent[] | null>;
|
|
15986
|
+
declare function extractReceivedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<PacketDeliveredEvent[] | null>;
|
|
15987
|
+
declare function extractComposeSentEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<ComposeSentEvent[] | null>;
|
|
15988
|
+
declare function extractComposeDeliveredEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<ComposeDeliveredEvent[] | null>;
|
|
15989
|
+
declare function extractWorkerFeePaidEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<FeesPaidEvent[] | null>;
|
|
15990
|
+
/**
|
|
15991
|
+
* @param connection
|
|
15992
|
+
* @param program extract event from specific program id
|
|
15993
|
+
* @signature transaction signature(tx hash) or parsed transaction
|
|
15994
|
+
* @eventBeet beet struct for event
|
|
15995
|
+
* @commitment commitment level
|
|
15996
|
+
* @unsafeParseErr 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.
|
|
15997
|
+
* @returns array of events or null if no event found
|
|
15998
|
+
*/
|
|
15999
|
+
declare function extractEventFromTransactionSignature<E>(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, eventBeet: beet.FixableBeetArgsStruct<E> | beet.BeetArgsStruct<E>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<E[] | null>;
|
|
15991
16000
|
declare function generateAddressLookupTable(connection: Connection, payer: PublicKey, authority: PublicKey, addresses: PublicKey[]): Promise<{
|
|
15992
16001
|
instructions: TransactionInstruction[];
|
|
15993
16002
|
address: PublicKey;
|
package/dist/index.d.ts
CHANGED
|
@@ -15981,13 +15981,22 @@ declare abstract class BaseOApp {
|
|
|
15981
15981
|
getRemote(connection: Connection, dstEid: number, commitmentOrConfig?: web3$1.Commitment | web3$1.GetAccountInfoConfig): Promise<Uint8Array | null>;
|
|
15982
15982
|
}
|
|
15983
15983
|
|
|
15984
|
-
declare function extractSentPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<PacketSentEvent[] | null>;
|
|
15985
|
-
declare function extractVerifiedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<PacketVerifiedEvent[] | null>;
|
|
15986
|
-
declare function extractReceivedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<PacketDeliveredEvent[] | null>;
|
|
15987
|
-
declare function extractComposeSentEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<ComposeSentEvent[] | null>;
|
|
15988
|
-
declare function extractComposeDeliveredEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<ComposeDeliveredEvent[] | null>;
|
|
15989
|
-
declare function extractWorkerFeePaidEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig): Promise<FeesPaidEvent[] | null>;
|
|
15990
|
-
|
|
15984
|
+
declare function extractSentPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<PacketSentEvent[] | null>;
|
|
15985
|
+
declare function extractVerifiedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<PacketVerifiedEvent[] | null>;
|
|
15986
|
+
declare function extractReceivedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<PacketDeliveredEvent[] | null>;
|
|
15987
|
+
declare function extractComposeSentEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<ComposeSentEvent[] | null>;
|
|
15988
|
+
declare function extractComposeDeliveredEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<ComposeDeliveredEvent[] | null>;
|
|
15989
|
+
declare function extractWorkerFeePaidEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<FeesPaidEvent[] | null>;
|
|
15990
|
+
/**
|
|
15991
|
+
* @param connection
|
|
15992
|
+
* @param program extract event from specific program id
|
|
15993
|
+
* @signature transaction signature(tx hash) or parsed transaction
|
|
15994
|
+
* @eventBeet beet struct for event
|
|
15995
|
+
* @commitment commitment level
|
|
15996
|
+
* @unsafeParseErr 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.
|
|
15997
|
+
* @returns array of events or null if no event found
|
|
15998
|
+
*/
|
|
15999
|
+
declare function extractEventFromTransactionSignature<E>(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, eventBeet: beet.FixableBeetArgsStruct<E> | beet.BeetArgsStruct<E>, commitment?: Finality | GetVersionedTransactionConfig, unsafeParseErr?: boolean): Promise<E[] | null>;
|
|
15991
16000
|
declare function generateAddressLookupTable(connection: Connection, payer: PublicKey, authority: PublicKey, addresses: PublicKey[]): Promise<{
|
|
15992
16001
|
instructions: TransactionInstruction[];
|
|
15993
16002
|
address: PublicKey;
|
package/dist/index.mjs
CHANGED
|
@@ -14987,83 +14987,92 @@ function getEventDiscriminator(event) {
|
|
|
14987
14987
|
const sha2562 = hash.digest("hex");
|
|
14988
14988
|
return sha2562.slice(0, 16);
|
|
14989
14989
|
}
|
|
14990
|
-
async function extractSentPacketEventByTxHash(connection, program, signature, commitment) {
|
|
14990
|
+
async function extractSentPacketEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
14991
14991
|
const events = await extractEventFromTransactionSignature(
|
|
14992
14992
|
connection,
|
|
14993
14993
|
program,
|
|
14994
14994
|
signature,
|
|
14995
14995
|
packetSentEventBeet,
|
|
14996
|
-
commitment
|
|
14996
|
+
commitment,
|
|
14997
|
+
unsafeParseErr
|
|
14997
14998
|
);
|
|
14998
14999
|
if (!events)
|
|
14999
15000
|
return null;
|
|
15000
15001
|
return events;
|
|
15001
15002
|
}
|
|
15002
|
-
async function extractVerifiedPacketEventByTxHash(connection, program, signature, commitment) {
|
|
15003
|
+
async function extractVerifiedPacketEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15003
15004
|
const events = await extractEventFromTransactionSignature(
|
|
15004
15005
|
connection,
|
|
15005
15006
|
program,
|
|
15006
15007
|
signature,
|
|
15007
15008
|
packetVerifiedEventBeet,
|
|
15008
|
-
commitment
|
|
15009
|
+
commitment,
|
|
15010
|
+
unsafeParseErr
|
|
15009
15011
|
);
|
|
15010
15012
|
if (!events)
|
|
15011
15013
|
return null;
|
|
15012
15014
|
return events;
|
|
15013
15015
|
}
|
|
15014
|
-
async function extractReceivedPacketEventByTxHash(connection, program, signature, commitment) {
|
|
15016
|
+
async function extractReceivedPacketEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15015
15017
|
const events = await extractEventFromTransactionSignature(
|
|
15016
15018
|
connection,
|
|
15017
15019
|
program,
|
|
15018
15020
|
signature,
|
|
15019
15021
|
packetDeliveredEventBeet,
|
|
15020
|
-
commitment
|
|
15022
|
+
commitment,
|
|
15023
|
+
unsafeParseErr
|
|
15021
15024
|
);
|
|
15022
15025
|
if (!events)
|
|
15023
15026
|
return null;
|
|
15024
15027
|
return events;
|
|
15025
15028
|
}
|
|
15026
|
-
async function extractComposeSentEventByTxHash(connection, program, signature, commitment) {
|
|
15029
|
+
async function extractComposeSentEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15027
15030
|
const events = await extractEventFromTransactionSignature(
|
|
15028
15031
|
connection,
|
|
15029
15032
|
program,
|
|
15030
15033
|
signature,
|
|
15031
15034
|
composeSentEventBeet,
|
|
15032
|
-
commitment
|
|
15035
|
+
commitment,
|
|
15036
|
+
unsafeParseErr
|
|
15033
15037
|
);
|
|
15034
15038
|
if (!events)
|
|
15035
15039
|
return null;
|
|
15036
15040
|
return events;
|
|
15037
15041
|
}
|
|
15038
|
-
async function extractComposeDeliveredEventByTxHash(connection, program, signature, commitment) {
|
|
15042
|
+
async function extractComposeDeliveredEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15039
15043
|
const events = await extractEventFromTransactionSignature(
|
|
15040
15044
|
connection,
|
|
15041
15045
|
program,
|
|
15042
15046
|
signature,
|
|
15043
15047
|
composeDeliveredEventBeet,
|
|
15044
|
-
commitment
|
|
15048
|
+
commitment,
|
|
15049
|
+
unsafeParseErr
|
|
15045
15050
|
);
|
|
15046
15051
|
if (!events)
|
|
15047
15052
|
return null;
|
|
15048
15053
|
return events;
|
|
15049
15054
|
}
|
|
15050
|
-
async function extractWorkerFeePaidEventByTxHash(connection, program, signature, commitment) {
|
|
15055
|
+
async function extractWorkerFeePaidEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15051
15056
|
const events = await extractEventFromTransactionSignature(
|
|
15052
15057
|
connection,
|
|
15053
15058
|
program,
|
|
15054
15059
|
signature,
|
|
15055
15060
|
feesPaidEventBeet,
|
|
15056
|
-
commitment
|
|
15061
|
+
commitment,
|
|
15062
|
+
unsafeParseErr
|
|
15057
15063
|
);
|
|
15058
15064
|
if (!events)
|
|
15059
15065
|
return null;
|
|
15060
15066
|
return events;
|
|
15061
15067
|
}
|
|
15062
|
-
async function extractEventFromTransactionSignature(connection, program, signature, eventBeet, commitment) {
|
|
15068
|
+
async function extractEventFromTransactionSignature(connection, program, signature, eventBeet, commitment, unsafeParseErr = false) {
|
|
15063
15069
|
const tx = typeof signature === "string" ? await connection.getParsedTransaction(signature, commitment) : signature;
|
|
15064
15070
|
if (tx == null)
|
|
15065
15071
|
return null;
|
|
15066
15072
|
const events = new Array();
|
|
15073
|
+
if (tx.meta?.err !== null && !unsafeParseErr) {
|
|
15074
|
+
return null;
|
|
15075
|
+
}
|
|
15067
15076
|
for (const instruction of tx.meta?.innerInstructions ?? []) {
|
|
15068
15077
|
for (const innerInstruction of instruction.instructions) {
|
|
15069
15078
|
const inst = innerInstruction;
|