@layerzerolabs/lz-solana-sdk-v2 3.0.53 → 3.0.56
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 +41 -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
package/src/uln.ts
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AccountMeta,
|
|
3
|
+
Cluster,
|
|
4
|
+
ClusterFilter,
|
|
3
5
|
Commitment,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
Option,
|
|
7
|
+
Program,
|
|
8
|
+
ProgramError,
|
|
9
|
+
ProgramRepositoryInterface,
|
|
6
10
|
PublicKey,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
RpcInterface,
|
|
12
|
+
Signer,
|
|
13
|
+
WrappedInstruction,
|
|
14
|
+
createNoopSigner,
|
|
15
|
+
createNullRpc,
|
|
16
|
+
defaultPublicKey,
|
|
17
|
+
isSome,
|
|
18
|
+
publicKey,
|
|
19
|
+
} from '@metaplex-foundation/umi'
|
|
20
|
+
import { createDefaultProgramRepository } from '@metaplex-foundation/umi-program-repository'
|
|
21
|
+
import { fromWeb3JsPublicKey } from '@metaplex-foundation/umi-web3js-adapters'
|
|
22
|
+
import { TOKEN_PROGRAM_ID } from '@solana/spl-token'
|
|
10
23
|
import invariant from 'tiny-invariant'
|
|
11
24
|
|
|
12
25
|
import { arrayify } from '@layerzerolabs/lz-utilities'
|
|
@@ -14,15 +27,17 @@ import { PacketV1Codec } from '@layerzerolabs/lz-v2-utilities'
|
|
|
14
27
|
|
|
15
28
|
import { EndpointProgram, MessageLibInterface, SetConfigType, SolanaPacketPath } from '.'
|
|
16
29
|
import { DVN, accounts as DvnAccounts } from './dvn'
|
|
30
|
+
import { ENDPOINT_PROGRAM_ID } from './endpoint'
|
|
17
31
|
import { Executor, accounts as ExecutorAccounts } from './executor'
|
|
18
|
-
import
|
|
19
|
-
import * as
|
|
20
|
-
import * as
|
|
21
|
-
import * as
|
|
22
|
-
import * as
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
import { ULN_PROGRAM_ID } from './generated/kinobi/uln'
|
|
33
|
+
import * as accounts from './generated/kinobi/uln/accounts'
|
|
34
|
+
import * as errors from './generated/kinobi/uln/errors'
|
|
35
|
+
import * as events from './generated/kinobi/uln/events'
|
|
36
|
+
import * as instructions from './generated/kinobi/uln/instructions'
|
|
37
|
+
import * as types from './generated/kinobi/uln/types'
|
|
38
|
+
import { EndpointPDA, EventPDA, UlnPDA } from './pda'
|
|
39
|
+
|
|
40
|
+
export { ULN_PROGRAM_ID } from './generated/kinobi/uln'
|
|
26
41
|
export { accounts, instructions, types, events, errors }
|
|
27
42
|
|
|
28
43
|
/**
|
|
@@ -120,53 +135,63 @@ export interface OptionalOracles {
|
|
|
120
135
|
* @see {@link MessageLibInterface}
|
|
121
136
|
*/
|
|
122
137
|
export class Uln implements MessageLibInterface {
|
|
123
|
-
|
|
124
|
-
|
|
138
|
+
public readonly pda: UlnPDA
|
|
139
|
+
public readonly programRepo: ProgramRepositoryInterface
|
|
140
|
+
public readonly eventAuthority: PublicKey
|
|
125
141
|
|
|
126
142
|
/**
|
|
127
143
|
* Creates an instance of the Uln class.
|
|
128
144
|
*
|
|
129
|
-
* @param {PublicKey}
|
|
145
|
+
* @param {PublicKey} programId - The program public key.
|
|
130
146
|
*/
|
|
131
|
-
constructor(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
147
|
+
constructor(
|
|
148
|
+
public programId: PublicKey = ULN_PROGRAM_ID,
|
|
149
|
+
rpc?: RpcInterface
|
|
150
|
+
) {
|
|
151
|
+
this.pda = new UlnPDA(programId)
|
|
152
|
+
if (rpc === undefined) {
|
|
153
|
+
rpc = createNullRpc()
|
|
154
|
+
rpc.getCluster = (): Cluster => 'custom'
|
|
155
|
+
}
|
|
156
|
+
this.programRepo = createDefaultProgramRepository({ rpc }, [
|
|
157
|
+
{
|
|
158
|
+
name: 'uln',
|
|
159
|
+
publicKey: programId,
|
|
160
|
+
getErrorFromCode(code: number, cause?: Error): ProgramError | null {
|
|
161
|
+
return errors.getUlnErrorFromCode(code, this, cause)
|
|
162
|
+
},
|
|
163
|
+
getErrorFromName(name: string, cause?: Error): ProgramError | null {
|
|
164
|
+
return errors.getUlnErrorFromName(name, this, cause)
|
|
165
|
+
},
|
|
166
|
+
isOnCluster(): boolean {
|
|
167
|
+
return true
|
|
168
|
+
},
|
|
169
|
+
} satisfies Program,
|
|
170
|
+
])
|
|
171
|
+
|
|
172
|
+
this.eventAuthority = new EventPDA(programId).eventAuthority()[0]
|
|
135
173
|
}
|
|
136
174
|
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
// }
|
|
175
|
+
getProgram(clusterFilter: ClusterFilter = 'custom'): Program {
|
|
176
|
+
return this.programRepo.get('uln', clusterFilter)
|
|
177
|
+
}
|
|
154
178
|
|
|
155
|
-
|
|
179
|
+
initUln(payer: Signer, param: { admin: PublicKey; eid: number; endpointProgram?: PublicKey }): WrappedInstruction {
|
|
180
|
+
const { admin, eid, endpointProgram } = param
|
|
181
|
+
const [msgLib] = this.pda.messageLib()
|
|
182
|
+
const [endpointAuth] = new EndpointPDA(endpointProgram ?? ENDPOINT_PROGRAM_ID).messageLibraryInfo(msgLib)
|
|
183
|
+
return instructions.initUln(
|
|
184
|
+
{ programs: this.programRepo, payer },
|
|
156
185
|
{
|
|
157
186
|
payer,
|
|
158
|
-
uln: setting,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
} satisfies types.InitUlnParams,
|
|
167
|
-
} satisfies instructions.InitUlnInstructionArgs,
|
|
168
|
-
this.program
|
|
169
|
-
)
|
|
187
|
+
uln: this.pda.setting(),
|
|
188
|
+
// param
|
|
189
|
+
eid,
|
|
190
|
+
admin,
|
|
191
|
+
endpoint: endpointAuth,
|
|
192
|
+
endpointProgram: endpointProgram ?? ENDPOINT_PROGRAM_ID,
|
|
193
|
+
}
|
|
194
|
+
).items[0]
|
|
170
195
|
}
|
|
171
196
|
|
|
172
197
|
/**
|
|
@@ -183,60 +208,60 @@ export class Uln implements MessageLibInterface {
|
|
|
183
208
|
* @returns {Promise<TransactionInstruction>} A promise that resolves to the transaction instruction.
|
|
184
209
|
*/
|
|
185
210
|
async initOrUpdateDefaultConfig(
|
|
186
|
-
|
|
187
|
-
admin:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
const [
|
|
197
|
-
const
|
|
198
|
-
|
|
211
|
+
rpc: RpcInterface,
|
|
212
|
+
admin: Signer,
|
|
213
|
+
param: {
|
|
214
|
+
remote: number
|
|
215
|
+
sendUlnConfig: Option<types.UlnConfig>
|
|
216
|
+
receiveUlnConfig: Option<types.UlnConfig>
|
|
217
|
+
executorConfig: Option<types.ExecutorConfig>
|
|
218
|
+
}
|
|
219
|
+
): Promise<WrappedInstruction> {
|
|
220
|
+
const { remote, sendUlnConfig, receiveUlnConfig, executorConfig } = param
|
|
221
|
+
const [setting] = this.pda.setting()
|
|
222
|
+
const [sendConfig] = this.pda.defaultSendConfig(remote)
|
|
223
|
+
const [receiveConfigPDA] = this.pda.defaultReceiveConfig(remote)
|
|
224
|
+
const sendConfigExists = await rpc.accountExists(sendConfig, { commitment: 'confirmed' })
|
|
225
|
+
if (sendConfigExists) {
|
|
199
226
|
// update default config
|
|
200
|
-
return instructions.
|
|
227
|
+
return instructions.setDefaultConfig(
|
|
228
|
+
{ programs: this.programRepo },
|
|
201
229
|
{
|
|
202
230
|
admin,
|
|
203
231
|
uln: setting,
|
|
204
|
-
sendConfig:
|
|
232
|
+
sendConfig: sendConfig,
|
|
205
233
|
receiveConfig: receiveConfigPDA,
|
|
206
|
-
eventAuthority: this.
|
|
207
|
-
program: this.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
} satisfies types.SetDefaultConfigParams,
|
|
216
|
-
} satisfies instructions.SetDefaultConfigInstructionArgs,
|
|
217
|
-
this.program
|
|
218
|
-
)
|
|
234
|
+
eventAuthority: this.eventAuthority,
|
|
235
|
+
program: this.programId,
|
|
236
|
+
// param
|
|
237
|
+
eid: remote,
|
|
238
|
+
sendUlnConfig,
|
|
239
|
+
receiveUlnConfig,
|
|
240
|
+
executorConfig,
|
|
241
|
+
}
|
|
242
|
+
).items[0]
|
|
219
243
|
} else {
|
|
244
|
+
invariant(isSome(sendUlnConfig), 'sendUlnConfig is required')
|
|
245
|
+
invariant(isSome(receiveUlnConfig), 'receiveUlnConfig is required')
|
|
246
|
+
invariant(isSome(executorConfig), 'executorConfig is required')
|
|
247
|
+
|
|
220
248
|
// init default config
|
|
221
|
-
return instructions.
|
|
249
|
+
return instructions.initDefaultConfig(
|
|
250
|
+
{ programs: this.programRepo },
|
|
222
251
|
{
|
|
223
252
|
admin,
|
|
224
253
|
uln: setting,
|
|
225
|
-
sendConfig:
|
|
254
|
+
sendConfig: sendConfig,
|
|
226
255
|
receiveConfig: receiveConfigPDA,
|
|
227
|
-
eventAuthority: this.
|
|
228
|
-
program: this.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
} satisfies types.InitDefaultConfigParams,
|
|
237
|
-
} satisfies instructions.InitDefaultConfigInstructionArgs,
|
|
238
|
-
this.program
|
|
239
|
-
)
|
|
256
|
+
eventAuthority: this.eventAuthority,
|
|
257
|
+
program: this.programId,
|
|
258
|
+
// param
|
|
259
|
+
eid: remote,
|
|
260
|
+
sendUlnConfig: sendUlnConfig.value,
|
|
261
|
+
receiveUlnConfig: receiveUlnConfig.value,
|
|
262
|
+
executorConfig: executorConfig.value,
|
|
263
|
+
}
|
|
264
|
+
).items[0]
|
|
240
265
|
}
|
|
241
266
|
}
|
|
242
267
|
|
|
@@ -255,103 +280,83 @@ export class Uln implements MessageLibInterface {
|
|
|
255
280
|
* @param {number} treasury.lzToken.fee - The LZ token fee.
|
|
256
281
|
* @returns {Promise<TransactionInstruction>} A promise that resolves to the transaction instruction.
|
|
257
282
|
*/
|
|
258
|
-
|
|
259
|
-
admin:
|
|
283
|
+
setTreasury(
|
|
284
|
+
admin: Signer,
|
|
260
285
|
treasury: {
|
|
261
286
|
admin: PublicKey
|
|
262
287
|
nativeReceiver: PublicKey
|
|
263
288
|
nativeFeeBps: number
|
|
264
289
|
lzToken: { receiver: PublicKey; fee: number } | null
|
|
265
290
|
} | null
|
|
266
|
-
):
|
|
267
|
-
|
|
268
|
-
|
|
291
|
+
): WrappedInstruction {
|
|
292
|
+
return instructions.setTreasury(
|
|
293
|
+
{ programs: this.programRepo },
|
|
269
294
|
{
|
|
270
295
|
signer: admin,
|
|
271
|
-
uln: setting,
|
|
272
|
-
eventAuthority: this.
|
|
273
|
-
program: this.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
} satisfies types.SetTreasuryParams,
|
|
279
|
-
} satisfies instructions.SetTreasuryInstructionArgs,
|
|
280
|
-
this.program
|
|
281
|
-
)
|
|
282
|
-
return Promise.resolve(ix)
|
|
296
|
+
uln: this.pda.setting(),
|
|
297
|
+
eventAuthority: this.eventAuthority,
|
|
298
|
+
program: this.programId,
|
|
299
|
+
// param
|
|
300
|
+
treasury,
|
|
301
|
+
}
|
|
302
|
+
).items[0]
|
|
283
303
|
}
|
|
284
304
|
|
|
285
|
-
|
|
286
|
-
|
|
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(
|
|
305
|
+
transferAdmin(admin: Signer, newAdmin: PublicKey): WrappedInstruction {
|
|
306
|
+
return instructions.transferAdmin(
|
|
307
|
+
{ programs: this.programRepo },
|
|
307
308
|
{
|
|
308
309
|
admin,
|
|
309
|
-
uln: setting,
|
|
310
|
-
eventAuthority: this.
|
|
311
|
-
program: this.
|
|
312
|
-
}
|
|
313
|
-
{
|
|
314
|
-
|
|
315
|
-
admin: newAdmin,
|
|
316
|
-
} satisfies types.TransferAdminParams,
|
|
317
|
-
} satisfies instructions.TransferAdminInstructionArgs,
|
|
318
|
-
this.program
|
|
319
|
-
)
|
|
310
|
+
uln: this.pda.setting(),
|
|
311
|
+
eventAuthority: this.eventAuthority,
|
|
312
|
+
program: this.programId,
|
|
313
|
+
},
|
|
314
|
+
{ admin: newAdmin }
|
|
315
|
+
).items[0]
|
|
320
316
|
}
|
|
321
317
|
|
|
322
318
|
/**
|
|
323
319
|
* Gets the account metadata for the CPI (Cross-Program Invocation) of the quote instruction.
|
|
324
320
|
*
|
|
325
|
-
* @param {
|
|
321
|
+
* @param {RpcInterface} rpc - The connection to the Solana cluster.
|
|
326
322
|
* @param {PublicKey} _payer - The payer public key.
|
|
327
|
-
* @param {
|
|
323
|
+
* @param {SolanaPacketPath} path - The packet path.
|
|
328
324
|
* @param {Commitment} [commitment] - The commitment level.
|
|
329
325
|
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
330
326
|
*/
|
|
331
327
|
async getQuoteIXAccountMetaForCPI(
|
|
332
|
-
|
|
328
|
+
rpc: RpcInterface,
|
|
333
329
|
_payer: PublicKey,
|
|
334
330
|
path: SolanaPacketPath,
|
|
335
|
-
commitment
|
|
331
|
+
commitment: Commitment = 'confirmed'
|
|
336
332
|
): Promise<AccountMeta[]> {
|
|
337
|
-
const { sender
|
|
338
|
-
const sender =
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
const [setting] = this.deriver.setting()
|
|
342
|
-
|
|
343
|
-
const remainingAccounts = await this.getSendIxRemainingAccounts(connection, sender, dstEid, false, commitment)
|
|
344
|
-
const accounts = instructions.createQuoteInstructionAccounts(
|
|
333
|
+
const { sender, dstEid } = path
|
|
334
|
+
// const sender = publicKey(arrayify(sender_))
|
|
335
|
+
const txBuilder = instructions.quote(
|
|
336
|
+
{ programs: this.programRepo },
|
|
345
337
|
{
|
|
346
|
-
endpoint:
|
|
347
|
-
uln: setting,
|
|
348
|
-
sendConfig,
|
|
349
|
-
defaultSendConfig: defaultSendConfig,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
338
|
+
endpoint: createNoopSigner(defaultPublicKey()),
|
|
339
|
+
uln: this.pda.setting(),
|
|
340
|
+
sendConfig: this.pda.sendConfig(dstEid, sender),
|
|
341
|
+
defaultSendConfig: this.pda.defaultSendConfig(dstEid),
|
|
342
|
+
|
|
343
|
+
packet: {
|
|
344
|
+
nonce: 0,
|
|
345
|
+
srcEid: 0,
|
|
346
|
+
sender: defaultPublicKey(),
|
|
347
|
+
dstEid: 0,
|
|
348
|
+
receiver: new Uint8Array(32),
|
|
349
|
+
guid: new Uint8Array(32),
|
|
350
|
+
message: new Uint8Array(4),
|
|
351
|
+
},
|
|
352
|
+
options: new Uint8Array(4),
|
|
353
|
+
payInLzToken: false,
|
|
354
|
+
}
|
|
353
355
|
)
|
|
354
|
-
return
|
|
356
|
+
return txBuilder
|
|
357
|
+
.addRemainingAccounts(await this.getSendIxRemainingAccounts(rpc, sender, dstEid, false, commitment))
|
|
358
|
+
.getInstructions()[0]
|
|
359
|
+
.keys.slice(1)
|
|
355
360
|
}
|
|
356
361
|
|
|
357
362
|
/**
|
|
@@ -364,47 +369,132 @@ export class Uln implements MessageLibInterface {
|
|
|
364
369
|
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
365
370
|
*/
|
|
366
371
|
async getSendIXAccountMetaForCPI(
|
|
367
|
-
|
|
372
|
+
rpc: RpcInterface,
|
|
368
373
|
payer: PublicKey,
|
|
369
374
|
path: SolanaPacketPath,
|
|
370
375
|
commitment: Commitment = 'confirmed'
|
|
371
376
|
): Promise<AccountMeta[]> {
|
|
372
|
-
const { sender
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
377
|
+
const { sender, dstEid } = path
|
|
378
|
+
|
|
379
|
+
const ulnState = await this.getSetting(rpc, commitment)
|
|
380
|
+
let treasury: PublicKey | undefined
|
|
381
|
+
if (ulnState !== null && isSome(ulnState.treasury)) {
|
|
382
|
+
treasury = ulnState.treasury.value.nativeReceiver
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
let txBuilder = instructions.send(
|
|
386
|
+
{ payer: createNoopSigner(payer), programs: this.programRepo },
|
|
382
387
|
{
|
|
383
|
-
endpoint:
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
+
endpoint: createNoopSigner(defaultPublicKey()),
|
|
389
|
+
payer: createNoopSigner(payer),
|
|
390
|
+
uln: this.pda.setting(),
|
|
391
|
+
sendConfig: this.pda.sendConfig(dstEid, sender),
|
|
392
|
+
defaultSendConfig: this.pda.defaultSendConfig(dstEid),
|
|
388
393
|
treasury,
|
|
389
|
-
eventAuthority: this.
|
|
390
|
-
program: this.
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
+
eventAuthority: this.eventAuthority,
|
|
395
|
+
program: this.programId,
|
|
396
|
+
|
|
397
|
+
// param
|
|
398
|
+
packet: {
|
|
399
|
+
nonce: 0,
|
|
400
|
+
srcEid: 0,
|
|
401
|
+
sender: defaultPublicKey(),
|
|
402
|
+
dstEid: 0,
|
|
403
|
+
receiver: new Uint8Array(32),
|
|
404
|
+
guid: new Uint8Array(32),
|
|
405
|
+
message: new Uint8Array(4),
|
|
406
|
+
},
|
|
407
|
+
options: new Uint8Array(4),
|
|
408
|
+
nativeFee: 0,
|
|
409
|
+
}
|
|
394
410
|
)
|
|
395
|
-
|
|
396
|
-
|
|
411
|
+
txBuilder = txBuilder.addRemainingAccounts(
|
|
412
|
+
await this.getSendIxRemainingAccounts(rpc, sender, dstEid, true, commitment)
|
|
413
|
+
)
|
|
414
|
+
const accounts = txBuilder.getInstructions()[0].keys.map((key) => {
|
|
415
|
+
if (payer !== key.pubkey) {
|
|
397
416
|
key.isSigner = false
|
|
398
417
|
}
|
|
418
|
+
if (treasury !== undefined && key.pubkey === treasury) {
|
|
419
|
+
key.isWritable = true
|
|
420
|
+
}
|
|
421
|
+
return key
|
|
399
422
|
})
|
|
400
|
-
|
|
401
|
-
if (treasury) {
|
|
402
|
-
const treasuryIndex = accounts.findIndex((k) => k.pubkey.toBase58() == treasury.toBase58())
|
|
403
|
-
accounts[treasuryIndex].isWritable = true // treasury account
|
|
404
|
-
}
|
|
405
423
|
return accounts.slice(1)
|
|
406
424
|
}
|
|
407
425
|
|
|
426
|
+
/***
|
|
427
|
+
* Get the account meta of the send instruction for CPI(Cross-Program Invocation ) with lzToken
|
|
428
|
+
*/
|
|
429
|
+
async getSendWithLzTokenIXAccountMetaForCPI(
|
|
430
|
+
rpc: RpcInterface,
|
|
431
|
+
accounts: {
|
|
432
|
+
payer: PublicKey
|
|
433
|
+
tokenMint: PublicKey
|
|
434
|
+
tokenSource: PublicKey
|
|
435
|
+
},
|
|
436
|
+
path: SolanaPacketPath,
|
|
437
|
+
programs: {
|
|
438
|
+
tokenProgram?: PublicKey
|
|
439
|
+
associatedTokenProgram?: PublicKey
|
|
440
|
+
},
|
|
441
|
+
commitment: Commitment = 'confirmed'
|
|
442
|
+
): Promise<AccountMeta[]> {
|
|
443
|
+
const { payer, tokenMint, tokenSource } = accounts
|
|
444
|
+
const { sender, dstEid } = path
|
|
445
|
+
|
|
446
|
+
const ulnState = await this.getSetting(rpc, commitment)
|
|
447
|
+
invariant(ulnState !== null, 'ULN not initialized')
|
|
448
|
+
invariant(isSome(ulnState.treasury), 'treasury not set')
|
|
449
|
+
invariant(isSome(ulnState.treasury.value.lzToken), 'lzToken treasury not set')
|
|
450
|
+
const lzTokenTreasury = ulnState.treasury.value.lzToken.value.receiver
|
|
451
|
+
|
|
452
|
+
let txBuilder = instructions.sendWithLzToken(
|
|
453
|
+
{ payer: createNoopSigner(payer), programs: this.programRepo },
|
|
454
|
+
{
|
|
455
|
+
endpoint: createNoopSigner(defaultPublicKey()),
|
|
456
|
+
payer: createNoopSigner(payer),
|
|
457
|
+
uln: this.pda.setting(),
|
|
458
|
+
sendConfig: this.pda.sendConfig(dstEid, sender),
|
|
459
|
+
defaultSendConfig: this.pda.defaultSendConfig(dstEid),
|
|
460
|
+
lzTokenTreasury,
|
|
461
|
+
eventAuthority: this.eventAuthority,
|
|
462
|
+
program: this.programId,
|
|
463
|
+
lzTokenSource: tokenSource,
|
|
464
|
+
lzTokenMint: tokenMint,
|
|
465
|
+
tokenProgram: programs.tokenProgram ?? fromWeb3JsPublicKey(TOKEN_PROGRAM_ID),
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
packet: {
|
|
469
|
+
nonce: 0,
|
|
470
|
+
srcEid: 0,
|
|
471
|
+
sender: defaultPublicKey(),
|
|
472
|
+
dstEid: 0,
|
|
473
|
+
receiver: new Uint8Array(32),
|
|
474
|
+
guid: new Uint8Array(32),
|
|
475
|
+
message: new Uint8Array(4),
|
|
476
|
+
},
|
|
477
|
+
options: new Uint8Array(4),
|
|
478
|
+
nativeFee: 0,
|
|
479
|
+
lzTokenFee: 0,
|
|
480
|
+
lzTokenMint: tokenMint,
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
txBuilder = txBuilder.addRemainingAccounts(
|
|
484
|
+
await this.getSendIxRemainingAccounts(rpc, sender, dstEid, true, commitment)
|
|
485
|
+
)
|
|
486
|
+
const keys = txBuilder.getInstructions()[0].keys.map((key) => {
|
|
487
|
+
if (payer !== key.pubkey) {
|
|
488
|
+
key.isSigner = false
|
|
489
|
+
}
|
|
490
|
+
if (key.pubkey === lzTokenTreasury) {
|
|
491
|
+
key.isWritable = true
|
|
492
|
+
}
|
|
493
|
+
return key
|
|
494
|
+
})
|
|
495
|
+
return keys.slice(1)
|
|
496
|
+
}
|
|
497
|
+
|
|
408
498
|
// 3 RPC requests
|
|
409
499
|
/**
|
|
410
500
|
* Gets the remaining accounts for the send instruction.
|
|
@@ -417,37 +507,37 @@ export class Uln implements MessageLibInterface {
|
|
|
417
507
|
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
418
508
|
*/
|
|
419
509
|
async getSendIxRemainingAccounts(
|
|
420
|
-
|
|
510
|
+
rpc: RpcInterface,
|
|
421
511
|
sender: PublicKey,
|
|
422
512
|
dstEid: number,
|
|
423
513
|
payment: boolean,
|
|
424
|
-
commitment: Commitment
|
|
514
|
+
commitment: Commitment = 'confirmed'
|
|
425
515
|
): Promise<AccountMeta[]> {
|
|
426
|
-
const { executor, dvns } = await this.getWorkers(
|
|
516
|
+
const { executor, dvns } = await this.getWorkers(rpc, sender, dstEid)
|
|
427
517
|
|
|
428
518
|
const priceFeeds = new Array<PublicKey>()
|
|
429
519
|
;[executor.config, ...dvns.map((dvn) => dvn.config)].forEach((config) => {
|
|
430
|
-
if (!priceFeeds.find((p) => p
|
|
520
|
+
if (!priceFeeds.find((p) => p === config.priceFeed)) {
|
|
431
521
|
priceFeeds.push(config.priceFeed)
|
|
432
522
|
}
|
|
433
523
|
})
|
|
434
|
-
const priceFeedInfos = await
|
|
524
|
+
const priceFeedInfos = await rpc.getAccounts(priceFeeds, { commitment })
|
|
435
525
|
const priceFeedDict = priceFeedInfos.reduce((acc, info, i) => {
|
|
436
|
-
invariant(info, `priceFeed:${priceFeeds[i]
|
|
437
|
-
acc.set(priceFeeds[i]
|
|
526
|
+
invariant(info.exists, `priceFeed:${priceFeeds[i]} not initialized`)
|
|
527
|
+
acc.set(priceFeeds[i], info.owner)
|
|
438
528
|
return acc
|
|
439
|
-
}, new Map<
|
|
529
|
+
}, new Map<PublicKey, PublicKey>())
|
|
440
530
|
const executorAccounts = new Executor(executor.owner).getQuoteIXAccountMetaForCPI(
|
|
441
531
|
executor.config.priceFeed,
|
|
442
532
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
443
|
-
priceFeedDict.get(executor.config.priceFeed
|
|
533
|
+
priceFeedDict.get(executor.config.priceFeed)!,
|
|
444
534
|
payment
|
|
445
535
|
)
|
|
446
536
|
const dvnAccounts = dvns.map((p, i) => {
|
|
447
537
|
return new DVN(p.owner).getQuoteIXAccountMetaForCPI(
|
|
448
538
|
p.config.priceFeed,
|
|
449
539
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
450
|
-
priceFeedDict.get(p.config.priceFeed
|
|
540
|
+
priceFeedDict.get(p.config.priceFeed)!,
|
|
451
541
|
payment
|
|
452
542
|
)
|
|
453
543
|
})
|
|
@@ -465,63 +555,61 @@ export class Uln implements MessageLibInterface {
|
|
|
465
555
|
* @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
556
|
*/
|
|
467
557
|
async getWorkers(
|
|
468
|
-
|
|
558
|
+
rpc: RpcInterface,
|
|
469
559
|
sender: PublicKey,
|
|
470
560
|
eid: number,
|
|
471
|
-
commitment: Commitment
|
|
561
|
+
commitment: Commitment = 'confirmed'
|
|
472
562
|
): Promise<{
|
|
473
563
|
executor: { config: ExecutorAccounts.ExecutorConfig; owner: PublicKey }
|
|
474
564
|
dvns: { config: DvnAccounts.DvnConfig; owner: PublicKey }[]
|
|
475
565
|
}> {
|
|
476
|
-
const [defaultSendConfig] = this.
|
|
477
|
-
const [sendConfig] = this.
|
|
478
|
-
const [defaultSendConfigBuf, sendConfigBuf] = await
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
)
|
|
482
|
-
invariant(defaultSendConfigBuf, 'defaultSendConfig not initialized')
|
|
566
|
+
const [defaultSendConfig] = this.pda.defaultSendConfig(eid)
|
|
567
|
+
const [sendConfig] = this.pda.sendConfig(eid, sender)
|
|
568
|
+
const [defaultSendConfigBuf, sendConfigBuf] = await rpc.getAccounts([defaultSendConfig, sendConfig], {
|
|
569
|
+
commitment,
|
|
570
|
+
})
|
|
571
|
+
invariant(defaultSendConfigBuf.exists, 'defaultSendConfig not initialized')
|
|
483
572
|
|
|
484
|
-
const
|
|
573
|
+
const defaultSendConfigState = accounts.deserializeSendConfig(defaultSendConfigBuf)
|
|
485
574
|
let {
|
|
486
575
|
executor,
|
|
487
576
|
uln: { requiredDvns, optionalDvns },
|
|
488
577
|
} = defaultSendConfigState
|
|
489
|
-
const sendConfigState = sendConfigBuf ? accounts.
|
|
578
|
+
const sendConfigState = sendConfigBuf.exists ? accounts.deserializeSendConfig(sendConfigBuf) : null
|
|
490
579
|
|
|
491
580
|
// if the executor is set in the send config, use it
|
|
492
|
-
if (sendConfigState?.executor &&
|
|
581
|
+
if (sendConfigState?.executor && sendConfigState.executor.executor !== defaultPublicKey()) {
|
|
493
582
|
;({ executor } = sendConfigState)
|
|
494
583
|
}
|
|
495
584
|
|
|
496
585
|
// if the requiredDvns is set in the send config, use it
|
|
497
586
|
if (sendConfigState && sendConfigState.uln.requiredDvns.length > 0) {
|
|
498
587
|
requiredDvns = sendConfigState.uln.requiredDvns.filter((p) => {
|
|
499
|
-
return
|
|
588
|
+
return p !== defaultPublicKey()
|
|
500
589
|
})
|
|
501
590
|
}
|
|
502
591
|
|
|
503
592
|
// if the optionalDvns is set in the send config, use it
|
|
504
593
|
if (sendConfigState && sendConfigState.uln.optionalDvns.length > 0) {
|
|
505
594
|
optionalDvns = sendConfigState.uln.optionalDvns.filter((p) => {
|
|
506
|
-
return
|
|
595
|
+
return p !== defaultPublicKey()
|
|
507
596
|
})
|
|
508
597
|
}
|
|
509
598
|
const dvns = requiredDvns.concat(optionalDvns)
|
|
510
|
-
const [executorBuf, ...dvnBuf] = await
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
)
|
|
514
|
-
invariant(executorBuf, `executor:${executor.executor.toBase58()} not initialized`)
|
|
599
|
+
const [executorBuf, ...dvnBuf] = await rpc.getAccounts([executor.executor, ...dvns], {
|
|
600
|
+
commitment,
|
|
601
|
+
})
|
|
602
|
+
invariant(executorBuf.exists, `executor:${executor.executor} not initialized`)
|
|
515
603
|
|
|
516
604
|
return {
|
|
517
605
|
executor: {
|
|
518
|
-
config: ExecutorAccounts.
|
|
606
|
+
config: ExecutorAccounts.deserializeExecutorConfig(executorBuf),
|
|
519
607
|
owner: executorBuf.owner,
|
|
520
608
|
},
|
|
521
609
|
dvns: dvnBuf.map((dvn, i) => {
|
|
522
|
-
invariant(dvn, `dvn:${dvns[i]
|
|
610
|
+
invariant(dvn.exists, `dvn:${dvns[i]} not initialized`)
|
|
523
611
|
return {
|
|
524
|
-
config: DvnAccounts.
|
|
612
|
+
config: DvnAccounts.deserializeDvnConfig(dvn),
|
|
525
613
|
owner: dvn.owner,
|
|
526
614
|
}
|
|
527
615
|
}),
|
|
@@ -531,109 +619,74 @@ export class Uln implements MessageLibInterface {
|
|
|
531
619
|
/**
|
|
532
620
|
* Initializes the verification process.
|
|
533
621
|
*
|
|
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
622
|
*/
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
payer: PublicKey,
|
|
544
|
-
dvn: PublicKey,
|
|
545
|
-
packetBytes: Uint8Array,
|
|
546
|
-
commitmentOrConfig?: Commitment | GetAccountInfoConfig
|
|
547
|
-
): Promise<TransactionInstruction | null> {
|
|
623
|
+
initVerify(payer: Signer, param: { dvn: PublicKey; packetBytes: Uint8Array }): WrappedInstruction {
|
|
624
|
+
const { dvn, packetBytes } = param
|
|
548
625
|
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
549
626
|
const headerHash = packet.headerHash()
|
|
550
627
|
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
551
628
|
const payloadHash = packet.payloadHash()
|
|
552
629
|
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
630
|
+
// const confirmationsInfo = await rpc.getAccount(confirmationsPDA, { commitment })
|
|
631
|
+
// if (confirmationsInfo.exists) {
|
|
632
|
+
// // throw new Error('init verify already executed')
|
|
633
|
+
// return null
|
|
634
|
+
// }
|
|
635
|
+
return instructions.initVerify(
|
|
636
|
+
{ programs: this.programRepo, payer },
|
|
560
637
|
{
|
|
561
638
|
payer,
|
|
562
|
-
confirmations:
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
} satisfies types.InitVerifyParams,
|
|
570
|
-
} satisfies instructions.InitVerifyInstructionArgs,
|
|
571
|
-
this.program
|
|
572
|
-
)
|
|
639
|
+
confirmations: this.pda.confirmations(headerHashBytes, payloadHashBytes, dvn),
|
|
640
|
+
// param
|
|
641
|
+
packetHeader: Array.from(Uint8Array.from(Buffer.from(packet.header().slice(2), 'hex'))),
|
|
642
|
+
payloadHash: payloadHashBytes,
|
|
643
|
+
dvn,
|
|
644
|
+
}
|
|
645
|
+
).items[0]
|
|
573
646
|
}
|
|
574
647
|
|
|
575
|
-
|
|
576
|
-
|
|
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 {
|
|
648
|
+
verify(dvn: Signer, param: { packetBytes: Uint8Array; confirmations: number | bigint }): WrappedInstruction {
|
|
649
|
+
const { packetBytes, confirmations } = param
|
|
584
650
|
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
585
651
|
const headerHash = packet.headerHash()
|
|
586
652
|
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
587
653
|
const payloadHash = packet.payloadHash()
|
|
588
654
|
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
589
|
-
|
|
590
|
-
|
|
655
|
+
return instructions.verify(
|
|
656
|
+
{ programs: this.programRepo },
|
|
591
657
|
{
|
|
592
658
|
dvn,
|
|
593
|
-
confirmations:
|
|
594
|
-
eventAuthority: this.
|
|
595
|
-
program: this.
|
|
596
|
-
}
|
|
659
|
+
confirmations: this.pda.confirmations(headerHashBytes, payloadHashBytes, dvn.publicKey),
|
|
660
|
+
eventAuthority: this.eventAuthority,
|
|
661
|
+
program: this.programId,
|
|
662
|
+
},
|
|
597
663
|
{
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
} satisfies instructions.VerifyInstructionArgs,
|
|
604
|
-
this.program
|
|
605
|
-
)
|
|
664
|
+
packetHeader: Array.from(Uint8Array.from(Buffer.from(packet.header().slice(2), 'hex'))),
|
|
665
|
+
payloadHash: payloadHashBytes,
|
|
666
|
+
confirmations: confirmations,
|
|
667
|
+
}
|
|
668
|
+
).items[0]
|
|
606
669
|
}
|
|
607
670
|
|
|
608
|
-
|
|
609
|
-
|
|
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 {
|
|
671
|
+
closeVerify(dvn: Signer, param: { receiver: PublicKey; packetBytes: Uint8Array }): WrappedInstruction {
|
|
672
|
+
const { receiver, packetBytes } = param
|
|
617
673
|
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
618
674
|
const headerHash = packet.headerHash()
|
|
619
675
|
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
620
676
|
const payloadHash = packet.payloadHash()
|
|
621
677
|
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
622
|
-
|
|
623
|
-
|
|
678
|
+
return instructions.closeVerify(
|
|
679
|
+
{ programs: this.programRepo },
|
|
624
680
|
{
|
|
625
681
|
dvn,
|
|
626
682
|
receiver,
|
|
627
|
-
confirmations:
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
} satisfies instructions.CloseVerifyInstructionArgs,
|
|
635
|
-
this.program
|
|
636
|
-
)
|
|
683
|
+
confirmations: this.pda.confirmations(headerHashBytes, payloadHashBytes, dvn.publicKey),
|
|
684
|
+
|
|
685
|
+
// param
|
|
686
|
+
packetHeaderHash: headerHashBytes,
|
|
687
|
+
payloadHash: payloadHashBytes,
|
|
688
|
+
}
|
|
689
|
+
).items[0]
|
|
637
690
|
}
|
|
638
691
|
|
|
639
692
|
/**
|
|
@@ -647,29 +700,23 @@ export class Uln implements MessageLibInterface {
|
|
|
647
700
|
* @returns {Promise<boolean>} A promise that resolves to true if the DVN is verified, false otherwise.
|
|
648
701
|
*/
|
|
649
702
|
async isDvnVerified(
|
|
650
|
-
|
|
703
|
+
rpc: RpcInterface,
|
|
651
704
|
endpointProgram: PublicKey,
|
|
652
705
|
dvn: PublicKey,
|
|
653
706
|
packetBytes: Uint8Array,
|
|
654
|
-
|
|
707
|
+
commitment: Commitment = 'confirmed'
|
|
655
708
|
): Promise<boolean> {
|
|
656
709
|
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
657
710
|
const headerHash = packet.headerHash()
|
|
658
711
|
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
659
712
|
const payloadHash = packet.payloadHash()
|
|
660
713
|
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
661
|
-
const [confirmationsPDA] = this.
|
|
714
|
+
const [confirmationsPDA] = this.pda.confirmations(headerHashBytes, payloadHashBytes, dvn)
|
|
662
715
|
const endpoint = new EndpointProgram.Endpoint(endpointProgram)
|
|
663
|
-
const receiver =
|
|
716
|
+
const receiver = publicKey(arrayify(packet.receiver()))
|
|
664
717
|
const sender = arrayify(packet.sender())
|
|
665
|
-
const nonce = await endpoint.getNonce(
|
|
666
|
-
const pendingNonce = await endpoint.getPendingInboundNonce(
|
|
667
|
-
connection,
|
|
668
|
-
receiver,
|
|
669
|
-
packet.srcEid(),
|
|
670
|
-
sender,
|
|
671
|
-
commitmentOrConfig
|
|
672
|
-
)
|
|
718
|
+
const nonce = await endpoint.getNonce(rpc, receiver, packet.srcEid(), sender, commitment)
|
|
719
|
+
const pendingNonce = await endpoint.getPendingInboundNonce(rpc, receiver, packet.srcEid(), sender, commitment)
|
|
673
720
|
if (!nonce || !pendingNonce) {
|
|
674
721
|
return false
|
|
675
722
|
}
|
|
@@ -682,24 +729,15 @@ export class Uln implements MessageLibInterface {
|
|
|
682
729
|
if (pendingNonce.nonces.find((n) => n.toString() === packet.nonce()) !== undefined) {
|
|
683
730
|
return true
|
|
684
731
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
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
|
|
732
|
+
|
|
733
|
+
// before commitVerification, should call initVerify and verify
|
|
734
|
+
const confirmation = await accounts.safeFetchConfirmations({ rpc }, confirmationsPDA, { commitment })
|
|
735
|
+
if (confirmation?.value == null) {
|
|
736
|
+
// initial value is null not verified
|
|
702
737
|
return false
|
|
738
|
+
} else {
|
|
739
|
+
// TODO check confirmation value
|
|
740
|
+
return true
|
|
703
741
|
}
|
|
704
742
|
}
|
|
705
743
|
|
|
@@ -712,28 +750,26 @@ export class Uln implements MessageLibInterface {
|
|
|
712
750
|
* @returns {Promise<TransactionInstruction>} A promise that resolves to the transaction instruction.
|
|
713
751
|
*/
|
|
714
752
|
async commitVerification(
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
): Promise<
|
|
753
|
+
rpc: RpcInterface,
|
|
754
|
+
packetBytes: Uint8Array,
|
|
755
|
+
endpointProgram: PublicKey = ENDPOINT_PROGRAM_ID
|
|
756
|
+
): Promise<WrappedInstruction> {
|
|
719
757
|
const packet = PacketV1Codec.fromBytes(packetBytes)
|
|
720
758
|
const payloadHash = packet.payloadHash()
|
|
721
759
|
const srcEid = packet.srcEid()
|
|
722
|
-
const receiver =
|
|
760
|
+
const receiver = publicKey(arrayify(packet.receiver()))
|
|
723
761
|
const payloadHashBytes = Uint8Array.from(Buffer.from(payloadHash.slice(2), 'hex'))
|
|
724
|
-
|
|
725
|
-
const [
|
|
726
|
-
const
|
|
727
|
-
const [msgLib] = this.deriver.messageLib()
|
|
728
|
-
const receiveConfigState = await this.getFinalReceiveConfigState(connection, receiver, srcEid)
|
|
762
|
+
|
|
763
|
+
const [msgLib] = this.pda.messageLib()
|
|
764
|
+
const receiveConfigState = await this.getFinalReceiveConfigState(rpc, receiver, srcEid)
|
|
729
765
|
|
|
730
766
|
const headerHash = packet.headerHash()
|
|
731
767
|
const headerHashBytes = Uint8Array.from(Buffer.from(headerHash.slice(2), 'hex'))
|
|
732
768
|
|
|
733
|
-
const confirmations: AccountMeta[] = receiveConfigState.
|
|
734
|
-
.concat(receiveConfigState.
|
|
769
|
+
const confirmations: AccountMeta[] = receiveConfigState.requiredDvns
|
|
770
|
+
.concat(receiveConfigState.optionalDvns)
|
|
735
771
|
.map((p) => {
|
|
736
|
-
const [confirmationsPDA] = this.
|
|
772
|
+
const [confirmationsPDA] = this.pda.confirmations(headerHashBytes, payloadHashBytes, p)
|
|
737
773
|
return {
|
|
738
774
|
pubkey: confirmationsPDA,
|
|
739
775
|
isSigner: false,
|
|
@@ -743,21 +779,19 @@ export class Uln implements MessageLibInterface {
|
|
|
743
779
|
const endpoint = new EndpointProgram.Endpoint(endpointProgram)
|
|
744
780
|
const verifyAccounts = endpoint.getVerifyIXAccountMetaForCPI(packet, msgLib)
|
|
745
781
|
|
|
746
|
-
|
|
782
|
+
const txBuilder = instructions.commitVerification(
|
|
783
|
+
{ programs: this.programRepo },
|
|
747
784
|
{
|
|
748
|
-
uln: setting,
|
|
749
|
-
defaultReceiveConfig,
|
|
750
|
-
receiveConfig,
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
payloadHash: Array.from(payloadHashBytes),
|
|
757
|
-
} satisfies types.CommitVerificationParams,
|
|
758
|
-
} satisfies instructions.CommitVerificationInstructionArgs,
|
|
759
|
-
this.program
|
|
785
|
+
uln: this.pda.setting(),
|
|
786
|
+
defaultReceiveConfig: this.pda.defaultReceiveConfig(srcEid),
|
|
787
|
+
receiveConfig: this.pda.receiveConfig(srcEid, receiver),
|
|
788
|
+
|
|
789
|
+
// param
|
|
790
|
+
packetHeader: Array.from(arrayify(packet.header())),
|
|
791
|
+
payloadHash: payloadHashBytes,
|
|
792
|
+
}
|
|
760
793
|
)
|
|
794
|
+
return txBuilder.addRemainingAccounts(confirmations.concat(verifyAccounts)).items[0]
|
|
761
795
|
}
|
|
762
796
|
|
|
763
797
|
/**
|
|
@@ -769,24 +803,25 @@ export class Uln implements MessageLibInterface {
|
|
|
769
803
|
* @returns {AccountMeta[]} An array of account metadata.
|
|
770
804
|
*/
|
|
771
805
|
getInitConfigIXAccountMetaForCPI(payer: PublicKey, oappID: PublicKey, eid: number): AccountMeta[] {
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
const [setting] = this.deriver.setting()
|
|
775
|
-
|
|
776
|
-
const accounts = instructions.createInitConfigInstructionAccounts(
|
|
806
|
+
const txBuilder = instructions.initConfig(
|
|
807
|
+
{ payer: createNoopSigner(payer), programs: this.programRepo },
|
|
777
808
|
{
|
|
778
|
-
endpoint:
|
|
779
|
-
payer,
|
|
780
|
-
uln: setting,
|
|
781
|
-
sendConfig,
|
|
782
|
-
receiveConfig,
|
|
783
|
-
|
|
784
|
-
|
|
809
|
+
endpoint: createNoopSigner(defaultPublicKey()),
|
|
810
|
+
payer: createNoopSigner(payer),
|
|
811
|
+
uln: this.pda.setting(),
|
|
812
|
+
sendConfig: this.pda.sendConfig(eid, oappID),
|
|
813
|
+
receiveConfig: this.pda.receiveConfig(eid, oappID),
|
|
814
|
+
|
|
815
|
+
// params
|
|
816
|
+
oapp: defaultPublicKey(),
|
|
817
|
+
eid: 0,
|
|
818
|
+
}
|
|
785
819
|
)
|
|
786
|
-
accounts.
|
|
787
|
-
if (
|
|
820
|
+
const accounts = txBuilder.getInstructions()[0].keys.map((key) => {
|
|
821
|
+
if (payer !== key.pubkey) {
|
|
788
822
|
key.isSigner = false
|
|
789
823
|
}
|
|
824
|
+
return key
|
|
790
825
|
})
|
|
791
826
|
return accounts.slice(1)
|
|
792
827
|
}
|
|
@@ -805,13 +840,11 @@ export class Uln implements MessageLibInterface {
|
|
|
805
840
|
): Uint8Array {
|
|
806
841
|
switch (configType) {
|
|
807
842
|
case SetConfigType.EXECUTOR: {
|
|
808
|
-
|
|
809
|
-
return Uint8Array.from(data)
|
|
843
|
+
return types.getExecutorConfigSerializer().serialize(configData as types.ExecutorConfig)
|
|
810
844
|
}
|
|
811
845
|
case SetConfigType.SEND_ULN:
|
|
812
846
|
case SetConfigType.RECEIVE_ULN: {
|
|
813
|
-
|
|
814
|
-
return Uint8Array.from(data)
|
|
847
|
+
return types.getUlnConfigSerializer().serialize(configData as types.UlnConfig)
|
|
815
848
|
}
|
|
816
849
|
default:
|
|
817
850
|
throw new Error(`invalid config type: ${configType as number}`)
|
|
@@ -826,54 +859,45 @@ export class Uln implements MessageLibInterface {
|
|
|
826
859
|
* @param {number} eid - The endpoint ID.
|
|
827
860
|
* @returns {Promise<AccountMeta[]>} A promise that resolves to an array of account metadata.
|
|
828
861
|
*/
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
):
|
|
834
|
-
const [
|
|
835
|
-
const [
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
const [msgLib] = this.deriver.messageLib()
|
|
840
|
-
const [msgLibInfo] = new EndpointPDADeriver(endpointProgram).messageLibraryInfo(msgLib)
|
|
841
|
-
|
|
842
|
-
const accounts = instructions.createSetConfigInstructionAccounts(
|
|
862
|
+
getSetConfigIXAccountMetaForCPI(
|
|
863
|
+
oapp: PublicKey,
|
|
864
|
+
eid: number,
|
|
865
|
+
endpointProgram: PublicKey = ENDPOINT_PROGRAM_ID
|
|
866
|
+
): AccountMeta[] {
|
|
867
|
+
const [msgLib] = this.pda.messageLib()
|
|
868
|
+
const [msgLibInfo] = new EndpointPDA(endpointProgram).messageLibraryInfo(msgLib)
|
|
869
|
+
|
|
870
|
+
const txBuilder = instructions.setConfig(
|
|
871
|
+
{ programs: this.programRepo },
|
|
843
872
|
{
|
|
844
|
-
endpoint: msgLibInfo,
|
|
845
|
-
uln: setting,
|
|
846
|
-
sendConfig,
|
|
847
|
-
defaultSendConfig,
|
|
848
|
-
defaultReceiveConfig,
|
|
849
|
-
receiveConfig,
|
|
850
|
-
eventAuthority: this.
|
|
851
|
-
program: this.
|
|
852
|
-
|
|
853
|
-
|
|
873
|
+
endpoint: createNoopSigner(msgLibInfo),
|
|
874
|
+
uln: this.pda.setting(),
|
|
875
|
+
sendConfig: this.pda.sendConfig(eid, oapp),
|
|
876
|
+
defaultSendConfig: this.pda.defaultSendConfig(eid),
|
|
877
|
+
defaultReceiveConfig: this.pda.defaultReceiveConfig(eid),
|
|
878
|
+
receiveConfig: this.pda.receiveConfig(eid, oapp),
|
|
879
|
+
eventAuthority: this.eventAuthority,
|
|
880
|
+
program: this.programId,
|
|
881
|
+
// param
|
|
882
|
+
oapp: defaultPublicKey(),
|
|
883
|
+
eid: 0,
|
|
884
|
+
configType: 0,
|
|
885
|
+
config: new Uint8Array(32),
|
|
886
|
+
}
|
|
854
887
|
)
|
|
855
|
-
return
|
|
888
|
+
return txBuilder.getInstructions()[0].keys.slice(1)
|
|
856
889
|
}
|
|
857
890
|
|
|
858
|
-
//
|
|
859
|
-
// all of below functions are retrieving accounts state
|
|
860
891
|
/**
|
|
861
892
|
* Gets the ULN settings.
|
|
862
893
|
*
|
|
863
|
-
* @param {
|
|
864
|
-
* @param {Commitment
|
|
894
|
+
* @param {RpcInterface} rpc - The connection to the Solana cluster.
|
|
895
|
+
* @param {Commitment} [commitment] - The commitment level or account info configuration.
|
|
865
896
|
* @returns {Promise<accounts.UlnSettings | null>} A promise that resolves to the ULN settings or null if not found.
|
|
866
897
|
*/
|
|
867
|
-
async getSetting(
|
|
868
|
-
|
|
869
|
-
|
|
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
|
-
}
|
|
898
|
+
async getSetting(rpc: RpcInterface, commitment: Commitment = 'confirmed'): Promise<accounts.UlnSettings | null> {
|
|
899
|
+
const [setting] = this.pda.setting()
|
|
900
|
+
return accounts.safeFetchUlnSettings({ rpc }, setting, { commitment })
|
|
877
901
|
}
|
|
878
902
|
|
|
879
903
|
/**
|
|
@@ -885,16 +909,12 @@ export class Uln implements MessageLibInterface {
|
|
|
885
909
|
* @returns {Promise<accounts.SendConfig | null>} A promise that resolves to the default send configuration state or null if not found.
|
|
886
910
|
*/
|
|
887
911
|
async getDefaultSendConfigState(
|
|
888
|
-
|
|
912
|
+
rpc: RpcInterface,
|
|
889
913
|
eid: number,
|
|
890
|
-
|
|
914
|
+
commitment: Commitment = 'confirmed'
|
|
891
915
|
): Promise<accounts.SendConfig | null> {
|
|
892
|
-
const [config] = this.
|
|
893
|
-
|
|
894
|
-
return await accounts.SendConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
895
|
-
} catch (e) {
|
|
896
|
-
return null
|
|
897
|
-
}
|
|
916
|
+
const [config] = this.pda.defaultSendConfig(eid)
|
|
917
|
+
return accounts.safeFetchSendConfig({ rpc }, config, { commitment })
|
|
898
918
|
}
|
|
899
919
|
|
|
900
920
|
/**
|
|
@@ -907,17 +927,13 @@ export class Uln implements MessageLibInterface {
|
|
|
907
927
|
* @returns {Promise<accounts.SendConfig | null>} A promise that resolves to the send configuration state or null if not found.
|
|
908
928
|
*/
|
|
909
929
|
async getSendConfigState(
|
|
910
|
-
|
|
930
|
+
rpc: RpcInterface,
|
|
911
931
|
sender: PublicKey,
|
|
912
932
|
eid: number,
|
|
913
|
-
|
|
933
|
+
commitment: Commitment = 'confirmed'
|
|
914
934
|
): Promise<accounts.SendConfig | null> {
|
|
915
|
-
const [config] = this.
|
|
916
|
-
|
|
917
|
-
return await accounts.SendConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
918
|
-
} catch (e) {
|
|
919
|
-
return null
|
|
920
|
-
}
|
|
935
|
+
const [config] = this.pda.sendConfig(eid, sender)
|
|
936
|
+
return accounts.safeFetchSendConfig({ rpc }, config, { commitment })
|
|
921
937
|
}
|
|
922
938
|
|
|
923
939
|
/**
|
|
@@ -929,16 +945,12 @@ export class Uln implements MessageLibInterface {
|
|
|
929
945
|
* @returns {Promise<accounts.ReceiveConfig | null>} A promise that resolves to the default receive configuration state or null if not found.
|
|
930
946
|
*/
|
|
931
947
|
async getDefaultReceiveConfigState(
|
|
932
|
-
|
|
948
|
+
rpc: RpcInterface,
|
|
933
949
|
eid: number,
|
|
934
|
-
|
|
950
|
+
commitment: Commitment = 'confirmed'
|
|
935
951
|
): Promise<accounts.ReceiveConfig | null> {
|
|
936
|
-
const [config] = this.
|
|
937
|
-
|
|
938
|
-
return await accounts.ReceiveConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
939
|
-
} catch (e) {
|
|
940
|
-
return null
|
|
941
|
-
}
|
|
952
|
+
const [config] = this.pda.defaultReceiveConfig(eid)
|
|
953
|
+
return accounts.safeFetchReceiveConfig({ rpc }, config, { commitment })
|
|
942
954
|
}
|
|
943
955
|
|
|
944
956
|
/**
|
|
@@ -951,17 +963,13 @@ export class Uln implements MessageLibInterface {
|
|
|
951
963
|
* @returns {Promise<accounts.ReceiveConfig | null>} A promise that resolves to the receive configuration state or null if not found.
|
|
952
964
|
*/
|
|
953
965
|
async getReceiveConfigState(
|
|
954
|
-
|
|
966
|
+
rpc: RpcInterface,
|
|
955
967
|
receiver: PublicKey,
|
|
956
968
|
eid: number,
|
|
957
|
-
|
|
969
|
+
commitment: Commitment = 'confirmed'
|
|
958
970
|
): Promise<accounts.ReceiveConfig | null> {
|
|
959
|
-
const [config] = this.
|
|
960
|
-
|
|
961
|
-
return await accounts.ReceiveConfig.fromAccountAddress(connection, config, commitmentOrConfig)
|
|
962
|
-
} catch (e) {
|
|
963
|
-
return null
|
|
964
|
-
}
|
|
971
|
+
const [config] = this.pda.receiveConfig(eid, receiver)
|
|
972
|
+
return accounts.safeFetchReceiveConfig({ rpc }, config, { commitment })
|
|
965
973
|
}
|
|
966
974
|
|
|
967
975
|
/**
|
|
@@ -975,16 +983,54 @@ export class Uln implements MessageLibInterface {
|
|
|
975
983
|
* @throws {Error} If no DVN is found.
|
|
976
984
|
*/
|
|
977
985
|
async getFinalReceiveConfigState(
|
|
978
|
-
|
|
986
|
+
rpc: RpcInterface,
|
|
979
987
|
receiver: PublicKey,
|
|
980
988
|
eid: number,
|
|
981
|
-
|
|
982
|
-
): Promise<
|
|
983
|
-
const
|
|
989
|
+
commitment: Commitment = 'confirmed'
|
|
990
|
+
): Promise<types.UlnConfig> {
|
|
991
|
+
const [defaultConfig] = this.pda.defaultReceiveConfig(eid)
|
|
992
|
+
const [customConfig] = this.pda.receiveConfig(eid, receiver)
|
|
993
|
+
|
|
994
|
+
const [defaultConfigInfo, customConfigInfo] = await rpc.getAccounts([defaultConfig, customConfig], {
|
|
995
|
+
commitment,
|
|
996
|
+
})
|
|
997
|
+
if (!defaultConfigInfo.exists) {
|
|
998
|
+
throw new Error(`please init default receive config first. ${defaultConfig}`)
|
|
999
|
+
}
|
|
1000
|
+
const defaultConfigState = accounts.deserializeReceiveConfig(defaultConfigInfo)
|
|
1001
|
+
const customConfigState = customConfigInfo.exists ? accounts.deserializeReceiveConfig(customConfigInfo) : null
|
|
1002
|
+
return this.getConfigState(defaultConfigState, customConfigState)
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
async getFinalSendConfigState(
|
|
1006
|
+
rpc: RpcInterface,
|
|
1007
|
+
sender: PublicKey,
|
|
1008
|
+
eid: number,
|
|
1009
|
+
commitment: Commitment = 'confirmed'
|
|
1010
|
+
): Promise<types.UlnConfig> {
|
|
1011
|
+
const [defaultConfig] = this.pda.defaultSendConfig(eid)
|
|
1012
|
+
const [customConfig] = this.pda.sendConfig(eid, sender)
|
|
1013
|
+
|
|
1014
|
+
const [defaultConfigInfo, customConfigInfo] = await rpc.getAccounts([defaultConfig, customConfig], {
|
|
1015
|
+
commitment,
|
|
1016
|
+
})
|
|
1017
|
+
if (!defaultConfigInfo.exists) {
|
|
1018
|
+
throw new Error(`please init default send config first. ${defaultConfig}`)
|
|
1019
|
+
}
|
|
1020
|
+
const defaultConfigState = accounts.deserializeSendConfig(defaultConfigInfo)
|
|
1021
|
+
const customConfigState = customConfigInfo.exists ? accounts.deserializeSendConfig(customConfigInfo) : null
|
|
1022
|
+
return this.getConfigState(defaultConfigState, customConfigState)
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
private getConfigState(
|
|
1026
|
+
defaultConfigState: accounts.ReceiveConfig | accounts.SendConfig,
|
|
1027
|
+
customConfigState: accounts.ReceiveConfig | accounts.SendConfig | null
|
|
1028
|
+
): types.UlnConfig {
|
|
1029
|
+
const NIL_CONFIRMATIONS = '18446744073709551615' // max uint64
|
|
984
1030
|
const NIL_DVN_COUNT = '255'
|
|
985
1031
|
|
|
986
1032
|
const rtn_config: types.UlnConfig = {
|
|
987
|
-
confirmations:
|
|
1033
|
+
confirmations: 0n,
|
|
988
1034
|
requiredDvnCount: 0,
|
|
989
1035
|
optionalDvnCount: 0,
|
|
990
1036
|
optionalDvnThreshold: 0,
|
|
@@ -992,20 +1038,7 @@ export class Uln implements MessageLibInterface {
|
|
|
992
1038
|
optionalDvns: [],
|
|
993
1039
|
}
|
|
994
1040
|
|
|
995
|
-
|
|
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) {
|
|
1041
|
+
if (customConfigState == null || customConfigState.uln.confirmations === 0n) {
|
|
1009
1042
|
rtn_config.confirmations = defaultConfigState.uln.confirmations
|
|
1010
1043
|
} else if (customConfigState.uln.confirmations.toString() !== NIL_CONFIRMATIONS) {
|
|
1011
1044
|
rtn_config.confirmations = customConfigState.uln.confirmations
|
|
@@ -1036,10 +1069,6 @@ export class Uln implements MessageLibInterface {
|
|
|
1036
1069
|
if (rtn_config.requiredDvnCount === 0 && rtn_config.optionalDvnCount === 0) {
|
|
1037
1070
|
throw new Error('no dvn')
|
|
1038
1071
|
}
|
|
1039
|
-
|
|
1040
|
-
return accounts.ReceiveConfig.fromArgs({
|
|
1041
|
-
bump: defaultConfigState.bump,
|
|
1042
|
-
uln: rtn_config,
|
|
1043
|
-
})
|
|
1072
|
+
return rtn_config
|
|
1044
1073
|
}
|
|
1045
1074
|
}
|