@oobe-protocol-labs/synapse-client-sdk 1.2.1 → 1.2.2
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 +74 -0
- package/dist/cjs/ai/gateway/index.d.ts +86 -5
- package/dist/cjs/ai/gateway/index.d.ts.map +1 -1
- package/dist/cjs/ai/gateway/index.js +278 -40
- package/dist/cjs/ai/gateway/index.js.map +1 -1
- package/dist/cjs/ai/gateway/registry.d.ts +223 -0
- package/dist/cjs/ai/gateway/registry.d.ts.map +1 -0
- package/dist/cjs/ai/gateway/registry.js +290 -0
- package/dist/cjs/ai/gateway/registry.js.map +1 -0
- package/dist/cjs/ai/gateway/types.d.ts +107 -1
- package/dist/cjs/ai/gateway/types.d.ts.map +1 -1
- package/dist/cjs/ai/gateway/x402/index.d.ts +2 -4
- package/dist/cjs/ai/gateway/x402/index.d.ts.map +1 -1
- package/dist/cjs/ai/gateway/x402/index.js +2 -1
- package/dist/cjs/ai/gateway/x402/index.js.map +1 -1
- package/dist/cjs/ai/gateway/x402/registry.d.ts +131 -1
- package/dist/cjs/ai/gateway/x402/registry.d.ts.map +1 -1
- package/dist/cjs/ai/gateway/x402/registry.js +229 -1
- package/dist/cjs/ai/gateway/x402/registry.js.map +1 -1
- package/dist/cjs/ai/index.d.ts +2 -1
- package/dist/cjs/ai/index.d.ts.map +1 -1
- package/dist/cjs/ai/index.js +21 -2
- package/dist/cjs/ai/index.js.map +1 -1
- package/dist/cjs/ai/persistence/helpers.d.ts +83 -0
- package/dist/cjs/ai/persistence/helpers.d.ts.map +1 -0
- package/dist/cjs/ai/persistence/helpers.js +193 -0
- package/dist/cjs/ai/persistence/helpers.js.map +1 -0
- package/dist/cjs/ai/persistence/index.d.ts +91 -0
- package/dist/cjs/ai/persistence/index.d.ts.map +1 -0
- package/dist/cjs/ai/persistence/index.js +109 -0
- package/dist/cjs/ai/persistence/index.js.map +1 -0
- package/dist/cjs/ai/persistence/memory.d.ts +71 -0
- package/dist/cjs/ai/persistence/memory.d.ts.map +1 -0
- package/dist/cjs/ai/persistence/memory.js +192 -0
- package/dist/cjs/ai/persistence/memory.js.map +1 -0
- package/dist/cjs/ai/persistence/postgresql.d.ts +119 -0
- package/dist/cjs/ai/persistence/postgresql.d.ts.map +1 -0
- package/dist/cjs/ai/persistence/postgresql.js +310 -0
- package/dist/cjs/ai/persistence/postgresql.js.map +1 -0
- package/dist/cjs/ai/persistence/redis.d.ts +84 -0
- package/dist/cjs/ai/persistence/redis.d.ts.map +1 -0
- package/dist/cjs/ai/persistence/redis.js +241 -0
- package/dist/cjs/ai/persistence/redis.js.map +1 -0
- package/dist/cjs/ai/persistence/types.d.ts +267 -0
- package/dist/cjs/ai/persistence/types.d.ts.map +1 -0
- package/dist/cjs/ai/persistence/types.js +40 -0
- package/dist/cjs/ai/persistence/types.js.map +1 -0
- package/dist/cjs/core/client.d.ts +16 -0
- package/dist/cjs/core/client.d.ts.map +1 -1
- package/dist/cjs/core/client.js +18 -0
- package/dist/cjs/core/client.js.map +1 -1
- package/dist/cjs/next/index.d.ts +141 -0
- package/dist/cjs/next/index.d.ts.map +1 -0
- package/dist/cjs/next/index.js +177 -0
- package/dist/cjs/next/index.js.map +1 -0
- package/dist/cjs/utils/helpers.d.ts +79 -1
- package/dist/cjs/utils/helpers.d.ts.map +1 -1
- package/dist/cjs/utils/helpers.js +109 -0
- package/dist/cjs/utils/helpers.js.map +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/AccountReader.html +18 -18
- package/dist/docs/classes/AccountsClient.html +10 -10
- package/dist/docs/classes/AsyncProviderError.html +4 -4
- package/dist/docs/classes/CircularDependencyError.html +4 -4
- 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/InstructionWriter.html +11 -11
- package/dist/docs/classes/MemoryGuard.html +9 -9
- package/dist/docs/classes/NetworkError.html +5 -5
- package/dist/docs/classes/RefRegistry.html +11 -11
- package/dist/docs/classes/RefReleasedError.html +4 -4
- package/dist/docs/classes/RpcMethodNotFoundError.html +4 -4
- package/dist/docs/classes/ServiceNotFoundError.html +4 -4
- package/dist/docs/classes/ServiceRef.html +13 -13
- package/dist/docs/classes/SolanaRpc.html +55 -55
- package/dist/docs/classes/SynapseClient.html +25 -15
- package/dist/docs/classes/SynapseContext.html +27 -27
- 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/WeakServiceRef.html +4 -4
- package/dist/docs/classes/WsClient.html +10 -10
- package/dist/docs/enums/SynapseNetwork.html +2 -2
- package/dist/docs/enums/SynapseRegion.html +2 -2
- package/dist/docs/enums/TokenExtensionType.html +2 -2
- package/dist/docs/functions/Epoch-1.html +1 -1
- package/dist/docs/functions/Lamports-2.html +1 -1
- 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/autoSelectRegion.html +1 -1
- package/dist/docs/functions/autoWire.html +1 -1
- package/dist/docs/functions/base58Encode.html +1 -1
- package/dist/docs/functions/base64ToBytes.html +1 -1
- package/dist/docs/functions/bigIntReplacer.html +6 -0
- package/dist/docs/functions/chunk.html +1 -1
- package/dist/docs/functions/computeBalanceChanges.html +1 -1
- package/dist/docs/functions/computeTokenBalanceChanges.html +1 -1
- package/dist/docs/functions/createBareContext.html +1 -1
- package/dist/docs/functions/createBinding.html +1 -1
- package/dist/docs/functions/createBoundHook.html +1 -1
- package/dist/docs/functions/createReactAdapter.html +1 -1
- package/dist/docs/functions/createRefHook.html +1 -1
- package/dist/docs/functions/createServerMiddleware.html +1 -1
- package/dist/docs/functions/createServiceHook.html +1 -1
- package/dist/docs/functions/createSingleton.html +15 -0
- package/dist/docs/functions/createSynapse.html +1 -1
- package/dist/docs/functions/createSynapseContext.html +1 -1
- package/dist/docs/functions/createToken.html +1 -1
- package/dist/docs/functions/decodeBase58.html +1 -1
- package/dist/docs/functions/decodeLookupTable.html +1 -1
- package/dist/docs/functions/decodeMint.html +1 -1
- package/dist/docs/functions/decodeMultisig.html +1 -1
- package/dist/docs/functions/decodeNonceAccount.html +1 -1
- package/dist/docs/functions/decodeStakeAccount.html +1 -1
- package/dist/docs/functions/decodeToken2022Account.html +1 -1
- package/dist/docs/functions/decodeToken2022Mint.html +1 -1
- package/dist/docs/functions/decodeTokenAccount.html +1 -1
- package/dist/docs/functions/encodeBase58.html +1 -1
- package/dist/docs/functions/fetchLookupTable.html +1 -1
- package/dist/docs/functions/fetchMint.html +1 -1
- package/dist/docs/functions/fetchNonceAccount.html +1 -1
- package/dist/docs/functions/fetchStakeAccount.html +1 -1
- package/dist/docs/functions/fetchTokenAccount.html +1 -1
- package/dist/docs/functions/fetchTokenAccountsByOwner.html +1 -1
- package/dist/docs/functions/fromKitAddress.html +1 -1
- package/dist/docs/functions/getAccountInfo.html +1 -1
- 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/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/getContext.html +1 -1
- package/dist/docs/functions/getDecodedAccount.html +1 -1
- package/dist/docs/functions/getDecodedAccounts.html +1 -1
- 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/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/isBlockhashValid.html +1 -1
- package/dist/docs/functions/isBrowser.html +1 -1
- package/dist/docs/functions/isDisposable.html +1 -1
- package/dist/docs/functions/isProgramInCategory.html +1 -1
- package/dist/docs/functions/isServer.html +1 -1
- package/dist/docs/functions/isValidPubkey.html +1 -1
- package/dist/docs/functions/isValidSignature.html +1 -1
- 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/minimumLedgerSlot.html +1 -1
- package/dist/docs/functions/parseAccountUpdate.html +1 -1
- 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/parseSlotUpdate.html +1 -1
- package/dist/docs/functions/parseTimestamp.html +1 -1
- package/dist/docs/functions/parseTransaction.html +1 -1
- 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/readonly.html +1 -1
- package/dist/docs/functions/readonlySigner.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/sendTransaction.html +1 -1
- package/dist/docs/functions/setGlobalContext.html +1 -1
- package/dist/docs/functions/simulateTransaction.html +1 -1
- package/dist/docs/functions/sleep.html +1 -1
- package/dist/docs/functions/solToLamports.html +1 -1
- package/dist/docs/functions/toClientConfig.html +1 -1
- package/dist/docs/functions/toJsonSafe.html +13 -0
- package/dist/docs/functions/toKitAddress.html +1 -1
- package/dist/docs/functions/toKitInstruction.html +1 -1
- package/dist/docs/functions/toKitLamports.html +1 -1
- package/dist/docs/functions/toKitSignatureString.html +1 -1
- package/dist/docs/functions/tryGetContext.html +1 -1
- package/dist/docs/functions/tryUseService.html +1 -1
- package/dist/docs/functions/useBoundServices.html +1 -1
- package/dist/docs/functions/useService.html +1 -1
- package/dist/docs/functions/useSharedRef.html +1 -1
- package/dist/docs/functions/withRef.html +1 -1
- package/dist/docs/functions/withRefAsync.html +1 -1
- package/dist/docs/functions/writable.html +1 -1
- package/dist/docs/functions/writableSigner.html +1 -1
- package/dist/docs/interfaces/AccountInfo.html +7 -7
- package/dist/docs/interfaces/AccountMeta.html +4 -4
- package/dist/docs/interfaces/AccountNotification.html +2 -2
- package/dist/docs/interfaces/AccountSubParams.html +2 -2
- package/dist/docs/interfaces/AddMemoParams.html +5 -5
- package/dist/docs/interfaces/AdvanceNonceParams.html +3 -3
- package/dist/docs/interfaces/AliasProvider.html +2 -2
- package/dist/docs/interfaces/AllocateParams.html +3 -3
- package/dist/docs/interfaces/ApproveCheckedParams.html +9 -9
- package/dist/docs/interfaces/ApproveParams.html +7 -7
- package/dist/docs/interfaces/AssetSignatureInfo.html +2 -2
- package/dist/docs/interfaces/AssetSignaturesPage.html +2 -2
- package/dist/docs/interfaces/AssignParams.html +3 -3
- package/dist/docs/interfaces/AsyncFactoryProvider.html +2 -2
- package/dist/docs/interfaces/AuthorizeNonceParams.html +4 -4
- 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/BurnCheckedParams.html +8 -8
- package/dist/docs/interfaces/BurnParams.html +7 -7
- package/dist/docs/interfaces/CallOptions.html +6 -6
- package/dist/docs/interfaces/ClassProvider.html +2 -2
- package/dist/docs/interfaces/CloseAccountParams.html +6 -6
- package/dist/docs/interfaces/ConfirmedTransaction.html +6 -6
- package/dist/docs/interfaces/ContactInfo.html +2 -2
- package/dist/docs/interfaces/ContextAdapter.html +5 -5
- package/dist/docs/interfaces/ContextEvents.html +6 -6
- package/dist/docs/interfaces/ContextModule.html +3 -3
- package/dist/docs/interfaces/CreateATAParams.html +6 -6
- package/dist/docs/interfaces/CreateAccountParams.html +6 -6
- package/dist/docs/interfaces/CreateAccountWithSeedParams.html +8 -8
- package/dist/docs/interfaces/CreateSynapseContextOpts.html +4 -4
- 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 +4 -4
- package/dist/docs/interfaces/DecodedLookupTable.html +8 -8
- package/dist/docs/interfaces/DecodedMint.html +6 -6
- package/dist/docs/interfaces/DecodedMultisig.html +5 -5
- package/dist/docs/interfaces/DecodedNonceAccount.html +6 -6
- package/dist/docs/interfaces/DecodedStakeAccount.html +2 -2
- package/dist/docs/interfaces/DecodedToken2022Account.html +9 -9
- package/dist/docs/interfaces/DecodedToken2022Mint.html +6 -6
- package/dist/docs/interfaces/DecodedTokenAccount.html +9 -9
- package/dist/docs/interfaces/DefaultAccountStateExt.html +2 -2
- package/dist/docs/interfaces/Disposable.html +2 -2
- 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/FactoryProvider.html +2 -2
- package/dist/docs/interfaces/FetchedMint.html +6 -6
- package/dist/docs/interfaces/FetchedTokenAccount.html +6 -6
- package/dist/docs/interfaces/FreezeThawParams.html +6 -6
- 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 +2 -2
- 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/InitializeAccountParams.html +5 -5
- package/dist/docs/interfaces/InitializeMintParams.html +6 -6
- package/dist/docs/interfaces/InitializeNonceParams.html +3 -3
- package/dist/docs/interfaces/InterestBearingConfigExt.html +2 -2
- package/dist/docs/interfaces/LatencyProbeResult.html +2 -2
- package/dist/docs/interfaces/LeakReport.html +5 -5
- package/dist/docs/interfaces/LogsNotification.html +2 -2
- package/dist/docs/interfaces/LogsSubParams.html +2 -2
- package/dist/docs/interfaces/MemoTransferExt.html +2 -2
- package/dist/docs/interfaces/MemoryGuardConfig.html +4 -4
- package/dist/docs/interfaces/MetadataPointerExt.html +2 -2
- package/dist/docs/interfaces/MintCloseAuthorityExt.html +2 -2
- package/dist/docs/interfaces/MintToCheckedParams.html +8 -8
- package/dist/docs/interfaces/MintToParams.html +7 -7
- package/dist/docs/interfaces/NonTransferableExt.html +2 -2
- 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 +2 -2
- 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/ProgramsBundle.html +33 -33
- 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/ReactAdapterConfig.html +2 -2
- package/dist/docs/interfaces/RecoverNestedParams.html +7 -7
- package/dist/docs/interfaces/RefRegistryConfig.html +2 -2
- package/dist/docs/interfaces/RefStats.html +7 -7
- package/dist/docs/interfaces/RequestHeapFrameParams.html +2 -2
- package/dist/docs/interfaces/ResolveMiddleware.html +1 -1
- package/dist/docs/interfaces/RevokeParams.html +5 -5
- 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 +3 -3
- package/dist/docs/interfaces/RpcResponse.html +2 -2
- package/dist/docs/interfaces/SendTransactionOpts.html +6 -6
- package/dist/docs/interfaces/ServerAdapterConfig.html +3 -3
- package/dist/docs/interfaces/ServiceBinding.html +6 -6
- package/dist/docs/interfaces/ServiceRegistration.html +3 -3
- package/dist/docs/interfaces/ServiceResolver.html +6 -6
- package/dist/docs/interfaces/ServiceToken.html +4 -4
- package/dist/docs/interfaces/SetComputeUnitLimitParams.html +2 -2
- package/dist/docs/interfaces/SetComputeUnitPriceParams.html +2 -2
- package/dist/docs/interfaces/SetLoadedAccountsDataSizeLimitParams.html +2 -2
- 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/SingletonOptions.html +7 -0
- 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 +2 -2
- package/dist/docs/interfaces/StakeDelegation.html +3 -3
- package/dist/docs/interfaces/StakeLockup.html +4 -4
- package/dist/docs/interfaces/StakeMeta.html +2 -2
- package/dist/docs/interfaces/Supply.html +5 -5
- package/dist/docs/interfaces/SynapseClientConfig.html +9 -9
- package/dist/docs/interfaces/SynapseClientLike.html +2 -2
- package/dist/docs/interfaces/SynapseEndpoint.html +7 -7
- package/dist/docs/interfaces/SyncNativeParams.html +3 -3
- package/dist/docs/interfaces/SystemTransferParams.html +4 -4
- 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/TokenTransferParams.html +7 -7
- package/dist/docs/interfaces/TransactionInstruction.html +4 -4
- package/dist/docs/interfaces/TransactionMeta.html +11 -11
- package/dist/docs/interfaces/TransferCheckedParams.html +9 -9
- package/dist/docs/interfaces/TransferFeeAmount.html +2 -2
- package/dist/docs/interfaces/TransferFeeConfig.html +2 -2
- package/dist/docs/interfaces/TransportConfig.html +7 -7
- package/dist/docs/interfaces/UnknownExtension.html +2 -2
- package/dist/docs/interfaces/ValueProvider.html +2 -2
- package/dist/docs/interfaces/VoteAccount.html +9 -9
- package/dist/docs/interfaces/VoteAccountsResult.html +3 -3
- package/dist/docs/interfaces/WithdrawNonceParams.html +5 -5
- package/dist/docs/interfaces/WsConfig.html +6 -6
- package/dist/docs/media/CHANGELOG.md +74 -0
- package/dist/docs/modules.html +4 -0
- package/dist/docs/types/AccountFetchOpts.html +1 -1
- package/dist/docs/types/AccountFilter.html +1 -1
- 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 +1 -1
- package/dist/docs/types/Encoding.html +1 -1
- package/dist/docs/types/Epoch.html +1 -1
- package/dist/docs/types/Lamports.html +1 -1
- package/dist/docs/types/LogsFilter.html +1 -1
- package/dist/docs/types/MemcmpFilter.html +1 -1
- package/dist/docs/types/NonceState.html +1 -1
- package/dist/docs/types/ParsedGeyserUpdate.html +1 -1
- package/dist/docs/types/Pubkey.html +1 -1
- package/dist/docs/types/RuntimeEnv.html +1 -1
- package/dist/docs/types/ServiceLifecycle.html +1 -1
- package/dist/docs/types/ServiceProvider.html +1 -1
- package/dist/docs/types/Signature.html +1 -1
- package/dist/docs/types/Slot.html +1 -1
- package/dist/docs/types/StakeAccountType.html +1 -1
- package/dist/docs/types/SubscriptionId.html +1 -1
- package/dist/docs/types/TokenAccountState.html +1 -1
- package/dist/docs/types/TransactionDetail.html +1 -1
- 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/ASSOCIATED_TOKEN_PROGRAM.html +1 -1
- package/dist/docs/variables/AssociatedToken.html +4 -4
- package/dist/docs/variables/COMPUTE_BUDGET_PROGRAM.html +1 -1
- package/dist/docs/variables/ComputeBudget.html +5 -5
- 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 +1 -1
- package/dist/docs/variables/LOOKUP_TABLE_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/MARINADE_PROGRAMS.html +1 -1
- package/dist/docs/variables/MAX_MULTISIG_SIGNERS.html +1 -1
- package/dist/docs/variables/MEMO_PROGRAM_V1.html +1 -1
- package/dist/docs/variables/MEMO_PROGRAM_V2.html +1 -1
- 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 +1 -1
- package/dist/docs/variables/MULTISIG_SIZE.html +1 -1
- package/dist/docs/variables/Memo.html +2 -2
- package/dist/docs/variables/NONCE_ACCOUNT_SIZE.html +1 -1
- 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 +1 -1
- 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_PROGRAM.html +1 -1
- package/dist/docs/variables/SYSTEM_PROGRAMS.html +1 -1
- package/dist/docs/variables/SYSTEM_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/SplToken.html +16 -16
- package/dist/docs/variables/SystemProgram.html +10 -10
- package/dist/docs/variables/TOKEN_2022_PROGRAM.html +1 -1
- package/dist/docs/variables/TOKEN_2022_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/TOKEN_ACCOUNT_SIZE.html +1 -1
- package/dist/docs/variables/TOKEN_PROGRAM.html +1 -1
- package/dist/docs/variables/TOKEN_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/Tokens.html +1 -1
- package/dist/esm/ai/gateway/index.d.ts +86 -5
- package/dist/esm/ai/gateway/index.d.ts.map +1 -1
- package/dist/esm/ai/gateway/index.js +275 -39
- package/dist/esm/ai/gateway/index.js.map +1 -1
- package/dist/esm/ai/gateway/registry.d.ts +223 -0
- package/dist/esm/ai/gateway/registry.d.ts.map +1 -0
- package/dist/esm/ai/gateway/registry.js +285 -0
- package/dist/esm/ai/gateway/registry.js.map +1 -0
- package/dist/esm/ai/gateway/types.d.ts +107 -1
- package/dist/esm/ai/gateway/types.d.ts.map +1 -1
- package/dist/esm/ai/gateway/x402/index.d.ts +2 -4
- package/dist/esm/ai/gateway/x402/index.d.ts.map +1 -1
- package/dist/esm/ai/gateway/x402/index.js +2 -3
- package/dist/esm/ai/gateway/x402/index.js.map +1 -1
- package/dist/esm/ai/gateway/x402/registry.d.ts +131 -1
- package/dist/esm/ai/gateway/x402/registry.d.ts.map +1 -1
- package/dist/esm/ai/gateway/x402/registry.js +227 -0
- package/dist/esm/ai/gateway/x402/registry.js.map +1 -1
- package/dist/esm/ai/index.d.ts +2 -1
- package/dist/esm/ai/index.d.ts.map +1 -1
- package/dist/esm/ai/index.js +13 -1
- package/dist/esm/ai/index.js.map +1 -1
- package/dist/esm/ai/persistence/helpers.d.ts +83 -0
- package/dist/esm/ai/persistence/helpers.d.ts.map +1 -0
- package/dist/esm/ai/persistence/helpers.js +183 -0
- package/dist/esm/ai/persistence/helpers.js.map +1 -0
- package/dist/esm/ai/persistence/index.d.ts +91 -0
- package/dist/esm/ai/persistence/index.d.ts.map +1 -0
- package/dist/esm/ai/persistence/index.js +94 -0
- package/dist/esm/ai/persistence/index.js.map +1 -0
- package/dist/esm/ai/persistence/memory.d.ts +71 -0
- package/dist/esm/ai/persistence/memory.d.ts.map +1 -0
- package/dist/esm/ai/persistence/memory.js +188 -0
- package/dist/esm/ai/persistence/memory.js.map +1 -0
- package/dist/esm/ai/persistence/postgresql.d.ts +119 -0
- package/dist/esm/ai/persistence/postgresql.d.ts.map +1 -0
- package/dist/esm/ai/persistence/postgresql.js +306 -0
- package/dist/esm/ai/persistence/postgresql.js.map +1 -0
- package/dist/esm/ai/persistence/redis.d.ts +84 -0
- package/dist/esm/ai/persistence/redis.d.ts.map +1 -0
- package/dist/esm/ai/persistence/redis.js +237 -0
- package/dist/esm/ai/persistence/redis.js.map +1 -0
- package/dist/esm/ai/persistence/types.d.ts +267 -0
- package/dist/esm/ai/persistence/types.d.ts.map +1 -0
- package/dist/esm/ai/persistence/types.js +36 -0
- package/dist/esm/ai/persistence/types.js.map +1 -0
- package/dist/esm/core/client.d.ts +16 -0
- package/dist/esm/core/client.d.ts.map +1 -1
- package/dist/esm/core/client.js +18 -0
- package/dist/esm/core/client.js.map +1 -1
- package/dist/esm/next/index.d.ts +141 -0
- package/dist/esm/next/index.d.ts.map +1 -0
- package/dist/esm/next/index.js +171 -0
- package/dist/esm/next/index.js.map +1 -0
- package/dist/esm/utils/helpers.d.ts +79 -1
- package/dist/esm/utils/helpers.d.ts.map +1 -1
- package/dist/esm/utils/helpers.js +106 -0
- package/dist/esm/utils/helpers.js.map +1 -1
- package/package.json +20 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,80 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [1.2.2] — 2026-03-02
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`toJsonSafe()` & `bigIntReplacer()`** — Recursive BigInt→string serializer and
|
|
15
|
+
`JSON.stringify` replacer. Eliminates the "Do not know how to serialize a BigInt"
|
|
16
|
+
crash in Next.js API Routes and Express handlers.
|
|
17
|
+
(`import { toJsonSafe, bigIntReplacer } from '…/utils'`)
|
|
18
|
+
|
|
19
|
+
- **`createSingleton()`** — HMR-safe singleton factory using `globalThis.__synapse_singletons`.
|
|
20
|
+
Survives Next.js / Vite hot-module reloads in development. Supports `version` option
|
|
21
|
+
for cache invalidation.
|
|
22
|
+
(`import { createSingleton } from '…/utils'`)
|
|
23
|
+
|
|
24
|
+
- **`client.getTransport()`** — Public accessor for the underlying `HttpTransport`,
|
|
25
|
+
replacing the `(client as any)._transport` pattern.
|
|
26
|
+
|
|
27
|
+
- **`gateway.snapshot(depth?)`** — JSON-safe serialization of the entire AgentGateway
|
|
28
|
+
state with three depth levels: `'minimal'`, `'standard'`, `'full'`.
|
|
29
|
+
Also adds `gateway.toJSON()` enabling `JSON.stringify(gateway)`.
|
|
30
|
+
|
|
31
|
+
- **`gateway.createPaymentIntent(opts)`** — Builder for `PaymentIntent` objects with
|
|
32
|
+
auto-generated nonce, timestamp, token. Accepts buyer as `AgentId`, string, or
|
|
33
|
+
`AgentGateway` instance.
|
|
34
|
+
|
|
35
|
+
- **Retry on `gateway.execute()`** — Configurable retry with exponential backoff via
|
|
36
|
+
`RetryConfig`. Supports per-call overrides, transient error detection, and optional
|
|
37
|
+
fallback to direct RPC on the last attempt. Emits `call:retry` events.
|
|
38
|
+
|
|
39
|
+
- **x402 pipeline hooks & observability** — `executeWithX402()` now emits granular
|
|
40
|
+
`x402:pipeline:*` events for each pipeline step (paywall → verify → execute → settle).
|
|
41
|
+
Accepts `onStep` callback and returns full pipeline trace with per-step timing.
|
|
42
|
+
|
|
43
|
+
- **`AgentRegistry`** — Multi-agent lifecycle manager with CRUD, `filter()`,
|
|
44
|
+
`searchMarketplace()`, `getAggregateMetrics()`, `snapshot()`, pluggable persistence
|
|
45
|
+
via `PersistenceAdapter`, and `[Symbol.iterator]` support.
|
|
46
|
+
|
|
47
|
+
- **`FacilitatorDiscovery`** — Runtime-aware facilitator discovery wrapping the static
|
|
48
|
+
`FACILITATOR_REGISTRY`. Adds `filter()`, `query()`, `healthCheck()`, and `findBest()`
|
|
49
|
+
with optional health-check-based selection and gas-sponsoring preference.
|
|
50
|
+
|
|
51
|
+
- **Persistence module (`ai/persistence`)** — Full long-term storage layer for agent
|
|
52
|
+
gateway data:
|
|
53
|
+
- `MemoryStore` — in-process, for testing and dev
|
|
54
|
+
- `RedisPersistence` — Redis/Valkey adapter (ioredis, node-redis, @upstash/redis)
|
|
55
|
+
- `PostgresPersistence` — PostgreSQL adapter with auto-migration (pg, @vercel/postgres,
|
|
56
|
+
@neondatabase/serverless)
|
|
57
|
+
- Universal `PersistenceStore` interface covering agents, sessions, receipts, metrics,
|
|
58
|
+
and generic key-value with TTL
|
|
59
|
+
- All adapters implement `PersistenceAdapter` for drop-in use with `AgentRegistry`
|
|
60
|
+
- Helpers: `serialize()`, `deserialize()`, `buildKey()`, `buildSchema()` (DDL generator)
|
|
61
|
+
- New optional peer deps: `ioredis >=5.0.0`, `pg >=8.0.0`
|
|
62
|
+
|
|
63
|
+
- **Next.js integration (`./next`)** — Drop-in helpers for App Router:
|
|
64
|
+
- `synapseResponse(data)` — BigInt-safe `Response` factory
|
|
65
|
+
- `withSynapseError(handler)` — API Route error boundary
|
|
66
|
+
- `createSynapseProvider(config)` — HMR-safe SynapseClient singleton
|
|
67
|
+
- `createGatewayProvider(clientProvider, configFactory)` — HMR-safe AgentGateway singleton
|
|
68
|
+
|
|
69
|
+
### New types
|
|
70
|
+
|
|
71
|
+
- `RetryConfig`, `SnapshotDepth`, `GatewaySnapshot`, `X402PipelineStep`
|
|
72
|
+
- `SessionRecord`, `ReceiptRecord`, `MetricPoint`, `PersistenceStore`
|
|
73
|
+
- `RedisLike`, `PgLike`, `RedisStoreConfig`, `PostgresStoreConfig`, `MemoryStoreConfig`
|
|
74
|
+
- `FacilitatorHealthResult`, `FindBestOptions`, `AgentRegistryConfig`
|
|
75
|
+
- `SynapseResponseInit`, `SingletonOptions`
|
|
76
|
+
|
|
77
|
+
### New subpath exports
|
|
78
|
+
|
|
79
|
+
- `@oobe-protocol-labs/synapse-client-sdk/next`
|
|
80
|
+
- `@oobe-protocol-labs/synapse-client-sdk/ai/persistence`
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
10
84
|
## [1.2.1] — 2025-07-22
|
|
11
85
|
|
|
12
86
|
### Fixed
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* @since 1.0.0
|
|
21
21
|
*/
|
|
22
22
|
import type { SynapseClientLike } from '../../core/client';
|
|
23
|
-
import type { AgentId, AgentIdentity, GatewayConfig, GatewayEventHandler, GatewayEventType, PaymentIntent, PaymentReceipt, PricingTier, AttestedResult, ToolBundle, SessionState } from './types';
|
|
23
|
+
import type { AgentId, AgentIdentity, GatewayConfig, GatewayEventHandler, GatewayEventType, PaymentIntent, PaymentReceipt, PricingTier, AttestedResult, ToolBundle, SessionState, RetryConfig, SnapshotDepth, GatewaySnapshot, X402PipelineStep } from './types';
|
|
24
24
|
import { AgentSession } from './session';
|
|
25
25
|
import { PricingEngine } from './pricing';
|
|
26
26
|
import { ResponseValidator } from './validator';
|
|
@@ -194,13 +194,19 @@ export declare class AgentGateway {
|
|
|
194
194
|
* 4. `session.postCall()` — deduct budget, increment counters
|
|
195
195
|
* 5. `pricing.reportLatency()`— feed latency into dynamic pricing
|
|
196
196
|
*
|
|
197
|
+
* If `config.retry` is set, transient errors are retried with exponential
|
|
198
|
+
* backoff. Pass per-call `opts.retry` to override.
|
|
199
|
+
*
|
|
197
200
|
* @param {string} sessionId - The session to charge
|
|
198
201
|
* @param {string} method - Solana JSON-RPC method name
|
|
199
202
|
* @param {unknown[]} [params=[]] - Method parameters
|
|
203
|
+
* @param {{ retry?: RetryConfig }} [opts] - Per-call overrides
|
|
200
204
|
* @returns {Promise<AttestedResult<T>>} The attested result
|
|
201
205
|
* @since 1.0.0
|
|
202
206
|
*/
|
|
203
|
-
execute<T = unknown>(sessionId: string, method: string, params?: unknown[]
|
|
207
|
+
execute<T = unknown>(sessionId: string, method: string, params?: unknown[], opts?: {
|
|
208
|
+
retry?: RetryConfig;
|
|
209
|
+
}): Promise<AttestedResult<T>>;
|
|
204
210
|
/**
|
|
205
211
|
* @description Execute a batch of methods within a metered session.
|
|
206
212
|
* Each method is individually metered.
|
|
@@ -244,18 +250,31 @@ export declare class AgentGateway {
|
|
|
244
250
|
* This combines processX402Request + execute + settleX402Payment
|
|
245
251
|
* into a single call for convenience.
|
|
246
252
|
*
|
|
253
|
+
* Emits granular `x402:pipeline:*` events for each step so consumers
|
|
254
|
+
* can build step-by-step UI animations, logging, or monitoring without
|
|
255
|
+
* reconstructing the pipeline manually.
|
|
256
|
+
*
|
|
247
257
|
* @param {string | null} sessionId - Session to charge (or null for x402-only billing)
|
|
248
258
|
* @param {string} method - RPC method
|
|
249
259
|
* @param {unknown[]} [params=[]] - Method params
|
|
250
260
|
* @param {Record<string, string | undefined>} [incomingHeaders={}] - HTTP headers with PAYMENT-SIGNATURE
|
|
251
|
-
* @
|
|
261
|
+
* @param {{ onStep?: (step: X402PipelineStep) => void }} [opts] - Pipeline callbacks
|
|
262
|
+
* @returns {Promise<{ result: AttestedResult<T> | null; x402: PaywallResult; settlement: SettleResult | null; responseHeaders: Record<string, string>; pipeline: { steps: X402PipelineStep[]; totalDurationMs: number } }>}
|
|
252
263
|
* @since 1.0.0
|
|
253
264
|
*/
|
|
254
|
-
executeWithX402<T = unknown>(sessionId: string | null, method: string, params?: unknown[], incomingHeaders?: Record<string, string | undefined
|
|
265
|
+
executeWithX402<T = unknown>(sessionId: string | null, method: string, params?: unknown[], incomingHeaders?: Record<string, string | undefined>, opts?: {
|
|
266
|
+
/** Callback invoked after each pipeline step completes. */
|
|
267
|
+
onStep?: (step: X402PipelineStep) => void;
|
|
268
|
+
}): Promise<{
|
|
255
269
|
result: AttestedResult<T> | null;
|
|
256
270
|
x402: PaywallResult;
|
|
257
271
|
settlement: SettleResult | null;
|
|
258
272
|
responseHeaders: Record<string, string>;
|
|
273
|
+
/** Pipeline execution trace — always populated since v1.2.2. */
|
|
274
|
+
pipeline: {
|
|
275
|
+
steps: X402PipelineStep[];
|
|
276
|
+
totalDurationMs: number;
|
|
277
|
+
};
|
|
259
278
|
}>;
|
|
260
279
|
/**
|
|
261
280
|
* @description Execute an RPC call on a remote x402-enabled server.
|
|
@@ -346,6 +365,67 @@ export declare class AgentGateway {
|
|
|
346
365
|
clientPayments: number;
|
|
347
366
|
};
|
|
348
367
|
};
|
|
368
|
+
/**
|
|
369
|
+
* @description Return a JSON-safe snapshot of the entire gateway state.
|
|
370
|
+
*
|
|
371
|
+
* All `BigInt` values are converted to strings. The result can be passed
|
|
372
|
+
* directly to `JSON.stringify()` or `NextResponse.json()` without any
|
|
373
|
+
* manual serialization.
|
|
374
|
+
*
|
|
375
|
+
* @param {{ depth?: SnapshotDepth }} [opts] - Control how much data is included.
|
|
376
|
+
* - `'minimal'` — identity + metrics only (for lists)
|
|
377
|
+
* - `'standard'` — identity + metrics + sessions + tiers + marketplace (default)
|
|
378
|
+
* - `'full'` — everything including full session snapshots
|
|
379
|
+
* @returns {GatewaySnapshot} A plain object safe for JSON serialization.
|
|
380
|
+
* @since 1.2.2
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```ts
|
|
384
|
+
* const snap = gateway.snapshot();
|
|
385
|
+
* return NextResponse.json(snap); // no bigIntToString() needed
|
|
386
|
+
* ```
|
|
387
|
+
*/
|
|
388
|
+
snapshot(opts?: {
|
|
389
|
+
depth?: SnapshotDepth;
|
|
390
|
+
}): GatewaySnapshot;
|
|
391
|
+
/**
|
|
392
|
+
* Alias for `snapshot()` — enables `JSON.stringify(gateway)`.
|
|
393
|
+
* @since 1.2.2
|
|
394
|
+
*/
|
|
395
|
+
toJSON(): GatewaySnapshot;
|
|
396
|
+
/**
|
|
397
|
+
* @description Build a {@link PaymentIntent} with sensible defaults.
|
|
398
|
+
*
|
|
399
|
+
* Generates `nonce`, `createdAt`, and `token` automatically. Accepts
|
|
400
|
+
* `budget` as a string or number that is converted to `BigInt` internally.
|
|
401
|
+
*
|
|
402
|
+
* @param {object} opts - Intent parameters
|
|
403
|
+
* @param {AgentId | string | AgentGateway} opts.buyer - Buyer agent ID, DID string, or gateway instance
|
|
404
|
+
* @param {string} [opts.tier='standard'] - Pricing tier ID
|
|
405
|
+
* @param {string | number | bigint} opts.budget - Max budget (converted to BigInt)
|
|
406
|
+
* @param {number} [opts.ttl] - TTL in seconds (default: config.sessionTtl or 3600)
|
|
407
|
+
* @param {string} [opts.signature='sdk-generated'] - Payment signature
|
|
408
|
+
* @returns {PaymentIntent} A ready-to-use PaymentIntent
|
|
409
|
+
* @since 1.2.2
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```ts
|
|
413
|
+
* const intent = gateway.createPaymentIntent({
|
|
414
|
+
* buyer: buyerGateway,
|
|
415
|
+
* tier: 'standard',
|
|
416
|
+
* budget: '100000',
|
|
417
|
+
* });
|
|
418
|
+
* const session = gateway.openSession(intent);
|
|
419
|
+
* ```
|
|
420
|
+
*/
|
|
421
|
+
createPaymentIntent(opts: {
|
|
422
|
+
buyer: AgentId | string | AgentGateway;
|
|
423
|
+
tier?: string;
|
|
424
|
+
budget: string | number | bigint;
|
|
425
|
+
ttl?: number;
|
|
426
|
+
signature?: string;
|
|
427
|
+
token?: PricingTier['token'];
|
|
428
|
+
}): PaymentIntent;
|
|
349
429
|
private getSessionOrThrow;
|
|
350
430
|
/**
|
|
351
431
|
* Basic intent verification (signature is deferred to wallet integration).
|
|
@@ -370,11 +450,12 @@ export declare class AgentGateway {
|
|
|
370
450
|
* @since 1.0.0
|
|
371
451
|
*/
|
|
372
452
|
export declare function createAgentGateway(client: SynapseClientLike, config: GatewayConfig): AgentGateway;
|
|
373
|
-
export type { AgentId, AgentIdentity, AgentCredential, PaymentToken, PricingTier, PaymentIntent, PaymentReceipt, SessionState, SessionStatus, ResponseAttestation, AttestedResult, ToolListing, ToolBundle, GatewayEventType, GatewayEvent, GatewayEventHandler, GatewayConfig, } from './types';
|
|
453
|
+
export type { AgentId, AgentIdentity, AgentCredential, PaymentToken, PricingTier, PaymentIntent, PaymentReceipt, SessionState, SessionStatus, ResponseAttestation, AttestedResult, ToolListing, ToolBundle, GatewayEventType, GatewayEvent, GatewayEventHandler, GatewayConfig, RetryConfig, SnapshotDepth, GatewaySnapshot, X402PipelineStep, } from './types';
|
|
374
454
|
export { AgentId as createAgentId } from './types';
|
|
375
455
|
export { AgentSession, SessionError, BudgetExhaustedError, RateLimitExceededError, SessionExpiredError, CallLimitExceededError, } from './session';
|
|
376
456
|
export { PricingEngine, DEFAULT_TIERS, type DynamicPricingConfig } from './pricing';
|
|
377
457
|
export { ResponseValidator } from './validator';
|
|
378
458
|
export { ToolMarketplace, type MarketplaceQuery, type MarketplaceStats } from './marketplace';
|
|
459
|
+
export { AgentRegistry, MemoryAdapter, type PersistenceAdapter, type AgentRegistryConfig, } from './registry';
|
|
379
460
|
export * from './x402';
|
|
380
461
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/gateway/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,aAAa,EAEb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EAEd,UAAU,EACV,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,YAAY,EAAgB,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,aAAa,EAAiB,MAAM,WAAW,CAAC;AACzD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,CAAC;KAC9B,GAAG,aAAa;IA0BjB,OAAO,CAAC,iBAAiB;IAMzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAe1B;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,aAAa,GACpB,YAAY,CAEd;AAMD,YAAY,EACV,OAAO,EACP,aAAa,EACb,eAAe,EACf,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG9F,OAAO,EACL,aAAa,EACb,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAC;AAGpB,cAAc,QAAQ,CAAC"}
|
|
@@ -57,7 +57,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
57
57
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
58
58
|
};
|
|
59
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
exports.ToolMarketplace = exports.ResponseValidator = exports.DEFAULT_TIERS = exports.PricingEngine = exports.CallLimitExceededError = exports.SessionExpiredError = exports.RateLimitExceededError = exports.BudgetExhaustedError = exports.SessionError = exports.AgentSession = exports.createAgentId = exports.AgentGateway = exports.IntentVerificationError = exports.MaxSessionsError = exports.SessionNotFoundError = exports.GatewayError = void 0;
|
|
60
|
+
exports.MemoryAdapter = exports.AgentRegistry = exports.ToolMarketplace = exports.ResponseValidator = exports.DEFAULT_TIERS = exports.PricingEngine = exports.CallLimitExceededError = exports.SessionExpiredError = exports.RateLimitExceededError = exports.BudgetExhaustedError = exports.SessionError = exports.AgentSession = exports.createAgentId = exports.AgentGateway = exports.IntentVerificationError = exports.MaxSessionsError = exports.SessionNotFoundError = exports.GatewayError = void 0;
|
|
61
61
|
exports.createAgentGateway = createAgentGateway;
|
|
62
62
|
const crypto_1 = require("crypto");
|
|
63
63
|
const session_1 = require("./session");
|
|
@@ -343,52 +343,88 @@ class AgentGateway {
|
|
|
343
343
|
* 4. `session.postCall()` — deduct budget, increment counters
|
|
344
344
|
* 5. `pricing.reportLatency()`— feed latency into dynamic pricing
|
|
345
345
|
*
|
|
346
|
+
* If `config.retry` is set, transient errors are retried with exponential
|
|
347
|
+
* backoff. Pass per-call `opts.retry` to override.
|
|
348
|
+
*
|
|
346
349
|
* @param {string} sessionId - The session to charge
|
|
347
350
|
* @param {string} method - Solana JSON-RPC method name
|
|
348
351
|
* @param {unknown[]} [params=[]] - Method parameters
|
|
352
|
+
* @param {{ retry?: RetryConfig }} [opts] - Per-call overrides
|
|
349
353
|
* @returns {Promise<AttestedResult<T>>} The attested result
|
|
350
354
|
* @since 1.0.0
|
|
351
355
|
*/
|
|
352
|
-
async execute(sessionId, method, params = []) {
|
|
356
|
+
async execute(sessionId, method, params = [], opts = {}) {
|
|
353
357
|
const session = this.getSessionOrThrow(sessionId);
|
|
354
358
|
const snap = session.snapshot();
|
|
355
359
|
// ── Pre-flight
|
|
356
360
|
this.emit('call:before', { method, params }, sessionId);
|
|
357
361
|
const cost = session.preCall(method);
|
|
358
|
-
// ──
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
362
|
+
// ── Retry config (per-call > gateway-level > none)
|
|
363
|
+
const retryCfg = opts.retry ?? this.config.retry;
|
|
364
|
+
const maxAttempts = retryCfg?.maxAttempts ?? 1;
|
|
365
|
+
const backoffMs = retryCfg?.backoffMs ?? 500;
|
|
366
|
+
const backoffMul = retryCfg?.backoffMultiplier ?? 2;
|
|
367
|
+
const retryableErrors = retryCfg?.retryableErrors ?? [
|
|
368
|
+
'fetch failed', 'ECONNRESET', 'ETIMEDOUT', 'ENOTFOUND', 'socket hang up',
|
|
369
|
+
];
|
|
370
|
+
const fallback = retryCfg?.fallbackToDirectRpc ?? false;
|
|
371
|
+
let lastErr;
|
|
372
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
373
|
+
const start = performance.now();
|
|
374
|
+
try {
|
|
375
|
+
const result = await this.transport.request(method, params);
|
|
376
|
+
const latencyMs = Math.round(performance.now() - start);
|
|
377
|
+
// ── Attest
|
|
378
|
+
const shouldAttest = snap.tier.includesAttestation ||
|
|
379
|
+
(this.config.attestByDefault ?? false);
|
|
380
|
+
const slot = typeof result === 'object' && result !== null && 'context' in result
|
|
381
|
+
? result.context?.slot ?? 0
|
|
382
|
+
: 0;
|
|
383
|
+
const attested = await this.validator.wrapResult(result, sessionId, method, params, slot, latencyMs, snap.callsMade + 1, shouldAttest);
|
|
384
|
+
// ── Post-call
|
|
385
|
+
session.postCall(method, cost);
|
|
386
|
+
this.totalCallsServed++;
|
|
387
|
+
this.pricing.reportLatency(latencyMs);
|
|
388
|
+
this.emit('call:after', {
|
|
389
|
+
method, latencyMs, cost: cost.toString(), attested: shouldAttest, attempt,
|
|
390
|
+
}, sessionId);
|
|
391
|
+
if (shouldAttest && attested.attestation) {
|
|
392
|
+
this.emit('call:attested', { attestation: attested.attestation }, sessionId);
|
|
393
|
+
}
|
|
394
|
+
return attested;
|
|
395
|
+
}
|
|
396
|
+
catch (err) {
|
|
397
|
+
lastErr = err;
|
|
398
|
+
const errMsg = String(err);
|
|
399
|
+
const isRetryable = retryableErrors.some(s => errMsg.includes(s));
|
|
400
|
+
if (attempt < maxAttempts && isRetryable) {
|
|
401
|
+
const delay = backoffMs * (backoffMul ** (attempt - 1));
|
|
402
|
+
this.emit('call:retry', {
|
|
403
|
+
method, attempt, maxAttempts, error: errMsg, delayMs: delay,
|
|
404
|
+
}, sessionId);
|
|
405
|
+
await new Promise(r => setTimeout(r, delay));
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
// ── Fallback to raw RPC on last attempt
|
|
409
|
+
if (fallback && attempt === maxAttempts) {
|
|
410
|
+
try {
|
|
411
|
+
const fbStart = performance.now();
|
|
412
|
+
const fbResult = await this.transport.request(method, params);
|
|
413
|
+
const fbLatency = Math.round(performance.now() - fbStart);
|
|
414
|
+
const attested = await this.validator.wrapResult(fbResult, sessionId, method, params, 0, fbLatency, snap.callsMade + 1, false);
|
|
415
|
+
session.postCall(method, cost);
|
|
416
|
+
this.totalCallsServed++;
|
|
417
|
+
this.pricing.reportLatency(fbLatency);
|
|
418
|
+
return attested;
|
|
419
|
+
}
|
|
420
|
+
catch {
|
|
421
|
+
// fallback also failed — throw original error
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
390
425
|
}
|
|
391
|
-
|
|
426
|
+
this.emit('call:error', { method, error: String(lastErr) }, sessionId);
|
|
427
|
+
throw lastErr;
|
|
392
428
|
}
|
|
393
429
|
/**
|
|
394
430
|
* @description Execute a batch of methods within a metered session.
|
|
@@ -469,32 +505,62 @@ class AgentGateway {
|
|
|
469
505
|
* This combines processX402Request + execute + settleX402Payment
|
|
470
506
|
* into a single call for convenience.
|
|
471
507
|
*
|
|
508
|
+
* Emits granular `x402:pipeline:*` events for each step so consumers
|
|
509
|
+
* can build step-by-step UI animations, logging, or monitoring without
|
|
510
|
+
* reconstructing the pipeline manually.
|
|
511
|
+
*
|
|
472
512
|
* @param {string | null} sessionId - Session to charge (or null for x402-only billing)
|
|
473
513
|
* @param {string} method - RPC method
|
|
474
514
|
* @param {unknown[]} [params=[]] - Method params
|
|
475
515
|
* @param {Record<string, string | undefined>} [incomingHeaders={}] - HTTP headers with PAYMENT-SIGNATURE
|
|
476
|
-
* @
|
|
516
|
+
* @param {{ onStep?: (step: X402PipelineStep) => void }} [opts] - Pipeline callbacks
|
|
517
|
+
* @returns {Promise<{ result: AttestedResult<T> | null; x402: PaywallResult; settlement: SettleResult | null; responseHeaders: Record<string, string>; pipeline: { steps: X402PipelineStep[]; totalDurationMs: number } }>}
|
|
477
518
|
* @since 1.0.0
|
|
478
519
|
*/
|
|
479
|
-
async executeWithX402(sessionId, method, params = [], incomingHeaders = {}) {
|
|
520
|
+
async executeWithX402(sessionId, method, params = [], incomingHeaders = {}, opts = {}) {
|
|
521
|
+
const pipelineStart = performance.now();
|
|
522
|
+
const steps = [];
|
|
523
|
+
let stepId = 0;
|
|
524
|
+
const pushStep = (step) => {
|
|
525
|
+
const s = { ...step, id: ++stepId, totalSteps: 0 };
|
|
526
|
+
steps.push(s);
|
|
527
|
+
this.emit(`x402:pipeline:${step.actor === 'facilitator' ? 'verify' : step.action.toLowerCase().includes('paywall') ? 'paywall' : step.action.toLowerCase().includes('settle') ? 'settle' : 'execute'}`, s, sessionId ?? '');
|
|
528
|
+
opts.onStep?.(s);
|
|
529
|
+
};
|
|
480
530
|
// ── Step 1: x402 paywall check
|
|
531
|
+
let t = performance.now();
|
|
481
532
|
const x402Result = await this.processX402Request(method, incomingHeaders);
|
|
533
|
+
pushStep({
|
|
534
|
+
actor: 'seller',
|
|
535
|
+
action: `Paywall → ${x402Result.type}`,
|
|
536
|
+
detail: x402Result.type === 'payment-required'
|
|
537
|
+
? 'Payment required — returning 402'
|
|
538
|
+
: x402Result.type === 'payment-valid'
|
|
539
|
+
? 'Payment verified — proceeding'
|
|
540
|
+
: 'No payment needed',
|
|
541
|
+
data: { type: x402Result.type, method },
|
|
542
|
+
durationMs: Math.round(performance.now() - t),
|
|
543
|
+
status: 'real',
|
|
544
|
+
});
|
|
482
545
|
if (x402Result.type === 'payment-required') {
|
|
546
|
+
// Finalize totalSteps
|
|
547
|
+
for (const s of steps)
|
|
548
|
+
s.totalSteps = stepId;
|
|
483
549
|
return {
|
|
484
550
|
result: null,
|
|
485
551
|
x402: x402Result,
|
|
486
552
|
settlement: null,
|
|
487
553
|
responseHeaders: x402Result.headers,
|
|
554
|
+
pipeline: { steps, totalDurationMs: Math.round(performance.now() - pipelineStart) },
|
|
488
555
|
};
|
|
489
556
|
}
|
|
490
557
|
// ── Step 2: Execute the RPC call
|
|
558
|
+
t = performance.now();
|
|
491
559
|
let attested;
|
|
492
560
|
if (sessionId) {
|
|
493
|
-
// Metered execution within a session
|
|
494
561
|
attested = await this.execute(sessionId, method, params);
|
|
495
562
|
}
|
|
496
563
|
else {
|
|
497
|
-
// Direct execution (x402-only billing, no session metering)
|
|
498
564
|
const start = performance.now();
|
|
499
565
|
const result = await this.transport.request(method, params);
|
|
500
566
|
const latencyMs = Math.round(performance.now() - start);
|
|
@@ -502,16 +568,43 @@ class AgentGateway {
|
|
|
502
568
|
this.totalCallsServed++;
|
|
503
569
|
this.pricing.reportLatency(latencyMs);
|
|
504
570
|
}
|
|
571
|
+
pushStep({
|
|
572
|
+
actor: 'seller',
|
|
573
|
+
action: `Execute ${method}`,
|
|
574
|
+
detail: `RPC call completed in ${attested.latencyMs}ms`,
|
|
575
|
+
data: { method, latencyMs: attested.latencyMs, hasAttestation: !!attested.attestation },
|
|
576
|
+
durationMs: Math.round(performance.now() - t),
|
|
577
|
+
status: 'real',
|
|
578
|
+
});
|
|
505
579
|
// ── Step 3: Settle (if x402 payment was provided)
|
|
506
580
|
let settlement = null;
|
|
507
581
|
const responseHeaders = {};
|
|
508
582
|
if (x402Result.type === 'payment-valid') {
|
|
583
|
+
t = performance.now();
|
|
509
584
|
settlement = await this.settleX402Payment(x402Result.paymentPayload, x402Result.requirements);
|
|
510
585
|
if (settlement.responseHeader) {
|
|
511
586
|
responseHeaders['PAYMENT-RESPONSE'] = settlement.responseHeader;
|
|
512
587
|
}
|
|
588
|
+
pushStep({
|
|
589
|
+
actor: 'facilitator',
|
|
590
|
+
action: 'Settle payment',
|
|
591
|
+
detail: settlement.success ? 'Payment settled on-chain' : 'Settlement failed',
|
|
592
|
+
data: {
|
|
593
|
+
success: settlement.success,
|
|
594
|
+
transaction: settlement.settleResponse?.transaction,
|
|
595
|
+
},
|
|
596
|
+
durationMs: Math.round(performance.now() - t),
|
|
597
|
+
status: 'real',
|
|
598
|
+
});
|
|
513
599
|
}
|
|
514
|
-
|
|
600
|
+
// Finalize totalSteps
|
|
601
|
+
for (const s of steps)
|
|
602
|
+
s.totalSteps = stepId;
|
|
603
|
+
const totalDurationMs = Math.round(performance.now() - pipelineStart);
|
|
604
|
+
this.emit('x402:pipeline:complete', {
|
|
605
|
+
steps, totalDurationMs, method, sessionId,
|
|
606
|
+
}, sessionId ?? '');
|
|
607
|
+
return { result: attested, x402: x402Result, settlement, responseHeaders, pipeline: { steps, totalDurationMs } };
|
|
515
608
|
}
|
|
516
609
|
/* ═══════════════════════════════════════════════════════════
|
|
517
610
|
* x402 Protocol — Buyer Side (Client)
|
|
@@ -727,6 +820,147 @@ class AgentGateway {
|
|
|
727
820
|
},
|
|
728
821
|
};
|
|
729
822
|
}
|
|
823
|
+
/* ═══════════════════════════════════════════════════════════
|
|
824
|
+
* Snapshot — JSON-safe serialization
|
|
825
|
+
* ═══════════════════════════════════════════════════════════ */
|
|
826
|
+
/**
|
|
827
|
+
* @description Return a JSON-safe snapshot of the entire gateway state.
|
|
828
|
+
*
|
|
829
|
+
* All `BigInt` values are converted to strings. The result can be passed
|
|
830
|
+
* directly to `JSON.stringify()` or `NextResponse.json()` without any
|
|
831
|
+
* manual serialization.
|
|
832
|
+
*
|
|
833
|
+
* @param {{ depth?: SnapshotDepth }} [opts] - Control how much data is included.
|
|
834
|
+
* - `'minimal'` — identity + metrics only (for lists)
|
|
835
|
+
* - `'standard'` — identity + metrics + sessions + tiers + marketplace (default)
|
|
836
|
+
* - `'full'` — everything including full session snapshots
|
|
837
|
+
* @returns {GatewaySnapshot} A plain object safe for JSON serialization.
|
|
838
|
+
* @since 1.2.2
|
|
839
|
+
*
|
|
840
|
+
* @example
|
|
841
|
+
* ```ts
|
|
842
|
+
* const snap = gateway.snapshot();
|
|
843
|
+
* return NextResponse.json(snap); // no bigIntToString() needed
|
|
844
|
+
* ```
|
|
845
|
+
*/
|
|
846
|
+
snapshot(opts = {}) {
|
|
847
|
+
const depth = opts.depth ?? 'standard';
|
|
848
|
+
const identity = this.config.identity;
|
|
849
|
+
const result = {
|
|
850
|
+
agentId: this.agentId,
|
|
851
|
+
identity: {
|
|
852
|
+
name: identity.name,
|
|
853
|
+
walletPubkey: identity.walletPubkey,
|
|
854
|
+
description: identity.description,
|
|
855
|
+
tags: identity.tags,
|
|
856
|
+
createdAt: identity.createdAt,
|
|
857
|
+
},
|
|
858
|
+
metrics: {
|
|
859
|
+
totalCallsServed: this.totalCallsServed,
|
|
860
|
+
totalRevenue: this.totalRevenue.toString(),
|
|
861
|
+
activeSessions: [...this.sessions.values()].filter(s => s.status === 'active').length,
|
|
862
|
+
totalSessions: this.sessions.size,
|
|
863
|
+
avgLatencyMs: this.pricing.getAvgLatency(),
|
|
864
|
+
totalAttestations: this.validator.totalAttestations,
|
|
865
|
+
},
|
|
866
|
+
sessions: [],
|
|
867
|
+
tiers: [],
|
|
868
|
+
marketplace: { totalListings: 0, totalBundles: 0 },
|
|
869
|
+
x402: {
|
|
870
|
+
paywallEnabled: this.paywall !== null,
|
|
871
|
+
clientEnabled: this.x402Client !== null,
|
|
872
|
+
clientPayments: this.x402Client?.payments ?? 0,
|
|
873
|
+
},
|
|
874
|
+
};
|
|
875
|
+
if (depth === 'minimal')
|
|
876
|
+
return result;
|
|
877
|
+
// Sessions
|
|
878
|
+
for (const session of this.sessions.values()) {
|
|
879
|
+
const snap = session.snapshot();
|
|
880
|
+
const entry = {
|
|
881
|
+
id: snap.id,
|
|
882
|
+
status: snap.status,
|
|
883
|
+
buyer: snap.buyer,
|
|
884
|
+
};
|
|
885
|
+
if (depth === 'full') {
|
|
886
|
+
entry.budgetRemaining = snap.budgetRemaining.toString();
|
|
887
|
+
entry.callsMade = snap.callsMade;
|
|
888
|
+
entry.createdAt = snap.createdAt;
|
|
889
|
+
}
|
|
890
|
+
result.sessions.push(entry);
|
|
891
|
+
}
|
|
892
|
+
// Tiers
|
|
893
|
+
for (const tier of this.config.defaultTiers) {
|
|
894
|
+
result.tiers.push({
|
|
895
|
+
id: tier.id,
|
|
896
|
+
label: tier.label,
|
|
897
|
+
pricePerCall: tier.pricePerCall.toString(),
|
|
898
|
+
maxCallsPerSession: tier.maxCallsPerSession,
|
|
899
|
+
rateLimit: tier.rateLimit,
|
|
900
|
+
includesAttestation: tier.includesAttestation,
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
// Marketplace
|
|
904
|
+
const mpStats = this.marketplace.getStats();
|
|
905
|
+
result.marketplace = {
|
|
906
|
+
totalListings: mpStats.totalListings,
|
|
907
|
+
totalBundles: mpStats.totalBundles,
|
|
908
|
+
};
|
|
909
|
+
return result;
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Alias for `snapshot()` — enables `JSON.stringify(gateway)`.
|
|
913
|
+
* @since 1.2.2
|
|
914
|
+
*/
|
|
915
|
+
toJSON() {
|
|
916
|
+
return this.snapshot({ depth: 'standard' });
|
|
917
|
+
}
|
|
918
|
+
/* ═══════════════════════════════════════════════════════════
|
|
919
|
+
* PaymentIntent builder
|
|
920
|
+
* ═══════════════════════════════════════════════════════════ */
|
|
921
|
+
/**
|
|
922
|
+
* @description Build a {@link PaymentIntent} with sensible defaults.
|
|
923
|
+
*
|
|
924
|
+
* Generates `nonce`, `createdAt`, and `token` automatically. Accepts
|
|
925
|
+
* `budget` as a string or number that is converted to `BigInt` internally.
|
|
926
|
+
*
|
|
927
|
+
* @param {object} opts - Intent parameters
|
|
928
|
+
* @param {AgentId | string | AgentGateway} opts.buyer - Buyer agent ID, DID string, or gateway instance
|
|
929
|
+
* @param {string} [opts.tier='standard'] - Pricing tier ID
|
|
930
|
+
* @param {string | number | bigint} opts.budget - Max budget (converted to BigInt)
|
|
931
|
+
* @param {number} [opts.ttl] - TTL in seconds (default: config.sessionTtl or 3600)
|
|
932
|
+
* @param {string} [opts.signature='sdk-generated'] - Payment signature
|
|
933
|
+
* @returns {PaymentIntent} A ready-to-use PaymentIntent
|
|
934
|
+
* @since 1.2.2
|
|
935
|
+
*
|
|
936
|
+
* @example
|
|
937
|
+
* ```ts
|
|
938
|
+
* const intent = gateway.createPaymentIntent({
|
|
939
|
+
* buyer: buyerGateway,
|
|
940
|
+
* tier: 'standard',
|
|
941
|
+
* budget: '100000',
|
|
942
|
+
* });
|
|
943
|
+
* const session = gateway.openSession(intent);
|
|
944
|
+
* ```
|
|
945
|
+
*/
|
|
946
|
+
createPaymentIntent(opts) {
|
|
947
|
+
const buyerId = opts.buyer instanceof AgentGateway
|
|
948
|
+
? opts.buyer.agentId
|
|
949
|
+
: opts.buyer;
|
|
950
|
+
const tierId = opts.tier ?? 'standard';
|
|
951
|
+
const tier = this.pricing.getTier(tierId);
|
|
952
|
+
return {
|
|
953
|
+
nonce: (0, crypto_1.randomUUID)(),
|
|
954
|
+
buyer: buyerId,
|
|
955
|
+
seller: this.agentId,
|
|
956
|
+
tierId,
|
|
957
|
+
maxBudget: BigInt(opts.budget),
|
|
958
|
+
token: opts.token ?? tier?.token ?? { type: 'USDC' },
|
|
959
|
+
signature: opts.signature ?? 'sdk-generated',
|
|
960
|
+
createdAt: Date.now(),
|
|
961
|
+
ttl: opts.ttl ?? this.config.sessionTtl ?? 3600,
|
|
962
|
+
};
|
|
963
|
+
}
|
|
730
964
|
/* ═══════════════════════════════════════════════════════════
|
|
731
965
|
* Internals
|
|
732
966
|
* ═══════════════════════════════════════════════════════════ */
|
|
@@ -795,6 +1029,10 @@ var validator_2 = require("./validator");
|
|
|
795
1029
|
Object.defineProperty(exports, "ResponseValidator", { enumerable: true, get: function () { return validator_2.ResponseValidator; } });
|
|
796
1030
|
var marketplace_2 = require("./marketplace");
|
|
797
1031
|
Object.defineProperty(exports, "ToolMarketplace", { enumerable: true, get: function () { return marketplace_2.ToolMarketplace; } });
|
|
1032
|
+
/* ── Agent Registry ────────────────────────────────────────── */
|
|
1033
|
+
var registry_1 = require("./registry");
|
|
1034
|
+
Object.defineProperty(exports, "AgentRegistry", { enumerable: true, get: function () { return registry_1.AgentRegistry; } });
|
|
1035
|
+
Object.defineProperty(exports, "MemoryAdapter", { enumerable: true, get: function () { return registry_1.MemoryAdapter; } });
|
|
798
1036
|
/* ── x402 Protocol ─────────────────────────────────────────── */
|
|
799
1037
|
__exportStar(require("./x402"), exports);
|
|
800
1038
|
//# sourceMappingURL=index.js.map
|