mppx 0.8.17 → 0.8.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/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 +51 -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
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import type { Account } from 'viem'
|
|
2
|
-
import { createClient } from 'viem'
|
|
3
|
-
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'
|
|
4
|
-
import { Actions, Addresses } from 'viem/tempo'
|
|
5
|
-
import { describe, expect, test } from 'vp/test'
|
|
6
|
-
import { tempoNetwork } from '~test/config.js'
|
|
7
|
-
import { asset, chain, fundAccount, http } from '~test/tempo/viem.js'
|
|
8
|
-
|
|
9
|
-
import { resolveFeeToken } from './fee-token.js'
|
|
10
|
-
|
|
11
|
-
const isLocalnet = tempoNetwork === 'localnet'
|
|
12
|
-
|
|
13
|
-
function clientFor(account: Account) {
|
|
14
|
-
return createClient({
|
|
15
|
-
account,
|
|
16
|
-
chain,
|
|
17
|
-
transport: http(),
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function expectAddress(actual: string | undefined, expected: string) {
|
|
22
|
-
expect(actual?.toLowerCase()).toBe(expected.toLowerCase())
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function testAccount() {
|
|
26
|
-
return privateKeyToAccount(generatePrivateKey())
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
describe.runIf(isLocalnet)('resolveFeeToken', () => {
|
|
30
|
-
test('uses the funded account fee preference first', async () => {
|
|
31
|
-
const account = testAccount()
|
|
32
|
-
const client = clientFor(account)
|
|
33
|
-
await fundAccount({ address: account.address, token: asset })
|
|
34
|
-
await Actions.fee.setUserTokenSync(client, {
|
|
35
|
-
feeToken: asset,
|
|
36
|
-
token: asset,
|
|
37
|
-
} as never)
|
|
38
|
-
|
|
39
|
-
const feeToken = await resolveFeeToken({
|
|
40
|
-
account: account.address,
|
|
41
|
-
candidateTokens: [Addresses.pathUsd],
|
|
42
|
-
client,
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
expectAddress(feeToken, asset)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
test('falls through to the first funded candidate token', async () => {
|
|
49
|
-
const account = testAccount()
|
|
50
|
-
const client = clientFor(account)
|
|
51
|
-
await fundAccount({ address: account.address, token: asset })
|
|
52
|
-
|
|
53
|
-
const feeToken = await resolveFeeToken({
|
|
54
|
-
account: account.address,
|
|
55
|
-
candidateTokens: [Addresses.pathUsd, asset],
|
|
56
|
-
client,
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
expectAddress(feeToken, asset)
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
test('falls through from an unfunded account fee preference', async () => {
|
|
63
|
-
const account = testAccount()
|
|
64
|
-
const client = clientFor(account)
|
|
65
|
-
await fundAccount({ address: account.address, token: asset })
|
|
66
|
-
await Actions.fee.setUserTokenSync(client, {
|
|
67
|
-
feeToken: asset,
|
|
68
|
-
token: Addresses.pathUsd,
|
|
69
|
-
} as never)
|
|
70
|
-
|
|
71
|
-
const feeToken = await resolveFeeToken({
|
|
72
|
-
account: account.address,
|
|
73
|
-
candidateTokens: [asset],
|
|
74
|
-
client,
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
expectAddress(feeToken, asset)
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
test('prioritizes funded allowed candidates', async () => {
|
|
81
|
-
const account = testAccount()
|
|
82
|
-
const client = clientFor(account)
|
|
83
|
-
await fundAccount({ address: account.address, token: asset })
|
|
84
|
-
await fundAccount({ address: account.address, token: Addresses.pathUsd })
|
|
85
|
-
await Actions.fee.setUserTokenSync(client, {
|
|
86
|
-
feeToken: asset,
|
|
87
|
-
token: asset,
|
|
88
|
-
} as never)
|
|
89
|
-
|
|
90
|
-
const feeToken = await resolveFeeToken({
|
|
91
|
-
account: account.address,
|
|
92
|
-
allowedTokens: [Addresses.pathUsd, asset],
|
|
93
|
-
candidateTokens: [Addresses.pathUsd, asset],
|
|
94
|
-
client,
|
|
95
|
-
prioritizeCandidates: true,
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
expectAddress(feeToken, Addresses.pathUsd)
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
test('falls through prioritized candidates when pathUSD is unfunded', async () => {
|
|
102
|
-
const account = testAccount()
|
|
103
|
-
const client = clientFor(account)
|
|
104
|
-
await fundAccount({ address: account.address, token: asset })
|
|
105
|
-
|
|
106
|
-
const feeToken = await resolveFeeToken({
|
|
107
|
-
account: account.address,
|
|
108
|
-
allowedTokens: [Addresses.pathUsd, asset],
|
|
109
|
-
candidateTokens: [Addresses.pathUsd, asset],
|
|
110
|
-
client,
|
|
111
|
-
prioritizeCandidates: true,
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
expectAddress(feeToken, asset)
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
test('uses a funded chain fee token when configured', async () => {
|
|
118
|
-
const account = testAccount()
|
|
119
|
-
const client = createClient({
|
|
120
|
-
account,
|
|
121
|
-
chain: { ...chain, feeToken: asset },
|
|
122
|
-
transport: http(),
|
|
123
|
-
})
|
|
124
|
-
await fundAccount({ address: account.address, token: asset })
|
|
125
|
-
|
|
126
|
-
const feeToken = await resolveFeeToken({
|
|
127
|
-
account: account.address,
|
|
128
|
-
candidateTokens: [Addresses.pathUsd],
|
|
129
|
-
client,
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
expectAddress(feeToken, asset)
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
test('falls through from an unfunded chain fee token', async () => {
|
|
136
|
-
const account = testAccount()
|
|
137
|
-
const client = createClient({
|
|
138
|
-
account,
|
|
139
|
-
chain: { ...chain, feeToken: Addresses.pathUsd },
|
|
140
|
-
transport: http(),
|
|
141
|
-
})
|
|
142
|
-
await fundAccount({ address: account.address, token: asset })
|
|
143
|
-
|
|
144
|
-
const feeToken = await resolveFeeToken({
|
|
145
|
-
account: account.address,
|
|
146
|
-
candidateTokens: [asset],
|
|
147
|
-
client,
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
expectAddress(feeToken, asset)
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
test('falls back to the first known token when none are funded', async () => {
|
|
154
|
-
const account = testAccount()
|
|
155
|
-
const client = clientFor(account)
|
|
156
|
-
|
|
157
|
-
const feeToken = await resolveFeeToken({
|
|
158
|
-
account: account.address,
|
|
159
|
-
candidateTokens: [asset, Addresses.pathUsd],
|
|
160
|
-
client,
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
expectAddress(feeToken, asset)
|
|
164
|
-
})
|
|
165
|
-
})
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { Address, Client } from 'viem'
|
|
2
|
-
import { Actions, TokenId } from 'viem/tempo'
|
|
3
|
-
|
|
4
|
-
import * as TempoAddress from './address.js'
|
|
5
|
-
import * as defaults from './defaults.js'
|
|
6
|
-
|
|
7
|
-
function pushUnique(
|
|
8
|
-
tokens: Address[],
|
|
9
|
-
token: Address | undefined,
|
|
10
|
-
allowedTokens?: readonly Address[] | undefined,
|
|
11
|
-
) {
|
|
12
|
-
if (!token) return
|
|
13
|
-
if (
|
|
14
|
-
allowedTokens &&
|
|
15
|
-
!allowedTokens.some((allowedToken) => TempoAddress.isEqual(allowedToken, token))
|
|
16
|
-
)
|
|
17
|
-
return
|
|
18
|
-
if (tokens.some((t) => TempoAddress.isEqual(t, token))) return
|
|
19
|
-
tokens.push(token)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async function hasBalance(client: Client, account: Address, token: Address): Promise<boolean> {
|
|
23
|
-
try {
|
|
24
|
-
return (await Actions.token.getBalance(client as never, { account, token })).amount > 0n
|
|
25
|
-
} catch {
|
|
26
|
-
return false
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function getChainFeeToken(client: Client): Address | undefined {
|
|
31
|
-
const feeToken = (client.chain as { feeToken?: Address | bigint | undefined } | undefined)
|
|
32
|
-
?.feeToken
|
|
33
|
-
if (feeToken) return TokenId.toAddress(feeToken)
|
|
34
|
-
|
|
35
|
-
const chainId = client.chain?.id
|
|
36
|
-
return chainId ? defaults.currency[chainId as keyof typeof defaults.currency] : undefined
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Resolves a funded fee token from account, chain, and caller-supplied preferences.
|
|
41
|
-
*
|
|
42
|
-
* `prioritizeCandidates` checks candidate tokens before account and chain
|
|
43
|
-
* preferences. `allowedTokens` limits every preference to the caller's policy.
|
|
44
|
-
*/
|
|
45
|
-
export async function resolveFeeToken(parameters: {
|
|
46
|
-
account: Address
|
|
47
|
-
allowedTokens?: readonly Address[] | undefined
|
|
48
|
-
candidateTokens?: readonly Address[] | undefined
|
|
49
|
-
client: Client
|
|
50
|
-
prioritizeCandidates?: boolean | undefined
|
|
51
|
-
}): Promise<Address | undefined> {
|
|
52
|
-
const { account, allowedTokens, candidateTokens, client, prioritizeCandidates } = parameters
|
|
53
|
-
const tokens: Address[] = []
|
|
54
|
-
|
|
55
|
-
if (prioritizeCandidates)
|
|
56
|
-
for (const token of candidateTokens ?? []) pushUnique(tokens, token, allowedTokens)
|
|
57
|
-
|
|
58
|
-
const userToken = await Actions.fee
|
|
59
|
-
.getUserToken(client as never, { account })
|
|
60
|
-
.then((token) => token?.address as Address | undefined)
|
|
61
|
-
.catch(() => undefined)
|
|
62
|
-
pushUnique(tokens, userToken, allowedTokens)
|
|
63
|
-
pushUnique(tokens, getChainFeeToken(client), allowedTokens)
|
|
64
|
-
if (!prioritizeCandidates)
|
|
65
|
-
for (const token of candidateTokens ?? []) pushUnique(tokens, token, allowedTokens)
|
|
66
|
-
|
|
67
|
-
for (const token of tokens) {
|
|
68
|
-
if (await hasBalance(client, account, token)) return token
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return tokens[0]
|
|
72
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vp/test'
|
|
2
|
-
|
|
3
|
-
import * as Proof from './proof.js'
|
|
4
|
-
|
|
5
|
-
const parsePkhSourceCases = [
|
|
6
|
-
{
|
|
7
|
-
expected: {
|
|
8
|
-
address: '0xa5cc3c03994db5b0d9ba5e4f6d2efbd9f213b141',
|
|
9
|
-
chainId: 42431,
|
|
10
|
-
},
|
|
11
|
-
name: 'parses a valid did:pkh:eip155 source',
|
|
12
|
-
source: 'did:pkh:eip155:42431:0xa5cc3c03994db5b0d9ba5e4f6d2efbd9f213b141',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
expected: null,
|
|
16
|
-
name: 'rejects non-numeric chain ids',
|
|
17
|
-
source: 'did:pkh:eip155:not-a-number:0x1234',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
expected: null,
|
|
21
|
-
name: 'rejects leading-zero chain ids',
|
|
22
|
-
source: 'did:pkh:eip155:01:0xa5cc3c03994db5b0d9ba5e4f6d2efbd9f213b141',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
expected: null,
|
|
26
|
-
name: 'rejects unsafe integer chain ids',
|
|
27
|
-
source: 'did:pkh:eip155:9007199254740992:0xa5cc3c03994db5b0d9ba5e4f6d2efbd9f213b141',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
expected: null,
|
|
31
|
-
name: 'rejects invalid addresses',
|
|
32
|
-
source: 'did:pkh:eip155:42431:not-an-address',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
expected: null,
|
|
36
|
-
name: 'rejects extra path segments',
|
|
37
|
-
source: 'did:pkh:eip155:42431:0xAbCdEf1234567890AbCdEf1234567890AbCdEf12:extra',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
expected: null,
|
|
41
|
-
name: 'rejects unsupported namespaces',
|
|
42
|
-
source: 'did:pkh:solana:42431:0xa5cc3c03994db5b0d9ba5e4f6d2efbd9f213b141',
|
|
43
|
-
},
|
|
44
|
-
] as const
|
|
45
|
-
|
|
46
|
-
describe('Proof', () => {
|
|
47
|
-
test('types has Proof with account, challengeId and realm fields', () => {
|
|
48
|
-
expect(Proof.types).toEqual({
|
|
49
|
-
Proof: [
|
|
50
|
-
{ name: 'account', type: 'address' },
|
|
51
|
-
{ name: 'challengeId', type: 'string' },
|
|
52
|
-
{ name: 'realm', type: 'string' },
|
|
53
|
-
],
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
test('domain returns EIP-712 domain with name, version, chainId', () => {
|
|
58
|
-
const d = Proof.domain(42431)
|
|
59
|
-
expect(d).toEqual({ name: 'MPP', version: '3', chainId: 42431 })
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
test('domain uses provided chainId', () => {
|
|
63
|
-
expect(Proof.domain(1).chainId).toBe(1)
|
|
64
|
-
expect(Proof.domain(99999).chainId).toBe(99999)
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
test('message wraps account, challengeId and realm', () => {
|
|
68
|
-
expect(
|
|
69
|
-
Proof.message({
|
|
70
|
-
account: '0xAbCdEf1234567890AbCdEf1234567890AbCdEf12',
|
|
71
|
-
challengeId: 'abc123',
|
|
72
|
-
realm: 'api.example.com',
|
|
73
|
-
}),
|
|
74
|
-
).toEqual({
|
|
75
|
-
account: '0xAbCdEf1234567890AbCdEf1234567890AbCdEf12',
|
|
76
|
-
challengeId: 'abc123',
|
|
77
|
-
realm: 'api.example.com',
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
test('proofSource constructs did:pkh DID', () => {
|
|
82
|
-
expect(Proof.proofSource({ address: '0x1234567890abcdef', chainId: 42431 })).toBe(
|
|
83
|
-
'did:pkh:eip155:42431:0x1234567890abcdef',
|
|
84
|
-
)
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
test('proofSource preserves address casing', () => {
|
|
88
|
-
const address = '0xAbCdEf1234567890AbCdEf1234567890AbCdEf12'
|
|
89
|
-
expect(Proof.proofSource({ address, chainId: 1 })).toBe(`did:pkh:eip155:1:${address}`)
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
for (const { expected, name, source } of parsePkhSourceCases) {
|
|
93
|
-
test(`parsePkhSource ${name}`, () => {
|
|
94
|
-
expect(Proof.parsePkhSource(source)).toEqual(expected)
|
|
95
|
-
})
|
|
96
|
-
}
|
|
97
|
-
})
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { hashTypedData, isAddress, type Address, type Hex } from 'viem'
|
|
2
|
-
|
|
3
|
-
/** EIP-712 primary type for proof credentials. */
|
|
4
|
-
export const primaryType = 'Proof' as const
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* EIP-712 typed-data field definitions for Tempo zero-amount proof credentials.
|
|
8
|
-
*
|
|
9
|
-
* The `account` field cryptographically binds the signature to the payer
|
|
10
|
-
* wallet, so a proof signed for one account cannot be replayed against another
|
|
11
|
-
* — including across an access key that is authorized for multiple accounts.
|
|
12
|
-
*/
|
|
13
|
-
export const types = {
|
|
14
|
-
Proof: [
|
|
15
|
-
{ name: 'account', type: 'address' },
|
|
16
|
-
{ name: 'challengeId', type: 'string' },
|
|
17
|
-
{ name: 'realm', type: 'string' },
|
|
18
|
-
],
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
/** Constructs the EIP-712 domain for a proof credential. */
|
|
22
|
-
export function domain(chainId: number) {
|
|
23
|
-
return { name: 'MPP', version: '3', chainId } as const
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Constructs the EIP-712 message for a proof credential.
|
|
28
|
-
*
|
|
29
|
-
* @param parameters - Proof message parameters.
|
|
30
|
-
* @param parameters.account - Payer wallet address the proof is bound to.
|
|
31
|
-
* @param parameters.challengeId - Challenge `id` being proven.
|
|
32
|
-
* @param parameters.realm - Challenge `realm` being proven.
|
|
33
|
-
*/
|
|
34
|
-
export function message(parameters: { account: Address; challengeId: string; realm: string }) {
|
|
35
|
-
const { account, challengeId, realm } = parameters
|
|
36
|
-
return { account, challengeId, realm } as const
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Constructs the complete EIP-712 typed-data payload for a proof credential.
|
|
41
|
-
*
|
|
42
|
-
* This is the canonical, wallet-bound proof contract: signing this payload
|
|
43
|
-
* commits the signer to a specific `account`, `challengeId`, and `realm`.
|
|
44
|
-
*/
|
|
45
|
-
export function typedData(parameters: {
|
|
46
|
-
account: Address
|
|
47
|
-
chainId: number
|
|
48
|
-
challengeId: string
|
|
49
|
-
realm: string
|
|
50
|
-
}) {
|
|
51
|
-
const { account, chainId, challengeId, realm } = parameters
|
|
52
|
-
return {
|
|
53
|
-
domain: domain(chainId),
|
|
54
|
-
types,
|
|
55
|
-
primaryType,
|
|
56
|
-
message: message({ account, challengeId, realm }),
|
|
57
|
-
} as const
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** Computes the EIP-712 digest (signing payload) for a proof credential. */
|
|
61
|
-
export function hash(parameters: {
|
|
62
|
-
account: Address
|
|
63
|
-
chainId: number
|
|
64
|
-
challengeId: string
|
|
65
|
-
realm: string
|
|
66
|
-
}): Hex {
|
|
67
|
-
return hashTypedData(typedData(parameters))
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Constructs the expected `did:pkh` source DID for a proof credential. */
|
|
71
|
-
export function proofSource(parameters: { address: string; chainId: number }): string {
|
|
72
|
-
return `did:pkh:eip155:${parameters.chainId}:${parameters.address}`
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Parses a `did:pkh:eip155` source DID. */
|
|
76
|
-
export function parsePkhSource(source: string): { address: Address; chainId: number } | null {
|
|
77
|
-
const match = /^did:pkh:eip155:(0|[1-9]\d*):([^:]+)$/.exec(source)
|
|
78
|
-
if (!match) return null
|
|
79
|
-
|
|
80
|
-
const chainIdText = match[1]!
|
|
81
|
-
const address = match[2]!
|
|
82
|
-
const chainId = Number(chainIdText)
|
|
83
|
-
if (!Number.isSafeInteger(chainId)) return null
|
|
84
|
-
if (!isAddress(address)) return null
|
|
85
|
-
|
|
86
|
-
return { address: address as Address, chainId }
|
|
87
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AbiItem } from 'ox'
|
|
2
|
-
import { Abis } from 'viem/tempo'
|
|
3
|
-
|
|
4
|
-
export const approve = /*#__PURE__*/ AbiItem.getSelector(Abis.tip20, 'approve')
|
|
5
|
-
export const transfer = /*#__PURE__*/ AbiItem.getSelector(Abis.tip20, 'transfer')
|
|
6
|
-
export const transferWithMemo = /*#__PURE__*/ AbiItem.getSelector(Abis.tip20, 'transferWithMemo')
|
|
7
|
-
export const swapExactAmountOut = /*#__PURE__*/ AbiItem.getSelector(
|
|
8
|
-
Abis.stablecoinDex,
|
|
9
|
-
'swapExactAmountOut',
|
|
10
|
-
)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Account } from 'viem'
|
|
2
|
-
|
|
3
|
-
import type { ConfiguredDefaults } from '../../internal/types.js'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Request defaults for a Tempo factory.
|
|
7
|
-
*
|
|
8
|
-
* Includes only caller configuration known to be defined, plus `resolved`
|
|
9
|
-
* values that the factory creates unconditionally before returning its method.
|
|
10
|
-
* This keeps the returned handler's required request fields aligned with the
|
|
11
|
-
* values that will actually exist at runtime.
|
|
12
|
-
*/
|
|
13
|
-
export type DeriveDefaults<parameters, defaults, resolved extends object = {}> = ConfiguredDefaults<
|
|
14
|
-
parameters,
|
|
15
|
-
defaults
|
|
16
|
-
> &
|
|
17
|
-
resolved &
|
|
18
|
-
(parameters extends { account: Account | string } ? { recipient: string } : {}) &
|
|
19
|
-
(parameters extends { recipient: string } ? { recipient: string } : {})
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { type Address, createClient, custom, type Hex } from 'viem'
|
|
2
|
-
import {
|
|
3
|
-
Account as TempoAccount,
|
|
4
|
-
KeyAuthorizationManager,
|
|
5
|
-
Secp256k1,
|
|
6
|
-
Transaction,
|
|
7
|
-
} from 'viem/tempo'
|
|
8
|
-
import { beforeAll, describe, expect, test } from 'vp/test'
|
|
9
|
-
import { tempoNetwork } from '~test/config.js'
|
|
10
|
-
import { deployEscrow, openChannel } from '~test/tempo/legacy/session.js'
|
|
11
|
-
import { asset as currency, chain, http } from '~test/tempo/viem.js'
|
|
12
|
-
|
|
13
|
-
import { createOpenPayload } from './client/ChannelOps.js'
|
|
14
|
-
import { closeOnChain, settleOnChain } from './session/Chain.js'
|
|
15
|
-
import { signVoucher } from './session/Voucher.js'
|
|
16
|
-
|
|
17
|
-
const rootAccount = TempoAccount.fromSecp256k1(
|
|
18
|
-
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
|
|
19
|
-
)
|
|
20
|
-
const recipient = '0x2222222222222222222222222222222222222222' as Address
|
|
21
|
-
const isLocalnet = tempoNetwork === 'localnet'
|
|
22
|
-
|
|
23
|
-
async function createAccessKeyClient() {
|
|
24
|
-
const keyAuthorizationManager = KeyAuthorizationManager.memory()
|
|
25
|
-
const accessKey = TempoAccount.fromSecp256k1(Secp256k1.randomPrivateKey(), {
|
|
26
|
-
access: rootAccount,
|
|
27
|
-
keyAuthorizationManager,
|
|
28
|
-
})
|
|
29
|
-
const keyAuthorization = await rootAccount.signKeyAuthorization(
|
|
30
|
-
{
|
|
31
|
-
accessKeyAddress: accessKey.accessKeyAddress,
|
|
32
|
-
keyType: accessKey.keyType,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
chainId: BigInt(chain.id),
|
|
36
|
-
},
|
|
37
|
-
)
|
|
38
|
-
await keyAuthorizationManager.set(
|
|
39
|
-
{
|
|
40
|
-
accessKey: accessKey.accessKeyAddress,
|
|
41
|
-
address: rootAccount.address,
|
|
42
|
-
chainId: chain.id,
|
|
43
|
-
},
|
|
44
|
-
keyAuthorization,
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
const signedTransactions: Transaction.TransactionSerializedTempo[] = []
|
|
48
|
-
const rpcClient = createClient({ chain, transport: http() })
|
|
49
|
-
|
|
50
|
-
const client = createClient({
|
|
51
|
-
account: accessKey,
|
|
52
|
-
chain,
|
|
53
|
-
transport: custom({
|
|
54
|
-
async request({ method, params }: { method: string; params?: readonly unknown[] }) {
|
|
55
|
-
if (method === 'eth_sendRawTransaction' || method === 'eth_sendRawTransactionSync')
|
|
56
|
-
signedTransactions.push(params?.[0] as Transaction.TransactionSerializedTempo)
|
|
57
|
-
return rpcClient.request({ method, params } as never)
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
return { accessKey, client, keyAuthorization, signedTransactions }
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function expectTransactionKeyAuthorization(
|
|
66
|
-
serializedTransaction: Hex,
|
|
67
|
-
keyAuthorization: Awaited<ReturnType<typeof rootAccount.signKeyAuthorization>>,
|
|
68
|
-
) {
|
|
69
|
-
const transaction = Transaction.deserialize(
|
|
70
|
-
serializedTransaction as Transaction.TransactionSerializedTempo,
|
|
71
|
-
)
|
|
72
|
-
expect(transaction.keyAuthorization).toEqual(keyAuthorization)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async function createChannelForPayee(payee: Address, escrowContract: Address) {
|
|
76
|
-
const payer = rootAccount
|
|
77
|
-
const { channelId } = await openChannel({
|
|
78
|
-
deposit: 10_000_000n,
|
|
79
|
-
escrow: escrowContract,
|
|
80
|
-
payee,
|
|
81
|
-
payer,
|
|
82
|
-
salt: Secp256k1.randomPrivateKey(),
|
|
83
|
-
token: currency,
|
|
84
|
-
})
|
|
85
|
-
const cumulativeAmount = 1_000_000n
|
|
86
|
-
const signature = await signVoucher(
|
|
87
|
-
createClient({ account: payer, chain, transport: http() }),
|
|
88
|
-
payer,
|
|
89
|
-
{ channelId, cumulativeAmount },
|
|
90
|
-
escrowContract,
|
|
91
|
-
chain.id,
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
return { channelId, cumulativeAmount, escrowContract, signature }
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
describe.runIf(isLocalnet)('legacy Tempo session access-key authorization attachment', () => {
|
|
98
|
-
let escrowContract: Address
|
|
99
|
-
|
|
100
|
-
beforeAll(async () => {
|
|
101
|
-
escrowContract = await deployEscrow()
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
test('open signs a prepared transaction with keyAuthorization', async () => {
|
|
105
|
-
const { accessKey, client, keyAuthorization } = await createAccessKeyClient()
|
|
106
|
-
|
|
107
|
-
const { payload } = await createOpenPayload(client, accessKey, {
|
|
108
|
-
chainId: chain.id,
|
|
109
|
-
currency,
|
|
110
|
-
deposit: 5_000_000n,
|
|
111
|
-
escrowContract,
|
|
112
|
-
initialAmount: 1_000_000n,
|
|
113
|
-
payee: recipient,
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
expect(payload.action).toBe('open')
|
|
117
|
-
if (payload.action !== 'open') throw new Error('unexpected payload action')
|
|
118
|
-
expectTransactionKeyAuthorization(payload.transaction, keyAuthorization)
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
test('settle sends a prepared transaction with keyAuthorization', async () => {
|
|
122
|
-
const { accessKey, client, keyAuthorization, signedTransactions } =
|
|
123
|
-
await createAccessKeyClient()
|
|
124
|
-
const channel = await createChannelForPayee(rootAccount.address, escrowContract)
|
|
125
|
-
|
|
126
|
-
const hash = await settleOnChain(
|
|
127
|
-
client,
|
|
128
|
-
channel.escrowContract,
|
|
129
|
-
{
|
|
130
|
-
channelId: channel.channelId,
|
|
131
|
-
cumulativeAmount: channel.cumulativeAmount,
|
|
132
|
-
signature: channel.signature,
|
|
133
|
-
},
|
|
134
|
-
{ account: accessKey },
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
expect(hash).toMatch(/^0x[0-9a-f]{64}$/)
|
|
138
|
-
expect(signedTransactions).toHaveLength(1)
|
|
139
|
-
expectTransactionKeyAuthorization(signedTransactions[0]!, keyAuthorization)
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
test('close sends a prepared transaction with keyAuthorization', async () => {
|
|
143
|
-
const { accessKey, client, keyAuthorization, signedTransactions } =
|
|
144
|
-
await createAccessKeyClient()
|
|
145
|
-
const channel = await createChannelForPayee(rootAccount.address, escrowContract)
|
|
146
|
-
|
|
147
|
-
const hash = await closeOnChain(
|
|
148
|
-
client,
|
|
149
|
-
channel.escrowContract,
|
|
150
|
-
{
|
|
151
|
-
channelId: channel.channelId,
|
|
152
|
-
cumulativeAmount: channel.cumulativeAmount,
|
|
153
|
-
signature: channel.signature,
|
|
154
|
-
},
|
|
155
|
-
{ account: accessKey },
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
expect(hash).toMatch(/^0x[0-9a-f]{64}$/)
|
|
159
|
-
expect(signedTransactions).toHaveLength(1)
|
|
160
|
-
expectTransactionKeyAuthorization(signedTransactions[0]!, keyAuthorization)
|
|
161
|
-
})
|
|
162
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Tempo Legacy Session
|
|
2
|
-
|
|
3
|
-
This directory contains the retained client for the legacy smart-contract-backed
|
|
4
|
-
`tempo/session` implementation.
|
|
5
|
-
|
|
6
|
-
The default `tempo.session` implementation is TIP-1034 precompile-backed and
|
|
7
|
-
lives under `src/tempo/session/precompile`. The legacy server implementation has
|
|
8
|
-
been removed, while legacy chain, channel, voucher, and client code remains here
|
|
9
|
-
for clients migrating existing sessions.
|