@layerzerolabs/lz-solana-sdk-v2 3.0.52 → 3.0.54
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 +28 -0
- package/dist/index.cjs +2764 -4309
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +14 -115
- package/dist/index.d.ts +14 -115
- package/dist/index.mjs +2764 -4307
- package/dist/index.mjs.map +1 -1
- package/dist/umi.cjs +14486 -0
- package/dist/umi.cjs.map +1 -0
- package/dist/umi.d.mts +8807 -0
- package/dist/umi.d.ts +8807 -0
- package/dist/umi.mjs +14401 -0
- package/dist/umi.mjs.map +1 -0
- package/package.json +26 -10
- package/src/deployment.test.ts +1 -1
- package/src/deployment.ts +2 -2
- package/src/dvn.ts +248 -449
- package/src/endpoint.ts +793 -964
- package/src/executor.ts +286 -413
- package/src/generated/kinobi/blocked_messagelib/errors/blockedMessagelib.ts +42 -0
- package/src/generated/kinobi/blocked_messagelib/errors/index.ts +9 -0
- package/src/generated/kinobi/blocked_messagelib/index.ts +12 -0
- package/src/generated/kinobi/blocked_messagelib/instructions/index.ts +9 -0
- package/src/generated/kinobi/blocked_messagelib/instructions/version.ts +80 -0
- package/src/generated/kinobi/blocked_messagelib/programs/blockedMessagelib.ts +55 -0
- package/src/generated/kinobi/blocked_messagelib/programs/index.ts +9 -0
- package/src/generated/kinobi/blocked_messagelib/shared/index.ts +117 -0
- package/src/generated/kinobi/dvn/accounts/dvnConfig.ts +199 -0
- package/src/generated/kinobi/dvn/accounts/executeHash.ts +148 -0
- package/src/generated/kinobi/dvn/accounts/index.ts +11 -0
- package/src/generated/kinobi/dvn/accounts/receiveConfig.ts +154 -0
- package/src/generated/kinobi/dvn/errors/dvn.ts +263 -0
- package/src/generated/kinobi/dvn/errors/index.ts +9 -0
- package/src/generated/kinobi/dvn/events/adminConfigSetEvent.ts +23 -0
- package/src/generated/kinobi/dvn/events/feeWithdrawnEvent.ts +35 -0
- package/src/generated/kinobi/dvn/events/index.ts +3 -0
- package/src/generated/kinobi/dvn/events/multisigConfigSetEvent.ts +28 -0
- package/src/generated/kinobi/dvn/index.ts +14 -0
- package/src/generated/kinobi/dvn/instructions/closeExecute.ts +126 -0
- package/src/generated/kinobi/dvn/instructions/index.ts +15 -0
- package/src/generated/kinobi/dvn/instructions/initDvn.ts +155 -0
- package/src/generated/kinobi/dvn/instructions/invoke.ts +161 -0
- package/src/generated/kinobi/dvn/instructions/quoteDvn.ts +150 -0
- package/src/generated/kinobi/dvn/instructions/setConfig.ts +138 -0
- package/src/generated/kinobi/dvn/instructions/verifiable.ts +139 -0
- package/src/generated/kinobi/dvn/instructions/withdrawFee.ts +139 -0
- package/src/generated/kinobi/dvn/programs/dvn.ts +48 -0
- package/src/generated/kinobi/dvn/programs/index.ts +9 -0
- package/src/generated/kinobi/dvn/shared/index.ts +117 -0
- package/src/generated/kinobi/dvn/types/acl.ts +29 -0
- package/src/generated/kinobi/dvn/types/adminConfig.ts +116 -0
- package/src/generated/kinobi/dvn/types/dstConfig.ts +43 -0
- package/src/generated/kinobi/dvn/types/executeTransactionDigest.ts +55 -0
- package/src/generated/kinobi/dvn/types/index.ts +18 -0
- package/src/generated/kinobi/dvn/types/lzOption.ts +29 -0
- package/src/generated/kinobi/dvn/types/multisig.ts +29 -0
- package/src/generated/kinobi/dvn/types/multisigConfig.ts +130 -0
- package/src/generated/kinobi/dvn/types/transactionAccount.ts +37 -0
- package/src/generated/kinobi/dvn/types/ulnConfig.ts +49 -0
- package/src/generated/kinobi/dvn/types/verificationState.ts +28 -0
- package/src/generated/kinobi/endpoint/accounts/composeMessageState.ts +166 -0
- package/src/generated/kinobi/endpoint/accounts/endpointSettings.ts +171 -0
- package/src/generated/kinobi/endpoint/accounts/index.ts +17 -0
- package/src/generated/kinobi/endpoint/accounts/messageLibInfo.ts +170 -0
- package/src/generated/kinobi/endpoint/accounts/nonce.ts +151 -0
- package/src/generated/kinobi/endpoint/accounts/oAppRegistry.ts +151 -0
- package/src/generated/kinobi/endpoint/accounts/payloadHash.ts +144 -0
- package/src/generated/kinobi/endpoint/accounts/pendingInboundNonce.ts +163 -0
- package/src/generated/kinobi/endpoint/accounts/receiveLibraryConfig.ts +175 -0
- package/src/generated/kinobi/endpoint/accounts/sendLibraryConfig.ts +167 -0
- package/src/generated/kinobi/endpoint/errors/endpoint.ts +276 -0
- package/src/generated/kinobi/endpoint/errors/index.ts +9 -0
- package/src/generated/kinobi/endpoint/events/adminTransferredEvent.ts +27 -0
- package/src/generated/kinobi/endpoint/events/composeDeliveredEvent.ts +40 -0
- package/src/generated/kinobi/endpoint/events/composeSentEvent.ts +43 -0
- package/src/generated/kinobi/endpoint/events/defaultReceiveLibrarySetEvent.ts +35 -0
- package/src/generated/kinobi/endpoint/events/defaultReceiveLibraryTimeoutSetEvent.ts +46 -0
- package/src/generated/kinobi/endpoint/events/defaultSendLibrarySetEvent.ts +32 -0
- package/src/generated/kinobi/endpoint/events/delegateSetEvent.ts +27 -0
- package/src/generated/kinobi/endpoint/events/inboundNonceSkippedEvent.ts +46 -0
- package/src/generated/kinobi/endpoint/events/index.ts +22 -0
- package/src/generated/kinobi/endpoint/events/libraryRegisteredEvent.ts +34 -0
- package/src/generated/kinobi/endpoint/events/lzComposeAlertEvent.ts +65 -0
- package/src/generated/kinobi/endpoint/events/lzReceiveAlertEvent.ts +67 -0
- package/src/generated/kinobi/endpoint/events/lzTokenSetEvent.ts +28 -0
- package/src/generated/kinobi/endpoint/events/oAppRegisteredEvent.ts +31 -0
- package/src/generated/kinobi/endpoint/events/packetBurntEvent.ts +49 -0
- package/src/generated/kinobi/endpoint/events/packetDeliveredEvent.ts +46 -0
- package/src/generated/kinobi/endpoint/events/packetNilifiedEvent.ts +49 -0
- package/src/generated/kinobi/endpoint/events/packetSentEvent.ts +38 -0
- package/src/generated/kinobi/endpoint/events/packetVerifiedEvent.ts +49 -0
- package/src/generated/kinobi/endpoint/events/receiveLibrarySetEvent.ts +37 -0
- package/src/generated/kinobi/endpoint/events/receiveLibraryTimeoutSetEvent.ts +50 -0
- package/src/generated/kinobi/endpoint/events/rentWithdrawnEvent.ts +35 -0
- package/src/generated/kinobi/endpoint/events/sendLibrarySetEvent.ts +37 -0
- package/src/generated/kinobi/endpoint/index.ts +14 -0
- package/src/generated/kinobi/endpoint/instructions/burn.ts +166 -0
- package/src/generated/kinobi/endpoint/instructions/clear.ts +169 -0
- package/src/generated/kinobi/endpoint/instructions/clearCompose.ts +142 -0
- package/src/generated/kinobi/endpoint/instructions/index.ts +40 -0
- package/src/generated/kinobi/endpoint/instructions/initConfig.ts +145 -0
- package/src/generated/kinobi/endpoint/instructions/initDefaultReceiveLibrary.ts +172 -0
- package/src/generated/kinobi/endpoint/instructions/initDefaultSendLibrary.ts +171 -0
- package/src/generated/kinobi/endpoint/instructions/initEndpoint.ts +142 -0
- package/src/generated/kinobi/endpoint/instructions/initNonce.ts +158 -0
- package/src/generated/kinobi/endpoint/instructions/initReceiveLibrary.ts +154 -0
- package/src/generated/kinobi/endpoint/instructions/initSendLibrary.ts +152 -0
- package/src/generated/kinobi/endpoint/instructions/initVerify.ts +159 -0
- package/src/generated/kinobi/endpoint/instructions/lzComposeAlert.ts +159 -0
- package/src/generated/kinobi/endpoint/instructions/lzReceiveAlert.ts +161 -0
- package/src/generated/kinobi/endpoint/instructions/nilify.ts +165 -0
- package/src/generated/kinobi/endpoint/instructions/quote.ts +160 -0
- package/src/generated/kinobi/endpoint/instructions/registerLibrary.ts +167 -0
- package/src/generated/kinobi/endpoint/instructions/registerOapp.ts +154 -0
- package/src/generated/kinobi/endpoint/instructions/send.ts +178 -0
- package/src/generated/kinobi/endpoint/instructions/sendCompose.ts +166 -0
- package/src/generated/kinobi/endpoint/instructions/setConfig.ts +154 -0
- package/src/generated/kinobi/endpoint/instructions/setDefaultReceiveLibrary.ts +160 -0
- package/src/generated/kinobi/endpoint/instructions/setDefaultReceiveLibraryTimeout.ts +163 -0
- package/src/generated/kinobi/endpoint/instructions/setDefaultSendLibrary.ts +156 -0
- package/src/generated/kinobi/endpoint/instructions/setDelegate.ts +130 -0
- package/src/generated/kinobi/endpoint/instructions/setLzToken.ts +138 -0
- package/src/generated/kinobi/endpoint/instructions/setReceiveLibrary.ts +163 -0
- package/src/generated/kinobi/endpoint/instructions/setReceiveLibraryTimeout.ts +164 -0
- package/src/generated/kinobi/endpoint/instructions/setSendLibrary.ts +158 -0
- package/src/generated/kinobi/endpoint/instructions/skip.ts +173 -0
- package/src/generated/kinobi/endpoint/instructions/transferAdmin.ts +137 -0
- package/src/generated/kinobi/endpoint/instructions/verify.ts +171 -0
- package/src/generated/kinobi/endpoint/instructions/withdrawRent.ts +139 -0
- package/src/generated/kinobi/endpoint/programs/endpoint.ts +52 -0
- package/src/generated/kinobi/endpoint/programs/index.ts +9 -0
- package/src/generated/kinobi/endpoint/shared/index.ts +117 -0
- package/src/generated/kinobi/endpoint/types/index.ts +12 -0
- package/src/generated/kinobi/endpoint/types/messageLibType.ts +26 -0
- package/src/generated/kinobi/endpoint/types/messagingFee.ts +29 -0
- package/src/generated/kinobi/endpoint/types/messagingReceipt.ts +41 -0
- package/src/generated/kinobi/endpoint/types/receiveLibraryTimeout.ts +35 -0
- package/src/generated/kinobi/executor/accounts/executorConfig.ts +208 -0
- package/src/generated/kinobi/executor/accounts/index.ts +10 -0
- package/src/generated/kinobi/executor/accounts/nonce.ts +151 -0
- package/src/generated/kinobi/executor/errors/executor.ts +279 -0
- package/src/generated/kinobi/executor/errors/index.ts +9 -0
- package/src/generated/kinobi/executor/events/index.ts +1 -0
- package/src/generated/kinobi/executor/events/nativeDropAppliedEvent.ts +62 -0
- package/src/generated/kinobi/executor/index.ts +14 -0
- package/src/generated/kinobi/executor/instructions/adminSetConfig.ts +130 -0
- package/src/generated/kinobi/executor/instructions/compose.ts +155 -0
- package/src/generated/kinobi/executor/instructions/executable.ts +134 -0
- package/src/generated/kinobi/executor/instructions/execute.ts +159 -0
- package/src/generated/kinobi/executor/instructions/index.ts +16 -0
- package/src/generated/kinobi/executor/instructions/initExecutor.ts +154 -0
- package/src/generated/kinobi/executor/instructions/nativeDrop.ts +174 -0
- package/src/generated/kinobi/executor/instructions/ownerSetConfig.ts +130 -0
- package/src/generated/kinobi/executor/instructions/quoteExecutor.ts +147 -0
- package/src/generated/kinobi/executor/programs/executor.ts +52 -0
- package/src/generated/kinobi/executor/programs/index.ts +9 -0
- package/src/generated/kinobi/executor/shared/index.ts +117 -0
- package/src/generated/kinobi/executor/types/acl.ts +29 -0
- package/src/generated/kinobi/executor/types/adminSetConfigParams.ts +92 -0
- package/src/generated/kinobi/executor/types/dstConfig.ts +49 -0
- package/src/generated/kinobi/executor/types/executionState.ts +27 -0
- package/src/generated/kinobi/executor/types/index.ts +17 -0
- package/src/generated/kinobi/executor/types/lzComposeParams.ts +45 -0
- package/src/generated/kinobi/executor/types/lzOption.ts +29 -0
- package/src/generated/kinobi/executor/types/lzReceiveParams.ts +50 -0
- package/src/generated/kinobi/executor/types/nativeDropRequest.ts +35 -0
- package/src/generated/kinobi/executor/types/ownerSetConfigParams.ts +129 -0
- package/src/generated/kinobi/pricefeed/accounts/index.ts +9 -0
- package/src/generated/kinobi/pricefeed/accounts/priceFeed.ts +175 -0
- package/src/generated/kinobi/pricefeed/errors/index.ts +9 -0
- package/src/generated/kinobi/pricefeed/errors/pricefeed.ts +94 -0
- package/src/generated/kinobi/pricefeed/index.ts +14 -0
- package/src/generated/kinobi/pricefeed/instructions/getFee.ts +120 -0
- package/src/generated/kinobi/pricefeed/instructions/index.ts +14 -0
- package/src/generated/kinobi/pricefeed/instructions/initPriceFeed.ts +148 -0
- package/src/generated/kinobi/pricefeed/instructions/setPrice.ts +134 -0
- package/src/generated/kinobi/pricefeed/instructions/setPriceFeed.ts +131 -0
- package/src/generated/kinobi/pricefeed/instructions/setSolPrice.ts +126 -0
- package/src/generated/kinobi/pricefeed/instructions/transferAdmin.ts +125 -0
- package/src/generated/kinobi/pricefeed/programs/index.ts +9 -0
- package/src/generated/kinobi/pricefeed/programs/pricefeed.ts +55 -0
- package/src/generated/kinobi/pricefeed/shared/index.ts +117 -0
- package/src/generated/kinobi/pricefeed/types/index.ts +11 -0
- package/src/generated/kinobi/pricefeed/types/modelType.ts +74 -0
- package/src/generated/kinobi/pricefeed/types/price.ts +47 -0
- package/src/generated/kinobi/pricefeed/types/priceParams.ts +47 -0
- package/src/generated/kinobi/simple_messagelib/accounts/index.ts +11 -0
- package/src/generated/kinobi/simple_messagelib/accounts/messageLib.ts +180 -0
- package/src/generated/kinobi/simple_messagelib/accounts/receiveConfigStore.ts +162 -0
- package/src/generated/kinobi/simple_messagelib/accounts/sendConfigStore.ts +154 -0
- package/src/generated/kinobi/simple_messagelib/errors/index.ts +9 -0
- package/src/generated/kinobi/simple_messagelib/errors/simpleMessagelib.ts +146 -0
- package/src/generated/kinobi/simple_messagelib/index.ts +14 -0
- package/src/generated/kinobi/simple_messagelib/instructions/index.ts +23 -0
- package/src/generated/kinobi/simple_messagelib/instructions/initConfig.ts +160 -0
- package/src/generated/kinobi/simple_messagelib/instructions/initDefaultConfig.ts +164 -0
- package/src/generated/kinobi/simple_messagelib/instructions/initMessageLib.ts +161 -0
- package/src/generated/kinobi/simple_messagelib/instructions/quote.ts +128 -0
- package/src/generated/kinobi/simple_messagelib/instructions/revertCall.ts +84 -0
- package/src/generated/kinobi/simple_messagelib/instructions/send.ts +155 -0
- package/src/generated/kinobi/simple_messagelib/instructions/sendWithLzToken.ts +202 -0
- package/src/generated/kinobi/simple_messagelib/instructions/setConfig.ts +145 -0
- package/src/generated/kinobi/simple_messagelib/instructions/setDefaultConfig.ts +164 -0
- package/src/generated/kinobi/simple_messagelib/instructions/setFee.ts +122 -0
- package/src/generated/kinobi/simple_messagelib/instructions/setWlCaller.ts +121 -0
- package/src/generated/kinobi/simple_messagelib/instructions/transferAdmin.ts +125 -0
- package/src/generated/kinobi/simple_messagelib/instructions/validatePacket.ts +129 -0
- package/src/generated/kinobi/simple_messagelib/instructions/version.ts +80 -0
- package/src/generated/kinobi/simple_messagelib/instructions/withdrawFees.ts +127 -0
- package/src/generated/kinobi/simple_messagelib/programs/index.ts +9 -0
- package/src/generated/kinobi/simple_messagelib/programs/simpleMessagelib.ts +55 -0
- package/src/generated/kinobi/simple_messagelib/shared/index.ts +117 -0
- package/src/generated/kinobi/simple_messagelib/types/index.ts +11 -0
- package/src/generated/kinobi/simple_messagelib/types/messagingFee.ts +29 -0
- package/src/generated/kinobi/simple_messagelib/types/packet.ts +52 -0
- package/src/generated/kinobi/simple_messagelib/types/version.ts +33 -0
- package/src/generated/kinobi/uln/accounts/confirmations.ts +160 -0
- package/src/generated/kinobi/uln/accounts/index.ts +12 -0
- package/src/generated/kinobi/uln/accounts/receiveConfig.ts +154 -0
- package/src/generated/kinobi/uln/accounts/sendConfig.ts +156 -0
- package/src/generated/kinobi/uln/accounts/ulnSettings.ts +169 -0
- package/src/generated/kinobi/uln/errors/index.ts +9 -0
- package/src/generated/kinobi/uln/errors/uln.ts +474 -0
- package/src/generated/kinobi/uln/events/adminTransferredEvent.ts +27 -0
- package/src/generated/kinobi/uln/events/configSetEvent.ts +38 -0
- package/src/generated/kinobi/uln/events/defaultConfigSetEvent.ts +52 -0
- package/src/generated/kinobi/uln/events/feesPaidEvent.ts +49 -0
- package/src/generated/kinobi/uln/events/index.ts +7 -0
- package/src/generated/kinobi/uln/events/payloadVerifiedEvent.ts +47 -0
- package/src/generated/kinobi/uln/events/rentWithdrawnEvent.ts +35 -0
- package/src/generated/kinobi/uln/events/treasurySetEvent.ts +29 -0
- package/src/generated/kinobi/uln/index.ts +14 -0
- package/src/generated/kinobi/uln/instructions/closeVerify.ts +127 -0
- package/src/generated/kinobi/uln/instructions/commitVerification.ts +134 -0
- package/src/generated/kinobi/uln/instructions/index.ts +24 -0
- package/src/generated/kinobi/uln/instructions/initConfig.ts +156 -0
- package/src/generated/kinobi/uln/instructions/initDefaultConfig.ts +179 -0
- package/src/generated/kinobi/uln/instructions/initUln.ts +143 -0
- package/src/generated/kinobi/uln/instructions/initVerify.ts +149 -0
- package/src/generated/kinobi/uln/instructions/quote.ts +136 -0
- package/src/generated/kinobi/uln/instructions/send.ts +181 -0
- package/src/generated/kinobi/uln/instructions/sendWithLzToken.ts +226 -0
- package/src/generated/kinobi/uln/instructions/setConfig.ts +165 -0
- package/src/generated/kinobi/uln/instructions/setDefaultConfig.ts +167 -0
- package/src/generated/kinobi/uln/instructions/setTreasury.ts +135 -0
- package/src/generated/kinobi/uln/instructions/transferAdmin.ts +133 -0
- package/src/generated/kinobi/uln/instructions/verify.ts +140 -0
- package/src/generated/kinobi/uln/instructions/version.ts +80 -0
- package/src/generated/kinobi/uln/instructions/withdrawRent.ts +135 -0
- package/src/generated/kinobi/uln/programs/index.ts +9 -0
- package/src/generated/kinobi/uln/programs/uln.ts +48 -0
- package/src/generated/kinobi/uln/shared/index.ts +117 -0
- package/src/generated/kinobi/uln/types/config.ts +88 -0
- package/src/generated/kinobi/uln/types/executorConfig.ts +32 -0
- package/src/generated/kinobi/uln/types/index.ts +18 -0
- package/src/generated/kinobi/uln/types/lzTokenTreasury.ts +32 -0
- package/src/generated/kinobi/uln/types/messagingFee.ts +29 -0
- package/src/generated/kinobi/uln/types/packet.ts +52 -0
- package/src/generated/kinobi/uln/types/treasury.ts +47 -0
- package/src/generated/kinobi/uln/types/treasuryFee.ts +42 -0
- package/src/generated/kinobi/uln/types/ulnConfig.ts +49 -0
- package/src/generated/kinobi/uln/types/version.ts +33 -0
- package/src/generated/kinobi/uln/types/workerFee.ts +29 -0
- package/src/generated/kinobi/worker_interface/errors/index.ts +9 -0
- package/src/generated/kinobi/worker_interface/errors/workerInterface.ts +68 -0
- package/src/generated/kinobi/worker_interface/index.ts +13 -0
- package/src/generated/kinobi/worker_interface/instructions/index.ts +10 -0
- package/src/generated/kinobi/worker_interface/instructions/quoteDvn.ts +150 -0
- package/src/generated/kinobi/worker_interface/instructions/quoteExecutor.ts +147 -0
- package/src/generated/kinobi/worker_interface/programs/index.ts +9 -0
- package/src/generated/kinobi/worker_interface/programs/workerInterface.ts +55 -0
- package/src/generated/kinobi/worker_interface/shared/index.ts +117 -0
- package/src/generated/kinobi/worker_interface/types/index.ts +9 -0
- package/src/generated/kinobi/worker_interface/types/lzOption.ts +29 -0
- package/src/index.ts +31 -47
- package/src/next_nonce.ts +107 -0
- package/src/pda.ts +328 -0
- package/src/pricefeed.ts +115 -168
- package/src/receive.ts +285 -0
- package/src/send-helper.ts +269 -188
- package/src/simple-message-lib.ts +254 -146
- package/src/{base-oapp.ts → solita/base-oapp.ts} +2 -3
- package/src/solita/config.ts +32 -0
- package/src/solita/deployment.ts +128 -0
- package/src/solita/dvn.ts +606 -0
- package/src/solita/endpoint.ts +1517 -0
- package/src/solita/executor.ts +577 -0
- package/src/solita/index.ts +100 -0
- package/src/solita/pricefeed.ts +208 -0
- package/src/{recevie.ts → solita/recevie.ts} +2 -3
- package/src/solita/send-helper.ts +503 -0
- package/src/solita/simple-message-lib.ts +302 -0
- package/src/solita/types.ts +222 -0
- package/src/solita/uln.ts +1045 -0
- package/src/solita/utility.ts +589 -0
- package/src/types.ts +59 -65
- package/src/uln.ts +495 -466
- package/src/utility.ts +226 -180
- /package/src/generated/{blocked_messagelib → solita/blocked_messagelib}/index.ts +0 -0
- /package/src/generated/{blocked_messagelib → solita/blocked_messagelib}/instructions/index.ts +0 -0
- /package/src/generated/{blocked_messagelib → solita/blocked_messagelib}/instructions/version.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/accounts/DvnConfig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/accounts/ExecuteHash.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/accounts/ReceiveConfig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/accounts/index.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/errors/index.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/events/AdminConfigSetEvent.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/events/FeeWithdrawnEvent.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/events/MultisigConfigSetEvent.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/events/index.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/index.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/closeExecute.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/index.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/initDvn.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/invoke.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/quoteDvn.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/setConfig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/verifiable.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/instructions/withdrawFee.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/Acl.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/AdminConfig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/CloseExecuteParams.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/DstConfig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/ExecuteTransactionDigest.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/InitDvnParams.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/InvokeParams.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/LzOption.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/Multisig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/MultisigConfig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/QuoteDvnParams.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/SetConfigParams.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/TransactionAccount.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/UlnConfig.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/VerifiableParams.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/VerificationState.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/WithdrawFeeParams.ts +0 -0
- /package/src/generated/{dvn → solita/dvn}/types/index.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/ComposeMessageState.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/EndpointSettings.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/MessageLibInfo.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/Nonce.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/OAppRegistry.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/PayloadHash.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/PendingInboundNonce.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/ReceiveLibraryConfig.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/SendLibraryConfig.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/accounts/index.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/errors/index.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/AdminTransferredEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/ComposeDeliveredEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/ComposeSentEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/DefaultReceiveLibrarySetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/DefaultReceiveLibraryTimeoutSetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/DefaultSendLibrarySetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/DelegateSetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/InboundNonceSkippedEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/LibraryRegisteredEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/LzComposeAlertEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/LzReceiveAlertEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/LzTokenSetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/OAppRegisteredEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/PacketBurntEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/PacketDeliveredEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/PacketNilifiedEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/PacketSentEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/PacketVerifiedEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/ReceiveLibrarySetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/ReceiveLibraryTimeoutSetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/RentWithdrawnEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/SendLibrarySetEvent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/events/index.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/index.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/burn.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/clear.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/clearCompose.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/index.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initConfig.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initDefaultReceiveLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initDefaultSendLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initEndpoint.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initNonce.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initReceiveLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initSendLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/initVerify.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/lzComposeAlert.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/lzReceiveAlert.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/nilify.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/quote.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/registerLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/registerOapp.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/send.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/sendCompose.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setConfig.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setDefaultReceiveLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setDefaultReceiveLibraryTimeout.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setDefaultSendLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setDelegate.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setLzToken.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setReceiveLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setReceiveLibraryTimeout.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/setSendLibrary.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/skip.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/transferAdmin.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/verify.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/instructions/withdrawRent.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/BurnParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/ClearComposeParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/ClearParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitConfigParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitDefaultReceiveLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitDefaultSendLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitEndpointParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitNonceParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitReceiveLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitSendLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/InitVerifyParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/LzComposeAlertParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/LzReceiveAlertParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/MessageLibType.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/MessagingFee.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/MessagingReceipt.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/NilifyParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/QuoteParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/ReceiveLibraryTimeout.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/RegisterLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/RegisterOAppParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SendComposeParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SendParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetConfigParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetDefaultReceiveLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetDefaultReceiveLibraryTimeoutParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetDefaultSendLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetDelegateParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetLzTokenParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetReceiveLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetReceiveLibraryTimeoutParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SetSendLibraryParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/SkipParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/TransferAdminParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/VerifyParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/WithdrawRentParams.ts +0 -0
- /package/src/generated/{endpoint → solita/endpoint}/types/index.ts +0 -0
- /package/src/generated/{executor → solita/executor}/accounts/ExecutorConfig.ts +0 -0
- /package/src/generated/{executor → solita/executor}/accounts/Nonce.ts +0 -0
- /package/src/generated/{executor → solita/executor}/accounts/index.ts +0 -0
- /package/src/generated/{executor → solita/executor}/errors/index.ts +0 -0
- /package/src/generated/{executor → solita/executor}/events/NativeDropAppliedEvent.ts +0 -0
- /package/src/generated/{executor → solita/executor}/events/index.ts +0 -0
- /package/src/generated/{executor → solita/executor}/index.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/adminSetConfig.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/compose.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/executable.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/execute.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/index.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/initExecutor.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/nativeDrop.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/ownerSetConfig.ts +0 -0
- /package/src/generated/{executor → solita/executor}/instructions/quoteExecutor.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/Acl.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/AdminSetConfigParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/ComposeParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/DstConfig.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/ExecutableParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/ExecuteParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/ExecutionState.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/InitExecutorParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/LzComposeParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/LzOption.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/LzReceiveParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/NativeDropParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/NativeDropRequest.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/OwnerSetConfigParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/QuoteExecutorParams.ts +0 -0
- /package/src/generated/{executor → solita/executor}/types/index.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/accounts/PriceFeed.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/accounts/index.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/errors/index.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/index.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/instructions/getFee.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/instructions/index.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/instructions/initPriceFeed.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/instructions/setPrice.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/instructions/setPriceFeed.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/instructions/setSolPrice.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/instructions/transferAdmin.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/GetFeeParams.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/InitPriceFeedParams.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/ModelType.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/Price.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/PriceParams.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/SetPriceFeedParams.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/SetPriceParams.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/SetSolPriceParams.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/TransferAdminParams.ts +0 -0
- /package/src/generated/{pricefeed → solita/pricefeed}/types/index.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/accounts/MessageLib.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/accounts/ReceiveConfigStore.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/accounts/SendConfigStore.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/accounts/index.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/errors/index.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/index.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/index.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/initConfig.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/initDefaultConfig.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/initMessageLib.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/quote.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/revertCall.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/send.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/sendWithLzToken.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/setConfig.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/setDefaultConfig.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/setFee.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/setWlCaller.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/transferAdmin.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/validatePacket.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/version.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/instructions/withdrawFees.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/InitConfigParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/InitDefaultConfigParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/InitMessageLibParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/MessagingFee.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/Packet.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/QuoteParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/SendParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/SendWithLzTokenParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/SetConfigParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/SetDefaultConfigParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/SetFeeParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/SetWlCallerParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/TransferAdminParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/ValidatePacketParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/Version.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/WithdrawFeesParams.ts +0 -0
- /package/src/generated/{simple_messagelib → solita/simple_messagelib}/types/index.ts +0 -0
- /package/src/generated/{uln → solita/uln}/accounts/Confirmations.ts +0 -0
- /package/src/generated/{uln → solita/uln}/accounts/ReceiveConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/accounts/SendConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/accounts/UlnSettings.ts +0 -0
- /package/src/generated/{uln → solita/uln}/accounts/index.ts +0 -0
- /package/src/generated/{uln → solita/uln}/errors/index.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/AdminTransferredEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/ConfigSetEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/DefaultConfigSetEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/FeesPaidEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/LzTokenSetEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/PayloadVerifiedEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/RentWithdrawnEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/TreasuryFeeCapSetEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/TreasurySetEvent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/events/index.ts +0 -0
- /package/src/generated/{uln → solita/uln}/index.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/closeVerify.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/commitVerification.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/index.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/initConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/initDefaultConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/initUln.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/initVerify.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/quote.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/send.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/sendWithLzToken.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/setConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/setDefaultConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/setTreasury.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/transferAdmin.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/verify.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/version.ts +0 -0
- /package/src/generated/{uln → solita/uln}/instructions/withdrawRent.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/CloseVerifyParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/CommitVerificationParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/Config.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/ExecutorConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/InitConfigParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/InitDefaultConfigParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/InitUlnParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/InitVerifyParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/LzTokenTreasury.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/MessagingFee.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/Packet.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/QuoteParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/SendParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/SendWithLzTokenParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/SetConfigParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/SetDefaultConfigParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/SetTreasuryParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/TransferAdminParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/Treasury.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/TreasuryFee.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/UlnConfig.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/VerifyParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/Version.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/WithdrawRentParams.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/WorkerFee.ts +0 -0
- /package/src/generated/{uln → solita/uln}/types/index.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/errors/index.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/index.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/instructions/index.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/instructions/quoteDvn.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/instructions/quoteExecutor.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/types/LzOption.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/types/QuoteDvnParams.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/types/QuoteExecutorParams.ts +0 -0
- /package/src/generated/{worker_interface → solita/worker_interface}/types/index.ts +0 -0
- /package/src/{pda-deriver.ts → solita/pda-deriver.ts} +0 -0
|
@@ -0,0 +1,1045 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccountMeta,
|
|
3
|
+
Commitment,
|
|
4
|
+
Connection,
|
|
5
|
+
GetAccountInfoConfig,
|
|
6
|
+
PublicKey,
|
|
7
|
+
TransactionInstruction,
|
|
8
|
+
} from '@solana/web3.js'
|
|
9
|
+
import BN from 'bn.js'
|
|
10
|
+
import invariant from 'tiny-invariant'
|
|
11
|
+
|
|
12
|
+
import { arrayify } from '@layerzerolabs/lz-utilities'
|
|
13
|
+
import { PacketV1Codec } from '@layerzerolabs/lz-v2-utilities'
|
|
14
|
+
|
|
15
|
+
import { EndpointProgram, MessageLibInterface, SetConfigType, SolanaPacketPath } from '.'
|
|
16
|
+
import { DVN, accounts as DvnAccounts } from './dvn'
|
|
17
|
+
import { Executor, accounts as ExecutorAccounts } from './executor'
|
|
18
|
+
import { EndpointPDADeriver, EventPDADeriver, UlnPDADeriver } from './pda-deriver'
|
|
19
|
+
import * as accounts from '../generated/solita/uln/accounts'
|
|
20
|
+
import * as errors from '../generated/solita/uln/errors'
|
|
21
|
+
import * as events from '../generated/solita/uln/events'
|
|
22
|
+
import * as instructions from '../generated/solita/uln/instructions'
|
|
23
|
+
import * as types from '../generated/solita/uln/types'
|
|
24
|
+
|
|
25
|
+
export * from '../generated/solita/uln'
|
|
26
|
+
export { accounts, instructions, types, events, errors }
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Interface representing the maximum message size.
|
|
30
|
+
*/
|
|
31
|
+
export interface MaxMessageSize {
|
|
32
|
+
/**
|
|
33
|
+
* The size of the message.
|
|
34
|
+
*/
|
|
35
|
+
size: number
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The kind of the message size.
|
|
39
|
+
*/
|
|
40
|
+
__kind: 'MaxMessageSize'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Interface representing the outbound confirmations.
|
|
45
|
+
*/
|
|
46
|
+
export interface OutboundConfirmations {
|
|
47
|
+
/**
|
|
48
|
+
* The number of confirmations.
|
|
49
|
+
*/
|
|
50
|
+
confirmations: number
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The kind of the outbound confirmations.
|
|
54
|
+
*/
|
|
55
|
+
__kind: 'OutboundConfirmations'
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Interface representing the inbound confirmations.
|
|
60
|
+
*/
|
|
61
|
+
export interface InboundConfirmations {
|
|
62
|
+
/**
|
|
63
|
+
* The number of confirmations.
|
|
64
|
+
*/
|
|
65
|
+
confirmations: number
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The kind of the inbound confirmations.
|
|
69
|
+
*/
|
|
70
|
+
__kind: 'InboundConfirmations'
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Interface representing the oracles.
|
|
75
|
+
*/
|
|
76
|
+
export interface Oracles {
|
|
77
|
+
/**
|
|
78
|
+
* Indicates if custom oracles are used.
|
|
79
|
+
*/
|
|
80
|
+
useCustomOracles: boolean
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The array of oracle public keys.
|
|
84
|
+
*/
|
|
85
|
+
oracles: PublicKey[]
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The kind of the oracles.
|
|
89
|
+
*/
|
|
90
|
+
__kind: 'Oracles'
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Interface representing the optional oracles.
|
|
95
|
+
*/
|
|
96
|
+
export interface OptionalOracles {
|
|
97
|
+
/**
|
|
98
|
+
* Indicates if custom optional oracles are used.
|
|
99
|
+
*/
|
|
100
|
+
useCustomOptionalOracles: boolean
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The array of optional oracle public keys.
|
|
104
|
+
*/
|
|
105
|
+
optionalOracles: PublicKey[]
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The threshold for the optional oracles.
|
|
109
|
+
*/
|
|
110
|
+
threshold: number
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The kind of the optional oracles.
|
|
114
|
+
*/
|
|
115
|
+
__kind: 'OptionalOracles'
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Class representing the ULN (Ultra Light Node).
|
|
120
|
+
* @see {@link MessageLibInterface}
|
|
121
|
+
*/
|
|
122
|
+
export class Uln implements MessageLibInterface {
|
|
123
|
+
deriver: UlnPDADeriver
|
|
124
|
+
eventAuthorityPDA: PublicKey
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Creates an instance of the Uln class.
|
|
128
|
+
*
|
|
129
|
+
* @param {PublicKey} program - The program public key.
|
|
130
|
+
*/
|
|
131
|
+
constructor(public program: PublicKey) {
|
|
132
|
+
this.deriver = new UlnPDADeriver(program)
|
|
133
|
+
const [eventAuthorityPDA] = new EventPDADeriver(program).eventAuthority()
|
|
134
|
+
this.eventAuthorityPDA = eventAuthorityPDA
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Initializes the ULN.
|
|
139
|
+
*
|
|
140
|
+
* @param {PublicKey} endpointProgram - The endpoint program public key.
|
|
141
|
+
* @param {PublicKey} payer - The payer public key.
|
|
142
|
+
* @param {PublicKey} admin - The admin public key.
|
|
143
|
+
* @param {number} eid - The endpoint ID.
|
|
144
|
+
* @returns {TransactionInstruction} The transaction instruction.
|
|
145
|
+
*/
|
|
146
|
+
initUln(endpointProgram: PublicKey, payer: PublicKey, admin: PublicKey, eid: number): TransactionInstruction {
|
|
147
|
+
const [setting] = this.deriver.setting()
|
|
148
|
+
const [msgLib] = this.deriver.messageLib()
|
|
149
|
+
const [endpointAuth] = new EndpointPDADeriver(endpointProgram).messageLibraryInfo(msgLib)
|
|
150
|
+
// const info = await connection.getAccountInfo(setting, commitmentOrConfig)
|
|
151
|
+
// if (info) {
|
|
152
|
+
// throw new Error('uln already initialized')
|
|
153
|
+
// }
|
|
154
|
+
|
|
155
|
+
return instructions.createInitUlnInstruction(
|
|
156
|
+
{
|
|
157
|
+
payer,
|
|
158
|
+
uln: setting,
|
|
159
|
+
} satisfies instructions.InitUlnInstructionAccounts,
|
|
160
|
+
{
|
|
161
|
+
params: {
|
|
162
|
+
eid,
|
|
163
|
+
admin,
|
|
164
|
+
endpoint: endpointAuth,
|
|
165
|
+
endpointProgram: endpointProgram,
|
|
166
|
+
} satisfies types.InitUlnParams,
|
|
167
|
+
} satisfies instructions.InitUlnInstructionArgs,
|
|
168
|
+
this.program
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Initializes or updates the default configuration.
|
|
174
|
+
* before calling this function, you should call initUln to initialize the uln
|
|
175
|
+
*
|
|
176
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
177
|
+
* @param {PublicKey} admin - The admin public key.
|
|
178
|
+
* @param {number} eid - The endpoint ID.
|
|
179
|
+
* @param {types.UlnConfig} sendUlnConfig - The send ULN configuration.
|
|
180
|
+
* @param {types.UlnConfig} receiveUlnConfig - The receive ULN configuration.
|
|
181
|
+
* @param {types.ExecutorConfig} executorConfig - The executor configuration.
|
|
182
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
183
|
+
* @returns {Promise<TransactionInstruction>} A promise that resolves to the transaction instruction.
|
|
184
|
+
*/
|
|
185
|
+
async initOrUpdateDefaultConfig(
|
|
186
|
+
connection: Connection,
|
|
187
|
+
admin: PublicKey,
|
|
188
|
+
eid: number,
|
|
189
|
+
sendUlnConfig: types.UlnConfig,
|
|
190
|
+
receiveUlnConfig: types.UlnConfig,
|
|
191
|
+
executorConfig: types.ExecutorConfig,
|
|
192
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
193
|
+
): Promise<TransactionInstruction> {
|
|
194
|
+
const [setting] = this.deriver.setting()
|
|
195
|
+
const [sendConfigPDA] = this.deriver.defaultSendConfig(eid)
|
|
196
|
+
const [receiveConfigPDA] = this.deriver.defaultReceiveConfig(eid)
|
|
197
|
+
const configInfo = await connection.getAccountInfo(sendConfigPDA, commitmentOrConfig)
|
|
198
|
+
if (configInfo) {
|
|
199
|
+
// update default config
|
|
200
|
+
return instructions.createSetDefaultConfigInstruction(
|
|
201
|
+
{
|
|
202
|
+
admin,
|
|
203
|
+
uln: setting,
|
|
204
|
+
sendConfig: sendConfigPDA,
|
|
205
|
+
receiveConfig: receiveConfigPDA,
|
|
206
|
+
eventAuthority: this.eventAuthorityPDA,
|
|
207
|
+
program: this.program,
|
|
208
|
+
} satisfies instructions.SetDefaultConfigInstructionAccounts,
|
|
209
|
+
{
|
|
210
|
+
params: {
|
|
211
|
+
eid,
|
|
212
|
+
sendUlnConfig,
|
|
213
|
+
receiveUlnConfig,
|
|
214
|
+
executorConfig,
|
|
215
|
+
} satisfies types.SetDefaultConfigParams,
|
|
216
|
+
} satisfies instructions.SetDefaultConfigInstructionArgs,
|
|
217
|
+
this.program
|
|
218
|
+
)
|
|
219
|
+
} else {
|
|
220
|
+
// init default config
|
|
221
|
+
return instructions.createInitDefaultConfigInstruction(
|
|
222
|
+
{
|
|
223
|
+
admin,
|
|
224
|
+
uln: setting,
|
|
225
|
+
sendConfig: sendConfigPDA,
|
|
226
|
+
receiveConfig: receiveConfigPDA,
|
|
227
|
+
eventAuthority: this.eventAuthorityPDA,
|
|
228
|
+
program: this.program,
|
|
229
|
+
} satisfies instructions.InitDefaultConfigInstructionAccounts,
|
|
230
|
+
{
|
|
231
|
+
params: {
|
|
232
|
+
eid,
|
|
233
|
+
sendUlnConfig,
|
|
234
|
+
receiveUlnConfig,
|
|
235
|
+
executorConfig,
|
|
236
|
+
} satisfies types.InitDefaultConfigParams,
|
|
237
|
+
} satisfies instructions.InitDefaultConfigInstructionArgs,
|
|
238
|
+
this.program
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// msg_lib -> msg_lib_program ->
|
|
244
|
+
/**
|
|
245
|
+
* Sets the treasury.
|
|
246
|
+
* before calling this function, you should call initUln to initialize the uln
|
|
247
|
+
*
|
|
248
|
+
* @param {PublicKey} admin - The admin public key.
|
|
249
|
+
* @param {object} treasury - The treasury object.
|
|
250
|
+
* @param {PublicKey} treasury.admin - The treasury admin public key.
|
|
251
|
+
* @param {PublicKey} treasury.nativeReceiver - The native receiver public key.
|
|
252
|
+
* @param {number} treasury.nativeFeeBps - The native fee basis points.
|
|
253
|
+
* @param {object} treasury.lzToken - The LZ token object.
|
|
254
|
+
* @param {PublicKey} treasury.lzToken.receiver - The LZ token receiver public key.
|
|
255
|
+
* @param {number} treasury.lzToken.fee - The LZ token fee.
|
|
256
|
+
* @returns {Promise<TransactionInstruction>} A promise that resolves to the transaction instruction.
|
|
257
|
+
*/
|
|
258
|
+
async setTreasury(
|
|
259
|
+
admin: PublicKey,
|
|
260
|
+
treasury: {
|
|
261
|
+
admin: PublicKey
|
|
262
|
+
nativeReceiver: PublicKey
|
|
263
|
+
nativeFeeBps: number
|
|
264
|
+
lzToken: { receiver: PublicKey; fee: number } | null
|
|
265
|
+
} | null
|
|
266
|
+
): Promise<TransactionInstruction> {
|
|
267
|
+
const [setting] = this.deriver.setting()
|
|
268
|
+
const ix = instructions.createSetTreasuryInstruction(
|
|
269
|
+
{
|
|
270
|
+
signer: admin,
|
|
271
|
+
uln: setting,
|
|
272
|
+
eventAuthority: this.eventAuthorityPDA,
|
|
273
|
+
program: this.program,
|
|
274
|
+
} satisfies instructions.SetTreasuryInstructionAccounts,
|
|
275
|
+
{
|
|
276
|
+
params: {
|
|
277
|
+
treasury,
|
|
278
|
+
} satisfies types.SetTreasuryParams,
|
|
279
|
+
} satisfies instructions.SetTreasuryInstructionArgs,
|
|
280
|
+
this.program
|
|
281
|
+
)
|
|
282
|
+
return Promise.resolve(ix)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Transfers the admin role to a new admin.
|
|
287
|
+
*
|
|
288
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
289
|
+
* @param {PublicKey} admin - The current admin public key.
|
|
290
|
+
* @param {PublicKey} newAdmin - The new admin public key.
|
|
291
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
292
|
+
* @returns {Promise<TransactionInstruction>} A promise that resolves to the transaction instruction.
|
|
293
|
+
* @throws {Error} If the ULN is not initialized.
|
|
294
|
+
*/
|
|
295
|
+
async transferAdmin(
|
|
296
|
+
connection: Connection,
|
|
297
|
+
admin: PublicKey,
|
|
298
|
+
newAdmin: PublicKey,
|
|
299
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
300
|
+
): Promise<TransactionInstruction> {
|
|
301
|
+
const [setting] = this.deriver.setting()
|
|
302
|
+
const info = await connection.getAccountInfo(setting, commitmentOrConfig)
|
|
303
|
+
if (!info) {
|
|
304
|
+
throw new Error('uln not initialized')
|
|
305
|
+
}
|
|
306
|
+
return instructions.createTransferAdminInstruction(
|
|
307
|
+
{
|
|
308
|
+
admin,
|
|
309
|
+
uln: setting,
|
|
310
|
+
eventAuthority: this.eventAuthorityPDA,
|
|
311
|
+
program: this.program,
|
|
312
|
+
} satisfies instructions.TransferAdminInstructionAccounts,
|
|
313
|
+
{
|
|
314
|
+
params: {
|
|
315
|
+
admin: newAdmin,
|
|
316
|
+
} satisfies types.TransferAdminParams,
|
|
317
|
+
} satisfies instructions.TransferAdminInstructionArgs,
|
|
318
|
+
this.program
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Gets the account metadata for the CPI (Cross-Program Invocation) of the quote instruction.
|
|
324
|
+
*
|
|
325
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
326
|
+
* @param {PublicKey} _payer - The payer public key.
|
|
327
|
+
* @param {PacketPath} path - The packet path.
|
|
328
|
+
* @param {Commitment} [commitment] - The commitment level.
|
|
329
|
+
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
330
|
+
*/
|
|
331
|
+
async getQuoteIXAccountMetaForCPI(
|
|
332
|
+
connection: Connection,
|
|
333
|
+
_payer: PublicKey,
|
|
334
|
+
path: SolanaPacketPath,
|
|
335
|
+
commitment?: Commitment
|
|
336
|
+
): Promise<AccountMeta[]> {
|
|
337
|
+
const { sender: sender_, dstEid } = path
|
|
338
|
+
const sender = new PublicKey(arrayify(sender_))
|
|
339
|
+
const [defaultSendConfig] = this.deriver.defaultSendConfig(dstEid)
|
|
340
|
+
const [sendConfig] = this.deriver.sendConfig(dstEid, sender)
|
|
341
|
+
const [setting] = this.deriver.setting()
|
|
342
|
+
|
|
343
|
+
const remainingAccounts = await this.getSendIxRemainingAccounts(connection, sender, dstEid, false, commitment)
|
|
344
|
+
const accounts = instructions.createQuoteInstructionAccounts(
|
|
345
|
+
{
|
|
346
|
+
endpoint: PublicKey.default, // useless
|
|
347
|
+
uln: setting,
|
|
348
|
+
sendConfig,
|
|
349
|
+
defaultSendConfig: defaultSendConfig,
|
|
350
|
+
anchorRemainingAccounts: remainingAccounts,
|
|
351
|
+
} satisfies instructions.QuoteInstructionAccounts,
|
|
352
|
+
this.program
|
|
353
|
+
)
|
|
354
|
+
return accounts.slice(1)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Gets the account metadata for the CPI (Cross-Program Invocation) of the send instruction.
|
|
359
|
+
*
|
|
360
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
361
|
+
* @param {PublicKey} payer - The payer public key.
|
|
362
|
+
* @param {PacketPath} path - The packet path.
|
|
363
|
+
* @param {Commitment} [commitment='confirmed'] - The commitment level.
|
|
364
|
+
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
365
|
+
*/
|
|
366
|
+
async getSendIXAccountMetaForCPI(
|
|
367
|
+
connection: Connection,
|
|
368
|
+
payer: PublicKey,
|
|
369
|
+
path: SolanaPacketPath,
|
|
370
|
+
commitment: Commitment = 'confirmed'
|
|
371
|
+
): Promise<AccountMeta[]> {
|
|
372
|
+
const { sender: sender_, dstEid } = path
|
|
373
|
+
const sender = new PublicKey(arrayify(sender_))
|
|
374
|
+
const [sendConfig] = this.deriver.sendConfig(dstEid, sender)
|
|
375
|
+
const [defaultSendConfig] = this.deriver.defaultSendConfig(dstEid)
|
|
376
|
+
|
|
377
|
+
const [setting] = this.deriver.setting()
|
|
378
|
+
const ulnState = await this.getSetting(connection, commitment)
|
|
379
|
+
const treasury = ulnState?.treasury?.nativeReceiver
|
|
380
|
+
const remainingAccounts = await this.getSendIxRemainingAccounts(connection, sender, dstEid, true, commitment)
|
|
381
|
+
const accounts = instructions.createSendInstructionAccounts(
|
|
382
|
+
{
|
|
383
|
+
endpoint: PublicKey.default, // useless
|
|
384
|
+
uln: setting,
|
|
385
|
+
sendConfig,
|
|
386
|
+
defaultSendConfig,
|
|
387
|
+
payer,
|
|
388
|
+
treasury,
|
|
389
|
+
eventAuthority: this.eventAuthorityPDA,
|
|
390
|
+
program: this.program,
|
|
391
|
+
anchorRemainingAccounts: remainingAccounts,
|
|
392
|
+
} satisfies instructions.SendInstructionAccounts,
|
|
393
|
+
this.program
|
|
394
|
+
)
|
|
395
|
+
accounts.forEach((key) => {
|
|
396
|
+
if (!payer.equals(key.pubkey)) {
|
|
397
|
+
key.isSigner = false
|
|
398
|
+
}
|
|
399
|
+
})
|
|
400
|
+
|
|
401
|
+
if (treasury) {
|
|
402
|
+
const treasuryIndex = accounts.findIndex((k) => k.pubkey.toBase58() == treasury.toBase58())
|
|
403
|
+
accounts[treasuryIndex].isWritable = true // treasury account
|
|
404
|
+
}
|
|
405
|
+
return accounts.slice(1)
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// 3 RPC requests
|
|
409
|
+
/**
|
|
410
|
+
* Gets the remaining accounts for the send instruction.
|
|
411
|
+
*
|
|
412
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
413
|
+
* @param {PublicKey} sender - The sender public key.
|
|
414
|
+
* @param {number} dstEid - The destination endpoint ID.
|
|
415
|
+
* @param {boolean} payment - Indicates if payment is required.
|
|
416
|
+
* @param {Commitment | GetAccountInfoConfig} [commitment='confirmed'] - The commitment level or account info configuration.
|
|
417
|
+
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
418
|
+
*/
|
|
419
|
+
async getSendIxRemainingAccounts(
|
|
420
|
+
connection: Connection,
|
|
421
|
+
sender: PublicKey,
|
|
422
|
+
dstEid: number,
|
|
423
|
+
payment: boolean,
|
|
424
|
+
commitment: Commitment | GetAccountInfoConfig = 'confirmed'
|
|
425
|
+
): Promise<AccountMeta[]> {
|
|
426
|
+
const { executor, dvns } = await this.getWorkers(connection, sender, dstEid, commitment)
|
|
427
|
+
|
|
428
|
+
const priceFeeds = new Array<PublicKey>()
|
|
429
|
+
;[executor.config, ...dvns.map((dvn) => dvn.config)].forEach((config) => {
|
|
430
|
+
if (!priceFeeds.find((p) => p.equals(config.priceFeed))) {
|
|
431
|
+
priceFeeds.push(config.priceFeed)
|
|
432
|
+
}
|
|
433
|
+
})
|
|
434
|
+
const priceFeedInfos = await connection.getMultipleAccountsInfo(priceFeeds, commitment)
|
|
435
|
+
const priceFeedDict = priceFeedInfos.reduce((acc, info, i) => {
|
|
436
|
+
invariant(info, `priceFeed:${priceFeeds[i].toBase58()} not initialized`)
|
|
437
|
+
acc.set(priceFeeds[i].toBase58(), info.owner)
|
|
438
|
+
return acc
|
|
439
|
+
}, new Map<string, PublicKey>())
|
|
440
|
+
const executorAccounts = new Executor(executor.owner).getQuoteIXAccountMetaForCPI(
|
|
441
|
+
executor.config.priceFeed,
|
|
442
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
443
|
+
priceFeedDict.get(executor.config.priceFeed.toBase58())!,
|
|
444
|
+
payment
|
|
445
|
+
)
|
|
446
|
+
const dvnAccounts = dvns.map((p, i) => {
|
|
447
|
+
return new DVN(p.owner).getQuoteIXAccountMetaForCPI(
|
|
448
|
+
p.config.priceFeed,
|
|
449
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
450
|
+
priceFeedDict.get(p.config.priceFeed.toBase58())!,
|
|
451
|
+
payment
|
|
452
|
+
)
|
|
453
|
+
})
|
|
454
|
+
return executorAccounts.concat(dvnAccounts.flat())
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Gets all workers (executor and DVN).
|
|
459
|
+
* 2 RPC requests
|
|
460
|
+
*
|
|
461
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
462
|
+
* @param {PublicKey} sender - The sender public key.
|
|
463
|
+
* @param {number} eid - The endpoint ID.
|
|
464
|
+
* @param {Commitment | GetAccountInfoConfig} [commitment='confirmed'] - The commitment level or account info configuration.
|
|
465
|
+
* @returns {Promise<{ executor: { config: ExecutorAccounts.ExecutorConfig; owner: PublicKey }; dvns: { config: DvnAccounts.DvnConfig; owner: PublicKey }[] }>} A promise that resolves to an object containing the executor and DVN configurations.
|
|
466
|
+
*/
|
|
467
|
+
async getWorkers(
|
|
468
|
+
connection: Connection,
|
|
469
|
+
sender: PublicKey,
|
|
470
|
+
eid: number,
|
|
471
|
+
commitment: Commitment | GetAccountInfoConfig = 'confirmed'
|
|
472
|
+
): Promise<{
|
|
473
|
+
executor: { config: ExecutorAccounts.ExecutorConfig; owner: PublicKey }
|
|
474
|
+
dvns: { config: DvnAccounts.DvnConfig; owner: PublicKey }[]
|
|
475
|
+
}> {
|
|
476
|
+
const [defaultSendConfig] = this.deriver.defaultSendConfig(eid)
|
|
477
|
+
const [sendConfig] = this.deriver.sendConfig(eid, sender)
|
|
478
|
+
const [defaultSendConfigBuf, sendConfigBuf] = await connection.getMultipleAccountsInfo(
|
|
479
|
+
[defaultSendConfig, sendConfig],
|
|
480
|
+
commitment
|
|
481
|
+
)
|
|
482
|
+
invariant(defaultSendConfigBuf, 'defaultSendConfig not initialized')
|
|
483
|
+
|
|
484
|
+
const [defaultSendConfigState] = accounts.SendConfig.fromAccountInfo(defaultSendConfigBuf)
|
|
485
|
+
let {
|
|
486
|
+
executor,
|
|
487
|
+
uln: { requiredDvns, optionalDvns },
|
|
488
|
+
} = defaultSendConfigState
|
|
489
|
+
const sendConfigState = sendConfigBuf ? accounts.SendConfig.fromAccountInfo(sendConfigBuf)[0] : null
|
|
490
|
+
|
|
491
|
+
// if the executor is set in the send config, use it
|
|
492
|
+
if (sendConfigState?.executor && !sendConfigState.executor.executor.equals(PublicKey.default)) {
|
|
493
|
+
;({ executor } = sendConfigState)
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// if the requiredDvns is set in the send config, use it
|
|
497
|
+
if (sendConfigState && sendConfigState.uln.requiredDvns.length > 0) {
|
|
498
|
+
requiredDvns = sendConfigState.uln.requiredDvns.filter((p) => {
|
|
499
|
+
return !p.equals(PublicKey.default)
|
|
500
|
+
})
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// if the optionalDvns is set in the send config, use it
|
|
504
|
+
if (sendConfigState && sendConfigState.uln.optionalDvns.length > 0) {
|
|
505
|
+
optionalDvns = sendConfigState.uln.optionalDvns.filter((p) => {
|
|
506
|
+
return !p.equals(PublicKey.default)
|
|
507
|
+
})
|
|
508
|
+
}
|
|
509
|
+
const dvns = requiredDvns.concat(optionalDvns)
|
|
510
|
+
const [executorBuf, ...dvnBuf] = await connection.getMultipleAccountsInfo(
|
|
511
|
+
[executor.executor, ...dvns],
|
|
512
|
+
commitment
|
|
513
|
+
)
|
|
514
|
+
invariant(executorBuf, `executor:${executor.executor.toBase58()} not initialized`)
|
|
515
|
+
|
|
516
|
+
return {
|
|
517
|
+
executor: {
|
|
518
|
+
config: ExecutorAccounts.ExecutorConfig.fromAccountInfo(executorBuf)[0],
|
|
519
|
+
owner: executorBuf.owner,
|
|
520
|
+
},
|
|
521
|
+
dvns: dvnBuf.map((dvn, i) => {
|
|
522
|
+
invariant(dvn, `dvn:${dvns[i].toBase58()} not initialized`)
|
|
523
|
+
return {
|
|
524
|
+
config: DvnAccounts.DvnConfig.fromAccountInfo(dvn)[0],
|
|
525
|
+
owner: dvn.owner,
|
|
526
|
+
}
|
|
527
|
+
}),
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Initializes the verification process.
|
|
533
|
+
*
|
|
534
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
535
|
+
* @param {PublicKey} payer - The payer public key.
|
|
536
|
+
* @param {PublicKey} dvn - The DVN public key.
|
|
537
|
+
* @param {Uint8Array} packetBytes - The packet bytes.
|
|
538
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
539
|
+
* @returns {Promise<TransactionInstruction | null>} A promise that resolves to the transaction instruction or null if not needed.
|
|
540
|
+
*/
|
|
541
|
+
async initVerify(
|
|
542
|
+
connection: Connection,
|
|
543
|
+
payer: PublicKey,
|
|
544
|
+
dvn: PublicKey,
|
|
545
|
+
packetBytes: Uint8Array,
|
|
546
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
547
|
+
): Promise<TransactionInstruction | null> {
|
|
548
|
+
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
549
|
+
const headerHash = packet.headerHash()
|
|
550
|
+
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
551
|
+
const payloadHash = packet.payloadHash()
|
|
552
|
+
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
553
|
+
const [confirmationsPDA] = this.deriver.confirmations(headerHashBytes, payloadHashBytes, dvn)
|
|
554
|
+
const confirmationsInfo = await connection.getAccountInfo(confirmationsPDA, commitmentOrConfig)
|
|
555
|
+
if (confirmationsInfo) {
|
|
556
|
+
// throw new Error('init verify already executed')
|
|
557
|
+
return null
|
|
558
|
+
}
|
|
559
|
+
return instructions.createInitVerifyInstruction(
|
|
560
|
+
{
|
|
561
|
+
payer,
|
|
562
|
+
confirmations: confirmationsPDA,
|
|
563
|
+
} satisfies instructions.InitVerifyInstructionAccounts,
|
|
564
|
+
{
|
|
565
|
+
params: {
|
|
566
|
+
packetHeader: Array.from(Uint8Array.from(Buffer.from(packet.header().slice(2), 'hex'))),
|
|
567
|
+
payloadHash: Array.from(payloadHashBytes),
|
|
568
|
+
dvn,
|
|
569
|
+
} satisfies types.InitVerifyParams,
|
|
570
|
+
} satisfies instructions.InitVerifyInstructionArgs,
|
|
571
|
+
this.program
|
|
572
|
+
)
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Verifies the packet.
|
|
577
|
+
*
|
|
578
|
+
* @param {PublicKey} dvn - The DVN public key.
|
|
579
|
+
* @param {Uint8Array} packetBytes - The packet bytes.
|
|
580
|
+
* @param {number | string} confirmations - The number of confirmations.
|
|
581
|
+
* @returns {TransactionInstruction} The transaction instruction.
|
|
582
|
+
*/
|
|
583
|
+
verify(dvn: PublicKey, packetBytes: Uint8Array, confirmations: number | string): TransactionInstruction {
|
|
584
|
+
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
585
|
+
const headerHash = packet.headerHash()
|
|
586
|
+
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
587
|
+
const payloadHash = packet.payloadHash()
|
|
588
|
+
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
589
|
+
const [confirmationsPDA] = this.deriver.confirmations(headerHashBytes, payloadHashBytes, dvn)
|
|
590
|
+
return instructions.createVerifyInstruction(
|
|
591
|
+
{
|
|
592
|
+
dvn,
|
|
593
|
+
confirmations: confirmationsPDA,
|
|
594
|
+
eventAuthority: this.eventAuthorityPDA,
|
|
595
|
+
program: this.program,
|
|
596
|
+
} satisfies instructions.VerifyInstructionAccounts,
|
|
597
|
+
{
|
|
598
|
+
params: {
|
|
599
|
+
packetHeader: Array.from(Uint8Array.from(Buffer.from(packet.header().slice(2), 'hex'))),
|
|
600
|
+
payloadHash: Array.from(payloadHashBytes),
|
|
601
|
+
confirmations: typeof confirmations === 'string' ? new BN(confirmations) : confirmations,
|
|
602
|
+
} satisfies types.VerifyParams,
|
|
603
|
+
} satisfies instructions.VerifyInstructionArgs,
|
|
604
|
+
this.program
|
|
605
|
+
)
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Closes the verification process.
|
|
610
|
+
*
|
|
611
|
+
* @param {PublicKey} dvn - The DVN public key.
|
|
612
|
+
* @param {PublicKey} receiver - The receiver public key.
|
|
613
|
+
* @param {Uint8Array} packetBytes - The packet bytes.
|
|
614
|
+
* @returns {TransactionInstruction} The transaction instruction.
|
|
615
|
+
*/
|
|
616
|
+
closeVerify(dvn: PublicKey, receiver: PublicKey, packetBytes: Uint8Array): TransactionInstruction {
|
|
617
|
+
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
618
|
+
const headerHash = packet.headerHash()
|
|
619
|
+
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
620
|
+
const payloadHash = packet.payloadHash()
|
|
621
|
+
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
622
|
+
const [confirmationsPDA] = this.deriver.confirmations(headerHashBytes, payloadHashBytes, dvn)
|
|
623
|
+
return instructions.createCloseVerifyInstruction(
|
|
624
|
+
{
|
|
625
|
+
dvn,
|
|
626
|
+
receiver,
|
|
627
|
+
confirmations: confirmationsPDA,
|
|
628
|
+
} satisfies instructions.CloseVerifyInstructionAccounts,
|
|
629
|
+
{
|
|
630
|
+
params: {
|
|
631
|
+
packetHeaderHash: Array.from(headerHashBytes),
|
|
632
|
+
payloadHash: Array.from(payloadHashBytes),
|
|
633
|
+
} satisfies types.CloseVerifyParams,
|
|
634
|
+
} satisfies instructions.CloseVerifyInstructionArgs,
|
|
635
|
+
this.program
|
|
636
|
+
)
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Checks if the DVN is verified.
|
|
641
|
+
*
|
|
642
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
643
|
+
* @param {PublicKey} endpointProgram - The endpoint program public key.
|
|
644
|
+
* @param {PublicKey} dvn - The DVN public key.
|
|
645
|
+
* @param {Uint8Array} packetBytes - The packet bytes.
|
|
646
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig='confirmed'] - The commitment level or account info configuration.
|
|
647
|
+
* @returns {Promise<boolean>} A promise that resolves to true if the DVN is verified, false otherwise.
|
|
648
|
+
*/
|
|
649
|
+
async isDvnVerified(
|
|
650
|
+
connection: Connection,
|
|
651
|
+
endpointProgram: PublicKey,
|
|
652
|
+
dvn: PublicKey,
|
|
653
|
+
packetBytes: Uint8Array,
|
|
654
|
+
commitmentOrConfig: Commitment | GetAccountInfoConfig = 'confirmed'
|
|
655
|
+
): Promise<boolean> {
|
|
656
|
+
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
657
|
+
const headerHash = packet.headerHash()
|
|
658
|
+
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
659
|
+
const payloadHash = packet.payloadHash()
|
|
660
|
+
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
661
|
+
const [confirmationsPDA] = this.deriver.confirmations(headerHashBytes, payloadHashBytes, dvn)
|
|
662
|
+
const endpoint = new EndpointProgram.Endpoint(endpointProgram)
|
|
663
|
+
const receiver = new PublicKey(arrayify(packet.receiver()))
|
|
664
|
+
const sender = arrayify(packet.sender())
|
|
665
|
+
const nonce = await endpoint.getNonce(connection, receiver, packet.srcEid(), sender, commitmentOrConfig)
|
|
666
|
+
const pendingNonce = await endpoint.getPendingInboundNonce(
|
|
667
|
+
connection,
|
|
668
|
+
receiver,
|
|
669
|
+
packet.srcEid(),
|
|
670
|
+
sender,
|
|
671
|
+
commitmentOrConfig
|
|
672
|
+
)
|
|
673
|
+
if (!nonce || !pendingNonce) {
|
|
674
|
+
return false
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
// after lzReceive, the inboundNonce is increased by 1
|
|
678
|
+
if (parseInt(nonce.inboundNonce.toString()) >= parseInt(packet.nonce())) {
|
|
679
|
+
return true
|
|
680
|
+
}
|
|
681
|
+
// after commitVerification, the nonce is added to pendingNonce
|
|
682
|
+
if (pendingNonce.nonces.find((n) => n.toString() === packet.nonce()) !== undefined) {
|
|
683
|
+
return true
|
|
684
|
+
}
|
|
685
|
+
try {
|
|
686
|
+
// before commitVerification, should call initVerify and verify
|
|
687
|
+
const confirmation = await accounts.Confirmations.fromAccountAddress(
|
|
688
|
+
connection,
|
|
689
|
+
confirmationsPDA,
|
|
690
|
+
commitmentOrConfig
|
|
691
|
+
)
|
|
692
|
+
if (confirmation.value === null) {
|
|
693
|
+
// initial value is null
|
|
694
|
+
// not verified
|
|
695
|
+
return false
|
|
696
|
+
} else {
|
|
697
|
+
// TODO check confirmation value
|
|
698
|
+
return true
|
|
699
|
+
}
|
|
700
|
+
} catch (e: unknown) {
|
|
701
|
+
// don't invoke initVerify
|
|
702
|
+
return false
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* Commits the verification process.
|
|
708
|
+
*
|
|
709
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
710
|
+
* @param {PublicKey} endpointProgram - The endpoint program public key.
|
|
711
|
+
* @param {Uint8Array} packetBytes - The packet bytes.
|
|
712
|
+
* @returns {Promise<TransactionInstruction>} A promise that resolves to the transaction instruction.
|
|
713
|
+
*/
|
|
714
|
+
async commitVerification(
|
|
715
|
+
connection: Connection,
|
|
716
|
+
endpointProgram: PublicKey,
|
|
717
|
+
packetBytes: Uint8Array
|
|
718
|
+
): Promise<TransactionInstruction> {
|
|
719
|
+
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
720
|
+
const payloadHash = packet.payloadHash()
|
|
721
|
+
const srcEid = packet.srcEid()
|
|
722
|
+
const receiver = new PublicKey(arrayify(packet.receiver()))
|
|
723
|
+
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
724
|
+
const [defaultReceiveConfig] = this.deriver.defaultReceiveConfig(srcEid)
|
|
725
|
+
const [receiveConfig] = this.deriver.receiveConfig(srcEid, receiver)
|
|
726
|
+
const [setting] = this.deriver.setting()
|
|
727
|
+
const [msgLib] = this.deriver.messageLib()
|
|
728
|
+
const receiveConfigState = await this.getFinalReceiveConfigState(connection, receiver, srcEid)
|
|
729
|
+
|
|
730
|
+
const headerHash = packet.headerHash()
|
|
731
|
+
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
732
|
+
|
|
733
|
+
const confirmations: AccountMeta[] = receiveConfigState.uln.requiredDvns
|
|
734
|
+
.concat(receiveConfigState.uln.optionalDvns)
|
|
735
|
+
.map((p) => {
|
|
736
|
+
const [confirmationsPDA] = this.deriver.confirmations(headerHashBytes, payloadHashBytes, p)
|
|
737
|
+
return {
|
|
738
|
+
pubkey: confirmationsPDA,
|
|
739
|
+
isSigner: false,
|
|
740
|
+
isWritable: true,
|
|
741
|
+
}
|
|
742
|
+
})
|
|
743
|
+
const endpoint = new EndpointProgram.Endpoint(endpointProgram)
|
|
744
|
+
const verifyAccounts = endpoint.getVerifyIXAccountMetaForCPI(packet, msgLib)
|
|
745
|
+
|
|
746
|
+
return instructions.createCommitVerificationInstruction(
|
|
747
|
+
{
|
|
748
|
+
uln: setting,
|
|
749
|
+
defaultReceiveConfig,
|
|
750
|
+
receiveConfig,
|
|
751
|
+
anchorRemainingAccounts: confirmations.concat(verifyAccounts),
|
|
752
|
+
} satisfies instructions.CommitVerificationInstructionAccounts,
|
|
753
|
+
{
|
|
754
|
+
params: {
|
|
755
|
+
packetHeader: Array.from(arrayify(packet.header())),
|
|
756
|
+
payloadHash: Array.from(payloadHashBytes),
|
|
757
|
+
} satisfies types.CommitVerificationParams,
|
|
758
|
+
} satisfies instructions.CommitVerificationInstructionArgs,
|
|
759
|
+
this.program
|
|
760
|
+
)
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Gets the account metadata for the CPI (Cross-Program Invocation) of the init config instruction.
|
|
765
|
+
*
|
|
766
|
+
* @param {PublicKey} payer - The payer public key.
|
|
767
|
+
* @param {PublicKey} oappID - The OApp ID public key.
|
|
768
|
+
* @param {number} eid - The endpoint ID.
|
|
769
|
+
* @returns {AccountMeta[]} An array of account metadata.
|
|
770
|
+
*/
|
|
771
|
+
getInitConfigIXAccountMetaForCPI(payer: PublicKey, oappID: PublicKey, eid: number): AccountMeta[] {
|
|
772
|
+
const [sendConfig] = this.deriver.sendConfig(eid, oappID)
|
|
773
|
+
const [receiveConfig] = this.deriver.receiveConfig(eid, oappID)
|
|
774
|
+
const [setting] = this.deriver.setting()
|
|
775
|
+
|
|
776
|
+
const accounts = instructions.createInitConfigInstructionAccounts(
|
|
777
|
+
{
|
|
778
|
+
endpoint: PublicKey.default, // useless
|
|
779
|
+
payer,
|
|
780
|
+
uln: setting,
|
|
781
|
+
sendConfig,
|
|
782
|
+
receiveConfig,
|
|
783
|
+
} satisfies instructions.InitConfigInstructionAccounts,
|
|
784
|
+
this.program
|
|
785
|
+
)
|
|
786
|
+
accounts.forEach((key) => {
|
|
787
|
+
if (!payer.equals(key.pubkey)) {
|
|
788
|
+
key.isSigner = false
|
|
789
|
+
}
|
|
790
|
+
})
|
|
791
|
+
return accounts.slice(1)
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Constructs the set config data.
|
|
796
|
+
*
|
|
797
|
+
* @param {SetConfigType} configType - The configuration type.
|
|
798
|
+
* @param {types.ExecutorConfig | types.UlnConfig} configData - The configuration data.
|
|
799
|
+
* @returns {Uint8Array} The constructed set config data.
|
|
800
|
+
* @throws {Error} If the configuration type is invalid.
|
|
801
|
+
*/
|
|
802
|
+
static constructSetConfigData(
|
|
803
|
+
configType: SetConfigType,
|
|
804
|
+
configData: types.ExecutorConfig | types.UlnConfig
|
|
805
|
+
): Uint8Array {
|
|
806
|
+
switch (configType) {
|
|
807
|
+
case SetConfigType.EXECUTOR: {
|
|
808
|
+
const [data] = types.executorConfigBeet.serialize(configData as types.ExecutorConfig)
|
|
809
|
+
return Uint8Array.from(data)
|
|
810
|
+
}
|
|
811
|
+
case SetConfigType.SEND_ULN:
|
|
812
|
+
case SetConfigType.RECEIVE_ULN: {
|
|
813
|
+
const [data] = types.ulnConfigBeet.serialize(configData as types.UlnConfig)
|
|
814
|
+
return Uint8Array.from(data)
|
|
815
|
+
}
|
|
816
|
+
default:
|
|
817
|
+
throw new Error(`invalid config type: ${configType as number}`)
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Gets the account metadata for the CPI (Cross-Program Invocation) of the set config instruction.
|
|
823
|
+
*
|
|
824
|
+
* @param {PublicKey} endpointProgram - The endpoint program public key.
|
|
825
|
+
* @param {PublicKey} oappID - The OApp ID public key.
|
|
826
|
+
* @param {number} eid - The endpoint ID.
|
|
827
|
+
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
828
|
+
*/
|
|
829
|
+
async getSetConfigIXAccountMetaForCPI(
|
|
830
|
+
endpointProgram: PublicKey,
|
|
831
|
+
oappID: PublicKey,
|
|
832
|
+
eid: number
|
|
833
|
+
): Promise<AccountMeta[]> {
|
|
834
|
+
const [sendConfig] = this.deriver.sendConfig(eid, oappID)
|
|
835
|
+
const [receiveConfig] = this.deriver.receiveConfig(eid, oappID)
|
|
836
|
+
const [defaultSendConfig] = this.deriver.defaultSendConfig(eid)
|
|
837
|
+
const [defaultReceiveConfig] = this.deriver.defaultReceiveConfig(eid)
|
|
838
|
+
const [setting] = this.deriver.setting()
|
|
839
|
+
const [msgLib] = this.deriver.messageLib()
|
|
840
|
+
const [msgLibInfo] = new EndpointPDADeriver(endpointProgram).messageLibraryInfo(msgLib)
|
|
841
|
+
|
|
842
|
+
const accounts = instructions.createSetConfigInstructionAccounts(
|
|
843
|
+
{
|
|
844
|
+
endpoint: msgLibInfo,
|
|
845
|
+
uln: setting,
|
|
846
|
+
sendConfig,
|
|
847
|
+
defaultSendConfig,
|
|
848
|
+
defaultReceiveConfig,
|
|
849
|
+
receiveConfig,
|
|
850
|
+
eventAuthority: this.eventAuthorityPDA,
|
|
851
|
+
program: this.program,
|
|
852
|
+
} satisfies instructions.SetConfigInstructionAccounts,
|
|
853
|
+
this.program
|
|
854
|
+
)
|
|
855
|
+
return Promise.resolve(accounts.slice(1))
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
//
|
|
859
|
+
// all of below functions are retrieving accounts state
|
|
860
|
+
/**
|
|
861
|
+
* Gets the ULN settings.
|
|
862
|
+
*
|
|
863
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
864
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
865
|
+
* @returns {Promise<accounts.UlnSettings | null>} A promise that resolves to the ULN settings or null if not found.
|
|
866
|
+
*/
|
|
867
|
+
async getSetting(
|
|
868
|
+
connection: Connection,
|
|
869
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
870
|
+
): Promise<accounts.UlnSettings | null> {
|
|
871
|
+
const [setting] = this.deriver.setting()
|
|
872
|
+
try {
|
|
873
|
+
return await accounts.UlnSettings.fromAccountAddress(connection, setting, commitmentOrConfig)
|
|
874
|
+
} catch (e) {
|
|
875
|
+
return null
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Gets the default send configuration state.
|
|
881
|
+
*
|
|
882
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
883
|
+
* @param {number} eid - The endpoint ID.
|
|
884
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
885
|
+
* @returns {Promise<accounts.SendConfig | null>} A promise that resolves to the default send configuration state or null if not found.
|
|
886
|
+
*/
|
|
887
|
+
async getDefaultSendConfigState(
|
|
888
|
+
connection: Connection,
|
|
889
|
+
eid: number,
|
|
890
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
891
|
+
): Promise<accounts.SendConfig | null> {
|
|
892
|
+
const [config] = this.deriver.defaultSendConfig(eid)
|
|
893
|
+
try {
|
|
894
|
+
return await accounts.SendConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
895
|
+
} catch (e) {
|
|
896
|
+
return null
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Gets the send configuration state.
|
|
902
|
+
*
|
|
903
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
904
|
+
* @param {PublicKey} sender - The sender public key.
|
|
905
|
+
* @param {number} eid - The endpoint ID.
|
|
906
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
907
|
+
* @returns {Promise<accounts.SendConfig | null>} A promise that resolves to the send configuration state or null if not found.
|
|
908
|
+
*/
|
|
909
|
+
async getSendConfigState(
|
|
910
|
+
connection: Connection,
|
|
911
|
+
sender: PublicKey,
|
|
912
|
+
eid: number,
|
|
913
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
914
|
+
): Promise<accounts.SendConfig | null> {
|
|
915
|
+
const [config] = this.deriver.sendConfig(eid, sender)
|
|
916
|
+
try {
|
|
917
|
+
return await accounts.SendConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
918
|
+
} catch (e) {
|
|
919
|
+
return null
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Gets the default receive configuration state.
|
|
925
|
+
*
|
|
926
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
927
|
+
* @param {number} eid - The endpoint ID.
|
|
928
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
929
|
+
* @returns {Promise<accounts.ReceiveConfig | null>} A promise that resolves to the default receive configuration state or null if not found.
|
|
930
|
+
*/
|
|
931
|
+
async getDefaultReceiveConfigState(
|
|
932
|
+
connection: Connection,
|
|
933
|
+
eid: number,
|
|
934
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
935
|
+
): Promise<accounts.ReceiveConfig | null> {
|
|
936
|
+
const [config] = this.deriver.defaultReceiveConfig(eid)
|
|
937
|
+
try {
|
|
938
|
+
return await accounts.ReceiveConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
939
|
+
} catch (e) {
|
|
940
|
+
return null
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Gets the receive configuration state.
|
|
946
|
+
*
|
|
947
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
948
|
+
* @param {PublicKey} receiver - The receiver public key.
|
|
949
|
+
* @param {number} eid - The endpoint ID.
|
|
950
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig] - The commitment level or account info configuration.
|
|
951
|
+
* @returns {Promise<accounts.ReceiveConfig | null>} A promise that resolves to the receive configuration state or null if not found.
|
|
952
|
+
*/
|
|
953
|
+
async getReceiveConfigState(
|
|
954
|
+
connection: Connection,
|
|
955
|
+
receiver: PublicKey,
|
|
956
|
+
eid: number,
|
|
957
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
958
|
+
): Promise<accounts.ReceiveConfig | null> {
|
|
959
|
+
const [config] = this.deriver.receiveConfig(eid, receiver)
|
|
960
|
+
try {
|
|
961
|
+
return await accounts.ReceiveConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
962
|
+
} catch (e) {
|
|
963
|
+
return null
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Gets the final receive configuration state.
|
|
969
|
+
*
|
|
970
|
+
* @param {Connection} connection - The connection to the Solana cluster.
|
|
971
|
+
* @param {PublicKey} receiver - The receiver public key.
|
|
972
|
+
* @param {number} eid - The endpoint ID.
|
|
973
|
+
* @param {Commitment | GetAccountInfoConfig} [commitmentOrConfig='confirmed'] - The commitment level or account info configuration.
|
|
974
|
+
* @returns {Promise<accounts.ReceiveConfig>} A promise that resolves to the final receive configuration state.
|
|
975
|
+
* @throws {Error} If no DVN is found.
|
|
976
|
+
*/
|
|
977
|
+
async getFinalReceiveConfigState(
|
|
978
|
+
connection: Connection,
|
|
979
|
+
receiver: PublicKey,
|
|
980
|
+
eid: number,
|
|
981
|
+
commitmentOrConfig: Commitment | GetAccountInfoConfig = 'confirmed'
|
|
982
|
+
): Promise<accounts.ReceiveConfig> {
|
|
983
|
+
const NIL_CONFIRMATIONS = '18446744073709551615' // max u64
|
|
984
|
+
const NIL_DVN_COUNT = '255'
|
|
985
|
+
|
|
986
|
+
const rtn_config: types.UlnConfig = {
|
|
987
|
+
confirmations: 0,
|
|
988
|
+
requiredDvnCount: 0,
|
|
989
|
+
optionalDvnCount: 0,
|
|
990
|
+
optionalDvnThreshold: 0,
|
|
991
|
+
requiredDvns: [],
|
|
992
|
+
optionalDvns: [],
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
const [defaultConfig] = this.deriver.defaultReceiveConfig(eid)
|
|
996
|
+
const [customConfig] = this.deriver.receiveConfig(eid, receiver)
|
|
997
|
+
|
|
998
|
+
const [defaultConfigInfo, customConfigInfo] = await connection.getMultipleAccountsInfo(
|
|
999
|
+
[defaultConfig, customConfig],
|
|
1000
|
+
commitmentOrConfig
|
|
1001
|
+
)
|
|
1002
|
+
if (defaultConfigInfo == null) {
|
|
1003
|
+
throw new Error(`please init default receive config first. ${defaultConfig.toBase58()}`)
|
|
1004
|
+
}
|
|
1005
|
+
const defaultConfigState = accounts.ReceiveConfig.fromAccountInfo(defaultConfigInfo)[0]
|
|
1006
|
+
const customConfigState = customConfigInfo ? accounts.ReceiveConfig.fromAccountInfo(customConfigInfo)[0] : null
|
|
1007
|
+
|
|
1008
|
+
if (customConfigState == null || customConfigState.uln.confirmations == 0) {
|
|
1009
|
+
rtn_config.confirmations = defaultConfigState.uln.confirmations
|
|
1010
|
+
} else if (customConfigState.uln.confirmations.toString() !== NIL_CONFIRMATIONS) {
|
|
1011
|
+
rtn_config.confirmations = customConfigState.uln.confirmations
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
if (customConfigState == null || customConfigState.uln.requiredDvnCount == 0) {
|
|
1015
|
+
if (defaultConfigState.uln.requiredDvnCount > 0) {
|
|
1016
|
+
rtn_config.requiredDvns = defaultConfigState.uln.requiredDvns
|
|
1017
|
+
rtn_config.requiredDvnCount = defaultConfigState.uln.requiredDvnCount
|
|
1018
|
+
}
|
|
1019
|
+
} else if (customConfigState.uln.requiredDvnCount.toString() !== NIL_DVN_COUNT) {
|
|
1020
|
+
rtn_config.requiredDvns = customConfigState.uln.requiredDvns
|
|
1021
|
+
rtn_config.requiredDvnCount = customConfigState.uln.requiredDvnCount
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
if (customConfigState == null || customConfigState.uln.optionalDvnCount == 0) {
|
|
1025
|
+
if (defaultConfigState.uln.optionalDvnCount > 0) {
|
|
1026
|
+
rtn_config.optionalDvns = defaultConfigState.uln.optionalDvns
|
|
1027
|
+
rtn_config.optionalDvnCount = defaultConfigState.uln.optionalDvnCount
|
|
1028
|
+
rtn_config.optionalDvnThreshold = defaultConfigState.uln.optionalDvnThreshold
|
|
1029
|
+
}
|
|
1030
|
+
} else if (customConfigState.uln.optionalDvnCount.toString() !== NIL_DVN_COUNT) {
|
|
1031
|
+
rtn_config.optionalDvns = customConfigState.uln.optionalDvns
|
|
1032
|
+
rtn_config.optionalDvnCount = customConfigState.uln.optionalDvnCount
|
|
1033
|
+
rtn_config.optionalDvnThreshold = customConfigState.uln.optionalDvnThreshold
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
if (rtn_config.requiredDvnCount === 0 && rtn_config.optionalDvnCount === 0) {
|
|
1037
|
+
throw new Error('no dvn')
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
return accounts.ReceiveConfig.fromArgs({
|
|
1041
|
+
bump: defaultConfigState.bump,
|
|
1042
|
+
uln: rtn_config,
|
|
1043
|
+
})
|
|
1044
|
+
}
|
|
1045
|
+
}
|