@oobe-protocol-labs/synapse-client-sdk 1.0.1 → 1.0.3

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 (623) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/cjs/accounts/helpers.d.ts +88 -0
  3. package/dist/cjs/accounts/helpers.d.ts.map +1 -0
  4. package/dist/cjs/accounts/helpers.js +117 -0
  5. package/dist/cjs/accounts/helpers.js.map +1 -0
  6. package/dist/cjs/accounts/index.d.ts +105 -0
  7. package/dist/cjs/accounts/index.d.ts.map +1 -0
  8. package/dist/cjs/accounts/index.js +137 -0
  9. package/dist/cjs/accounts/index.js.map +1 -0
  10. package/dist/cjs/accounts/lookup.d.ts +30 -0
  11. package/dist/cjs/accounts/lookup.d.ts.map +1 -0
  12. package/dist/cjs/accounts/lookup.js +31 -0
  13. package/dist/cjs/accounts/lookup.js.map +1 -0
  14. package/dist/cjs/accounts/nonce.d.ts +30 -0
  15. package/dist/cjs/accounts/nonce.d.ts.map +1 -0
  16. package/dist/cjs/accounts/nonce.js +31 -0
  17. package/dist/cjs/accounts/nonce.js.map +1 -0
  18. package/dist/cjs/accounts/stake.d.ts +33 -0
  19. package/dist/cjs/accounts/stake.d.ts.map +1 -0
  20. package/dist/cjs/accounts/stake.js +34 -0
  21. package/dist/cjs/accounts/stake.js.map +1 -0
  22. package/dist/cjs/accounts/token.d.ts +98 -0
  23. package/dist/cjs/accounts/token.d.ts.map +1 -0
  24. package/dist/cjs/accounts/token.js +126 -0
  25. package/dist/cjs/accounts/token.js.map +1 -0
  26. package/dist/cjs/ai/gateway/x402/facilitator.d.ts +4 -4
  27. package/dist/cjs/ai/gateway/x402/facilitator.js +4 -4
  28. package/dist/cjs/ai/tools/zod/index.d.ts +1 -1
  29. package/dist/cjs/ai/tools/zod/index.d.ts.map +1 -1
  30. package/dist/cjs/ai/tools/zod/index.js +2 -2
  31. package/dist/cjs/ai/tools/zod/index.js.map +1 -1
  32. package/dist/cjs/ai/tools/zod/types.d.ts +2 -0
  33. package/dist/cjs/ai/tools/zod/types.d.ts.map +1 -1
  34. package/dist/cjs/ai/tools/zod/types.js.map +1 -1
  35. package/dist/cjs/core/client.d.ts +97 -9
  36. package/dist/cjs/core/client.d.ts.map +1 -1
  37. package/dist/cjs/core/client.js +120 -5
  38. package/dist/cjs/core/client.js.map +1 -1
  39. package/dist/cjs/core/transport.d.ts +1 -1
  40. package/dist/cjs/core/transport.d.ts.map +1 -1
  41. package/dist/cjs/core/transport.js +5 -5
  42. package/dist/cjs/core/transport.js.map +1 -1
  43. package/dist/cjs/core/types.d.ts +23 -4
  44. package/dist/cjs/core/types.d.ts.map +1 -1
  45. package/dist/cjs/core/types.js +5 -1
  46. package/dist/cjs/core/types.js.map +1 -1
  47. package/dist/cjs/decoders/index.d.ts +36 -0
  48. package/dist/cjs/decoders/index.d.ts.map +1 -0
  49. package/dist/cjs/decoders/index.js +62 -0
  50. package/dist/cjs/decoders/index.js.map +1 -0
  51. package/dist/cjs/decoders/layout.d.ts +105 -0
  52. package/dist/cjs/decoders/layout.d.ts.map +1 -0
  53. package/dist/cjs/decoders/layout.js +188 -0
  54. package/dist/cjs/decoders/layout.js.map +1 -0
  55. package/dist/cjs/decoders/lookup-table.d.ts +60 -0
  56. package/dist/cjs/decoders/lookup-table.d.ts.map +1 -0
  57. package/dist/cjs/decoders/lookup-table.js +75 -0
  58. package/dist/cjs/decoders/lookup-table.js.map +1 -0
  59. package/dist/cjs/decoders/multisig.d.ts +49 -0
  60. package/dist/cjs/decoders/multisig.d.ts.map +1 -0
  61. package/dist/cjs/decoders/multisig.js +50 -0
  62. package/dist/cjs/decoders/multisig.js.map +1 -0
  63. package/dist/cjs/decoders/nonce.d.ts +54 -0
  64. package/dist/cjs/decoders/nonce.d.ts.map +1 -0
  65. package/dist/cjs/decoders/nonce.js +48 -0
  66. package/dist/cjs/decoders/nonce.js.map +1 -0
  67. package/dist/cjs/decoders/stake.d.ts +65 -0
  68. package/dist/cjs/decoders/stake.d.ts.map +1 -0
  69. package/dist/cjs/decoders/stake.js +86 -0
  70. package/dist/cjs/decoders/stake.js.map +1 -0
  71. package/dist/cjs/decoders/token-2022.d.ts +134 -0
  72. package/dist/cjs/decoders/token-2022.d.ts.map +1 -0
  73. package/dist/cjs/decoders/token-2022.js +160 -0
  74. package/dist/cjs/decoders/token-2022.js.map +1 -0
  75. package/dist/cjs/decoders/token.d.ts +87 -0
  76. package/dist/cjs/decoders/token.d.ts.map +1 -0
  77. package/dist/cjs/decoders/token.js +71 -0
  78. package/dist/cjs/decoders/token.js.map +1 -0
  79. package/dist/cjs/index.d.ts +3 -0
  80. package/dist/cjs/index.d.ts.map +1 -1
  81. package/dist/cjs/index.js +6 -0
  82. package/dist/cjs/index.js.map +1 -1
  83. package/dist/cjs/kit/index.d.ts +94 -0
  84. package/dist/cjs/kit/index.d.ts.map +1 -0
  85. package/dist/cjs/kit/index.js +196 -0
  86. package/dist/cjs/kit/index.js.map +1 -0
  87. package/dist/docs/assets/highlight.css +7 -0
  88. package/dist/docs/assets/navigation.js +1 -1
  89. package/dist/docs/assets/search.js +1 -1
  90. package/dist/docs/classes/AccountReader.html +61 -0
  91. package/dist/docs/classes/AccountsClient.html +43 -0
  92. package/dist/docs/classes/DasClient.html +13 -13
  93. package/dist/docs/classes/GeyserParser.html +17 -17
  94. package/dist/docs/classes/GrpcTransport.html +6 -6
  95. package/dist/docs/classes/HttpTransport.html +4 -4
  96. package/dist/docs/classes/NetworkError.html +5 -5
  97. package/dist/docs/classes/RpcMethodNotFoundError.html +4 -4
  98. package/dist/docs/classes/SolanaError.html +40 -0
  99. package/dist/docs/classes/SolanaRpc.html +55 -55
  100. package/dist/docs/classes/SynapseClient.html +50 -19
  101. package/dist/docs/classes/SynapseError.html +4 -4
  102. package/dist/docs/classes/TimeoutError.html +4 -4
  103. package/dist/docs/classes/UpstreamError.html +6 -6
  104. package/dist/docs/classes/WsClient.html +10 -10
  105. package/dist/docs/enums/AccountRole.html +40 -0
  106. package/dist/docs/enums/SynapseNetwork.html +2 -2
  107. package/dist/docs/enums/SynapseRegion.html +2 -2
  108. package/dist/docs/enums/TokenExtensionType.html +23 -0
  109. package/dist/docs/functions/Epoch-1.html +1 -1
  110. package/dist/docs/functions/{Lamports-1.html → Lamports-2.html} +2 -2
  111. package/dist/docs/functions/Pubkey-1.html +1 -1
  112. package/dist/docs/functions/Sig.html +1 -1
  113. package/dist/docs/functions/Slot-1.html +1 -1
  114. package/dist/docs/functions/UnixTs.html +1 -1
  115. package/dist/docs/functions/addSignersToTransactionMessage.html +14 -0
  116. package/dist/docs/functions/address-1.html +15 -0
  117. package/dist/docs/functions/airdropFactory.html +9 -0
  118. package/dist/docs/functions/appendTransactionMessageInstruction.html +8 -0
  119. package/dist/docs/functions/appendTransactionMessageInstructions.html +8 -0
  120. package/dist/docs/functions/assertAccountDecoded.html +13 -0
  121. package/dist/docs/functions/assertAccountExists.html +10 -0
  122. package/dist/docs/functions/assertIsAddress.html +7 -0
  123. package/dist/docs/functions/assertIsKeyPairSigner.html +6 -0
  124. package/dist/docs/functions/assertIsKitSignature.html +7 -0
  125. package/dist/docs/functions/assertIsTransactionSigner.html +7 -0
  126. package/dist/docs/functions/autoSelectRegion.html +1 -1
  127. package/dist/docs/functions/base58Encode.html +1 -1
  128. package/dist/docs/functions/base64ToBytes.html +7 -0
  129. package/dist/docs/functions/blockhash.html +15 -0
  130. package/dist/docs/functions/chunk.html +1 -1
  131. package/dist/docs/functions/commitmentComparator.html +1 -0
  132. package/dist/docs/functions/compileTransaction.html +14 -0
  133. package/dist/docs/functions/compileTransactionMessage.html +8 -0
  134. package/dist/docs/functions/computeBalanceChanges.html +1 -1
  135. package/dist/docs/functions/computeTokenBalanceChanges.html +1 -1
  136. package/dist/docs/functions/createAddressWithSeed.html +6 -0
  137. package/dist/docs/functions/createDefaultRpcSubscriptionsTransport.html +7 -0
  138. package/dist/docs/functions/createDefaultRpcTransport.html +10 -0
  139. package/dist/docs/functions/createDefaultSolanaRpcSubscriptionsChannelCreator.html +5 -0
  140. package/dist/docs/functions/createKeyPairFromBytes.html +12 -0
  141. package/dist/docs/functions/createKeyPairFromPrivateKeyBytes.html +17 -0
  142. package/dist/docs/functions/createKeyPairSignerFromBytes.html +6 -0
  143. package/dist/docs/functions/createKeyPairSignerFromPrivateKeyBytes.html +6 -0
  144. package/dist/docs/functions/createNoopSigner.html +6 -0
  145. package/dist/docs/functions/createRpc.html +3 -0
  146. package/dist/docs/functions/createSignableMessage.html +6 -0
  147. package/dist/docs/functions/createSignerFromKeyPair.html +12 -0
  148. package/dist/docs/functions/createSolanaRpc.html +4 -0
  149. package/dist/docs/functions/createSolanaRpcApi.html +12 -0
  150. package/dist/docs/functions/createSolanaRpcFromTransport.html +3 -0
  151. package/dist/docs/functions/createSolanaRpcSubscriptions.html +4 -0
  152. package/dist/docs/functions/createSolanaRpcSubscriptionsApi.html +1 -0
  153. package/dist/docs/functions/createSolanaRpcSubscriptionsFromTransport.html +3 -0
  154. package/dist/docs/functions/createSolanaRpcSubscriptions_UNSTABLE.html +4 -0
  155. package/dist/docs/functions/createSynapse.html +1 -1
  156. package/dist/docs/functions/createTransactionMessage.html +6 -0
  157. package/dist/docs/functions/decodeAccount.html +9 -0
  158. package/dist/docs/functions/decodeLookupTable.html +17 -0
  159. package/dist/docs/functions/decodeMint.html +6 -0
  160. package/dist/docs/functions/decodeMultisig.html +13 -0
  161. package/dist/docs/functions/decodeNonceAccount.html +14 -0
  162. package/dist/docs/functions/decodeStakeAccount.html +12 -0
  163. package/dist/docs/functions/decodeToken2022Account.html +5 -0
  164. package/dist/docs/functions/decodeToken2022Mint.html +5 -0
  165. package/dist/docs/functions/decodeTokenAccount.html +6 -0
  166. package/dist/docs/functions/devnet.html +2 -0
  167. package/dist/docs/functions/encodeBase58.html +7 -0
  168. package/dist/docs/functions/fetchEncodedAccount.html +9 -0
  169. package/dist/docs/functions/fetchEncodedAccounts.html +11 -0
  170. package/dist/docs/functions/fetchJsonParsedAccount.html +12 -0
  171. package/dist/docs/functions/fetchJsonParsedAccounts.html +14 -0
  172. package/dist/docs/functions/fetchLookupTable.html +10 -0
  173. package/dist/docs/functions/fetchMint.html +11 -0
  174. package/dist/docs/functions/fetchNonceAccount.html +10 -0
  175. package/dist/docs/functions/fetchStakeAccount.html +10 -0
  176. package/dist/docs/functions/fetchTokenAccount.html +12 -0
  177. package/dist/docs/functions/fetchTokenAccountsByOwner.html +11 -0
  178. package/dist/docs/functions/fromKitAddress.html +5 -0
  179. package/dist/docs/functions/generateKeyPair.html +6 -0
  180. package/dist/docs/functions/generateKeyPairSigner.html +7 -0
  181. package/dist/docs/functions/getAccountInfo.html +1 -1
  182. package/dist/docs/functions/getAddressCodec.html +6 -0
  183. package/dist/docs/functions/getAddressComparator.html +1 -0
  184. package/dist/docs/functions/getAddressDecoder.html +6 -0
  185. package/dist/docs/functions/getAddressEncoder.html +5 -0
  186. package/dist/docs/functions/getAddressFromPublicKey.html +5 -0
  187. package/dist/docs/functions/getAsset.html +1 -1
  188. package/dist/docs/functions/getAssetBatch.html +1 -1
  189. package/dist/docs/functions/getAssetProof.html +1 -1
  190. package/dist/docs/functions/getAssetProofBatch.html +1 -1
  191. package/dist/docs/functions/getAssetsByAuthority.html +1 -1
  192. package/dist/docs/functions/getAssetsByCreator.html +1 -1
  193. package/dist/docs/functions/getAssetsByGroup.html +1 -1
  194. package/dist/docs/functions/getAssetsByOwner.html +1 -1
  195. package/dist/docs/functions/getBalance.html +1 -1
  196. package/dist/docs/functions/getBase58Codec.html +26 -0
  197. package/dist/docs/functions/getBase58Decoder.html +10 -0
  198. package/dist/docs/functions/getBase58Encoder.html +11 -0
  199. package/dist/docs/functions/getBase64Codec.html +26 -0
  200. package/dist/docs/functions/getBase64Decoder.html +10 -0
  201. package/dist/docs/functions/getBase64Encoder.html +11 -0
  202. package/dist/docs/functions/getBlock.html +1 -1
  203. package/dist/docs/functions/getBlockCommitment.html +1 -1
  204. package/dist/docs/functions/getBlockHeight.html +1 -1
  205. package/dist/docs/functions/getBlockProduction.html +1 -1
  206. package/dist/docs/functions/getBlockTime.html +1 -1
  207. package/dist/docs/functions/getBlocks.html +1 -1
  208. package/dist/docs/functions/getBlocksWithLimit.html +1 -1
  209. package/dist/docs/functions/getClusterNodes.html +1 -1
  210. package/dist/docs/functions/getDecodedAccount.html +14 -0
  211. package/dist/docs/functions/getDecodedAccounts.html +9 -0
  212. package/dist/docs/functions/getEnvironment.html +1 -1
  213. package/dist/docs/functions/getEpochInfo.html +1 -1
  214. package/dist/docs/functions/getEpochSchedule.html +1 -1
  215. package/dist/docs/functions/getFeeForMessage.html +1 -1
  216. package/dist/docs/functions/getFirstAvailableBlock.html +1 -1
  217. package/dist/docs/functions/getGenesisHash.html +1 -1
  218. package/dist/docs/functions/getHealth.html +1 -1
  219. package/dist/docs/functions/getHighestSnapshotSlot.html +1 -1
  220. package/dist/docs/functions/getIdentity.html +1 -1
  221. package/dist/docs/functions/getInflationGovernor.html +1 -1
  222. package/dist/docs/functions/getInflationRate.html +1 -1
  223. package/dist/docs/functions/getInflationReward.html +1 -1
  224. package/dist/docs/functions/getLargestAccounts.html +1 -1
  225. package/dist/docs/functions/getLatestBlockhash.html +1 -1
  226. package/dist/docs/functions/getLeaderSchedule.html +1 -1
  227. package/dist/docs/functions/getMaxRetransmitSlot.html +1 -1
  228. package/dist/docs/functions/getMaxShredInsertSlot.html +1 -1
  229. package/dist/docs/functions/getMinimumBalanceForRentExemption.html +1 -1
  230. package/dist/docs/functions/getMultipleAccounts.html +1 -1
  231. package/dist/docs/functions/getProgramAccounts.html +1 -1
  232. package/dist/docs/functions/getProgramCategory.html +1 -1
  233. package/dist/docs/functions/getProgramDerivedAddress.html +6 -0
  234. package/dist/docs/functions/getRecentPerformanceSamples.html +1 -1
  235. package/dist/docs/functions/getRecentPrioritizationFees.html +1 -1
  236. package/dist/docs/functions/getSignatureStatuses.html +1 -1
  237. package/dist/docs/functions/getSignaturesForAddress.html +1 -1
  238. package/dist/docs/functions/getSignaturesForAsset.html +1 -1
  239. package/dist/docs/functions/getSlot.html +1 -1
  240. package/dist/docs/functions/getSlotLeader.html +1 -1
  241. package/dist/docs/functions/getSlotLeaders.html +1 -1
  242. package/dist/docs/functions/getStakeActivation.html +1 -1
  243. package/dist/docs/functions/getStakeMinimumDelegation.html +1 -1
  244. package/dist/docs/functions/getSupply.html +1 -1
  245. package/dist/docs/functions/getTokenAccountBalance.html +1 -1
  246. package/dist/docs/functions/getTokenAccounts.html +1 -1
  247. package/dist/docs/functions/getTokenAccountsByDelegate.html +1 -1
  248. package/dist/docs/functions/getTokenAccountsByOwner.html +1 -1
  249. package/dist/docs/functions/getTokenLargestAccounts.html +1 -1
  250. package/dist/docs/functions/getTokenSupply.html +1 -1
  251. package/dist/docs/functions/getTransaction.html +1 -1
  252. package/dist/docs/functions/getTransactionCount.html +1 -1
  253. package/dist/docs/functions/getVersion.html +1 -1
  254. package/dist/docs/functions/getVoteAccounts.html +1 -1
  255. package/dist/docs/functions/isAddress.html +6 -0
  256. package/dist/docs/functions/isBlockhashValid.html +1 -1
  257. package/dist/docs/functions/isBrowser.html +1 -1
  258. package/dist/docs/functions/isKeyPairSigner.html +6 -0
  259. package/dist/docs/functions/isKitSignature.html +6 -0
  260. package/dist/docs/functions/isProgramInCategory.html +1 -1
  261. package/dist/docs/functions/isServer.html +1 -1
  262. package/dist/docs/functions/isTransactionSigner.html +7 -0
  263. package/dist/docs/functions/isValidPubkey.html +1 -1
  264. package/dist/docs/functions/isValidSignature.html +1 -1
  265. package/dist/docs/functions/kitSignature.html +6 -0
  266. package/dist/docs/functions/kitUnixTimestamp.html +6 -0
  267. package/dist/docs/functions/lamports-1.html +6 -0
  268. package/dist/docs/functions/lamportsToSol.html +1 -1
  269. package/dist/docs/functions/listEndpoints.html +1 -1
  270. package/dist/docs/functions/listNetworks.html +1 -1
  271. package/dist/docs/functions/listRegions.html +1 -1
  272. package/dist/docs/functions/mainnet.html +2 -0
  273. package/dist/docs/functions/minimumLedgerSlot.html +1 -1
  274. package/dist/docs/functions/parseAccountUpdate.html +1 -1
  275. package/dist/docs/functions/parseBase58RpcAccount.html +7 -0
  276. package/dist/docs/functions/parseBase64RpcAccount.html +7 -0
  277. package/dist/docs/functions/parseBlockMeta.html +1 -1
  278. package/dist/docs/functions/parseEntry.html +1 -1
  279. package/dist/docs/functions/parseGeyserUpdate.html +1 -1
  280. package/dist/docs/functions/parseJsonRpcAccount.html +9 -0
  281. package/dist/docs/functions/parseSlotUpdate.html +1 -1
  282. package/dist/docs/functions/parseTimestamp.html +1 -1
  283. package/dist/docs/functions/parseTransaction.html +1 -1
  284. package/dist/docs/functions/partiallySignTransaction.html +12 -0
  285. package/dist/docs/functions/partiallySignTransactionMessageWithSigners.html +22 -0
  286. package/dist/docs/functions/pipe.html +95 -0
  287. package/dist/docs/functions/prependTransactionMessageInstruction.html +8 -0
  288. package/dist/docs/functions/prependTransactionMessageInstructions.html +8 -0
  289. package/dist/docs/functions/probeLatency.html +1 -1
  290. package/dist/docs/functions/rawBufferToBase58.html +1 -1
  291. package/dist/docs/functions/rawBufferToBase64.html +1 -1
  292. package/dist/docs/functions/rawBufferToBytes.html +1 -1
  293. package/dist/docs/functions/rawBufferToHex.html +1 -1
  294. package/dist/docs/functions/requestAirdrop.html +1 -1
  295. package/dist/docs/functions/resolveEndpoint.html +1 -1
  296. package/dist/docs/functions/resolveProgram.html +1 -1
  297. package/dist/docs/functions/resolveProgramBatch.html +1 -1
  298. package/dist/docs/functions/retry.html +1 -1
  299. package/dist/docs/functions/searchAssets.html +1 -1
  300. package/dist/docs/functions/sendAndConfirmDurableNonceTransactionFactory.html +6 -0
  301. package/dist/docs/functions/sendAndConfirmTransactionFactory.html +6 -0
  302. package/dist/docs/functions/sendTransaction.html +1 -1
  303. package/dist/docs/functions/sendTransactionWithoutConfirmingFactory.html +6 -0
  304. package/dist/docs/functions/setTransactionMessageFeePayer.html +7 -0
  305. package/dist/docs/functions/setTransactionMessageFeePayerSigner.html +8 -0
  306. package/dist/docs/functions/setTransactionMessageLifetimeUsingBlockhash.html +7 -0
  307. package/dist/docs/functions/setTransactionMessageLifetimeUsingDurableNonce.html +9 -0
  308. package/dist/docs/functions/signAndSendTransactionMessageWithSigners.html +32 -0
  309. package/dist/docs/functions/signBytes.html +7 -0
  310. package/dist/docs/functions/signTransaction.html +10 -0
  311. package/dist/docs/functions/signTransactionMessageWithSigners.html +13 -0
  312. package/dist/docs/functions/simulateTransaction.html +1 -1
  313. package/dist/docs/functions/sleep.html +1 -1
  314. package/dist/docs/functions/solToLamports.html +2 -2
  315. package/dist/docs/functions/testnet.html +2 -0
  316. package/dist/docs/functions/toClientConfig.html +1 -1
  317. package/dist/docs/functions/toKitAddress.html +8 -0
  318. package/dist/docs/functions/toKitLamports.html +6 -0
  319. package/dist/docs/functions/toKitSignatureString.html +5 -0
  320. package/dist/docs/functions/verifySignature.html +8 -0
  321. package/dist/docs/hierarchy.html +1 -1
  322. package/dist/docs/interfaces/AccountInfo.html +7 -7
  323. package/dist/docs/interfaces/AccountNotification.html +2 -2
  324. package/dist/docs/interfaces/AccountSubParams.html +2 -2
  325. package/dist/docs/interfaces/AssetSignatureInfo.html +2 -2
  326. package/dist/docs/interfaces/AssetSignaturesPage.html +2 -2
  327. package/dist/docs/interfaces/BalanceChange.html +6 -6
  328. package/dist/docs/interfaces/BlockProduction.html +3 -3
  329. package/dist/docs/interfaces/BlockResult.html +2 -2
  330. package/dist/docs/interfaces/BlockReward.html +2 -2
  331. package/dist/docs/interfaces/BlockhashResult.html +2 -2
  332. package/dist/docs/interfaces/CallOptions.html +6 -6
  333. package/dist/docs/interfaces/ConfirmedTransaction.html +6 -6
  334. package/dist/docs/interfaces/ContactInfo.html +2 -2
  335. package/dist/docs/interfaces/DasAsset.html +2 -2
  336. package/dist/docs/interfaces/DasAssetProof.html +2 -2
  337. package/dist/docs/interfaces/DasAuthority.html +2 -2
  338. package/dist/docs/interfaces/DasCompression.html +2 -2
  339. package/dist/docs/interfaces/DasContent.html +2 -2
  340. package/dist/docs/interfaces/DasCreator.html +2 -2
  341. package/dist/docs/interfaces/DasFile.html +2 -2
  342. package/dist/docs/interfaces/DasGrouping.html +2 -2
  343. package/dist/docs/interfaces/DasOpts.html +2 -2
  344. package/dist/docs/interfaces/DasOwnership.html +2 -2
  345. package/dist/docs/interfaces/DasPage.html +2 -2
  346. package/dist/docs/interfaces/DasRoyalty.html +2 -2
  347. package/dist/docs/interfaces/DasSearchParams.html +2 -2
  348. package/dist/docs/interfaces/DasSupply.html +2 -2
  349. package/dist/docs/interfaces/DataSlice.html +3 -3
  350. package/dist/docs/interfaces/DecodedAccountResult.html +10 -0
  351. package/dist/docs/interfaces/DecodedLookupTable.html +20 -0
  352. package/dist/docs/interfaces/DecodedMint.html +16 -0
  353. package/dist/docs/interfaces/DecodedMultisig.html +14 -0
  354. package/dist/docs/interfaces/DecodedNonceAccount.html +16 -0
  355. package/dist/docs/interfaces/DecodedStakeAccount.html +7 -0
  356. package/dist/docs/interfaces/DecodedToken2022Account.html +20 -0
  357. package/dist/docs/interfaces/DecodedToken2022Mint.html +14 -0
  358. package/dist/docs/interfaces/DecodedTokenAccount.html +22 -0
  359. package/dist/docs/interfaces/DefaultAccountStateExt.html +5 -0
  360. package/dist/docs/interfaces/EndpointConnectConfig.html +5 -5
  361. package/dist/docs/interfaces/EpochInfo.html +7 -7
  362. package/dist/docs/interfaces/EpochSchedule.html +2 -2
  363. package/dist/docs/interfaces/FetchedMint.html +13 -0
  364. package/dist/docs/interfaces/FetchedTokenAccount.html +13 -0
  365. package/dist/docs/interfaces/GetAccountInfoOpts.html +6 -6
  366. package/dist/docs/interfaces/GetAssetsByAuthorityParams.html +2 -2
  367. package/dist/docs/interfaces/GetAssetsByCreatorParams.html +2 -2
  368. package/dist/docs/interfaces/GetAssetsByGroupParams.html +2 -2
  369. package/dist/docs/interfaces/GetAssetsByOwnerParams.html +2 -2
  370. package/dist/docs/interfaces/GetBlockOpts.html +6 -6
  371. package/dist/docs/interfaces/GetBlockProductionOpts.html +6 -6
  372. package/dist/docs/interfaces/GetMultipleAccountsOpts.html +6 -6
  373. package/dist/docs/interfaces/GetProgramAccountsOpts.html +6 -6
  374. package/dist/docs/interfaces/GetSignatureStatusesOpts.html +6 -6
  375. package/dist/docs/interfaces/GetSignaturesOpts.html +7 -7
  376. package/dist/docs/interfaces/GetTokenAccountsParams.html +2 -2
  377. package/dist/docs/interfaces/GetTransactionOpts.html +6 -6
  378. package/dist/docs/interfaces/GeyserParserConfig.html +6 -6
  379. package/dist/docs/interfaces/GeyserParserEvents.html +9 -9
  380. package/dist/docs/interfaces/GeyserParserStats.html +2 -2
  381. package/dist/docs/interfaces/GrpcCallOptions.html +2 -2
  382. package/dist/docs/interfaces/GrpcTransportConfig.html +6 -6
  383. package/dist/docs/interfaces/ImmutableOwnerExt.html +4 -0
  384. package/dist/docs/interfaces/InflationGovernor.html +2 -2
  385. package/dist/docs/interfaces/InflationRate.html +2 -2
  386. package/dist/docs/interfaces/InflationReward.html +2 -2
  387. package/dist/docs/interfaces/InterestBearingConfigExt.html +9 -0
  388. package/dist/docs/interfaces/LatencyProbeResult.html +2 -2
  389. package/dist/docs/interfaces/LogsNotification.html +2 -2
  390. package/dist/docs/interfaces/LogsSubParams.html +2 -2
  391. package/dist/docs/interfaces/MemoTransferExt.html +5 -0
  392. package/dist/docs/interfaces/MetadataPointerExt.html +6 -0
  393. package/dist/docs/interfaces/MintCloseAuthorityExt.html +5 -0
  394. package/dist/docs/interfaces/NonTransferableExt.html +4 -0
  395. package/dist/docs/interfaces/PaginationOpts.html +2 -2
  396. package/dist/docs/interfaces/ParsedAccountUpdate.html +16 -16
  397. package/dist/docs/interfaces/ParsedBlockMeta.html +2 -2
  398. package/dist/docs/interfaces/ParsedEntry.html +2 -2
  399. package/dist/docs/interfaces/ParsedInstruction.html +9 -9
  400. package/dist/docs/interfaces/ParsedSlotUpdate.html +3 -3
  401. package/dist/docs/interfaces/ParsedTransaction.html +19 -19
  402. package/dist/docs/interfaces/PerfSample.html +2 -2
  403. package/dist/docs/interfaces/PermanentDelegateExt.html +5 -0
  404. package/dist/docs/interfaces/ProgramAccount.html +2 -2
  405. package/dist/docs/interfaces/ProgramNotification.html +2 -2
  406. package/dist/docs/interfaces/ProgramSubParams.html +2 -2
  407. package/dist/docs/interfaces/RawAccountInfo.html +2 -2
  408. package/dist/docs/interfaces/RawBlockMeta.html +2 -2
  409. package/dist/docs/interfaces/RawBuffer.html +2 -2
  410. package/dist/docs/interfaces/RawCompiledInstruction.html +2 -2
  411. package/dist/docs/interfaces/RawEntry.html +2 -2
  412. package/dist/docs/interfaces/RawGeyserUpdate.html +2 -2
  413. package/dist/docs/interfaces/RawInnerInstruction.html +2 -2
  414. package/dist/docs/interfaces/RawSlotInfo.html +2 -2
  415. package/dist/docs/interfaces/RawTimestamp.html +2 -2
  416. package/dist/docs/interfaces/RawTokenBalance.html +2 -2
  417. package/dist/docs/interfaces/RawTransactionInfo.html +2 -2
  418. package/dist/docs/interfaces/RootNotification.html +2 -2
  419. package/dist/docs/interfaces/RootSubParams.html +1 -1
  420. package/dist/docs/interfaces/RpcContext.html +2 -2
  421. package/dist/docs/interfaces/RpcError.html +4 -4
  422. package/dist/docs/interfaces/RpcRequest.html +2 -2
  423. package/dist/docs/interfaces/RpcResponse.html +2 -2
  424. package/dist/docs/interfaces/SendTransactionOpts.html +6 -6
  425. package/dist/docs/interfaces/SignatureInfo.html +7 -7
  426. package/dist/docs/interfaces/SignatureNotification.html +2 -2
  427. package/dist/docs/interfaces/SignatureStatus.html +5 -5
  428. package/dist/docs/interfaces/SignatureSubParams.html +2 -2
  429. package/dist/docs/interfaces/SignaturesForAssetParams.html +2 -2
  430. package/dist/docs/interfaces/SimulateResult.html +2 -2
  431. package/dist/docs/interfaces/SimulateTransactionOpts.html +7 -7
  432. package/dist/docs/interfaces/SlotNotification.html +2 -2
  433. package/dist/docs/interfaces/SlotSubParams.html +1 -1
  434. package/dist/docs/interfaces/SortOpts.html +2 -2
  435. package/dist/docs/interfaces/StakeAuthorized.html +5 -0
  436. package/dist/docs/interfaces/StakeDelegation.html +9 -0
  437. package/dist/docs/interfaces/StakeLockup.html +9 -0
  438. package/dist/docs/interfaces/StakeMeta.html +6 -0
  439. package/dist/docs/interfaces/Supply.html +5 -5
  440. package/dist/docs/interfaces/SynapseClientConfig.html +9 -9
  441. package/dist/docs/interfaces/SynapseEndpoint.html +7 -7
  442. package/dist/docs/interfaces/TokenAccount.html +3 -3
  443. package/dist/docs/interfaces/TokenAccountsByOwnerResult.html +2 -2
  444. package/dist/docs/interfaces/TokenAmount.html +5 -5
  445. package/dist/docs/interfaces/TokenBalanceChange.html +2 -2
  446. package/dist/docs/interfaces/TransactionMessageWithBlockhashLifetime.html +12 -0
  447. package/dist/docs/interfaces/TransactionMeta.html +11 -11
  448. package/dist/docs/interfaces/TransferFeeAmount.html +5 -0
  449. package/dist/docs/interfaces/TransferFeeConfig.html +9 -0
  450. package/dist/docs/interfaces/TransportConfig.html +7 -7
  451. package/dist/docs/interfaces/UnknownExtension.html +6 -0
  452. package/dist/docs/interfaces/VoteAccount.html +9 -9
  453. package/dist/docs/interfaces/VoteAccountsResult.html +3 -3
  454. package/dist/docs/interfaces/WsConfig.html +6 -6
  455. package/dist/docs/media/CHANGELOG.md +61 -0
  456. package/dist/docs/modules.html +182 -6
  457. package/dist/docs/types/AccountFetchOpts.html +3 -0
  458. package/dist/docs/types/AccountFilter.html +1 -1
  459. package/dist/docs/types/Address.html +5 -0
  460. package/dist/docs/types/Base58.html +1 -1
  461. package/dist/docs/types/Brand.html +1 -1
  462. package/dist/docs/types/Commitment.html +1 -1
  463. package/dist/docs/types/DasSortBy.html +1 -1
  464. package/dist/docs/types/DasSortDirection.html +1 -1
  465. package/dist/docs/types/DataSizeFilter.html +1 -1
  466. package/dist/docs/types/DecodedExtension.html +3 -0
  467. package/dist/docs/types/Encoding.html +1 -1
  468. package/dist/docs/types/Epoch.html +1 -1
  469. package/dist/docs/types/KeyPairSigner.html +17 -0
  470. package/dist/docs/types/KitCommitment.html +4 -0
  471. package/dist/docs/types/Lamports.html +2 -1
  472. package/dist/docs/types/LogsFilter.html +1 -1
  473. package/dist/docs/types/MemcmpFilter.html +1 -1
  474. package/dist/docs/types/MessagePartialSigner.html +23 -0
  475. package/dist/docs/types/MessageSigner.html +8 -0
  476. package/dist/docs/types/NonceState.html +3 -0
  477. package/dist/docs/types/NoopSigner.html +18 -0
  478. package/dist/docs/types/ParsedGeyserUpdate.html +1 -1
  479. package/dist/docs/types/Pubkey.html +3 -2
  480. package/dist/docs/types/Rpc.html +4 -0
  481. package/dist/docs/types/RpcSubscriptions.html +5 -0
  482. package/dist/docs/types/RpcTransport.html +3 -0
  483. package/dist/docs/types/RuntimeEnv.html +1 -1
  484. package/dist/docs/types/Signature.html +3 -2
  485. package/dist/docs/types/SignatureBytes.html +5 -0
  486. package/dist/docs/types/Slot.html +1 -1
  487. package/dist/docs/types/SolanaRpcApi.html +3 -0
  488. package/dist/docs/types/SolanaRpcApiDevnet.html +3 -0
  489. package/dist/docs/types/SolanaRpcApiMainnet.html +4 -0
  490. package/dist/docs/types/SolanaRpcApiTestnet.html +3 -0
  491. package/dist/docs/types/SolanaRpcSubscriptionsApi.html +1 -0
  492. package/dist/docs/types/StakeAccountType.html +3 -0
  493. package/dist/docs/types/SubscriptionId.html +1 -1
  494. package/dist/docs/types/TokenAccountState.html +3 -0
  495. package/dist/docs/types/TransactionDetail.html +1 -1
  496. package/dist/docs/types/TransactionMessage.html +1 -0
  497. package/dist/docs/types/TransactionModifyingSigner.html +30 -0
  498. package/dist/docs/types/TransactionPartialSigner.html +22 -0
  499. package/dist/docs/types/TransactionSendingSigner.html +33 -0
  500. package/dist/docs/types/TransactionSigner.html +9 -0
  501. package/dist/docs/types/UnaryMethod.html +1 -1
  502. package/dist/docs/types/UnixTimestamp.html +1 -1
  503. package/dist/docs/types/WsNotification.html +1 -1
  504. package/dist/docs/variables/DEFAULT_RPC_CONFIG.html +6 -0
  505. package/dist/docs/variables/DEFAULT_RPC_SUBSCRIPTIONS_CONFIG.html +1 -0
  506. package/dist/docs/variables/JUPITER_PROGRAMS.html +1 -1
  507. package/dist/docs/variables/KNOWN_PROGRAMS.html +1 -1
  508. package/dist/docs/variables/KNOWN_PROGRAMS_COUNT.html +1 -1
  509. package/dist/docs/variables/LOOKUP_TABLE_HEADER_SIZE.html +3 -0
  510. package/dist/docs/variables/LOOKUP_TABLE_PROGRAM_ID.html +3 -0
  511. package/dist/docs/variables/MARINADE_PROGRAMS.html +1 -1
  512. package/dist/docs/variables/MAX_MULTISIG_SIGNERS.html +3 -0
  513. package/dist/docs/variables/METAPLEX_PROGRAMS.html +1 -1
  514. package/dist/docs/variables/METEORA_PROGRAMS.html +1 -1
  515. package/dist/docs/variables/MINT_SIZE.html +3 -0
  516. package/dist/docs/variables/MULTISIG_SIZE.html +3 -0
  517. package/dist/docs/variables/NONCE_ACCOUNT_SIZE.html +3 -0
  518. package/dist/docs/variables/ORCA_PROGRAMS.html +1 -1
  519. package/dist/docs/variables/OTHER_PROGRAMS.html +1 -1
  520. package/dist/docs/variables/RAYDIUM_PROGRAMS.html +1 -1
  521. package/dist/docs/variables/SDK_USER_AGENT.html +1 -1
  522. package/dist/docs/variables/SPL_PROGRAMS.html +1 -1
  523. package/dist/docs/variables/STAKE_PROGRAM_ID.html +3 -0
  524. package/dist/docs/variables/SYNAPSE_DEVNET_EU.html +1 -1
  525. package/dist/docs/variables/SYNAPSE_DEVNET_US.html +1 -1
  526. package/dist/docs/variables/SYNAPSE_ENDPOINTS.html +1 -1
  527. package/dist/docs/variables/SYNAPSE_MAINNET_EU.html +1 -1
  528. package/dist/docs/variables/SYNAPSE_MAINNET_US.html +1 -1
  529. package/dist/docs/variables/SYSTEM_PROGRAMS.html +1 -1
  530. package/dist/docs/variables/SYSTEM_PROGRAM_ID.html +3 -0
  531. package/dist/docs/variables/TOKEN_2022_PROGRAM_ID.html +3 -0
  532. package/dist/docs/variables/TOKEN_ACCOUNT_SIZE.html +3 -0
  533. package/dist/docs/variables/TOKEN_PROGRAM_ID.html +3 -0
  534. package/dist/esm/accounts/helpers.d.ts +88 -0
  535. package/dist/esm/accounts/helpers.d.ts.map +1 -0
  536. package/dist/esm/accounts/helpers.js +112 -0
  537. package/dist/esm/accounts/helpers.js.map +1 -0
  538. package/dist/esm/accounts/index.d.ts +105 -0
  539. package/dist/esm/accounts/index.d.ts.map +1 -0
  540. package/dist/esm/accounts/index.js +124 -0
  541. package/dist/esm/accounts/index.js.map +1 -0
  542. package/dist/esm/accounts/lookup.d.ts +30 -0
  543. package/dist/esm/accounts/lookup.d.ts.map +1 -0
  544. package/dist/esm/accounts/lookup.js +28 -0
  545. package/dist/esm/accounts/lookup.js.map +1 -0
  546. package/dist/esm/accounts/nonce.d.ts +30 -0
  547. package/dist/esm/accounts/nonce.d.ts.map +1 -0
  548. package/dist/esm/accounts/nonce.js +28 -0
  549. package/dist/esm/accounts/nonce.js.map +1 -0
  550. package/dist/esm/accounts/stake.d.ts +33 -0
  551. package/dist/esm/accounts/stake.d.ts.map +1 -0
  552. package/dist/esm/accounts/stake.js +31 -0
  553. package/dist/esm/accounts/stake.js.map +1 -0
  554. package/dist/esm/accounts/token.d.ts +98 -0
  555. package/dist/esm/accounts/token.d.ts.map +1 -0
  556. package/dist/esm/accounts/token.js +121 -0
  557. package/dist/esm/accounts/token.js.map +1 -0
  558. package/dist/esm/ai/gateway/index.js +2 -2
  559. package/dist/esm/ai/gateway/x402/facilitator.d.ts +4 -4
  560. package/dist/esm/ai/gateway/x402/facilitator.js +4 -4
  561. package/dist/esm/ai/index.js +2 -2
  562. package/dist/esm/ai/tools/index.js +3 -3
  563. package/dist/esm/ai/tools/protocols/index.js +6 -6
  564. package/dist/esm/ai/tools/zod/index.d.ts +1 -1
  565. package/dist/esm/ai/tools/zod/index.d.ts.map +1 -1
  566. package/dist/esm/ai/tools/zod/index.js +2 -2
  567. package/dist/esm/ai/tools/zod/index.js.map +1 -1
  568. package/dist/esm/ai/tools/zod/types.d.ts +2 -0
  569. package/dist/esm/ai/tools/zod/types.d.ts.map +1 -1
  570. package/dist/esm/ai/tools/zod/types.js.map +1 -1
  571. package/dist/esm/core/client.d.ts +97 -9
  572. package/dist/esm/core/client.d.ts.map +1 -1
  573. package/dist/esm/core/client.js +120 -5
  574. package/dist/esm/core/client.js.map +1 -1
  575. package/dist/esm/core/transport.d.ts +1 -1
  576. package/dist/esm/core/transport.d.ts.map +1 -1
  577. package/dist/esm/core/transport.js +5 -5
  578. package/dist/esm/core/transport.js.map +1 -1
  579. package/dist/esm/core/types.d.ts +23 -4
  580. package/dist/esm/core/types.d.ts.map +1 -1
  581. package/dist/esm/core/types.js +5 -1
  582. package/dist/esm/core/types.js.map +1 -1
  583. package/dist/esm/decoders/index.d.ts +36 -0
  584. package/dist/esm/decoders/index.d.ts.map +1 -0
  585. package/dist/esm/decoders/index.js +37 -0
  586. package/dist/esm/decoders/index.js.map +1 -0
  587. package/dist/esm/decoders/layout.d.ts +105 -0
  588. package/dist/esm/decoders/layout.d.ts.map +1 -0
  589. package/dist/esm/decoders/layout.js +183 -0
  590. package/dist/esm/decoders/layout.js.map +1 -0
  591. package/dist/esm/decoders/lookup-table.d.ts +60 -0
  592. package/dist/esm/decoders/lookup-table.d.ts.map +1 -0
  593. package/dist/esm/decoders/lookup-table.js +71 -0
  594. package/dist/esm/decoders/lookup-table.js.map +1 -0
  595. package/dist/esm/decoders/multisig.d.ts +49 -0
  596. package/dist/esm/decoders/multisig.d.ts.map +1 -0
  597. package/dist/esm/decoders/multisig.js +46 -0
  598. package/dist/esm/decoders/multisig.js.map +1 -0
  599. package/dist/esm/decoders/nonce.d.ts +54 -0
  600. package/dist/esm/decoders/nonce.d.ts.map +1 -0
  601. package/dist/esm/decoders/nonce.js +44 -0
  602. package/dist/esm/decoders/nonce.js.map +1 -0
  603. package/dist/esm/decoders/stake.d.ts +65 -0
  604. package/dist/esm/decoders/stake.d.ts.map +1 -0
  605. package/dist/esm/decoders/stake.js +82 -0
  606. package/dist/esm/decoders/stake.js.map +1 -0
  607. package/dist/esm/decoders/token-2022.d.ts +134 -0
  608. package/dist/esm/decoders/token-2022.d.ts.map +1 -0
  609. package/dist/esm/decoders/token-2022.js +155 -0
  610. package/dist/esm/decoders/token-2022.js.map +1 -0
  611. package/dist/esm/decoders/token.d.ts +87 -0
  612. package/dist/esm/decoders/token.d.ts.map +1 -0
  613. package/dist/esm/decoders/token.js +66 -0
  614. package/dist/esm/decoders/token.js.map +1 -0
  615. package/dist/esm/index.d.ts +3 -0
  616. package/dist/esm/index.d.ts.map +1 -1
  617. package/dist/esm/index.js +6 -0
  618. package/dist/esm/index.js.map +1 -1
  619. package/dist/esm/kit/index.d.ts +94 -0
  620. package/dist/esm/kit/index.d.ts.map +1 -0
  621. package/dist/esm/kit/index.js +100 -0
  622. package/dist/esm/kit/index.js.map +1 -0
  623. package/package.json +45 -48
