@layerzerolabs/lz-solana-sdk-v2 3.0.47 → 3.0.49
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 +26 -0
- package/package.json +11 -10
- package/src/base-oapp.ts +159 -0
- package/src/config.ts +32 -0
- package/src/deployment.test.ts +11 -0
- package/src/deployment.ts +128 -0
- package/src/dvn.ts +606 -0
- package/src/endpoint.ts +1518 -0
- package/src/executor.ts +577 -0
- package/src/generated/blocked_messagelib/index.ts +18 -0
- package/src/generated/blocked_messagelib/instructions/index.ts +1 -0
- package/src/generated/blocked_messagelib/instructions/version.ts +59 -0
- package/src/generated/dvn/accounts/DvnConfig.ts +217 -0
- package/src/generated/dvn/accounts/ExecuteHash.ts +179 -0
- package/src/generated/dvn/accounts/ReceiveConfig.ts +169 -0
- package/src/generated/dvn/accounts/index.ts +9 -0
- package/src/generated/dvn/errors/index.ts +396 -0
- package/src/generated/dvn/events/AdminConfigSetEvent.ts +22 -0
- package/src/generated/dvn/events/FeeWithdrawnEvent.ts +26 -0
- package/src/generated/dvn/events/MultisigConfigSetEvent.ts +22 -0
- package/src/generated/dvn/events/index.ts +3 -0
- package/src/generated/dvn/index.ts +21 -0
- package/src/generated/dvn/instructions/closeExecute.ts +148 -0
- package/src/generated/dvn/instructions/index.ts +7 -0
- package/src/generated/dvn/instructions/initDvn.ts +144 -0
- package/src/generated/dvn/instructions/invoke.ts +178 -0
- package/src/generated/dvn/instructions/quoteDvn.ts +145 -0
- package/src/generated/dvn/instructions/setConfig.ts +157 -0
- package/src/generated/dvn/instructions/verifiable.ts +160 -0
- package/src/generated/dvn/instructions/withdrawFee.ts +172 -0
- package/src/generated/dvn/types/Acl.ts +26 -0
- package/src/generated/dvn/types/AdminConfig.ts +100 -0
- package/src/generated/dvn/types/CloseExecuteParams.ts +21 -0
- package/src/generated/dvn/types/DstConfig.ts +28 -0
- package/src/generated/dvn/types/ExecuteTransactionDigest.ts +37 -0
- package/src/generated/dvn/types/InitDvnParams.ts +34 -0
- package/src/generated/dvn/types/InvokeParams.ts +28 -0
- package/src/generated/dvn/types/LzOption.ts +24 -0
- package/src/generated/dvn/types/Multisig.ts +24 -0
- package/src/generated/dvn/types/MultisigConfig.ts +124 -0
- package/src/generated/dvn/types/QuoteDvnParams.ts +38 -0
- package/src/generated/dvn/types/SetConfigParams.ts +22 -0
- package/src/generated/dvn/types/TransactionAccount.ts +29 -0
- package/src/generated/dvn/types/UlnConfig.ts +34 -0
- package/src/generated/dvn/types/VerifiableParams.ts +24 -0
- package/src/generated/dvn/types/VerificationState.ts +27 -0
- package/src/generated/dvn/types/WithdrawFeeParams.ts +20 -0
- package/src/generated/dvn/types/index.ts +17 -0
- package/src/generated/endpoint/accounts/ComposeMessageState.ts +170 -0
- package/src/generated/endpoint/accounts/EndpointSettings.ts +184 -0
- package/src/generated/endpoint/accounts/MessageLibInfo.ts +178 -0
- package/src/generated/endpoint/accounts/Nonce.ts +193 -0
- package/src/generated/endpoint/accounts/OAppRegistry.ts +169 -0
- package/src/generated/endpoint/accounts/PayloadHash.ts +169 -0
- package/src/generated/endpoint/accounts/PendingInboundNonce.ts +172 -0
- package/src/generated/endpoint/accounts/ReceiveLibraryConfig.ts +183 -0
- package/src/generated/endpoint/accounts/SendLibraryConfig.ts +171 -0
- package/src/generated/endpoint/accounts/index.ts +31 -0
- package/src/generated/endpoint/errors/index.ts +428 -0
- package/src/generated/endpoint/events/AdminTransferredEvent.ts +23 -0
- package/src/generated/endpoint/events/ComposeDeliveredEvent.ts +31 -0
- package/src/generated/endpoint/events/ComposeSentEvent.ts +33 -0
- package/src/generated/endpoint/events/DefaultReceiveLibrarySetEvent.ts +27 -0
- package/src/generated/endpoint/events/DefaultReceiveLibraryTimeoutSetEvent.ts +29 -0
- package/src/generated/endpoint/events/DefaultSendLibrarySetEvent.ts +27 -0
- package/src/generated/endpoint/events/DelegateSetEvent.ts +22 -0
- package/src/generated/endpoint/events/InboundNonceSkippedEvent.ts +31 -0
- package/src/generated/endpoint/events/LibraryRegisteredEvent.ts +27 -0
- package/src/generated/endpoint/events/LzComposeAlertEvent.ts +43 -0
- package/src/generated/endpoint/events/LzReceiveAlertEvent.ts +45 -0
- package/src/generated/endpoint/events/LzTokenSetEvent.ts +23 -0
- package/src/generated/endpoint/events/OAppRegisteredEvent.ts +27 -0
- package/src/generated/endpoint/events/PacketBurntEvent.ts +32 -0
- package/src/generated/endpoint/events/PacketDeliveredEvent.ts +31 -0
- package/src/generated/endpoint/events/PacketNilifiedEvent.ts +33 -0
- package/src/generated/endpoint/events/PacketSentEvent.ts +29 -0
- package/src/generated/endpoint/events/PacketVerifiedEvent.ts +33 -0
- package/src/generated/endpoint/events/ReceiveLibrarySetEvent.ts +29 -0
- package/src/generated/endpoint/events/ReceiveLibraryTimeoutSetEvent.ts +33 -0
- package/src/generated/endpoint/events/RentWithdrawnEvent.ts +27 -0
- package/src/generated/endpoint/events/SendLibrarySetEvent.ts +29 -0
- package/src/generated/endpoint/events/index.ts +22 -0
- package/src/generated/endpoint/index.ts +21 -0
- package/src/generated/endpoint/instructions/burn.ts +191 -0
- package/src/generated/endpoint/instructions/clear.ts +193 -0
- package/src/generated/endpoint/instructions/clearCompose.ts +160 -0
- package/src/generated/endpoint/instructions/index.ts +32 -0
- package/src/generated/endpoint/instructions/initConfig.ts +172 -0
- package/src/generated/endpoint/instructions/initDefaultReceiveLibrary.ts +195 -0
- package/src/generated/endpoint/instructions/initDefaultSendLibrary.ts +195 -0
- package/src/generated/endpoint/instructions/initEndpoint.ts +147 -0
- package/src/generated/endpoint/instructions/initNonce.ts +168 -0
- package/src/generated/endpoint/instructions/initReceiveLibrary.ts +159 -0
- package/src/generated/endpoint/instructions/initSendLibrary.ts +159 -0
- package/src/generated/endpoint/instructions/initVerify.ts +159 -0
- package/src/generated/endpoint/instructions/lzComposeAlert.ts +148 -0
- package/src/generated/endpoint/instructions/lzReceiveAlert.ts +148 -0
- package/src/generated/endpoint/instructions/nilify.ts +193 -0
- package/src/generated/endpoint/instructions/quote.ts +181 -0
- package/src/generated/endpoint/instructions/registerLibrary.ts +183 -0
- package/src/generated/endpoint/instructions/registerOapp.ts +183 -0
- package/src/generated/endpoint/instructions/send.ts +215 -0
- package/src/generated/endpoint/instructions/sendCompose.ts +183 -0
- package/src/generated/endpoint/instructions/setConfig.ts +169 -0
- package/src/generated/endpoint/instructions/setDefaultReceiveLibrary.ts +184 -0
- package/src/generated/endpoint/instructions/setDefaultReceiveLibraryTimeout.ts +185 -0
- package/src/generated/endpoint/instructions/setDefaultSendLibrary.ts +184 -0
- package/src/generated/endpoint/instructions/setDelegate.ts +160 -0
- package/src/generated/endpoint/instructions/setLzToken.ts +160 -0
- package/src/generated/endpoint/instructions/setReceiveLibrary.ts +190 -0
- package/src/generated/endpoint/instructions/setReceiveLibraryTimeout.ts +184 -0
- package/src/generated/endpoint/instructions/setSendLibrary.ts +190 -0
- package/src/generated/endpoint/instructions/skip.ts +203 -0
- package/src/generated/endpoint/instructions/transferAdmin.ts +160 -0
- package/src/generated/endpoint/instructions/verify.ts +205 -0
- package/src/generated/endpoint/instructions/withdrawRent.ts +172 -0
- package/src/generated/endpoint/types/BurnParams.ts +32 -0
- package/src/generated/endpoint/types/ClearComposeParams.ts +31 -0
- package/src/generated/endpoint/types/ClearParams.ts +34 -0
- package/src/generated/endpoint/types/InitConfigParams.ts +26 -0
- package/src/generated/endpoint/types/InitDefaultReceiveLibraryParams.ts +27 -0
- package/src/generated/endpoint/types/InitDefaultSendLibraryParams.ts +27 -0
- package/src/generated/endpoint/types/InitEndpointParams.ts +27 -0
- package/src/generated/endpoint/types/InitNonceParams.ts +28 -0
- package/src/generated/endpoint/types/InitReceiveLibraryParams.ts +27 -0
- package/src/generated/endpoint/types/InitSendLibraryParams.ts +27 -0
- package/src/generated/endpoint/types/InitVerifyParams.ts +30 -0
- package/src/generated/endpoint/types/LzComposeAlertParams.ts +41 -0
- package/src/generated/endpoint/types/LzReceiveAlertParams.ts +43 -0
- package/src/generated/endpoint/types/MessageLibType.ts +25 -0
- package/src/generated/endpoint/types/MessagingFee.ts +24 -0
- package/src/generated/endpoint/types/MessagingReceipt.ts +27 -0
- package/src/generated/endpoint/types/NilifyParams.ts +32 -0
- package/src/generated/endpoint/types/QuoteParams.ts +34 -0
- package/src/generated/endpoint/types/ReceiveLibraryTimeout.ts +27 -0
- package/src/generated/endpoint/types/RegisterLibraryParams.ts +28 -0
- package/src/generated/endpoint/types/RegisterOAppParams.ts +23 -0
- package/src/generated/endpoint/types/SendComposeParams.ts +31 -0
- package/src/generated/endpoint/types/SendParams.ts +32 -0
- package/src/generated/endpoint/types/SetConfigParams.ts +31 -0
- package/src/generated/endpoint/types/SetDefaultReceiveLibraryParams.ts +29 -0
- package/src/generated/endpoint/types/SetDefaultReceiveLibraryTimeoutParams.ts +29 -0
- package/src/generated/endpoint/types/SetDefaultSendLibraryParams.ts +27 -0
- package/src/generated/endpoint/types/SetDelegateParams.ts +22 -0
- package/src/generated/endpoint/types/SetLzTokenParams.ts +23 -0
- package/src/generated/endpoint/types/SetReceiveLibraryParams.ts +31 -0
- package/src/generated/endpoint/types/SetReceiveLibraryTimeoutParams.ts +31 -0
- package/src/generated/endpoint/types/SetSendLibraryParams.ts +29 -0
- package/src/generated/endpoint/types/SkipParams.ts +30 -0
- package/src/generated/endpoint/types/TransferAdminParams.ts +23 -0
- package/src/generated/endpoint/types/VerifyParams.ts +32 -0
- package/src/generated/endpoint/types/WithdrawRentParams.ts +21 -0
- package/src/generated/endpoint/types/index.ts +36 -0
- package/src/generated/executor/accounts/ExecutorConfig.ts +216 -0
- package/src/generated/executor/accounts/Nonce.ts +193 -0
- package/src/generated/executor/accounts/index.ts +7 -0
- package/src/generated/executor/errors/index.ts +434 -0
- package/src/generated/executor/events/NativeDropAppliedEvent.ts +38 -0
- package/src/generated/executor/events/index.ts +1 -0
- package/src/generated/executor/index.ts +21 -0
- package/src/generated/executor/instructions/adminSetConfig.ts +136 -0
- package/src/generated/executor/instructions/compose.ts +181 -0
- package/src/generated/executor/instructions/executable.ts +136 -0
- package/src/generated/executor/instructions/execute.ts +181 -0
- package/src/generated/executor/instructions/index.ts +8 -0
- package/src/generated/executor/instructions/initExecutor.ts +147 -0
- package/src/generated/executor/instructions/nativeDrop.ts +171 -0
- package/src/generated/executor/instructions/ownerSetConfig.ts +136 -0
- package/src/generated/executor/instructions/quoteExecutor.ts +148 -0
- package/src/generated/executor/types/Acl.ts +26 -0
- package/src/generated/executor/types/AdminSetConfigParams.ts +83 -0
- package/src/generated/executor/types/ComposeParams.ts +27 -0
- package/src/generated/executor/types/DstConfig.ts +32 -0
- package/src/generated/executor/types/ExecutableParams.ts +30 -0
- package/src/generated/executor/types/ExecuteParams.ts +31 -0
- package/src/generated/executor/types/ExecutionState.ts +26 -0
- package/src/generated/executor/types/InitExecutorParams.ts +33 -0
- package/src/generated/executor/types/LzComposeParams.ts +35 -0
- package/src/generated/executor/types/LzOption.ts +24 -0
- package/src/generated/executor/types/LzReceiveParams.ts +33 -0
- package/src/generated/executor/types/NativeDropParams.ts +36 -0
- package/src/generated/executor/types/NativeDropRequest.ts +26 -0
- package/src/generated/executor/types/OwnerSetConfigParams.ts +123 -0
- package/src/generated/executor/types/QuoteExecutorParams.ts +34 -0
- package/src/generated/executor/types/index.ts +15 -0
- package/src/generated/pricefeed/accounts/PriceFeed.ts +220 -0
- package/src/generated/pricefeed/accounts/index.ts +5 -0
- package/src/generated/pricefeed/errors/index.ts +115 -0
- package/src/generated/pricefeed/index.ts +21 -0
- package/src/generated/pricefeed/instructions/getFee.ts +121 -0
- package/src/generated/pricefeed/instructions/index.ts +6 -0
- package/src/generated/pricefeed/instructions/initPriceFeed.ts +147 -0
- package/src/generated/pricefeed/instructions/setPrice.ts +133 -0
- package/src/generated/pricefeed/instructions/setPriceFeed.ts +136 -0
- package/src/generated/pricefeed/instructions/setSolPrice.ts +136 -0
- package/src/generated/pricefeed/instructions/transferAdmin.ts +136 -0
- package/src/generated/pricefeed/types/GetFeeParams.ts +26 -0
- package/src/generated/pricefeed/types/InitPriceFeedParams.ts +27 -0
- package/src/generated/pricefeed/types/ModelType.ts +66 -0
- package/src/generated/pricefeed/types/Price.ts +31 -0
- package/src/generated/pricefeed/types/PriceParams.ts +29 -0
- package/src/generated/pricefeed/types/SetPriceFeedParams.ts +29 -0
- package/src/generated/pricefeed/types/SetPriceParams.ts +26 -0
- package/src/generated/pricefeed/types/SetSolPriceParams.ts +21 -0
- package/src/generated/pricefeed/types/TransferAdminParams.ts +23 -0
- package/src/generated/pricefeed/types/index.ts +9 -0
- package/src/generated/simple_messagelib/accounts/MessageLib.ts +222 -0
- package/src/generated/simple_messagelib/accounts/ReceiveConfigStore.ts +168 -0
- package/src/generated/simple_messagelib/accounts/SendConfigStore.ts +170 -0
- package/src/generated/simple_messagelib/accounts/index.ts +13 -0
- package/src/generated/simple_messagelib/errors/index.ts +207 -0
- package/src/generated/simple_messagelib/index.ts +21 -0
- package/src/generated/simple_messagelib/instructions/index.ts +15 -0
- package/src/generated/simple_messagelib/instructions/initConfig.ts +183 -0
- package/src/generated/simple_messagelib/instructions/initDefaultConfig.ts +171 -0
- package/src/generated/simple_messagelib/instructions/initMessageLib.ts +147 -0
- package/src/generated/simple_messagelib/instructions/quote.ts +133 -0
- package/src/generated/simple_messagelib/instructions/revertCall.ts +59 -0
- package/src/generated/simple_messagelib/instructions/send.ts +154 -0
- package/src/generated/simple_messagelib/instructions/sendWithLzToken.ts +207 -0
- package/src/generated/simple_messagelib/instructions/setConfig.ts +157 -0
- package/src/generated/simple_messagelib/instructions/setDefaultConfig.ts +171 -0
- package/src/generated/simple_messagelib/instructions/setFee.ts +133 -0
- package/src/generated/simple_messagelib/instructions/setWlCaller.ts +136 -0
- package/src/generated/simple_messagelib/instructions/transferAdmin.ts +136 -0
- package/src/generated/simple_messagelib/instructions/validatePacket.ts +136 -0
- package/src/generated/simple_messagelib/instructions/version.ts +59 -0
- package/src/generated/simple_messagelib/instructions/withdrawFees.ts +148 -0
- package/src/generated/simple_messagelib/types/InitConfigParams.ts +26 -0
- package/src/generated/simple_messagelib/types/InitDefaultConfigParams.ts +27 -0
- package/src/generated/simple_messagelib/types/InitMessageLibParams.ts +35 -0
- package/src/generated/simple_messagelib/types/MessagingFee.ts +24 -0
- package/src/generated/simple_messagelib/types/Packet.ts +36 -0
- package/src/generated/simple_messagelib/types/QuoteParams.ts +27 -0
- package/src/generated/simple_messagelib/types/SendParams.ts +27 -0
- package/src/generated/simple_messagelib/types/SendWithLzTokenParams.ts +34 -0
- package/src/generated/simple_messagelib/types/SetConfigParams.ts +31 -0
- package/src/generated/simple_messagelib/types/SetDefaultConfigParams.ts +27 -0
- package/src/generated/simple_messagelib/types/SetFeeParams.ts +24 -0
- package/src/generated/simple_messagelib/types/SetWlCallerParams.ts +22 -0
- package/src/generated/simple_messagelib/types/TransferAdminParams.ts +23 -0
- package/src/generated/simple_messagelib/types/ValidatePacketParams.ts +21 -0
- package/src/generated/simple_messagelib/types/Version.ts +26 -0
- package/src/generated/simple_messagelib/types/WithdrawFeesParams.ts +21 -0
- package/src/generated/simple_messagelib/types/index.ts +16 -0
- package/src/generated/uln/accounts/Confirmations.ts +171 -0
- package/src/generated/uln/accounts/ReceiveConfig.ts +169 -0
- package/src/generated/uln/accounts/SendConfig.ts +177 -0
- package/src/generated/uln/accounts/UlnSettings.ts +195 -0
- package/src/generated/uln/accounts/index.ts +16 -0
- package/src/generated/uln/errors/index.ts +761 -0
- package/src/generated/uln/events/AdminTransferredEvent.ts +23 -0
- package/src/generated/uln/events/ConfigSetEvent.ts +30 -0
- package/src/generated/uln/events/DefaultConfigSetEvent.ts +31 -0
- package/src/generated/uln/events/FeesPaidEvent.ts +28 -0
- package/src/generated/uln/events/LzTokenSetEvent.ts +23 -0
- package/src/generated/uln/events/PayloadVerifiedEvent.ts +31 -0
- package/src/generated/uln/events/RentWithdrawnEvent.ts +27 -0
- package/src/generated/uln/events/TreasuryFeeCapSetEvent.ts +21 -0
- package/src/generated/uln/events/TreasurySetEvent.ts +22 -0
- package/src/generated/uln/events/index.ts +7 -0
- package/src/generated/uln/index.ts +21 -0
- package/src/generated/uln/instructions/closeVerify.ts +148 -0
- package/src/generated/uln/instructions/commitVerification.ts +148 -0
- package/src/generated/uln/instructions/index.ts +16 -0
- package/src/generated/uln/instructions/initConfig.ts +183 -0
- package/src/generated/uln/instructions/initDefaultConfig.ts +195 -0
- package/src/generated/uln/instructions/initUln.ts +144 -0
- package/src/generated/uln/instructions/initVerify.ts +147 -0
- package/src/generated/uln/instructions/quote.ts +157 -0
- package/src/generated/uln/instructions/send.ts +220 -0
- package/src/generated/uln/instructions/sendWithLzToken.ts +255 -0
- package/src/generated/uln/instructions/setConfig.ts +205 -0
- package/src/generated/uln/instructions/setDefaultConfig.ts +184 -0
- package/src/generated/uln/instructions/setTreasury.ts +160 -0
- package/src/generated/uln/instructions/transferAdmin.ts +160 -0
- package/src/generated/uln/instructions/verify.ts +157 -0
- package/src/generated/uln/instructions/version.ts +59 -0
- package/src/generated/uln/instructions/withdrawRent.ts +172 -0
- package/src/generated/uln/types/CloseVerifyParams.ts +24 -0
- package/src/generated/uln/types/CommitVerificationParams.ts +25 -0
- package/src/generated/uln/types/Config.ts +75 -0
- package/src/generated/uln/types/ExecutorConfig.ts +26 -0
- package/src/generated/uln/types/InitConfigParams.ts +26 -0
- package/src/generated/uln/types/InitDefaultConfigParams.ts +31 -0
- package/src/generated/uln/types/InitUlnParams.ts +30 -0
- package/src/generated/uln/types/InitVerifyParams.ts +28 -0
- package/src/generated/uln/types/LzTokenTreasury.ts +26 -0
- package/src/generated/uln/types/MessagingFee.ts +24 -0
- package/src/generated/uln/types/Packet.ts +36 -0
- package/src/generated/uln/types/QuoteParams.ts +27 -0
- package/src/generated/uln/types/SendParams.ts +27 -0
- package/src/generated/uln/types/SendWithLzTokenParams.ts +34 -0
- package/src/generated/uln/types/SetConfigParams.ts +31 -0
- package/src/generated/uln/types/SetDefaultConfigParams.ts +31 -0
- package/src/generated/uln/types/SetTreasuryParams.ts +22 -0
- package/src/generated/uln/types/TransferAdminParams.ts +23 -0
- package/src/generated/uln/types/Treasury.ts +31 -0
- package/src/generated/uln/types/TreasuryFee.ts +28 -0
- package/src/generated/uln/types/UlnConfig.ts +34 -0
- package/src/generated/uln/types/VerifyParams.ts +26 -0
- package/src/generated/uln/types/Version.ts +26 -0
- package/src/generated/uln/types/WithdrawRentParams.ts +21 -0
- package/src/generated/uln/types/WorkerFee.ts +26 -0
- package/src/generated/uln/types/index.ts +25 -0
- package/src/generated/worker_interface/errors/index.ts +75 -0
- package/src/generated/worker_interface/index.ts +20 -0
- package/src/generated/worker_interface/instructions/index.ts +2 -0
- package/src/generated/worker_interface/instructions/quoteDvn.ts +145 -0
- package/src/generated/worker_interface/instructions/quoteExecutor.ts +148 -0
- package/src/generated/worker_interface/types/LzOption.ts +24 -0
- package/src/generated/worker_interface/types/QuoteDvnParams.ts +38 -0
- package/src/generated/worker_interface/types/QuoteExecutorParams.ts +34 -0
- package/src/generated/worker_interface/types/index.ts +3 -0
- package/src/index.ts +120 -0
- package/src/pda-deriver.ts +658 -0
- package/src/pricefeed.ts +208 -0
- package/src/recevie.ts +269 -0
- package/src/send-helper.ts +504 -0
- package/src/simple-message-lib.ts +303 -0
- package/src/types.ts +222 -0
- package/src/uln.ts +1045 -0
- package/src/utility.ts +592 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet'
|
|
9
|
+
import * as web3 from '@solana/web3.js'
|
|
10
|
+
import {
|
|
11
|
+
InitMessageLibParams,
|
|
12
|
+
initMessageLibParamsBeet,
|
|
13
|
+
} from '../types/InitMessageLibParams'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @category Instructions
|
|
17
|
+
* @category InitMessageLib
|
|
18
|
+
* @category generated
|
|
19
|
+
*/
|
|
20
|
+
export type InitMessageLibInstructionArgs = {
|
|
21
|
+
params: InitMessageLibParams
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @category Instructions
|
|
25
|
+
* @category InitMessageLib
|
|
26
|
+
* @category generated
|
|
27
|
+
*/
|
|
28
|
+
export const initMessageLibStruct = new beet.BeetArgsStruct<
|
|
29
|
+
InitMessageLibInstructionArgs & {
|
|
30
|
+
instructionDiscriminator: number[] /* size: 8 */
|
|
31
|
+
}
|
|
32
|
+
>(
|
|
33
|
+
[
|
|
34
|
+
['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
35
|
+
['params', initMessageLibParamsBeet],
|
|
36
|
+
],
|
|
37
|
+
'InitMessageLibInstructionArgs'
|
|
38
|
+
)
|
|
39
|
+
/**
|
|
40
|
+
* Accounts required by the _initMessageLib_ instruction
|
|
41
|
+
*
|
|
42
|
+
* @property [_writable_, **signer**] payer
|
|
43
|
+
* @property [_writable_] messageLib
|
|
44
|
+
* @category Instructions
|
|
45
|
+
* @category InitMessageLib
|
|
46
|
+
* @category generated
|
|
47
|
+
*/
|
|
48
|
+
export type InitMessageLibInstructionAccounts = {
|
|
49
|
+
payer: web3.PublicKey
|
|
50
|
+
messageLib: web3.PublicKey
|
|
51
|
+
systemProgram?: web3.PublicKey
|
|
52
|
+
anchorRemainingAccounts?: web3.AccountMeta[]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const initMessageLibInstructionDiscriminator = [
|
|
56
|
+
184, 93, 59, 206, 98, 238, 225, 54,
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Creates a _InitMessageLib_ instruction.
|
|
61
|
+
*
|
|
62
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
63
|
+
* @param args to provide as instruction data to the program
|
|
64
|
+
*
|
|
65
|
+
* @category Instructions
|
|
66
|
+
* @category InitMessageLib
|
|
67
|
+
* @category generated
|
|
68
|
+
*/
|
|
69
|
+
export function createInitMessageLibInstruction(
|
|
70
|
+
accounts: InitMessageLibInstructionAccounts,
|
|
71
|
+
args: InitMessageLibInstructionArgs,
|
|
72
|
+
programId: web3.PublicKey
|
|
73
|
+
) {
|
|
74
|
+
const [data] = initMessageLibStruct.serialize({
|
|
75
|
+
instructionDiscriminator: initMessageLibInstructionDiscriminator,
|
|
76
|
+
...args,
|
|
77
|
+
})
|
|
78
|
+
const keys: web3.AccountMeta[] = [
|
|
79
|
+
{
|
|
80
|
+
pubkey: accounts.payer,
|
|
81
|
+
isWritable: true,
|
|
82
|
+
isSigner: true,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
pubkey: accounts.messageLib,
|
|
86
|
+
isWritable: true,
|
|
87
|
+
isSigner: false,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
pubkey: accounts.systemProgram ?? web3.SystemProgram.programId,
|
|
91
|
+
isWritable: false,
|
|
92
|
+
isSigner: false,
|
|
93
|
+
},
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
97
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
98
|
+
keys.push(acc)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const ix = new web3.TransactionInstruction({
|
|
103
|
+
programId,
|
|
104
|
+
keys,
|
|
105
|
+
data,
|
|
106
|
+
})
|
|
107
|
+
return ix
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Creates a _InitMessageLib_ instructionAccounts.
|
|
112
|
+
*
|
|
113
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
114
|
+
* @category Instructions
|
|
115
|
+
* @category InitMessageLib
|
|
116
|
+
* @category generated
|
|
117
|
+
*/
|
|
118
|
+
export function createInitMessageLibInstructionAccounts(
|
|
119
|
+
accounts: InitMessageLibInstructionAccounts,
|
|
120
|
+
programId: web3.PublicKey
|
|
121
|
+
) {
|
|
122
|
+
const keys: web3.AccountMeta[] = [
|
|
123
|
+
{
|
|
124
|
+
pubkey: accounts.payer,
|
|
125
|
+
isWritable: true,
|
|
126
|
+
isSigner: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
pubkey: accounts.messageLib,
|
|
130
|
+
isWritable: true,
|
|
131
|
+
isSigner: false,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
pubkey: accounts.systemProgram ?? web3.SystemProgram.programId,
|
|
135
|
+
isWritable: false,
|
|
136
|
+
isSigner: false,
|
|
137
|
+
},
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
141
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
142
|
+
keys.push(acc)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return keys
|
|
147
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet'
|
|
9
|
+
import * as web3 from '@solana/web3.js'
|
|
10
|
+
import { QuoteParams, quoteParamsBeet } from '../types/QuoteParams'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @category Instructions
|
|
14
|
+
* @category Quote
|
|
15
|
+
* @category generated
|
|
16
|
+
*/
|
|
17
|
+
export type QuoteInstructionArgs = {
|
|
18
|
+
params: QuoteParams
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @category Instructions
|
|
22
|
+
* @category Quote
|
|
23
|
+
* @category generated
|
|
24
|
+
*/
|
|
25
|
+
export const quoteStruct = new beet.FixableBeetArgsStruct<
|
|
26
|
+
QuoteInstructionArgs & {
|
|
27
|
+
instructionDiscriminator: number[] /* size: 8 */
|
|
28
|
+
}
|
|
29
|
+
>(
|
|
30
|
+
[
|
|
31
|
+
['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
32
|
+
['params', quoteParamsBeet],
|
|
33
|
+
],
|
|
34
|
+
'QuoteInstructionArgs'
|
|
35
|
+
)
|
|
36
|
+
/**
|
|
37
|
+
* Accounts required by the _quote_ instruction
|
|
38
|
+
*
|
|
39
|
+
* @property [**signer**] endpoint
|
|
40
|
+
* @property [] messageLib
|
|
41
|
+
* @category Instructions
|
|
42
|
+
* @category Quote
|
|
43
|
+
* @category generated
|
|
44
|
+
*/
|
|
45
|
+
export type QuoteInstructionAccounts = {
|
|
46
|
+
endpoint: web3.PublicKey
|
|
47
|
+
messageLib: web3.PublicKey
|
|
48
|
+
anchorRemainingAccounts?: web3.AccountMeta[]
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const quoteInstructionDiscriminator = [
|
|
52
|
+
149, 42, 109, 247, 134, 146, 213, 123,
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Creates a _Quote_ instruction.
|
|
57
|
+
*
|
|
58
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
59
|
+
* @param args to provide as instruction data to the program
|
|
60
|
+
*
|
|
61
|
+
* @category Instructions
|
|
62
|
+
* @category Quote
|
|
63
|
+
* @category generated
|
|
64
|
+
*/
|
|
65
|
+
export function createQuoteInstruction(
|
|
66
|
+
accounts: QuoteInstructionAccounts,
|
|
67
|
+
args: QuoteInstructionArgs,
|
|
68
|
+
programId: web3.PublicKey
|
|
69
|
+
) {
|
|
70
|
+
const [data] = quoteStruct.serialize({
|
|
71
|
+
instructionDiscriminator: quoteInstructionDiscriminator,
|
|
72
|
+
...args,
|
|
73
|
+
})
|
|
74
|
+
const keys: web3.AccountMeta[] = [
|
|
75
|
+
{
|
|
76
|
+
pubkey: accounts.endpoint,
|
|
77
|
+
isWritable: false,
|
|
78
|
+
isSigner: true,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
pubkey: accounts.messageLib,
|
|
82
|
+
isWritable: false,
|
|
83
|
+
isSigner: false,
|
|
84
|
+
},
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
88
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
89
|
+
keys.push(acc)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const ix = new web3.TransactionInstruction({
|
|
94
|
+
programId,
|
|
95
|
+
keys,
|
|
96
|
+
data,
|
|
97
|
+
})
|
|
98
|
+
return ix
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Creates a _Quote_ instructionAccounts.
|
|
103
|
+
*
|
|
104
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
105
|
+
* @category Instructions
|
|
106
|
+
* @category Quote
|
|
107
|
+
* @category generated
|
|
108
|
+
*/
|
|
109
|
+
export function createQuoteInstructionAccounts(
|
|
110
|
+
accounts: QuoteInstructionAccounts,
|
|
111
|
+
programId: web3.PublicKey
|
|
112
|
+
) {
|
|
113
|
+
const keys: web3.AccountMeta[] = [
|
|
114
|
+
{
|
|
115
|
+
pubkey: accounts.endpoint,
|
|
116
|
+
isWritable: false,
|
|
117
|
+
isSigner: true,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
pubkey: accounts.messageLib,
|
|
121
|
+
isWritable: false,
|
|
122
|
+
isSigner: false,
|
|
123
|
+
},
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
127
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
128
|
+
keys.push(acc)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return keys
|
|
133
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet'
|
|
9
|
+
import * as web3 from '@solana/web3.js'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @category Instructions
|
|
13
|
+
* @category RevertCall
|
|
14
|
+
* @category generated
|
|
15
|
+
*/
|
|
16
|
+
export const revertCallStruct = new beet.BeetArgsStruct<{
|
|
17
|
+
instructionDiscriminator: number[] /* size: 8 */
|
|
18
|
+
}>(
|
|
19
|
+
[['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]],
|
|
20
|
+
'RevertCallInstructionArgs'
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
export const revertCallInstructionDiscriminator = [
|
|
24
|
+
124, 243, 145, 116, 106, 203, 93, 114,
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates a _RevertCall_ instruction.
|
|
29
|
+
*
|
|
30
|
+
* @category Instructions
|
|
31
|
+
* @category RevertCall
|
|
32
|
+
* @category generated
|
|
33
|
+
*/
|
|
34
|
+
export function createRevertCallInstruction(programId: web3.PublicKey) {
|
|
35
|
+
const [data] = revertCallStruct.serialize({
|
|
36
|
+
instructionDiscriminator: revertCallInstructionDiscriminator,
|
|
37
|
+
})
|
|
38
|
+
const keys: web3.AccountMeta[] = []
|
|
39
|
+
|
|
40
|
+
const ix = new web3.TransactionInstruction({
|
|
41
|
+
programId,
|
|
42
|
+
keys,
|
|
43
|
+
data,
|
|
44
|
+
})
|
|
45
|
+
return ix
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Creates a _RevertCall_ instructionAccounts.
|
|
50
|
+
*
|
|
51
|
+
* @category Instructions
|
|
52
|
+
* @category RevertCall
|
|
53
|
+
* @category generated
|
|
54
|
+
*/
|
|
55
|
+
export function createRevertCallInstructionAccounts(programId: web3.PublicKey) {
|
|
56
|
+
const keys: web3.AccountMeta[] = []
|
|
57
|
+
|
|
58
|
+
return keys
|
|
59
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet'
|
|
9
|
+
import * as web3 from '@solana/web3.js'
|
|
10
|
+
import { SendParams, sendParamsBeet } from '../types/SendParams'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @category Instructions
|
|
14
|
+
* @category Send
|
|
15
|
+
* @category generated
|
|
16
|
+
*/
|
|
17
|
+
export type SendInstructionArgs = {
|
|
18
|
+
params: SendParams
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @category Instructions
|
|
22
|
+
* @category Send
|
|
23
|
+
* @category generated
|
|
24
|
+
*/
|
|
25
|
+
export const sendStruct = new beet.FixableBeetArgsStruct<
|
|
26
|
+
SendInstructionArgs & {
|
|
27
|
+
instructionDiscriminator: number[] /* size: 8 */
|
|
28
|
+
}
|
|
29
|
+
>(
|
|
30
|
+
[
|
|
31
|
+
['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
32
|
+
['params', sendParamsBeet],
|
|
33
|
+
],
|
|
34
|
+
'SendInstructionArgs'
|
|
35
|
+
)
|
|
36
|
+
/**
|
|
37
|
+
* Accounts required by the _send_ instruction
|
|
38
|
+
*
|
|
39
|
+
* @property [**signer**] endpoint
|
|
40
|
+
* @property [_writable_] messageLib
|
|
41
|
+
* @property [_writable_, **signer**] payer
|
|
42
|
+
* @category Instructions
|
|
43
|
+
* @category Send
|
|
44
|
+
* @category generated
|
|
45
|
+
*/
|
|
46
|
+
export type SendInstructionAccounts = {
|
|
47
|
+
endpoint: web3.PublicKey
|
|
48
|
+
messageLib: web3.PublicKey
|
|
49
|
+
payer: web3.PublicKey
|
|
50
|
+
systemProgram?: web3.PublicKey
|
|
51
|
+
anchorRemainingAccounts?: web3.AccountMeta[]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const sendInstructionDiscriminator = [102, 251, 20, 187, 65, 75, 12, 69]
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Creates a _Send_ instruction.
|
|
58
|
+
*
|
|
59
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
60
|
+
* @param args to provide as instruction data to the program
|
|
61
|
+
*
|
|
62
|
+
* @category Instructions
|
|
63
|
+
* @category Send
|
|
64
|
+
* @category generated
|
|
65
|
+
*/
|
|
66
|
+
export function createSendInstruction(
|
|
67
|
+
accounts: SendInstructionAccounts,
|
|
68
|
+
args: SendInstructionArgs,
|
|
69
|
+
programId: web3.PublicKey
|
|
70
|
+
) {
|
|
71
|
+
const [data] = sendStruct.serialize({
|
|
72
|
+
instructionDiscriminator: sendInstructionDiscriminator,
|
|
73
|
+
...args,
|
|
74
|
+
})
|
|
75
|
+
const keys: web3.AccountMeta[] = [
|
|
76
|
+
{
|
|
77
|
+
pubkey: accounts.endpoint,
|
|
78
|
+
isWritable: false,
|
|
79
|
+
isSigner: true,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
pubkey: accounts.messageLib,
|
|
83
|
+
isWritable: true,
|
|
84
|
+
isSigner: false,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
pubkey: accounts.payer,
|
|
88
|
+
isWritable: true,
|
|
89
|
+
isSigner: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
pubkey: accounts.systemProgram ?? web3.SystemProgram.programId,
|
|
93
|
+
isWritable: false,
|
|
94
|
+
isSigner: false,
|
|
95
|
+
},
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
99
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
100
|
+
keys.push(acc)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const ix = new web3.TransactionInstruction({
|
|
105
|
+
programId,
|
|
106
|
+
keys,
|
|
107
|
+
data,
|
|
108
|
+
})
|
|
109
|
+
return ix
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Creates a _Send_ instructionAccounts.
|
|
114
|
+
*
|
|
115
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
116
|
+
* @category Instructions
|
|
117
|
+
* @category Send
|
|
118
|
+
* @category generated
|
|
119
|
+
*/
|
|
120
|
+
export function createSendInstructionAccounts(
|
|
121
|
+
accounts: SendInstructionAccounts,
|
|
122
|
+
programId: web3.PublicKey
|
|
123
|
+
) {
|
|
124
|
+
const keys: web3.AccountMeta[] = [
|
|
125
|
+
{
|
|
126
|
+
pubkey: accounts.endpoint,
|
|
127
|
+
isWritable: false,
|
|
128
|
+
isSigner: true,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
pubkey: accounts.messageLib,
|
|
132
|
+
isWritable: true,
|
|
133
|
+
isSigner: false,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
pubkey: accounts.payer,
|
|
137
|
+
isWritable: true,
|
|
138
|
+
isSigner: true,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
pubkey: accounts.systemProgram ?? web3.SystemProgram.programId,
|
|
142
|
+
isWritable: false,
|
|
143
|
+
isSigner: false,
|
|
144
|
+
},
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
148
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
149
|
+
keys.push(acc)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return keys
|
|
154
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as splToken from '@solana/spl-token'
|
|
9
|
+
import * as beet from '@metaplex-foundation/beet'
|
|
10
|
+
import * as web3 from '@solana/web3.js'
|
|
11
|
+
import {
|
|
12
|
+
SendWithLzTokenParams,
|
|
13
|
+
sendWithLzTokenParamsBeet,
|
|
14
|
+
} from '../types/SendWithLzTokenParams'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @category Instructions
|
|
18
|
+
* @category SendWithLzToken
|
|
19
|
+
* @category generated
|
|
20
|
+
*/
|
|
21
|
+
export type SendWithLzTokenInstructionArgs = {
|
|
22
|
+
params: SendWithLzTokenParams
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @category Instructions
|
|
26
|
+
* @category SendWithLzToken
|
|
27
|
+
* @category generated
|
|
28
|
+
*/
|
|
29
|
+
export const sendWithLzTokenStruct = new beet.FixableBeetArgsStruct<
|
|
30
|
+
SendWithLzTokenInstructionArgs & {
|
|
31
|
+
instructionDiscriminator: number[] /* size: 8 */
|
|
32
|
+
}
|
|
33
|
+
>(
|
|
34
|
+
[
|
|
35
|
+
['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
36
|
+
['params', sendWithLzTokenParamsBeet],
|
|
37
|
+
],
|
|
38
|
+
'SendWithLzTokenInstructionArgs'
|
|
39
|
+
)
|
|
40
|
+
/**
|
|
41
|
+
* Accounts required by the _sendWithLzToken_ instruction
|
|
42
|
+
*
|
|
43
|
+
* @property [**signer**] endpoint
|
|
44
|
+
* @property [_writable_] messageLib
|
|
45
|
+
* @property [_writable_] messageLibLzToken
|
|
46
|
+
* @property [_writable_, **signer**] payer
|
|
47
|
+
* @property [_writable_] lzTokenSource
|
|
48
|
+
* @property [] lzTokenMint
|
|
49
|
+
* @category Instructions
|
|
50
|
+
* @category SendWithLzToken
|
|
51
|
+
* @category generated
|
|
52
|
+
*/
|
|
53
|
+
export type SendWithLzTokenInstructionAccounts = {
|
|
54
|
+
endpoint: web3.PublicKey
|
|
55
|
+
messageLib: web3.PublicKey
|
|
56
|
+
messageLibLzToken: web3.PublicKey
|
|
57
|
+
payer: web3.PublicKey
|
|
58
|
+
lzTokenSource: web3.PublicKey
|
|
59
|
+
lzTokenMint: web3.PublicKey
|
|
60
|
+
tokenProgram?: web3.PublicKey
|
|
61
|
+
systemProgram?: web3.PublicKey
|
|
62
|
+
anchorRemainingAccounts?: web3.AccountMeta[]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const sendWithLzTokenInstructionDiscriminator = [
|
|
66
|
+
165, 161, 84, 48, 129, 26, 193, 19,
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Creates a _SendWithLzToken_ instruction.
|
|
71
|
+
*
|
|
72
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
73
|
+
* @param args to provide as instruction data to the program
|
|
74
|
+
*
|
|
75
|
+
* @category Instructions
|
|
76
|
+
* @category SendWithLzToken
|
|
77
|
+
* @category generated
|
|
78
|
+
*/
|
|
79
|
+
export function createSendWithLzTokenInstruction(
|
|
80
|
+
accounts: SendWithLzTokenInstructionAccounts,
|
|
81
|
+
args: SendWithLzTokenInstructionArgs,
|
|
82
|
+
programId: web3.PublicKey
|
|
83
|
+
) {
|
|
84
|
+
const [data] = sendWithLzTokenStruct.serialize({
|
|
85
|
+
instructionDiscriminator: sendWithLzTokenInstructionDiscriminator,
|
|
86
|
+
...args,
|
|
87
|
+
})
|
|
88
|
+
const keys: web3.AccountMeta[] = [
|
|
89
|
+
{
|
|
90
|
+
pubkey: accounts.endpoint,
|
|
91
|
+
isWritable: false,
|
|
92
|
+
isSigner: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
pubkey: accounts.messageLib,
|
|
96
|
+
isWritable: true,
|
|
97
|
+
isSigner: false,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
pubkey: accounts.messageLibLzToken,
|
|
101
|
+
isWritable: true,
|
|
102
|
+
isSigner: false,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
pubkey: accounts.payer,
|
|
106
|
+
isWritable: true,
|
|
107
|
+
isSigner: true,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
pubkey: accounts.lzTokenSource,
|
|
111
|
+
isWritable: true,
|
|
112
|
+
isSigner: false,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
pubkey: accounts.lzTokenMint,
|
|
116
|
+
isWritable: false,
|
|
117
|
+
isSigner: false,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
pubkey: accounts.tokenProgram ?? splToken.TOKEN_PROGRAM_ID,
|
|
121
|
+
isWritable: false,
|
|
122
|
+
isSigner: false,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
pubkey: accounts.systemProgram ?? web3.SystemProgram.programId,
|
|
126
|
+
isWritable: false,
|
|
127
|
+
isSigner: false,
|
|
128
|
+
},
|
|
129
|
+
]
|
|
130
|
+
|
|
131
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
132
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
133
|
+
keys.push(acc)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const ix = new web3.TransactionInstruction({
|
|
138
|
+
programId,
|
|
139
|
+
keys,
|
|
140
|
+
data,
|
|
141
|
+
})
|
|
142
|
+
return ix
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Creates a _SendWithLzToken_ instructionAccounts.
|
|
147
|
+
*
|
|
148
|
+
* @param accounts that will be accessed while the instruction is processed
|
|
149
|
+
* @category Instructions
|
|
150
|
+
* @category SendWithLzToken
|
|
151
|
+
* @category generated
|
|
152
|
+
*/
|
|
153
|
+
export function createSendWithLzTokenInstructionAccounts(
|
|
154
|
+
accounts: SendWithLzTokenInstructionAccounts,
|
|
155
|
+
programId: web3.PublicKey
|
|
156
|
+
) {
|
|
157
|
+
const keys: web3.AccountMeta[] = [
|
|
158
|
+
{
|
|
159
|
+
pubkey: accounts.endpoint,
|
|
160
|
+
isWritable: false,
|
|
161
|
+
isSigner: true,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
pubkey: accounts.messageLib,
|
|
165
|
+
isWritable: true,
|
|
166
|
+
isSigner: false,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
pubkey: accounts.messageLibLzToken,
|
|
170
|
+
isWritable: true,
|
|
171
|
+
isSigner: false,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
pubkey: accounts.payer,
|
|
175
|
+
isWritable: true,
|
|
176
|
+
isSigner: true,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
pubkey: accounts.lzTokenSource,
|
|
180
|
+
isWritable: true,
|
|
181
|
+
isSigner: false,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
pubkey: accounts.lzTokenMint,
|
|
185
|
+
isWritable: false,
|
|
186
|
+
isSigner: false,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
pubkey: accounts.tokenProgram ?? splToken.TOKEN_PROGRAM_ID,
|
|
190
|
+
isWritable: false,
|
|
191
|
+
isSigner: false,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
pubkey: accounts.systemProgram ?? web3.SystemProgram.programId,
|
|
195
|
+
isWritable: false,
|
|
196
|
+
isSigner: false,
|
|
197
|
+
},
|
|
198
|
+
]
|
|
199
|
+
|
|
200
|
+
if (accounts.anchorRemainingAccounts != null) {
|
|
201
|
+
for (const acc of accounts.anchorRemainingAccounts) {
|
|
202
|
+
keys.push(acc)
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return keys
|
|
207
|
+
}
|