mppx 0.14.0 → 0.15.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/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/dist/Expires.js +1 -1
- package/dist/Store.d.ts +2 -2
- package/dist/Store.js +13 -3
- package/dist/attestation/internal/HttpMessageSignature.js +2 -0
- package/dist/cli/cli.js +25 -25
- package/dist/cli/plugins/index.js +2 -2
- package/dist/integrations/x402/Evm.d.ts +1 -0
- package/dist/internal/version.d.ts +2 -2
- package/dist/internal/version.js +1 -1
- package/dist/middlewares/express.js +18 -6
- package/dist/server/Mppx.d.ts +5 -0
- package/dist/server/Mppx.js +8 -3
- package/dist/tempo/Methods.d.ts +5 -0
- package/dist/tempo/Methods.js +1 -0
- package/dist/tempo/client/Subscription.d.ts +5 -0
- package/dist/tempo/server/Charge.js +4 -0
- package/dist/tempo/server/Methods.d.ts +26 -0
- package/dist/tempo/server/Subscription.d.ts +5 -0
- package/dist/tempo/server/Subscription.js +8 -4
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/session/server/CloseSupervisor.d.ts +13 -1
- package/dist/tempo/session/server/CloseSupervisor.js +23 -2
- package/dist/tempo/session/server/Ws.d.ts +5 -2
- package/dist/tempo/session/server/Ws.js +11 -2
- package/dist/tempo/session/server/index.d.ts +3 -1
- package/dist/tempo/session/server/index.js +2 -0
- package/dist/tempo/subscription/Store.d.ts +7 -1
- package/dist/tempo/subscription/Store.js +56 -4
- package/dist/tempo/subscription/Types.d.ts +2 -0
- package/package.json +1 -1
package/dist/tempo/Methods.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare const subscriptionAccessKey: z.ZodMiniObject<{
|
|
|
12
12
|
secp256k1: "secp256k1";
|
|
13
13
|
webAuthn: "webAuthn";
|
|
14
14
|
}>;
|
|
15
|
+
keyToken: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
15
16
|
}, z.core.$strip>;
|
|
16
17
|
/**
|
|
17
18
|
* Tempo charge intent for one-time TIP-20 token transfers.
|
|
@@ -212,6 +213,7 @@ export declare const subscription: {
|
|
|
212
213
|
secp256k1: "secp256k1";
|
|
213
214
|
webAuthn: "webAuthn";
|
|
214
215
|
}>;
|
|
216
|
+
keyToken: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
215
217
|
}, z.core.$strip>>;
|
|
216
218
|
chainId: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
217
219
|
currency: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>;
|
|
@@ -226,6 +228,7 @@ export declare const subscription: {
|
|
|
226
228
|
secp256k1: "secp256k1";
|
|
227
229
|
webAuthn: "webAuthn";
|
|
228
230
|
}>;
|
|
231
|
+
keyToken: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
229
232
|
}, z.core.$strip>>;
|
|
230
233
|
chainId: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
231
234
|
}, z.core.$strip>>;
|
|
@@ -255,6 +258,7 @@ export declare const subscription: {
|
|
|
255
258
|
accessKey?: {
|
|
256
259
|
accessKeyAddress: `0x${string}`;
|
|
257
260
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
261
|
+
keyToken?: `0x${string}` | undefined;
|
|
258
262
|
} | undefined;
|
|
259
263
|
chainId?: number | undefined;
|
|
260
264
|
currency: `0x${string}`;
|
|
@@ -265,6 +269,7 @@ export declare const subscription: {
|
|
|
265
269
|
accessKey?: {
|
|
266
270
|
accessKeyAddress: `0x${string}`;
|
|
267
271
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
272
|
+
keyToken?: `0x${string}` | undefined;
|
|
268
273
|
} | undefined;
|
|
269
274
|
chainId?: number | undefined;
|
|
270
275
|
} | undefined;
|
package/dist/tempo/Methods.js
CHANGED
|
@@ -18,6 +18,7 @@ const normalizedAddress = z.pipe(z.address(), z.transform((value) => value.toLow
|
|
|
18
18
|
const subscriptionAccessKey = z.object({
|
|
19
19
|
accessKeyAddress: normalizedAddress,
|
|
20
20
|
keyType: z.enum(['p256', 'secp256k1', 'webAuthn']),
|
|
21
|
+
keyToken: z.optional(z.pipe(z.string().check(z.regex(/^0x[0-9a-fA-F]{120}$/)), z.transform((value) => value))),
|
|
21
22
|
});
|
|
22
23
|
const subscriptionMethodDetails = z.object({
|
|
23
24
|
accessKey: z.optional(subscriptionAccessKey),
|
|
@@ -32,6 +32,7 @@ export declare function subscription(parameters?: subscription.Parameters): Meth
|
|
|
32
32
|
secp256k1: "secp256k1";
|
|
33
33
|
webAuthn: "webAuthn";
|
|
34
34
|
}>;
|
|
35
|
+
keyToken: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
35
36
|
}, z.core.$strip>>;
|
|
36
37
|
chainId: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
37
38
|
currency: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>;
|
|
@@ -46,6 +47,7 @@ export declare function subscription(parameters?: subscription.Parameters): Meth
|
|
|
46
47
|
secp256k1: "secp256k1";
|
|
47
48
|
webAuthn: "webAuthn";
|
|
48
49
|
}>;
|
|
50
|
+
keyToken: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
49
51
|
}, z.core.$strip>>;
|
|
50
52
|
chainId: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
51
53
|
}, z.core.$strip>>;
|
|
@@ -74,6 +76,7 @@ export declare function subscription(parameters?: subscription.Parameters): Meth
|
|
|
74
76
|
secp256k1: "secp256k1";
|
|
75
77
|
webAuthn: "webAuthn";
|
|
76
78
|
}>;
|
|
79
|
+
keyToken: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
77
80
|
}, z.core.$strip>> | undefined;
|
|
78
81
|
chainId?: number | undefined;
|
|
79
82
|
} | undefined;
|
|
@@ -82,6 +85,7 @@ export declare function subscription(parameters?: subscription.Parameters): Meth
|
|
|
82
85
|
accessKey?: {
|
|
83
86
|
accessKeyAddress: `0x${string}`;
|
|
84
87
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
88
|
+
keyToken?: `0x${string}` | undefined;
|
|
85
89
|
} | undefined;
|
|
86
90
|
chainId?: number | undefined;
|
|
87
91
|
currency: `0x${string}`;
|
|
@@ -92,6 +96,7 @@ export declare function subscription(parameters?: subscription.Parameters): Meth
|
|
|
92
96
|
accessKey?: {
|
|
93
97
|
accessKeyAddress: `0x${string}`;
|
|
94
98
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
99
|
+
keyToken?: `0x${string}` | undefined;
|
|
95
100
|
} | undefined;
|
|
96
101
|
chainId?: number | undefined;
|
|
97
102
|
} | undefined;
|
|
@@ -446,6 +446,7 @@ export function charge(parameters = {}) {
|
|
|
446
446
|
reason: 'Proof credential has already been used',
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
|
+
Expires.assert(expires, challenge.id);
|
|
449
450
|
return toReceipt(challenge.id);
|
|
450
451
|
}
|
|
451
452
|
case 'transaction': {
|
|
@@ -590,6 +591,9 @@ export function charge(parameters = {}) {
|
|
|
590
591
|
policy: transactionFeePayerPolicy,
|
|
591
592
|
transaction,
|
|
592
593
|
});
|
|
594
|
+
// Authorize before the irreversible send; expiry must not turn a paid
|
|
595
|
+
// request into a fresh payment challenge while settlement completes.
|
|
596
|
+
Expires.assert(expires, challenge.id);
|
|
593
597
|
broadcastAttempted = true;
|
|
594
598
|
if (waitForConfirmation) {
|
|
595
599
|
const start = Date.now();
|
|
@@ -4662,6 +4662,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4662
4662
|
secp256k1: "secp256k1";
|
|
4663
4663
|
webAuthn: "webAuthn";
|
|
4664
4664
|
}>;
|
|
4665
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4665
4666
|
}, import("zod/v4/core").$strip>>;
|
|
4666
4667
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
4667
4668
|
currency: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>;
|
|
@@ -4676,6 +4677,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4676
4677
|
secp256k1: "secp256k1";
|
|
4677
4678
|
webAuthn: "webAuthn";
|
|
4678
4679
|
}>;
|
|
4680
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4679
4681
|
}, import("zod/v4/core").$strip>>;
|
|
4680
4682
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
4681
4683
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -4704,6 +4706,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4704
4706
|
secp256k1: "secp256k1";
|
|
4705
4707
|
webAuthn: "webAuthn";
|
|
4706
4708
|
}>;
|
|
4709
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4707
4710
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
4708
4711
|
chainId?: number | undefined;
|
|
4709
4712
|
} | undefined;
|
|
@@ -4712,6 +4715,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4712
4715
|
accessKey?: {
|
|
4713
4716
|
accessKeyAddress: `0x${string}`;
|
|
4714
4717
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
4718
|
+
keyToken?: `0x${string}` | undefined;
|
|
4715
4719
|
} | undefined;
|
|
4716
4720
|
chainId?: number | undefined;
|
|
4717
4721
|
currency: `0x${string}`;
|
|
@@ -4722,6 +4726,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4722
4726
|
accessKey?: {
|
|
4723
4727
|
accessKeyAddress: `0x${string}`;
|
|
4724
4728
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
4729
|
+
keyToken?: `0x${string}` | undefined;
|
|
4725
4730
|
} | undefined;
|
|
4726
4731
|
chainId?: number | undefined;
|
|
4727
4732
|
} | undefined;
|
|
@@ -4757,6 +4762,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4757
4762
|
secp256k1: "secp256k1";
|
|
4758
4763
|
webAuthn: "webAuthn";
|
|
4759
4764
|
}>;
|
|
4765
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4760
4766
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
4761
4767
|
chainId?: number | undefined;
|
|
4762
4768
|
} | undefined;
|
|
@@ -4791,6 +4797,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4791
4797
|
secp256k1: "secp256k1";
|
|
4792
4798
|
webAuthn: "webAuthn";
|
|
4793
4799
|
}>;
|
|
4800
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4794
4801
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
4795
4802
|
chainId?: number | undefined;
|
|
4796
4803
|
} | undefined;
|
|
@@ -4833,6 +4840,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4833
4840
|
secp256k1: "secp256k1";
|
|
4834
4841
|
webAuthn: "webAuthn";
|
|
4835
4842
|
}>;
|
|
4843
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4836
4844
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
4837
4845
|
chainId?: number | undefined;
|
|
4838
4846
|
} | undefined;
|
|
@@ -4870,6 +4878,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4870
4878
|
secp256k1: "secp256k1";
|
|
4871
4879
|
webAuthn: "webAuthn";
|
|
4872
4880
|
}>;
|
|
4881
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4873
4882
|
}, import("zod/v4/core").$strip>>;
|
|
4874
4883
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
4875
4884
|
currency: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>;
|
|
@@ -4884,6 +4893,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4884
4893
|
secp256k1: "secp256k1";
|
|
4885
4894
|
webAuthn: "webAuthn";
|
|
4886
4895
|
}>;
|
|
4896
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4887
4897
|
}, import("zod/v4/core").$strip>>;
|
|
4888
4898
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
4889
4899
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -4912,6 +4922,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4912
4922
|
secp256k1: "secp256k1";
|
|
4913
4923
|
webAuthn: "webAuthn";
|
|
4914
4924
|
}>;
|
|
4925
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4915
4926
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
4916
4927
|
chainId?: number | undefined;
|
|
4917
4928
|
} | undefined;
|
|
@@ -4920,6 +4931,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4920
4931
|
accessKey?: {
|
|
4921
4932
|
accessKeyAddress: `0x${string}`;
|
|
4922
4933
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
4934
|
+
keyToken?: `0x${string}` | undefined;
|
|
4923
4935
|
} | undefined;
|
|
4924
4936
|
chainId?: number | undefined;
|
|
4925
4937
|
currency: `0x${string}`;
|
|
@@ -4930,6 +4942,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4930
4942
|
accessKey?: {
|
|
4931
4943
|
accessKeyAddress: `0x${string}`;
|
|
4932
4944
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
4945
|
+
keyToken?: `0x${string}` | undefined;
|
|
4933
4946
|
} | undefined;
|
|
4934
4947
|
chainId?: number | undefined;
|
|
4935
4948
|
} | undefined;
|
|
@@ -4958,6 +4971,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4958
4971
|
secp256k1: "secp256k1";
|
|
4959
4972
|
webAuthn: "webAuthn";
|
|
4960
4973
|
}>;
|
|
4974
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4961
4975
|
}, import("zod/v4/core").$strip>>;
|
|
4962
4976
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
4963
4977
|
currency: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>;
|
|
@@ -4972,6 +4986,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
4972
4986
|
secp256k1: "secp256k1";
|
|
4973
4987
|
webAuthn: "webAuthn";
|
|
4974
4988
|
}>;
|
|
4989
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
4975
4990
|
}, import("zod/v4/core").$strip>>;
|
|
4976
4991
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
4977
4992
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -5000,6 +5015,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5000
5015
|
secp256k1: "secp256k1";
|
|
5001
5016
|
webAuthn: "webAuthn";
|
|
5002
5017
|
}>;
|
|
5018
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
5003
5019
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
5004
5020
|
chainId?: number | undefined;
|
|
5005
5021
|
} | undefined;
|
|
@@ -5008,6 +5024,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5008
5024
|
accessKey?: {
|
|
5009
5025
|
accessKeyAddress: `0x${string}`;
|
|
5010
5026
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
5027
|
+
keyToken?: `0x${string}` | undefined;
|
|
5011
5028
|
} | undefined;
|
|
5012
5029
|
chainId?: number | undefined;
|
|
5013
5030
|
currency: `0x${string}`;
|
|
@@ -5018,6 +5035,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5018
5035
|
accessKey?: {
|
|
5019
5036
|
accessKeyAddress: `0x${string}`;
|
|
5020
5037
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
5038
|
+
keyToken?: `0x${string}` | undefined;
|
|
5021
5039
|
} | undefined;
|
|
5022
5040
|
chainId?: number | undefined;
|
|
5023
5041
|
} | undefined;
|
|
@@ -5053,6 +5071,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5053
5071
|
secp256k1: "secp256k1";
|
|
5054
5072
|
webAuthn: "webAuthn";
|
|
5055
5073
|
}>;
|
|
5074
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
5056
5075
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
5057
5076
|
chainId?: number | undefined;
|
|
5058
5077
|
} | undefined;
|
|
@@ -5087,6 +5106,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5087
5106
|
secp256k1: "secp256k1";
|
|
5088
5107
|
webAuthn: "webAuthn";
|
|
5089
5108
|
}>;
|
|
5109
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
5090
5110
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
5091
5111
|
chainId?: number | undefined;
|
|
5092
5112
|
} | undefined;
|
|
@@ -5129,6 +5149,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5129
5149
|
secp256k1: "secp256k1";
|
|
5130
5150
|
webAuthn: "webAuthn";
|
|
5131
5151
|
}>;
|
|
5152
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
5132
5153
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
5133
5154
|
chainId?: number | undefined;
|
|
5134
5155
|
} | undefined;
|
|
@@ -5166,6 +5187,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5166
5187
|
secp256k1: "secp256k1";
|
|
5167
5188
|
webAuthn: "webAuthn";
|
|
5168
5189
|
}>;
|
|
5190
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
5169
5191
|
}, import("zod/v4/core").$strip>>;
|
|
5170
5192
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
5171
5193
|
currency: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>;
|
|
@@ -5180,6 +5202,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5180
5202
|
secp256k1: "secp256k1";
|
|
5181
5203
|
webAuthn: "webAuthn";
|
|
5182
5204
|
}>;
|
|
5205
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
5183
5206
|
}, import("zod/v4/core").$strip>>;
|
|
5184
5207
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
5185
5208
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -5208,6 +5231,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5208
5231
|
secp256k1: "secp256k1";
|
|
5209
5232
|
webAuthn: "webAuthn";
|
|
5210
5233
|
}>;
|
|
5234
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
5211
5235
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
5212
5236
|
chainId?: number | undefined;
|
|
5213
5237
|
} | undefined;
|
|
@@ -5216,6 +5240,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5216
5240
|
accessKey?: {
|
|
5217
5241
|
accessKeyAddress: `0x${string}`;
|
|
5218
5242
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
5243
|
+
keyToken?: `0x${string}` | undefined;
|
|
5219
5244
|
} | undefined;
|
|
5220
5245
|
chainId?: number | undefined;
|
|
5221
5246
|
currency: `0x${string}`;
|
|
@@ -5226,6 +5251,7 @@ declare function subscriptionOffers<const parameters extends CurrencyParameters<
|
|
|
5226
5251
|
accessKey?: {
|
|
5227
5252
|
accessKeyAddress: `0x${string}`;
|
|
5228
5253
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
5254
|
+
keyToken?: `0x${string}` | undefined;
|
|
5229
5255
|
} | undefined;
|
|
5230
5256
|
chainId?: number | undefined;
|
|
5231
5257
|
} | undefined;
|
|
@@ -33,6 +33,7 @@ export declare function subscription<const parameters extends subscription.Param
|
|
|
33
33
|
secp256k1: "secp256k1";
|
|
34
34
|
webAuthn: "webAuthn";
|
|
35
35
|
}>;
|
|
36
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
36
37
|
}, import("zod/v4/core").$strip>>;
|
|
37
38
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
38
39
|
currency: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>;
|
|
@@ -47,6 +48,7 @@ export declare function subscription<const parameters extends subscription.Param
|
|
|
47
48
|
secp256k1: "secp256k1";
|
|
48
49
|
webAuthn: "webAuthn";
|
|
49
50
|
}>;
|
|
51
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
50
52
|
}, import("zod/v4/core").$strip>>;
|
|
51
53
|
chainId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
52
54
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -75,6 +77,7 @@ export declare function subscription<const parameters extends subscription.Param
|
|
|
75
77
|
secp256k1: "secp256k1";
|
|
76
78
|
webAuthn: "webAuthn";
|
|
77
79
|
}>;
|
|
80
|
+
keyToken: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<`0x${string}`, string>>>;
|
|
78
81
|
}, import("zod/v4/core").$strip>> | undefined;
|
|
79
82
|
chainId?: number | undefined;
|
|
80
83
|
} | undefined;
|
|
@@ -83,6 +86,7 @@ export declare function subscription<const parameters extends subscription.Param
|
|
|
83
86
|
accessKey?: {
|
|
84
87
|
accessKeyAddress: `0x${string}`;
|
|
85
88
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
89
|
+
keyToken?: `0x${string}` | undefined;
|
|
86
90
|
} | undefined;
|
|
87
91
|
chainId?: number | undefined;
|
|
88
92
|
currency: `0x${string}`;
|
|
@@ -93,6 +97,7 @@ export declare function subscription<const parameters extends subscription.Param
|
|
|
93
97
|
accessKey?: {
|
|
94
98
|
accessKeyAddress: `0x${string}`;
|
|
95
99
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
100
|
+
keyToken?: `0x${string}` | undefined;
|
|
96
101
|
} | undefined;
|
|
97
102
|
chainId?: number | undefined;
|
|
98
103
|
} | undefined;
|
|
@@ -353,10 +353,11 @@ async function resolveChallengeAccessKey(parameters) {
|
|
|
353
353
|
(existing && isActive(existing) ? existing.accessKey : undefined));
|
|
354
354
|
}
|
|
355
355
|
async function createUnboundChallengeAccessKey(parameters) {
|
|
356
|
-
const accessKey = await parameters.store.
|
|
356
|
+
const accessKey = await parameters.store.createChallengeAccessKey();
|
|
357
357
|
return {
|
|
358
358
|
accessKeyAddress: accessKey.accessKeyAddress,
|
|
359
359
|
keyType: accessKey.keyType,
|
|
360
|
+
keyToken: accessKey.keyToken,
|
|
360
361
|
};
|
|
361
362
|
}
|
|
362
363
|
async function activateSubscription(parameters) {
|
|
@@ -646,8 +647,8 @@ function resolveRenewalHandler(parameters) {
|
|
|
646
647
|
}
|
|
647
648
|
async function submitSubscriptionPayment(parameters) {
|
|
648
649
|
const { accessKey, feePayer, feePayerPolicy, getClient, keyAuthorization, lookupKey, request, settlementReference, source, store, waitForConfirmation, } = parameters;
|
|
649
|
-
const stored = (await store.
|
|
650
|
-
(await store.
|
|
650
|
+
const stored = (await store.getAccessKeyByAddress(accessKey.accessKeyAddress, accessKey.keyToken)) ??
|
|
651
|
+
(await store.getAccessKey(lookupKey));
|
|
651
652
|
if (!stored) {
|
|
652
653
|
throw new VerificationFailedError({ reason: 'subscription access key is missing' });
|
|
653
654
|
}
|
|
@@ -754,9 +755,11 @@ async function submitSubscriptionPayment(parameters) {
|
|
|
754
755
|
if (!waitForConfirmation) {
|
|
755
756
|
// Optimistic mode has no receipt to inspect, so it cannot detect a T6
|
|
756
757
|
// (TIP-1028) held transfer. Use `waitForConfirmation: true` for T6-safe proof.
|
|
757
|
-
|
|
758
|
+
const hash = await sendRawTransaction(client, {
|
|
758
759
|
serializedTransaction: serializedTransaction,
|
|
759
760
|
});
|
|
761
|
+
await store.retainAccessKey(lookupKey, stored);
|
|
762
|
+
return hash;
|
|
760
763
|
}
|
|
761
764
|
const receipt = await sendRawTransactionSync(client, {
|
|
762
765
|
serializedTransaction: serializedTransaction,
|
|
@@ -772,6 +775,7 @@ async function submitSubscriptionPayment(parameters) {
|
|
|
772
775
|
memo,
|
|
773
776
|
recipient: request.recipient,
|
|
774
777
|
});
|
|
778
|
+
await store.retainAccessKey(lookupKey, stored);
|
|
775
779
|
return receipt.transactionHash;
|
|
776
780
|
}
|
|
777
781
|
/**
|