@@ -0,0 +1,66 @@
1
+ /**
2
+ * SPL Token account and mint decoders.
3
+ *
4
+ * Decodes raw bytes from SPL Token program accounts into typed objects.
5
+ * Supports both Token Account (165 bytes) and Mint (82 bytes) layouts.
6
+ *
7
+ * @module decoders/token
8
+ * @since 1.1.0
9
+ */
10
+ import { AccountReader } from './layout.js';
11
+ const TOKEN_ACCOUNT_STATES = [
12
+ 'uninitialized', 'initialized', 'frozen',
13
+ ];
14
+ // ── Constants ──────────────────────────────────────────────────
15
+ /** Expected size of an SPL Token Account. @since 1.1.0 */
16
+ export const TOKEN_ACCOUNT_SIZE = 165;
17
+ /** Expected size of an SPL Token Mint. @since 1.1.0 */
18
+ export const MINT_SIZE = 82;
19
+ /** SPL Token Program ID. @since 1.1.0 */
20
+ export const TOKEN_PROGRAM_ID = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
21
+ // ── Decoder functions ──────────────────────────────────────────
22
+ /**
23
+ * Decode raw bytes into a {@link DecodedTokenAccount}.
24
+ *
25
+ * @param data - Raw account data (must be >= 165 bytes).
26
+ * @returns Decoded token account.
27
+ * @throws {Error} If data is too short.
28
+ * @since 1.1.0
29
+ */
30
+ export function decodeTokenAccount(data) {
31
+ if (data.length < TOKEN_ACCOUNT_SIZE) {
32
+ throw new Error(`Token account data too short: expected >= ${TOKEN_ACCOUNT_SIZE} bytes, got ${data.length}`);
33
+ }
34
+ const r = new AccountReader(data);
35
+ const mint = r.pubkey(); // 32 bytes [0..32]
36
+ const owner = r.pubkey(); // 32 bytes [32..64]
37
+ const amount = r.u64(); // 8 bytes [64..72]
38
+ const delegate = r.coption(() => r.pubkey()); // 4+32=36 bytes [72..108]
39
+ const stateIdx = r.u8(); // 1 byte [108]
40
+ const state = TOKEN_ACCOUNT_STATES[stateIdx] ?? 'uninitialized';
41
+ const isNative = r.coption(() => r.u64()); // 4+8=12 bytes [109..121]
42
+ const delegatedAmount = r.u64(); // 8 bytes [121..129]
43
+ const closeAuthority = r.coption(() => r.pubkey()); // 4+32=36 bytes [129..165]
44
+ return { mint, owner, amount, delegate, state, isNative, delegatedAmount, closeAuthority };
45
+ }
46
+ /**
47
+ * Decode raw bytes into a {@link DecodedMint}.
48
+ *
49
+ * @param data - Raw account data (must be >= 82 bytes).
50
+ * @returns Decoded mint.
51
+ * @throws {Error} If data is too short.
52
+ * @since 1.1.0
53
+ */
54
+ export function decodeMint(data) {
55
+ if (data.length < MINT_SIZE) {
56
+ throw new Error(`Mint data too short: expected >= ${MINT_SIZE} bytes, got ${data.length}`);
57
+ }
58
+ const r = new AccountReader(data);
59
+ const mintAuthority = r.coption(() => r.pubkey()); // 4+32=36 bytes [0..36]
60
+ const supply = r.u64(); // 8 bytes [36..44]
61
+ const decimals = r.u8(); // 1 byte [44]
62
+ const isInitialized = r.bool(); // 1 byte [45]
63
+ const freezeAuthority = r.coption(() => r.pubkey()); // 4+32=36 bytes [46..82]
64
+ return { mintAuthority, supply, decimals, isInitialized, freezeAuthority };
65
+ }
66
+ //# sourceMappingURL=token.js.map
@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-28,6 +28,9 @@ export * from './grpc/index';
28
28
  export * from './das/index';
