@layerzerolabs/lz-solana-sdk-v2 3.0.135-sui.0 → 3.0.136
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/{index-CvZUDmni.d.mts → index-Cl-ICwDK.d.mts} +6 -6
- package/dist/{index-CvZUDmni.d.ts → index-Cl-ICwDK.d.ts} +6 -6
- package/dist/index.cjs +35 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +36 -27
- package/dist/index.mjs.map +1 -1
- package/dist/umi.cjs +18 -17
- package/dist/umi.cjs.map +1 -1
- package/dist/umi.d.mts +1 -1
- package/dist/umi.d.ts +1 -1
- package/dist/umi.mjs +18 -17
- package/dist/umi.mjs.map +1 -1
- package/package.json +9 -9
- package/src/solita/utility.ts +23 -12
- package/src/utility.ts +29 -20
package/dist/umi.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@metaplex-foundation/umi';
|
|
2
|
-
export { ae as AccountMetaRef, ad as AddressLocator, c as BlockedMessageLibProgram, d as DVNProgram, au as Deployment, D as DvnPDA, f as DvnProgram, h as EDDSA, E as ENFORCED_OPTIONS_SEED, j as EndpointPDA, e as EndpointProgram, l as EventPDA, a9 as ExecutorOptionType, m as ExecutorPDA, b as ExecutorProgram, R as FAUCET_URL, ag as InstructionForLzCompose, af as InstructionForLzReceive, a5 as LzComposeParams, ac as LzComposeTypesV2Accounts, ai as LzComposeTypesV2Result, a7 as LzReceiveAccount, a2 as LzReceiveParams, a3 as LzReceiveParamsArgs, ab as LzReceiveTypesV2Accounts, ah as LzReceiveTypesV2Result, g as MINT_SEED, a0 as MSG_TYPE_OFFSET, aa as MaxExecutorOptionTypeLength, M as MessageLibInterface, k as MessageLibPDA, a1 as MessageType, aD as NextNonceInstructionData, aE as NextNonceInstructionDataArgs, O as OmniAppPDA, P as PEER_SEED, n as PriceFeedPDA, p as PriceFeedProgram, aH as SendHelper, S as SetConfigType, s as SimpleMessageLibProgram, a as SolanaPacketPath, at as SupportedPrograms, U as UlnPDA, u as UlnProgram, ar as addressLocator, _ as buildLzComposeExecutionPlan, X as buildLzReceiveExecutionPlan, H as buildMessageV0, I as buildVersionedTransaction, A as closeLookupTable, C as createNonceAccountTX, z as deactivateLookupTable, v as extractComposeDeliveredEventByTxHash, t as extractComposeSentEventByTxHash, x as extractEventFromTransactionSignature, o as extractPacketSentEventByTxHash, r as extractReceivedPacketEventByTxHash, q as extractVerifiedPacketEventByTxHash, w as extractWorkerFeePaidEventByTxHash, y as generateAddressLookupTable, am as getAccountMetaRefSerializer, aj as getAddressLocatorSerializer, aA as getBlockedMessageLibProgramId, az as getDVNProgramId, aw as getEndpointProgramId, aB as getExecutorProgramId, ao as getInstructionForLzComposeSerializer, an as getInstructionForLzReceiveSerializer, Z as getLzComposeAccountsFromTypesV1, a6 as getLzComposeParamsSerializer, $ as getLzComposeTypesInfo, al as getLzComposeTypesV2AccountsSerializer, aq as getLzComposeTypesV2ResultSerializer, a8 as getLzReceiveAccountSerializer, W as getLzReceiveAccountsFromTypesV1, a4 as getLzReceiveParamsSerializer, Y as getLzReceiveTypesInfo, ak as getLzReceiveTypesV2AccountsSerializer, ap as getLzReceiveTypesV2ResultSerializer, aF as getNextNonceInstructionDataSerializer, aC as getPricefeedProgramId, av as getProgramKeypair, ax as getSimpleMessageLibProgramId, ay as getULNProgramId, N as idlTypes, J as instructionDiscriminator, G as isAccountInitialized, as as isAddressLocator, V as lzCompose, T as lzReceive, Q as messageLibs, aG as nextNonce, K as simulateWeb3JsTransaction, L as toWeb3Connection, B as txWithAddressLookupTable, F as txWithNonce } from './index-
|
|
2
|
+
export { ae as AccountMetaRef, ad as AddressLocator, c as BlockedMessageLibProgram, d as DVNProgram, au as Deployment, D as DvnPDA, f as DvnProgram, h as EDDSA, E as ENFORCED_OPTIONS_SEED, j as EndpointPDA, e as EndpointProgram, l as EventPDA, a9 as ExecutorOptionType, m as ExecutorPDA, b as ExecutorProgram, R as FAUCET_URL, ag as InstructionForLzCompose, af as InstructionForLzReceive, a5 as LzComposeParams, ac as LzComposeTypesV2Accounts, ai as LzComposeTypesV2Result, a7 as LzReceiveAccount, a2 as LzReceiveParams, a3 as LzReceiveParamsArgs, ab as LzReceiveTypesV2Accounts, ah as LzReceiveTypesV2Result, g as MINT_SEED, a0 as MSG_TYPE_OFFSET, aa as MaxExecutorOptionTypeLength, M as MessageLibInterface, k as MessageLibPDA, a1 as MessageType, aD as NextNonceInstructionData, aE as NextNonceInstructionDataArgs, O as OmniAppPDA, P as PEER_SEED, n as PriceFeedPDA, p as PriceFeedProgram, aH as SendHelper, S as SetConfigType, s as SimpleMessageLibProgram, a as SolanaPacketPath, at as SupportedPrograms, U as UlnPDA, u as UlnProgram, ar as addressLocator, _ as buildLzComposeExecutionPlan, X as buildLzReceiveExecutionPlan, H as buildMessageV0, I as buildVersionedTransaction, A as closeLookupTable, C as createNonceAccountTX, z as deactivateLookupTable, v as extractComposeDeliveredEventByTxHash, t as extractComposeSentEventByTxHash, x as extractEventFromTransactionSignature, o as extractPacketSentEventByTxHash, r as extractReceivedPacketEventByTxHash, q as extractVerifiedPacketEventByTxHash, w as extractWorkerFeePaidEventByTxHash, y as generateAddressLookupTable, am as getAccountMetaRefSerializer, aj as getAddressLocatorSerializer, aA as getBlockedMessageLibProgramId, az as getDVNProgramId, aw as getEndpointProgramId, aB as getExecutorProgramId, ao as getInstructionForLzComposeSerializer, an as getInstructionForLzReceiveSerializer, Z as getLzComposeAccountsFromTypesV1, a6 as getLzComposeParamsSerializer, $ as getLzComposeTypesInfo, al as getLzComposeTypesV2AccountsSerializer, aq as getLzComposeTypesV2ResultSerializer, a8 as getLzReceiveAccountSerializer, W as getLzReceiveAccountsFromTypesV1, a4 as getLzReceiveParamsSerializer, Y as getLzReceiveTypesInfo, ak as getLzReceiveTypesV2AccountsSerializer, ap as getLzReceiveTypesV2ResultSerializer, aF as getNextNonceInstructionDataSerializer, aC as getPricefeedProgramId, av as getProgramKeypair, ax as getSimpleMessageLibProgramId, ay as getULNProgramId, N as idlTypes, J as instructionDiscriminator, G as isAccountInitialized, as as isAddressLocator, V as lzCompose, T as lzReceive, Q as messageLibs, aG as nextNonce, K as simulateWeb3JsTransaction, L as toWeb3Connection, B as txWithAddressLookupTable, F as txWithNonce } from './index-Cl-ICwDK.mjs';
|
|
3
3
|
import '@layerzerolabs/lz-v2-utilities';
|
|
4
4
|
import '@metaplex-foundation/umi/serializers';
|
|
5
5
|
import '@layerzerolabs/lz-foundation';
|
package/dist/umi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@metaplex-foundation/umi';
|
|
2
|
-
export { ae as AccountMetaRef, ad as AddressLocator, c as BlockedMessageLibProgram, d as DVNProgram, au as Deployment, D as DvnPDA, f as DvnProgram, h as EDDSA, E as ENFORCED_OPTIONS_SEED, j as EndpointPDA, e as EndpointProgram, l as EventPDA, a9 as ExecutorOptionType, m as ExecutorPDA, b as ExecutorProgram, R as FAUCET_URL, ag as InstructionForLzCompose, af as InstructionForLzReceive, a5 as LzComposeParams, ac as LzComposeTypesV2Accounts, ai as LzComposeTypesV2Result, a7 as LzReceiveAccount, a2 as LzReceiveParams, a3 as LzReceiveParamsArgs, ab as LzReceiveTypesV2Accounts, ah as LzReceiveTypesV2Result, g as MINT_SEED, a0 as MSG_TYPE_OFFSET, aa as MaxExecutorOptionTypeLength, M as MessageLibInterface, k as MessageLibPDA, a1 as MessageType, aD as NextNonceInstructionData, aE as NextNonceInstructionDataArgs, O as OmniAppPDA, P as PEER_SEED, n as PriceFeedPDA, p as PriceFeedProgram, aH as SendHelper, S as SetConfigType, s as SimpleMessageLibProgram, a as SolanaPacketPath, at as SupportedPrograms, U as UlnPDA, u as UlnProgram, ar as addressLocator, _ as buildLzComposeExecutionPlan, X as buildLzReceiveExecutionPlan, H as buildMessageV0, I as buildVersionedTransaction, A as closeLookupTable, C as createNonceAccountTX, z as deactivateLookupTable, v as extractComposeDeliveredEventByTxHash, t as extractComposeSentEventByTxHash, x as extractEventFromTransactionSignature, o as extractPacketSentEventByTxHash, r as extractReceivedPacketEventByTxHash, q as extractVerifiedPacketEventByTxHash, w as extractWorkerFeePaidEventByTxHash, y as generateAddressLookupTable, am as getAccountMetaRefSerializer, aj as getAddressLocatorSerializer, aA as getBlockedMessageLibProgramId, az as getDVNProgramId, aw as getEndpointProgramId, aB as getExecutorProgramId, ao as getInstructionForLzComposeSerializer, an as getInstructionForLzReceiveSerializer, Z as getLzComposeAccountsFromTypesV1, a6 as getLzComposeParamsSerializer, $ as getLzComposeTypesInfo, al as getLzComposeTypesV2AccountsSerializer, aq as getLzComposeTypesV2ResultSerializer, a8 as getLzReceiveAccountSerializer, W as getLzReceiveAccountsFromTypesV1, a4 as getLzReceiveParamsSerializer, Y as getLzReceiveTypesInfo, ak as getLzReceiveTypesV2AccountsSerializer, ap as getLzReceiveTypesV2ResultSerializer, aF as getNextNonceInstructionDataSerializer, aC as getPricefeedProgramId, av as getProgramKeypair, ax as getSimpleMessageLibProgramId, ay as getULNProgramId, N as idlTypes, J as instructionDiscriminator, G as isAccountInitialized, as as isAddressLocator, V as lzCompose, T as lzReceive, Q as messageLibs, aG as nextNonce, K as simulateWeb3JsTransaction, L as toWeb3Connection, B as txWithAddressLookupTable, F as txWithNonce } from './index-
|
|
2
|
+
export { ae as AccountMetaRef, ad as AddressLocator, c as BlockedMessageLibProgram, d as DVNProgram, au as Deployment, D as DvnPDA, f as DvnProgram, h as EDDSA, E as ENFORCED_OPTIONS_SEED, j as EndpointPDA, e as EndpointProgram, l as EventPDA, a9 as ExecutorOptionType, m as ExecutorPDA, b as ExecutorProgram, R as FAUCET_URL, ag as InstructionForLzCompose, af as InstructionForLzReceive, a5 as LzComposeParams, ac as LzComposeTypesV2Accounts, ai as LzComposeTypesV2Result, a7 as LzReceiveAccount, a2 as LzReceiveParams, a3 as LzReceiveParamsArgs, ab as LzReceiveTypesV2Accounts, ah as LzReceiveTypesV2Result, g as MINT_SEED, a0 as MSG_TYPE_OFFSET, aa as MaxExecutorOptionTypeLength, M as MessageLibInterface, k as MessageLibPDA, a1 as MessageType, aD as NextNonceInstructionData, aE as NextNonceInstructionDataArgs, O as OmniAppPDA, P as PEER_SEED, n as PriceFeedPDA, p as PriceFeedProgram, aH as SendHelper, S as SetConfigType, s as SimpleMessageLibProgram, a as SolanaPacketPath, at as SupportedPrograms, U as UlnPDA, u as UlnProgram, ar as addressLocator, _ as buildLzComposeExecutionPlan, X as buildLzReceiveExecutionPlan, H as buildMessageV0, I as buildVersionedTransaction, A as closeLookupTable, C as createNonceAccountTX, z as deactivateLookupTable, v as extractComposeDeliveredEventByTxHash, t as extractComposeSentEventByTxHash, x as extractEventFromTransactionSignature, o as extractPacketSentEventByTxHash, r as extractReceivedPacketEventByTxHash, q as extractVerifiedPacketEventByTxHash, w as extractWorkerFeePaidEventByTxHash, y as generateAddressLookupTable, am as getAccountMetaRefSerializer, aj as getAddressLocatorSerializer, aA as getBlockedMessageLibProgramId, az as getDVNProgramId, aw as getEndpointProgramId, aB as getExecutorProgramId, ao as getInstructionForLzComposeSerializer, an as getInstructionForLzReceiveSerializer, Z as getLzComposeAccountsFromTypesV1, a6 as getLzComposeParamsSerializer, $ as getLzComposeTypesInfo, al as getLzComposeTypesV2AccountsSerializer, aq as getLzComposeTypesV2ResultSerializer, a8 as getLzReceiveAccountSerializer, W as getLzReceiveAccountsFromTypesV1, a4 as getLzReceiveParamsSerializer, Y as getLzReceiveTypesInfo, ak as getLzReceiveTypesV2AccountsSerializer, ap as getLzReceiveTypesV2ResultSerializer, aF as getNextNonceInstructionDataSerializer, aC as getPricefeedProgramId, av as getProgramKeypair, ax as getSimpleMessageLibProgramId, ay as getULNProgramId, N as idlTypes, J as instructionDiscriminator, G as isAccountInitialized, as as isAddressLocator, V as lzCompose, T as lzReceive, Q as messageLibs, aG as nextNonce, K as simulateWeb3JsTransaction, L as toWeb3Connection, B as txWithAddressLookupTable, F as txWithNonce } from './index-Cl-ICwDK.js';
|
|
3
3
|
import '@layerzerolabs/lz-v2-utilities';
|
|
4
4
|
import '@metaplex-foundation/umi/serializers';
|
|
5
5
|
import '@layerzerolabs/lz-foundation';
|
package/dist/umi.mjs
CHANGED
|
@@ -10376,9 +10376,9 @@ function closeLookupTable(recipient, authority, lookupTable) {
|
|
|
10376
10376
|
lookupTable
|
|
10377
10377
|
});
|
|
10378
10378
|
}
|
|
10379
|
-
async function txWithAddressLookupTable(connection, payer, instructions, recentBlockHash,
|
|
10379
|
+
async function txWithAddressLookupTable(connection, payer, instructions, recentBlockHash, _tableAddrs) {
|
|
10380
10380
|
recentBlockHash = recentBlockHash ?? (await connection.getLatestBlockhash()).blockhash;
|
|
10381
|
-
if (!
|
|
10381
|
+
if (!_tableAddrs) {
|
|
10382
10382
|
return new web3.VersionedTransaction(
|
|
10383
10383
|
new web3.TransactionMessage({
|
|
10384
10384
|
instructions,
|
|
@@ -10387,13 +10387,21 @@ async function txWithAddressLookupTable(connection, payer, instructions, recentB
|
|
|
10387
10387
|
}).compileToV0Message()
|
|
10388
10388
|
);
|
|
10389
10389
|
}
|
|
10390
|
-
const
|
|
10390
|
+
const tableAddrs = Array.isArray(_tableAddrs) ? _tableAddrs : [_tableAddrs];
|
|
10391
|
+
const lookupTableAccountsResult = await connection.getMultipleAccountsInfo(tableAddrs);
|
|
10392
|
+
const lookupTableAccounts = lookupTableAccountsResult.map((result, index) => {
|
|
10393
|
+
if (result === null) return null;
|
|
10394
|
+
return new web3.AddressLookupTableAccount({
|
|
10395
|
+
key: tableAddrs[index],
|
|
10396
|
+
state: web3.AddressLookupTableAccount.deserialize(result.data)
|
|
10397
|
+
});
|
|
10398
|
+
}).filter((account) => account !== null);
|
|
10391
10399
|
return new web3.VersionedTransaction(
|
|
10392
10400
|
new web3.TransactionMessage({
|
|
10393
10401
|
instructions,
|
|
10394
10402
|
payerKey: payer,
|
|
10395
10403
|
recentBlockhash: recentBlockHash
|
|
10396
|
-
}).compileToV0Message(
|
|
10404
|
+
}).compileToV0Message(lookupTableAccounts.length > 0 ? lookupTableAccounts : void 0)
|
|
10397
10405
|
);
|
|
10398
10406
|
}
|
|
10399
10407
|
async function createNonceAccountTX(connection, auth, lamportsForRent) {
|
|
@@ -10452,9 +10460,9 @@ async function buildMessageV0(connection, payerKey, instructions, commitmentOrCo
|
|
|
10452
10460
|
instructions
|
|
10453
10461
|
}).compileToV0Message();
|
|
10454
10462
|
}
|
|
10455
|
-
async function buildVersionedTransaction(connection, payerKey, instructions, commitmentOrConfig = "confirmed", blockhash,
|
|
10456
|
-
if (
|
|
10457
|
-
return txWithAddressLookupTable(connection, payerKey, instructions, blockhash,
|
|
10463
|
+
async function buildVersionedTransaction(connection, payerKey, instructions, commitmentOrConfig = "confirmed", blockhash, lookupTableAddresses) {
|
|
10464
|
+
if (lookupTableAddresses) {
|
|
10465
|
+
return txWithAddressLookupTable(connection, payerKey, instructions, blockhash, lookupTableAddresses);
|
|
10458
10466
|
}
|
|
10459
10467
|
return new web3.VersionedTransaction(
|
|
10460
10468
|
await buildMessageV0(connection, payerKey, instructions, commitmentOrConfig, blockhash)
|
|
@@ -10463,7 +10471,7 @@ async function buildVersionedTransaction(connection, payerKey, instructions, com
|
|
|
10463
10471
|
function instructionDiscriminator(method) {
|
|
10464
10472
|
return Buffer.from(sha2_256(Buffer.from(`global:${method}`))).subarray(0, 8);
|
|
10465
10473
|
}
|
|
10466
|
-
async function simulateWeb3JsTransaction(_connection, _instructions, _programId, _payer, serializer, commitment = "confirmed", blockhash,
|
|
10474
|
+
async function simulateWeb3JsTransaction(_connection, _instructions, _programId, _payer, serializer, commitment = "confirmed", blockhash, _lookupTableAddresses) {
|
|
10467
10475
|
let connection;
|
|
10468
10476
|
if (typeof _connection === "string") {
|
|
10469
10477
|
connection = new web3.Connection(_connection, commitment);
|
|
@@ -10493,21 +10501,14 @@ async function simulateWeb3JsTransaction(_connection, _instructions, _programId,
|
|
|
10493
10501
|
} else {
|
|
10494
10502
|
payer = toWeb3JsPublicKey(_payer);
|
|
10495
10503
|
}
|
|
10496
|
-
|
|
10497
|
-
if (_lookupTableAddress) {
|
|
10498
|
-
if (_lookupTableAddress instanceof web3.PublicKey) {
|
|
10499
|
-
lookupTableAddress = _lookupTableAddress;
|
|
10500
|
-
} else {
|
|
10501
|
-
lookupTableAddress = toWeb3JsPublicKey(_lookupTableAddress);
|
|
10502
|
-
}
|
|
10503
|
-
}
|
|
10504
|
+
const lookupTableAddresses = _lookupTableAddresses && (Array.isArray(_lookupTableAddresses) ? _lookupTableAddresses.map((addr) => addr instanceof web3.PublicKey ? addr : toWeb3JsPublicKey(addr)) : _lookupTableAddresses instanceof web3.PublicKey ? _lookupTableAddresses : toWeb3JsPublicKey(_lookupTableAddresses));
|
|
10504
10505
|
const tx = await buildVersionedTransaction(
|
|
10505
10506
|
connection,
|
|
10506
10507
|
payer,
|
|
10507
10508
|
instructions,
|
|
10508
10509
|
commitment,
|
|
10509
10510
|
blockhash,
|
|
10510
|
-
|
|
10511
|
+
lookupTableAddresses
|
|
10511
10512
|
);
|
|
10512
10513
|
const simulateResp = await connection.simulateTransaction(tx, { sigVerify: false, commitment });
|
|
10513
10514
|
const returnPrefix = `Program return: ${programId.toBase58()} `;
|