@bosonprotocol/x402-server 0.1.0 → 0.1.1-alpha-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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bosonprotocol/x402-server",
|
|
3
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.1.1-alpha-0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Framework-agnostic x402 resource-server SDK for the Boson Protocol escrow scheme — 402 challenge builder and FullOffer signer hook.",
|
|
6
6
|
"repository": {
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"@bosonprotocol/core-sdk": "1.48.0-alpha.6",
|
|
69
69
|
"viem": "^2.39.3",
|
|
70
70
|
"zod": "^3.24.2",
|
|
71
|
-
"@bosonprotocol/x402-core": "^0.1.0",
|
|
72
|
-
"@bosonprotocol/x402-actions": "^0.1.0",
|
|
73
|
-
"@bosonprotocol/x402-
|
|
74
|
-
"@bosonprotocol/x402-
|
|
71
|
+
"@bosonprotocol/x402-core": "^0.1.1-alpha-0",
|
|
72
|
+
"@bosonprotocol/x402-actions": "^0.1.1-alpha-0",
|
|
73
|
+
"@bosonprotocol/x402-evm": "^0.1.1-alpha-0",
|
|
74
|
+
"@bosonprotocol/x402-facilitator": "^0.1.1-alpha-0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/node": "^20.17.10",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FacilitatorVerifyInput, FacilitatorVerifyResult, FacilitatorSettleInput, FacilitatorSettleResult, FacilitatorPerformActionInput, FacilitatorPerformActionResult } from '@bosonprotocol/x402-facilitator';
|
|
2
|
-
|
|
3
|
-
type FetchLike = (input: string, init?: {
|
|
4
|
-
method?: string;
|
|
5
|
-
headers?: Record<string, string>;
|
|
6
|
-
body?: string;
|
|
7
|
-
}) => Promise<{
|
|
8
|
-
ok: boolean;
|
|
9
|
-
status: number;
|
|
10
|
-
text: () => Promise<string>;
|
|
11
|
-
json?: () => Promise<unknown>;
|
|
12
|
-
}>;
|
|
13
|
-
interface CreateFacilitatorClientOptions {
|
|
14
|
-
/** Base URL of the facilitator service (no trailing slash needed). */
|
|
15
|
-
url: string;
|
|
16
|
-
/** Optional `fetch` override — defaults to the global `fetch`. Useful for tests + non-`fetch` runtimes. */
|
|
17
|
-
fetch?: FetchLike;
|
|
18
|
-
/** Optional headers attached to every request — e.g. an `Authorization` for hosted facilitators. */
|
|
19
|
-
headers?: Record<string, string>;
|
|
20
|
-
}
|
|
21
|
-
interface FacilitatorClient {
|
|
22
|
-
verify(input: FacilitatorVerifyInput): Promise<FacilitatorVerifyResult>;
|
|
23
|
-
settle(input: FacilitatorSettleInput): Promise<FacilitatorSettleResult>;
|
|
24
|
-
performAction(input: FacilitatorPerformActionInput): Promise<FacilitatorPerformActionResult>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Construct a typed HTTP client for the facilitator. The returned
|
|
28
|
-
* methods stringify the input as JSON and POST to the matching path
|
|
29
|
-
* on the configured URL. Non-2xx responses raise `FacilitatorHttpError`;
|
|
30
|
-
* 2xx responses are JSON-parsed and returned verbatim.
|
|
31
|
-
*/
|
|
32
|
-
declare function createFacilitatorClient(opts: CreateFacilitatorClientOptions): FacilitatorClient;
|
|
33
|
-
|
|
34
|
-
export { type CreateFacilitatorClientOptions as C, type FacilitatorClient as F, type FetchLike as a, createFacilitatorClient as c };
|
|
@@ -1,435 +0,0 @@
|
|
|
1
|
-
import * as _bosonprotocol_x402_facilitator from '@bosonprotocol/x402-facilitator';
|
|
2
|
-
import * as _bosonprotocol_x402_actions from '@bosonprotocol/x402-actions';
|
|
3
|
-
import { ChannelRegistry } from '@bosonprotocol/x402-actions';
|
|
4
|
-
import { EvmNetwork, Address } from '@bosonprotocol/x402-core/schemes/escrow';
|
|
5
|
-
import { Hex } from 'viem';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import { CoreSDK } from '@bosonprotocol/core-sdk';
|
|
8
|
-
import { ExchangeReader } from './onchain/index.js';
|
|
9
|
-
|
|
10
|
-
/** Funds entity returned by `coreSdk.getFunds` — narrowed to the fields the handler reshapes. */
|
|
11
|
-
interface CoreSdkFundsEntity {
|
|
12
|
-
id?: string;
|
|
13
|
-
accountId: string;
|
|
14
|
-
availableAmount: string;
|
|
15
|
-
token: {
|
|
16
|
-
address: string;
|
|
17
|
-
decimals: string;
|
|
18
|
-
symbol: string;
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/** Seller entity returned by `coreSdk.getSellersByAddress` — only the id is consumed. */
|
|
23
|
-
interface CoreSdkSellerEntity {
|
|
24
|
-
id: string;
|
|
25
|
-
}
|
|
26
|
-
/** Buyer entity returned by `coreSdk.getBuyers` — only the id is consumed. */
|
|
27
|
-
interface CoreSdkBuyerEntity {
|
|
28
|
-
id: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The subset of `CoreSDK` the read-only handlers actually use. Both the
|
|
32
|
-
* real `CoreSDK` and a hand-rolled stub for tests satisfy this shape.
|
|
33
|
-
*/
|
|
34
|
-
interface CoreSdkReadAdapter {
|
|
35
|
-
getFunds(queryVars: {
|
|
36
|
-
fundsFilter: {
|
|
37
|
-
accountId: string;
|
|
38
|
-
};
|
|
39
|
-
}): Promise<CoreSdkFundsEntity[]>;
|
|
40
|
-
getSellersByAddress(address: string): Promise<CoreSdkSellerEntity[]>;
|
|
41
|
-
getBuyers(queryVars: {
|
|
42
|
-
buyersFilter: {
|
|
43
|
-
wallet: string;
|
|
44
|
-
};
|
|
45
|
-
}): Promise<CoreSdkBuyerEntity[]>;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Cast a full `CoreSDK` to the narrowed adapter shape. Structural-only;
|
|
49
|
-
* does not capture or wrap anything.
|
|
50
|
-
*/
|
|
51
|
-
declare function asCoreSdkReadAdapter(coreSdk: CoreSDK): CoreSdkReadAdapter;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Minimal signing surface needed by `signFullOffer`. Structurally
|
|
55
|
-
* compatible with viem's `Account` (in particular `LocalAccount` from
|
|
56
|
-
* `privateKeyToAccount`), but kept narrow so consumers can plug in
|
|
57
|
-
* HSM- / KMS- / ERC-1271-backed signers without depending on viem's
|
|
58
|
-
* internal account types.
|
|
59
|
-
*/
|
|
60
|
-
interface SellerSigner {
|
|
61
|
-
/** Address that the EIP-712 signature must recover to (`creator` in `BosonOfferRef`). */
|
|
62
|
-
readonly address: Address;
|
|
63
|
-
/** EIP-712 typed-data signer. Accepts the same shape viem's `signTypedData` does. */
|
|
64
|
-
signTypedData: (params: {
|
|
65
|
-
domain: Record<string, unknown>;
|
|
66
|
-
types: Record<string, readonly {
|
|
67
|
-
name: string;
|
|
68
|
-
type: string;
|
|
69
|
-
}[]>;
|
|
70
|
-
primaryType: string;
|
|
71
|
-
message: Record<string, unknown>;
|
|
72
|
-
}) => Promise<Hex>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Per-server configuration. Validated by `x402bServerConfigSchema` at
|
|
76
|
-
* `createX402bServer` time so bad config fails fast at boot rather than
|
|
77
|
-
* later inside a 402 response.
|
|
78
|
-
*/
|
|
79
|
-
interface X402bServerConfig {
|
|
80
|
-
/** CAIP-2 EVM network the server advertises (e.g. `eip155:8453`). */
|
|
81
|
-
network: EvmNetwork;
|
|
82
|
-
/** EVM chain id matching `network` — passed straight to the EIP-712 builder's salt. */
|
|
83
|
-
chainId: number;
|
|
84
|
-
/** Address of the Boson Diamond — the EIP-712 `verifyingContract` and the wire-level `escrowAddress`. */
|
|
85
|
-
escrow: Address;
|
|
86
|
-
/** Seller signer (signs the FullOffer EIP-712 typed-data). */
|
|
87
|
-
signer: SellerSigner;
|
|
88
|
-
/** Facilitator service the server forwards meta-tx envelopes to. The URL is also advertised in `nextActions[].endpoints.facilitator`. */
|
|
89
|
-
facilitator: {
|
|
90
|
-
url: string;
|
|
91
|
-
};
|
|
92
|
-
/** Per-seller channel + endpoint registry consumed by `deriveNextActions`. */
|
|
93
|
-
channelRegistry: ChannelRegistry;
|
|
94
|
-
/**
|
|
95
|
-
* Reader the convenience handlers use to verify the post-settle /
|
|
96
|
-
* post-perform-action exchange state. Required at runtime when any
|
|
97
|
-
* write handler is invoked; the `signOffer` / `buildPaymentRequirements`
|
|
98
|
-
* read-only paths don't touch it. See `./onchain/verify-exchange.ts`
|
|
99
|
-
* for the interface.
|
|
100
|
-
*/
|
|
101
|
-
exchangeReader?: ExchangeReader;
|
|
102
|
-
/**
|
|
103
|
-
* URL of the Boson Protocol subgraph for this network. Used by the
|
|
104
|
-
* read-only `available-funds` handler and the address→entityId
|
|
105
|
-
* resolver shared with `withdraw-funds`. Optional at config time
|
|
106
|
-
* (legacy commit/redeem handlers don't need it); required at runtime
|
|
107
|
-
* by `handlers.withdrawFunds` / `handlers.getAvailableFunds`.
|
|
108
|
-
*/
|
|
109
|
-
subgraphUrl?: string;
|
|
110
|
-
/**
|
|
111
|
-
* Pre-built read-only core-sdk client. If omitted, the server
|
|
112
|
-
* constructs one internally from `subgraphUrl` + `escrow` + `chainId`
|
|
113
|
-
* with a throwing `Web3LibAdapter` stub. Provide your own for tests
|
|
114
|
-
* or when you want to share a single core-sdk instance with the
|
|
115
|
-
* rest of your service.
|
|
116
|
-
*/
|
|
117
|
-
coreSdkRead?: CoreSdkReadAdapter;
|
|
118
|
-
/**
|
|
119
|
-
* Server-side store of the buyer wallet that originally committed
|
|
120
|
-
* each exchange (keyed by `exchangeId`). Populated on Flow A commit
|
|
121
|
-
* acceptance and read at redeem time to detect voucher transfers —
|
|
122
|
-
* a redeemer whose wallet differs from the recorded committer MUST
|
|
123
|
-
* supply fresh `fulfillment` data; same-wallet redeemers MAY.
|
|
124
|
-
*
|
|
125
|
-
* Optional in the config: when omitted, `createX402bServer` wires up
|
|
126
|
-
* an in-memory `Map`. Hosts that need cross-process / persistent
|
|
127
|
-
* tracking supply their own `Map`-shaped backing store.
|
|
128
|
-
*/
|
|
129
|
-
exchangeBuyerStore?: Map<string, Address>;
|
|
130
|
-
/**
|
|
131
|
-
* Server-side store of the fulfillment option ids advertised for
|
|
132
|
-
* each Flow A exchange (keyed by `exchangeId`). Populated from the
|
|
133
|
-
* original `PaymentRequirements` after commit verification and read
|
|
134
|
-
* at redeem time so re-submitted fulfillment data cannot switch to a
|
|
135
|
-
* channel the offer never advertised.
|
|
136
|
-
*
|
|
137
|
-
* Optional in the config: when omitted, `createX402bServer` wires up
|
|
138
|
-
* an in-memory `Map`. Hosts that provide `exchangeBuyerStore` for
|
|
139
|
-
* cross-process tracking should normally provide this store too.
|
|
140
|
-
*/
|
|
141
|
-
exchangeFulfillmentOptionStore?: Map<string, readonly string[]>;
|
|
142
|
-
/**
|
|
143
|
-
* Pending fulfillment updates that reached REDEEMED on-chain but
|
|
144
|
-
* failed the server-side `channel.onCommit(...)` upsert. The redeem
|
|
145
|
-
* handler records the update here before attempting the channel write,
|
|
146
|
-
* deletes it on success, and leaves it behind with the error message
|
|
147
|
-
* on failure so the host can replay/reconcile out of band.
|
|
148
|
-
*/
|
|
149
|
-
redeemFulfillmentUpdateStore?: Map<string, RedeemFulfillmentUpdate>;
|
|
150
|
-
/**
|
|
151
|
-
* Fulfillment channels the server accepts at redeem time when the
|
|
152
|
-
* client re-submits delivery data. Structurally a subset of
|
|
153
|
-
* `@bosonprotocol/x402-fulfillment`'s `FulfillmentChannel` — only
|
|
154
|
-
* `id`, `validate`, and `onCommit` are read here, so existing
|
|
155
|
-
* channel instances pass through directly. Required iff a host
|
|
156
|
-
* wants to accept redeem-time fulfillment updates; absent means
|
|
157
|
-
* redeem requests carrying `fulfillment` are rejected with
|
|
158
|
-
* `FULFILLMENT_CHANNELS_NOT_CONFIGURED`.
|
|
159
|
-
*/
|
|
160
|
-
fulfillmentChannels?: readonly RedeemFulfillmentChannel[];
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Minimal structural slice of `FulfillmentChannel` the redeem
|
|
164
|
-
* handler needs. Kept inline so `@bosonprotocol/x402-server` does
|
|
165
|
-
* not depend on `@bosonprotocol/x402-fulfillment` (avoids a hard
|
|
166
|
-
* coupling between the resource-server SDK and a specific channel
|
|
167
|
-
* package); any real channel implementation is type-compatible.
|
|
168
|
-
*/
|
|
169
|
-
interface RedeemFulfillmentChannel {
|
|
170
|
-
readonly id: string;
|
|
171
|
-
validate(data: Record<string, unknown> | null): {
|
|
172
|
-
ok: true;
|
|
173
|
-
} | {
|
|
174
|
-
ok: false;
|
|
175
|
-
reason: string;
|
|
176
|
-
};
|
|
177
|
-
onCommit(exchangeId: string, data: Record<string, unknown> | null): Promise<void>;
|
|
178
|
-
}
|
|
179
|
-
interface RedeemFulfillmentUpdate {
|
|
180
|
-
exchangeId: string;
|
|
181
|
-
option: string;
|
|
182
|
-
data: Record<string, unknown> | null;
|
|
183
|
-
redeemer: Address;
|
|
184
|
-
recordedAt: number;
|
|
185
|
-
error?: string;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* zod validator for `X402bServerConfig`. Shallow on the signer +
|
|
189
|
-
* exchange reader (viem account types bring their own structural
|
|
190
|
-
* validators; the user-supplied reader impl is structurally typed);
|
|
191
|
-
* strict on the scalar fields we own here, and on the channel
|
|
192
|
-
* registry via `@bosonprotocol/x402-actions`.
|
|
193
|
-
*/
|
|
194
|
-
declare const x402bServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
195
|
-
network: z.ZodString;
|
|
196
|
-
chainId: z.ZodNumber;
|
|
197
|
-
escrow: z.ZodString;
|
|
198
|
-
signer: z.ZodObject<{
|
|
199
|
-
address: z.ZodString;
|
|
200
|
-
signTypedData: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodPromise<z.ZodString>>;
|
|
201
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
202
|
-
address: z.ZodString;
|
|
203
|
-
signTypedData: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodPromise<z.ZodString>>;
|
|
204
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
205
|
-
address: z.ZodString;
|
|
206
|
-
signTypedData: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodPromise<z.ZodString>>;
|
|
207
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
208
|
-
facilitator: z.ZodObject<{
|
|
209
|
-
url: z.ZodEffects<z.ZodString, string, string>;
|
|
210
|
-
}, "strict", z.ZodTypeAny, {
|
|
211
|
-
url: string;
|
|
212
|
-
}, {
|
|
213
|
-
url: string;
|
|
214
|
-
}>;
|
|
215
|
-
channelRegistry: z.ZodObject<{
|
|
216
|
-
channels: z.ZodEffects<z.ZodArray<z.ZodEnum<[_bosonprotocol_x402_actions.ActionChannel, ..._bosonprotocol_x402_actions.ActionChannel[]]>, "many">, _bosonprotocol_x402_actions.ActionChannel[], _bosonprotocol_x402_actions.ActionChannel[]>;
|
|
217
|
-
endpoints: z.ZodOptional<z.ZodRecord<z.ZodEnum<[_bosonprotocol_x402_facilitator.ActionId, ..._bosonprotocol_x402_facilitator.ActionId[]]>, z.ZodEffects<z.ZodString, string, string>>>;
|
|
218
|
-
xmtp: z.ZodOptional<z.ZodString>;
|
|
219
|
-
mcp: z.ZodOptional<z.ZodString>;
|
|
220
|
-
escrow: z.ZodString;
|
|
221
|
-
}, "strict", z.ZodTypeAny, {
|
|
222
|
-
channels: _bosonprotocol_x402_actions.ActionChannel[];
|
|
223
|
-
escrow: string;
|
|
224
|
-
mcp?: string | undefined;
|
|
225
|
-
xmtp?: string | undefined;
|
|
226
|
-
endpoints?: Partial<Record<_bosonprotocol_x402_facilitator.ActionId, string>> | undefined;
|
|
227
|
-
}, {
|
|
228
|
-
channels: _bosonprotocol_x402_actions.ActionChannel[];
|
|
229
|
-
escrow: string;
|
|
230
|
-
mcp?: string | undefined;
|
|
231
|
-
xmtp?: string | undefined;
|
|
232
|
-
endpoints?: Partial<Record<_bosonprotocol_x402_facilitator.ActionId, string>> | undefined;
|
|
233
|
-
}>;
|
|
234
|
-
exchangeReader: z.ZodOptional<z.ZodObject<{
|
|
235
|
-
read: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnknown>;
|
|
236
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
237
|
-
read: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnknown>;
|
|
238
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
239
|
-
read: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnknown>;
|
|
240
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
241
|
-
subgraphUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
242
|
-
coreSdkRead: z.ZodOptional<z.ZodObject<{
|
|
243
|
-
getFunds: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
244
|
-
getSellersByAddress: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
245
|
-
getBuyers: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
246
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
247
|
-
getFunds: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
248
|
-
getSellersByAddress: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
249
|
-
getBuyers: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
250
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
251
|
-
getFunds: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
252
|
-
getSellersByAddress: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
253
|
-
getBuyers: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
254
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
255
|
-
exchangeBuyerStore: z.ZodOptional<z.ZodType<Map<unknown, unknown>, z.ZodTypeDef, Map<unknown, unknown>>>;
|
|
256
|
-
exchangeFulfillmentOptionStore: z.ZodOptional<z.ZodType<Map<unknown, unknown>, z.ZodTypeDef, Map<unknown, unknown>>>;
|
|
257
|
-
redeemFulfillmentUpdateStore: z.ZodOptional<z.ZodType<Map<unknown, unknown>, z.ZodTypeDef, Map<unknown, unknown>>>;
|
|
258
|
-
fulfillmentChannels: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
259
|
-
id: z.ZodString;
|
|
260
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
261
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
262
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
263
|
-
id: z.ZodString;
|
|
264
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
265
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
266
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
267
|
-
id: z.ZodString;
|
|
268
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
269
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
270
|
-
}, z.ZodTypeAny, "passthrough">>, "many">, z.objectOutputType<{
|
|
271
|
-
id: z.ZodString;
|
|
272
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
273
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
274
|
-
}, z.ZodTypeAny, "passthrough">[], z.objectInputType<{
|
|
275
|
-
id: z.ZodString;
|
|
276
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
277
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
278
|
-
}, z.ZodTypeAny, "passthrough">[]>>;
|
|
279
|
-
}, "strict", z.ZodTypeAny, {
|
|
280
|
-
chainId: number;
|
|
281
|
-
network: string;
|
|
282
|
-
escrow: string;
|
|
283
|
-
channelRegistry: {
|
|
284
|
-
channels: _bosonprotocol_x402_actions.ActionChannel[];
|
|
285
|
-
escrow: string;
|
|
286
|
-
mcp?: string | undefined;
|
|
287
|
-
xmtp?: string | undefined;
|
|
288
|
-
endpoints?: Partial<Record<_bosonprotocol_x402_facilitator.ActionId, string>> | undefined;
|
|
289
|
-
};
|
|
290
|
-
facilitator: {
|
|
291
|
-
url: string;
|
|
292
|
-
};
|
|
293
|
-
signer: {
|
|
294
|
-
address: string;
|
|
295
|
-
signTypedData: (args_0: unknown, ...args: unknown[]) => Promise<string>;
|
|
296
|
-
} & {
|
|
297
|
-
[k: string]: unknown;
|
|
298
|
-
};
|
|
299
|
-
subgraphUrl?: string | undefined;
|
|
300
|
-
exchangeReader?: z.objectOutputType<{
|
|
301
|
-
read: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnknown>;
|
|
302
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
303
|
-
coreSdkRead?: z.objectOutputType<{
|
|
304
|
-
getFunds: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
305
|
-
getSellersByAddress: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
306
|
-
getBuyers: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
307
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
308
|
-
exchangeBuyerStore?: Map<unknown, unknown> | undefined;
|
|
309
|
-
exchangeFulfillmentOptionStore?: Map<unknown, unknown> | undefined;
|
|
310
|
-
redeemFulfillmentUpdateStore?: Map<unknown, unknown> | undefined;
|
|
311
|
-
fulfillmentChannels?: z.objectOutputType<{
|
|
312
|
-
id: z.ZodString;
|
|
313
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
314
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
315
|
-
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
316
|
-
}, {
|
|
317
|
-
chainId: number;
|
|
318
|
-
network: string;
|
|
319
|
-
escrow: string;
|
|
320
|
-
channelRegistry: {
|
|
321
|
-
channels: _bosonprotocol_x402_actions.ActionChannel[];
|
|
322
|
-
escrow: string;
|
|
323
|
-
mcp?: string | undefined;
|
|
324
|
-
xmtp?: string | undefined;
|
|
325
|
-
endpoints?: Partial<Record<_bosonprotocol_x402_facilitator.ActionId, string>> | undefined;
|
|
326
|
-
};
|
|
327
|
-
facilitator: {
|
|
328
|
-
url: string;
|
|
329
|
-
};
|
|
330
|
-
signer: {
|
|
331
|
-
address: string;
|
|
332
|
-
signTypedData: (args_0: unknown, ...args: unknown[]) => Promise<string>;
|
|
333
|
-
} & {
|
|
334
|
-
[k: string]: unknown;
|
|
335
|
-
};
|
|
336
|
-
subgraphUrl?: string | undefined;
|
|
337
|
-
exchangeReader?: z.objectInputType<{
|
|
338
|
-
read: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnknown>;
|
|
339
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
340
|
-
coreSdkRead?: z.objectInputType<{
|
|
341
|
-
getFunds: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
342
|
-
getSellersByAddress: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
343
|
-
getBuyers: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
344
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
345
|
-
exchangeBuyerStore?: Map<unknown, unknown> | undefined;
|
|
346
|
-
exchangeFulfillmentOptionStore?: Map<unknown, unknown> | undefined;
|
|
347
|
-
redeemFulfillmentUpdateStore?: Map<unknown, unknown> | undefined;
|
|
348
|
-
fulfillmentChannels?: z.objectInputType<{
|
|
349
|
-
id: z.ZodString;
|
|
350
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
351
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
352
|
-
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
353
|
-
}>, {
|
|
354
|
-
chainId: number;
|
|
355
|
-
network: string;
|
|
356
|
-
escrow: string;
|
|
357
|
-
channelRegistry: {
|
|
358
|
-
channels: _bosonprotocol_x402_actions.ActionChannel[];
|
|
359
|
-
escrow: string;
|
|
360
|
-
mcp?: string | undefined;
|
|
361
|
-
xmtp?: string | undefined;
|
|
362
|
-
endpoints?: Partial<Record<_bosonprotocol_x402_facilitator.ActionId, string>> | undefined;
|
|
363
|
-
};
|
|
364
|
-
facilitator: {
|
|
365
|
-
url: string;
|
|
366
|
-
};
|
|
367
|
-
signer: {
|
|
368
|
-
address: string;
|
|
369
|
-
signTypedData: (args_0: unknown, ...args: unknown[]) => Promise<string>;
|
|
370
|
-
} & {
|
|
371
|
-
[k: string]: unknown;
|
|
372
|
-
};
|
|
373
|
-
subgraphUrl?: string | undefined;
|
|
374
|
-
exchangeReader?: z.objectOutputType<{
|
|
375
|
-
read: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnknown>;
|
|
376
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
377
|
-
coreSdkRead?: z.objectOutputType<{
|
|
378
|
-
getFunds: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
379
|
-
getSellersByAddress: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
380
|
-
getBuyers: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
381
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
382
|
-
exchangeBuyerStore?: Map<unknown, unknown> | undefined;
|
|
383
|
-
exchangeFulfillmentOptionStore?: Map<unknown, unknown> | undefined;
|
|
384
|
-
redeemFulfillmentUpdateStore?: Map<unknown, unknown> | undefined;
|
|
385
|
-
fulfillmentChannels?: z.objectOutputType<{
|
|
386
|
-
id: z.ZodString;
|
|
387
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
388
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
389
|
-
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
390
|
-
}, {
|
|
391
|
-
chainId: number;
|
|
392
|
-
network: string;
|
|
393
|
-
escrow: string;
|
|
394
|
-
channelRegistry: {
|
|
395
|
-
channels: _bosonprotocol_x402_actions.ActionChannel[];
|
|
396
|
-
escrow: string;
|
|
397
|
-
mcp?: string | undefined;
|
|
398
|
-
xmtp?: string | undefined;
|
|
399
|
-
endpoints?: Partial<Record<_bosonprotocol_x402_facilitator.ActionId, string>> | undefined;
|
|
400
|
-
};
|
|
401
|
-
facilitator: {
|
|
402
|
-
url: string;
|
|
403
|
-
};
|
|
404
|
-
signer: {
|
|
405
|
-
address: string;
|
|
406
|
-
signTypedData: (args_0: unknown, ...args: unknown[]) => Promise<string>;
|
|
407
|
-
} & {
|
|
408
|
-
[k: string]: unknown;
|
|
409
|
-
};
|
|
410
|
-
subgraphUrl?: string | undefined;
|
|
411
|
-
exchangeReader?: z.objectInputType<{
|
|
412
|
-
read: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnknown>;
|
|
413
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
414
|
-
coreSdkRead?: z.objectInputType<{
|
|
415
|
-
getFunds: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
416
|
-
getSellersByAddress: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
417
|
-
getBuyers: z.ZodFunction<z.ZodTuple<[z.ZodUnknown], z.ZodUnknown>, z.ZodUnknown>;
|
|
418
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
419
|
-
exchangeBuyerStore?: Map<unknown, unknown> | undefined;
|
|
420
|
-
exchangeFulfillmentOptionStore?: Map<unknown, unknown> | undefined;
|
|
421
|
-
redeemFulfillmentUpdateStore?: Map<unknown, unknown> | undefined;
|
|
422
|
-
fulfillmentChannels?: z.objectInputType<{
|
|
423
|
-
id: z.ZodString;
|
|
424
|
-
validate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
425
|
-
onCommit: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
426
|
-
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
427
|
-
}>;
|
|
428
|
-
/**
|
|
429
|
-
* Cross-field invariant: `config.escrow` and
|
|
430
|
-
* `config.channelRegistry.escrow` must agree — the Diamond address is
|
|
431
|
-
* the same on both sides. Run this after `x402bServerConfigSchema.parse`.
|
|
432
|
-
*/
|
|
433
|
-
declare function assertChannelRegistryEscrowMatch(config: X402bServerConfig): void;
|
|
434
|
-
|
|
435
|
-
export { type CoreSdkBuyerEntity as C, type RedeemFulfillmentChannel as R, type SellerSigner as S, type X402bServerConfig as X, type CoreSdkFundsEntity as a, type CoreSdkReadAdapter as b, type CoreSdkSellerEntity as c, type RedeemFulfillmentUpdate as d, asCoreSdkReadAdapter as e, assertChannelRegistryEscrowMatch as f, x402bServerConfigSchema as x };
|