29
29
  export * from './websocket/index';
30
30
  export * from './utils/index';
31
+ export * from './kit/index';
32
+ export * from './decoders/index';
33
+ export * from './accounts/index';
31
34
  import { SynapseClient, type SynapseClientConfig } from './core/client';
32
35
  /**
33
36
  * Convenience factory to create a {@link SynapseClient} instance.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAG9B,cAAc,aAAa,CAAC;AAG5B,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAG5B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxE;;;;;;;;;;;GAWG,CAAA,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAE3E;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAG9B,cAAc,aAAa,CAAC;AAG5B,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAG5B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,eAAe,CAAC;AAG9B,cAAc,aAAa,CAAC;AAG5B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxE;;;;;;;;;;;GAWG,CAAA,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAE3E;AAED,eAAe,aAAa,CAAC"}
package/dist/esm/index.js CHANGED
@@ -35,6 +35,12 @@ export * from './das/index.js';
35
35
  export * from './websocket/index.js';
36
36
  // ── Utility helpers ────────────────────────────────────────────
37
37
  export * from './utils/index.js';
38
+ // ── @solana/kit bridge (native types, signers, RPC) ────────────
39
+ export * from './kit/index.js';
40
+ // ── Native account data decoders (zero-dep, DataView-based) ────
41
+ export * from './decoders/index.js';
42
+ // ── Typed account fetchers (RPC + decode in one call) ──────────
43
+ export * from './accounts/index.js';
38
44
  // ── Convenience factory ────────────────────────────────────────
39
45
  import { SynapseClient } from './core/client.js';
40
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mEAAmE;AACnE,cAAc,cAAc,CAAC;AAE7B,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,iEAAiE;AACjE,cAAc,aAAa,CAAC;AAE5B,kEAAkE;AAClE,cAAc,cAAc,CAAC;AAE7B,kEAAkE;AAClE,cAAc,aAAa,CAAC;AAE5B,kEAAkE;AAClE,cAAc,mBAAmB,CAAC;AAElC,kEAAkE;AAClE,cAAc,eAAe,CAAC;AAE9B,kEAAkE;AAClE,OAAO,EAAE,aAAa,EAA4B,MAAM,eAAe,CAAC;AACxE;;;;;;;;;;;GAWG,CAAA,MAAM,UAAU,aAAa,CAAC,MAA2B;IAC1D,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mEAAmE;AACnE,cAAc,cAAc,CAAC;AAE7B,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,iEAAiE;AACjE,cAAc,aAAa,CAAC;AAE5B,kEAAkE;AAClE,cAAc,cAAc,CAAC;AAE7B,kEAAkE;AAClE,cAAc,aAAa,CAAC;AAE5B,kEAAkE;AAClE,cAAc,mBAAmB,CAAC;AAElC,kEAAkE;AAClE,cAAc,eAAe,CAAC;AAE9B,kEAAkE;AAClE,cAAc,aAAa,CAAC;AAE5B,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AAEjC,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AAEjC,kEAAkE;AAClE,OAAO,EAAE,aAAa,EAA4B,MAAM,eAAe,CAAC;AACxE;;;;;;;;;;;GAWG,CAAA,MAAM,UAAU,aAAa,CAAC,MAA2B;IAC1D,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @solana/kit bridge — native Solana types, signers, and RPC for the Synapse SDK.
3
+ *
4
+ * This module re-exports curated types and functions from `@solana/kit` (the
5
+ * official Anza Solana TypeScript SDK) and provides bridge utilities to convert
6
+ * between Synapse branded types and Kit native types.
7
+ *
8
+ * @module kit
9
+ * @since 1.1.0
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { SynapseClient } from '@oobe-protocol-labs/synapse-client-sdk';
14
+ * import { toKitAddress, generateKeyPairSigner } from '@oobe-protocol-labs/synapse-client-sdk/kit';
15
+ *
16
+ * const client = new SynapseClient({ endpoint: 'https://rpc.synapse.com' });
17
+ *
18
+ * // Bridge Synapse Pubkey -> Kit Address
19
+ * const addr = toKitAddress(Pubkey('So11111111111111111111111111111111111111112'));
20
+ *
21
+ * // Use Kit's native RPC (fully typed 53 methods)
22
+ * const kitRpc = client.kitRpc;
23
+ * const balance = await kitRpc.getBalance(addr).send();
24
+ *
25
+ * // Generate a signer
26
+ * const signer = await generateKeyPairSigner();
27
+ * ```
28
+ */
29
+ export type { Address } from '@solana/kit';
30
+ export { address, isAddress, assertIsAddress, getAddressFromPublicKey, getAddressEncoder, getAddressDecoder, getAddressCodec, getAddressComparator, getProgramDerivedAddress, createAddressWithSeed, } from '@solana/kit';
31
+ export type { SignatureBytes } from '@solana/kit';
32
+ export { generateKeyPair, createKeyPairFromBytes, createKeyPairFromPrivateKeyBytes, signBytes, verifySignature, signature as kitSignature, isSignature as isKitSignature, assertIsSignature as assertIsKitSignature, } from '@solana/kit';
33
+ export type { KeyPairSigner, TransactionSigner, MessageSigner, TransactionPartialSigner, MessagePartialSigner, NoopSigner, TransactionModifyingSigner, TransactionSendingSigner, } from '@solana/kit';
34
+ export { generateKeyPairSigner, createKeyPairSignerFromBytes, createKeyPairSignerFromPrivateKeyBytes, createSignerFromKeyPair, createNoopSigner, isKeyPairSigner, assertIsKeyPairSigner, isTransactionSigner, assertIsTransactionSigner, addSignersToTransactionMessage, } from '@solana/kit';
35
+ export type { Rpc, RpcTransport, SolanaRpcApi, SolanaRpcApiDevnet, SolanaRpcApiMainnet, SolanaRpcApiTestnet, } from '@solana/kit';
36
+ export { createSolanaRpc, createSolanaRpcFromTransport, createSolanaRpcApi, createDefaultRpcTransport, createRpc, DEFAULT_RPC_CONFIG, } from '@solana/kit';
37
+ export type { RpcSubscriptions, SolanaRpcSubscriptionsApi, } from '@solana/kit';
38
+ export { createSolanaRpcSubscriptions, createSolanaRpcSubscriptions_UNSTABLE, createSolanaRpcSubscriptionsFromTransport, createSolanaRpcSubscriptionsApi, createDefaultRpcSubscriptionsTransport, createDefaultSolanaRpcSubscriptionsChannelCreator, DEFAULT_RPC_SUBSCRIPTIONS_CONFIG, } from '@solana/kit';
39
+ export type { TransactionMessage, TransactionMessageWithBlockhashLifetime, } from '@solana/kit';
40
+ export { createTransactionMessage, setTransactionMessageFeePayer, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce, appendTransactionMessageInstruction, appendTransactionMessageInstructions, prependTransactionMessageInstruction, prependTransactionMessageInstructions, compileTransaction, compileTransactionMessage, signTransactionMessageWithSigners, partiallySignTransactionMessageWithSigners, signAndSendTransactionMessageWithSigners, partiallySignTransaction, signTransaction, pipe, } from '@solana/kit';
41
+ export { sendAndConfirmTransactionFactory, sendAndConfirmDurableNonceTransactionFactory, sendTransactionWithoutConfirmingFactory, airdropFactory, } from '@solana/kit';
42
+ export type { Commitment as KitCommitment } from '@solana/kit';
43
+ export { lamports, blockhash, unixTimestamp as kitUnixTimestamp, commitmentComparator, } from '@solana/kit';
44
+ export { devnet, mainnet, testnet, } from '@solana/kit';
45
+ export { fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, decodeAccount, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount, assertAccountExists, assertAccountDecoded, } from '@solana/kit';
46
+ export { AccountRole } from '@solana/kit';
47
+ export { getBase58Encoder, getBase58Decoder, getBase58Codec, getBase64Encoder, getBase64Decoder, getBase64Codec, } from '@solana/kit';
48
+ export { SolanaError } from '@solana/kit';
49
+ export { createSignableMessage, } from '@solana/kit';
50
+ import type { Address } from '@solana/kit';
51
+ import type { Pubkey, Signature as SynapseSig, Lamports as SynapseLamports } from '../core/types';
52
+ /**
53
+ * Convert a Synapse branded {@link Pubkey} to a Kit {@link Address}.
54
+ *
55
+ * @param pubkey - A Synapse `Pubkey` (base58 string).
56
+ * @returns A Kit `Address` with full type-level validation.
57
+ * @since 1.1.0
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * import { Pubkey } from '@oobe-protocol-labs/synapse-client-sdk';
62
+ * import { toKitAddress } from '@oobe-protocol-labs/synapse-client-sdk/kit';
63
+ *
64
+ * const addr = toKitAddress(Pubkey('So11111111111111111111111111111111111111112'));
65
+ * ```
66
+ */
67
+ export declare function toKitAddress(pubkey: Pubkey): Address;
68
+ /**
69
+ * Convert a Kit {@link Address} to a Synapse branded {@link Pubkey}.
70
+ *
71
+ * @param addr - A Kit `Address`.
72
+ * @returns A Synapse `Pubkey`.
73
+ * @since 1.1.0
74
+ */
75
+ export declare function fromKitAddress(addr: Address): Pubkey;
76
+ /**
77
+ * Convert a Synapse branded {@link Signature} to a Kit signature string.
78
+ *
79
+ * @param sig - A Synapse `Signature` (base58 string).
80
+ * @returns The raw base58 string (Kit uses plain strings for tx signatures in RPC responses).
81
+ * @since 1.1.0
82
+ */
83
+ export declare function toKitSignatureString(sig: SynapseSig): string;
84
+ /**
85
+ * Convert a Synapse branded {@link Lamports} (bigint) to Kit lamports.
86
+ *
87
+ * Kit's `lamports()` factory produces an opaque branded bigint.
88
+ *
89
+ * @param amount - Synapse `Lamports` (bigint).
90
+ * @returns Kit-branded lamports value.
91
+ * @since 1.1.0
92
+ */
93
+ export declare function toKitLamports(amount: SynapseLamports): import("@solana/kit").Lamports;
94
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAOH,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gCAAgC,EAChC,SAAS,EACT,eAAe,EACf,SAAS,IAAI,YAAY,EACzB,WAAW,IAAI,cAAc,EAC7B,iBAAiB,IAAI,oBAAoB,GAC1C,MAAM,aAAa,CA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AE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,QAAQ,EACR,SAAS,EACT,aAAa,IAAI,gBAAgB,EACjC,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,MAAM,EACN,OAAO,EACP,OAAO,GACR,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EACL,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAMrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,UAAU,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAE5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,kCAEpD"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * @solana/kit bridge — native Solana types, signers, and RPC for the Synapse SDK.
3
+ *
4
+ * This module re-exports curated types and functions from `@solana/kit` (the
5
+ * official Anza Solana TypeScript SDK) and provides bridge utilities to convert
6
+ * between Synapse branded types and Kit native types.
7
+ *
8
+ * @module kit
9
+ * @since 1.1.0
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { SynapseClient } from '@oobe-protocol-labs/synapse-client-sdk';
14
+ * import { toKitAddress, generateKeyPairSigner } from '@oobe-protocol-labs/synapse-client-sdk/kit';
15
+ *
16
+ * const client = new SynapseClient({ endpoint: 'https://rpc.synapse.com' });
17
+ *
18
+ * // Bridge Synapse Pubkey -> Kit Address
19
+ * const addr = toKitAddress(Pubkey('So11111111111111111111111111111111111111112'));
20
+ *
21
+ * // Use Kit's native RPC (fully typed 53 methods)
22
+ * const kitRpc = client.kitRpc;
23
+ * const balance = await kitRpc.getBalance(addr).send();
24
+ *
25
+ * // Generate a signer
26
+ * const signer = await generateKeyPairSigner();
27
+ * ```
28
+ */
29
+ export { address, isAddress, assertIsAddress, getAddressFromPublicKey, getAddressEncoder, getAddressDecoder, getAddressCodec, getAddressComparator, getProgramDerivedAddress, createAddressWithSeed, } from '@solana/kit';
30
+ export { generateKeyPair, createKeyPairFromBytes, createKeyPairFromPrivateKeyBytes, signBytes, verifySignature, signature as kitSignature, isSignature as isKitSignature, assertIsSignature as assertIsKitSignature, } from '@solana/kit';
31
+ export { generateKeyPairSigner, createKeyPairSignerFromBytes, createKeyPairSignerFromPrivateKeyBytes, createSignerFromKeyPair, createNoopSigner, isKeyPairSigner, assertIsKeyPairSigner, isTransactionSigner, assertIsTransactionSigner, addSignersToTransactionMessage, } from '@solana/kit';
32
+ export { createSolanaRpc, createSolanaRpcFromTransport, createSolanaRpcApi, createDefaultRpcTransport, createRpc, DEFAULT_RPC_CONFIG, } from '@solana/kit';
33
+ export { createSolanaRpcSubscriptions, createSolanaRpcSubscriptions_UNSTABLE, createSolanaRpcSubscriptionsFromTransport, createSolanaRpcSubscriptionsApi, createDefaultRpcSubscriptionsTransport, createDefaultSolanaRpcSubscriptionsChannelCreator, DEFAULT_RPC_SUBSCRIPTIONS_CONFIG, } from '@solana/kit';
34
+ export { createTransactionMessage, setTransactionMessageFeePayer, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageLifetimeUsingDurableNonce, appendTransactionMessageInstruction, appendTransactionMessageInstructions, prependTransactionMessageInstruction, prependTransactionMessageInstructions, compileTransaction, compileTransactionMessage, signTransactionMessageWithSigners, partiallySignTransactionMessageWithSigners, signAndSendTransactionMessageWithSigners, partiallySignTransaction, signTransaction, pipe, } from '@solana/kit';
35
+ // ── Transaction sending & confirmation ─────────────────────────
36
+ export { sendAndConfirmTransactionFactory, sendAndConfirmDurableNonceTransactionFactory, sendTransactionWithoutConfirmingFactory, airdropFactory, } from '@solana/kit';
37
+ export { lamports, blockhash, unixTimestamp as kitUnixTimestamp, commitmentComparator, } from '@solana/kit';
38
+ // ── Cluster helpers ────────────────────────────────────────────
39
+ export { devnet, mainnet, testnet, } from '@solana/kit';
40
+ // ── Account helpers ────────────────────────────────────────────
41
+ export { fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, decodeAccount, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount, assertAccountExists, assertAccountDecoded, } from '@solana/kit';
42
+ export { AccountRole } from '@solana/kit';
43
+ // ── Codecs ─────────────────────────────────────────────────────
44
+ export { getBase58Encoder, getBase58Decoder, getBase58Codec, getBase64Encoder, getBase64Decoder, getBase64Codec, } from '@solana/kit';
45
+ // ── Errors ─────────────────────────────────────────────────────
46
+ export { SolanaError } from '@solana/kit';
47
+ // ── Offchain messages ──────────────────────────────────────────
48
+ export { createSignableMessage, } from '@solana/kit';
49
+ import { address as kitAddress, lamports as kitLamportsFactory, } from '@solana/kit';
50
+ /**
51
+ * Convert a Synapse branded {@link Pubkey} to a Kit {@link Address}.
52
+ *
53
+ * @param pubkey - A Synapse `Pubkey` (base58 string).
54
+ * @returns A Kit `Address` with full type-level validation.
55
+ * @since 1.1.0
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * import { Pubkey } from '@oobe-protocol-labs/synapse-client-sdk';
60
+ * import { toKitAddress } from '@oobe-protocol-labs/synapse-client-sdk/kit';
61
+ *
62
+ * const addr = toKitAddress(Pubkey('So11111111111111111111111111111111111111112'));
63
+ * ```
64
+ */
65
+ export function toKitAddress(pubkey) {
66
+ return kitAddress(pubkey);
67
+ }
68
+ /**
69
+ * Convert a Kit {@link Address} to a Synapse branded {@link Pubkey}.
70
+ *
71
+ * @param addr - A Kit `Address`.
72
+ * @returns A Synapse `Pubkey`.
73
+ * @since 1.1.0
74
+ */
75
+ export function fromKitAddress(addr) {
76
+ return addr;
77
+ }
78
+ /**
79
+ * Convert a Synapse branded {@link Signature} to a Kit signature string.
80
+ *
81
+ * @param sig - A Synapse `Signature` (base58 string).
82
+ * @returns The raw base58 string (Kit uses plain strings for tx signatures in RPC responses).
83
+ * @since 1.1.0
84
+ */
85
+ export function toKitSignatureString(sig) {
86
+ return sig;
87
+ }
88
+ /**
89
+ * Convert a Synapse branded {@link Lamports} (bigint) to Kit lamports.
90
+ *
91
+ * Kit's `lamports()` factory produces an opaque branded bigint.
92
+ *
93
+ * @param amount - Synapse `Lamports` (bigint).
94
+ * @returns Kit-branded lamports value.
95
+ * @since 1.1.0
96
+ */
97
+ export function toKitLamports(amount) {
98
+ return kitLamportsFactory(amount);
99
+ }
100
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/kit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAQH,OAAO,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAIrB,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gCAAgC,E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EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,kEAAkE;AAClE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,kEAAkE;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,kEAAkE;AAClE,OAAO,EACL,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAOrB,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,QAAQ,IAAI,kBAAkB,GAC/B,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,UAAU,CAAC,MAA2B,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAa;IAC1C,OAAO,IAAyB,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAe;IAClD,OAAO,GAAwB,CAAC;AAClC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,MAAuB;IACnD,OAAO,kBAAkB,CAAC,MAA2B,CAAC,CAAC;AACzD,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@oobe-protocol-labs/synapse-client-sdk",
3
- "version": "1.0.1",
4
- "description": "Synapse Client SDK - RPC Client for Solana with WebSocket, Smart Caching, Circuit Breaker & Load Balancing | Powered by oobeprotocol.ai (OOBE)",
5
-
3
+ "version": "1.0.3",
4
+ "description": "Synapse Client SDK -- Typed Solana RPC gateway with @solana/kit native types, 53 JSON-RPC methods, DAS, WebSocket, gRPC/Geyser parser, signers/wallets, and AI agent tooling (LangChain, x402) | Powered by oobeprotocol.ai (OOBE)",
6
5
  "main": "dist/cjs/index.js",
