@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,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level typed nonce account fetcher.
|
|
3
|
+
*
|
|
4
|
+
* @module accounts/nonce
|
|
5
|
+
* @since 1.1.0
|
|
6
|
+
*/
|
|
7
|
+
import type { HttpTransport, CallOptions } from '../core/transport';
|
|
8
|
+
import type { Pubkey, Commitment } from '../core/types';
|
|
9
|
+
import type { DecodedNonceAccount } from '../decoders/nonce';
|
|
10
|
+
import type { DecodedAccountResult } from './helpers';
|
|
11
|
+
/**
|
|
12
|
+
* Fetch and decode a Solana nonce account.
|
|
13
|
+
*
|
|
14
|
+
* @param transport - HTTP transport.
|
|
15
|
+
* @param pubkey - Nonce account public key.
|
|
16
|
+
* @param opts - RPC options.
|
|
17
|
+
* @returns Decoded nonce account, or `null` if not found.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const nonce = await fetchNonceAccount(transport, noncePubkey);
|
|
22
|
+
* if (nonce) console.log(`Blockhash: ${nonce.decoded.blockhash}`);
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @since 1.1.0
|
|
26
|
+
*/
|
|
27
|
+
export declare function fetchNonceAccount(transport: HttpTransport, pubkey: Pubkey, opts?: {
|
|
28
|
+
commitment?: Commitment;
|
|
29
|
+
} & CallOptions): Promise<DecodedAccountResult<DecodedNonceAccount> | null>;
|
|
30
|
+
//# sourceMappingURL=nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonce.d.ts","sourceRoot":"","sources":["../../../src/accounts/nonce.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,UAAU,CAAA;CAAE,GAAG,WAAgB,GACnD,OAAO,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAE3D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level typed nonce account fetcher.
|
|
3
|
+
*
|
|
4
|
+
* @module accounts/nonce
|
|
5
|
+
* @since 1.1.0
|
|
6
|
+
*/
|
|
7
|
+
import { decodeNonceAccount } from '../decoders/nonce.js';
|
|
8
|
+
import { getDecodedAccount } from './helpers.js';
|
|
9
|
+
/**
|
|
10
|
+
* Fetch and decode a Solana nonce account.
|
|
11
|
+
*
|
|
12
|
+
* @param transport - HTTP transport.
|
|
13
|
+
* @param pubkey - Nonce account public key.
|
|
14
|
+
* @param opts - RPC options.
|
|
15
|
+
* @returns Decoded nonce account, or `null` if not found.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const nonce = await fetchNonceAccount(transport, noncePubkey);
|
|
20
|
+
* if (nonce) console.log(`Blockhash: ${nonce.decoded.blockhash}`);
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @since 1.1.0
|
|
24
|
+
*/
|
|
25
|
+
export async function fetchNonceAccount(transport, pubkey, opts = {}) {
|
|
26
|
+
return getDecodedAccount(transport, pubkey, decodeNonceAccount, opts);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=nonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonce.js","sourceRoot":"","sources":["../../../src/accounts/nonce.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAwB,EACxB,MAAc,EACd,OAAkD,EAAE;IAEpD,OAAO,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level typed stake account fetcher.
|
|
3
|
+
*
|
|
4
|
+
* @module accounts/stake
|
|
5
|
+
* @since 1.1.0
|
|
6
|
+
*/
|
|
7
|
+
import type { HttpTransport, CallOptions } from '../core/transport';
|
|
8
|
+
import type { Pubkey, Commitment } from '../core/types';
|
|
9
|
+
import type { DecodedStakeAccount } from '../decoders/stake';
|
|
10
|
+
import type { DecodedAccountResult } from './helpers';
|
|
11
|
+
/**
|
|
12
|
+
* Fetch and decode a Solana stake account.
|
|
13
|
+
*
|
|
14
|
+
* @param transport - HTTP transport.
|
|
15
|
+
* @param pubkey - Stake account public key.
|
|
16
|
+
* @param opts - RPC options.
|
|
17
|
+
* @returns Decoded stake account, or `null` if not found.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const stake = await fetchStakeAccount(transport, stakeAccountPubkey);
|
|
22
|
+
* if (stake?.decoded.type === 'delegated') {
|
|
23
|
+
* console.log(`Delegated to: ${stake.decoded.stake!.voterPubkey}`);
|
|
24
|
+
* console.log(`Stake amount: ${stake.decoded.stake!.stake} lamports`);
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @since 1.1.0
|
|
29
|
+
*/
|
|
30
|
+
export declare function fetchStakeAccount(transport: HttpTransport, pubkey: Pubkey, opts?: {
|
|
31
|
+
commitment?: Commitment;
|
|
32
|
+
} & CallOptions): Promise<DecodedAccountResult<DecodedStakeAccount> | null>;
|
|
33
|
+
//# sourceMappingURL=stake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stake.d.ts","sourceRoot":"","sources":["../../../src/accounts/stake.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,UAAU,CAAA;CAAE,GAAG,WAAgB,GACnD,OAAO,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAE3D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level typed stake account fetcher.
|
|
3
|
+
*
|
|
4
|
+
* @module accounts/stake
|
|
5
|
+
* @since 1.1.0
|
|
6
|
+
*/
|
|
7
|
+
import { decodeStakeAccount } from '../decoders/stake.js';
|
|
8
|
+
import { getDecodedAccount } from './helpers.js';
|
|
9
|
+
/**
|
|
10
|
+
* Fetch and decode a Solana stake account.
|
|
11
|
+
*
|
|
12
|
+
* @param transport - HTTP transport.
|
|
13
|
+
* @param pubkey - Stake account public key.
|
|
14
|
+
* @param opts - RPC options.
|
|
15
|
+
* @returns Decoded stake account, or `null` if not found.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const stake = await fetchStakeAccount(transport, stakeAccountPubkey);
|
|
20
|
+
* if (stake?.decoded.type === 'delegated') {
|
|
21
|
+
* console.log(`Delegated to: ${stake.decoded.stake!.voterPubkey}`);
|
|
22
|
+
* console.log(`Stake amount: ${stake.decoded.stake!.stake} lamports`);
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @since 1.1.0
|
|
27
|
+
*/
|
|
28
|
+
export async function fetchStakeAccount(transport, pubkey, opts = {}) {
|
|
29
|
+
return getDecodedAccount(transport, pubkey, decodeStakeAccount, opts);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=stake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stake.js","sourceRoot":"","sources":["../../../src/accounts/stake.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAwB,EACxB,MAAc,EACd,OAAkD,EAAE;IAEpD,OAAO,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level typed token account fetchers.
|
|
3
|
+
*
|
|
4
|
+
* Wraps RPC calls + decoders to provide a one-call API for fetching
|
|
5
|
+
* decoded SPL Token accounts and mints.
|
|
6
|
+
*
|
|
7
|
+
* @module accounts/token
|
|
8
|
+
* @since 1.1.0
|
|
9
|
+
*/
|
|
10
|
+
import type { HttpTransport, CallOptions } from '../core/transport';
|
|
11
|
+
import type { Pubkey, Commitment } from '../core/types';
|
|
12
|
+
import type { DecodedTokenAccount, DecodedMint } from '../decoders/token';
|
|
13
|
+
import type { DecodedAccountResult } from './helpers';
|
|
14
|
+
/**
|
|
15
|
+
* Fetched token account with owner program metadata.
|
|
16
|
+
* @since 1.1.0
|
|
17
|
+
*/
|
|
18
|
+
export interface FetchedTokenAccount extends DecodedAccountResult<DecodedTokenAccount> {
|
|
19
|
+
/** The token program that owns this account ('token' or 'token-2022'). */
|
|
20
|
+
program: 'token' | 'token-2022';
|
|
21
|
+
/** Account public key. */
|
|
22
|
+
address: Pubkey;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetched mint with owner program metadata.
|
|
26
|
+
* @since 1.1.0
|
|
27
|
+
*/
|
|
28
|
+
export interface FetchedMint extends DecodedAccountResult<DecodedMint> {
|
|
29
|
+
/** The token program that owns this mint ('token' or 'token-2022'). */
|
|
30
|
+
program: 'token' | 'token-2022';
|
|
31
|
+
/** Mint public key. */
|
|
32
|
+
address: Pubkey;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Fetch and decode a single SPL Token account.
|
|
36
|
+
*
|
|
37
|
+
* Automatically detects Token vs Token-2022 from the on-chain owner
|
|
38
|
+
* and applies the appropriate decoder (including extensions for 2022).
|
|
39
|
+
*
|
|
40
|
+
* @param transport - HTTP transport.
|
|
41
|
+
* @param pubkey - Token account public key.
|
|
42
|
+
* @param opts - RPC options.
|
|
43
|
+
* @returns Decoded token account, or `null` if not found.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const acct = await fetchTokenAccount(transport, tokenAccountPubkey);
|
|
48
|
+
* if (acct) console.log(`Balance: ${acct.decoded.amount}, Mint: ${acct.decoded.mint}`);
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @since 1.1.0
|
|
52
|
+
*/
|
|
53
|
+
export declare function fetchTokenAccount(transport: HttpTransport, pubkey: Pubkey, opts?: {
|
|
54
|
+
commitment?: Commitment;
|
|
55
|
+
} & CallOptions): Promise<FetchedTokenAccount | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Fetch and decode a token mint.
|
|
58
|
+
*
|
|
59
|
+
* Automatically detects Token vs Token-2022 and applies the appropriate decoder.
|
|
60
|
+
*
|
|
61
|
+
* @param transport - HTTP transport.
|
|
62
|
+
* @param pubkey - Mint public key.
|
|
63
|
+
* @param opts - RPC options.
|
|
64
|
+
* @returns Decoded mint, or `null` if not found.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const mint = await fetchMint(transport, mintPubkey);
|
|
69
|
+
* if (mint) console.log(`Supply: ${mint.decoded.supply}, Decimals: ${mint.decoded.decimals}`);
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @since 1.1.0
|
|
73
|
+
*/
|
|
74
|
+
export declare function fetchMint(transport: HttpTransport, pubkey: Pubkey, opts?: {
|
|
75
|
+
commitment?: Commitment;
|
|
76
|
+
} & CallOptions): Promise<FetchedMint | null>;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch all token accounts owned by a wallet, optionally filtered by mint.
|
|
79
|
+
*
|
|
80
|
+
* @param transport - HTTP transport.
|
|
81
|
+
* @param owner - Wallet public key.
|
|
82
|
+
* @param mint - Token mint to filter by (optional).
|
|
83
|
+
* @param opts - RPC options. Include `programId` to target Token-2022 specifically.
|
|
84
|
+
* @returns Array of decoded token accounts.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const accounts = await fetchTokenAccountsByOwner(transport, walletPubkey, usdcMint);
|
|
89
|
+
* for (const a of accounts) console.log(`${a.address}: ${a.decoded.amount}`);
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @since 1.1.0
|
|
93
|
+
*/
|
|
94
|
+
export declare function fetchTokenAccountsByOwner(transport: HttpTransport, owner: Pubkey, mint?: Pubkey, opts?: {
|
|
95
|
+
commitment?: Commitment;
|
|
96
|
+
programId?: Pubkey;
|
|
97
|
+
} & CallOptions): Promise<FetchedTokenAccount[]>;
|
|
98
|
+
//# sourceMappingURL=token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/accounts/token.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAItD;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB,CAAC,mBAAmB,CAAC;IACpF,0EAA0E;IAC1E,OAAO,EAAE,OAAO,GAAG,YAAY,CAAC;IAChC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,WAAW,CAAC;IACpE,uEAAuE;IACvE,OAAO,EAAE,OAAO,GAAG,YAAY,CAAC;IAChC,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,UAAU,CAAA;CAAE,GAAG,WAAgB,GACnD,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAerC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,UAAU,CAAA;CAAE,GAAG,WAAgB,GACnD,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAc7B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EACb,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAgB,GACvE,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAkDhC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level typed token account fetchers.
|
|
3
|
+
*
|
|
4
|
+
* Wraps RPC calls + decoders to provide a one-call API for fetching
|
|
5
|
+
* decoded SPL Token accounts and mints.
|
|
6
|
+
*
|
|
7
|
+
* @module accounts/token
|
|
8
|
+
* @since 1.1.0
|
|
9
|
+
*/
|
|
10
|
+
import { Pubkey as mkPubkey } from '../core/types.js';
|
|
11
|
+
import { decodeTokenAccount, decodeMint, TOKEN_PROGRAM_ID } from '../decoders/token.js';
|
|
12
|
+
import { decodeToken2022Account, decodeToken2022Mint, TOKEN_2022_PROGRAM_ID } from '../decoders/token-2022.js';
|
|
13
|
+
import { getDecodedAccount, base64ToBytes } from './helpers.js';
|
|
14
|
+
// ── Fetchers ───────────────────────────────────────────────────
|
|
15
|
+
/**
|
|
16
|
+
* Fetch and decode a single SPL Token account.
|
|
17
|
+
*
|
|
18
|
+
* Automatically detects Token vs Token-2022 from the on-chain owner
|
|
19
|
+
* and applies the appropriate decoder (including extensions for 2022).
|
|
20
|
+
*
|
|
21
|
+
* @param transport - HTTP transport.
|
|
22
|
+
* @param pubkey - Token account public key.
|
|
23
|
+
* @param opts - RPC options.
|
|
24
|
+
* @returns Decoded token account, or `null` if not found.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const acct = await fetchTokenAccount(transport, tokenAccountPubkey);
|
|
29
|
+
* if (acct) console.log(`Balance: ${acct.decoded.amount}, Mint: ${acct.decoded.mint}`);
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @since 1.1.0
|
|
33
|
+
*/
|
|
34
|
+
export async function fetchTokenAccount(transport, pubkey, opts = {}) {
|
|
35
|
+
const result = await getDecodedAccount(transport, pubkey, decodeTokenAccount, opts);
|
|
36
|
+
if (!result)
|
|
37
|
+
return null;
|
|
38
|
+
const owner = String(result.raw.owner);
|
|
39
|
+
const program = owner === TOKEN_2022_PROGRAM_ID ? 'token-2022' : 'token';
|
|
40
|
+
// Re-decode with Token-2022 decoder to capture extensions
|
|
41
|
+
if (program === 'token-2022') {
|
|
42
|
+
const bytes = base64ToBytes(result.raw.data);
|
|
43
|
+
const decoded = decodeToken2022Account(bytes);
|
|
44
|
+
return { decoded, raw: result.raw, slot: result.slot, program, address: pubkey };
|
|
45
|
+
}
|
|
46
|
+
return { decoded: result.decoded, raw: result.raw, slot: result.slot, program, address: pubkey };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Fetch and decode a token mint.
|
|
50
|
+
*
|
|
51
|
+
* Automatically detects Token vs Token-2022 and applies the appropriate decoder.
|
|
52
|
+
*
|
|
53
|
+
* @param transport - HTTP transport.
|
|
54
|
+
* @param pubkey - Mint public key.
|
|
55
|
+
* @param opts - RPC options.
|
|
56
|
+
* @returns Decoded mint, or `null` if not found.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const mint = await fetchMint(transport, mintPubkey);
|
|
61
|
+
* if (mint) console.log(`Supply: ${mint.decoded.supply}, Decimals: ${mint.decoded.decimals}`);
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @since 1.1.0
|
|
65
|
+
*/
|
|
66
|
+
export async function fetchMint(transport, pubkey, opts = {}) {
|
|
67
|
+
const result = await getDecodedAccount(transport, pubkey, decodeMint, opts);
|
|
68
|
+
if (!result)
|
|
69
|
+
return null;
|
|
70
|
+
const owner = String(result.raw.owner);
|
|
71
|
+
const program = owner === TOKEN_2022_PROGRAM_ID ? 'token-2022' : 'token';
|
|
72
|
+
if (program === 'token-2022') {
|
|
73
|
+
const bytes = base64ToBytes(result.raw.data);
|
|
74
|
+
const decoded = decodeToken2022Mint(bytes);
|
|
75
|
+
return { decoded, raw: result.raw, slot: result.slot, program, address: pubkey };
|
|
76
|
+
}
|
|
77
|
+
return { decoded: result.decoded, raw: result.raw, slot: result.slot, program, address: pubkey };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Fetch all token accounts owned by a wallet, optionally filtered by mint.
|
|
81
|
+
*
|
|
82
|
+
* @param transport - HTTP transport.
|
|
83
|
+
* @param owner - Wallet public key.
|
|
84
|
+
* @param mint - Token mint to filter by (optional).
|
|
85
|
+
* @param opts - RPC options. Include `programId` to target Token-2022 specifically.
|
|
86
|
+
* @returns Array of decoded token accounts.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const accounts = await fetchTokenAccountsByOwner(transport, walletPubkey, usdcMint);
|
|
91
|
+
* for (const a of accounts) console.log(`${a.address}: ${a.decoded.amount}`);
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @since 1.1.0
|
|
95
|
+
*/
|
|
96
|
+
export async function fetchTokenAccountsByOwner(transport, owner, mint, opts = {}) {
|
|
97
|
+
const { commitment, programId, ...callOpts } = opts;
|
|
98
|
+
const filter = mint
|
|
99
|
+
? { mint: String(mint) }
|
|
100
|
+
: { programId: String(programId ?? TOKEN_PROGRAM_ID) };
|
|
101
|
+
const cfg = { encoding: 'base64' };
|
|
102
|
+
if (commitment)
|
|
103
|
+
cfg.commitment = commitment;
|
|
104
|
+
const result = await transport.request('getTokenAccountsByOwner', [owner, filter, cfg], callOpts);
|
|
105
|
+
return result.value.map((entry) => {
|
|
106
|
+
const bytes = base64ToBytes(entry.account.data);
|
|
107
|
+
const entryOwner = entry.account.owner;
|
|
108
|
+
const program = entryOwner === TOKEN_2022_PROGRAM_ID ? 'token-2022' : 'token';
|
|
109
|
+
const decoded = program === 'token-2022'
|
|
110
|
+
? decodeToken2022Account(bytes)
|
|
111
|
+
: decodeTokenAccount(bytes);
|
|
112
|
+
return {
|
|
113
|
+
decoded,
|
|
114
|
+
raw: entry.account,
|
|
115
|
+
slot: result.context.slot,
|
|
116
|
+
program,
|
|
117
|
+
address: mkPubkey(entry.pubkey),
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/accounts/token.ts"],"names":[],"mappings":"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"}
|
|
@@ -609,7 +609,7 @@ export class AgentGateway {
|
|
|
609
609
|
this.getSessionOrThrow(sessionId);
|
|
610
610
|
// Lazy import to keep gateway usable without langchain installed
|
|
611
611
|
const { tool: lcTool } = await import('@langchain/core/tools');
|
|
612
|
-
const { agentRpcMethods } = await import('../tools/zod.js');
|
|
612
|
+
const { agentRpcMethods } = await import('../tools/zod/index.js');
|
|
613
613
|
const tools = [];
|
|
614
614
|
for (const method of agentRpcMethods) {
|
|
615
615
|
const gateway = this;
|
|
@@ -740,5 +740,5 @@ export { PricingEngine, DEFAULT_TIERS } from './pricing.js';
|
|
|
740
740
|
export { ResponseValidator } from './validator.js';
|
|
741
741
|
export { ToolMarketplace } from './marketplace.js';
|
|
742
742
|
/* ── x402 Protocol ─────────────────────────────────────────── */
|
|
743
|
-
export * from './x402.js';
|
|
743
|
+
export * from './x402/index.js';
|
|
744
744
|
//# sourceMappingURL=index.js.map
|
|
@@ -144,20 +144,20 @@ export declare class FacilitatorClient {
|
|
|
144
144
|
* ```ts
|
|
145
145
|
* import { createFacilitator, KnownFacilitator } from '@oobe-protocol-labs/synapse-client-sdk';
|
|
146
146
|
*
|
|
147
|
-
* //
|
|
147
|
+
* // One-liner with a known facilitator
|
|
148
148
|
* const facilitator = createFacilitator(KnownFacilitator.PayAI);
|
|
149
149
|
* const facilitator = createFacilitator(KnownFacilitator.RelAI);
|
|
150
150
|
* const facilitator = createFacilitator(KnownFacilitator.Dexter);
|
|
151
151
|
* const facilitator = createFacilitator(KnownFacilitator.CDP);
|
|
152
152
|
*
|
|
153
|
-
* //
|
|
153
|
+
* // Custom URL
|
|
154
154
|
* const facilitator = createFacilitator({ url: 'https://my-facilitator.com' });
|
|
155
155
|
*
|
|
156
|
-
* //
|
|
156
|
+
* // Known facilitator + auth override
|
|
157
157
|
* const facilitator = createFacilitator(KnownFacilitator.PayAI);
|
|
158
158
|
* // Then set PAYAI_API_KEY_ID / PAYAI_API_KEY_SECRET env vars for production.
|
|
159
159
|
*
|
|
160
|
-
* //
|
|
160
|
+
* // Default (PayAI free tier)
|
|
161
161
|
* const facilitator = createFacilitator();
|
|
162
162
|
* ```
|
|
163
163
|
*
|
|
@@ -257,20 +257,20 @@ export class FacilitatorClient {
|
|
|
257
257
|
* ```ts
|
|
258
258
|
* import { createFacilitator, KnownFacilitator } from '@oobe-protocol-labs/synapse-client-sdk';
|
|
259
259
|
*
|
|
260
|
-
* //
|
|
260
|
+
* // One-liner with a known facilitator
|
|
261
261
|
* const facilitator = createFacilitator(KnownFacilitator.PayAI);
|
|
262
262
|
* const facilitator = createFacilitator(KnownFacilitator.RelAI);
|
|
263
263
|
* const facilitator = createFacilitator(KnownFacilitator.Dexter);
|
|
264
264
|
* const facilitator = createFacilitator(KnownFacilitator.CDP);
|
|
265
265
|
*
|
|
266
|
-
* //
|
|
266
|
+
* // Custom URL
|
|
267
267
|
* const facilitator = createFacilitator({ url: 'https://my-facilitator.com' });
|
|
268
268
|
*
|
|
269
|
-
* //
|
|
269
|
+
* // Known facilitator + auth override
|
|
270
270
|
* const facilitator = createFacilitator(KnownFacilitator.PayAI);
|
|
271
271
|
* // Then set PAYAI_API_KEY_ID / PAYAI_API_KEY_SECRET env vars for production.
|
|
272
272
|
*
|
|
273
|
-
* //
|
|
273
|
+
* // Default (PayAI free tier)
|
|
274
274
|
* const facilitator = createFacilitator();
|
|
275
275
|
* ```
|
|
276
276
|
*
|
package/dist/esm/ai/index.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* @since 1.0.0
|
|
16
16
|
*/
|
|
17
17
|
// ── Tools (LangChain) ─────────────────────────────────────────
|
|
18
|
-
export { createExecutableSolanaTools, agentRpcMethods, solanaToolNames, } from './tools.js';
|
|
18
|
+
export { createExecutableSolanaTools, agentRpcMethods, solanaToolNames, } from './tools/index.js';
|
|
19
19
|
// ── Gateway (Agent Commerce) ──────────────────────────────────
|
|
20
20
|
export {
|
|
21
21
|
// Main orchestrator
|
|
@@ -33,5 +33,5 @@ GatewayError, SessionNotFoundError, MaxSessionsError, IntentVerificationError, c
|
|
|
33
33
|
// x402 Protocol
|
|
34
34
|
X402Paywall, X402Client, FacilitatorClient, createFacilitator, createX402Client, encodePaymentHeader, decodePaymentHeader, defaultRequirementsSelector, SOLANA_MAINNET, SOLANA_DEVNET, USDC_MAINNET, USDC_DEVNET, X402_HEADER_PAYMENT_REQUIRED, X402_HEADER_PAYMENT_SIGNATURE, X402_HEADER_PAYMENT_RESPONSE, X402_STATUS_CODE, X402_VERSION,
|
|
35
35
|
// x402 Errors
|
|
36
|
-
FacilitatorError, VerifyError, SettleError, X402ClientError, NoAcceptablePaymentError, PaymentSigningError, PaymentRetryError, } from './gateway.js';
|
|
36
|
+
FacilitatorError, VerifyError, SettleError, X402ClientError, NoAcceptablePaymentError, PaymentSigningError, PaymentRetryError, } from './gateway/index.js';
|
|
37
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
* @since 1.0.0
|
|
21
21
|
*/
|
|
22
22
|
import { tool } from '@langchain/core/tools';
|
|
23
|
-
import { agentRpcMethods } from './zod.js';
|
|
23
|
+
import { agentRpcMethods } from './zod/index.js';
|
|
24
24
|
// Re-export for convenience
|
|
25
|
-
export { agentRpcMethods } from './zod.js';
|
|
25
|
+
export { agentRpcMethods } from './zod/index.js';
|
|
26
26
|
// ── Protocol tools (Jupiter, Raydium, Metaplex) ───────────────
|
|
27
27
|
export {
|
|
28
28
|
// Factories
|
|
@@ -32,7 +32,7 @@ jupiterMethods, jupiterMethodNames, raydiumMethods, raydiumMethodNames, metaplex
|
|
|
32
32
|
// Shared infrastructure
|
|
33
33
|
ProtocolHttpClient, ProtocolApiError, buildProtocolTools, createMethodRegistry,
|
|
34
34
|
// Constants
|
|
35
|
-
JUPITER_API_URL, RAYDIUM_API_URL, } from './protocols.js';
|
|
35
|
+
JUPITER_API_URL, RAYDIUM_API_URL, } from './protocols/index.js';
|
|
36
36
|
/* ═══════════════════════════════════════════════════════════════
|
|
37
37
|
* Method name → standalone function dispatcher
|
|
38
38
|
*
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
// ── Shared infrastructure ──────────────────────────────────────
|
|
21
21
|
export { ProtocolHttpClient, ProtocolApiError, createMethodRegistry, buildProtocolTools, } from './shared.js';
|
|
22
22
|
// ── Jupiter ────────────────────────────────────────────────────
|
|
23
|
-
export { createJupiterTools, jupiterMethods, jupiterMethodNames, JUPITER_API_URL, } from './jupiter.js';
|
|
23
|
+
export { createJupiterTools, jupiterMethods, jupiterMethodNames, JUPITER_API_URL, } from './jupiter/index.js';
|
|
24
24
|
// ── Raydium ────────────────────────────────────────────────────
|
|
25
|
-
export { createRaydiumTools, raydiumMethods, raydiumMethodNames, RAYDIUM_API_URL, } from './raydium.js';
|
|
25
|
+
export { createRaydiumTools, raydiumMethods, raydiumMethodNames, RAYDIUM_API_URL, } from './raydium/index.js';
|
|
26
26
|
// ── Metaplex ───────────────────────────────────────────────────
|
|
27
|
-
export { createMetaplexTools, metaplexMethods, metaplexMethodNames, } from './metaplex.js';
|
|
28
|
-
import { createJupiterTools } from './jupiter.js';
|
|
29
|
-
import { createRaydiumTools } from './raydium.js';
|
|
30
|
-
import { createMetaplexTools } from './metaplex.js';
|
|
27
|
+
export { createMetaplexTools, metaplexMethods, metaplexMethodNames, } from './metaplex/index.js';
|
|
28
|
+
import { createJupiterTools } from './jupiter/index.js';
|
|
29
|
+
import { createRaydiumTools } from './raydium/index.js';
|
|
30
|
+
import { createMetaplexTools } from './metaplex/index.js';
|
|
31
31
|
/**
|
|
32
32
|
* @description Create tools for all Solana native protocols in a single call.
|
|
33
33
|
*
|
|
@@ -31,5 +31,5 @@ export declare const agentRpcMethods: AgentRpcMethod[];
|
|
|
31
31
|
* @returns {AgentRpcMethod} The registered method descriptor
|
|
32
32
|
* @since 1.0.0
|
|
33
33
|
*/
|
|
34
|
-
export declare function registerRpcMethod<I extends z.ZodTypeAny, O extends z.ZodTypeAny>(name: string, input: I, output: O, description?: string): AgentRpcMethod;
|
|
34
|
+
export declare function registerRpcMethod<I extends z.ZodTypeAny, O extends z.ZodTypeAny>(name: string, input: I, output: O, description?: string, skill?: string): AgentRpcMethod;
|
|
35
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/tools/zod/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAc9C;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,EAAoB,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC,UAAU,EAC9E,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/tools/zod/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAc9C;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,EAAoB,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC,UAAU,EAC9E,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,cAAc,CAKhB"}
|
|
@@ -43,10 +43,10 @@ export const agentRpcMethods = _registry ?? [];
|
|
|
43
43
|
* @returns {AgentRpcMethod} The registered method descriptor
|
|
44
44
|
* @since 1.0.0
|
|
45
45
|
*/
|
|
46
|
-
export function registerRpcMethod(name, input, output, description) {
|
|
46
|
+
export function registerRpcMethod(name, input, output, description, skill) {
|
|
47
47
|
if (!_registry)
|
|
48
48
|
_registry = [];
|
|
49
|
-
const method = { name, input, output, description };
|
|
49
|
+
const method = { name, input, output, description, skill };
|
|
50
50
|
_registry.push(method);
|
|
51
51
|
return method;
|
|
52
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/tools/zod/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;qEAGqE;AACrE,OAAO,SAAS,CAAC;AAOjB;;;;;;;;GAQG;AACH,kCAAkC;AAClC,IAAI,SAAuC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqB,SAAS,IAAI,EAAE,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,KAAQ,EACR,MAAS,EACT,WAAoB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/tools/zod/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;qEAGqE;AACrE,OAAO,SAAS,CAAC;AAOjB;;;;;;;;GAQG;AACH,kCAAkC;AAClC,IAAI,SAAuC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqB,SAAS,IAAI,EAAE,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,KAAQ,EACR,MAAS,EACT,WAAoB,EACpB,KAAc;IAEd,IAAI,CAAC,SAAS;QAAE,SAAS,GAAG,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAmB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAG,CAAC;IAC5E,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -21,5 +21,7 @@ export interface AgentRpcMethod {
|
|
|
21
21
|
input: z.ZodTypeAny;
|
|
22
22
|
/** Zod schema documenting the expected output shape. */
|
|
23
23
|
output: z.ZodTypeAny;
|
|
24
|
+
/** Optional skill/category tag for organizing methods. */
|
|
25
|
+
skill?: string;
|
|
24
26
|
}
|
|
25
27
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/ai/tools/zod/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC;IACpB,wDAAwD;IACxD,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/ai/tools/zod/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC;IACpB,wDAAwD;IACxD,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC;IAErB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|