@privy-io/api-types 0.10.0 → 0.11.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 +8 -0
- package/client.d.mts +18 -24
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -24
- package/client.d.ts.map +1 -1
- package/client.js +6 -12
- package/client.js.map +1 -1
- package/client.mjs +6 -12
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/client-auth.d.mts +496 -514
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +496 -514
- package/resources/client-auth.d.ts.map +1 -1
- package/resources/client-auth.js.map +1 -1
- package/resources/client-auth.mjs.map +1 -1
- package/resources/embedded-wallets.d.mts +9 -9
- package/resources/embedded-wallets.d.mts.map +1 -1
- package/resources/embedded-wallets.d.ts +9 -9
- package/resources/embedded-wallets.d.ts.map +1 -1
- package/resources/fiat.d.mts +110 -0
- package/resources/fiat.d.mts.map +1 -0
- package/resources/fiat.d.ts +110 -0
- package/resources/fiat.d.ts.map +1 -0
- package/resources/fiat.js +9 -0
- package/resources/fiat.js.map +1 -0
- package/resources/fiat.mjs +5 -0
- package/resources/fiat.mjs.map +1 -0
- package/resources/funding.d.mts +46 -46
- package/resources/funding.d.mts.map +1 -1
- package/resources/funding.d.ts +46 -46
- package/resources/funding.d.ts.map +1 -1
- package/resources/index.d.mts +9 -8
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +9 -8
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/key-quorums.d.mts +1 -132
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +1 -132
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/key-quorums.js +0 -92
- package/resources/key-quorums.js.map +1 -1
- package/resources/key-quorums.mjs +0 -92
- package/resources/key-quorums.mjs.map +1 -1
- package/resources/policies.d.mts +1 -311
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +1 -311
- package/resources/policies.d.ts.map +1 -1
- package/resources/policies.js +0 -229
- package/resources/policies.js.map +1 -1
- package/resources/policies.mjs +0 -229
- package/resources/policies.mjs.map +1 -1
- package/resources/transactions.d.mts +28 -44
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +28 -44
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +0 -17
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +0 -17
- package/resources/transactions.mjs.map +1 -1
- package/resources/users.d.mts +1 -345
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +1 -345
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +0 -272
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +0 -272
- package/resources/users.mjs.map +1 -1
- package/resources/wallets/index.d.mts +1 -1
- package/resources/wallets/index.d.mts.map +1 -1
- package/resources/wallets/index.d.ts +1 -1
- package/resources/wallets/index.d.ts.map +1 -1
- package/resources/wallets/index.js.map +1 -1
- package/resources/wallets/index.mjs.map +1 -1
- package/resources/wallets/wallets.d.mts +130 -315
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +130 -315
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js +41 -102
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs +41 -102
- package/resources/wallets/wallets.mjs.map +1 -1
- package/src/client.ts +106 -152
- package/src/resources/client-auth.ts +743 -787
- package/src/resources/embedded-wallets.ts +14 -14
- package/src/resources/fiat.ts +177 -0
- package/src/resources/funding.ts +65 -65
- package/src/resources/index.ts +86 -106
- package/src/resources/key-quorums.ts +1 -203
- package/src/resources/policies.ts +1 -493
- package/src/resources/transactions.ts +35 -55
- package/src/resources/users.ts +1 -479
- package/src/resources/wallets/index.ts +4 -9
- package/src/resources/wallets/wallets.ts +182 -423
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -4,287 +4,8 @@ import { APIResource } from '../core/resource';
|
|
|
4
4
|
import * as PoliciesAPI from './policies';
|
|
5
5
|
import * as SharedAPI from './shared';
|
|
6
6
|
import * as WalletsAPI from './wallets/wallets';
|
|
7
|
-
import { APIPromise } from '../core/api-promise';
|
|
8
|
-
import { buildHeaders } from '../internal/headers';
|
|
9
|
-
import { RequestOptions } from '../internal/request-options';
|
|
10
|
-
import { path } from '../internal/utils/path';
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
* Operations related to policies
|
|
14
|
-
*/
|
|
15
|
-
export class Policies extends APIResource {
|
|
16
|
-
/**
|
|
17
|
-
* Create a new policy.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* const policy = await client.policies.create({
|
|
22
|
-
* chain_type: 'ethereum',
|
|
23
|
-
* name: 'x',
|
|
24
|
-
* rules: [
|
|
25
|
-
* {
|
|
26
|
-
* action: 'ALLOW',
|
|
27
|
-
* conditions: [
|
|
28
|
-
* {
|
|
29
|
-
* field: 'to',
|
|
30
|
-
* field_source: 'ethereum_transaction',
|
|
31
|
-
* operator: 'eq',
|
|
32
|
-
* value: 'string',
|
|
33
|
-
* },
|
|
34
|
-
* ],
|
|
35
|
-
* method: 'eth_sendTransaction',
|
|
36
|
-
* name: 'x',
|
|
37
|
-
* },
|
|
38
|
-
* ],
|
|
39
|
-
* version: '1.0',
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
create(params: PolicyCreateParams, options?: RequestOptions): APIPromise<Policy> {
|
|
44
|
-
const { 'privy-idempotency-key': privyIdempotencyKey, ...body } = params;
|
|
45
|
-
return this._client.post('/v1/policies', {
|
|
46
|
-
body,
|
|
47
|
-
...options,
|
|
48
|
-
headers: buildHeaders([
|
|
49
|
-
{ ...(privyIdempotencyKey != null ? { 'privy-idempotency-key': privyIdempotencyKey } : undefined) },
|
|
50
|
-
options?.headers,
|
|
51
|
-
]),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Create a new rule for a policy.
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```ts
|
|
60
|
-
* const policyRuleResponse =
|
|
61
|
-
* await client.policies._createRule(
|
|
62
|
-
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
63
|
-
* {
|
|
64
|
-
* action: 'ALLOW',
|
|
65
|
-
* conditions: [
|
|
66
|
-
* {
|
|
67
|
-
* field: 'to',
|
|
68
|
-
* field_source: 'ethereum_transaction',
|
|
69
|
-
* operator: 'eq',
|
|
70
|
-
* value: 'string',
|
|
71
|
-
* },
|
|
72
|
-
* ],
|
|
73
|
-
* method: 'eth_sendTransaction',
|
|
74
|
-
* name: 'x',
|
|
75
|
-
* },
|
|
76
|
-
* );
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
_createRule(
|
|
80
|
-
policyID: string,
|
|
81
|
-
params: PolicyCreateRuleParams,
|
|
82
|
-
options?: RequestOptions,
|
|
83
|
-
): APIPromise<PolicyRuleResponse> {
|
|
84
|
-
const {
|
|
85
|
-
'privy-authorization-signature': privyAuthorizationSignature,
|
|
86
|
-
'privy-request-expiry': privyRequestExpiry,
|
|
87
|
-
...body
|
|
88
|
-
} = params;
|
|
89
|
-
return this._client.post(path`/v1/policies/${policyID}/rules`, {
|
|
90
|
-
body,
|
|
91
|
-
...options,
|
|
92
|
-
headers: buildHeaders([
|
|
93
|
-
{
|
|
94
|
-
...(privyAuthorizationSignature != null ?
|
|
95
|
-
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
96
|
-
: undefined),
|
|
97
|
-
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
98
|
-
},
|
|
99
|
-
options?.headers,
|
|
100
|
-
]),
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Delete a policy by policy ID.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```ts
|
|
109
|
-
* const successResponse = await client.policies._delete(
|
|
110
|
-
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
111
|
-
* );
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
_delete(
|
|
115
|
-
policyID: string,
|
|
116
|
-
params: PolicyDeleteParams | null | undefined = {},
|
|
117
|
-
options?: RequestOptions,
|
|
118
|
-
): APIPromise<SharedAPI.SuccessResponse> {
|
|
119
|
-
const {
|
|
120
|
-
'privy-authorization-signature': privyAuthorizationSignature,
|
|
121
|
-
'privy-request-expiry': privyRequestExpiry,
|
|
122
|
-
} = params ?? {};
|
|
123
|
-
return this._client.delete(path`/v1/policies/${policyID}`, {
|
|
124
|
-
...options,
|
|
125
|
-
headers: buildHeaders([
|
|
126
|
-
{
|
|
127
|
-
...(privyAuthorizationSignature != null ?
|
|
128
|
-
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
129
|
-
: undefined),
|
|
130
|
-
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
131
|
-
},
|
|
132
|
-
options?.headers,
|
|
133
|
-
]),
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Delete a rule by policy ID and rule ID.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```ts
|
|
142
|
-
* const successResponse = await client.policies._deleteRule(
|
|
143
|
-
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
144
|
-
* { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
|
|
145
|
-
* );
|
|
146
|
-
* ```
|
|
147
|
-
*/
|
|
148
|
-
_deleteRule(
|
|
149
|
-
ruleID: string,
|
|
150
|
-
params: PolicyDeleteRuleParams,
|
|
151
|
-
options?: RequestOptions,
|
|
152
|
-
): APIPromise<SharedAPI.SuccessResponse> {
|
|
153
|
-
const {
|
|
154
|
-
policy_id,
|
|
155
|
-
'privy-authorization-signature': privyAuthorizationSignature,
|
|
156
|
-
'privy-request-expiry': privyRequestExpiry,
|
|
157
|
-
} = params;
|
|
158
|
-
return this._client.delete(path`/v1/policies/${policy_id}/rules/${ruleID}`, {
|
|
159
|
-
...options,
|
|
160
|
-
headers: buildHeaders([
|
|
161
|
-
{
|
|
162
|
-
...(privyAuthorizationSignature != null ?
|
|
163
|
-
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
164
|
-
: undefined),
|
|
165
|
-
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
166
|
-
},
|
|
167
|
-
options?.headers,
|
|
168
|
-
]),
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Update a policy by policy ID.
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```ts
|
|
177
|
-
* const policy = await client.policies._update(
|
|
178
|
-
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
179
|
-
* );
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
_update(policyID: string, params: PolicyUpdateParams, options?: RequestOptions): APIPromise<Policy> {
|
|
183
|
-
const {
|
|
184
|
-
'privy-authorization-signature': privyAuthorizationSignature,
|
|
185
|
-
'privy-request-expiry': privyRequestExpiry,
|
|
186
|
-
...body
|
|
187
|
-
} = params;
|
|
188
|
-
return this._client.patch(path`/v1/policies/${policyID}`, {
|
|
189
|
-
body,
|
|
190
|
-
...options,
|
|
191
|
-
headers: buildHeaders([
|
|
192
|
-
{
|
|
193
|
-
...(privyAuthorizationSignature != null ?
|
|
194
|
-
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
195
|
-
: undefined),
|
|
196
|
-
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
197
|
-
},
|
|
198
|
-
options?.headers,
|
|
199
|
-
]),
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Update a rule by policy ID and rule ID.
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* ```ts
|
|
208
|
-
* const policyRuleResponse =
|
|
209
|
-
* await client.policies._updateRule(
|
|
210
|
-
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
211
|
-
* {
|
|
212
|
-
* policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
213
|
-
* action: 'ALLOW',
|
|
214
|
-
* conditions: [
|
|
215
|
-
* {
|
|
216
|
-
* field: 'to',
|
|
217
|
-
* field_source: 'ethereum_transaction',
|
|
218
|
-
* operator: 'eq',
|
|
219
|
-
* value: 'string',
|
|
220
|
-
* },
|
|
221
|
-
* ],
|
|
222
|
-
* method: 'eth_sendTransaction',
|
|
223
|
-
* name: 'x',
|
|
224
|
-
* },
|
|
225
|
-
* );
|
|
226
|
-
* ```
|
|
227
|
-
*/
|
|
228
|
-
_updateRule(
|
|
229
|
-
ruleID: string,
|
|
230
|
-
params: PolicyUpdateRuleParams,
|
|
231
|
-
options?: RequestOptions,
|
|
232
|
-
): APIPromise<PolicyRuleResponse> {
|
|
233
|
-
const {
|
|
234
|
-
policy_id,
|
|
235
|
-
'privy-authorization-signature': privyAuthorizationSignature,
|
|
236
|
-
'privy-request-expiry': privyRequestExpiry,
|
|
237
|
-
...body
|
|
238
|
-
} = params;
|
|
239
|
-
return this._client.patch(path`/v1/policies/${policy_id}/rules/${ruleID}`, {
|
|
240
|
-
body,
|
|
241
|
-
...options,
|
|
242
|
-
headers: buildHeaders([
|
|
243
|
-
{
|
|
244
|
-
...(privyAuthorizationSignature != null ?
|
|
245
|
-
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
246
|
-
: undefined),
|
|
247
|
-
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
248
|
-
},
|
|
249
|
-
options?.headers,
|
|
250
|
-
]),
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Get a policy by policy ID.
|
|
256
|
-
*
|
|
257
|
-
* @example
|
|
258
|
-
* ```ts
|
|
259
|
-
* const policy = await client.policies.get(
|
|
260
|
-
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
261
|
-
* );
|
|
262
|
-
* ```
|
|
263
|
-
*/
|
|
264
|
-
get(policyID: string, options?: RequestOptions): APIPromise<Policy> {
|
|
265
|
-
return this._client.get(path`/v1/policies/${policyID}`, options);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Get a rule by policy ID and rule ID.
|
|
270
|
-
*
|
|
271
|
-
* @example
|
|
272
|
-
* ```ts
|
|
273
|
-
* const policyRuleResponse = await client.policies.getRule(
|
|
274
|
-
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
275
|
-
* { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
|
|
276
|
-
* );
|
|
277
|
-
* ```
|
|
278
|
-
*/
|
|
279
|
-
getRule(
|
|
280
|
-
ruleID: string,
|
|
281
|
-
params: PolicyGetRuleParams,
|
|
282
|
-
options?: RequestOptions,
|
|
283
|
-
): APIPromise<PolicyRuleResponse> {
|
|
284
|
-
const { policy_id } = params;
|
|
285
|
-
return this._client.get(path`/v1/policies/${policy_id}/rules/${ruleID}`, options);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
8
|
+
export class Policies extends APIResource {}
|
|
288
9
|
|
|
289
10
|
/**
|
|
290
11
|
* A parameter in a Solidity ABI function or event definition.
|
|
@@ -1046,212 +767,6 @@ export interface UpdateConditionSetRequestBody {
|
|
|
1046
767
|
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
1047
768
|
}
|
|
1048
769
|
|
|
1049
|
-
export interface PolicyCreateParams {
|
|
1050
|
-
/**
|
|
1051
|
-
* Body param: The wallet chain types.
|
|
1052
|
-
*/
|
|
1053
|
-
chain_type: WalletsAPI.WalletChainType;
|
|
1054
|
-
|
|
1055
|
-
/**
|
|
1056
|
-
* Body param: Name to assign to policy.
|
|
1057
|
-
*/
|
|
1058
|
-
name: string;
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
* Body param
|
|
1062
|
-
*/
|
|
1063
|
-
rules: Array<PolicyCreateParams.Rule>;
|
|
1064
|
-
|
|
1065
|
-
/**
|
|
1066
|
-
* Body param: Version of the policy. Currently, 1.0 is the only version.
|
|
1067
|
-
*/
|
|
1068
|
-
version: '1.0';
|
|
1069
|
-
|
|
1070
|
-
/**
|
|
1071
|
-
* Body param: The owner of the resource, specified as a Privy user ID, a P-256
|
|
1072
|
-
* public key, or null to remove the current owner.
|
|
1073
|
-
*/
|
|
1074
|
-
owner?: SharedAPI.OwnerInput | null;
|
|
1075
|
-
|
|
1076
|
-
/**
|
|
1077
|
-
* Body param: The key quorum ID to set as the owner of the resource. If you
|
|
1078
|
-
* provide this, do not specify an owner.
|
|
1079
|
-
*/
|
|
1080
|
-
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
1081
|
-
|
|
1082
|
-
/**
|
|
1083
|
-
* Header param: Idempotency keys ensure API requests are executed only once within
|
|
1084
|
-
* a 24-hour window.
|
|
1085
|
-
*/
|
|
1086
|
-
'privy-idempotency-key'?: string;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
export namespace PolicyCreateParams {
|
|
1090
|
-
export interface Rule {
|
|
1091
|
-
/**
|
|
1092
|
-
* The action to take when a policy rule matches.
|
|
1093
|
-
*/
|
|
1094
|
-
action: PoliciesAPI.PolicyAction;
|
|
1095
|
-
|
|
1096
|
-
conditions: Array<PoliciesAPI.PolicyCondition>;
|
|
1097
|
-
|
|
1098
|
-
/**
|
|
1099
|
-
* Method the rule applies to.
|
|
1100
|
-
*/
|
|
1101
|
-
method: PoliciesAPI.PolicyMethod;
|
|
1102
|
-
|
|
1103
|
-
name: string;
|
|
1104
|
-
|
|
1105
|
-
id?: string;
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
export interface PolicyCreateRuleParams {
|
|
1110
|
-
/**
|
|
1111
|
-
* Body param: The action to take when a policy rule matches.
|
|
1112
|
-
*/
|
|
1113
|
-
action: PolicyAction;
|
|
1114
|
-
|
|
1115
|
-
/**
|
|
1116
|
-
* Body param
|
|
1117
|
-
*/
|
|
1118
|
-
conditions: Array<PolicyCondition>;
|
|
1119
|
-
|
|
1120
|
-
/**
|
|
1121
|
-
* Body param: Method the rule applies to.
|
|
1122
|
-
*/
|
|
1123
|
-
method: PolicyMethod;
|
|
1124
|
-
|
|
1125
|
-
/**
|
|
1126
|
-
* Body param
|
|
1127
|
-
*/
|
|
1128
|
-
name: string;
|
|
1129
|
-
|
|
1130
|
-
/**
|
|
1131
|
-
* Header param: Request authorization signature. If multiple signatures are
|
|
1132
|
-
* required, they should be comma separated.
|
|
1133
|
-
*/
|
|
1134
|
-
'privy-authorization-signature'?: string;
|
|
1135
|
-
|
|
1136
|
-
/**
|
|
1137
|
-
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1138
|
-
* representing the deadline by which the request must be processed.
|
|
1139
|
-
*/
|
|
1140
|
-
'privy-request-expiry'?: string;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
export interface PolicyDeleteParams {
|
|
1144
|
-
/**
|
|
1145
|
-
* Request authorization signature. If multiple signatures are required, they
|
|
1146
|
-
* should be comma separated.
|
|
1147
|
-
*/
|
|
1148
|
-
'privy-authorization-signature'?: string;
|
|
1149
|
-
|
|
1150
|
-
/**
|
|
1151
|
-
* Request expiry. Value is a Unix timestamp in milliseconds representing the
|
|
1152
|
-
* deadline by which the request must be processed.
|
|
1153
|
-
*/
|
|
1154
|
-
'privy-request-expiry'?: string;
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
export interface PolicyDeleteRuleParams {
|
|
1158
|
-
/**
|
|
1159
|
-
* Path param
|
|
1160
|
-
*/
|
|
1161
|
-
policy_id: string;
|
|
1162
|
-
|
|
1163
|
-
/**
|
|
1164
|
-
* Header param: Request authorization signature. If multiple signatures are
|
|
1165
|
-
* required, they should be comma separated.
|
|
1166
|
-
*/
|
|
1167
|
-
'privy-authorization-signature'?: string;
|
|
1168
|
-
|
|
1169
|
-
/**
|
|
1170
|
-
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1171
|
-
* representing the deadline by which the request must be processed.
|
|
1172
|
-
*/
|
|
1173
|
-
'privy-request-expiry'?: string;
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
export interface PolicyUpdateParams {
|
|
1177
|
-
/**
|
|
1178
|
-
* Body param: Name to assign to policy.
|
|
1179
|
-
*/
|
|
1180
|
-
name?: string;
|
|
1181
|
-
|
|
1182
|
-
/**
|
|
1183
|
-
* Body param: The owner of the resource, specified as a Privy user ID, a P-256
|
|
1184
|
-
* public key, or null to remove the current owner.
|
|
1185
|
-
*/
|
|
1186
|
-
owner?: SharedAPI.OwnerInput | null;
|
|
1187
|
-
|
|
1188
|
-
/**
|
|
1189
|
-
* Body param: The key quorum ID to set as the owner of the resource. If you
|
|
1190
|
-
* provide this, do not specify an owner.
|
|
1191
|
-
*/
|
|
1192
|
-
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
1193
|
-
|
|
1194
|
-
/**
|
|
1195
|
-
* Body param
|
|
1196
|
-
*/
|
|
1197
|
-
rules?: Array<PolicyRuleRequestBody>;
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* Header param: Request authorization signature. If multiple signatures are
|
|
1201
|
-
* required, they should be comma separated.
|
|
1202
|
-
*/
|
|
1203
|
-
'privy-authorization-signature'?: string;
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1207
|
-
* representing the deadline by which the request must be processed.
|
|
1208
|
-
*/
|
|
1209
|
-
'privy-request-expiry'?: string;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
export interface PolicyUpdateRuleParams {
|
|
1213
|
-
/**
|
|
1214
|
-
* Path param
|
|
1215
|
-
*/
|
|
1216
|
-
policy_id: string;
|
|
1217
|
-
|
|
1218
|
-
/**
|
|
1219
|
-
* Body param: The action to take when a policy rule matches.
|
|
1220
|
-
*/
|
|
1221
|
-
action: PolicyAction;
|
|
1222
|
-
|
|
1223
|
-
/**
|
|
1224
|
-
* Body param
|
|
1225
|
-
*/
|
|
1226
|
-
conditions: Array<PolicyCondition>;
|
|
1227
|
-
|
|
1228
|
-
/**
|
|
1229
|
-
* Body param: Method the rule applies to.
|
|
1230
|
-
*/
|
|
1231
|
-
method: PolicyMethod;
|
|
1232
|
-
|
|
1233
|
-
/**
|
|
1234
|
-
* Body param
|
|
1235
|
-
*/
|
|
1236
|
-
name: string;
|
|
1237
|
-
|
|
1238
|
-
/**
|
|
1239
|
-
* Header param: Request authorization signature. If multiple signatures are
|
|
1240
|
-
* required, they should be comma separated.
|
|
1241
|
-
*/
|
|
1242
|
-
'privy-authorization-signature'?: string;
|
|
1243
|
-
|
|
1244
|
-
/**
|
|
1245
|
-
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1246
|
-
* representing the deadline by which the request must be processed.
|
|
1247
|
-
*/
|
|
1248
|
-
'privy-request-expiry'?: string;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
export interface PolicyGetRuleParams {
|
|
1252
|
-
policy_id: string;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
770
|
export declare namespace Policies {
|
|
1256
771
|
export {
|
|
1257
772
|
type AbiParameter as AbiParameter,
|
|
@@ -1295,12 +810,5 @@ export declare namespace Policies {
|
|
|
1295
810
|
type TronCalldataCondition as TronCalldataCondition,
|
|
1296
811
|
type TronTransactionCondition as TronTransactionCondition,
|
|
1297
812
|
type UpdateConditionSetRequestBody as UpdateConditionSetRequestBody,
|
|
1298
|
-
type PolicyCreateParams as PolicyCreateParams,
|
|
1299
|
-
type PolicyCreateRuleParams as PolicyCreateRuleParams,
|
|
1300
|
-
type PolicyDeleteParams as PolicyDeleteParams,
|
|
1301
|
-
type PolicyDeleteRuleParams as PolicyDeleteRuleParams,
|
|
1302
|
-
type PolicyUpdateParams as PolicyUpdateParams,
|
|
1303
|
-
type PolicyUpdateRuleParams as PolicyUpdateRuleParams,
|
|
1304
|
-
type PolicyGetRuleParams as PolicyGetRuleParams,
|
|
1305
813
|
};
|
|
1306
814
|
}
|
|
@@ -1,60 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
-
import { APIPromise } from '../core/api-promise';
|
|
5
|
-
import { RequestOptions } from '../internal/request-options';
|
|
6
|
-
import { path } from '../internal/utils/path';
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
* Operations related to transactions
|
|
10
|
-
*/
|
|
11
|
-
export class Transactions extends APIResource {
|
|
12
|
-
/**
|
|
13
|
-
* Get a transaction by transaction ID.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const transaction = await client.transactions.get(
|
|
18
|
-
* 'transaction_id',
|
|
19
|
-
* );
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
get(transactionID: string, options?: RequestOptions): APIPromise<Transaction> {
|
|
23
|
-
return this._client.get(path`/v1/transactions/${transactionID}`, options);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The request body for scanning a transaction.
|
|
29
|
-
*/
|
|
30
|
-
export interface TransactionScanningRequestBody {
|
|
31
|
-
chain_id: string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Additional information for Blockaid to validate against.
|
|
35
|
-
*/
|
|
36
|
-
metadata: TransactionScanningMetadata;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Raw RPC request to execute with the wallet.
|
|
40
|
-
*/
|
|
41
|
-
request: TransactionScanningRpcRequest;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The response from scanning a transaction.
|
|
46
|
-
*/
|
|
47
|
-
export interface TransactionScanningResponseBody {
|
|
48
|
-
/**
|
|
49
|
-
* The simulation result from a transaction scan.
|
|
50
|
-
*/
|
|
51
|
-
simulation: TransactionScanningSimulationResult;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The validation result from a transaction scan.
|
|
55
|
-
*/
|
|
56
|
-
validation: TransactionScanningValidationResult;
|
|
57
|
-
}
|
|
5
|
+
export class Transactions extends APIResource {}
|
|
58
6
|
|
|
59
7
|
/**
|
|
60
8
|
* A transaction from a Privy wallet.
|
|
@@ -188,6 +136,38 @@ export interface TransactionScanningParams {
|
|
|
188
136
|
value?: string;
|
|
189
137
|
}
|
|
190
138
|
|
|
139
|
+
/**
|
|
140
|
+
* The request body for scanning a transaction.
|
|
141
|
+
*/
|
|
142
|
+
export interface TransactionScanningRequestBody {
|
|
143
|
+
chain_id: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Additional information for Blockaid to validate against.
|
|
147
|
+
*/
|
|
148
|
+
metadata: TransactionScanningMetadata;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Raw RPC request to execute with the wallet.
|
|
152
|
+
*/
|
|
153
|
+
request: TransactionScanningRpcRequest;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The response from scanning a transaction.
|
|
158
|
+
*/
|
|
159
|
+
export interface TransactionScanningResponseBody {
|
|
160
|
+
/**
|
|
161
|
+
* The simulation result from a transaction scan.
|
|
162
|
+
*/
|
|
163
|
+
simulation: TransactionScanningSimulationResult;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The validation result from a transaction scan.
|
|
167
|
+
*/
|
|
168
|
+
validation: TransactionScanningValidationResult;
|
|
169
|
+
}
|
|
170
|
+
|
|
191
171
|
/**
|
|
192
172
|
* Raw RPC request to execute with the wallet.
|
|
193
173
|
*/
|
|
@@ -256,8 +236,6 @@ export interface TransactionScanningValidationSuccessResult {
|
|
|
256
236
|
|
|
257
237
|
export declare namespace Transactions {
|
|
258
238
|
export {
|
|
259
|
-
type TransactionScanningRequestBody as TransactionScanningRequestBody,
|
|
260
|
-
type TransactionScanningResponseBody as TransactionScanningResponseBody,
|
|
261
239
|
type Transaction as Transaction,
|
|
262
240
|
type TransactionList as TransactionList,
|
|
263
241
|
type TransactionScanningAssetDiff as TransactionScanningAssetDiff,
|
|
@@ -267,6 +245,8 @@ export declare namespace Transactions {
|
|
|
267
245
|
type TransactionScanningExposure as TransactionScanningExposure,
|
|
268
246
|
type TransactionScanningMetadata as TransactionScanningMetadata,
|
|
269
247
|
type TransactionScanningParams as TransactionScanningParams,
|
|
248
|
+
type TransactionScanningRequestBody as TransactionScanningRequestBody,
|
|
249
|
+
type TransactionScanningResponseBody as TransactionScanningResponseBody,
|
|
270
250
|
type TransactionScanningRpcRequest as TransactionScanningRpcRequest,
|
|
271
251
|
type TransactionScanningSimulationErrorResult as TransactionScanningSimulationErrorResult,
|
|
272
252
|
type TransactionScanningSimulationResult as TransactionScanningSimulationResult,
|