7
6
  "module": "dist/esm/index.js",
8
7
  "types": "dist/esm/index.d.ts",
@@ -51,6 +50,21 @@
51
50
  "types": "./dist/esm/ai/index.d.ts",
52
51
  "import": "./dist/esm/ai/index.js",
53
52
  "require": "./dist/cjs/ai/index.js"
53
+ },
54
+ "./kit": {
55
+ "types": "./dist/esm/kit/index.d.ts",
56
+ "import": "./dist/esm/kit/index.js",
57
+ "require": "./dist/cjs/kit/index.js"
58
+ },
59
+ "./decoders": {
60
+ "types": "./dist/esm/decoders/index.d.ts",
61
+ "import": "./dist/esm/decoders/index.js",
62
+ "require": "./dist/cjs/decoders/index.js"
63
+ },
64
+ "./accounts": {
65
+ "types": "./dist/esm/accounts/index.d.ts",
66
+ "import": "./dist/esm/accounts/index.js",
67
+ "require": "./dist/cjs/accounts/index.js"
54
68
  }
55
69
  },
56
70
  "files": [
@@ -77,7 +91,7 @@
77
91
  "build:docs": "typedoc --out dist/docs src/index.ts && cp -r dist/docs docs && touch docs/.nojekyll",
78
92
  "docs": "typedoc --out docs src/index.ts",
79
93
  "win-build": "rimraf dist && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && pnpm run -s win-build:docs",
80
- "win-build:docs": "typedoc --out dist/docs src/index.ts || echo 'typedoc non trovato, salto build docs'",
94
+ "win-build:docs": "typedoc --out dist/docs src/index.ts || echo 'typedoc not found, skipping docs build'",
81
95
  "dev": "tsc --watch",
82
96
  "lint": "eslint src/**/*.ts --fix",
83
97
  "lint:check": "eslint src/**/*.ts",
@@ -91,65 +105,37 @@
91
105
  },
