@layerzerolabs/lz-solana-sdk-v2 3.0.47 → 3.0.48

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