@cashie/core-lib 1.0.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 +9 -0
- package/dist/abi/abi.d.ts +2620 -0
- package/dist/abi/index.d.ts +1 -0
- package/dist/backend/auth/index.d.ts +4 -0
- package/dist/backend/auth/jwt.types.d.ts +3 -0
- package/dist/backend/auth/ocap/ocap-build.d.ts +35 -0
- package/dist/backend/auth/ocap/ocap-types.d.ts +87 -0
- package/dist/backend/auth/siwe.types.d.ts +18 -0
- package/dist/backend/blockchain/index.d.ts +1 -0
- package/dist/backend/blockchain/types.d.ts +11 -0
- package/dist/backend/contracts/badge.types.d.ts +25 -0
- package/dist/backend/contracts/balance.types.d.ts +32 -0
- package/dist/backend/contracts/event.types.d.ts +34 -0
- package/dist/backend/contracts/index.d.ts +4 -0
- package/dist/backend/contracts/receipt.types.d.ts +55 -0
- package/dist/backend/index.d.ts +4 -0
- package/dist/backend/tx-tracking/index.d.ts +1 -0
- package/dist/backend/tx-tracking/types.d.ts +41 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/payment-client.d.ts +30 -0
- package/dist/client/schemas.d.ts +55 -0
- package/dist/client/types.d.ts +163 -0
- package/dist/data/cashieDataUrl.d.ts +79 -0
- package/dist/data/encoder.d.ts +130 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/data/types.d.ts +116 -0
- package/dist/erc-7715/common.types.d.ts +37 -0
- package/dist/erc-7715/index.d.ts +4 -0
- package/dist/erc-7715/permission/index.d.ts +2 -0
- package/dist/erc-7715/permission/schemas.d.ts +172 -0
- package/dist/erc-7715/permission/types.d.ts +27 -0
- package/dist/erc-7715/request/index.d.ts +2 -0
- package/dist/erc-7715/request/schemas.d.ts +260 -0
- package/dist/erc-7715/request/types.d.ts +47 -0
- package/dist/erc-7715/rules/index.d.ts +2 -0
- package/dist/erc-7715/rules/schemas.d.ts +76 -0
- package/dist/erc-7715/rules/types.d.ts +26 -0
- package/dist/identity/cashieIdentitySoulTypedData.d.ts +65 -0
- package/dist/identity/encoder.d.ts +24 -0
- package/dist/identity/index.d.ts +5 -0
- package/dist/identity/issuer/error/index.d.ts +1 -0
- package/dist/identity/issuer/error/plaidIdvErrors.d.ts +24 -0
- package/dist/identity/issuer/identity-issuer.d.ts +30 -0
- package/dist/identity/issuer/index.d.ts +3 -0
- package/dist/identity/issuer/types.d.ts +35 -0
- package/dist/identity/soul/index.d.ts +1 -0
- package/dist/identity/soul/soulManager.d.ts +63 -0
- package/dist/identity/types.d.ts +196 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +7 -0
- package/dist/intent/encoder.d.ts +22 -0
- package/dist/intent/index.d.ts +2 -0
- package/dist/intent/types.d.ts +88 -0
- package/dist/router/index.d.ts +1 -0
- package/dist/router/types.d.ts +12 -0
- package/dist/shared/either.d.ts +68 -0
- package/dist/shared/errorCode.d.ts +115 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/types/eip-7702.types.d.ts +21 -0
- package/dist/shared/types/index.d.ts +3 -0
- package/dist/shared/types/payment-protocol.types.d.ts +17 -0
- package/dist/shared/types/rpc.types.d.ts +14 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/utils.d.ts +17 -0
- package/package.json +67 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { GetPermissionsInfoResultParams, GetSupportedExecutionPermissionsResult, InitCodeData, PermissionRequest, PermissionResponse, PermissionsRequest, PermissionsResponse } from './types.js';
|
|
3
|
+
export declare const initCodeDataSchema: z.ZodObject<{
|
|
4
|
+
factory: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
5
|
+
factoryData: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const permissionRequestSchema: z.ZodObject<{
|
|
8
|
+
chainId: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
9
|
+
from: z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
10
|
+
to: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
11
|
+
permission: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
13
|
+
justification: z.ZodString;
|
|
14
|
+
type: z.ZodLiteral<"erc20-token-payment">;
|
|
15
|
+
data: z.ZodObject<{
|
|
16
|
+
recipient: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
17
|
+
paymentDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
19
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
20
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
21
|
+
type: z.ZodLiteral<"single">;
|
|
22
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
23
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
24
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
25
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
26
|
+
type: z.ZodLiteral<"recurring">;
|
|
27
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
billingPeriod: z.ZodEnum<{
|
|
29
|
+
weekly: "weekly";
|
|
30
|
+
monthly: "monthly";
|
|
31
|
+
annually: "annually";
|
|
32
|
+
}>;
|
|
33
|
+
}, z.core.$strict>], "type">;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
}, z.core.$strict>], "type">;
|
|
36
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
38
|
+
justification: z.ZodString;
|
|
39
|
+
type: z.ZodLiteral<"expiry">;
|
|
40
|
+
data: z.ZodObject<{
|
|
41
|
+
timestamp: z.ZodNumber;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
44
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
45
|
+
justification: z.ZodString;
|
|
46
|
+
type: z.ZodLiteral<"identity-mint">;
|
|
47
|
+
data: z.ZodObject<{
|
|
48
|
+
identityMintPayload: z.ZodType<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown, z.core.$ZodTypeInternals<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown>>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
}, z.core.$strict>], "type">>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export declare const permissionsRequestSchema: z.ZodArray<z.ZodObject<{
|
|
53
|
+
chainId: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
54
|
+
from: z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
55
|
+
to: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
56
|
+
permission: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
57
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
58
|
+
justification: z.ZodString;
|
|
59
|
+
type: z.ZodLiteral<"erc20-token-payment">;
|
|
60
|
+
data: z.ZodObject<{
|
|
61
|
+
recipient: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
62
|
+
paymentDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
63
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
64
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
65
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
66
|
+
type: z.ZodLiteral<"single">;
|
|
67
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
69
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
70
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
71
|
+
type: z.ZodLiteral<"recurring">;
|
|
72
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
billingPeriod: z.ZodEnum<{
|
|
74
|
+
weekly: "weekly";
|
|
75
|
+
monthly: "monthly";
|
|
76
|
+
annually: "annually";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.core.$strict>], "type">;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
}, z.core.$strict>], "type">;
|
|
81
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
82
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
83
|
+
justification: z.ZodString;
|
|
84
|
+
type: z.ZodLiteral<"expiry">;
|
|
85
|
+
data: z.ZodObject<{
|
|
86
|
+
timestamp: z.ZodNumber;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
90
|
+
justification: z.ZodString;
|
|
91
|
+
type: z.ZodLiteral<"identity-mint">;
|
|
92
|
+
data: z.ZodObject<{
|
|
93
|
+
identityMintPayload: z.ZodType<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown, z.core.$ZodTypeInternals<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown>>;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
}, z.core.$strict>], "type">>>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
export declare const permissionResponseSchema: z.ZodObject<{
|
|
98
|
+
chainId: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
99
|
+
to: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
100
|
+
permission: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
101
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
102
|
+
justification: z.ZodString;
|
|
103
|
+
type: z.ZodLiteral<"erc20-token-payment">;
|
|
104
|
+
data: z.ZodObject<{
|
|
105
|
+
recipient: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
106
|
+
paymentDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
107
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
108
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
109
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
110
|
+
type: z.ZodLiteral<"single">;
|
|
111
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
112
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
113
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
114
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
115
|
+
type: z.ZodLiteral<"recurring">;
|
|
116
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
billingPeriod: z.ZodEnum<{
|
|
118
|
+
weekly: "weekly";
|
|
119
|
+
monthly: "monthly";
|
|
120
|
+
annually: "annually";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.core.$strict>], "type">;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
}, z.core.$strict>], "type">;
|
|
125
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
126
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
127
|
+
justification: z.ZodString;
|
|
128
|
+
type: z.ZodLiteral<"expiry">;
|
|
129
|
+
data: z.ZodObject<{
|
|
130
|
+
timestamp: z.ZodNumber;
|
|
131
|
+
}, z.core.$strict>;
|
|
132
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
133
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
134
|
+
justification: z.ZodString;
|
|
135
|
+
type: z.ZodLiteral<"identity-mint">;
|
|
136
|
+
data: z.ZodObject<{
|
|
137
|
+
identityMintPayload: z.ZodType<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown, z.core.$ZodTypeInternals<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown>>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
}, z.core.$strict>], "type">>>;
|
|
140
|
+
from: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
141
|
+
context: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
142
|
+
dependencies: z.ZodArray<z.ZodObject<{
|
|
143
|
+
factory: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
144
|
+
factoryData: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
delegationManager: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
export declare const permissionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
149
|
+
chainId: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
150
|
+
to: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
151
|
+
permission: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
152
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
153
|
+
justification: z.ZodString;
|
|
154
|
+
type: z.ZodLiteral<"erc20-token-payment">;
|
|
155
|
+
data: z.ZodObject<{
|
|
156
|
+
recipient: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
157
|
+
paymentDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
158
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
159
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
160
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
161
|
+
type: z.ZodLiteral<"single">;
|
|
162
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
163
|
+
allowance: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
164
|
+
tokenAddress: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
165
|
+
rewardItems: z.ZodOptional<z.ZodArray<z.ZodType<import("../../index.js").RewardItem, unknown, z.core.$ZodTypeInternals<import("../../index.js").RewardItem, unknown>>>>;
|
|
166
|
+
type: z.ZodLiteral<"recurring">;
|
|
167
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
billingPeriod: z.ZodEnum<{
|
|
169
|
+
weekly: "weekly";
|
|
170
|
+
monthly: "monthly";
|
|
171
|
+
annually: "annually";
|
|
172
|
+
}>;
|
|
173
|
+
}, z.core.$strict>], "type">;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
}, z.core.$strict>], "type">;
|
|
176
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
177
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
178
|
+
justification: z.ZodString;
|
|
179
|
+
type: z.ZodLiteral<"expiry">;
|
|
180
|
+
data: z.ZodObject<{
|
|
181
|
+
timestamp: z.ZodNumber;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
184
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
185
|
+
justification: z.ZodString;
|
|
186
|
+
type: z.ZodLiteral<"identity-mint">;
|
|
187
|
+
data: z.ZodObject<{
|
|
188
|
+
identityMintPayload: z.ZodType<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown, z.core.$ZodTypeInternals<import("../../index.js").IdentityMintSignPayloadWithSignature, unknown>>;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
}, z.core.$strict>], "type">>>;
|
|
191
|
+
from: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
192
|
+
context: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
193
|
+
dependencies: z.ZodArray<z.ZodObject<{
|
|
194
|
+
factory: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
195
|
+
factoryData: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
delegationManager: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
export declare const getPermissionsInfoResultParamsSchema: z.ZodObject<{
|
|
200
|
+
chainIds: z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
201
|
+
}, z.core.$strict>;
|
|
202
|
+
export declare const supportedExecutionPermissionInfoSchema: z.ZodObject<{
|
|
203
|
+
chainIds: z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
204
|
+
ruleTypes: z.ZodArray<z.ZodString>;
|
|
205
|
+
}, z.core.$strict>;
|
|
206
|
+
export declare const getSupportedExecutionPermissionsResultSchema: z.ZodObject<{
|
|
207
|
+
'erc20-token-payment': z.ZodObject<{
|
|
208
|
+
chainIds: z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
209
|
+
ruleTypes: z.ZodArray<z.ZodString>;
|
|
210
|
+
}, z.core.$strict>;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
/**
|
|
213
|
+
* Parses init code dependency data.
|
|
214
|
+
*
|
|
215
|
+
* @param value - The value to validate.
|
|
216
|
+
* @returns The parsed init code dependency data.
|
|
217
|
+
*/
|
|
218
|
+
export declare function parseInitCodeData(value: unknown): InitCodeData;
|
|
219
|
+
/**
|
|
220
|
+
* Parses a permission request.
|
|
221
|
+
*
|
|
222
|
+
* @param value - The value to validate.
|
|
223
|
+
* @returns The parsed permission request.
|
|
224
|
+
*/
|
|
225
|
+
export declare function parsePermissionRequest(value: unknown): PermissionRequest;
|
|
226
|
+
/**
|
|
227
|
+
* Parses a list of permission requests.
|
|
228
|
+
*
|
|
229
|
+
* @param value - The value to validate.
|
|
230
|
+
* @returns The parsed permission request list.
|
|
231
|
+
*/
|
|
232
|
+
export declare function parsePermissionsRequest(value: unknown): PermissionsRequest;
|
|
233
|
+
/**
|
|
234
|
+
* Parses a permission response.
|
|
235
|
+
*
|
|
236
|
+
* @param value - The value to validate.
|
|
237
|
+
* @returns The parsed permission response.
|
|
238
|
+
*/
|
|
239
|
+
export declare function parsePermissionResponse(value: unknown): PermissionResponse;
|
|
240
|
+
/**
|
|
241
|
+
* Parses a list of permission responses.
|
|
242
|
+
*
|
|
243
|
+
* @param value - The value to validate.
|
|
244
|
+
* @returns The parsed permission response list.
|
|
245
|
+
*/
|
|
246
|
+
export declare function parsePermissionsResponse(value: unknown): PermissionsResponse;
|
|
247
|
+
/**
|
|
248
|
+
* Parses get-permissions-info result params.
|
|
249
|
+
*
|
|
250
|
+
* @param value - The value to validate.
|
|
251
|
+
* @returns The parsed get-permissions-info result params.
|
|
252
|
+
*/
|
|
253
|
+
export declare function parseGetPermissionsInfoResultParams(value: unknown): GetPermissionsInfoResultParams;
|
|
254
|
+
/**
|
|
255
|
+
* Parses supported execution permission metadata.
|
|
256
|
+
*
|
|
257
|
+
* @param value - The value to validate.
|
|
258
|
+
* @returns The parsed supported execution permissions result.
|
|
259
|
+
*/
|
|
260
|
+
export declare function parseGetSupportedExecutionPermissionsResult(value: unknown): GetSupportedExecutionPermissionsResult;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SupportedPermissionTypes, Permission } from '../permission/types.js';
|
|
3
|
+
import { Rule, SupportedRuleTypes } from '../rules/types.js';
|
|
4
|
+
import { getPermissionsInfoResultParamsSchema, getSupportedExecutionPermissionsResultSchema, initCodeDataSchema, permissionRequestSchema, permissionResponseSchema, permissionsRequestSchema, permissionsResponseSchema } from './schemas.js';
|
|
5
|
+
/**
|
|
6
|
+
* A request to grant erc-7715 permissions to a signer.
|
|
7
|
+
*/
|
|
8
|
+
export type PermissionRequest<TPermission extends SupportedPermissionTypes = SupportedPermissionTypes, TRule extends SupportedRuleTypes = SupportedRuleTypes> = z.infer<typeof permissionRequestSchema> & {
|
|
9
|
+
chainId: z.infer<typeof permissionRequestSchema>['chainId'];
|
|
10
|
+
from?: z.infer<typeof permissionRequestSchema>['from'];
|
|
11
|
+
to: z.infer<typeof permissionRequestSchema>['to'];
|
|
12
|
+
permission: Permission<TPermission>;
|
|
13
|
+
rules?: Rule<TRule>[] | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A request to grant erc-7715 permissions to a signer.
|
|
17
|
+
*/
|
|
18
|
+
export type PermissionsRequest = PermissionRequest<SupportedPermissionTypes, SupportedRuleTypes>[] & z.infer<typeof permissionsRequestSchema>;
|
|
19
|
+
export type InitCodeData = z.infer<typeof initCodeDataSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* A response to a request to grant erc-7715 permissions to a signer.
|
|
22
|
+
*/
|
|
23
|
+
export type PermissionResponse<TPermission extends SupportedPermissionTypes = SupportedPermissionTypes, TRule extends SupportedRuleTypes = SupportedRuleTypes> = z.infer<typeof permissionResponseSchema> & PermissionRequest<TPermission, TRule> & {
|
|
24
|
+
from: z.infer<typeof permissionResponseSchema>['from'];
|
|
25
|
+
/**
|
|
26
|
+
* The context is a catch-all to identify a permission for revoking permissions or redeeming permissions,
|
|
27
|
+
* and can contain non-identifying data as well. The context is required as defined in ERC-7710.
|
|
28
|
+
*/
|
|
29
|
+
context: z.infer<typeof permissionResponseSchema>['context'];
|
|
30
|
+
dependencies: InitCodeData[];
|
|
31
|
+
delegationManager: z.infer<typeof permissionResponseSchema>['delegationManager'];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A response to a request to grant erc-7715 permissions to a signer.
|
|
35
|
+
*/
|
|
36
|
+
export type PermissionsResponse = PermissionResponse<SupportedPermissionTypes, SupportedRuleTypes>[] & z.infer<typeof permissionsResponseSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* A response to allow a Wallet to specify the 7715 permission types and rules types it supports.
|
|
39
|
+
*/
|
|
40
|
+
export type GetPermissionsInfoResultParams = z.infer<typeof getPermissionsInfoResultParamsSchema>;
|
|
41
|
+
/**
|
|
42
|
+
* A response that include an object keyed on supported permission types including ruleTypes (string[]) that can be applied to the permission.
|
|
43
|
+
*/
|
|
44
|
+
export type GetSupportedExecutionPermissionsResult = Record<SupportedPermissionTypes, {
|
|
45
|
+
chainIds: z.infer<typeof getSupportedExecutionPermissionsResultSchema>['erc20-token-payment']['chainIds'];
|
|
46
|
+
ruleTypes: string[];
|
|
47
|
+
}>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { IdentityMintSignPayloadWithSignature } from '../../identity/types.js';
|
|
3
|
+
import type { ExpiryRule, IdentityMintRule, Rule } from './types.js';
|
|
4
|
+
export declare const identityTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
5
|
+
export declare const burnAuthSchema: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
6
|
+
export declare const identityMintSignPayloadWithSignatureSchema: z.ZodType<IdentityMintSignPayloadWithSignature>;
|
|
7
|
+
export declare const expiryRuleSchema: z.ZodObject<{
|
|
8
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
9
|
+
justification: z.ZodString;
|
|
10
|
+
type: z.ZodLiteral<"expiry">;
|
|
11
|
+
data: z.ZodObject<{
|
|
12
|
+
timestamp: z.ZodNumber;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export declare const identityMintRuleSchema: z.ZodObject<{
|
|
16
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
17
|
+
justification: z.ZodString;
|
|
18
|
+
type: z.ZodLiteral<"identity-mint">;
|
|
19
|
+
data: z.ZodObject<{
|
|
20
|
+
identityMintPayload: z.ZodType<IdentityMintSignPayloadWithSignature, unknown, z.core.$ZodTypeInternals<IdentityMintSignPayloadWithSignature, unknown>>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export declare const ruleSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
24
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
25
|
+
justification: z.ZodString;
|
|
26
|
+
type: z.ZodLiteral<"expiry">;
|
|
27
|
+
data: z.ZodObject<{
|
|
28
|
+
timestamp: z.ZodNumber;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
32
|
+
justification: z.ZodString;
|
|
33
|
+
type: z.ZodLiteral<"identity-mint">;
|
|
34
|
+
data: z.ZodObject<{
|
|
35
|
+
identityMintPayload: z.ZodType<IdentityMintSignPayloadWithSignature, unknown, z.core.$ZodTypeInternals<IdentityMintSignPayloadWithSignature, unknown>>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
}, z.core.$strict>], "type">;
|
|
38
|
+
export declare const ruleSchemas: {
|
|
39
|
+
expiry: z.ZodObject<{
|
|
40
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
41
|
+
justification: z.ZodString;
|
|
42
|
+
type: z.ZodLiteral<"expiry">;
|
|
43
|
+
data: z.ZodObject<{
|
|
44
|
+
timestamp: z.ZodNumber;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
identityMint: z.ZodObject<{
|
|
48
|
+
isAdjustmentAllowed: z.ZodBoolean;
|
|
49
|
+
justification: z.ZodString;
|
|
50
|
+
type: z.ZodLiteral<"identity-mint">;
|
|
51
|
+
data: z.ZodObject<{
|
|
52
|
+
identityMintPayload: z.ZodType<IdentityMintSignPayloadWithSignature, unknown, z.core.$ZodTypeInternals<IdentityMintSignPayloadWithSignature, unknown>>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Parses an expiry rule.
|
|
58
|
+
*
|
|
59
|
+
* @param value - The value to validate.
|
|
60
|
+
* @returns The parsed expiry rule.
|
|
61
|
+
*/
|
|
62
|
+
export declare function parseExpiryRule(value: unknown): ExpiryRule;
|
|
63
|
+
/**
|
|
64
|
+
* Parses an identity-mint rule.
|
|
65
|
+
*
|
|
66
|
+
* @param value - The value to validate.
|
|
67
|
+
* @returns The parsed identity-mint rule.
|
|
68
|
+
*/
|
|
69
|
+
export declare function parseIdentityMintRule(value: unknown): IdentityMintRule;
|
|
70
|
+
/**
|
|
71
|
+
* Parses any supported ERC-7715 rule.
|
|
72
|
+
*
|
|
73
|
+
* @param value - The value to validate.
|
|
74
|
+
* @returns The parsed rule.
|
|
75
|
+
*/
|
|
76
|
+
export declare function parseRule(value: unknown): Rule;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { expiryRuleSchema, identityMintRuleSchema, ruleSchema } from './schemas.js';
|
|
3
|
+
/**
|
|
4
|
+
* A rule that sets an expiry timestamp for a permission.
|
|
5
|
+
*/
|
|
6
|
+
export type ExpiryRule = z.infer<typeof expiryRuleSchema>;
|
|
7
|
+
/**
|
|
8
|
+
* A rule that sets an identity mint payload.
|
|
9
|
+
* It requires an identity to be minted before the permission can be used.
|
|
10
|
+
*/
|
|
11
|
+
export type IdentityMintRule = z.infer<typeof identityMintRuleSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* A mapping of rule types to their corresponding rule schemas.
|
|
14
|
+
*/
|
|
15
|
+
export type RuleTypeMapping = {
|
|
16
|
+
expiry: ExpiryRule;
|
|
17
|
+
identityMint: IdentityMintRule;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A type that represents the different types of rules.
|
|
21
|
+
*/
|
|
22
|
+
export type SupportedRuleTypes = keyof RuleTypeMapping;
|
|
23
|
+
/**
|
|
24
|
+
* A type that represents a rule.
|
|
25
|
+
*/
|
|
26
|
+
export type Rule<TRule extends SupportedRuleTypes = SupportedRuleTypes> = RuleTypeMapping[TRule] & z.infer<typeof ruleSchema>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import { type CashieIdentitySoulEip712Domain, type IdentityMintProofSignPayload, type IdentityMintProofTypedData, type IdentityMintSignPayload, type IdentityMintConsentTypedData } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Args for recipient identity mint consent (`IdentityMintConsent`, includes issuer `proof`).
|
|
5
|
+
*/
|
|
6
|
+
export type IdentityMintConsentArgs = {
|
|
7
|
+
/** Hex encoding of uint256 (e.g. `0x1`); same shape as payment intent / provider RPC `chainId`. */
|
|
8
|
+
chainId: Hex;
|
|
9
|
+
verifyingContract: Address;
|
|
10
|
+
message: IdentityMintSignPayload;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Args for Identity Verification Prover signing (`IdentityMintPayload`, excludes `proof` / `signature`).
|
|
14
|
+
*/
|
|
15
|
+
export type IdentityMintProofArgs = {
|
|
16
|
+
/** Hex encoding of uint256 (e.g. `0x1`); same shape as payment intent / provider RPC `chainId`. */
|
|
17
|
+
chainId: Hex;
|
|
18
|
+
verifyingContract: Address;
|
|
19
|
+
message: IdentityMintProofSignPayload;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Builds the EIP-712 domain used by `CashieIdentitySoul`
|
|
23
|
+
* (`EIP712(CashieIdentitySoul.NAME, CashieIdentitySoul.DOMAIN_VERSION)` in onchain `CashieIdentitySoul` contract).
|
|
24
|
+
*
|
|
25
|
+
* @param chainId Hex-encoded chain id (uint256)
|
|
26
|
+
* @param verifyingContract The address of the verifying contract
|
|
27
|
+
* @returns The EIP-712 domain
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildCashieIdentitySoulDomain(chainId: Hex, verifyingContract: Address): CashieIdentitySoulEip712Domain;
|
|
30
|
+
/**
|
|
31
|
+
* Constructs typed-data for the recipient consent signer (`IdentityMintConsent`).
|
|
32
|
+
* Pass the result to `walletClient.signTypedData` or any EIP-1193 `eth_signTypedData_v4` flow.
|
|
33
|
+
*
|
|
34
|
+
* The `message` must include issuer `proof` and must **not** include `signature`.
|
|
35
|
+
*
|
|
36
|
+
* @param args Consent typed-data args
|
|
37
|
+
* @returns Recipient consent typed data
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildIdentityMintConsentTypedData(args: IdentityMintConsentArgs): IdentityMintConsentTypedData;
|
|
40
|
+
/**
|
|
41
|
+
* Constructs typed-data for the Identity Verification Prover (`IdentityMintPayload`).
|
|
42
|
+
* Pass the result to `walletClient.signTypedData` or any EIP-1193 `eth_signTypedData_v4` flow.
|
|
43
|
+
*
|
|
44
|
+
* The `message` must **not** include `proof` or `signature`.
|
|
45
|
+
*
|
|
46
|
+
* @param args Prover typed-data args
|
|
47
|
+
* @returns Prover proof typed data
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildIdentityMintProofTypedData(args: IdentityMintProofArgs): IdentityMintProofTypedData;
|
|
50
|
+
/**
|
|
51
|
+
* EIP-712 digest for recipient consent EIP-1271 verification
|
|
52
|
+
* (`IdentitySoulEncoderLib.hashIdentityMintConsent`).
|
|
53
|
+
*
|
|
54
|
+
* @param args Consent typed-data args
|
|
55
|
+
* @returns The EIP-712 digest
|
|
56
|
+
*/
|
|
57
|
+
export declare function hashIdentityMintConsentTypedData(args: IdentityMintConsentArgs): Hex;
|
|
58
|
+
/**
|
|
59
|
+
* EIP-712 digest for issuer / prover EIP-1271 verification
|
|
60
|
+
* (`IdentitySoulEncoderLib.hashIdentityMintPayload`).
|
|
61
|
+
*
|
|
62
|
+
* @param args Prover typed-data args
|
|
63
|
+
* @returns The EIP-712 digest
|
|
64
|
+
*/
|
|
65
|
+
export declare function hashIdentityMintProofTypedData(args: IdentityMintProofArgs): Hex;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Same as `IdentityTokenIdLib.tokenIdFor` — `uint256(uint160(account))`.
|
|
4
|
+
*
|
|
5
|
+
* @param account Holder address (checksum-normalized)
|
|
6
|
+
* @returns ERC-721 token id for `CashieIdentitySoul`
|
|
7
|
+
*/
|
|
8
|
+
export declare function identityTokenIdFor(account: Address): bigint;
|
|
9
|
+
/**
|
|
10
|
+
* Same as `IdentityTokenIdLib.accountFor` — `address(uint160(tokenId))` (high bits ignored).
|
|
11
|
+
*
|
|
12
|
+
* @param tokenId On-chain token id (may include junk above bit 159)
|
|
13
|
+
* @returns Address from the low 160 bits
|
|
14
|
+
*/
|
|
15
|
+
export declare function identityAccountFor(tokenId: bigint): Address;
|
|
16
|
+
/**
|
|
17
|
+
* Off-chain **`keccak256`** over the canonical commitment preimage string.
|
|
18
|
+
* Kept here (vs `cashieIdentitySoulTypedData.ts`) so EIP-712 wiring stays focused on typed-data signing.
|
|
19
|
+
*
|
|
20
|
+
* @param providerId Provider id segment
|
|
21
|
+
* @param account Account segment
|
|
22
|
+
* @returns Digest (`Hex`) of ``keccak256(`0x${providerId}-${account}`)``
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildIdentityCommitmentHash(providerId: string, account: string): Hex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './plaidIdvErrors.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error codes returned by Plaid Identity Verification handlers.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum PlaidIdvErrorCode {
|
|
5
|
+
IDV_SESSION_SUCCESS = "IDV_SESSION_SUCCESS",
|
|
6
|
+
IDV_SESSION_PENDING_REVIEW = "IDV_SESSION_PENDING_REVIEW",
|
|
7
|
+
INVALID_IDV_SESSION = "INVALID_IDV_SESSION",
|
|
8
|
+
IDV_MAX_FAILED_VERIFICATION_THRESHOLD_REACHED = "IDV_MAX_FAILED_VERIFICATION_THRESHOLD_REACHED"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Human-readable messages keyed by {@link PlaidIdvErrorCode}.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PLAID_IDV_ERROR_MESSAGE: Record<PlaidIdvErrorCode, string>;
|
|
14
|
+
export type PlaidIdvErrorBody = {
|
|
15
|
+
error_code: PlaidIdvErrorCode;
|
|
16
|
+
error_message: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Build the `{ error_code, error_message }` body for a Plaid IDV error.
|
|
20
|
+
*
|
|
21
|
+
* @param code - Stable error code
|
|
22
|
+
* @returns JSON error body
|
|
23
|
+
*/
|
|
24
|
+
export declare const plaidIdvError: (code: PlaidIdvErrorCode) => PlaidIdvErrorBody;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IssueIdentityProofRequest, IssuedIdentityProofResponse } from './types.js';
|
|
2
|
+
interface IIdentityIssuer {
|
|
3
|
+
issueIdentityProof(request: IssueIdentityProofRequest): Promise<IssuedIdentityProofResponse>;
|
|
4
|
+
isSupportedIdentityIssuerId(identityIssuerId: string): boolean;
|
|
5
|
+
}
|
|
6
|
+
export type IdentityIssuerArgs = {
|
|
7
|
+
idvProverUrl: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class IdentityIssuer implements IIdentityIssuer {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(config: IdentityIssuerArgs);
|
|
12
|
+
private postIdvProver;
|
|
13
|
+
/**
|
|
14
|
+
* POST /api/idv/generate-identity-proof — Issue identity proof for Cashie Identity Soul
|
|
15
|
+
*
|
|
16
|
+
* @param params - The parameters for generating the identity proof.
|
|
17
|
+
* @returns Promise resolving to the issued identity proof.
|
|
18
|
+
*/
|
|
19
|
+
private generatePlaidIdentityProof;
|
|
20
|
+
/**
|
|
21
|
+
* POST /api/idv/generate-identity-proof — Issue identity proof for Cashie Identity Soul
|
|
22
|
+
*
|
|
23
|
+
* @param params - The parameters for generating the identity proof.
|
|
24
|
+
* @returns Promise resolving to the issued identity proof.
|
|
25
|
+
*/
|
|
26
|
+
private generateBusinessIdentityProof;
|
|
27
|
+
issueIdentityProof(request: IssueIdentityProofRequest): Promise<IssuedIdentityProofResponse>;
|
|
28
|
+
isSupportedIdentityIssuerId(identityIssuerId: string): boolean;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { IdentityMintSignPayload } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Issued identity proof from an Identity Verification Prover flow.
|
|
5
|
+
* Client supplies `to` and asks the recipient to sign `IdentityMintConsent` over these fields + `proof`.
|
|
6
|
+
*/
|
|
7
|
+
export type IssuedIdentityProofResponse = Omit<IdentityMintSignPayload, 'to'>;
|
|
8
|
+
/**
|
|
9
|
+
* Supported identity issuer IDs for identity verification for Cashie Identity Soul.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum IdentityIssuerId {
|
|
12
|
+
PLAID = "plaid-identity",
|
|
13
|
+
BUSINESS = "business-identity"
|
|
14
|
+
}
|
|
15
|
+
export type PlaidIssueIdentityProofParams = {
|
|
16
|
+
account: Address;
|
|
17
|
+
};
|
|
18
|
+
export type BusinessIssueIdentityProofParams = {
|
|
19
|
+
account: Address;
|
|
20
|
+
/**
|
|
21
|
+
* Site hostname without scheme (e.g. `merchant.example.com`).
|
|
22
|
+
*/
|
|
23
|
+
domain: string;
|
|
24
|
+
};
|
|
25
|
+
export type IdentityProofParamsToType = {
|
|
26
|
+
[IdentityIssuerId.PLAID]: PlaidIssueIdentityProofParams;
|
|
27
|
+
[IdentityIssuerId.BUSINESS]: BusinessIssueIdentityProofParams;
|
|
28
|
+
};
|
|
29
|
+
export type SupportedIssueIdentityProofParams = keyof IdentityProofParamsToType;
|
|
30
|
+
export type IssueIdentityProofRequest = {
|
|
31
|
+
[K in SupportedIssueIdentityProofParams]: {
|
|
32
|
+
identityIssuerId: K;
|
|
33
|
+
params: IdentityProofParamsToType[K];
|
|
34
|
+
};
|
|
35
|
+
}[SupportedIssueIdentityProofParams];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './soulManager.js';
|