92
106
  "keywords": [
93
107
  "solana",
108
+ "solana-kit",
94
109
  "rpc",
95
110
  "gateway",
96
111
  "client",
97
112
  "sdk",
113
+ "signers",
114
+ "wallet",
98
115
  "ai",
99
116
  "agents",
100
- "synapse",
117
+ "langchain",
101
118
  "typescript",
102
119
  "websocket",
103
- "real-time",
104
- "defi",
105
- "nft",
106
- "analytics",
107
- "performance",
108
- "caching",
109
- "load-balancing",
110
- "circuit-breaker",
120
+ "grpc",
121
+ "geyser",
122
+ "das-api",
123
+ "compressed-nft",
124
+ "x402",
111
125
  "blockchain",
112
126
  "web3",
113
- "dApp",
114
- "smart-contracts",
115
- "jupiter",
116
- "metaplex",
117
- "compressed-nft",
118
- "das-api",
119
- "priority-fees",
120
- "jito",
121
- "mev",
122
- "advanced-features",
123
- "enterprise-ready"
127
+ "json-rpc",
128
+ "zod"
124
129
  ],
125
130
  "author": "Synapse Gateway | OOBE PROTOCOL LABS (https://oobeprotocol.ai)",
126
131
  "license": "MIT",
127
132
  "dependencies": {
128
- "@langchain/core": "^0.3.78",
129
- "@metaplex-foundation/mpl-token-metadata": "^3.4.0",
130
- "@metaplex-foundation/umi": "^1.4.1",
131
- "@solana/spl-token": "^0.4.14",
132
- "@solana/web3.js": "^1.98.4",
133
- "bignumber.js": "^9.1.2",
134
- "bs58": "^5.0.0",
135
- "crypto-js": "^4.2.0",
136
- "date-fns": "^3.6.0",
137
- "deepagents": "^1.8.0",
133
+ "@solana/kit": "^6.1.0",
138
134
  "eventemitter3": "^5.0.1",
139
- "fast-json-stable-stringify": "^2.1.0",
140
- "jose": "^5.8.0",
141
- "langchain": "^1.2.25",
142
- "lru-cache": "^11.1.0",
143
- "p-limit": "^6.1.0",
144
- "p-queue": "^8.0.1",
145
- "p-retry": "^6.2.0",
146
- "p-timeout": "^6.1.3",
147
- "undici": "^7.14.0",
148
- "ws": "^8.18.3",
149
- "zod": "^4.1.11"
135
+ "ws": "^8.18.3"
150
136
  },
151
137
  "devDependencies": {
152
- "@types/crypto-js": "^4.2.2",
138
+ "@langchain/core": "^0.3.78",
153
139
  "@types/node": "^24.3.0",
154
140
  "@types/ws": "^8.5.10",
155
141
  "@typescript-eslint/eslint-plugin": "^8.15.0",
@@ -161,10 +147,21 @@
161
147
  "prettier": "^3.3.3",
162
148
  "typedoc": "^0.26.10",
163
149
  "typescript": "^5.9.2",
164
- "vitest": "^4.0.18"
150
+ "vitest": "^4.0.18",
151
+ "zod": "^4.1.11"
165
152
  },
166
153
  "peerDependencies": {
167
- "typescript": ">=5.0.0"
154
+ "@langchain/core": ">=0.3.0 <0.4.0",
155
+ "typescript": ">=5.0.0",
156
+ "zod": ">=3.23.0 || >=4.0.0"
157
+ },
158
+ "peerDependenciesMeta": {
159
+ "zod": {
160
+ "optional": true
161
+ },
162
+ "@langchain/core": {
163
+ "optional": true
164
+ }
168
165
  },
169
166
  "engines": {
170
167
  "node": ">=18.0.0"