@layerzerolabs/lz-solana-sdk-v2 2.3.36 → 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 +10 -0
- package/dist/index.cjs +14 -15
- 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 +14 -15
- 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,
|
|
15985
|
-
declare function extractVerifiedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15986
|
-
declare function extractReceivedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15987
|
-
declare function extractComposeSentEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15988
|
-
declare function extractComposeDeliveredEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15989
|
-
declare function extractWorkerFeePaidEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
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,
|
|
15985
|
-
declare function extractVerifiedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15986
|
-
declare function extractReceivedPacketEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15987
|
-
declare function extractComposeSentEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15988
|
-
declare function extractComposeDeliveredEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
15989
|
-
declare function extractWorkerFeePaidEventByTxHash(connection: Connection, program: PublicKey, signature: TransactionSignature | Awaited<ReturnType<typeof connection.getParsedTransaction>>, commitment?: Finality | GetVersionedTransactionConfig,
|
|
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,91 +14987,90 @@ 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
14996
|
commitment,
|
|
14997
|
-
|
|
14997
|
+
unsafeParseErr
|
|
14998
14998
|
);
|
|
14999
14999
|
if (!events)
|
|
15000
15000
|
return null;
|
|
15001
15001
|
return events;
|
|
15002
15002
|
}
|
|
15003
|
-
async function extractVerifiedPacketEventByTxHash(connection, program, signature, commitment,
|
|
15003
|
+
async function extractVerifiedPacketEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15004
15004
|
const events = await extractEventFromTransactionSignature(
|
|
15005
15005
|
connection,
|
|
15006
15006
|
program,
|
|
15007
15007
|
signature,
|
|
15008
15008
|
packetVerifiedEventBeet,
|
|
15009
15009
|
commitment,
|
|
15010
|
-
|
|
15010
|
+
unsafeParseErr
|
|
15011
15011
|
);
|
|
15012
15012
|
if (!events)
|
|
15013
15013
|
return null;
|
|
15014
15014
|
return events;
|
|
15015
15015
|
}
|
|
15016
|
-
async function extractReceivedPacketEventByTxHash(connection, program, signature, commitment,
|
|
15016
|
+
async function extractReceivedPacketEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15017
15017
|
const events = await extractEventFromTransactionSignature(
|
|
15018
15018
|
connection,
|
|
15019
15019
|
program,
|
|
15020
15020
|
signature,
|
|
15021
15021
|
packetDeliveredEventBeet,
|
|
15022
15022
|
commitment,
|
|
15023
|
-
|
|
15023
|
+
unsafeParseErr
|
|
15024
15024
|
);
|
|
15025
15025
|
if (!events)
|
|
15026
15026
|
return null;
|
|
15027
15027
|
return events;
|
|
15028
15028
|
}
|
|
15029
|
-
async function extractComposeSentEventByTxHash(connection, program, signature, commitment,
|
|
15029
|
+
async function extractComposeSentEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15030
15030
|
const events = await extractEventFromTransactionSignature(
|
|
15031
15031
|
connection,
|
|
15032
15032
|
program,
|
|
15033
15033
|
signature,
|
|
15034
15034
|
composeSentEventBeet,
|
|
15035
15035
|
commitment,
|
|
15036
|
-
|
|
15036
|
+
unsafeParseErr
|
|
15037
15037
|
);
|
|
15038
15038
|
if (!events)
|
|
15039
15039
|
return null;
|
|
15040
15040
|
return events;
|
|
15041
15041
|
}
|
|
15042
|
-
async function extractComposeDeliveredEventByTxHash(connection, program, signature, commitment,
|
|
15042
|
+
async function extractComposeDeliveredEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15043
15043
|
const events = await extractEventFromTransactionSignature(
|
|
15044
15044
|
connection,
|
|
15045
15045
|
program,
|
|
15046
15046
|
signature,
|
|
15047
15047
|
composeDeliveredEventBeet,
|
|
15048
15048
|
commitment,
|
|
15049
|
-
|
|
15049
|
+
unsafeParseErr
|
|
15050
15050
|
);
|
|
15051
15051
|
if (!events)
|
|
15052
15052
|
return null;
|
|
15053
15053
|
return events;
|
|
15054
15054
|
}
|
|
15055
|
-
async function extractWorkerFeePaidEventByTxHash(connection, program, signature, commitment,
|
|
15055
|
+
async function extractWorkerFeePaidEventByTxHash(connection, program, signature, commitment, unsafeParseErr = false) {
|
|
15056
15056
|
const events = await extractEventFromTransactionSignature(
|
|
15057
15057
|
connection,
|
|
15058
15058
|
program,
|
|
15059
15059
|
signature,
|
|
15060
15060
|
feesPaidEventBeet,
|
|
15061
15061
|
commitment,
|
|
15062
|
-
|
|
15062
|
+
unsafeParseErr
|
|
15063
15063
|
);
|
|
15064
15064
|
if (!events)
|
|
15065
15065
|
return null;
|
|
15066
15066
|
return events;
|
|
15067
15067
|
}
|
|
15068
|
-
async function extractEventFromTransactionSignature(connection, program, signature, eventBeet, commitment,
|
|
15068
|
+
async function extractEventFromTransactionSignature(connection, program, signature, eventBeet, commitment, unsafeParseErr = false) {
|
|
15069
15069
|
const tx = typeof signature === "string" ? await connection.getParsedTransaction(signature, commitment) : signature;
|
|
15070
15070
|
if (tx == null)
|
|
15071
15071
|
return null;
|
|
15072
15072
|
const events = new Array();
|
|
15073
|
-
|
|
15074
|
-
if (err !== null && !skipErr) {
|
|
15073
|
+
if (tx.meta?.err !== null && !unsafeParseErr) {
|
|
15075
15074
|
return null;
|
|
15076
15075
|
}
|
|
15077
15076
|
for (const instruction of tx.meta?.innerInstructions ?? []) {
|