mppx 0.8.17 → 0.8.18
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 +55 -0
- package/README.md +15 -0
- package/dist/Challenge.js +21 -4
- package/dist/bin.js +3 -3
- package/dist/cli/THIRD-PARTY-LICENSES.txt +328 -0
- package/dist/cli/cli.js +253 -1505
- package/dist/cli/plugins/index.js +19 -5
- package/dist/cli/plugins/tempo.js +7 -3
- package/dist/cli/sessions/Manager.js +7 -4
- package/dist/cli/sessions/request.d.ts +2 -0
- package/dist/cli/sessions/request.js +18 -0
- package/dist/cli/sessions/store.js +28 -14
- package/dist/discovery/Discovery.js +2 -1
- package/dist/evm/client/Charge.js +8 -0
- package/dist/server/core.d.ts +9 -0
- package/dist/server/core.js +9 -0
- package/dist/stripe/server/Charge.js +2 -4
- package/dist/stripe/server/Methods.d.ts +2 -2
- package/dist/stripe/server/Methods.js +17 -11
- package/dist/stripe/server/internal/html.gen.d.ts +1 -1
- package/dist/stripe/server/internal/html.gen.js +1 -1
- package/dist/stripe/server/spt.d.ts +8 -0
- package/dist/stripe/server/spt.js +8 -0
- package/dist/tempo/Methods.d.ts +13 -0
- package/dist/tempo/Methods.js +14 -3
- package/dist/tempo/client/Charge.d.ts +3 -0
- package/dist/tempo/client/Charge.js +31 -9
- package/dist/tempo/client/Methods.d.ts +13 -0
- package/dist/tempo/internal/defaults.d.ts +11 -0
- package/dist/tempo/internal/defaults.js +11 -0
- package/dist/tempo/internal/machine-token-charge.d.ts +51 -0
- package/dist/tempo/internal/machine-token-charge.js +113 -0
- package/dist/tempo/internal/machine-token-session.d.ts +88 -0
- package/dist/tempo/internal/machine-token-session.js +173 -0
- package/dist/tempo/internal/signature-envelope.d.ts +14 -0
- package/dist/tempo/internal/signature-envelope.js +28 -0
- package/dist/tempo/legacy/client/ChannelOps.d.ts +2 -2
- package/dist/tempo/legacy/client/ChannelOps.js +11 -5
- package/dist/tempo/legacy/client/Session.d.ts +13 -1
- package/dist/tempo/legacy/client/Session.js +3 -3
- package/dist/tempo/legacy/client/SessionManager.d.ts +3 -1
- package/dist/tempo/legacy/client/SessionManager.js +2 -0
- package/dist/tempo/server/Charge.d.ts +3 -0
- package/dist/tempo/server/Charge.js +58 -17
- package/dist/tempo/server/Methods.d.ts +21 -4
- package/dist/tempo/server/Methods.js +8 -4
- package/dist/tempo/server/internal/html.gen.d.ts +1 -1
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/session/client/ChannelOps.d.ts +18 -3
- package/dist/tempo/session/client/ChannelOps.js +35 -6
- package/dist/tempo/session/client/ChannelStore.d.ts +0 -5
- package/dist/tempo/session/client/ChannelStore.js +2 -2
- package/dist/tempo/session/client/CredentialState.d.ts +17 -2
- package/dist/tempo/session/client/CredentialState.js +77 -76
- package/dist/tempo/session/client/Runtime.d.ts +4 -2
- package/dist/tempo/session/client/Runtime.js +21 -5
- package/dist/tempo/session/client/Session.d.ts +15 -3
- package/dist/tempo/session/client/Session.js +186 -63
- package/dist/tempo/session/client/SessionManager.d.ts +3 -1
- package/dist/tempo/session/client/SessionManager.js +35 -11
- package/dist/tempo/session/client/Transports.d.ts +2 -0
- package/dist/tempo/session/client/Transports.js +12 -2
- package/dist/tempo/session/precompile/Chain.d.ts +10 -2
- package/dist/tempo/session/precompile/Chain.js +50 -10
- package/dist/tempo/session/precompile/Protocol.d.ts +15 -0
- package/dist/tempo/session/precompile/Protocol.js +7 -0
- package/dist/tempo/session/precompile/Voucher.d.ts +3 -1
- package/dist/tempo/session/precompile/Voucher.js +6 -12
- package/dist/tempo/session/server/ChannelStore.d.ts +6 -0
- package/dist/tempo/session/server/ChannelStore.js +11 -4
- package/dist/tempo/session/server/CredentialVerification.d.ts +11 -9
- package/dist/tempo/session/server/CredentialVerification.js +185 -109
- package/dist/tempo/session/server/MeteredStream.d.ts +1 -1
- package/dist/tempo/session/server/MeteredStream.js +5 -4
- package/dist/tempo/session/server/RequestState.d.ts +19 -0
- package/dist/tempo/session/server/RequestState.js +61 -15
- package/dist/tempo/session/server/Session.d.ts +14 -2
- package/dist/tempo/session/server/Session.js +37 -6
- package/dist/tempo/session/server/Settlement.d.ts +11 -4
- package/dist/tempo/session/server/Settlement.js +53 -21
- package/dist/x402/client/Exact.d.ts +8 -0
- package/dist/x402/client/Exact.js +40 -10
- package/dist/x402/server/EvmCharge.d.ts +22 -0
- package/dist/x402/server/EvmCharge.js +23 -1
- package/package.json +15 -37
- package/dist/BodyDigest.d.ts.map +0 -1
- package/dist/BodyDigest.js.map +0 -1
- package/dist/Challenge.d.ts.map +0 -1
- package/dist/Challenge.js.map +0 -1
- package/dist/Constants.d.ts.map +0 -1
- package/dist/Constants.js.map +0 -1
- package/dist/Credential.d.ts.map +0 -1
- package/dist/Credential.js.map +0 -1
- package/dist/Errors.d.ts.map +0 -1
- package/dist/Errors.js.map +0 -1
- package/dist/Expires.d.ts.map +0 -1
- package/dist/Expires.js.map +0 -1
- package/dist/Html.d.ts.map +0 -1
- package/dist/Html.js.map +0 -1
- package/dist/Mcp.d.ts.map +0 -1
- package/dist/Mcp.js.map +0 -1
- package/dist/Method.d.ts.map +0 -1
- package/dist/Method.js.map +0 -1
- package/dist/PaymentRequest.d.ts.map +0 -1
- package/dist/PaymentRequest.js.map +0 -1
- package/dist/Receipt.d.ts.map +0 -1
- package/dist/Receipt.js.map +0 -1
- package/dist/Store.d.ts.map +0 -1
- package/dist/Store.js.map +0 -1
- package/dist/attestation/Client.d.ts.map +0 -1
- package/dist/attestation/Client.js.map +0 -1
- package/dist/attestation/Constants.d.ts.map +0 -1
- package/dist/attestation/Constants.js.map +0 -1
- package/dist/attestation/Server.d.ts.map +0 -1
- package/dist/attestation/Server.js.map +0 -1
- package/dist/attestation/Types.d.ts.map +0 -1
- package/dist/attestation/Types.js.map +0 -1
- package/dist/attestation/index.d.ts.map +0 -1
- package/dist/attestation/index.js.map +0 -1
- package/dist/attestation/internal/HttpMessageSignature.d.ts.map +0 -1
- package/dist/attestation/internal/HttpMessageSignature.js.map +0 -1
- package/dist/attestation/internal/SigningContext.d.ts.map +0 -1
- package/dist/attestation/internal/SigningContext.js.map +0 -1
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js.map +0 -1
- package/dist/cli/account.d.ts.map +0 -1
- package/dist/cli/account.js.map +0 -1
- package/dist/cli/cli.d.ts.map +0 -1
- package/dist/cli/cli.js.map +0 -1
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/internal.d.ts.map +0 -1
- package/dist/cli/internal.js.map +0 -1
- package/dist/cli/plugins/evm.d.ts.map +0 -1
- package/dist/cli/plugins/evm.js.map +0 -1
- package/dist/cli/plugins/index.d.ts.map +0 -1
- package/dist/cli/plugins/index.js.map +0 -1
- package/dist/cli/plugins/plugin.d.ts.map +0 -1
- package/dist/cli/plugins/plugin.js.map +0 -1
- package/dist/cli/plugins/stripe.d.ts.map +0 -1
- package/dist/cli/plugins/stripe.js.map +0 -1
- package/dist/cli/plugins/tempo.d.ts.map +0 -1
- package/dist/cli/plugins/tempo.js.map +0 -1
- package/dist/cli/sessions/Manager.d.ts.map +0 -1
- package/dist/cli/sessions/Manager.js.map +0 -1
- package/dist/cli/sessions/commands.d.ts.map +0 -1
- package/dist/cli/sessions/commands.js.map +0 -1
- package/dist/cli/sessions/request.d.ts.map +0 -1
- package/dist/cli/sessions/request.js.map +0 -1
- package/dist/cli/sessions/store.d.ts.map +0 -1
- package/dist/cli/sessions/store.js.map +0 -1
- package/dist/cli/utils.d.ts.map +0 -1
- package/dist/cli/utils.js.map +0 -1
- package/dist/cli/validate/challenge.d.ts.map +0 -1
- package/dist/cli/validate/challenge.js.map +0 -1
- package/dist/cli/validate/discovery.d.ts.map +0 -1
- package/dist/cli/validate/discovery.js.map +0 -1
- package/dist/cli/validate/helpers.d.ts.map +0 -1
- package/dist/cli/validate/helpers.js.map +0 -1
- package/dist/cli/validate/index.d.ts.map +0 -1
- package/dist/cli/validate/index.js.map +0 -1
- package/dist/cli/validate/messages.d.ts.map +0 -1
- package/dist/cli/validate/messages.js.map +0 -1
- package/dist/cli/validate/payment.d.ts.map +0 -1
- package/dist/cli/validate/payment.js.map +0 -1
- package/dist/client/Methods.d.ts.map +0 -1
- package/dist/client/Methods.js.map +0 -1
- package/dist/client/Mppx.d.ts.map +0 -1
- package/dist/client/Mppx.js.map +0 -1
- package/dist/client/Transport.d.ts.map +0 -1
- package/dist/client/Transport.js.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/internal/Fetch.d.ts.map +0 -1
- package/dist/client/internal/Fetch.js.map +0 -1
- package/dist/client/internal/MethodChallenge.d.ts.map +0 -1
- package/dist/client/internal/MethodChallenge.js.map +0 -1
- package/dist/client/internal/MethodResponse.d.ts.map +0 -1
- package/dist/client/internal/MethodResponse.js.map +0 -1
- package/dist/client/internal/protocols/Mcp.d.ts.map +0 -1
- package/dist/client/internal/protocols/Mcp.js.map +0 -1
- package/dist/client/internal/protocols/Mpp.d.ts.map +0 -1
- package/dist/client/internal/protocols/Mpp.js.map +0 -1
- package/dist/client/internal/protocols/Protocol.d.ts.map +0 -1
- package/dist/client/internal/protocols/Protocol.js.map +0 -1
- package/dist/client/internal/protocols/Shared.d.ts.map +0 -1
- package/dist/client/internal/protocols/Shared.js.map +0 -1
- package/dist/client/internal/protocols/X402.d.ts.map +0 -1
- package/dist/client/internal/protocols/X402.js.map +0 -1
- package/dist/client/node.d.ts.map +0 -1
- package/dist/client/node.js.map +0 -1
- package/dist/discovery/Discovery.d.ts.map +0 -1
- package/dist/discovery/Discovery.js.map +0 -1
- package/dist/discovery/OpenApi.d.ts.map +0 -1
- package/dist/discovery/OpenApi.js.map +0 -1
- package/dist/discovery/Validate.d.ts.map +0 -1
- package/dist/discovery/Validate.js.map +0 -1
- package/dist/discovery/index.d.ts.map +0 -1
- package/dist/discovery/index.js.map +0 -1
- package/dist/discovery/internal/Metadata.d.ts.map +0 -1
- package/dist/discovery/internal/Metadata.js.map +0 -1
- package/dist/evm/Assets.d.ts.map +0 -1
- package/dist/evm/Assets.js.map +0 -1
- package/dist/evm/Chains.d.ts.map +0 -1
- package/dist/evm/Chains.js.map +0 -1
- package/dist/evm/Methods.d.ts.map +0 -1
- package/dist/evm/Methods.js.map +0 -1
- package/dist/evm/Types.d.ts.map +0 -1
- package/dist/evm/Types.js.map +0 -1
- package/dist/evm/client/Charge.d.ts.map +0 -1
- package/dist/evm/client/Charge.js.map +0 -1
- package/dist/evm/client/Methods.d.ts.map +0 -1
- package/dist/evm/client/Methods.js.map +0 -1
- package/dist/evm/client/index.d.ts.map +0 -1
- package/dist/evm/client/index.js.map +0 -1
- package/dist/evm/index.d.ts.map +0 -1
- package/dist/evm/index.js.map +0 -1
- package/dist/evm/server/Charge.d.ts.map +0 -1
- package/dist/evm/server/Charge.js.map +0 -1
- package/dist/evm/server/Methods.d.ts.map +0 -1
- package/dist/evm/server/Methods.js.map +0 -1
- package/dist/evm/server/index.d.ts.map +0 -1
- package/dist/evm/server/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/AcceptPayment.d.ts.map +0 -1
- package/dist/internal/AcceptPayment.js.map +0 -1
- package/dist/internal/HeaderCodec.d.ts.map +0 -1
- package/dist/internal/HeaderCodec.js.map +0 -1
- package/dist/internal/constantTimeEqual.d.ts.map +0 -1
- package/dist/internal/constantTimeEqual.js.map +0 -1
- package/dist/internal/env.d.ts.map +0 -1
- package/dist/internal/env.js.map +0 -1
- package/dist/internal/types.d.ts.map +0 -1
- package/dist/internal/types.js.map +0 -1
- package/dist/mcp/client/McpClient.d.ts.map +0 -1
- package/dist/mcp/client/McpClient.js.map +0 -1
- package/dist/mcp/client/index.d.ts.map +0 -1
- package/dist/mcp/client/index.js.map +0 -1
- package/dist/mcp/server/Transport.d.ts.map +0 -1
- package/dist/mcp/server/Transport.js.map +0 -1
- package/dist/mcp/server/index.d.ts.map +0 -1
- package/dist/mcp/server/index.js.map +0 -1
- package/dist/middlewares/elysia.d.ts.map +0 -1
- package/dist/middlewares/elysia.js.map +0 -1
- package/dist/middlewares/express.d.ts.map +0 -1
- package/dist/middlewares/express.js.map +0 -1
- package/dist/middlewares/hono.d.ts.map +0 -1
- package/dist/middlewares/hono.js.map +0 -1
- package/dist/middlewares/internal/mppx.d.ts.map +0 -1
- package/dist/middlewares/internal/mppx.js.map +0 -1
- package/dist/middlewares/nextjs.d.ts.map +0 -1
- package/dist/middlewares/nextjs.js.map +0 -1
- package/dist/proxy/Proxy.d.ts.map +0 -1
- package/dist/proxy/Proxy.js.map +0 -1
- package/dist/proxy/Service.d.ts.map +0 -1
- package/dist/proxy/Service.js.map +0 -1
- package/dist/proxy/index.d.ts.map +0 -1
- package/dist/proxy/index.js.map +0 -1
- package/dist/proxy/internal/Headers.d.ts.map +0 -1
- package/dist/proxy/internal/Headers.js.map +0 -1
- package/dist/proxy/internal/Route.d.ts.map +0 -1
- package/dist/proxy/internal/Route.js.map +0 -1
- package/dist/proxy/services/anthropic.d.ts.map +0 -1
- package/dist/proxy/services/anthropic.js.map +0 -1
- package/dist/proxy/services/openai.d.ts.map +0 -1
- package/dist/proxy/services/openai.js.map +0 -1
- package/dist/proxy/services/stripe.d.ts.map +0 -1
- package/dist/proxy/services/stripe.js.map +0 -1
- package/dist/server/Methods.d.ts.map +0 -1
- package/dist/server/Methods.js.map +0 -1
- package/dist/server/Mppx.d.ts.map +0 -1
- package/dist/server/Mppx.js.map +0 -1
- package/dist/server/NodeListener.d.ts.map +0 -1
- package/dist/server/NodeListener.js.map +0 -1
- package/dist/server/Request.d.ts.map +0 -1
- package/dist/server/Request.js.map +0 -1
- package/dist/server/Response.d.ts.map +0 -1
- package/dist/server/Response.js.map +0 -1
- package/dist/server/Transport.d.ts.map +0 -1
- package/dist/server/Transport.js.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/internal/html/compose.main.gen.d.ts.map +0 -1
- package/dist/server/internal/html/compose.main.gen.js.map +0 -1
- package/dist/server/internal/html/config.d.ts.map +0 -1
- package/dist/server/internal/html/config.js.map +0 -1
- package/dist/server/internal/html/constants.d.ts.map +0 -1
- package/dist/server/internal/html/constants.js.map +0 -1
- package/dist/server/internal/html/serviceWorker.client.d.ts.map +0 -1
- package/dist/server/internal/html/serviceWorker.client.js.map +0 -1
- package/dist/server/internal/html/serviceWorker.gen.d.ts.map +0 -1
- package/dist/server/internal/html/serviceWorker.gen.js.map +0 -1
- package/dist/server/internal/scope.d.ts.map +0 -1
- package/dist/server/internal/scope.js.map +0 -1
- package/dist/stripe/Methods.d.ts.map +0 -1
- package/dist/stripe/Methods.js.map +0 -1
- package/dist/stripe/client/Charge.d.ts.map +0 -1
- package/dist/stripe/client/Charge.js.map +0 -1
- package/dist/stripe/client/Methods.d.ts.map +0 -1
- package/dist/stripe/client/Methods.js.map +0 -1
- package/dist/stripe/client/index.d.ts.map +0 -1
- package/dist/stripe/client/index.js.map +0 -1
- package/dist/stripe/index.d.ts.map +0 -1
- package/dist/stripe/index.js.map +0 -1
- package/dist/stripe/internal/constants.d.ts.map +0 -1
- package/dist/stripe/internal/constants.js.map +0 -1
- package/dist/stripe/internal/types.d.ts.map +0 -1
- package/dist/stripe/internal/types.js.map +0 -1
- package/dist/stripe/server/Charge.d.ts.map +0 -1
- package/dist/stripe/server/Charge.js.map +0 -1
- package/dist/stripe/server/Methods.d.ts.map +0 -1
- package/dist/stripe/server/Methods.js.map +0 -1
- package/dist/stripe/server/index.d.ts.map +0 -1
- package/dist/stripe/server/index.js.map +0 -1
- package/dist/stripe/server/internal/deposit-address.d.ts.map +0 -1
- package/dist/stripe/server/internal/deposit-address.js.map +0 -1
- package/dist/stripe/server/internal/html/types.d.ts.map +0 -1
- package/dist/stripe/server/internal/html/types.js.map +0 -1
- package/dist/stripe/server/internal/html.gen.d.ts.map +0 -1
- package/dist/stripe/server/internal/html.gen.js.map +0 -1
- package/dist/stripe/server/internal/record-payment.d.ts.map +0 -1
- package/dist/stripe/server/internal/record-payment.js.map +0 -1
- package/dist/stripe/server/internal/request.d.ts.map +0 -1
- package/dist/stripe/server/internal/request.js.map +0 -1
- package/dist/tap/Constants.d.ts.map +0 -1
- package/dist/tap/Constants.js.map +0 -1
- package/dist/tap/Types.d.ts.map +0 -1
- package/dist/tap/Types.js.map +0 -1
- package/dist/tap/client/index.d.ts.map +0 -1
- package/dist/tap/client/index.js.map +0 -1
- package/dist/tap/index.d.ts.map +0 -1
- package/dist/tap/index.js.map +0 -1
- package/dist/tap/server/index.d.ts.map +0 -1
- package/dist/tap/server/index.js.map +0 -1
- package/dist/tempo/Attribution.d.ts.map +0 -1
- package/dist/tempo/Attribution.js.map +0 -1
- package/dist/tempo/Methods.d.ts.map +0 -1
- package/dist/tempo/Methods.js.map +0 -1
- package/dist/tempo/Proof.d.ts.map +0 -1
- package/dist/tempo/Proof.js.map +0 -1
- package/dist/tempo/client/Charge.d.ts.map +0 -1
- package/dist/tempo/client/Charge.js.map +0 -1
- package/dist/tempo/client/Methods.d.ts.map +0 -1
- package/dist/tempo/client/Methods.js.map +0 -1
- package/dist/tempo/client/ResolveAccount.d.ts.map +0 -1
- package/dist/tempo/client/ResolveAccount.js.map +0 -1
- package/dist/tempo/client/Subscription.d.ts.map +0 -1
- package/dist/tempo/client/Subscription.js.map +0 -1
- package/dist/tempo/client/index.d.ts.map +0 -1
- package/dist/tempo/client/index.js.map +0 -1
- package/dist/tempo/index.d.ts.map +0 -1
- package/dist/tempo/index.js.map +0 -1
- package/dist/tempo/internal/account.d.ts.map +0 -1
- package/dist/tempo/internal/account.js.map +0 -1
- package/dist/tempo/internal/address.d.ts.map +0 -1
- package/dist/tempo/internal/address.js.map +0 -1
- package/dist/tempo/internal/auto-swap.d.ts.map +0 -1
- package/dist/tempo/internal/auto-swap.js.map +0 -1
- package/dist/tempo/internal/charge.d.ts.map +0 -1
- package/dist/tempo/internal/charge.js.map +0 -1
- package/dist/tempo/internal/defaults.d.ts.map +0 -1
- package/dist/tempo/internal/defaults.js.map +0 -1
- package/dist/tempo/internal/fee-payer.d.ts.map +0 -1
- package/dist/tempo/internal/fee-payer.js.map +0 -1
- package/dist/tempo/internal/fee-token.d.ts.map +0 -1
- package/dist/tempo/internal/fee-token.js.map +0 -1
- package/dist/tempo/internal/proof.d.ts.map +0 -1
- package/dist/tempo/internal/proof.js.map +0 -1
- package/dist/tempo/internal/selectors.d.ts.map +0 -1
- package/dist/tempo/internal/selectors.js.map +0 -1
- package/dist/tempo/internal/types.d.ts.map +0 -1
- package/dist/tempo/internal/types.js.map +0 -1
- package/dist/tempo/legacy/client/ChannelOps.d.ts.map +0 -1
- package/dist/tempo/legacy/client/ChannelOps.js.map +0 -1
- package/dist/tempo/legacy/client/Session.d.ts.map +0 -1
- package/dist/tempo/legacy/client/Session.js.map +0 -1
- package/dist/tempo/legacy/client/SessionManager.d.ts.map +0 -1
- package/dist/tempo/legacy/client/SessionManager.js.map +0 -1
- package/dist/tempo/legacy/client/index.d.ts.map +0 -1
- package/dist/tempo/legacy/client/index.js.map +0 -1
- package/dist/tempo/legacy/index.d.ts.map +0 -1
- package/dist/tempo/legacy/index.js.map +0 -1
- package/dist/tempo/legacy/session/Chain.d.ts.map +0 -1
- package/dist/tempo/legacy/session/Chain.js.map +0 -1
- package/dist/tempo/legacy/session/Channel.d.ts.map +0 -1
- package/dist/tempo/legacy/session/Channel.js.map +0 -1
- package/dist/tempo/legacy/session/Types.d.ts.map +0 -1
- package/dist/tempo/legacy/session/Types.js.map +0 -1
- package/dist/tempo/legacy/session/Voucher.d.ts.map +0 -1
- package/dist/tempo/legacy/session/Voucher.js.map +0 -1
- package/dist/tempo/legacy/session/escrow.abi.d.ts.map +0 -1
- package/dist/tempo/legacy/session/escrow.abi.js.map +0 -1
- package/dist/tempo/legacy/session/index.d.ts.map +0 -1
- package/dist/tempo/legacy/session/index.js.map +0 -1
- package/dist/tempo/server/Charge.d.ts.map +0 -1
- package/dist/tempo/server/Charge.js.map +0 -1
- package/dist/tempo/server/Methods.d.ts.map +0 -1
- package/dist/tempo/server/Methods.js.map +0 -1
- package/dist/tempo/server/Relay.d.ts.map +0 -1
- package/dist/tempo/server/Relay.js.map +0 -1
- package/dist/tempo/server/SponsorBudget.d.ts.map +0 -1
- package/dist/tempo/server/SponsorBudget.js.map +0 -1
- package/dist/tempo/server/Subscription.d.ts.map +0 -1
- package/dist/tempo/server/Subscription.js.map +0 -1
- package/dist/tempo/server/index.d.ts.map +0 -1
- package/dist/tempo/server/index.js.map +0 -1
- package/dist/tempo/server/internal/html.gen.d.ts.map +0 -1
- package/dist/tempo/server/internal/html.gen.js.map +0 -1
- package/dist/tempo/server/internal/request-body.d.ts.map +0 -1
- package/dist/tempo/server/internal/request-body.js.map +0 -1
- package/dist/tempo/server/internal/transport.d.ts.map +0 -1
- package/dist/tempo/server/internal/transport.js.map +0 -1
- package/dist/tempo/session/Snapshot.d.ts.map +0 -1
- package/dist/tempo/session/Snapshot.js.map +0 -1
- package/dist/tempo/session/client/ChannelOps.d.ts.map +0 -1
- package/dist/tempo/session/client/ChannelOps.js.map +0 -1
- package/dist/tempo/session/client/ChannelStore.d.ts.map +0 -1
- package/dist/tempo/session/client/ChannelStore.js.map +0 -1
- package/dist/tempo/session/client/CredentialState.d.ts.map +0 -1
- package/dist/tempo/session/client/CredentialState.js.map +0 -1
- package/dist/tempo/session/client/ReceiptCoordinator.d.ts.map +0 -1
- package/dist/tempo/session/client/ReceiptCoordinator.js.map +0 -1
- package/dist/tempo/session/client/Runtime.d.ts.map +0 -1
- package/dist/tempo/session/client/Runtime.js.map +0 -1
- package/dist/tempo/session/client/Session.d.ts.map +0 -1
- package/dist/tempo/session/client/Session.js.map +0 -1
- package/dist/tempo/session/client/SessionManager.d.ts.map +0 -1
- package/dist/tempo/session/client/SessionManager.js.map +0 -1
- package/dist/tempo/session/client/Transports.d.ts.map +0 -1
- package/dist/tempo/session/client/Transports.js.map +0 -1
- package/dist/tempo/session/client/index.d.ts.map +0 -1
- package/dist/tempo/session/client/index.js.map +0 -1
- package/dist/tempo/session/client/internal/SessionManager.d.ts.map +0 -1
- package/dist/tempo/session/client/internal/SessionManager.js.map +0 -1
- package/dist/tempo/session/index.d.ts.map +0 -1
- package/dist/tempo/session/index.js.map +0 -1
- package/dist/tempo/session/precompile/Chain.d.ts.map +0 -1
- package/dist/tempo/session/precompile/Chain.js.map +0 -1
- package/dist/tempo/session/precompile/Channel.d.ts.map +0 -1
- package/dist/tempo/session/precompile/Channel.js.map +0 -1
- package/dist/tempo/session/precompile/Protocol.d.ts.map +0 -1
- package/dist/tempo/session/precompile/Protocol.js.map +0 -1
- package/dist/tempo/session/precompile/Voucher.d.ts.map +0 -1
- package/dist/tempo/session/precompile/Voucher.js.map +0 -1
- package/dist/tempo/session/precompile/escrow.abi.d.ts.map +0 -1
- package/dist/tempo/session/precompile/escrow.abi.js.map +0 -1
- package/dist/tempo/session/precompile/index.d.ts.map +0 -1
- package/dist/tempo/session/precompile/index.js.map +0 -1
- package/dist/tempo/session/server/ChannelOps.d.ts.map +0 -1
- package/dist/tempo/session/server/ChannelOps.js.map +0 -1
- package/dist/tempo/session/server/ChannelStore.d.ts.map +0 -1
- package/dist/tempo/session/server/ChannelStore.js.map +0 -1
- package/dist/tempo/session/server/CredentialVerification.d.ts.map +0 -1
- package/dist/tempo/session/server/CredentialVerification.js.map +0 -1
- package/dist/tempo/session/server/MeteredStream.d.ts.map +0 -1
- package/dist/tempo/session/server/MeteredStream.js.map +0 -1
- package/dist/tempo/session/server/RequestState.d.ts.map +0 -1
- package/dist/tempo/session/server/RequestState.js.map +0 -1
- package/dist/tempo/session/server/Session.d.ts.map +0 -1
- package/dist/tempo/session/server/Session.js.map +0 -1
- package/dist/tempo/session/server/Settlement.d.ts.map +0 -1
- package/dist/tempo/session/server/Settlement.js.map +0 -1
- package/dist/tempo/session/server/Sse.d.ts.map +0 -1
- package/dist/tempo/session/server/Sse.js.map +0 -1
- package/dist/tempo/session/server/Transports.d.ts.map +0 -1
- package/dist/tempo/session/server/Transports.js.map +0 -1
- package/dist/tempo/session/server/Ws.d.ts.map +0 -1
- package/dist/tempo/session/server/Ws.js.map +0 -1
- package/dist/tempo/session/server/index.d.ts.map +0 -1
- package/dist/tempo/session/server/index.js.map +0 -1
- package/dist/tempo/subscription/KeyAuthorization.d.ts.map +0 -1
- package/dist/tempo/subscription/KeyAuthorization.js.map +0 -1
- package/dist/tempo/subscription/Receipt.d.ts.map +0 -1
- package/dist/tempo/subscription/Receipt.js.map +0 -1
- package/dist/tempo/subscription/Store.d.ts.map +0 -1
- package/dist/tempo/subscription/Store.js.map +0 -1
- package/dist/tempo/subscription/Types.d.ts.map +0 -1
- package/dist/tempo/subscription/Types.js.map +0 -1
- package/dist/tempo/subscription/index.d.ts.map +0 -1
- package/dist/tempo/subscription/index.js.map +0 -1
- package/dist/validation/core.d.ts.map +0 -1
- package/dist/validation/core.js.map +0 -1
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/viem/Account.d.ts.map +0 -1
- package/dist/viem/Account.js.map +0 -1
- package/dist/viem/Client.d.ts.map +0 -1
- package/dist/viem/Client.js.map +0 -1
- package/dist/web-bot-auth/Constants.d.ts.map +0 -1
- package/dist/web-bot-auth/Constants.js.map +0 -1
- package/dist/web-bot-auth/Types.d.ts.map +0 -1
- package/dist/web-bot-auth/Types.js.map +0 -1
- package/dist/web-bot-auth/client/index.d.ts.map +0 -1
- package/dist/web-bot-auth/client/index.js.map +0 -1
- package/dist/web-bot-auth/index.d.ts.map +0 -1
- package/dist/web-bot-auth/index.js.map +0 -1
- package/dist/web-bot-auth/internal/JwkThumbprint.d.ts.map +0 -1
- package/dist/web-bot-auth/internal/JwkThumbprint.js.map +0 -1
- package/dist/web-bot-auth/internal/SignatureAgent.d.ts.map +0 -1
- package/dist/web-bot-auth/internal/SignatureAgent.js.map +0 -1
- package/dist/web-bot-auth/server/index.d.ts.map +0 -1
- package/dist/web-bot-auth/server/index.js.map +0 -1
- package/dist/x402/Assets.d.ts.map +0 -1
- package/dist/x402/Assets.js.map +0 -1
- package/dist/x402/Header.d.ts.map +0 -1
- package/dist/x402/Header.js.map +0 -1
- package/dist/x402/Types.d.ts.map +0 -1
- package/dist/x402/Types.js.map +0 -1
- package/dist/x402/client/Exact.d.ts.map +0 -1
- package/dist/x402/client/Exact.js.map +0 -1
- package/dist/x402/index.d.ts.map +0 -1
- package/dist/x402/index.js.map +0 -1
- package/dist/x402/internal/ChallengeBrand.d.ts.map +0 -1
- package/dist/x402/internal/ChallengeBrand.js.map +0 -1
- package/dist/x402/internal/RouteBinding.d.ts.map +0 -1
- package/dist/x402/internal/RouteBinding.js.map +0 -1
- package/dist/x402/server/EvmCharge.d.ts.map +0 -1
- package/dist/x402/server/EvmCharge.js.map +0 -1
- package/dist/x402/server/Facilitator.d.ts.map +0 -1
- package/dist/x402/server/Facilitator.js.map +0 -1
- package/dist/zod.d.ts.map +0 -1
- package/dist/zod.js.map +0 -1
- package/src/BodyDigest.test.ts +0 -43
- package/src/BodyDigest.ts +0 -55
- package/src/Challenge.fuzz.test.ts +0 -154
- package/src/Challenge.test-d.ts +0 -82
- package/src/Challenge.test.ts +0 -1060
- package/src/Challenge.ts +0 -687
- package/src/Constants.ts +0 -58
- package/src/Credential.fuzz.test.ts +0 -62
- package/src/Credential.test.ts +0 -378
- package/src/Credential.ts +0 -217
- package/src/Errors.test.ts +0 -520
- package/src/Errors.ts +0 -448
- package/src/Expires.test.ts +0 -112
- package/src/Expires.ts +0 -59
- package/src/Html.ts +0 -67
- package/src/Mcp.ts +0 -85
- package/src/Method.test.ts +0 -177
- package/src/Method.ts +0 -631
- package/src/PaymentRequest.test.ts +0 -147
- package/src/PaymentRequest.ts +0 -108
- package/src/Receipt.test.ts +0 -151
- package/src/Receipt.ts +0 -146
- package/src/Store.test-d.ts +0 -211
- package/src/Store.test.ts +0 -407
- package/src/Store.ts +0 -397
- package/src/attestation/Attestation.integration.test.ts +0 -208
- package/src/attestation/Client.test.ts +0 -83
- package/src/attestation/Client.ts +0 -34
- package/src/attestation/Constants.ts +0 -15
- package/src/attestation/Server.test.ts +0 -60
- package/src/attestation/Server.ts +0 -12
- package/src/attestation/Types.test-d.ts +0 -54
- package/src/attestation/Types.ts +0 -77
- package/src/attestation/index.ts +0 -5
- package/src/attestation/internal/HttpMessageSignature.test.ts +0 -101
- package/src/attestation/internal/HttpMessageSignature.ts +0 -429
- package/src/attestation/internal/SigningContext.ts +0 -13
- package/src/bin.js +0 -2
- package/src/bin.ts +0 -4
- package/src/cli/account.ts +0 -269
- package/src/cli/cli.test.ts +0 -2221
- package/src/cli/cli.ts +0 -1650
- package/src/cli/config.test.ts +0 -89
- package/src/cli/config.ts +0 -50
- package/src/cli/internal.ts +0 -114
- package/src/cli/mcp.test.ts +0 -262
- package/src/cli/plugins/evm.ts +0 -55
- package/src/cli/plugins/index.ts +0 -4
- package/src/cli/plugins/plugin.ts +0 -84
- package/src/cli/plugins/stripe.ts +0 -174
- package/src/cli/plugins/tempo.ts +0 -1102
- package/src/cli/sessions/Manager.test.ts +0 -249
- package/src/cli/sessions/Manager.ts +0 -93
- package/src/cli/sessions/commands.ts +0 -444
- package/src/cli/sessions/request.test.ts +0 -51
- package/src/cli/sessions/request.ts +0 -353
- package/src/cli/sessions/store.test.ts +0 -581
- package/src/cli/sessions/store.ts +0 -940
- package/src/cli/utils.test.ts +0 -156
- package/src/cli/utils.ts +0 -394
- package/src/cli/validate/challenge.ts +0 -565
- package/src/cli/validate/discovery.test.ts +0 -435
- package/src/cli/validate/discovery.ts +0 -221
- package/src/cli/validate/helpers.ts +0 -166
- package/src/cli/validate/index.ts +0 -229
- package/src/cli/validate/messages.ts +0 -7
- package/src/cli/validate/payment.ts +0 -774
- package/src/cli/validate.test.ts +0 -843
- package/src/client/Methods.ts +0 -8
- package/src/client/Mppx.test-d.ts +0 -287
- package/src/client/Mppx.test.ts +0 -1065
- package/src/client/Mppx.ts +0 -487
- package/src/client/Transport.test.ts +0 -586
- package/src/client/Transport.ts +0 -170
- package/src/client/index.ts +0 -29
- package/src/client/internal/Fetch.browser.test.ts +0 -197
- package/src/client/internal/Fetch.test-d.ts +0 -109
- package/src/client/internal/Fetch.test.ts +0 -2336
- package/src/client/internal/Fetch.ts +0 -1075
- package/src/client/internal/MethodChallenge.ts +0 -35
- package/src/client/internal/MethodResponse.ts +0 -67
- package/src/client/internal/protocols/Mcp.test.ts +0 -220
- package/src/client/internal/protocols/Mcp.ts +0 -186
- package/src/client/internal/protocols/Mpp.ts +0 -21
- package/src/client/internal/protocols/Protocol.ts +0 -10
- package/src/client/internal/protocols/Shared.ts +0 -25
- package/src/client/internal/protocols/X402.ts +0 -46
- package/src/client/node.test.ts +0 -115
- package/src/client/node.ts +0 -247
- package/src/discovery/Discovery.test.ts +0 -214
- package/src/discovery/Discovery.ts +0 -105
- package/src/discovery/OpenApi.test.ts +0 -623
- package/src/discovery/OpenApi.ts +0 -192
- package/src/discovery/Validate.test.ts +0 -305
- package/src/discovery/Validate.ts +0 -77
- package/src/discovery/index.ts +0 -3
- package/src/discovery/internal/Metadata.ts +0 -51
- package/src/env.d.ts +0 -12
- package/src/evm/Assets.ts +0 -1
- package/src/evm/Chains.ts +0 -11
- package/src/evm/Methods.ts +0 -44
- package/src/evm/PublicInterface.test-d.ts +0 -134
- package/src/evm/Types.ts +0 -140
- package/src/evm/client/Charge.test.ts +0 -347
- package/src/evm/client/Charge.ts +0 -187
- package/src/evm/client/Methods.ts +0 -19
- package/src/evm/client/index.ts +0 -6
- package/src/evm/index.ts +0 -16
- package/src/evm/server/Charge.test.ts +0 -339
- package/src/evm/server/Charge.ts +0 -295
- package/src/evm/server/Methods.ts +0 -22
- package/src/evm/server/index.ts +0 -6
- package/src/index.ts +0 -14
- package/src/internal/AcceptPayment.test.ts +0 -347
- package/src/internal/AcceptPayment.ts +0 -366
- package/src/internal/HeaderCodec.ts +0 -36
- package/src/internal/changeset.test.ts +0 -106
- package/src/internal/constantTimeEqual.test.ts +0 -47
- package/src/internal/constantTimeEqual.ts +0 -10
- package/src/internal/env.test.ts +0 -42
- package/src/internal/env.ts +0 -49
- package/src/internal/types.test-d.ts +0 -21
- package/src/internal/types.ts +0 -479
- package/src/mcp/client/McpClient.integration.test.ts +0 -639
- package/src/mcp/client/McpClient.test-d.ts +0 -144
- package/src/mcp/client/McpClient.test.ts +0 -463
- package/src/mcp/client/McpClient.ts +0 -307
- package/src/mcp/client/McpClient.unit.test.ts +0 -135
- package/src/mcp/client/index.ts +0 -2
- package/src/mcp/server/Transport.test.ts +0 -191
- package/src/mcp/server/Transport.ts +0 -111
- package/src/mcp/server/index.ts +0 -1
- package/src/middlewares/elysia.test.ts +0 -285
- package/src/middlewares/elysia.ts +0 -116
- package/src/middlewares/express.test.ts +0 -361
- package/src/middlewares/express.ts +0 -140
- package/src/middlewares/hono.test.ts +0 -473
- package/src/middlewares/hono.ts +0 -153
- package/src/middlewares/internal/mppx.test.ts +0 -177
- package/src/middlewares/internal/mppx.ts +0 -67
- package/src/middlewares/nextjs.test.ts +0 -359
- package/src/middlewares/nextjs.ts +0 -107
- package/src/proxy/Proxy.test.ts +0 -1038
- package/src/proxy/Proxy.ts +0 -483
- package/src/proxy/Proxy.upstreamError.test.ts +0 -364
- package/src/proxy/Service.test.ts +0 -252
- package/src/proxy/Service.ts +0 -280
- package/src/proxy/index.ts +0 -6
- package/src/proxy/internal/Headers.test.ts +0 -139
- package/src/proxy/internal/Headers.ts +0 -66
- package/src/proxy/internal/Route.test.ts +0 -217
- package/src/proxy/internal/Route.ts +0 -64
- package/src/proxy/services/anthropic.test.ts +0 -132
- package/src/proxy/services/anthropic.ts +0 -53
- package/src/proxy/services/hooks.test-d.ts +0 -14
- package/src/proxy/services/hooks.test.ts +0 -44
- package/src/proxy/services/openai.test.ts +0 -157
- package/src/proxy/services/openai.ts +0 -60
- package/src/proxy/services/stripe.test.ts +0 -175
- package/src/proxy/services/stripe.ts +0 -59
- package/src/server/Methods.test-d.ts +0 -88
- package/src/server/Methods.test.ts +0 -69
- package/src/server/Methods.ts +0 -3
- package/src/server/Mppx.authorize.test.ts +0 -210
- package/src/server/Mppx.test-d.ts +0 -494
- package/src/server/Mppx.test.ts +0 -6711
- package/src/server/Mppx.ts +0 -2919
- package/src/server/NodeListener.test.ts +0 -293
- package/src/server/NodeListener.ts +0 -45
- package/src/server/Request.test.ts +0 -255
- package/src/server/Request.ts +0 -155
- package/src/server/Response.test.ts +0 -32
- package/src/server/Response.ts +0 -45
- package/src/server/Transport.test.ts +0 -598
- package/src/server/Transport.ts +0 -320
- package/src/server/index.ts +0 -9
- package/src/server/internal/html/compose.main.gen.ts +0 -2
- package/src/server/internal/html/compose.main.ts +0 -88
- package/src/server/internal/html/config.ts +0 -672
- package/src/server/internal/html/constants.ts +0 -28
- package/src/server/internal/html/serviceWorker.client.ts +0 -28
- package/src/server/internal/html/serviceWorker.gen.ts +0 -2
- package/src/server/internal/html/serviceWorker.ts +0 -27
- package/src/server/internal/html/tsconfig.compose.json +0 -8
- package/src/server/internal/html/tsconfig.worker.client.json +0 -8
- package/src/server/internal/html/tsconfig.worker.json +0 -8
- package/src/server/internal/scope.ts +0 -43
- package/src/stripe/Charge.integration.test.ts +0 -329
- package/src/stripe/Methods.test.ts +0 -62
- package/src/stripe/Methods.ts +0 -44
- package/src/stripe/client/Charge.test.ts +0 -205
- package/src/stripe/client/Charge.ts +0 -132
- package/src/stripe/client/Methods.ts +0 -37
- package/src/stripe/client/index.ts +0 -2
- package/src/stripe/index.ts +0 -1
- package/src/stripe/internal/constants.ts +0 -7
- package/src/stripe/internal/types.ts +0 -47
- package/src/stripe/server/Charge.test-d.ts +0 -81
- package/src/stripe/server/Charge.test.ts +0 -700
- package/src/stripe/server/Charge.ts +0 -487
- package/src/stripe/server/Methods.test-d.ts +0 -157
- package/src/stripe/server/Methods.test.ts +0 -403
- package/src/stripe/server/Methods.ts +0 -441
- package/src/stripe/server/index.ts +0 -2
- package/src/stripe/server/internal/deposit-address.ts +0 -57
- package/src/stripe/server/internal/html/main.ts +0 -165
- package/src/stripe/server/internal/html/node_modules/.bin/mppx +0 -22
- package/src/stripe/server/internal/html/node_modules/.bin/mppx.src +0 -22
- package/src/stripe/server/internal/html/package.json +0 -9
- package/src/stripe/server/internal/html/stripe-js-pure.d.ts +0 -7
- package/src/stripe/server/internal/html/tsconfig.json +0 -8
- package/src/stripe/server/internal/html/types.ts +0 -5
- package/src/stripe/server/internal/html.gen.ts +0 -2
- package/src/stripe/server/internal/record-payment.ts +0 -66
- package/src/stripe/server/internal/request.ts +0 -49
- package/src/tap/Constants.ts +0 -32
- package/src/tap/Tap.test.ts +0 -125
- package/src/tap/Types.ts +0 -11
- package/src/tap/client/index.ts +0 -54
- package/src/tap/index.ts +0 -4
- package/src/tap/server/index.ts +0 -48
- package/src/tempo/AccessKeyAuthorization.test.ts +0 -141
- package/src/tempo/Attribution.test.ts +0 -294
- package/src/tempo/Attribution.ts +0 -185
- package/src/tempo/Methods.test.ts +0 -425
- package/src/tempo/Methods.ts +0 -367
- package/src/tempo/Proof.conformance.test.ts +0 -146
- package/src/tempo/Proof.test-d.ts +0 -32
- package/src/tempo/Proof.test.ts +0 -40
- package/src/tempo/Proof.ts +0 -69
- package/src/tempo/PublicExports.test-d.ts +0 -130
- package/src/tempo/Subscription.integration.test.ts +0 -591
- package/src/tempo/client/Charge.test.ts +0 -501
- package/src/tempo/client/Charge.ts +0 -271
- package/src/tempo/client/Methods.ts +0 -45
- package/src/tempo/client/ResolveAccount.ts +0 -46
- package/src/tempo/client/Subscription.test.ts +0 -180
- package/src/tempo/client/Subscription.ts +0 -156
- package/src/tempo/client/index.ts +0 -17
- package/src/tempo/index.ts +0 -5
- package/src/tempo/internal/account.ts +0 -56
- package/src/tempo/internal/address.test.ts +0 -42
- package/src/tempo/internal/address.ts +0 -6
- package/src/tempo/internal/auto-swap.test.ts +0 -198
- package/src/tempo/internal/auto-swap.ts +0 -145
- package/src/tempo/internal/charge.test.ts +0 -66
- package/src/tempo/internal/charge.ts +0 -43
- package/src/tempo/internal/defaults.test.ts +0 -95
- package/src/tempo/internal/defaults.ts +0 -53
- package/src/tempo/internal/fee-payer.test.ts +0 -1177
- package/src/tempo/internal/fee-payer.ts +0 -808
- package/src/tempo/internal/fee-token.test.ts +0 -165
- package/src/tempo/internal/fee-token.ts +0 -72
- package/src/tempo/internal/proof.test.ts +0 -97
- package/src/tempo/internal/proof.ts +0 -87
- package/src/tempo/internal/selectors.ts +0 -10
- package/src/tempo/internal/types.ts +0 -19
- package/src/tempo/legacy/AccessKeyAuthorization.test.ts +0 -162
- package/src/tempo/legacy/README.md +0 -9
- package/src/tempo/legacy/client/ChannelOps.test.ts +0 -379
- package/src/tempo/legacy/client/ChannelOps.ts +0 -271
- package/src/tempo/legacy/client/Session.test.ts +0 -800
- package/src/tempo/legacy/client/Session.ts +0 -397
- package/src/tempo/legacy/client/SessionManager.test.ts +0 -468
- package/src/tempo/legacy/client/SessionManager.ts +0 -909
- package/src/tempo/legacy/client/index.ts +0 -6
- package/src/tempo/legacy/index.ts +0 -4
- package/src/tempo/legacy/session/Chain.test.ts +0 -1349
- package/src/tempo/legacy/session/Chain.ts +0 -830
- package/src/tempo/legacy/session/Channel.test.ts +0 -109
- package/src/tempo/legacy/session/Channel.ts +0 -51
- package/src/tempo/legacy/session/Types.ts +0 -91
- package/src/tempo/legacy/session/Voucher.test.ts +0 -410
- package/src/tempo/legacy/session/Voucher.ts +0 -183
- package/src/tempo/legacy/session/escrow.abi.ts +0 -760
- package/src/tempo/legacy/session/index.ts +0 -8
- package/src/tempo/server/AtomicStore.test-d.ts +0 -63
- package/src/tempo/server/Charge.test.ts +0 -6056
- package/src/tempo/server/Charge.ts +0 -1379
- package/src/tempo/server/Methods.ts +0 -86
- package/src/tempo/server/Relay.test.ts +0 -677
- package/src/tempo/server/Relay.ts +0 -297
- package/src/tempo/server/SponsorBudget.test.ts +0 -154
- package/src/tempo/server/SponsorBudget.ts +0 -219
- package/src/tempo/server/Sse.test.ts +0 -321
- package/src/tempo/server/Subscription.test.ts +0 -1944
- package/src/tempo/server/Subscription.ts +0 -1336
- package/src/tempo/server/index.ts +0 -12
- package/src/tempo/server/internal/html/main.ts +0 -115
- package/src/tempo/server/internal/html/node_modules/.bin/mppx +0 -22
- package/src/tempo/server/internal/html/node_modules/.bin/mppx.src +0 -22
- package/src/tempo/server/internal/html/package.json +0 -10
- package/src/tempo/server/internal/html/tsconfig.json +0 -8
- package/src/tempo/server/internal/html.gen.ts +0 -2
- package/src/tempo/server/internal/request-body.test.ts +0 -210
- package/src/tempo/server/internal/request-body.ts +0 -61
- package/src/tempo/server/internal/transport.test.ts +0 -922
- package/src/tempo/server/internal/transport.ts +0 -322
- package/src/tempo/session/README.md +0 -320
- package/src/tempo/session/Snapshot.test.ts +0 -41
- package/src/tempo/session/Snapshot.ts +0 -95
- package/src/tempo/session/client/ChannelOps.test.ts +0 -218
- package/src/tempo/session/client/ChannelOps.ts +0 -348
- package/src/tempo/session/client/ChannelStore.ts +0 -111
- package/src/tempo/session/client/CredentialState.test.ts +0 -789
- package/src/tempo/session/client/CredentialState.ts +0 -942
- package/src/tempo/session/client/ReceiptCoordinator.ts +0 -95
- package/src/tempo/session/client/Runtime.test.ts +0 -1104
- package/src/tempo/session/client/Runtime.ts +0 -1008
- package/src/tempo/session/client/Session.test.ts +0 -1355
- package/src/tempo/session/client/Session.ts +0 -420
- package/src/tempo/session/client/SessionManager.test.ts +0 -1899
- package/src/tempo/session/client/SessionManager.ts +0 -996
- package/src/tempo/session/client/Transports.test.ts +0 -1141
- package/src/tempo/session/client/Transports.ts +0 -1534
- package/src/tempo/session/client/index.ts +0 -40
- package/src/tempo/session/client/internal/SessionManager.ts +0 -36
- package/src/tempo/session/index.ts +0 -7
- package/src/tempo/session/precompile/Chain.integration.test.ts +0 -339
- package/src/tempo/session/precompile/Chain.test.ts +0 -1641
- package/src/tempo/session/precompile/Chain.ts +0 -1269
- package/src/tempo/session/precompile/Channel.test.ts +0 -147
- package/src/tempo/session/precompile/Channel.ts +0 -108
- package/src/tempo/session/precompile/Protocol.test.ts +0 -358
- package/src/tempo/session/precompile/Protocol.ts +0 -520
- package/src/tempo/session/precompile/Voucher.test.ts +0 -354
- package/src/tempo/session/precompile/Voucher.ts +0 -162
- package/src/tempo/session/precompile/escrow.abi.ts +0 -226
- package/src/tempo/session/precompile/index.ts +0 -33
- package/src/tempo/session/server/ChannelOps.test.ts +0 -129
- package/src/tempo/session/server/ChannelOps.ts +0 -157
- package/src/tempo/session/server/ChannelStore.test.ts +0 -1093
- package/src/tempo/session/server/ChannelStore.ts +0 -856
- package/src/tempo/session/server/CredentialVerification.test.ts +0 -299
- package/src/tempo/session/server/CredentialVerification.ts +0 -1087
- package/src/tempo/session/server/MeteredStream.ts +0 -99
- package/src/tempo/session/server/RequestState.test.ts +0 -574
- package/src/tempo/session/server/RequestState.ts +0 -507
- package/src/tempo/session/server/Session.integration.test.ts +0 -449
- package/src/tempo/session/server/Session.test.ts +0 -4247
- package/src/tempo/session/server/Session.ts +0 -669
- package/src/tempo/session/server/Settlement.test.ts +0 -345
- package/src/tempo/session/server/Settlement.ts +0 -527
- package/src/tempo/session/server/Sse.fuzz.test.ts +0 -138
- package/src/tempo/session/server/Sse.test.ts +0 -634
- package/src/tempo/session/server/Sse.ts +0 -261
- package/src/tempo/session/server/Transports.test.ts +0 -346
- package/src/tempo/session/server/Transports.ts +0 -256
- package/src/tempo/session/server/Ws.test.ts +0 -765
- package/src/tempo/session/server/Ws.ts +0 -391
- package/src/tempo/session/server/index.ts +0 -12
- package/src/tempo/subscription/KeyAuthorization.test.ts +0 -282
- package/src/tempo/subscription/KeyAuthorization.ts +0 -396
- package/src/tempo/subscription/Receipt.ts +0 -28
- package/src/tempo/subscription/Store.test.ts +0 -609
- package/src/tempo/subscription/Store.ts +0 -449
- package/src/tempo/subscription/Types.ts +0 -68
- package/src/tempo/subscription/index.ts +0 -23
- package/src/tsconfig.json +0 -10
- package/src/validation/core.ts +0 -386
- package/src/validation/index.ts +0 -11
- package/src/viem/Account.test.ts +0 -72
- package/src/viem/Account.ts +0 -30
- package/src/viem/Client.test.ts +0 -366
- package/src/viem/Client.ts +0 -93
- package/src/web-bot-auth/Constants.ts +0 -24
- package/src/web-bot-auth/Types.ts +0 -9
- package/src/web-bot-auth/WebBotAuth.test.ts +0 -182
- package/src/web-bot-auth/client/index.ts +0 -84
- package/src/web-bot-auth/index.ts +0 -6
- package/src/web-bot-auth/internal/JwkThumbprint.ts +0 -21
- package/src/web-bot-auth/internal/SignatureAgent.ts +0 -18
- package/src/web-bot-auth/server/index.ts +0 -113
- package/src/x402/Assets.test.ts +0 -253
- package/src/x402/Assets.ts +0 -221
- package/src/x402/Exact.e2e.test.ts +0 -488
- package/src/x402/Exact.localnet.test.ts +0 -475
- package/src/x402/Header.test.ts +0 -73
- package/src/x402/Header.ts +0 -79
- package/src/x402/PublicInterface.test-d.ts +0 -39
- package/src/x402/Types.ts +0 -248
- package/src/x402/client/Exact.test.ts +0 -309
- package/src/x402/client/Exact.ts +0 -186
- package/src/x402/index.ts +0 -6
- package/src/x402/internal/ChallengeBrand.ts +0 -14
- package/src/x402/internal/RouteBinding.ts +0 -18
- package/src/x402/server/EvmCharge.ts +0 -410
- package/src/x402/server/Facilitator.test.ts +0 -111
- package/src/x402/server/Facilitator.ts +0 -56
- package/src/zod.test.ts +0 -169
- package/src/zod.ts +0 -71
package/src/Errors.ts
DELETED
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
/** Default hint messages for payment errors. */
|
|
2
|
-
export const Hints = {
|
|
3
|
-
paymentRequired:
|
|
4
|
-
'Use a supported wallet to pay for this resource using one of the supported payment methods returned in the WWW-Authenticate header. See https://mpp.dev/tools/wallet.md',
|
|
5
|
-
malformedCredential:
|
|
6
|
-
'Use a supported wallet to construct valid credentials for one of the supported payment methods returned in the WWW-Authenticate header. See https://mpp.dev/tools/wallet.md',
|
|
7
|
-
methodUnsupported:
|
|
8
|
-
'Use a supported wallet to pay for this resource using one of the supported payment methods returned in the WWW-Authenticate header. See https://mpp.dev/tools/wallet.md',
|
|
9
|
-
} as const
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Base class for all payment-related errors.
|
|
13
|
-
*/
|
|
14
|
-
export abstract class PaymentError extends Error {
|
|
15
|
-
/** Safe method-specific context for diagnostics and relay responses. */
|
|
16
|
-
readonly details: Readonly<Record<string, unknown>> | undefined
|
|
17
|
-
|
|
18
|
-
/** RFC 9457 Problem Details type URI. */
|
|
19
|
-
abstract readonly type: string
|
|
20
|
-
|
|
21
|
-
/** Human-readable summary for RFC 9457 Problem Details. */
|
|
22
|
-
abstract readonly title: string
|
|
23
|
-
|
|
24
|
-
/** HTTP status code. */
|
|
25
|
-
readonly status: number = 402
|
|
26
|
-
|
|
27
|
-
/** Actionable hint for resolving the error (RFC 9457 extension member). */
|
|
28
|
-
readonly hint: string | undefined
|
|
29
|
-
|
|
30
|
-
protected constructor(message: string, options: PaymentError.Options = {}) {
|
|
31
|
-
super(message)
|
|
32
|
-
this.details = options.details
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** Converts the error to RFC 9457 Problem Details format. */
|
|
36
|
-
toProblemDetails(challengeId?: string): PaymentError.ProblemDetails {
|
|
37
|
-
return {
|
|
38
|
-
type: this.type,
|
|
39
|
-
title: this.title,
|
|
40
|
-
status: this.status,
|
|
41
|
-
detail: this.message,
|
|
42
|
-
...(this.details && Object.keys(this.details).length > 0 && { details: this.details }),
|
|
43
|
-
...(this.hint && { hint: this.hint }),
|
|
44
|
-
...(challengeId && { challengeId }),
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export declare namespace PaymentError {
|
|
50
|
-
type Options = {
|
|
51
|
-
details?: Record<string, unknown> | undefined
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
type ProblemDetails = {
|
|
55
|
-
/** RFC 9457 Problem Details type URI. */
|
|
56
|
-
type: string
|
|
57
|
-
/** Human-readable summary. */
|
|
58
|
-
title: string
|
|
59
|
-
/** HTTP status code. */
|
|
60
|
-
status: number
|
|
61
|
-
/** Human-readable explanation. */
|
|
62
|
-
detail: string
|
|
63
|
-
/** Safe method-specific diagnostic context. */
|
|
64
|
-
details?: Readonly<Record<string, unknown>>
|
|
65
|
-
/** Actionable hint for resolving the error (RFC 9457 extension member). */
|
|
66
|
-
hint?: string
|
|
67
|
-
/** Associated challenge ID, if applicable. */
|
|
68
|
-
challengeId?: string
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Credential is malformed (invalid base64url, bad JSON structure).
|
|
74
|
-
*/
|
|
75
|
-
export class MalformedCredentialError extends PaymentError {
|
|
76
|
-
override readonly name = 'MalformedCredentialError'
|
|
77
|
-
readonly title = 'Malformed Credential'
|
|
78
|
-
override readonly status = 402
|
|
79
|
-
readonly type = 'https://paymentauth.org/problems/malformed-credential'
|
|
80
|
-
override readonly hint = Hints.malformedCredential
|
|
81
|
-
|
|
82
|
-
constructor(options: MalformedCredentialError.Options = {}) {
|
|
83
|
-
const { reason } = options
|
|
84
|
-
super(reason ? `Credential is malformed: ${reason}.` : 'Credential is malformed.')
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export declare namespace MalformedCredentialError {
|
|
89
|
-
type Options = {
|
|
90
|
-
/** Reason the credential is malformed (e.g., "invalid base64url", "invalid JSON"). */
|
|
91
|
-
reason?: string
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Challenge ID is unknown, expired, or already used.
|
|
97
|
-
*/
|
|
98
|
-
export class InvalidChallengeError extends PaymentError {
|
|
99
|
-
override readonly name = 'InvalidChallengeError'
|
|
100
|
-
readonly title = 'Invalid Challenge'
|
|
101
|
-
override readonly status = 402
|
|
102
|
-
readonly type = 'https://paymentauth.org/problems/invalid-challenge'
|
|
103
|
-
|
|
104
|
-
constructor(options: InvalidChallengeError.Options = {}) {
|
|
105
|
-
const { id, reason } = options
|
|
106
|
-
const idPart = id ? ` "${id}"` : ''
|
|
107
|
-
const reasonPart = reason ? `: ${reason}` : ''
|
|
108
|
-
super(`Challenge${idPart} is invalid${reasonPart}.`)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export declare namespace InvalidChallengeError {
|
|
113
|
-
type Options = {
|
|
114
|
-
/** The invalid challenge ID. */
|
|
115
|
-
id?: string
|
|
116
|
-
/** Reason the challenge is invalid (e.g., "expired", "already used", "unknown"). */
|
|
117
|
-
reason?: string
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Payment proof is invalid or verification failed.
|
|
123
|
-
*/
|
|
124
|
-
export class VerificationFailedError extends PaymentError {
|
|
125
|
-
override readonly name = 'VerificationFailedError'
|
|
126
|
-
readonly title = 'Verification Failed'
|
|
127
|
-
readonly type = 'https://paymentauth.org/problems/verification-failed'
|
|
128
|
-
|
|
129
|
-
constructor(options: VerificationFailedError.Options = {}) {
|
|
130
|
-
const { details, reason } = options
|
|
131
|
-
super(reason ? `Payment verification failed: ${reason}.` : 'Payment verification failed.', {
|
|
132
|
-
details,
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export declare namespace VerificationFailedError {
|
|
138
|
-
type Options = {
|
|
139
|
-
/** Safe method-specific diagnostic context. */
|
|
140
|
-
details?: Record<string, unknown> | undefined
|
|
141
|
-
/** Reason verification failed (e.g., "invalid signature", "insufficient amount"). */
|
|
142
|
-
reason?: string
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Payment requires additional action (e.g., 3DS authentication).
|
|
148
|
-
*/
|
|
149
|
-
export class PaymentActionRequiredError extends PaymentError {
|
|
150
|
-
override readonly name = 'PaymentActionRequiredError'
|
|
151
|
-
readonly title = 'Payment Action Required'
|
|
152
|
-
readonly type = 'https://paymentauth.org/problems/payment-action-required'
|
|
153
|
-
|
|
154
|
-
constructor(options: PaymentActionRequiredError.Options = {}) {
|
|
155
|
-
const { reason } = options
|
|
156
|
-
super(reason ? `Payment requires action: ${reason}.` : 'Payment requires action.')
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export declare namespace PaymentActionRequiredError {
|
|
161
|
-
type Options = {
|
|
162
|
-
/** Reason action is required (e.g., "requires_action"). */
|
|
163
|
-
reason?: string
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Payment has expired.
|
|
169
|
-
*/
|
|
170
|
-
export class PaymentExpiredError extends PaymentError {
|
|
171
|
-
override readonly name = 'PaymentExpiredError'
|
|
172
|
-
readonly title = 'Payment Expired'
|
|
173
|
-
readonly type = 'https://paymentauth.org/problems/payment-expired'
|
|
174
|
-
|
|
175
|
-
constructor(options: PaymentExpiredError.Options = {}) {
|
|
176
|
-
const { expires } = options
|
|
177
|
-
super(expires ? `Payment expired at ${expires}.` : 'Payment has expired.')
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export declare namespace PaymentExpiredError {
|
|
182
|
-
type Options = {
|
|
183
|
-
/** ISO 8601 expiration timestamp. */
|
|
184
|
-
expires?: string
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* No credential was provided but payment is required.
|
|
190
|
-
*/
|
|
191
|
-
export class PaymentRequiredError extends PaymentError {
|
|
192
|
-
override readonly name = 'PaymentRequiredError'
|
|
193
|
-
readonly title = 'Payment Required'
|
|
194
|
-
readonly type = 'https://paymentauth.org/problems/payment-required'
|
|
195
|
-
override readonly hint = Hints.paymentRequired
|
|
196
|
-
|
|
197
|
-
constructor(options: PaymentRequiredError.Options = {}) {
|
|
198
|
-
const { description } = options
|
|
199
|
-
const parts = ['Payment is required']
|
|
200
|
-
if (description) parts.push(`(${description})`)
|
|
201
|
-
super(`${parts.join(' ')}.`)
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export declare namespace PaymentRequiredError {
|
|
206
|
-
type Options = {
|
|
207
|
-
/** Human-readable description of the payment. */
|
|
208
|
-
description?: string | undefined
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Credential payload does not match the expected schema.
|
|
214
|
-
*/
|
|
215
|
-
export class InvalidPayloadError extends PaymentError {
|
|
216
|
-
override readonly name = 'InvalidPayloadError'
|
|
217
|
-
readonly title = 'Invalid Payload'
|
|
218
|
-
readonly type = 'https://paymentauth.org/problems/invalid-payload'
|
|
219
|
-
|
|
220
|
-
constructor(options: InvalidPayloadError.Options = {}) {
|
|
221
|
-
const { reason } = options
|
|
222
|
-
super(reason ? `Credential payload is invalid: ${reason}.` : 'Credential payload is invalid.')
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export declare namespace InvalidPayloadError {
|
|
227
|
-
type Options = {
|
|
228
|
-
/** Reason the payload is invalid (e.g., "missing signature field"). */
|
|
229
|
-
reason?: string
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Request is malformed or contains invalid parameters.
|
|
235
|
-
*/
|
|
236
|
-
export class BadRequestError extends PaymentError {
|
|
237
|
-
override readonly name = 'BadRequestError'
|
|
238
|
-
readonly title = 'Bad Request'
|
|
239
|
-
override readonly status = 400
|
|
240
|
-
readonly type = 'https://paymentauth.org/problems/bad-request'
|
|
241
|
-
|
|
242
|
-
constructor(options: BadRequestError.Options = {}) {
|
|
243
|
-
const { reason } = options
|
|
244
|
-
super(reason ? `Bad request: ${reason}.` : 'Bad request.')
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export declare namespace BadRequestError {
|
|
249
|
-
type Options = {
|
|
250
|
-
/** Reason the request is invalid. */
|
|
251
|
-
reason?: string
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Payment amount is insufficient (too low).
|
|
257
|
-
*/
|
|
258
|
-
export class PaymentInsufficientError extends PaymentError {
|
|
259
|
-
override readonly name = 'PaymentInsufficientError'
|
|
260
|
-
readonly title = 'Payment Insufficient'
|
|
261
|
-
readonly type = 'https://paymentauth.org/problems/payment-insufficient'
|
|
262
|
-
|
|
263
|
-
constructor(options: PaymentInsufficientError.Options = {}) {
|
|
264
|
-
const { reason } = options
|
|
265
|
-
super(reason ? `Payment insufficient: ${reason}.` : 'Payment amount is insufficient.')
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
export declare namespace PaymentInsufficientError {
|
|
270
|
-
type Options = {
|
|
271
|
-
/** Reason the payment is insufficient (e.g., "expected 1000, received 500"). */
|
|
272
|
-
reason?: string
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Payment method is not supported by the server.
|
|
278
|
-
*/
|
|
279
|
-
export class PaymentMethodUnsupportedError extends PaymentError {
|
|
280
|
-
override readonly name = 'PaymentMethodUnsupportedError'
|
|
281
|
-
readonly title = 'Method Unsupported'
|
|
282
|
-
override readonly status = 400
|
|
283
|
-
readonly type = 'https://paymentauth.org/problems/method-unsupported'
|
|
284
|
-
override readonly hint = Hints.methodUnsupported
|
|
285
|
-
|
|
286
|
-
constructor(options: PaymentMethodUnsupportedError.Options = {}) {
|
|
287
|
-
const { method } = options
|
|
288
|
-
super(
|
|
289
|
-
method ? `Payment method "${method}" is not supported.` : 'Payment method is not supported.',
|
|
290
|
-
)
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export declare namespace PaymentMethodUnsupportedError {
|
|
295
|
-
type Options = {
|
|
296
|
-
/** The unsupported method identifier. */
|
|
297
|
-
method?: string
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Insufficient balance in the payment channel.
|
|
303
|
-
*/
|
|
304
|
-
export class InsufficientBalanceError extends PaymentError {
|
|
305
|
-
override readonly name = 'InsufficientBalanceError'
|
|
306
|
-
readonly title = 'Insufficient Balance'
|
|
307
|
-
override readonly status = 402
|
|
308
|
-
readonly type = 'https://paymentauth.org/problems/session/insufficient-balance'
|
|
309
|
-
|
|
310
|
-
constructor(options: InsufficientBalanceError.Options = {}) {
|
|
311
|
-
const { reason } = options
|
|
312
|
-
super(reason ? `Insufficient balance: ${reason}.` : 'Insufficient balance.')
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export declare namespace InsufficientBalanceError {
|
|
317
|
-
type Options = {
|
|
318
|
-
/** Reason for insufficient balance. */
|
|
319
|
-
reason?: string
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Voucher or close request signature is invalid.
|
|
325
|
-
*/
|
|
326
|
-
export class InvalidSignatureError extends PaymentError {
|
|
327
|
-
override readonly name = 'InvalidSignatureError'
|
|
328
|
-
readonly title = 'Invalid Signature'
|
|
329
|
-
override readonly status = 402
|
|
330
|
-
readonly type = 'https://paymentauth.org/problems/session/invalid-signature'
|
|
331
|
-
|
|
332
|
-
constructor(options: InvalidSignatureError.Options = {}) {
|
|
333
|
-
const { reason } = options
|
|
334
|
-
super(reason ? `Invalid signature: ${reason}.` : 'Invalid signature.')
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export declare namespace InvalidSignatureError {
|
|
339
|
-
type Options = {
|
|
340
|
-
reason?: string
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Recovered signer is not authorized for this channel.
|
|
346
|
-
*/
|
|
347
|
-
export class SignerMismatchError extends PaymentError {
|
|
348
|
-
override readonly name = 'SignerMismatchError'
|
|
349
|
-
readonly title = 'Signer Mismatch'
|
|
350
|
-
override readonly status = 402
|
|
351
|
-
readonly type = 'https://paymentauth.org/problems/session/signer-mismatch'
|
|
352
|
-
|
|
353
|
-
constructor(options: SignerMismatchError.Options = {}) {
|
|
354
|
-
const { reason } = options
|
|
355
|
-
super(reason ? `Signer mismatch: ${reason}.` : 'Signer is not authorized for this channel.')
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export declare namespace SignerMismatchError {
|
|
360
|
-
type Options = {
|
|
361
|
-
reason?: string
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Voucher cumulative amount exceeds the channel deposit.
|
|
367
|
-
*/
|
|
368
|
-
export class AmountExceedsDepositError extends PaymentError {
|
|
369
|
-
override readonly name = 'AmountExceedsDepositError'
|
|
370
|
-
readonly title = 'Amount Exceeds Deposit'
|
|
371
|
-
override readonly status = 402
|
|
372
|
-
readonly type = 'https://paymentauth.org/problems/session/amount-exceeds-deposit'
|
|
373
|
-
|
|
374
|
-
constructor(options: AmountExceedsDepositError.Options = {}) {
|
|
375
|
-
const { reason } = options
|
|
376
|
-
super(reason ? `Amount exceeds deposit: ${reason}.` : 'Voucher amount exceeds channel deposit.')
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
export declare namespace AmountExceedsDepositError {
|
|
381
|
-
type Options = {
|
|
382
|
-
reason?: string
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Voucher amount increase is below the minimum delta.
|
|
388
|
-
*/
|
|
389
|
-
export class DeltaTooSmallError extends PaymentError {
|
|
390
|
-
override readonly name = 'DeltaTooSmallError'
|
|
391
|
-
readonly title = 'Delta Too Small'
|
|
392
|
-
override readonly status = 402
|
|
393
|
-
readonly type = 'https://paymentauth.org/problems/session/delta-too-small'
|
|
394
|
-
|
|
395
|
-
constructor(options: DeltaTooSmallError.Options = {}) {
|
|
396
|
-
const { reason } = options
|
|
397
|
-
super(reason ? `Delta too small: ${reason}.` : 'Amount increase below minimum voucher delta.')
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
export declare namespace DeltaTooSmallError {
|
|
402
|
-
type Options = {
|
|
403
|
-
reason?: string
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* No channel with this ID exists.
|
|
409
|
-
*/
|
|
410
|
-
export class ChannelNotFoundError extends PaymentError {
|
|
411
|
-
override readonly name = 'ChannelNotFoundError'
|
|
412
|
-
readonly title = 'Channel Not Found'
|
|
413
|
-
override readonly status = 410
|
|
414
|
-
readonly type = 'https://paymentauth.org/problems/session/channel-not-found'
|
|
415
|
-
|
|
416
|
-
constructor(options: ChannelNotFoundError.Options = {}) {
|
|
417
|
-
const { reason } = options
|
|
418
|
-
super(reason ? `Channel not found: ${reason}.` : 'No channel with this ID exists.')
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
export declare namespace ChannelNotFoundError {
|
|
423
|
-
type Options = {
|
|
424
|
-
reason?: string
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Channel is closed or finalized.
|
|
430
|
-
*/
|
|
431
|
-
export class ChannelClosedError extends PaymentError {
|
|
432
|
-
override readonly name = 'ChannelClosedError'
|
|
433
|
-
readonly title = 'Channel Closed'
|
|
434
|
-
override readonly status = 410
|
|
435
|
-
readonly type = 'https://paymentauth.org/problems/session/channel-finalized'
|
|
436
|
-
|
|
437
|
-
constructor(options: ChannelClosedError.Options = {}) {
|
|
438
|
-
const { reason } = options
|
|
439
|
-
super(reason ? `Channel closed: ${reason}.` : 'Channel is closed.')
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
export declare namespace ChannelClosedError {
|
|
444
|
-
type Options = {
|
|
445
|
-
/** Reason the channel is closed. */
|
|
446
|
-
reason?: string
|
|
447
|
-
}
|
|
448
|
-
}
|
package/src/Expires.test.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, test, vi } from 'vp/test'
|
|
2
|
-
|
|
3
|
-
import * as Expires from './Expires.js'
|
|
4
|
-
|
|
5
|
-
const FIXED_NOW = new Date('2025-06-15T12:00:00.000Z').getTime()
|
|
6
|
-
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
vi.useFakeTimers()
|
|
9
|
-
vi.setSystemTime(FIXED_NOW)
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
afterEach(() => {
|
|
13
|
-
vi.useRealTimers()
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
describe('seconds', () => {
|
|
17
|
-
test('returns ISO string n seconds from now', () => {
|
|
18
|
-
expect(Expires.seconds(30)).toBe('2025-06-15T12:00:30.000Z')
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
test('0 returns current time', () => {
|
|
22
|
-
expect(Expires.seconds(0)).toBe('2025-06-15T12:00:00.000Z')
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
test('negative n returns past time', () => {
|
|
26
|
-
expect(Expires.seconds(-60)).toBe('2025-06-15T11:59:00.000Z')
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
describe('minutes', () => {
|
|
31
|
-
test('returns ISO string n minutes from now', () => {
|
|
32
|
-
expect(Expires.minutes(5)).toBe('2025-06-15T12:05:00.000Z')
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
test('0 returns current time', () => {
|
|
36
|
-
expect(Expires.minutes(0)).toBe('2025-06-15T12:00:00.000Z')
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
test('negative n returns past time', () => {
|
|
40
|
-
expect(Expires.minutes(-10)).toBe('2025-06-15T11:50:00.000Z')
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
describe('hours', () => {
|
|
45
|
-
test('returns ISO string n hours from now', () => {
|
|
46
|
-
expect(Expires.hours(2)).toBe('2025-06-15T14:00:00.000Z')
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
test('0 returns current time', () => {
|
|
50
|
-
expect(Expires.hours(0)).toBe('2025-06-15T12:00:00.000Z')
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
test('negative n returns past time', () => {
|
|
54
|
-
expect(Expires.hours(-3)).toBe('2025-06-15T09:00:00.000Z')
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
describe('days', () => {
|
|
59
|
-
test('returns ISO string n days from now', () => {
|
|
60
|
-
expect(Expires.days(1)).toBe('2025-06-16T12:00:00.000Z')
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
test('0 returns current time', () => {
|
|
64
|
-
expect(Expires.days(0)).toBe('2025-06-15T12:00:00.000Z')
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
test('negative n returns past time', () => {
|
|
68
|
-
expect(Expires.days(-2)).toBe('2025-06-13T12:00:00.000Z')
|
|
69
|
-
})
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
describe('weeks', () => {
|
|
73
|
-
test('returns ISO string n weeks from now', () => {
|
|
74
|
-
expect(Expires.weeks(1)).toBe('2025-06-22T12:00:00.000Z')
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
test('0 returns current time', () => {
|
|
78
|
-
expect(Expires.weeks(0)).toBe('2025-06-15T12:00:00.000Z')
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
test('negative n returns past time', () => {
|
|
82
|
-
expect(Expires.weeks(-1)).toBe('2025-06-08T12:00:00.000Z')
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
describe('months', () => {
|
|
87
|
-
test('returns ISO string n months (30 days) from now', () => {
|
|
88
|
-
expect(Expires.months(1)).toBe('2025-07-15T12:00:00.000Z')
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
test('0 returns current time', () => {
|
|
92
|
-
expect(Expires.months(0)).toBe('2025-06-15T12:00:00.000Z')
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
test('negative n returns past time', () => {
|
|
96
|
-
expect(Expires.months(-1)).toBe('2025-05-16T12:00:00.000Z')
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
describe('years', () => {
|
|
101
|
-
test('returns ISO string n years (365 days) from now', () => {
|
|
102
|
-
expect(Expires.years(1)).toBe('2026-06-15T12:00:00.000Z')
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
test('0 returns current time', () => {
|
|
106
|
-
expect(Expires.years(0)).toBe('2025-06-15T12:00:00.000Z')
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
test('negative n returns past time', () => {
|
|
110
|
-
expect(Expires.years(-1)).toBe('2024-06-15T12:00:00.000Z')
|
|
111
|
-
})
|
|
112
|
-
})
|
package/src/Expires.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { InvalidChallengeError, PaymentExpiredError } from './Errors.js'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Asserts that `expires` is present, well-formed, and not in the past.
|
|
5
|
-
*
|
|
6
|
-
* Throws `InvalidChallengeError` when missing or malformed,
|
|
7
|
-
* and `PaymentExpiredError` when the timestamp is in the past.
|
|
8
|
-
*/
|
|
9
|
-
export function assert(
|
|
10
|
-
expires: string | undefined,
|
|
11
|
-
challengeId?: string,
|
|
12
|
-
): asserts expires is string {
|
|
13
|
-
if (!expires)
|
|
14
|
-
throw new InvalidChallengeError({
|
|
15
|
-
...(challengeId && { id: challengeId }),
|
|
16
|
-
reason: 'missing required expires field',
|
|
17
|
-
})
|
|
18
|
-
if (Number.isNaN(new Date(expires).getTime()))
|
|
19
|
-
throw new InvalidChallengeError({
|
|
20
|
-
...(challengeId && { id: challengeId }),
|
|
21
|
-
reason: 'malformed expires timestamp',
|
|
22
|
-
})
|
|
23
|
-
if (new Date(expires) < new Date()) throw new PaymentExpiredError({ expires })
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Returns an ISO 8601 datetime string `n` days from now. */
|
|
27
|
-
export function days(n: number) {
|
|
28
|
-
return new Date(Date.now() + n * 24 * 60 * 60 * 1000).toISOString()
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Returns an ISO 8601 datetime string `n` hours from now. */
|
|
32
|
-
export function hours(n: number) {
|
|
33
|
-
return new Date(Date.now() + n * 60 * 60 * 1000).toISOString()
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** Returns an ISO 8601 datetime string `n` minutes from now. */
|
|
37
|
-
export function minutes(n: number) {
|
|
38
|
-
return new Date(Date.now() + n * 60 * 1000).toISOString()
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Returns an ISO 8601 datetime string `n` months (30 days) from now. */
|
|
42
|
-
export function months(n: number) {
|
|
43
|
-
return new Date(Date.now() + n * 30 * 24 * 60 * 60 * 1000).toISOString()
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Returns an ISO 8601 datetime string `n` seconds from now. */
|
|
47
|
-
export function seconds(n: number) {
|
|
48
|
-
return new Date(Date.now() + n * 1000).toISOString()
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** Returns an ISO 8601 datetime string `n` weeks from now. */
|
|
52
|
-
export function weeks(n: number) {
|
|
53
|
-
return new Date(Date.now() + n * 7 * 24 * 60 * 60 * 1000).toISOString()
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** Returns an ISO 8601 datetime string `n` years (365 days) from now. */
|
|
57
|
-
export function years(n: number) {
|
|
58
|
-
return new Date(Date.now() + n * 365 * 24 * 60 * 60 * 1000).toISOString()
|
|
59
|
-
}
|
package/src/Html.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Json } from 'ox'
|
|
2
|
-
|
|
3
|
-
import type * as Method from './Method.js'
|
|
4
|
-
import {
|
|
5
|
-
attrs,
|
|
6
|
-
type Config,
|
|
7
|
-
type Data,
|
|
8
|
-
ids,
|
|
9
|
-
type Text,
|
|
10
|
-
type Theme,
|
|
11
|
-
vars,
|
|
12
|
-
} from './server/internal/html/config.js'
|
|
13
|
-
import { submitCredential } from './server/internal/html/serviceWorker.client.js'
|
|
14
|
-
|
|
15
|
-
export function init<
|
|
16
|
-
method extends Method.Method = Method.Method,
|
|
17
|
-
config extends Record<string, unknown> = {},
|
|
18
|
-
>(methodName: method['name']): Context<method, config> {
|
|
19
|
-
const element = document.getElementById(ids.data)!
|
|
20
|
-
const dataMap = Json.parse(element.textContent) as Record<string, Data<method, config>>
|
|
21
|
-
|
|
22
|
-
const remaining = element.getAttribute(attrs.remaining)
|
|
23
|
-
if (!remaining || Number(remaining) <= 1) element.remove()
|
|
24
|
-
else element.setAttribute(attrs.remaining, String(Number(remaining) - 1))
|
|
25
|
-
|
|
26
|
-
const script = document.currentScript
|
|
27
|
-
const challengeId = script?.getAttribute(attrs.challengeId)
|
|
28
|
-
const data = challengeId
|
|
29
|
-
? (script!.removeAttribute(attrs.challengeId), dataMap[challengeId]!)
|
|
30
|
-
: Object.values(dataMap).find((d) => d.challenge.method === methodName)!
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
...data,
|
|
34
|
-
error(message?: string | null | undefined) {
|
|
35
|
-
if (!message) {
|
|
36
|
-
document.getElementById(ids.error)?.remove()
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
const existing = document.getElementById(ids.error)
|
|
40
|
-
if (existing) {
|
|
41
|
-
existing.textContent = message
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
const el = document.createElement('p')
|
|
45
|
-
el.id = ids.error
|
|
46
|
-
el.className = 'mppx-error'
|
|
47
|
-
el.role = 'alert'
|
|
48
|
-
el.textContent = message
|
|
49
|
-
document.getElementById(data.rootId)?.after(el)
|
|
50
|
-
},
|
|
51
|
-
root: document.getElementById(data.rootId)!,
|
|
52
|
-
submit: submitCredential,
|
|
53
|
-
vars,
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export type Context<
|
|
58
|
-
method extends Method.Method = Method.Method,
|
|
59
|
-
config extends Record<string, unknown> = {},
|
|
60
|
-
> = Data<method, config> & {
|
|
61
|
-
error: (message?: string | null | undefined) => void
|
|
62
|
-
root: HTMLElement
|
|
63
|
-
submit: (credential: string) => Promise<void>
|
|
64
|
-
vars: typeof vars
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export type { Config, Text, Theme }
|