@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.
- package/CHANGELOG.md +61 -0
- package/dist/cjs/accounts/helpers.d.ts +88 -0
- package/dist/cjs/accounts/helpers.d.ts.map +1 -0
- package/dist/cjs/accounts/helpers.js +117 -0
- package/dist/cjs/accounts/helpers.js.map +1 -0
- package/dist/cjs/accounts/index.d.ts +105 -0
- package/dist/cjs/accounts/index.d.ts.map +1 -0
- package/dist/cjs/accounts/index.js +137 -0
- package/dist/cjs/accounts/index.js.map +1 -0
- package/dist/cjs/accounts/lookup.d.ts +30 -0
- package/dist/cjs/accounts/lookup.d.ts.map +1 -0
- package/dist/cjs/accounts/lookup.js +31 -0
- package/dist/cjs/accounts/lookup.js.map +1 -0
- package/dist/cjs/accounts/nonce.d.ts +30 -0
- package/dist/cjs/accounts/nonce.d.ts.map +1 -0
- package/dist/cjs/accounts/nonce.js +31 -0
- package/dist/cjs/accounts/nonce.js.map +1 -0
- package/dist/cjs/accounts/stake.d.ts +33 -0
- package/dist/cjs/accounts/stake.d.ts.map +1 -0
- package/dist/cjs/accounts/stake.js +34 -0
- package/dist/cjs/accounts/stake.js.map +1 -0
- package/dist/cjs/accounts/token.d.ts +98 -0
- package/dist/cjs/accounts/token.d.ts.map +1 -0
- package/dist/cjs/accounts/token.js +126 -0
- package/dist/cjs/accounts/token.js.map +1 -0
- package/dist/cjs/ai/gateway/x402/facilitator.d.ts +4 -4
- package/dist/cjs/ai/gateway/x402/facilitator.js +4 -4
- package/dist/cjs/ai/tools/zod/index.d.ts +1 -1
- package/dist/cjs/ai/tools/zod/index.d.ts.map +1 -1
- package/dist/cjs/ai/tools/zod/index.js +2 -2
- package/dist/cjs/ai/tools/zod/index.js.map +1 -1
- package/dist/cjs/ai/tools/zod/types.d.ts +2 -0
- package/dist/cjs/ai/tools/zod/types.d.ts.map +1 -1
- package/dist/cjs/ai/tools/zod/types.js.map +1 -1
- package/dist/cjs/core/client.d.ts +97 -9
- package/dist/cjs/core/client.d.ts.map +1 -1
- package/dist/cjs/core/client.js +120 -5
- package/dist/cjs/core/client.js.map +1 -1
- package/dist/cjs/core/transport.d.ts +1 -1
- package/dist/cjs/core/transport.d.ts.map +1 -1
- package/dist/cjs/core/transport.js +5 -5
- package/dist/cjs/core/transport.js.map +1 -1
- package/dist/cjs/core/types.d.ts +23 -4
- package/dist/cjs/core/types.d.ts.map +1 -1
- package/dist/cjs/core/types.js +5 -1
- package/dist/cjs/core/types.js.map +1 -1
- package/dist/cjs/decoders/index.d.ts +36 -0
- package/dist/cjs/decoders/index.d.ts.map +1 -0
- package/dist/cjs/decoders/index.js +62 -0
- package/dist/cjs/decoders/index.js.map +1 -0
- package/dist/cjs/decoders/layout.d.ts +105 -0
- package/dist/cjs/decoders/layout.d.ts.map +1 -0
- package/dist/cjs/decoders/layout.js +188 -0
- package/dist/cjs/decoders/layout.js.map +1 -0
- package/dist/cjs/decoders/lookup-table.d.ts +60 -0
- package/dist/cjs/decoders/lookup-table.d.ts.map +1 -0
- package/dist/cjs/decoders/lookup-table.js +75 -0
- package/dist/cjs/decoders/lookup-table.js.map +1 -0
- package/dist/cjs/decoders/multisig.d.ts +49 -0
- package/dist/cjs/decoders/multisig.d.ts.map +1 -0
- package/dist/cjs/decoders/multisig.js +50 -0
- package/dist/cjs/decoders/multisig.js.map +1 -0
- package/dist/cjs/decoders/nonce.d.ts +54 -0
- package/dist/cjs/decoders/nonce.d.ts.map +1 -0
- package/dist/cjs/decoders/nonce.js +48 -0
- package/dist/cjs/decoders/nonce.js.map +1 -0
- package/dist/cjs/decoders/stake.d.ts +65 -0
- package/dist/cjs/decoders/stake.d.ts.map +1 -0
- package/dist/cjs/decoders/stake.js +86 -0
- package/dist/cjs/decoders/stake.js.map +1 -0
- package/dist/cjs/decoders/token-2022.d.ts +134 -0
- package/dist/cjs/decoders/token-2022.d.ts.map +1 -0
- package/dist/cjs/decoders/token-2022.js +160 -0
- package/dist/cjs/decoders/token-2022.js.map +1 -0
- package/dist/cjs/decoders/token.d.ts +87 -0
- package/dist/cjs/decoders/token.d.ts.map +1 -0
- package/dist/cjs/decoders/token.js +71 -0
- package/dist/cjs/decoders/token.js.map +1 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/kit/index.d.ts +94 -0
- package/dist/cjs/kit/index.d.ts.map +1 -0
- package/dist/cjs/kit/index.js +196 -0
- package/dist/cjs/kit/index.js.map +1 -0
- package/dist/docs/assets/highlight.css +7 -0
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/AccountReader.html +61 -0
- package/dist/docs/classes/AccountsClient.html +43 -0
- package/dist/docs/classes/DasClient.html +13 -13
- package/dist/docs/classes/GeyserParser.html +17 -17
- package/dist/docs/classes/GrpcTransport.html +6 -6
- package/dist/docs/classes/HttpTransport.html +4 -4
- package/dist/docs/classes/NetworkError.html +5 -5
- package/dist/docs/classes/RpcMethodNotFoundError.html +4 -4
- package/dist/docs/classes/SolanaError.html +40 -0
- package/dist/docs/classes/SolanaRpc.html +55 -55
- package/dist/docs/classes/SynapseClient.html +50 -19
- package/dist/docs/classes/SynapseError.html +4 -4
- package/dist/docs/classes/TimeoutError.html +4 -4
- package/dist/docs/classes/UpstreamError.html +6 -6
- package/dist/docs/classes/WsClient.html +10 -10
- package/dist/docs/enums/AccountRole.html +40 -0
- package/dist/docs/enums/SynapseNetwork.html +2 -2
- package/dist/docs/enums/SynapseRegion.html +2 -2
- package/dist/docs/enums/TokenExtensionType.html +23 -0
- package/dist/docs/functions/Epoch-1.html +1 -1
- package/dist/docs/functions/{Lamports-1.html → Lamports-2.html} +2 -2
- package/dist/docs/functions/Pubkey-1.html +1 -1
- package/dist/docs/functions/Sig.html +1 -1
- package/dist/docs/functions/Slot-1.html +1 -1
- package/dist/docs/functions/UnixTs.html +1 -1
- package/dist/docs/functions/addSignersToTransactionMessage.html +14 -0
- package/dist/docs/functions/address-1.html +15 -0
- package/dist/docs/functions/airdropFactory.html +9 -0
- package/dist/docs/functions/appendTransactionMessageInstruction.html +8 -0
- package/dist/docs/functions/appendTransactionMessageInstructions.html +8 -0
- package/dist/docs/functions/assertAccountDecoded.html +13 -0
- package/dist/docs/functions/assertAccountExists.html +10 -0
- package/dist/docs/functions/assertIsAddress.html +7 -0
- package/dist/docs/functions/assertIsKeyPairSigner.html +6 -0
- package/dist/docs/functions/assertIsKitSignature.html +7 -0
- package/dist/docs/functions/assertIsTransactionSigner.html +7 -0
- package/dist/docs/functions/autoSelectRegion.html +1 -1
- package/dist/docs/functions/base58Encode.html +1 -1
- package/dist/docs/functions/base64ToBytes.html +7 -0
- package/dist/docs/functions/blockhash.html +15 -0
- package/dist/docs/functions/chunk.html +1 -1
- package/dist/docs/functions/commitmentComparator.html +1 -0
- package/dist/docs/functions/compileTransaction.html +14 -0
- package/dist/docs/functions/compileTransactionMessage.html +8 -0
- package/dist/docs/functions/computeBalanceChanges.html +1 -1
- package/dist/docs/functions/computeTokenBalanceChanges.html +1 -1
- package/dist/docs/functions/createAddressWithSeed.html +6 -0
- package/dist/docs/functions/createDefaultRpcSubscriptionsTransport.html +7 -0
- package/dist/docs/functions/createDefaultRpcTransport.html +10 -0
- package/dist/docs/functions/createDefaultSolanaRpcSubscriptionsChannelCreator.html +5 -0
- package/dist/docs/functions/createKeyPairFromBytes.html +12 -0
- package/dist/docs/functions/createKeyPairFromPrivateKeyBytes.html +17 -0
- package/dist/docs/functions/createKeyPairSignerFromBytes.html +6 -0
- package/dist/docs/functions/createKeyPairSignerFromPrivateKeyBytes.html +6 -0
- package/dist/docs/functions/createNoopSigner.html +6 -0
- package/dist/docs/functions/createRpc.html +3 -0
- package/dist/docs/functions/createSignableMessage.html +6 -0
- package/dist/docs/functions/createSignerFromKeyPair.html +12 -0
- package/dist/docs/functions/createSolanaRpc.html +4 -0
- package/dist/docs/functions/createSolanaRpcApi.html +12 -0
- package/dist/docs/functions/createSolanaRpcFromTransport.html +3 -0
- package/dist/docs/functions/createSolanaRpcSubscriptions.html +4 -0
- package/dist/docs/functions/createSolanaRpcSubscriptionsApi.html +1 -0
- package/dist/docs/functions/createSolanaRpcSubscriptionsFromTransport.html +3 -0
- package/dist/docs/functions/createSolanaRpcSubscriptions_UNSTABLE.html +4 -0
- package/dist/docs/functions/createSynapse.html +1 -1
- package/dist/docs/functions/createTransactionMessage.html +6 -0
- package/dist/docs/functions/decodeAccount.html +9 -0
- package/dist/docs/functions/decodeLookupTable.html +17 -0
- package/dist/docs/functions/decodeMint.html +6 -0
- package/dist/docs/functions/decodeMultisig.html +13 -0
- package/dist/docs/functions/decodeNonceAccount.html +14 -0
- package/dist/docs/functions/decodeStakeAccount.html +12 -0
- package/dist/docs/functions/decodeToken2022Account.html +5 -0
- package/dist/docs/functions/decodeToken2022Mint.html +5 -0
- package/dist/docs/functions/decodeTokenAccount.html +6 -0
- package/dist/docs/functions/devnet.html +2 -0
- package/dist/docs/functions/encodeBase58.html +7 -0
- package/dist/docs/functions/fetchEncodedAccount.html +9 -0
- package/dist/docs/functions/fetchEncodedAccounts.html +11 -0
- package/dist/docs/functions/fetchJsonParsedAccount.html +12 -0
- package/dist/docs/functions/fetchJsonParsedAccounts.html +14 -0
- package/dist/docs/functions/fetchLookupTable.html +10 -0
- package/dist/docs/functions/fetchMint.html +11 -0
- package/dist/docs/functions/fetchNonceAccount.html +10 -0
- package/dist/docs/functions/fetchStakeAccount.html +10 -0
- package/dist/docs/functions/fetchTokenAccount.html +12 -0
- package/dist/docs/functions/fetchTokenAccountsByOwner.html +11 -0
- package/dist/docs/functions/fromKitAddress.html +5 -0
- package/dist/docs/functions/generateKeyPair.html +6 -0
- package/dist/docs/functions/generateKeyPairSigner.html +7 -0
- package/dist/docs/functions/getAccountInfo.html +1 -1
- package/dist/docs/functions/getAddressCodec.html +6 -0
- package/dist/docs/functions/getAddressComparator.html +1 -0
- package/dist/docs/functions/getAddressDecoder.html +6 -0
- package/dist/docs/functions/getAddressEncoder.html +5 -0
- package/dist/docs/functions/getAddressFromPublicKey.html +5 -0
- package/dist/docs/functions/getAsset.html +1 -1
- package/dist/docs/functions/getAssetBatch.html +1 -1
- package/dist/docs/functions/getAssetProof.html +1 -1
- package/dist/docs/functions/getAssetProofBatch.html +1 -1
- package/dist/docs/functions/getAssetsByAuthority.html +1 -1
- package/dist/docs/functions/getAssetsByCreator.html +1 -1
- package/dist/docs/functions/getAssetsByGroup.html +1 -1
- package/dist/docs/functions/getAssetsByOwner.html +1 -1
- package/dist/docs/functions/getBalance.html +1 -1
- package/dist/docs/functions/getBase58Codec.html +26 -0
- package/dist/docs/functions/getBase58Decoder.html +10 -0
- package/dist/docs/functions/getBase58Encoder.html +11 -0
- package/dist/docs/functions/getBase64Codec.html +26 -0
- package/dist/docs/functions/getBase64Decoder.html +10 -0
- package/dist/docs/functions/getBase64Encoder.html +11 -0
- package/dist/docs/functions/getBlock.html +1 -1
- package/dist/docs/functions/getBlockCommitment.html +1 -1
- package/dist/docs/functions/getBlockHeight.html +1 -1
- package/dist/docs/functions/getBlockProduction.html +1 -1
- package/dist/docs/functions/getBlockTime.html +1 -1
- package/dist/docs/functions/getBlocks.html +1 -1
- package/dist/docs/functions/getBlocksWithLimit.html +1 -1
- package/dist/docs/functions/getClusterNodes.html +1 -1
- package/dist/docs/functions/getDecodedAccount.html +14 -0
- package/dist/docs/functions/getDecodedAccounts.html +9 -0
- package/dist/docs/functions/getEnvironment.html +1 -1
- package/dist/docs/functions/getEpochInfo.html +1 -1
- package/dist/docs/functions/getEpochSchedule.html +1 -1
- package/dist/docs/functions/getFeeForMessage.html +1 -1
- package/dist/docs/functions/getFirstAvailableBlock.html +1 -1
- package/dist/docs/functions/getGenesisHash.html +1 -1
- package/dist/docs/functions/getHealth.html +1 -1
- package/dist/docs/functions/getHighestSnapshotSlot.html +1 -1
- package/dist/docs/functions/getIdentity.html +1 -1
- package/dist/docs/functions/getInflationGovernor.html +1 -1
- package/dist/docs/functions/getInflationRate.html +1 -1
- package/dist/docs/functions/getInflationReward.html +1 -1
- package/dist/docs/functions/getLargestAccounts.html +1 -1
- package/dist/docs/functions/getLatestBlockhash.html +1 -1
- package/dist/docs/functions/getLeaderSchedule.html +1 -1
- package/dist/docs/functions/getMaxRetransmitSlot.html +1 -1
- package/dist/docs/functions/getMaxShredInsertSlot.html +1 -1
- package/dist/docs/functions/getMinimumBalanceForRentExemption.html +1 -1
- package/dist/docs/functions/getMultipleAccounts.html +1 -1
- package/dist/docs/functions/getProgramAccounts.html +1 -1
- package/dist/docs/functions/getProgramCategory.html +1 -1
- package/dist/docs/functions/getProgramDerivedAddress.html +6 -0
- package/dist/docs/functions/getRecentPerformanceSamples.html +1 -1
- package/dist/docs/functions/getRecentPrioritizationFees.html +1 -1
- package/dist/docs/functions/getSignatureStatuses.html +1 -1
- package/dist/docs/functions/getSignaturesForAddress.html +1 -1
- package/dist/docs/functions/getSignaturesForAsset.html +1 -1
- package/dist/docs/functions/getSlot.html +1 -1
- package/dist/docs/functions/getSlotLeader.html +1 -1
- package/dist/docs/functions/getSlotLeaders.html +1 -1
- package/dist/docs/functions/getStakeActivation.html +1 -1
- package/dist/docs/functions/getStakeMinimumDelegation.html +1 -1
- package/dist/docs/functions/getSupply.html +1 -1
- package/dist/docs/functions/getTokenAccountBalance.html +1 -1
- package/dist/docs/functions/getTokenAccounts.html +1 -1
- package/dist/docs/functions/getTokenAccountsByDelegate.html +1 -1
- package/dist/docs/functions/getTokenAccountsByOwner.html +1 -1
- package/dist/docs/functions/getTokenLargestAccounts.html +1 -1
- package/dist/docs/functions/getTokenSupply.html +1 -1
- package/dist/docs/functions/getTransaction.html +1 -1
- package/dist/docs/functions/getTransactionCount.html +1 -1
- package/dist/docs/functions/getVersion.html +1 -1
- package/dist/docs/functions/getVoteAccounts.html +1 -1
- package/dist/docs/functions/isAddress.html +6 -0
- package/dist/docs/functions/isBlockhashValid.html +1 -1
- package/dist/docs/functions/isBrowser.html +1 -1
- package/dist/docs/functions/isKeyPairSigner.html +6 -0
- package/dist/docs/functions/isKitSignature.html +6 -0
- package/dist/docs/functions/isProgramInCategory.html +1 -1
- package/dist/docs/functions/isServer.html +1 -1
- package/dist/docs/functions/isTransactionSigner.html +7 -0
- package/dist/docs/functions/isValidPubkey.html +1 -1
- package/dist/docs/functions/isValidSignature.html +1 -1
- package/dist/docs/functions/kitSignature.html +6 -0
- package/dist/docs/functions/kitUnixTimestamp.html +6 -0
- package/dist/docs/functions/lamports-1.html +6 -0
- package/dist/docs/functions/lamportsToSol.html +1 -1
- package/dist/docs/functions/listEndpoints.html +1 -1
- package/dist/docs/functions/listNetworks.html +1 -1
- package/dist/docs/functions/listRegions.html +1 -1
- package/dist/docs/functions/mainnet.html +2 -0
- package/dist/docs/functions/minimumLedgerSlot.html +1 -1
- package/dist/docs/functions/parseAccountUpdate.html +1 -1
- package/dist/docs/functions/parseBase58RpcAccount.html +7 -0
- package/dist/docs/functions/parseBase64RpcAccount.html +7 -0
- package/dist/docs/functions/parseBlockMeta.html +1 -1
- package/dist/docs/functions/parseEntry.html +1 -1
- package/dist/docs/functions/parseGeyserUpdate.html +1 -1
- package/dist/docs/functions/parseJsonRpcAccount.html +9 -0
- package/dist/docs/functions/parseSlotUpdate.html +1 -1
- package/dist/docs/functions/parseTimestamp.html +1 -1
- package/dist/docs/functions/parseTransaction.html +1 -1
- package/dist/docs/functions/partiallySignTransaction.html +12 -0
- package/dist/docs/functions/partiallySignTransactionMessageWithSigners.html +22 -0
- package/dist/docs/functions/pipe.html +95 -0
- package/dist/docs/functions/prependTransactionMessageInstruction.html +8 -0
- package/dist/docs/functions/prependTransactionMessageInstructions.html +8 -0
- package/dist/docs/functions/probeLatency.html +1 -1
- package/dist/docs/functions/rawBufferToBase58.html +1 -1
- package/dist/docs/functions/rawBufferToBase64.html +1 -1
- package/dist/docs/functions/rawBufferToBytes.html +1 -1
- package/dist/docs/functions/rawBufferToHex.html +1 -1
- package/dist/docs/functions/requestAirdrop.html +1 -1
- package/dist/docs/functions/resolveEndpoint.html +1 -1
- package/dist/docs/functions/resolveProgram.html +1 -1
- package/dist/docs/functions/resolveProgramBatch.html +1 -1
- package/dist/docs/functions/retry.html +1 -1
- package/dist/docs/functions/searchAssets.html +1 -1
- package/dist/docs/functions/sendAndConfirmDurableNonceTransactionFactory.html +6 -0
- package/dist/docs/functions/sendAndConfirmTransactionFactory.html +6 -0
- package/dist/docs/functions/sendTransaction.html +1 -1
- package/dist/docs/functions/sendTransactionWithoutConfirmingFactory.html +6 -0
- package/dist/docs/functions/setTransactionMessageFeePayer.html +7 -0
- package/dist/docs/functions/setTransactionMessageFeePayerSigner.html +8 -0
- package/dist/docs/functions/setTransactionMessageLifetimeUsingBlockhash.html +7 -0
- package/dist/docs/functions/setTransactionMessageLifetimeUsingDurableNonce.html +9 -0
- package/dist/docs/functions/signAndSendTransactionMessageWithSigners.html +32 -0
- package/dist/docs/functions/signBytes.html +7 -0
- package/dist/docs/functions/signTransaction.html +10 -0
- package/dist/docs/functions/signTransactionMessageWithSigners.html +13 -0
- package/dist/docs/functions/simulateTransaction.html +1 -1
- package/dist/docs/functions/sleep.html +1 -1
- package/dist/docs/functions/solToLamports.html +2 -2
- package/dist/docs/functions/testnet.html +2 -0
- package/dist/docs/functions/toClientConfig.html +1 -1
- package/dist/docs/functions/toKitAddress.html +8 -0
- package/dist/docs/functions/toKitLamports.html +6 -0
- package/dist/docs/functions/toKitSignatureString.html +5 -0
- package/dist/docs/functions/verifySignature.html +8 -0
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/interfaces/AccountInfo.html +7 -7
- package/dist/docs/interfaces/AccountNotification.html +2 -2
- package/dist/docs/interfaces/AccountSubParams.html +2 -2
- package/dist/docs/interfaces/AssetSignatureInfo.html +2 -2
- package/dist/docs/interfaces/AssetSignaturesPage.html +2 -2
- package/dist/docs/interfaces/BalanceChange.html +6 -6
- package/dist/docs/interfaces/BlockProduction.html +3 -3
- package/dist/docs/interfaces/BlockResult.html +2 -2
- package/dist/docs/interfaces/BlockReward.html +2 -2
- package/dist/docs/interfaces/BlockhashResult.html +2 -2
- package/dist/docs/interfaces/CallOptions.html +6 -6
- package/dist/docs/interfaces/ConfirmedTransaction.html +6 -6
- package/dist/docs/interfaces/ContactInfo.html +2 -2
- package/dist/docs/interfaces/DasAsset.html +2 -2
- package/dist/docs/interfaces/DasAssetProof.html +2 -2
- package/dist/docs/interfaces/DasAuthority.html +2 -2
- package/dist/docs/interfaces/DasCompression.html +2 -2
- package/dist/docs/interfaces/DasContent.html +2 -2
- package/dist/docs/interfaces/DasCreator.html +2 -2
- package/dist/docs/interfaces/DasFile.html +2 -2
- package/dist/docs/interfaces/DasGrouping.html +2 -2
- package/dist/docs/interfaces/DasOpts.html +2 -2
- package/dist/docs/interfaces/DasOwnership.html +2 -2
- package/dist/docs/interfaces/DasPage.html +2 -2
- package/dist/docs/interfaces/DasRoyalty.html +2 -2
- package/dist/docs/interfaces/DasSearchParams.html +2 -2
- package/dist/docs/interfaces/DasSupply.html +2 -2
- package/dist/docs/interfaces/DataSlice.html +3 -3
- package/dist/docs/interfaces/DecodedAccountResult.html +10 -0
- package/dist/docs/interfaces/DecodedLookupTable.html +20 -0
- package/dist/docs/interfaces/DecodedMint.html +16 -0
- package/dist/docs/interfaces/DecodedMultisig.html +14 -0
- package/dist/docs/interfaces/DecodedNonceAccount.html +16 -0
- package/dist/docs/interfaces/DecodedStakeAccount.html +7 -0
- package/dist/docs/interfaces/DecodedToken2022Account.html +20 -0
- package/dist/docs/interfaces/DecodedToken2022Mint.html +14 -0
- package/dist/docs/interfaces/DecodedTokenAccount.html +22 -0
- package/dist/docs/interfaces/DefaultAccountStateExt.html +5 -0
- package/dist/docs/interfaces/EndpointConnectConfig.html +5 -5
- package/dist/docs/interfaces/EpochInfo.html +7 -7
- package/dist/docs/interfaces/EpochSchedule.html +2 -2
- package/dist/docs/interfaces/FetchedMint.html +13 -0
- package/dist/docs/interfaces/FetchedTokenAccount.html +13 -0
- package/dist/docs/interfaces/GetAccountInfoOpts.html +6 -6
- package/dist/docs/interfaces/GetAssetsByAuthorityParams.html +2 -2
- package/dist/docs/interfaces/GetAssetsByCreatorParams.html +2 -2
- package/dist/docs/interfaces/GetAssetsByGroupParams.html +2 -2
- package/dist/docs/interfaces/GetAssetsByOwnerParams.html +2 -2
- package/dist/docs/interfaces/GetBlockOpts.html +6 -6
- package/dist/docs/interfaces/GetBlockProductionOpts.html +6 -6
- package/dist/docs/interfaces/GetMultipleAccountsOpts.html +6 -6
- package/dist/docs/interfaces/GetProgramAccountsOpts.html +6 -6
- package/dist/docs/interfaces/GetSignatureStatusesOpts.html +6 -6
- package/dist/docs/interfaces/GetSignaturesOpts.html +7 -7
- package/dist/docs/interfaces/GetTokenAccountsParams.html +2 -2
- package/dist/docs/interfaces/GetTransactionOpts.html +6 -6
- package/dist/docs/interfaces/GeyserParserConfig.html +6 -6
- package/dist/docs/interfaces/GeyserParserEvents.html +9 -9
- package/dist/docs/interfaces/GeyserParserStats.html +2 -2
- package/dist/docs/interfaces/GrpcCallOptions.html +2 -2
- package/dist/docs/interfaces/GrpcTransportConfig.html +6 -6
- package/dist/docs/interfaces/ImmutableOwnerExt.html +4 -0
- package/dist/docs/interfaces/InflationGovernor.html +2 -2
- package/dist/docs/interfaces/InflationRate.html +2 -2
- package/dist/docs/interfaces/InflationReward.html +2 -2
- package/dist/docs/interfaces/InterestBearingConfigExt.html +9 -0
- package/dist/docs/interfaces/LatencyProbeResult.html +2 -2
- package/dist/docs/interfaces/LogsNotification.html +2 -2
- package/dist/docs/interfaces/LogsSubParams.html +2 -2
- package/dist/docs/interfaces/MemoTransferExt.html +5 -0
- package/dist/docs/interfaces/MetadataPointerExt.html +6 -0
- package/dist/docs/interfaces/MintCloseAuthorityExt.html +5 -0
- package/dist/docs/interfaces/NonTransferableExt.html +4 -0
- package/dist/docs/interfaces/PaginationOpts.html +2 -2
- package/dist/docs/interfaces/ParsedAccountUpdate.html +16 -16
- package/dist/docs/interfaces/ParsedBlockMeta.html +2 -2
- package/dist/docs/interfaces/ParsedEntry.html +2 -2
- package/dist/docs/interfaces/ParsedInstruction.html +9 -9
- package/dist/docs/interfaces/ParsedSlotUpdate.html +3 -3
- package/dist/docs/interfaces/ParsedTransaction.html +19 -19
- package/dist/docs/interfaces/PerfSample.html +2 -2
- package/dist/docs/interfaces/PermanentDelegateExt.html +5 -0
- package/dist/docs/interfaces/ProgramAccount.html +2 -2
- package/dist/docs/interfaces/ProgramNotification.html +2 -2
- package/dist/docs/interfaces/ProgramSubParams.html +2 -2
- package/dist/docs/interfaces/RawAccountInfo.html +2 -2
- package/dist/docs/interfaces/RawBlockMeta.html +2 -2
- package/dist/docs/interfaces/RawBuffer.html +2 -2
- package/dist/docs/interfaces/RawCompiledInstruction.html +2 -2
- package/dist/docs/interfaces/RawEntry.html +2 -2
- package/dist/docs/interfaces/RawGeyserUpdate.html +2 -2
- package/dist/docs/interfaces/RawInnerInstruction.html +2 -2
- package/dist/docs/interfaces/RawSlotInfo.html +2 -2
- package/dist/docs/interfaces/RawTimestamp.html +2 -2
- package/dist/docs/interfaces/RawTokenBalance.html +2 -2
- package/dist/docs/interfaces/RawTransactionInfo.html +2 -2
- package/dist/docs/interfaces/RootNotification.html +2 -2
- package/dist/docs/interfaces/RootSubParams.html +1 -1
- package/dist/docs/interfaces/RpcContext.html +2 -2
- package/dist/docs/interfaces/RpcError.html +4 -4
- package/dist/docs/interfaces/RpcRequest.html +2 -2
- package/dist/docs/interfaces/RpcResponse.html +2 -2
- package/dist/docs/interfaces/SendTransactionOpts.html +6 -6
- package/dist/docs/interfaces/SignatureInfo.html +7 -7
- package/dist/docs/interfaces/SignatureNotification.html +2 -2
- package/dist/docs/interfaces/SignatureStatus.html +5 -5
- package/dist/docs/interfaces/SignatureSubParams.html +2 -2
- package/dist/docs/interfaces/SignaturesForAssetParams.html +2 -2
- package/dist/docs/interfaces/SimulateResult.html +2 -2
- package/dist/docs/interfaces/SimulateTransactionOpts.html +7 -7
- package/dist/docs/interfaces/SlotNotification.html +2 -2
- package/dist/docs/interfaces/SlotSubParams.html +1 -1
- package/dist/docs/interfaces/SortOpts.html +2 -2
- package/dist/docs/interfaces/StakeAuthorized.html +5 -0
- package/dist/docs/interfaces/StakeDelegation.html +9 -0
- package/dist/docs/interfaces/StakeLockup.html +9 -0
- package/dist/docs/interfaces/StakeMeta.html +6 -0
- package/dist/docs/interfaces/Supply.html +5 -5
- package/dist/docs/interfaces/SynapseClientConfig.html +9 -9
- package/dist/docs/interfaces/SynapseEndpoint.html +7 -7
- package/dist/docs/interfaces/TokenAccount.html +3 -3
- package/dist/docs/interfaces/TokenAccountsByOwnerResult.html +2 -2
- package/dist/docs/interfaces/TokenAmount.html +5 -5
- package/dist/docs/interfaces/TokenBalanceChange.html +2 -2
- package/dist/docs/interfaces/TransactionMessageWithBlockhashLifetime.html +12 -0
- package/dist/docs/interfaces/TransactionMeta.html +11 -11
- package/dist/docs/interfaces/TransferFeeAmount.html +5 -0
- package/dist/docs/interfaces/TransferFeeConfig.html +9 -0
- package/dist/docs/interfaces/TransportConfig.html +7 -7
- package/dist/docs/interfaces/UnknownExtension.html +6 -0
- package/dist/docs/interfaces/VoteAccount.html +9 -9
- package/dist/docs/interfaces/VoteAccountsResult.html +3 -3
- package/dist/docs/interfaces/WsConfig.html +6 -6
- package/dist/docs/media/CHANGELOG.md +61 -0
- package/dist/docs/modules.html +182 -6
- package/dist/docs/types/AccountFetchOpts.html +3 -0
- package/dist/docs/types/AccountFilter.html +1 -1
- package/dist/docs/types/Address.html +5 -0
- package/dist/docs/types/Base58.html +1 -1
- package/dist/docs/types/Brand.html +1 -1
- package/dist/docs/types/Commitment.html +1 -1
- package/dist/docs/types/DasSortBy.html +1 -1
- package/dist/docs/types/DasSortDirection.html +1 -1
- package/dist/docs/types/DataSizeFilter.html +1 -1
- package/dist/docs/types/DecodedExtension.html +3 -0
- package/dist/docs/types/Encoding.html +1 -1
- package/dist/docs/types/Epoch.html +1 -1
- package/dist/docs/types/KeyPairSigner.html +17 -0
- package/dist/docs/types/KitCommitment.html +4 -0
- package/dist/docs/types/Lamports.html +2 -1
- package/dist/docs/types/LogsFilter.html +1 -1
- package/dist/docs/types/MemcmpFilter.html +1 -1
- package/dist/docs/types/MessagePartialSigner.html +23 -0
- package/dist/docs/types/MessageSigner.html +8 -0
- package/dist/docs/types/NonceState.html +3 -0
- package/dist/docs/types/NoopSigner.html +18 -0
- package/dist/docs/types/ParsedGeyserUpdate.html +1 -1
- package/dist/docs/types/Pubkey.html +3 -2
- package/dist/docs/types/Rpc.html +4 -0
- package/dist/docs/types/RpcSubscriptions.html +5 -0
- package/dist/docs/types/RpcTransport.html +3 -0
- package/dist/docs/types/RuntimeEnv.html +1 -1
- package/dist/docs/types/Signature.html +3 -2
- package/dist/docs/types/SignatureBytes.html +5 -0
- package/dist/docs/types/Slot.html +1 -1
- package/dist/docs/types/SolanaRpcApi.html +3 -0
- package/dist/docs/types/SolanaRpcApiDevnet.html +3 -0
- package/dist/docs/types/SolanaRpcApiMainnet.html +4 -0
- package/dist/docs/types/SolanaRpcApiTestnet.html +3 -0
- package/dist/docs/types/SolanaRpcSubscriptionsApi.html +1 -0
- package/dist/docs/types/StakeAccountType.html +3 -0
- package/dist/docs/types/SubscriptionId.html +1 -1
- package/dist/docs/types/TokenAccountState.html +3 -0
- package/dist/docs/types/TransactionDetail.html +1 -1
- package/dist/docs/types/TransactionMessage.html +1 -0
- package/dist/docs/types/TransactionModifyingSigner.html +30 -0
- package/dist/docs/types/TransactionPartialSigner.html +22 -0
- package/dist/docs/types/TransactionSendingSigner.html +33 -0
- package/dist/docs/types/TransactionSigner.html +9 -0
- package/dist/docs/types/UnaryMethod.html +1 -1
- package/dist/docs/types/UnixTimestamp.html +1 -1
- package/dist/docs/types/WsNotification.html +1 -1
- package/dist/docs/variables/DEFAULT_RPC_CONFIG.html +6 -0
- package/dist/docs/variables/DEFAULT_RPC_SUBSCRIPTIONS_CONFIG.html +1 -0
- package/dist/docs/variables/JUPITER_PROGRAMS.html +1 -1
- package/dist/docs/variables/KNOWN_PROGRAMS.html +1 -1
- package/dist/docs/variables/KNOWN_PROGRAMS_COUNT.html +1 -1
- package/dist/docs/variables/LOOKUP_TABLE_HEADER_SIZE.html +3 -0
- package/dist/docs/variables/LOOKUP_TABLE_PROGRAM_ID.html +3 -0
- package/dist/docs/variables/MARINADE_PROGRAMS.html +1 -1
- package/dist/docs/variables/MAX_MULTISIG_SIGNERS.html +3 -0
- package/dist/docs/variables/METAPLEX_PROGRAMS.html +1 -1
- package/dist/docs/variables/METEORA_PROGRAMS.html +1 -1
- package/dist/docs/variables/MINT_SIZE.html +3 -0
- package/dist/docs/variables/MULTISIG_SIZE.html +3 -0
- package/dist/docs/variables/NONCE_ACCOUNT_SIZE.html +3 -0
- package/dist/docs/variables/ORCA_PROGRAMS.html +1 -1
- package/dist/docs/variables/OTHER_PROGRAMS.html +1 -1
- package/dist/docs/variables/RAYDIUM_PROGRAMS.html +1 -1
- package/dist/docs/variables/SDK_USER_AGENT.html +1 -1
- package/dist/docs/variables/SPL_PROGRAMS.html +1 -1
- package/dist/docs/variables/STAKE_PROGRAM_ID.html +3 -0
- package/dist/docs/variables/SYNAPSE_DEVNET_EU.html +1 -1
- package/dist/docs/variables/SYNAPSE_DEVNET_US.html +1 -1
- package/dist/docs/variables/SYNAPSE_ENDPOINTS.html +1 -1
- package/dist/docs/variables/SYNAPSE_MAINNET_EU.html +1 -1
- package/dist/docs/variables/SYNAPSE_MAINNET_US.html +1 -1
- package/dist/docs/variables/SYSTEM_PROGRAMS.html +1 -1
- package/dist/docs/variables/SYSTEM_PROGRAM_ID.html +3 -0
- package/dist/docs/variables/TOKEN_2022_PROGRAM_ID.html +3 -0
- package/dist/docs/variables/TOKEN_ACCOUNT_SIZE.html +3 -0
- package/dist/docs/variables/TOKEN_PROGRAM_ID.html +3 -0
- package/dist/esm/accounts/helpers.d.ts +88 -0
- package/dist/esm/accounts/helpers.d.ts.map +1 -0
- package/dist/esm/accounts/helpers.js +112 -0
- package/dist/esm/accounts/helpers.js.map +1 -0
- package/dist/esm/accounts/index.d.ts +105 -0
- package/dist/esm/accounts/index.d.ts.map +1 -0
- package/dist/esm/accounts/index.js +124 -0
- package/dist/esm/accounts/index.js.map +1 -0
- package/dist/esm/accounts/lookup.d.ts +30 -0
- package/dist/esm/accounts/lookup.d.ts.map +1 -0
- package/dist/esm/accounts/lookup.js +28 -0
- package/dist/esm/accounts/lookup.js.map +1 -0
- package/dist/esm/accounts/nonce.d.ts +30 -0
- package/dist/esm/accounts/nonce.d.ts.map +1 -0
- package/dist/esm/accounts/nonce.js +28 -0
- package/dist/esm/accounts/nonce.js.map +1 -0
- package/dist/esm/accounts/stake.d.ts +33 -0
- package/dist/esm/accounts/stake.d.ts.map +1 -0
- package/dist/esm/accounts/stake.js +31 -0
- package/dist/esm/accounts/stake.js.map +1 -0
- package/dist/esm/accounts/token.d.ts +98 -0
- package/dist/esm/accounts/token.d.ts.map +1 -0
- package/dist/esm/accounts/token.js +121 -0
- package/dist/esm/accounts/token.js.map +1 -0
- package/dist/esm/ai/gateway/index.js +2 -2
- package/dist/esm/ai/gateway/x402/facilitator.d.ts +4 -4
- package/dist/esm/ai/gateway/x402/facilitator.js +4 -4
- package/dist/esm/ai/index.js +2 -2
- package/dist/esm/ai/tools/index.js +3 -3
- package/dist/esm/ai/tools/protocols/index.js +6 -6
- package/dist/esm/ai/tools/zod/index.d.ts +1 -1
- package/dist/esm/ai/tools/zod/index.d.ts.map +1 -1
- package/dist/esm/ai/tools/zod/index.js +2 -2
- package/dist/esm/ai/tools/zod/index.js.map +1 -1
- package/dist/esm/ai/tools/zod/types.d.ts +2 -0
- package/dist/esm/ai/tools/zod/types.d.ts.map +1 -1
- package/dist/esm/ai/tools/zod/types.js.map +1 -1
- package/dist/esm/core/client.d.ts +97 -9
- package/dist/esm/core/client.d.ts.map +1 -1
- package/dist/esm/core/client.js +120 -5
- package/dist/esm/core/client.js.map +1 -1
- package/dist/esm/core/transport.d.ts +1 -1
- package/dist/esm/core/transport.d.ts.map +1 -1
- package/dist/esm/core/transport.js +5 -5
- package/dist/esm/core/transport.js.map +1 -1
- package/dist/esm/core/types.d.ts +23 -4
- package/dist/esm/core/types.d.ts.map +1 -1
- package/dist/esm/core/types.js +5 -1
- package/dist/esm/core/types.js.map +1 -1
- package/dist/esm/decoders/index.d.ts +36 -0
- package/dist/esm/decoders/index.d.ts.map +1 -0
- package/dist/esm/decoders/index.js +37 -0
- package/dist/esm/decoders/index.js.map +1 -0
- package/dist/esm/decoders/layout.d.ts +105 -0
- package/dist/esm/decoders/layout.d.ts.map +1 -0
- package/dist/esm/decoders/layout.js +183 -0
- package/dist/esm/decoders/layout.js.map +1 -0
- package/dist/esm/decoders/lookup-table.d.ts +60 -0
- package/dist/esm/decoders/lookup-table.d.ts.map +1 -0
- package/dist/esm/decoders/lookup-table.js +71 -0
- package/dist/esm/decoders/lookup-table.js.map +1 -0
- package/dist/esm/decoders/multisig.d.ts +49 -0
- package/dist/esm/decoders/multisig.d.ts.map +1 -0
- package/dist/esm/decoders/multisig.js +46 -0
- package/dist/esm/decoders/multisig.js.map +1 -0
- package/dist/esm/decoders/nonce.d.ts +54 -0
- package/dist/esm/decoders/nonce.d.ts.map +1 -0
- package/dist/esm/decoders/nonce.js +44 -0
- package/dist/esm/decoders/nonce.js.map +1 -0
- package/dist/esm/decoders/stake.d.ts +65 -0
- package/dist/esm/decoders/stake.d.ts.map +1 -0
- package/dist/esm/decoders/stake.js +82 -0
- package/dist/esm/decoders/stake.js.map +1 -0
- package/dist/esm/decoders/token-2022.d.ts +134 -0
- package/dist/esm/decoders/token-2022.d.ts.map +1 -0
- package/dist/esm/decoders/token-2022.js +155 -0
- package/dist/esm/decoders/token-2022.js.map +1 -0
- package/dist/esm/decoders/token.d.ts +87 -0
- package/dist/esm/decoders/token.d.ts.map +1 -0
- package/dist/esm/decoders/token.js +66 -0
- package/dist/esm/decoders/token.js.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/kit/index.d.ts +94 -0
- package/dist/esm/kit/index.d.ts.map +1 -0
- package/dist/esm/kit/index.js +100 -0
- package/dist/esm/kit/index.js.map +1 -0
- 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/decoders/token.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAOzC,MAAM,oBAAoB,GAAiC;IACzD,eAAe,EAAE,aAAa,EAAE,QAAQ;CACzC,CAAC;AAwDF,kEAAkE;AAElE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,uDAAuD;AACvD,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAE5B,yCAAyC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AAE9E,kEAAkE;AAElE;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAgB;IACjD,IAAI,IAAI,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,6CAA6C,kBAAkB,eAAe,IAAI,CAAC,MAAM,EAAE,CAC5F,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IAElC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAe,oBAAoB;IAC3D,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAc,qBAAqB;IAC5D,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAgB,qBAAqB;IAC5D,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CA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MAAM,eAAe,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,yBAAyB;IAE9E,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC7E,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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.
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -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
|
/**
|
package/dist/esm/index.js.map
CHANGED
|
@@ -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,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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,CAAC;AAGrB,YAAY,EACV,aAAa,EACb,i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,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,EAChC,SAAS,EACT,eAAe,EACf,SAAS,IAAI,YAAY,EACzB,WAAW,IAAI,cAAc,EAC7B,iBAAiB,IAAI,oBAAoB,GAC1C,MAAM,aAAa,CAAC;AAarB,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,sCAAsC,EACtC,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AAWrB,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,kBAAkB,EAClB,yBAAyB,EACzB,SAAS,EACT,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAOrB,OAAO,EACL,4BAA4B,EAC5B,qCAAqC,EACrC,yCAAyC,EACzC,+BAA+B,EAC/B,sCAAsC,EACtC,iDAA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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.
|
|
4
|
-
"description": "Synapse Client SDK
|
|
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
|
|
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
|
-
"
|
|
117
|
+
"langchain",
|
|
101
118
|
"typescript",
|
|
102
119
|
"websocket",
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
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
|
-
"
|
|
114
|
-
"
|
|
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
|
-
"@
|
|
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
|
-
"
|
|
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
|
-
"@
|
|
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
|
-
"
|
|
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"
|