mppx 0.1.0 → 0.2.0
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/README.md +1 -1
- package/dist/Challenge.d.ts +18 -18
- package/dist/Challenge.d.ts.map +1 -1
- package/dist/Challenge.js +8 -8
- package/dist/Challenge.js.map +1 -1
- package/dist/Errors.d.ts +58 -8
- package/dist/Errors.d.ts.map +1 -1
- package/dist/Errors.js +51 -9
- package/dist/Errors.js.map +1 -1
- package/dist/Method.d.ts +154 -0
- package/dist/Method.d.ts.map +1 -0
- package/dist/Method.js +81 -0
- package/dist/Method.js.map +1 -0
- package/dist/PaymentRequest.d.ts +5 -5
- package/dist/PaymentRequest.d.ts.map +1 -1
- package/dist/PaymentRequest.js +5 -5
- package/dist/cli.js +67 -18
- package/dist/cli.js.map +1 -1
- package/dist/client/Methods.d.ts +2 -2
- package/dist/client/Methods.d.ts.map +1 -1
- package/dist/client/Methods.js +2 -2
- package/dist/client/Methods.js.map +1 -1
- package/dist/client/Mppx.d.ts +12 -7
- package/dist/client/Mppx.d.ts.map +1 -1
- package/dist/client/Mppx.js +10 -5
- package/dist/client/Mppx.js.map +1 -1
- package/dist/client/internal/Fetch.d.ts +13 -11
- package/dist/client/internal/Fetch.d.ts.map +1 -1
- package/dist/client/internal/Fetch.js +8 -4
- package/dist/client/internal/Fetch.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-sdk/client/McpClient.d.ts +6 -6
- package/dist/mcp-sdk/client/McpClient.d.ts.map +1 -1
- package/dist/mcp-sdk/client/McpClient.js +4 -4
- package/dist/mcp-sdk/client/McpClient.js.map +1 -1
- package/dist/middlewares/elysia.d.ts +1 -1
- package/dist/middlewares/express.d.ts +1 -1
- package/dist/middlewares/hono.d.ts +1 -1
- package/dist/middlewares/internal/mppx.d.ts +7 -7
- package/dist/middlewares/internal/mppx.d.ts.map +1 -1
- package/dist/middlewares/internal/mppx.js +5 -5
- package/dist/middlewares/internal/mppx.js.map +1 -1
- package/dist/middlewares/nextjs.d.ts +1 -1
- package/dist/proxy/Service.js +2 -2
- package/dist/proxy/Service.js.map +1 -1
- package/dist/server/Methods.d.ts +2 -2
- package/dist/server/Methods.d.ts.map +1 -1
- package/dist/server/Methods.js +2 -2
- package/dist/server/Methods.js.map +1 -1
- package/dist/server/Mppx.d.ts +17 -17
- package/dist/server/Mppx.d.ts.map +1 -1
- package/dist/server/Mppx.js +9 -9
- package/dist/server/Mppx.js.map +1 -1
- package/dist/stripe/{Intents.d.ts → Methods.d.ts} +22 -22
- package/dist/stripe/Methods.d.ts.map +1 -0
- package/dist/stripe/Methods.js +42 -0
- package/dist/stripe/Methods.js.map +1 -0
- package/dist/stripe/client/Charge.d.ts +48 -44
- package/dist/stripe/client/Charge.d.ts.map +1 -1
- package/dist/stripe/client/Charge.js +22 -17
- package/dist/stripe/client/Charge.js.map +1 -1
- package/dist/stripe/client/{MethodIntents.d.ts → Methods.d.ts} +25 -24
- package/dist/stripe/client/Methods.d.ts.map +1 -0
- package/dist/stripe/client/{MethodIntents.js → Methods.js} +4 -4
- package/dist/stripe/client/Methods.js.map +1 -0
- package/dist/stripe/client/index.d.ts +1 -1
- package/dist/stripe/client/index.d.ts.map +1 -1
- package/dist/stripe/client/index.js +1 -1
- package/dist/stripe/client/index.js.map +1 -1
- package/dist/stripe/index.d.ts +1 -1
- package/dist/stripe/index.d.ts.map +1 -1
- package/dist/stripe/index.js +1 -1
- package/dist/stripe/index.js.map +1 -1
- package/dist/stripe/internal/types.d.ts +25 -0
- package/dist/stripe/internal/types.d.ts.map +1 -0
- package/dist/stripe/internal/types.js +2 -0
- package/dist/stripe/internal/types.js.map +1 -0
- package/dist/stripe/server/Charge.d.ts +47 -28
- package/dist/stripe/server/Charge.d.ts.map +1 -1
- package/dist/stripe/server/Charge.js +90 -32
- package/dist/stripe/server/Charge.js.map +1 -1
- package/dist/stripe/server/{MethodIntents.d.ts → Methods.d.ts} +24 -23
- package/dist/stripe/server/Methods.d.ts.map +1 -0
- package/dist/stripe/server/{MethodIntents.js → Methods.js} +3 -3
- package/dist/stripe/server/Methods.js.map +1 -0
- package/dist/stripe/server/index.d.ts +1 -1
- package/dist/stripe/server/index.d.ts.map +1 -1
- package/dist/stripe/server/index.js +1 -1
- package/dist/stripe/server/index.js.map +1 -1
- package/dist/tempo/{Intents.d.ts → Methods.d.ts} +72 -69
- package/dist/tempo/Methods.d.ts.map +1 -0
- package/dist/tempo/Methods.js +118 -0
- package/dist/tempo/Methods.js.map +1 -0
- package/dist/tempo/client/ChannelOps.d.ts +1 -1
- package/dist/tempo/client/ChannelOps.js +1 -1
- package/dist/tempo/client/Charge.d.ts +25 -25
- package/dist/tempo/client/Charge.d.ts.map +1 -1
- package/dist/tempo/client/Charge.js +3 -3
- package/dist/tempo/client/Charge.js.map +1 -1
- package/dist/tempo/client/{MethodIntents.d.ts → Methods.d.ts} +74 -70
- package/dist/tempo/client/Methods.d.ts.map +1 -0
- package/dist/tempo/client/{MethodIntents.js → Methods.js} +3 -3
- package/dist/tempo/client/Methods.js.map +1 -0
- package/dist/tempo/client/Session.d.ts +49 -45
- package/dist/tempo/client/Session.d.ts.map +1 -1
- package/dist/tempo/client/Session.js +4 -4
- package/dist/tempo/client/Session.js.map +1 -1
- package/dist/tempo/client/SessionManager.d.ts +1 -1
- package/dist/tempo/client/SessionManager.d.ts.map +1 -1
- package/dist/tempo/client/SessionManager.js +10 -5
- package/dist/tempo/client/SessionManager.js.map +1 -1
- package/dist/tempo/client/index.d.ts +1 -1
- package/dist/tempo/client/index.d.ts.map +1 -1
- package/dist/tempo/client/index.js +1 -1
- package/dist/tempo/client/index.js.map +1 -1
- package/dist/tempo/index.d.ts +1 -1
- package/dist/tempo/index.d.ts.map +1 -1
- package/dist/tempo/index.js +1 -1
- package/dist/tempo/index.js.map +1 -1
- package/dist/tempo/internal/defaults.d.ts +1 -1
- package/dist/tempo/internal/defaults.js +1 -1
- package/dist/tempo/server/Charge.d.ts +27 -27
- package/dist/tempo/server/Charge.d.ts.map +1 -1
- package/dist/tempo/server/Charge.js +3 -3
- package/dist/tempo/server/Charge.js.map +1 -1
- package/dist/tempo/server/{MethodIntents.d.ts → Methods.d.ts} +73 -69
- package/dist/tempo/server/Methods.d.ts.map +1 -0
- package/dist/tempo/server/{MethodIntents.js → Methods.js} +4 -4
- package/dist/tempo/server/Methods.js.map +1 -0
- package/dist/tempo/server/Session.d.ts +51 -47
- package/dist/tempo/server/Session.d.ts.map +1 -1
- package/dist/tempo/server/Session.js +4 -4
- package/dist/tempo/server/Session.js.map +1 -1
- package/dist/tempo/server/index.d.ts +6 -0
- package/dist/tempo/server/index.d.ts.map +1 -0
- package/dist/tempo/server/index.js +6 -0
- package/dist/tempo/server/index.js.map +1 -0
- package/dist/tempo/server/internal/transport.d.ts.map +1 -1
- package/dist/tempo/server/internal/transport.js +2 -1
- package/dist/tempo/server/internal/transport.js.map +1 -1
- package/package.json +1 -1
- package/src/Challenge.test-d.ts +3 -3
- package/src/Challenge.test.ts +6 -6
- package/src/Challenge.ts +34 -34
- package/src/Errors.test.ts +75 -21
- package/src/Errors.ts +74 -9
- package/src/Method.test.ts +76 -0
- package/src/Method.ts +228 -0
- package/src/PaymentRequest.test.ts +4 -4
- package/src/PaymentRequest.ts +9 -9
- package/src/cli.test.ts +12 -22
- package/src/cli.ts +74 -21
- package/src/client/Methods.ts +2 -2
- package/src/client/Mppx.test-d.ts +6 -6
- package/src/client/Mppx.test.ts +26 -22
- package/src/client/Mppx.ts +29 -13
- package/src/client/Transport.test.ts +2 -2
- package/src/client/internal/Fetch.test.ts +35 -1
- package/src/client/internal/Fetch.ts +36 -27
- package/src/index.ts +1 -2
- package/src/mcp-sdk/client/McpClient.ts +11 -13
- package/src/middlewares/elysia.ts +1 -1
- package/src/middlewares/express.ts +1 -1
- package/src/middlewares/hono.ts +1 -1
- package/src/middlewares/internal/mppx.ts +10 -10
- package/src/middlewares/nextjs.ts +1 -1
- package/src/proxy/Service.ts +2 -2
- package/src/server/Methods.ts +2 -2
- package/src/server/Mppx.test-d.ts +27 -29
- package/src/server/Mppx.test.ts +23 -19
- package/src/server/Mppx.ts +43 -43
- package/src/server/Transport.test.ts +3 -3
- package/src/stripe/Charge.integration.test.ts +4 -1
- package/src/stripe/{Intents.test.ts → Methods.test.ts} +12 -12
- package/src/stripe/Methods.ts +45 -0
- package/src/stripe/client/Charge.test.ts +189 -0
- package/src/stripe/client/Charge.ts +40 -31
- package/src/stripe/client/{MethodIntents.ts → Methods.ts} +3 -3
- package/src/stripe/client/index.ts +1 -1
- package/src/stripe/index.ts +1 -1
- package/src/stripe/internal/types.ts +22 -0
- package/src/stripe/server/Charge.test.ts +241 -0
- package/src/stripe/server/Charge.ts +124 -38
- package/src/stripe/server/{MethodIntents.ts → Methods.ts} +2 -2
- package/src/stripe/server/index.ts +1 -1
- package/src/tempo/{Intents.test.ts → Methods.test.ts} +15 -15
- package/src/tempo/{Intents.ts → Methods.ts} +77 -22
- package/src/tempo/client/ChannelOps.ts +1 -1
- package/src/tempo/client/Charge.ts +3 -3
- package/src/tempo/client/{MethodIntents.ts → Methods.ts} +2 -2
- package/src/tempo/client/Session.ts +4 -4
- package/src/tempo/client/SessionManager.ts +11 -5
- package/src/tempo/client/index.ts +1 -1
- package/src/tempo/index.ts +1 -1
- package/src/tempo/internal/defaults.ts +1 -1
- package/src/tempo/server/Charge.ts +4 -7
- package/src/tempo/server/{MethodIntents.ts → Methods.ts} +3 -3
- package/src/tempo/server/Session.test.ts +4 -7
- package/src/tempo/server/Session.ts +6 -6
- package/src/tempo/server/index.ts +1 -1
- package/src/tempo/server/internal/transport.ts +3 -2
- package/dist/Intent.d.ts +0 -101
- package/dist/Intent.d.ts.map +0 -1
- package/dist/Intent.js +0 -83
- package/dist/Intent.js.map +0 -1
- package/dist/MethodIntent.d.ts +0 -225
- package/dist/MethodIntent.d.ts.map +0 -1
- package/dist/MethodIntent.js +0 -156
- package/dist/MethodIntent.js.map +0 -1
- package/dist/stripe/Intents.d.ts.map +0 -1
- package/dist/stripe/Intents.js +0 -27
- package/dist/stripe/Intents.js.map +0 -1
- package/dist/stripe/client/MethodIntents.d.ts.map +0 -1
- package/dist/stripe/client/MethodIntents.js.map +0 -1
- package/dist/stripe/server/MethodIntents.d.ts.map +0 -1
- package/dist/stripe/server/MethodIntents.js.map +0 -1
- package/dist/tempo/Intents.d.ts.map +0 -1
- package/dist/tempo/Intents.js +0 -81
- package/dist/tempo/Intents.js.map +0 -1
- package/dist/tempo/client/MethodIntents.d.ts.map +0 -1
- package/dist/tempo/client/MethodIntents.js.map +0 -1
- package/dist/tempo/server/MethodIntents.d.ts.map +0 -1
- package/dist/tempo/server/MethodIntents.js.map +0 -1
- package/src/Intent.test.ts +0 -180
- package/src/Intent.ts +0 -109
- package/src/MethodIntent.test.ts +0 -303
- package/src/MethodIntent.ts +0 -388
- package/src/stripe/Intents.ts +0 -27
|
@@ -10,12 +10,12 @@ import { tempo as tempo_chain } from 'viem/chains'
|
|
|
10
10
|
import { Abis, Transaction } from 'viem/tempo'
|
|
11
11
|
import { PaymentExpiredError } from '../../Errors.js'
|
|
12
12
|
import type { LooseOmit } from '../../internal/types.js'
|
|
13
|
-
import * as
|
|
13
|
+
import * as Method from '../../Method.js'
|
|
14
14
|
import * as Client from '../../viem/Client.js'
|
|
15
|
-
import * as Intents from '../Intents.js'
|
|
16
15
|
import * as Account from '../internal/account.js'
|
|
17
16
|
import * as defaults from '../internal/defaults.js'
|
|
18
17
|
import type * as types from '../internal/types.js'
|
|
18
|
+
import * as Methods from '../Methods.js'
|
|
19
19
|
|
|
20
20
|
const transferSelector = /*#__PURE__*/ toFunctionSelector(
|
|
21
21
|
'function transfer(address to, uint256 amount)',
|
|
@@ -56,7 +56,7 @@ export function charge<const parameters extends charge.Parameters>(
|
|
|
56
56
|
})
|
|
57
57
|
|
|
58
58
|
type Defaults = charge.DeriveDefaults<parameters>
|
|
59
|
-
return
|
|
59
|
+
return Method.toServer<typeof Methods.charge, Defaults>(Methods.charge, {
|
|
60
60
|
defaults: {
|
|
61
61
|
amount,
|
|
62
62
|
currency,
|
|
@@ -265,10 +265,7 @@ export function charge<const parameters extends charge.Parameters>(
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
export declare namespace charge {
|
|
268
|
-
type Defaults = LooseOmit<
|
|
269
|
-
MethodIntent.RequestDefaults<typeof Intents.charge>,
|
|
270
|
-
'feePayer' | 'recipient'
|
|
271
|
-
>
|
|
268
|
+
type Defaults = LooseOmit<Method.RequestDefaults<typeof Methods.charge>, 'feePayer' | 'recipient'>
|
|
272
269
|
|
|
273
270
|
type Parameters = {
|
|
274
271
|
/** Testnet mode. */
|
|
@@ -2,7 +2,7 @@ import { charge as charge_ } from './Charge.js'
|
|
|
2
2
|
import { session as session_, settle as settle_ } from './Session.js'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Creates both Tempo `charge` and `session`
|
|
5
|
+
* Creates both Tempo `charge` and `session` methods from shared parameters.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
@@ -20,9 +20,9 @@ export function tempo<const parameters extends tempo.Parameters>(parameters?: pa
|
|
|
20
20
|
export namespace tempo {
|
|
21
21
|
export type Parameters = charge_.Parameters & session_.Parameters
|
|
22
22
|
|
|
23
|
-
/** Creates a Tempo `charge` method
|
|
23
|
+
/** Creates a Tempo `charge` method for one-time TIP-20 token transfers. */
|
|
24
24
|
export const charge = charge_
|
|
25
|
-
/** Creates a Tempo `session` method
|
|
25
|
+
/** Creates a Tempo `session` method for session-based TIP-20 token payments. */
|
|
26
26
|
export const session = session_
|
|
27
27
|
/** One-shot settle: reads highest voucher from storage and submits on-chain. */
|
|
28
28
|
export const settle = settle_
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Challenge, z } from 'mppx'
|
|
1
2
|
import { Mppx as Mppx_server, tempo as tempo_server } from 'mppx/server'
|
|
2
3
|
import { type Address, createClient, type Hex } from 'viem'
|
|
3
4
|
import { Addresses } from 'viem/tempo'
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
InvalidSignatureError,
|
|
17
18
|
} from '../../Errors.js'
|
|
18
19
|
import * as Store from '../../Store.js'
|
|
20
|
+
import type * as Methods from '../Methods.js'
|
|
19
21
|
import * as ChannelStore from '../stream/ChannelStore.js'
|
|
20
22
|
import type { StreamReceipt } from '../stream/Types.js'
|
|
21
23
|
import { signVoucher } from '../stream/Voucher.js'
|
|
@@ -1295,18 +1297,13 @@ function makeChallenge(opts: { id?: string; channelId: Hex }) {
|
|
|
1295
1297
|
amount: '1000000',
|
|
1296
1298
|
unitType: 'token',
|
|
1297
1299
|
currency: currency as string,
|
|
1298
|
-
decimals: 6,
|
|
1299
1300
|
recipient: recipient as string,
|
|
1300
|
-
suggestedDeposit: undefined as string | undefined,
|
|
1301
1301
|
methodDetails: {
|
|
1302
1302
|
escrowContract: escrowContract as string,
|
|
1303
|
-
|
|
1304
|
-
minVoucherDelta: undefined as string | undefined,
|
|
1305
|
-
chainId: chain.id as number | undefined,
|
|
1306
|
-
feePayer: undefined as boolean | undefined,
|
|
1303
|
+
chainId: chain.id,
|
|
1307
1304
|
},
|
|
1308
1305
|
},
|
|
1309
|
-
}
|
|
1306
|
+
} as Challenge.Challenge<z.output<typeof Methods.session.schema.request>, 'session', 'tempo'>
|
|
1310
1307
|
}
|
|
1311
1308
|
|
|
1312
1309
|
function makeRequest() {
|
|
@@ -30,13 +30,13 @@ import {
|
|
|
30
30
|
} from '../../Errors.js'
|
|
31
31
|
import type { Challenge, Credential } from '../../index.js'
|
|
32
32
|
import type { LooseOmit } from '../../internal/types.js'
|
|
33
|
-
import * as
|
|
33
|
+
import * as Method from '../../Method.js'
|
|
34
34
|
import * as Store from '../../Store.js'
|
|
35
35
|
import * as Client from '../../viem/Client.js'
|
|
36
|
-
import * as Intents from '../Intents.js'
|
|
37
36
|
import * as Account from '../internal/account.js'
|
|
38
37
|
import * as defaults from '../internal/defaults.js'
|
|
39
38
|
import type * as types from '../internal/types.js'
|
|
39
|
+
import * as Methods from '../Methods.js'
|
|
40
40
|
import {
|
|
41
41
|
broadcastOpenTransaction,
|
|
42
42
|
broadcastTopUpTransaction,
|
|
@@ -51,7 +51,7 @@ import type { SignedVoucher, StreamCredentialPayload, StreamReceipt } from '../s
|
|
|
51
51
|
import { parseVoucherFromPayload, verifyVoucher } from '../stream/Voucher.js'
|
|
52
52
|
import * as Transport from './internal/transport.js'
|
|
53
53
|
|
|
54
|
-
/** Challenge methodDetails shape for stream
|
|
54
|
+
/** Challenge methodDetails shape for stream methods. */
|
|
55
55
|
type StreamMethodDetails = {
|
|
56
56
|
escrowContract: Address
|
|
57
57
|
chainId: number
|
|
@@ -61,7 +61,7 @@ type StreamMethodDetails = {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Creates a stream payment server using the
|
|
64
|
+
* Creates a stream payment server using the Method.toServer() pattern.
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* ```ts
|
|
@@ -110,7 +110,7 @@ export function session<const parameters extends session.Parameters>(p?: paramet
|
|
|
110
110
|
: undefined
|
|
111
111
|
|
|
112
112
|
type Defaults = session.DeriveDefaults<parameters>
|
|
113
|
-
return
|
|
113
|
+
return Method.toServer<typeof Methods.session, Defaults, Transport>(Methods.session, {
|
|
114
114
|
defaults: {
|
|
115
115
|
amount,
|
|
116
116
|
currency,
|
|
@@ -266,7 +266,7 @@ export function session<const parameters extends session.Parameters>(p?: paramet
|
|
|
266
266
|
|
|
267
267
|
export declare namespace session {
|
|
268
268
|
type Defaults = LooseOmit<
|
|
269
|
-
|
|
269
|
+
Method.RequestDefaults<typeof Methods.session>,
|
|
270
270
|
'feePayer' | 'recipient'
|
|
271
271
|
>
|
|
272
272
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as ChannelStore from '../stream/ChannelStore.js'
|
|
2
2
|
export * as Sse from '../stream/Sse.js'
|
|
3
3
|
export { charge } from './Charge.js'
|
|
4
|
-
export { tempo } from './
|
|
4
|
+
export { tempo } from './Methods.js'
|
|
5
5
|
export { session, settle } from './Session.js'
|
|
@@ -33,7 +33,7 @@ export function sse(options: sse.Options & { store: ChannelStore.ChannelStore })
|
|
|
33
33
|
return store
|
|
34
34
|
})()
|
|
35
35
|
|
|
36
|
-
const contextMap = new Map<string, Sse_core.fromRequest.Context>()
|
|
36
|
+
const contextMap = new Map<string, Sse_core.fromRequest.Context & { signal?: AbortSignal }>()
|
|
37
37
|
|
|
38
38
|
const base = Transport.http()
|
|
39
39
|
return Transport.from<Request, Response, Transport.ReceiptResponseOf<Sse>, Response>({
|
|
@@ -44,7 +44,7 @@ export function sse(options: sse.Options & { store: ChannelStore.ChannelStore })
|
|
|
44
44
|
if (credential) {
|
|
45
45
|
try {
|
|
46
46
|
const ctx = Sse_core.fromRequest(request)
|
|
47
|
-
contextMap.set(ctx.challengeId, ctx)
|
|
47
|
+
contextMap.set(ctx.challengeId, { ...ctx, signal: request.signal })
|
|
48
48
|
} catch {
|
|
49
49
|
// ignore — non-SSE credentials won't have stream context
|
|
50
50
|
}
|
|
@@ -84,6 +84,7 @@ export function sse(options: sse.Options & { store: ChannelStore.ChannelStore })
|
|
|
84
84
|
tickCost: ctx.tickCost,
|
|
85
85
|
pollIntervalMs: pollingInterval,
|
|
86
86
|
generate,
|
|
87
|
+
signal: ctx.signal,
|
|
87
88
|
})
|
|
88
89
|
return Sse_core.toResponse(stream)
|
|
89
90
|
}
|
package/dist/Intent.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import * as z from './zod.js';
|
|
2
|
-
/**
|
|
3
|
-
* A payment intent.
|
|
4
|
-
*/
|
|
5
|
-
export type Intent = {
|
|
6
|
-
name: string;
|
|
7
|
-
schema: {
|
|
8
|
-
request: z.z.ZodMiniObject | z.z.ZodMiniPipe<z.z.ZodMiniObject>;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Creates an intent.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* import { z } from 'mppx'
|
|
17
|
-
*
|
|
18
|
-
* const charge = Intent.from({
|
|
19
|
-
* name: 'charge',
|
|
20
|
-
* schema: {
|
|
21
|
-
* request: z.object({
|
|
22
|
-
* amount: z.string(),
|
|
23
|
-
* currency: z.string(),
|
|
24
|
-
* recipient: z.optional(z.string()),
|
|
25
|
-
* }),
|
|
26
|
-
* },
|
|
27
|
-
* })
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare function from<const intent extends Intent>(intent: intent): intent;
|
|
31
|
-
/**
|
|
32
|
-
* Charge intent for one-time immediate payments.
|
|
33
|
-
*
|
|
34
|
-
* @see https://github.com/tempoxyz/payment-auth-spec/blob/main/specs/intents/draft-payment-intent-charge-00.md
|
|
35
|
-
*/
|
|
36
|
-
export declare const charge: {
|
|
37
|
-
readonly name: "charge";
|
|
38
|
-
readonly schema: {
|
|
39
|
-
readonly request: z.ZodMiniPipe<z.ZodMiniObject<{
|
|
40
|
-
amount: z.ZodMiniString<string>;
|
|
41
|
-
currency: z.ZodMiniString<string>;
|
|
42
|
-
decimals: z.ZodMiniNumber<number>;
|
|
43
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
44
|
-
expires: z.ZodMiniDefault<z.ZodMiniString<string>>;
|
|
45
|
-
externalId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
46
|
-
recipient: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
47
|
-
}, z.core.$strip>, z.ZodMiniTransform<{
|
|
48
|
-
amount: string;
|
|
49
|
-
currency: string;
|
|
50
|
-
expires: string;
|
|
51
|
-
description?: string | undefined;
|
|
52
|
-
externalId?: string | undefined;
|
|
53
|
-
recipient?: string | undefined;
|
|
54
|
-
}, {
|
|
55
|
-
amount: string;
|
|
56
|
-
currency: string;
|
|
57
|
-
decimals: number;
|
|
58
|
-
expires: string;
|
|
59
|
-
description?: string | undefined;
|
|
60
|
-
externalId?: string | undefined;
|
|
61
|
-
recipient?: string | undefined;
|
|
62
|
-
}>>;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Session intent for pay-as-you-go streaming payments.
|
|
67
|
-
*
|
|
68
|
-
* Uses cumulative vouchers over a payment channel for
|
|
69
|
-
* incremental micropayments without per-request transactions.
|
|
70
|
-
*/
|
|
71
|
-
export declare const session: {
|
|
72
|
-
readonly name: "session";
|
|
73
|
-
readonly schema: {
|
|
74
|
-
readonly request: z.ZodMiniPipe<z.ZodMiniObject<{
|
|
75
|
-
amount: z.ZodMiniString<string>;
|
|
76
|
-
unitType: z.ZodMiniString<string>;
|
|
77
|
-
currency: z.ZodMiniString<string>;
|
|
78
|
-
decimals: z.ZodMiniNumber<number>;
|
|
79
|
-
recipient: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
80
|
-
suggestedDeposit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
81
|
-
}, z.core.$strip>, z.ZodMiniTransform<{
|
|
82
|
-
suggestedDeposit?: string | undefined;
|
|
83
|
-
amount: string;
|
|
84
|
-
unitType: string;
|
|
85
|
-
currency: string;
|
|
86
|
-
recipient?: string | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
amount: string;
|
|
89
|
-
unitType: string;
|
|
90
|
-
currency: string;
|
|
91
|
-
decimals: number;
|
|
92
|
-
recipient?: string | undefined;
|
|
93
|
-
suggestedDeposit?: string | undefined;
|
|
94
|
-
}>>;
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
/** @internal Extracts shape from an intent's request schema, supporting both object and pipe. */
|
|
98
|
-
export type ShapeOf<intent extends Intent> = intent['schema']['request'] extends z.z.ZodMiniObject ? intent['schema']['request']['shape'] : intent['schema']['request'] extends z.z.ZodMiniPipe<infer A> ? A extends z.z.ZodMiniObject ? A['shape'] : never : never;
|
|
99
|
-
/** @internal Extracts the inner object from a pipe or returns the schema directly. */
|
|
100
|
-
export declare function shapeOf(intent: Intent): Record<string, z.z.ZodMiniType>;
|
|
101
|
-
//# sourceMappingURL=Intent.d.ts.map
|
package/dist/Intent.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Intent.d.ts","sourceRoot":"","sources":["../src/Intent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAA;KAChE,CAAA;CACF,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,CAAC,KAAK,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBjB,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;CAqBlB,CAAA;AAEF,iGAAiG;AACjG,MAAM,MAAM,OAAO,CAAC,MAAM,SAAS,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,GAC9F,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GACpC,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAC1D,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,GACzB,CAAC,CAAC,OAAO,CAAC,GACV,KAAK,GACP,KAAK,CAAA;AAEX,sFAAsF;AACtF,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAIvE"}
|
package/dist/Intent.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { parseUnits } from 'viem';
|
|
2
|
-
import * as Expires from './Expires.js';
|
|
3
|
-
import * as z from './zod.js';
|
|
4
|
-
/**
|
|
5
|
-
* Creates an intent.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* import { z } from 'mppx'
|
|
10
|
-
*
|
|
11
|
-
* const charge = Intent.from({
|
|
12
|
-
* name: 'charge',
|
|
13
|
-
* schema: {
|
|
14
|
-
* request: z.object({
|
|
15
|
-
* amount: z.string(),
|
|
16
|
-
* currency: z.string(),
|
|
17
|
-
* recipient: z.optional(z.string()),
|
|
18
|
-
* }),
|
|
19
|
-
* },
|
|
20
|
-
* })
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export function from(intent) {
|
|
24
|
-
return intent;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Charge intent for one-time immediate payments.
|
|
28
|
-
*
|
|
29
|
-
* @see https://github.com/tempoxyz/payment-auth-spec/blob/main/specs/intents/draft-payment-intent-charge-00.md
|
|
30
|
-
*/
|
|
31
|
-
export const charge = from({
|
|
32
|
-
name: 'charge',
|
|
33
|
-
schema: {
|
|
34
|
-
request: z.pipe(z.object({
|
|
35
|
-
amount: z.amount(),
|
|
36
|
-
currency: z.string(),
|
|
37
|
-
decimals: z.number(),
|
|
38
|
-
description: z.optional(z.string()),
|
|
39
|
-
expires: z._default(z.datetime(), () => Expires.minutes(5)),
|
|
40
|
-
externalId: z.optional(z.string()),
|
|
41
|
-
recipient: z.optional(z.string()),
|
|
42
|
-
}),
|
|
43
|
-
// Note: Since the spec states we must have `amount` as a base unit, we
|
|
44
|
-
// will transform the amount to decimal units based on `decimals`.
|
|
45
|
-
z.transform(({ amount, decimals, ...rest }) => ({
|
|
46
|
-
...rest,
|
|
47
|
-
amount: parseUnits(amount, decimals).toString(),
|
|
48
|
-
}))),
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
/**
|
|
52
|
-
* Session intent for pay-as-you-go streaming payments.
|
|
53
|
-
*
|
|
54
|
-
* Uses cumulative vouchers over a payment channel for
|
|
55
|
-
* incremental micropayments without per-request transactions.
|
|
56
|
-
*/
|
|
57
|
-
export const session = from({
|
|
58
|
-
name: 'session',
|
|
59
|
-
schema: {
|
|
60
|
-
request: z.pipe(z.object({
|
|
61
|
-
amount: z.amount(),
|
|
62
|
-
unitType: z.string(),
|
|
63
|
-
currency: z.string(),
|
|
64
|
-
decimals: z.number(),
|
|
65
|
-
recipient: z.optional(z.string()),
|
|
66
|
-
suggestedDeposit: z.optional(z.amount()),
|
|
67
|
-
}), z.transform(({ amount, decimals, suggestedDeposit, ...rest }) => ({
|
|
68
|
-
...rest,
|
|
69
|
-
amount: parseUnits(amount, decimals).toString(),
|
|
70
|
-
...(suggestedDeposit
|
|
71
|
-
? { suggestedDeposit: parseUnits(suggestedDeposit, decimals).toString() }
|
|
72
|
-
: {}),
|
|
73
|
-
}))),
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
/** @internal Extracts the inner object from a pipe or returns the schema directly. */
|
|
77
|
-
export function shapeOf(intent) {
|
|
78
|
-
const { request } = intent.schema;
|
|
79
|
-
if ('shape' in request)
|
|
80
|
-
return request.shape;
|
|
81
|
-
return request._zod.def.in.shape;
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=Intent.js.map
|
package/dist/Intent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Intent.js","sourceRoot":"","sources":["../src/Intent.ts"],"names":[],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|
|
2
|
-
import type * as Credential from './Credential.js';
|
|
3
|
-
import * as Intent from './Intent.js';
|
|
4
|
-
import type { ExactPartial, LooseOmit, MaybePromise } from './internal/types.js';
|
|
5
|
-
import type * as Receipt from './Receipt.js';
|
|
6
|
-
import type * as Transport from './server/Transport.js';
|
|
7
|
-
import * as z from './zod.js';
|
|
8
|
-
/**
|
|
9
|
-
* A payment method-specific intent.
|
|
10
|
-
*/
|
|
11
|
-
export type MethodIntent<intent extends Intent.Intent = Intent.Intent, options extends fromIntent.Options<intent> = fromIntent.Options<intent>> = {
|
|
12
|
-
method: options['method'];
|
|
13
|
-
name: intent['name'];
|
|
14
|
-
schema: {
|
|
15
|
-
credential: {
|
|
16
|
-
payload: options['schema']['credential']['payload'];
|
|
17
|
-
};
|
|
18
|
-
request: MergedRequestSchema<intent, options>;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export type AnyMethodIntent = MethodIntent<any, any>;
|
|
22
|
-
/**
|
|
23
|
-
* Creates a method-specific intent.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* import { z } from 'zod/mini'
|
|
28
|
-
* import { MethodIntent } from 'mppx'
|
|
29
|
-
*
|
|
30
|
-
* const tempoCharge = MethodIntent.from({
|
|
31
|
-
* method: 'tempo',
|
|
32
|
-
* name: 'charge',
|
|
33
|
-
* schema: {
|
|
34
|
-
* credential: {
|
|
35
|
-
* payload: z.object({
|
|
36
|
-
* signature: z.string(),
|
|
37
|
-
* type: z.literal('transaction'),
|
|
38
|
-
* }),
|
|
39
|
-
* },
|
|
40
|
-
* request: z.object({
|
|
41
|
-
* amount: z.string(),
|
|
42
|
-
* currency: z.string(),
|
|
43
|
-
* recipient: z.string(),
|
|
44
|
-
* }),
|
|
45
|
-
* },
|
|
46
|
-
* })
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare function from<const intent extends MethodIntent>(intent: intent): intent;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a method-specific intent from a base intent.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* import { z } from 'zod/mini'
|
|
56
|
-
* import { Intent, MethodIntent } from 'mppx'
|
|
57
|
-
*
|
|
58
|
-
* const tempoCharge = MethodIntent.fromIntent(Intent.charge, {
|
|
59
|
-
* method: 'tempo',
|
|
60
|
-
* schema: {
|
|
61
|
-
* credential: {
|
|
62
|
-
* payload: z.object({
|
|
63
|
-
* signature: z.string(),
|
|
64
|
-
* type: z.literal('transaction'),
|
|
65
|
-
* }),
|
|
66
|
-
* },
|
|
67
|
-
* request: {
|
|
68
|
-
* methodDetails: z.object({
|
|
69
|
-
* chainId: z.number(),
|
|
70
|
-
* }),
|
|
71
|
-
* requires: ['recipient'],
|
|
72
|
-
* },
|
|
73
|
-
* },
|
|
74
|
-
* })
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
export declare function fromIntent<const intent extends Intent.Intent, const options extends fromIntent.Options<intent>>(intent: intent, options: options): MethodIntent<intent, options>;
|
|
78
|
-
export declare namespace fromIntent {
|
|
79
|
-
type Options<intent extends Intent.Intent> = {
|
|
80
|
-
method: string;
|
|
81
|
-
schema: {
|
|
82
|
-
credential: {
|
|
83
|
-
payload: z.ZodMiniType;
|
|
84
|
-
};
|
|
85
|
-
request?: {
|
|
86
|
-
methodDetails?: z.ZodMiniObject | undefined;
|
|
87
|
-
requires?: readonly (keyof Intent.ShapeOf<intent>)[] | undefined;
|
|
88
|
-
} | undefined;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/** @internal */
|
|
93
|
-
type RequiresKeys<intent extends Intent.Intent, options extends fromIntent.Options<intent>> = options['schema']['request'] extends {
|
|
94
|
-
requires: readonly (infer key)[];
|
|
95
|
-
} ? key : never;
|
|
96
|
-
/** @internal */
|
|
97
|
-
type UnwrapOptional<schema> = schema extends z.ZodMiniOptional<infer inner> ? inner : schema;
|
|
98
|
-
/** @internal */
|
|
99
|
-
type MethodDetailsShape<intent extends Intent.Intent, options extends fromIntent.Options<intent>> = options['schema']['request'] extends {
|
|
100
|
-
methodDetails: infer details extends z.ZodMiniObject;
|
|
101
|
-
} ? details['shape'] : Record<never, never>;
|
|
102
|
-
/** @internal */
|
|
103
|
-
type InputRequestShape<intent extends Intent.Intent, options extends fromIntent.Options<intent>> = {
|
|
104
|
-
[K in keyof Intent.ShapeOf<intent>]: K extends RequiresKeys<intent, options> ? UnwrapOptional<Intent.ShapeOf<intent>[K]> : Intent.ShapeOf<intent>[K];
|
|
105
|
-
} & MethodDetailsShape<intent, options>;
|
|
106
|
-
/** @internal */
|
|
107
|
-
type MethodDetailsOutput<intent extends Intent.Intent, options extends fromIntent.Options<intent>> = options['schema']['request'] extends {
|
|
108
|
-
methodDetails: infer details extends z.ZodMiniObject;
|
|
109
|
-
} ? {
|
|
110
|
-
methodDetails?: z.output<details>;
|
|
111
|
-
} : Record<never, never>;
|
|
112
|
-
/** @internal */
|
|
113
|
-
type OutputRequestType<intent extends Intent.Intent, options extends fromIntent.Options<intent>> = {
|
|
114
|
-
[K in keyof Intent.ShapeOf<intent>]: K extends RequiresKeys<intent, options> ? z.output<UnwrapOptional<Intent.ShapeOf<intent>[K]>> : z.output<Intent.ShapeOf<intent>[K]>;
|
|
115
|
-
} & MethodDetailsOutput<intent, options>;
|
|
116
|
-
/** @internal */
|
|
117
|
-
type MergedRequestSchema<intent extends Intent.Intent, options extends fromIntent.Options<intent>> = z.ZodMiniType<OutputRequestType<intent, options>, z.input<z.ZodMiniObject<InputRequestShape<intent, options>>>>;
|
|
118
|
-
/**
|
|
119
|
-
* A client-side configured method intent with credential creation logic.
|
|
120
|
-
*/
|
|
121
|
-
export type Client<intent extends AnyMethodIntent = MethodIntent, context extends z.ZodMiniType | undefined = z.ZodMiniType | undefined> = intent & {
|
|
122
|
-
context?: context;
|
|
123
|
-
createCredential: CreateCredentialFn<intent, context extends z.ZodMiniType ? z.output<context> : Record<never, never>>;
|
|
124
|
-
};
|
|
125
|
-
export type AnyClient = Client<any, any>;
|
|
126
|
-
/**
|
|
127
|
-
* A server-side configured method intent with verification logic.
|
|
128
|
-
*/
|
|
129
|
-
export type Server<intent extends AnyMethodIntent = MethodIntent, defaults extends ExactPartial<z.input<intent['schema']['request']>> = {}, transportOverride = undefined> = intent & {
|
|
130
|
-
defaults?: defaults | undefined;
|
|
131
|
-
request?: RequestFn<intent> | undefined;
|
|
132
|
-
respond?: RespondFn<intent> | undefined;
|
|
133
|
-
transport?: transportOverride | undefined;
|
|
134
|
-
verify: VerifyFn<intent>;
|
|
135
|
-
};
|
|
136
|
-
export type AnyServer = Server<any, any, any>;
|
|
137
|
-
/** Credential creation function for a single intent. */
|
|
138
|
-
export type CreateCredentialFn<intent extends AnyMethodIntent, context = unknown> = (parameters: {
|
|
139
|
-
challenge: Challenge.Challenge<z.output<intent['schema']['request']>, intent['name'], intent['method']>;
|
|
140
|
-
} & ([keyof context] extends [never] ? unknown : {
|
|
141
|
-
context: context;
|
|
142
|
-
})) => Promise<string>;
|
|
143
|
-
/** Request transform function for a single intent. */
|
|
144
|
-
export type RequestFn<intent extends AnyMethodIntent> = (options: {
|
|
145
|
-
credential?: Credential.Credential | null | undefined;
|
|
146
|
-
request: z.input<intent['schema']['request']>;
|
|
147
|
-
}) => MaybePromise<z.input<intent['schema']['request']>>;
|
|
148
|
-
/** Verification function for a single intent. */
|
|
149
|
-
export type VerifyFn<intent extends AnyMethodIntent> = (parameters: {
|
|
150
|
-
credential: Credential.Credential<z.output<intent['schema']['credential']['payload']>, Challenge.Challenge<z.output<intent['schema']['request']>, intent['name'], intent['method']>>;
|
|
151
|
-
request: z.input<intent['schema']['request']>;
|
|
152
|
-
}) => Promise<Receipt.Receipt>;
|
|
153
|
-
/**
|
|
154
|
-
* Optional respond function for a server-side method intent.
|
|
155
|
-
*
|
|
156
|
-
* Called after `verify` succeeds. If it returns a `Response`, the library
|
|
157
|
-
* treats the request as fully handled (e.g. channel open/close) and
|
|
158
|
-
* `withReceipt()` will short-circuit — returning the management response
|
|
159
|
-
* with the receipt header attached without invoking any user-supplied
|
|
160
|
-
* response or generator. If it returns `undefined`, the server handler
|
|
161
|
-
* is expected to serve content via `withReceipt(response)`.
|
|
162
|
-
*
|
|
163
|
-
* **HTTP-only.** The `input` parameter is a `Request` object; MCP transports
|
|
164
|
-
* do not invoke this hook.
|
|
165
|
-
*/
|
|
166
|
-
export type RespondFn<intent extends AnyMethodIntent> = (parameters: {
|
|
167
|
-
credential: Credential.Credential<z.output<intent['schema']['credential']['payload']>, Challenge.Challenge<z.output<intent['schema']['request']>, intent['name'], intent['method']>>;
|
|
168
|
-
input: globalThis.Request;
|
|
169
|
-
receipt: Receipt.Receipt;
|
|
170
|
-
request: z.input<intent['schema']['request']>;
|
|
171
|
-
}) => MaybePromise<globalThis.Response | undefined>;
|
|
172
|
-
/** Partial request type for defaults. */
|
|
173
|
-
export type RequestDefaults<intent extends AnyMethodIntent> = ExactPartial<z.input<intent['schema']['request']>>;
|
|
174
|
-
/** Makes fields optional if they exist in defaults. */
|
|
175
|
-
export type WithDefaults<request, defaults> = [keyof defaults] extends [never] ? request : LooseOmit<request, keyof defaults & string> & ExactPartial<Pick<request, keyof defaults & keyof request>>;
|
|
176
|
-
/**
|
|
177
|
-
* Extends a method intent with client-side credential creation logic.
|
|
178
|
-
*
|
|
179
|
-
* @example
|
|
180
|
-
* ```ts
|
|
181
|
-
* import { MethodIntent } from 'mppx'
|
|
182
|
-
* import { Intents } from 'mppx/tempo'
|
|
183
|
-
*
|
|
184
|
-
* const tempoCharge = MethodIntent.toClient(Intents.charge, {
|
|
185
|
-
* async createCredential({ challenge }) {
|
|
186
|
-
* return Credential.serialize({ challenge, payload: { ... } })
|
|
187
|
-
* },
|
|
188
|
-
* })
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
export declare function toClient<const intent extends AnyMethodIntent, const context extends z.ZodMiniType | undefined = undefined>(intent: intent, options: toClient.Options<intent, context>): Client<intent, context>;
|
|
192
|
-
export declare namespace toClient {
|
|
193
|
-
type Options<intent extends AnyMethodIntent, context extends z.ZodMiniType | undefined = undefined> = {
|
|
194
|
-
context?: context;
|
|
195
|
-
createCredential: CreateCredentialFn<intent, context extends z.ZodMiniType ? z.output<context> : Record<never, never>>;
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Extends a method intent with server-side verification logic.
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* ```ts
|
|
203
|
-
* import { MethodIntent } from 'mppx'
|
|
204
|
-
* import { Intents } from 'mppx/tempo'
|
|
205
|
-
*
|
|
206
|
-
* const tempoCharge = MethodIntent.toServer(Intents.charge, {
|
|
207
|
-
* async verify({ credential }) {
|
|
208
|
-
* // verification logic
|
|
209
|
-
* return { status: 'success', ... }
|
|
210
|
-
* },
|
|
211
|
-
* })
|
|
212
|
-
* ```
|
|
213
|
-
*/
|
|
214
|
-
export declare function toServer<const intent extends AnyMethodIntent, const defaults extends RequestDefaults<intent> = {}, const transportOverride extends Transport.AnyTransport | undefined = undefined>(intent: intent, options: toServer.Options<intent, defaults, transportOverride>): Server<intent, defaults, transportOverride>;
|
|
215
|
-
export declare namespace toServer {
|
|
216
|
-
type Options<intent extends AnyMethodIntent, defaults extends RequestDefaults<intent> = {}, transportOverride extends Transport.AnyTransport | undefined = undefined> = {
|
|
217
|
-
defaults?: defaults | undefined;
|
|
218
|
-
request?: RequestFn<intent> | undefined;
|
|
219
|
-
respond?: RespondFn<intent> | undefined;
|
|
220
|
-
transport?: transportOverride | undefined;
|
|
221
|
-
verify: VerifyFn<intent>;
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
export {};
|
|
225
|
-
//# sourceMappingURL=MethodIntent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MethodIntent.d.ts","sourceRoot":"","sources":["../src/MethodIntent.ts"],"names":[],"mappings":"A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