@oobe-protocol-labs/synapse-client-sdk 2.0.2 → 2.0.5
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 +54 -0
- package/README.md +2 -2
- package/dist/cjs/ai/index.d.ts +1 -1
- package/dist/cjs/ai/index.d.ts.map +1 -1
- package/dist/cjs/ai/index.js +12 -28
- package/dist/cjs/ai/index.js.map +1 -1
- package/dist/cjs/ai/sap/client.d.ts +197 -0
- package/dist/cjs/ai/sap/client.d.ts.map +1 -0
- package/dist/cjs/ai/sap/client.js +334 -0
- package/dist/cjs/ai/sap/client.js.map +1 -0
- package/dist/cjs/ai/sap/index.d.ts +69 -52
- package/dist/cjs/ai/sap/index.d.ts.map +1 -1
- package/dist/cjs/ai/sap/index.js +73 -77
- package/dist/cjs/ai/sap/index.js.map +1 -1
- package/dist/cjs/ai/sap/provider.d.ts +180 -0
- package/dist/cjs/ai/sap/provider.d.ts.map +1 -0
- package/dist/cjs/ai/sap/provider.js +219 -0
- package/dist/cjs/ai/sap/provider.js.map +1 -0
- package/dist/cjs/ai/sap/types.d.ts +120 -384
- package/dist/cjs/ai/sap/types.d.ts.map +1 -1
- package/dist/cjs/ai/sap/types.js +20 -200
- package/dist/cjs/ai/sap/types.js.map +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 +15 -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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/index.html +2 -2
- 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 +2 -2
- 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 +54 -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/index.d.ts +1 -1
- package/dist/esm/ai/index.d.ts.map +1 -1
- package/dist/esm/ai/index.js +9 -11
- package/dist/esm/ai/index.js.map +1 -1
- package/dist/esm/ai/sap/client.d.ts +197 -0
- package/dist/esm/ai/sap/client.d.ts.map +1 -0
- package/dist/esm/ai/sap/client.js +330 -0
- package/dist/esm/ai/sap/client.js.map +1 -0
- package/dist/esm/ai/sap/index.d.ts +69 -52
- package/dist/esm/ai/sap/index.d.ts.map +1 -1
- package/dist/esm/ai/sap/index.js +68 -49
- package/dist/esm/ai/sap/index.js.map +1 -1
- package/dist/esm/ai/sap/provider.d.ts +180 -0
- package/dist/esm/ai/sap/provider.d.ts.map +1 -0
- package/dist/esm/ai/sap/provider.js +215 -0
- package/dist/esm/ai/sap/provider.js.map +1 -0
- package/dist/esm/ai/sap/types.d.ts +120 -384
- package/dist/esm/ai/sap/types.d.ts.map +1 -1
- package/dist/esm/ai/sap/types.js +18 -195
- package/dist/esm/ai/sap/types.js.map +1 -1
- package/package.json +31 -20
- package/dist/cjs/ai/sap/adapter.d.ts +0 -140
- package/dist/cjs/ai/sap/adapter.d.ts.map +0 -1
- package/dist/cjs/ai/sap/adapter.js +0 -181
- package/dist/cjs/ai/sap/adapter.js.map +0 -1
- package/dist/cjs/ai/sap/discovery.d.ts +0 -165
- package/dist/cjs/ai/sap/discovery.d.ts.map +0 -1
- package/dist/cjs/ai/sap/discovery.js +0 -316
- package/dist/cjs/ai/sap/discovery.js.map +0 -1
- package/dist/cjs/ai/sap/pda.d.ts +0 -205
- package/dist/cjs/ai/sap/pda.d.ts.map +0 -1
- package/dist/cjs/ai/sap/pda.js +0 -547
- package/dist/cjs/ai/sap/pda.js.map +0 -1
- package/dist/cjs/ai/sap/program.d.ts +0 -153
- package/dist/cjs/ai/sap/program.d.ts.map +0 -1
- package/dist/cjs/ai/sap/program.js +0 -227
- package/dist/cjs/ai/sap/program.js.map +0 -1
- package/dist/cjs/ai/sap/registry.d.ts +0 -218
- package/dist/cjs/ai/sap/registry.d.ts.map +0 -1
- package/dist/cjs/ai/sap/registry.js +0 -519
- package/dist/cjs/ai/sap/registry.js.map +0 -1
- package/dist/cjs/ai/sap/scoring.d.ts +0 -138
- package/dist/cjs/ai/sap/scoring.d.ts.map +0 -1
- package/dist/cjs/ai/sap/scoring.js +0 -266
- package/dist/cjs/ai/sap/scoring.js.map +0 -1
- package/dist/cjs/ai/sap/subnetwork.d.ts +0 -201
- package/dist/cjs/ai/sap/subnetwork.d.ts.map +0 -1
- package/dist/cjs/ai/sap/subnetwork.js +0 -365
- package/dist/cjs/ai/sap/subnetwork.js.map +0 -1
- package/dist/cjs/ai/sap/validator.d.ts +0 -160
- package/dist/cjs/ai/sap/validator.d.ts.map +0 -1
- package/dist/cjs/ai/sap/validator.js +0 -619
- package/dist/cjs/ai/sap/validator.js.map +0 -1
- package/dist/esm/ai/sap/adapter.d.ts +0 -140
- package/dist/esm/ai/sap/adapter.d.ts.map +0 -1
- package/dist/esm/ai/sap/adapter.js +0 -177
- package/dist/esm/ai/sap/adapter.js.map +0 -1
- package/dist/esm/ai/sap/discovery.d.ts +0 -165
- package/dist/esm/ai/sap/discovery.d.ts.map +0 -1
- package/dist/esm/ai/sap/discovery.js +0 -311
- package/dist/esm/ai/sap/discovery.js.map +0 -1
- package/dist/esm/ai/sap/pda.d.ts +0 -205
- package/dist/esm/ai/sap/pda.d.ts.map +0 -1
- package/dist/esm/ai/sap/pda.js +0 -535
- package/dist/esm/ai/sap/pda.js.map +0 -1
- package/dist/esm/ai/sap/program.d.ts +0 -153
- package/dist/esm/ai/sap/program.d.ts.map +0 -1
- package/dist/esm/ai/sap/program.js +0 -222
- package/dist/esm/ai/sap/program.js.map +0 -1
- package/dist/esm/ai/sap/registry.d.ts +0 -218
- package/dist/esm/ai/sap/registry.d.ts.map +0 -1
- package/dist/esm/ai/sap/registry.js +0 -515
- package/dist/esm/ai/sap/registry.js.map +0 -1
- package/dist/esm/ai/sap/scoring.d.ts +0 -138
- package/dist/esm/ai/sap/scoring.d.ts.map +0 -1
- package/dist/esm/ai/sap/scoring.js +0 -262
- package/dist/esm/ai/sap/scoring.js.map +0 -1
- package/dist/esm/ai/sap/subnetwork.d.ts +0 -201
- package/dist/esm/ai/sap/subnetwork.d.ts.map +0 -1
- package/dist/esm/ai/sap/subnetwork.js +0 -361
- package/dist/esm/ai/sap/subnetwork.js.map +0 -1
- package/dist/esm/ai/sap/validator.d.ts +0 -160
- package/dist/esm/ai/sap/validator.d.ts.map +0 -1
- package/dist/esm/ai/sap/validator.js +0 -614
- package/dist/esm/ai/sap/validator.js.map +0 -1
|
@@ -1,418 +1,154 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module ai/sap/types
|
|
3
|
-
* @description
|
|
3
|
+
* @description Integration types for the SAP bridge layer.
|
|
4
4
|
*
|
|
5
|
-
* Defines the
|
|
6
|
-
*
|
|
5
|
+
* Defines the configuration, wallet interface, and context shapes
|
|
6
|
+
* used by {@link SynapseAnchorSap} to connect the Synapse Client SDK
|
|
7
|
+
* with the standalone SAP SDK (`@oobe-protocol-labs/synapse-sap-sdk`).
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* ```
|
|
10
|
-
* [0..8] u8[8] Anchor discriminator
|
|
11
|
-
* [8] u8 version (1)
|
|
12
|
-
* [9] u8 is_active (0 | 1)
|
|
13
|
-
* [10..42] u8[32] wallet pubkey (raw bytes)
|
|
14
|
-
* [42..50] i64 created_at (unix ms)
|
|
15
|
-
* [50..58] i64 updated_at (unix ms)
|
|
16
|
-
* [58..66] u64 total_calls_served
|
|
17
|
-
* [66..70] u32 avg_latency_ms
|
|
18
|
-
* [70] u8 uptime_percent (0-100)
|
|
19
|
-
* [71..] Borsh name (string), description (string),
|
|
20
|
-
* capabilities (Vec<string>),
|
|
21
|
-
* pricing tiers (Vec<AgentPricingOnChain>),
|
|
22
|
-
* x402_endpoint (Option<string>)
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @since 1.3.0
|
|
26
|
-
*/
|
|
27
|
-
import type { AgentIdentity, PricingTier } from '../gateway/types';
|
|
28
|
-
/**
|
|
29
|
-
* @description Default SAP program ID. Replace with your own deployed program.
|
|
30
|
-
* This is a placeholder — deploy the SAP Anchor program and set your ID.
|
|
31
|
-
* @since 1.3.0
|
|
9
|
+
* @since 2.1.0
|
|
32
10
|
*/
|
|
33
|
-
|
|
11
|
+
import type { SynapseNetwork, SynapseRegion } from '../../utils/synapse';
|
|
34
12
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
export declare const SAP_SEED_PREFIX = "synapse_agent";
|
|
40
|
-
/**
|
|
41
|
-
* @description Anchor discriminator for the AgentAccount type.
|
|
42
|
-
* Computed as: `sha256("account:AgentAccount")[0..8]`
|
|
43
|
-
* @since 1.3.0
|
|
44
|
-
*/
|
|
45
|
-
export declare const SAP_ACCOUNT_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
46
|
-
/**
|
|
47
|
-
* @description Instruction discriminators for SAP program methods.
|
|
48
|
-
* Computed as: `sha256("global:<method_name>")[0..8]`
|
|
49
|
-
* @since 1.3.0
|
|
13
|
+
* Canonical SAP program ID (mainnet deployment).
|
|
14
|
+
*
|
|
15
|
+
* This is the default used when no `programId` is specified.
|
|
16
|
+
* It matches `SAP_PROGRAM_ID` from `@oobe-protocol-labs/synapse-sap-sdk`.
|
|
50
17
|
*/
|
|
51
|
-
export declare const
|
|
52
|
-
readonly register: Uint8Array<ArrayBuffer>;
|
|
53
|
-
readonly update: Uint8Array<ArrayBuffer>;
|
|
54
|
-
readonly deactivate: Uint8Array<ArrayBuffer>;
|
|
55
|
-
readonly updateReputation: Uint8Array<ArrayBuffer>;
|
|
56
|
-
};
|
|
18
|
+
export declare const SAP_PROGRAM_ID = "SAPTU7aUXk2AaAdktexae1iuxXpokxzNDBAYYhaVyQL";
|
|
57
19
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
20
|
+
* Minimal wallet interface compatible with:
|
|
21
|
+
*
|
|
22
|
+
* - `@coral-xyz/anchor` `Wallet`
|
|
23
|
+
* - `@solana/wallet-adapter-react` `useWallet()` (when `connected`)
|
|
24
|
+
* - Any `Keypair`-based signer adapted to this shape
|
|
25
|
+
*
|
|
26
|
+
* @example Keypair adapter
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { Keypair } from '@solana/web3.js';
|
|
29
|
+
*
|
|
30
|
+
* const kp = Keypair.generate();
|
|
31
|
+
* const wallet: SapWallet = {
|
|
32
|
+
* publicKey: kp.publicKey,
|
|
33
|
+
* signTransaction: (tx) => { tx.partialSign(kp); return Promise.resolve(tx); },
|
|
34
|
+
* signAllTransactions: (txs) => { txs.forEach(t => t.partialSign(kp)); return Promise.resolve(txs); },
|
|
35
|
+
* };
|
|
36
|
+
* ```
|
|
60
37
|
*/
|
|
61
|
-
export interface
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
export interface SapWallet {
|
|
39
|
+
/** Wallet public key — must have `.toBase58()`. */
|
|
40
|
+
readonly publicKey: {
|
|
41
|
+
toBase58(): string;
|
|
42
|
+
toBytes(): Uint8Array;
|
|
43
|
+
};
|
|
44
|
+
/** Sign a single transaction. */
|
|
45
|
+
signTransaction<T>(tx: T): Promise<T>;
|
|
46
|
+
/** Sign multiple transactions. */
|
|
47
|
+
signAllTransactions<T>(txs: T[]): Promise<T[]>;
|
|
68
48
|
}
|
|
69
49
|
/**
|
|
70
|
-
*
|
|
71
|
-
* @since 1.3.0
|
|
50
|
+
* Commitment level for Anchor / Solana transactions.
|
|
72
51
|
*/
|
|
73
|
-
export
|
|
74
|
-
/** Capability identifier (e.g. `"jupiter:swap"`, `"raydium:pool_create"`). */
|
|
75
|
-
id: string;
|
|
76
|
-
/** Human-readable description. */
|
|
77
|
-
description?: string;
|
|
78
|
-
/** Protocol this capability belongs to. */
|
|
79
|
-
protocol?: string;
|
|
80
|
-
}
|
|
52
|
+
export type SapCommitment = 'processed' | 'confirmed' | 'finalized';
|
|
81
53
|
/**
|
|
82
|
-
*
|
|
54
|
+
* Configuration for {@link SynapseAnchorSap}.
|
|
83
55
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* - **Volume curves**: price drops automatically at higher usage tiers
|
|
87
|
-
* - **Escrow-ready**: compatible with prepaid escrow PDA balances
|
|
88
|
-
* - **Multi-token**: SOL, USDC, or any SPL token
|
|
89
|
-
* - **Metered settlement**: calls are counted on-chain, settled in batches
|
|
56
|
+
* At minimum, provide a `wallet`. The bridge resolves the RPC endpoint
|
|
57
|
+
* from Synapse's network registry unless `rpcEndpoint` is set.
|
|
90
58
|
*
|
|
91
|
-
*
|
|
59
|
+
* @example Minimal
|
|
60
|
+
* ```ts
|
|
61
|
+
* { wallet }
|
|
62
|
+
* ```
|
|
92
63
|
*
|
|
93
|
-
* @
|
|
64
|
+
* @example Full
|
|
65
|
+
* ```ts
|
|
66
|
+
* {
|
|
67
|
+
* wallet,
|
|
68
|
+
* network: SynapseNetwork.Mainnet,
|
|
69
|
+
* region: SynapseRegion.US,
|
|
70
|
+
* programId: 'SAPTU7aUXk2AaAdktexae1iuxXpokxzNDBAYYhaVyQL',
|
|
71
|
+
* commitment: 'confirmed',
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
94
74
|
*/
|
|
95
|
-
export interface
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
/** Base price per call in smallest token unit (lamports / USDC base units). */
|
|
99
|
-
pricePerCall: bigint;
|
|
100
|
-
/** Minimum price floor (for dynamic pricing — price never goes below this). */
|
|
101
|
-
minPricePerCall?: bigint;
|
|
102
|
-
/** Maximum price ceiling (for dynamic pricing — price never exceeds this). */
|
|
103
|
-
maxPricePerCall?: bigint;
|
|
75
|
+
export interface SapBridgeConfig {
|
|
76
|
+
/** Wallet with signing capability (required). */
|
|
77
|
+
wallet: SapWallet;
|
|
104
78
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* → first 100 calls at `pricePerCall`, next 900 at 800, everything after 1000 at 500.
|
|
108
|
-
* Empty array = flat pricing (no volume discount).
|
|
79
|
+
* Synapse network to connect to.
|
|
80
|
+
* @default SynapseNetwork.Mainnet
|
|
109
81
|
*/
|
|
110
|
-
|
|
111
|
-
/** Rate limit (calls per second). */
|
|
112
|
-
rateLimit: number;
|
|
113
|
-
/** Max calls per session (0 = unlimited). */
|
|
114
|
-
maxCallsPerSession: number;
|
|
115
|
-
/** Burst capacity — max calls allowed in a single second burst (≥ rateLimit). */
|
|
116
|
-
burstLimit?: number;
|
|
117
|
-
/** Payment token type. */
|
|
118
|
-
tokenType: 'SOL' | 'USDC' | 'SPL';
|
|
119
|
-
/** SPL token mint address (only when tokenType = 'SPL'). */
|
|
120
|
-
tokenMint?: string;
|
|
121
|
-
/** Token decimals (used for display — e.g. 9 for SOL, 6 for USDC). */
|
|
122
|
-
tokenDecimals?: number;
|
|
82
|
+
network?: SynapseNetwork;
|
|
123
83
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* - `'escrow'` — caller pre-funds an escrow PDA, agent draws per call
|
|
127
|
-
* - `'batched'` — calls accumulate off-chain, settled on-chain periodically
|
|
128
|
-
* - `'x402'` — payment via HTTP x402 protocol (off-chain → on-chain attestation)
|
|
129
|
-
* @default 'x402'
|
|
84
|
+
* Geographic region for endpoint selection.
|
|
85
|
+
* @default SynapseRegion.US
|
|
130
86
|
*/
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
87
|
+
region?: SynapseRegion;
|
|
88
|
+
/**
|
|
89
|
+
* Override RPC endpoint URL.
|
|
90
|
+
* When set, bypasses Synapse endpoint resolution entirely.
|
|
91
|
+
*/
|
|
92
|
+
rpcEndpoint?: string;
|
|
93
|
+
/**
|
|
94
|
+
* SAP program ID.
|
|
95
|
+
* @default SAP_PROGRAM_ID ('SAPTU7aUXk2AaAdktexae1iuxXpokxzNDBAYYhaVyQL')
|
|
96
|
+
*/
|
|
97
|
+
programId?: string;
|
|
98
|
+
/** Transaction commitment level. @default 'confirmed' */
|
|
99
|
+
commitment?: SapCommitment;
|
|
100
|
+
/** Skip preflight simulation for transactions. @default false */
|
|
101
|
+
skipPreflight?: boolean;
|
|
102
|
+
/** Enable debug logging. @default false */
|
|
103
|
+
debug?: boolean;
|
|
136
104
|
}
|
|
137
105
|
/**
|
|
138
|
-
*
|
|
139
|
-
* Implements ERC-8004-style metered billing for Solana agents.
|
|
106
|
+
* Shape of the React context value for SAP integration.
|
|
140
107
|
*
|
|
141
|
-
*
|
|
142
|
-
* 1. Calls 0 → breakpoint[0].afterCalls: charged at base `pricePerCall`
|
|
143
|
-
* 2. Calls breakpoint[0].afterCalls → breakpoint[1].afterCalls: charged at breakpoint[0].pricePerCall
|
|
144
|
-
* 3. And so on...
|
|
108
|
+
* Use this interface to type your own React context:
|
|
145
109
|
*
|
|
146
|
-
*
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
/** Average response latency in milliseconds. */
|
|
163
|
-
avgLatencyMs: number;
|
|
164
|
-
/** Uptime percentage (0–100). */
|
|
165
|
-
uptimePercent: number;
|
|
166
|
-
/** Reputation score (0–1000), computed off-chain and posted on-chain. */
|
|
167
|
-
score: number;
|
|
168
|
-
/** Unix timestamp of last reputation update. */
|
|
169
|
-
lastUpdatedAt: number;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* @description Full deserialized agent PDA account data.
|
|
173
|
-
* @since 1.3.0
|
|
174
|
-
*/
|
|
175
|
-
export interface AgentPDAAccount {
|
|
176
|
-
/** PDA address (base58). */
|
|
177
|
-
address: string;
|
|
178
|
-
/** Schema version. */
|
|
179
|
-
version: number;
|
|
180
|
-
/** Whether this agent is currently active. */
|
|
181
|
-
isActive: boolean;
|
|
182
|
-
/** Agent's wallet public key (base58). */
|
|
183
|
-
walletPubkey: string;
|
|
184
|
-
/** Human-readable agent name. */
|
|
185
|
-
name: string;
|
|
186
|
-
/** Agent description. */
|
|
187
|
-
description: string;
|
|
188
|
-
/** DID-style agent identifier. */
|
|
189
|
-
agentId?: string;
|
|
190
|
-
/** Advertised capabilities. */
|
|
191
|
-
capabilities: AgentCapability[];
|
|
192
|
-
/** On-chain pricing tiers. */
|
|
193
|
-
pricing: AgentPricingOnChain[];
|
|
194
|
-
/** Reputation metrics. */
|
|
195
|
-
reputation: AgentReputationOnChain;
|
|
196
|
-
/** x402 endpoint for remote calls (e.g. `"https://agent.example/.well-known/x402"`). */
|
|
197
|
-
x402Endpoint?: string;
|
|
198
|
-
/** Unix timestamp of creation (ms). */
|
|
199
|
-
createdAt: number;
|
|
200
|
-
/** Unix timestamp of last update (ms). */
|
|
201
|
-
updatedAt: number;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* @description Parameters for the `register` instruction.
|
|
205
|
-
* @since 1.3.0
|
|
206
|
-
*/
|
|
207
|
-
export interface RegisterAgentParams {
|
|
208
|
-
/** Agent's wallet public key (base58). Must be the signer. */
|
|
209
|
-
walletPubkey: string;
|
|
210
|
-
/** Human-readable name (max 64 bytes UTF-8). */
|
|
211
|
-
name: string;
|
|
212
|
-
/** Description (max 256 bytes UTF-8). */
|
|
213
|
-
description: string;
|
|
214
|
-
/** Optional DID identifier. */
|
|
215
|
-
agentId?: string;
|
|
216
|
-
/** Initial capabilities. */
|
|
217
|
-
capabilities?: AgentCapability[];
|
|
218
|
-
/** Initial pricing tiers. */
|
|
219
|
-
pricing?: AgentPricingOnChain[];
|
|
220
|
-
/** Optional x402 endpoint. */
|
|
221
|
-
x402Endpoint?: string;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* @description Parameters for the `update` instruction.
|
|
225
|
-
* Only provided fields are updated; omitted fields are unchanged.
|
|
226
|
-
* @since 1.3.0
|
|
227
|
-
*/
|
|
228
|
-
export interface UpdateAgentParams {
|
|
229
|
-
/** Wallet pubkey of the agent to update (must be signer). */
|
|
230
|
-
walletPubkey: string;
|
|
231
|
-
/** New name (max 64 bytes). */
|
|
232
|
-
name?: string;
|
|
233
|
-
/** New description (max 256 bytes). */
|
|
234
|
-
description?: string;
|
|
235
|
-
/** Updated capabilities (replaces existing list). */
|
|
236
|
-
capabilities?: AgentCapability[];
|
|
237
|
-
/** Updated pricing tiers (replaces existing list). */
|
|
238
|
-
pricing?: AgentPricingOnChain[];
|
|
239
|
-
/** Updated x402 endpoint. */
|
|
240
|
-
x402Endpoint?: string;
|
|
241
|
-
/** Set active/inactive status. */
|
|
242
|
-
isActive?: boolean;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* @description Parameters for the `updateReputation` instruction.
|
|
246
|
-
* Typically called by the agent itself or a trusted oracle.
|
|
247
|
-
* @since 1.3.0
|
|
248
|
-
*/
|
|
249
|
-
export interface UpdateReputationParams {
|
|
250
|
-
/** Wallet pubkey of the agent. */
|
|
251
|
-
walletPubkey: string;
|
|
252
|
-
/** New total calls served count. */
|
|
253
|
-
totalCallsServed?: bigint;
|
|
254
|
-
/** New average latency (ms). */
|
|
255
|
-
avgLatencyMs?: number;
|
|
256
|
-
/** New uptime percentage. */
|
|
257
|
-
uptimePercent?: number;
|
|
258
|
-
/** Reputation score (0–1000). */
|
|
259
|
-
score?: number;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* @description Filters for on-chain agent discovery.
|
|
263
|
-
* @since 1.3.0
|
|
264
|
-
*/
|
|
265
|
-
export interface AgentDiscoveryFilter {
|
|
266
|
-
/** Only return active agents. @default true */
|
|
267
|
-
activeOnly?: boolean;
|
|
268
|
-
/** Filter by capability ID (e.g. `"jupiter:swap"`). */
|
|
269
|
-
capability?: string;
|
|
270
|
-
/** Filter by protocol (e.g. `"jupiter"`, `"raydium"`). */
|
|
271
|
-
protocol?: string;
|
|
272
|
-
/** Min reputation score (0–1000). */
|
|
273
|
-
minReputation?: number;
|
|
274
|
-
/** Max price per call (lamports). */
|
|
275
|
-
maxPricePerCall?: bigint;
|
|
276
|
-
/** Min uptime percentage. */
|
|
277
|
-
minUptime?: number;
|
|
278
|
-
/** Sort results by this field. */
|
|
279
|
-
sortBy?: 'reputation' | 'price' | 'latency' | 'uptime' | 'calls';
|
|
280
|
-
/** Sort direction. @default 'desc' */
|
|
281
|
-
sortDirection?: 'asc' | 'desc';
|
|
282
|
-
/** Max results to return. @default 50 */
|
|
283
|
-
limit?: number;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* @description Result of an on-chain discovery query.
|
|
287
|
-
* @since 1.3.0
|
|
288
|
-
*/
|
|
289
|
-
export interface DiscoveryResult {
|
|
290
|
-
/** Matching agent accounts. */
|
|
291
|
-
agents: AgentPDAAccount[];
|
|
292
|
-
/** Total accounts scanned. */
|
|
293
|
-
totalScanned: number;
|
|
294
|
-
/** Total matching accounts (before limit). */
|
|
295
|
-
totalMatching: number;
|
|
296
|
-
/** Query latency in milliseconds. */
|
|
297
|
-
queryLatencyMs: number;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* @description Aggregate metrics across all discovered agents.
|
|
301
|
-
* @since 1.3.0
|
|
110
|
+
* ```tsx
|
|
111
|
+
* // app/providers/sap.tsx
|
|
112
|
+
* 'use client';
|
|
113
|
+
* import { createContext, useContext } from 'react';
|
|
114
|
+
* import type { SapContextValue } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
115
|
+
*
|
|
116
|
+
* const SapContext = createContext<SapContextValue>({
|
|
117
|
+
* client: null,
|
|
118
|
+
* loading: false,
|
|
119
|
+
* error: null,
|
|
120
|
+
* connect: async () => {},
|
|
121
|
+
* disconnect: () => {},
|
|
122
|
+
* });
|
|
123
|
+
*
|
|
124
|
+
* export const useSap = () => useContext(SapContext);
|
|
125
|
+
* ```
|
|
302
126
|
*/
|
|
303
|
-
export interface
|
|
304
|
-
/**
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
|
|
314
|
-
/** Unique protocols represented. */
|
|
315
|
-
protocols: string[];
|
|
316
|
-
/** Unique capabilities available. */
|
|
317
|
-
capabilities: string[];
|
|
127
|
+
export interface SapContextValue<TClient = unknown> {
|
|
128
|
+
/** The SAP bridge client — `null` until connected. */
|
|
129
|
+
client: TClient | null;
|
|
130
|
+
/** Whether the client is currently initializing. */
|
|
131
|
+
loading: boolean;
|
|
132
|
+
/** Initialization error, if any. */
|
|
133
|
+
error: Error | null;
|
|
134
|
+
/** Connect to SAP with the given wallet. */
|
|
135
|
+
connect: (wallet: SapWallet) => Promise<void>;
|
|
136
|
+
/** Disconnect and clear the client. */
|
|
137
|
+
disconnect: () => void;
|
|
318
138
|
}
|
|
319
139
|
/**
|
|
320
|
-
*
|
|
321
|
-
* Compatible with Solana `TransactionInstruction`.
|
|
322
|
-
* @since 1.3.0
|
|
140
|
+
* Configuration for {@link createSapProvider}.
|
|
323
141
|
*/
|
|
324
|
-
export interface
|
|
325
|
-
/**
|
|
326
|
-
|
|
327
|
-
/** Account metas for the instruction. */
|
|
328
|
-
keys: SAPAccountMeta[];
|
|
329
|
-
/** Serialized instruction data. */
|
|
330
|
-
data: Uint8Array;
|
|
142
|
+
export interface SapProviderConfig extends Omit<SapBridgeConfig, 'wallet'> {
|
|
143
|
+
/** Singleton cache key version — change to bust the cache. */
|
|
144
|
+
version?: string;
|
|
331
145
|
}
|
|
332
146
|
/**
|
|
333
|
-
*
|
|
334
|
-
* @since 1.3.0
|
|
147
|
+
* Error thrown when a required peer dependency is missing.
|
|
335
148
|
*/
|
|
336
|
-
export
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
isSigner: boolean;
|
|
341
|
-
/** Whether this account is writable. */
|
|
342
|
-
isWritable: boolean;
|
|
149
|
+
export declare class SapDependencyError extends Error {
|
|
150
|
+
readonly name = "SapDependencyError";
|
|
151
|
+
readonly packageName: string;
|
|
152
|
+
constructor(packageName: string);
|
|
343
153
|
}
|
|
344
|
-
/**
|
|
345
|
-
* @description Conversion helpers to bridge SAP types to gateway types.
|
|
346
|
-
* @since 1.3.0
|
|
347
|
-
*/
|
|
348
|
-
export declare function pdaToIdentity(pda: AgentPDAAccount): AgentIdentity;
|
|
349
|
-
/**
|
|
350
|
-
* @description Convert on-chain pricing to gateway PricingTier.
|
|
351
|
-
* @param {AgentPricingOnChain} p - On-chain pricing entry
|
|
352
|
-
* @returns {PricingTier} Gateway-compatible pricing tier
|
|
353
|
-
* @since 1.3.0
|
|
354
|
-
*/
|
|
355
|
-
export declare function pricingToTier(p: AgentPricingOnChain): PricingTier;
|
|
356
|
-
/**
|
|
357
|
-
* @description Compute the cost of a specific call number using volume curve pricing.
|
|
358
|
-
*
|
|
359
|
-
* Evaluates the agent's volume curve to determine the price for the Nth call.
|
|
360
|
-
* This implements ERC-8004-style metered billing natively on Solana.
|
|
361
|
-
*
|
|
362
|
-
* @param {AgentPricingOnChain} pricing - The pricing tier
|
|
363
|
-
* @param {number} callNumber - The call number (1-indexed, cumulative across sessions)
|
|
364
|
-
* @returns {bigint} Cost of this specific call in smallest token unit
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
* ```ts
|
|
368
|
-
* const pricing = {
|
|
369
|
-
* tierId: 'base',
|
|
370
|
-
* pricePerCall: 1000n, // 0.001 USDC base price
|
|
371
|
-
* volumeCurve: [
|
|
372
|
-
* { afterCalls: 100, pricePerCall: 800n }, // 20% off after 100 calls
|
|
373
|
-
* { afterCalls: 1000, pricePerCall: 500n }, // 50% off after 1000 calls
|
|
374
|
-
* ],
|
|
375
|
-
* // ...
|
|
376
|
-
* };
|
|
377
|
-
*
|
|
378
|
-
* computeCallCost(pricing, 1); // → 1000n (base price)
|
|
379
|
-
* computeCallCost(pricing, 101); // → 800n (first discount tier)
|
|
380
|
-
* computeCallCost(pricing, 1001); // → 500n (second discount tier)
|
|
381
|
-
* ```
|
|
382
|
-
*
|
|
383
|
-
* @since 1.4.0
|
|
384
|
-
*/
|
|
385
|
-
export declare function computeCallCost(pricing: AgentPricingOnChain, callNumber: number): bigint;
|
|
386
|
-
/**
|
|
387
|
-
* @description Estimate total cost for N calls using the volume curve.
|
|
388
|
-
*
|
|
389
|
-
* @param {AgentPricingOnChain} pricing - The pricing tier
|
|
390
|
-
* @param {number} totalCalls - Total number of calls
|
|
391
|
-
* @param {number} [startingFrom=1] - Starting call number (for continuing sessions)
|
|
392
|
-
* @returns {{ totalCost: bigint; avgPricePerCall: bigint; breakdown: Array<{ from: number; to: number; pricePerCall: bigint; subtotal: bigint }> }}
|
|
393
|
-
*
|
|
394
|
-
* @example
|
|
395
|
-
* ```ts
|
|
396
|
-
* const estimate = estimateTotalCost(pricing, 1500);
|
|
397
|
-
* // estimate.totalCost → 850_000n
|
|
398
|
-
* // estimate.avgPricePerCall → 566n
|
|
399
|
-
* // estimate.breakdown → [
|
|
400
|
-
* // { from: 1, to: 100, pricePerCall: 1000n, subtotal: 100_000n },
|
|
401
|
-
* // { from: 101, to: 1000, pricePerCall: 800n, subtotal: 720_000n },
|
|
402
|
-
* // { from: 1001, to: 1500, pricePerCall: 500n, subtotal: 250_000n },
|
|
403
|
-
* // ]
|
|
404
|
-
* ```
|
|
405
|
-
*
|
|
406
|
-
* @since 1.4.0
|
|
407
|
-
*/
|
|
408
|
-
export declare function estimateTotalCost(pricing: AgentPricingOnChain, totalCalls: number, startingFrom?: number): {
|
|
409
|
-
totalCost: bigint;
|
|
410
|
-
avgPricePerCall: bigint;
|
|
411
|
-
breakdown: Array<{
|
|
412
|
-
from: number;
|
|
413
|
-
to: number;
|
|
414
|
-
pricePerCall: bigint;
|
|
415
|
-
subtotal: bigint;
|
|
416
|
-
}>;
|
|
417
|
-
};
|
|
418
154
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/sap/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/sap/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,qBAAqB,CAAC;AAM7B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,gDAAgD,CAAC;AAM5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,SAAS;IACxB,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE;QAAE,QAAQ,IAAI,MAAM,CAAC;QAAC,OAAO,IAAI,UAAU,CAAA;KAAE,CAAC;IAClE,iCAAiC;IACjC,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtC,kCAAkC;IAClC,mBAAmB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CAChD;AAMD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,MAAM,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yDAAyD;IACzD,UAAU,CAAC,EAAE,aAAa,CAAC;IAE3B,iEAAiE;IACjE,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,eAAe,CAAC,OAAO,GAAG,OAAO;IAChD,sDAAsD;IACtD,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,4CAA4C;IAC5C,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,uCAAuC;IACvC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IACxE,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAkB,IAAI,wBAAwB;IAC9C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,WAAW,EAAE,MAAM;CAOhC"}
|