@openfort/openfort-node 0.7.7 → 0.8.1
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 +12 -0
- package/biome.json +2 -1
- package/dist/index.d.mts +4835 -437
- package/dist/index.d.ts +4835 -437
- package/dist/index.js +929 -124
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +813 -118
- package/dist/index.mjs.map +1 -1
- package/examples/README.md +28 -11
- package/examples/{policies → fee-sponsorship}/createPolicy.ts +2 -2
- package/examples/{policies → fee-sponsorship}/createPolicyRule.ts +3 -3
- package/examples/{policies → fee-sponsorship}/disableEnablePolicy.ts +4 -4
- package/examples/fee-sponsorship/getPolicy.ts +30 -0
- package/examples/fee-sponsorship/listPolicies.ts +17 -0
- package/examples/{policies → fee-sponsorship}/listPolicyRules.ts +4 -4
- package/examples/fee-sponsorship/updatePolicy.ts +29 -0
- package/examples/policies/createAccountPolicy.ts +73 -0
- package/examples/policies/createEvmPolicy.ts +149 -0
- package/examples/policies/createSolanaPolicy.ts +176 -0
- package/examples/policies/createTypedDataPolicy.ts +159 -0
- package/examples/policies/deletePolicy.ts +34 -0
- package/examples/policies/getPolicy.ts +24 -13
- package/examples/policies/listPolicies.ts +19 -2
- package/examples/policies/multiRulePolicy.ts +133 -0
- package/examples/policies/updatePolicy.ts +64 -16
- package/examples/policies/validatePolicy.ts +176 -0
- package/examples/transactions/createTransactionIntent.ts +2 -2
- package/examples/transactions/estimateGas.ts +2 -2
- package/examples/transactions/getTransactionIntent.ts +2 -2
- package/openapi.json +2352 -1142
- package/package.json +4 -3
- package/pnpm-workspace.yaml +1 -0
package/dist/index.js
CHANGED
|
@@ -68,6 +68,19 @@ __export(index_exports, {
|
|
|
68
68
|
CreateBackendWalletResponseObject: () => CreateBackendWalletResponseObject,
|
|
69
69
|
CreateEmbeddedRequestAccountType: () => CreateEmbeddedRequestAccountType,
|
|
70
70
|
CreateEmbeddedRequestChainType: () => CreateEmbeddedRequestChainType,
|
|
71
|
+
CreatePolicyBodySchema: () => CreatePolicyBodySchema,
|
|
72
|
+
CreatePolicyV2RequestScope: () => CreatePolicyV2RequestScope,
|
|
73
|
+
CreatePolicyV2RuleRequestAction: () => CreatePolicyV2RuleRequestAction,
|
|
74
|
+
CriteriaOperator: () => CriteriaOperator,
|
|
75
|
+
CriteriaOperatorEQUAL: () => CriteriaOperatorEQUAL,
|
|
76
|
+
CriteriaOperatorGREATERTHAN: () => CriteriaOperatorGREATERTHAN,
|
|
77
|
+
CriteriaOperatorGREATERTHANOREQUAL: () => CriteriaOperatorGREATERTHANOREQUAL,
|
|
78
|
+
CriteriaOperatorIN: () => CriteriaOperatorIN,
|
|
79
|
+
CriteriaOperatorLESSTHAN: () => CriteriaOperatorLESSTHAN,
|
|
80
|
+
CriteriaOperatorLESSTHANOREQUAL: () => CriteriaOperatorLESSTHANOREQUAL,
|
|
81
|
+
CriteriaOperatorMATCH: () => CriteriaOperatorMATCH,
|
|
82
|
+
CriteriaOperatorNOTIN: () => CriteriaOperatorNOTIN,
|
|
83
|
+
CriteriaType: () => CriteriaType,
|
|
71
84
|
Currency: () => Currency,
|
|
72
85
|
DeleteBackendWalletResponseObject: () => DeleteBackendWalletResponseObject,
|
|
73
86
|
DeveloperAccountResponseExpandable: () => DeveloperAccountResponseExpandable,
|
|
@@ -87,6 +100,8 @@ __export(index_exports, {
|
|
|
87
100
|
EntityTypePLAYER: () => EntityTypePLAYER,
|
|
88
101
|
EntityTypePOLICY: () => EntityTypePOLICY,
|
|
89
102
|
EntityTypePOLICYRULE: () => EntityTypePOLICYRULE,
|
|
103
|
+
EntityTypePOLICYV2: () => EntityTypePOLICYV2,
|
|
104
|
+
EntityTypePOLICYV2RULE: () => EntityTypePOLICYV2RULE,
|
|
90
105
|
EntityTypePROJECT: () => EntityTypePROJECT,
|
|
91
106
|
EntityTypeREADCONTRACT: () => EntityTypeREADCONTRACT,
|
|
92
107
|
EntityTypeSESSION: () => EntityTypeSESSION,
|
|
@@ -98,7 +113,43 @@ __export(index_exports, {
|
|
|
98
113
|
EntityTypeUSER: () => EntityTypeUSER,
|
|
99
114
|
EntityTypeWALLET: () => EntityTypeWALLET,
|
|
100
115
|
ErrorTypeINVALIDREQUESTERROR: () => ErrorTypeINVALIDREQUESTERROR,
|
|
116
|
+
EthValueCriterionOperator: () => EthValueCriterionOperator,
|
|
117
|
+
EthValueCriterionRequestOperator: () => EthValueCriterionRequestOperator,
|
|
118
|
+
EthValueCriterionRequestType: () => EthValueCriterionRequestType,
|
|
119
|
+
EthValueCriterionSchema: () => EthValueCriterionSchema,
|
|
120
|
+
EvaluatePolicyV2ResponseObject: () => EvaluatePolicyV2ResponseObject,
|
|
121
|
+
EvmAddressCriterionOperator: () => EvmAddressCriterionOperator,
|
|
122
|
+
EvmAddressCriterionRequestOperator: () => EvmAddressCriterionRequestOperator,
|
|
123
|
+
EvmAddressCriterionRequestType: () => EvmAddressCriterionRequestType,
|
|
124
|
+
EvmAddressCriterionSchema: () => EvmAddressCriterionSchema,
|
|
101
125
|
EvmClient: () => EvmClient,
|
|
126
|
+
EvmCriteriaType: () => EvmCriteriaType,
|
|
127
|
+
EvmCriteriaTypeETHVALUE: () => EvmCriteriaTypeETHVALUE,
|
|
128
|
+
EvmCriteriaTypeEVMADDRESS: () => EvmCriteriaTypeEVMADDRESS,
|
|
129
|
+
EvmCriteriaTypeEVMDATA: () => EvmCriteriaTypeEVMDATA,
|
|
130
|
+
EvmCriteriaTypeEVMMESSAGE: () => EvmCriteriaTypeEVMMESSAGE,
|
|
131
|
+
EvmCriteriaTypeEVMNETWORK: () => EvmCriteriaTypeEVMNETWORK,
|
|
132
|
+
EvmCriteriaTypeEVMTYPEDDATAFIELD: () => EvmCriteriaTypeEVMTYPEDDATAFIELD,
|
|
133
|
+
EvmCriteriaTypeEVMTYPEDDATAVERIFYINGCONTRACT: () => EvmCriteriaTypeEVMTYPEDDATAVERIFYINGCONTRACT,
|
|
134
|
+
EvmCriteriaTypeNETUSDCHANGE: () => EvmCriteriaTypeNETUSDCHANGE,
|
|
135
|
+
EvmDataCriterionRequestOperator: () => EvmDataCriterionRequestOperator,
|
|
136
|
+
EvmDataCriterionRequestType: () => EvmDataCriterionRequestType,
|
|
137
|
+
EvmDataCriterionSchema: () => EvmDataCriterionSchema,
|
|
138
|
+
EvmMessageCriterionRequestOperator: () => EvmMessageCriterionRequestOperator,
|
|
139
|
+
EvmMessageCriterionRequestType: () => EvmMessageCriterionRequestType,
|
|
140
|
+
EvmMessageCriterionSchema: () => EvmMessageCriterionSchema,
|
|
141
|
+
EvmNetworkCriterionOperator: () => EvmNetworkCriterionOperator,
|
|
142
|
+
EvmNetworkCriterionRequestOperator: () => EvmNetworkCriterionRequestOperator,
|
|
143
|
+
EvmNetworkCriterionRequestType: () => EvmNetworkCriterionRequestType,
|
|
144
|
+
EvmNetworkCriterionSchema: () => EvmNetworkCriterionSchema,
|
|
145
|
+
EvmTypedDataFieldCriterionOperator: () => EvmTypedDataFieldCriterionOperator,
|
|
146
|
+
EvmTypedDataFieldCriterionRequestOperator: () => EvmTypedDataFieldCriterionRequestOperator,
|
|
147
|
+
EvmTypedDataFieldCriterionRequestType: () => EvmTypedDataFieldCriterionRequestType,
|
|
148
|
+
EvmTypedDataFieldCriterionSchema: () => EvmTypedDataFieldCriterionSchema,
|
|
149
|
+
EvmTypedDataVerifyingContractCriterionOperator: () => EvmTypedDataVerifyingContractCriterionOperator,
|
|
150
|
+
EvmTypedDataVerifyingContractCriterionRequestOperator: () => EvmTypedDataVerifyingContractCriterionRequestOperator,
|
|
151
|
+
EvmTypedDataVerifyingContractCriterionRequestType: () => EvmTypedDataVerifyingContractCriterionRequestType,
|
|
152
|
+
EvmTypedDataVerifyingContractCriterionSchema: () => EvmTypedDataVerifyingContractCriterionSchema,
|
|
102
153
|
ExportPrivateKeyResponseObject: () => ExportPrivateKeyResponseObject,
|
|
103
154
|
GetAccountsV2AccountType: () => GetAccountsV2AccountType,
|
|
104
155
|
GetAccountsV2ChainType: () => GetAccountsV2ChainType,
|
|
@@ -115,9 +166,17 @@ __export(index_exports, {
|
|
|
115
166
|
JsonRpcRequestJsonrpc: () => JsonRpcRequestJsonrpc,
|
|
116
167
|
JsonRpcSuccessResponseAnyJsonrpc: () => JsonRpcSuccessResponseAnyJsonrpc,
|
|
117
168
|
ListBackendWalletsChainType: () => ListBackendWalletsChainType,
|
|
169
|
+
ListPoliciesScope: () => ListPoliciesScope,
|
|
170
|
+
MintAddressCriterionOperator: () => MintAddressCriterionOperator,
|
|
171
|
+
MintAddressCriterionRequestOperator: () => MintAddressCriterionRequestOperator,
|
|
172
|
+
MintAddressCriterionRequestType: () => MintAddressCriterionRequestType,
|
|
173
|
+
MintAddressCriterionSchema: () => MintAddressCriterionSchema,
|
|
118
174
|
MissingAPIKeyError: () => MissingAPIKeyError,
|
|
119
175
|
MissingPublishableKeyError: () => MissingPublishableKeyError,
|
|
120
176
|
MissingWalletSecretError: () => MissingWalletSecretError,
|
|
177
|
+
NetUSDChangeCriterionOperator: () => NetUSDChangeCriterionOperator,
|
|
178
|
+
NetUSDChangeCriterionRequestOperator: () => NetUSDChangeCriterionRequestOperator,
|
|
179
|
+
NetUSDChangeCriterionRequestType: () => NetUSDChangeCriterionRequestType,
|
|
121
180
|
NetworkError: () => NetworkError,
|
|
122
181
|
NextActionType: () => NextActionType,
|
|
123
182
|
OAuthProvider: () => OAuthProvider,
|
|
@@ -142,25 +201,77 @@ __export(index_exports, {
|
|
|
142
201
|
PolicyRuleTypeACCOUNT: () => PolicyRuleTypeACCOUNT,
|
|
143
202
|
PolicyRuleTypeCONTRACT: () => PolicyRuleTypeCONTRACT,
|
|
144
203
|
PolicyRuleTypeRATELIMIT: () => PolicyRuleTypeRATELIMIT,
|
|
204
|
+
PolicyV2Action: () => PolicyV2Action,
|
|
205
|
+
PolicyV2ListQueriesScope: () => PolicyV2ListQueriesScope,
|
|
206
|
+
PolicyV2Scope: () => PolicyV2Scope,
|
|
145
207
|
PregenerateAccountResponseCustody: () => PregenerateAccountResponseCustody,
|
|
146
208
|
PregenerateUserRequestV2AccountType: () => PregenerateUserRequestV2AccountType,
|
|
147
209
|
PregenerateUserRequestV2ChainType: () => PregenerateUserRequestV2ChainType,
|
|
148
210
|
PrismaSortOrder: () => PrismaSortOrder,
|
|
149
211
|
PrivateKeyPolicy: () => PrivateKeyPolicy,
|
|
212
|
+
ProgramIdCriterionOperator: () => ProgramIdCriterionOperator,
|
|
213
|
+
ProgramIdCriterionRequestOperator: () => ProgramIdCriterionRequestOperator,
|
|
214
|
+
ProgramIdCriterionRequestType: () => ProgramIdCriterionRequestType,
|
|
215
|
+
ProgramIdCriterionSchema: () => ProgramIdCriterionSchema,
|
|
150
216
|
ProjectStatsRequestTimeFrame: () => ProjectStatsRequestTimeFrame,
|
|
151
217
|
RegisterWalletSecretResponseObject: () => RegisterWalletSecretResponseObject,
|
|
152
218
|
ResponseTypeLIST: () => ResponseTypeLIST,
|
|
153
219
|
RevokeWalletSecretResponseObject: () => RevokeWalletSecretResponseObject,
|
|
154
220
|
RotateWalletSecretResponseObject: () => RotateWalletSecretResponseObject,
|
|
221
|
+
RuleSchema: () => RuleSchema,
|
|
222
|
+
SendEvmTransactionRuleSchema: () => SendEvmTransactionRuleSchema,
|
|
223
|
+
SendSolTransactionRuleSchema: () => SendSolTransactionRuleSchema,
|
|
155
224
|
SessionResponseExpandable: () => SessionResponseExpandable,
|
|
156
225
|
ShieldAuthProvider: () => import_shield_js2.ShieldAuthProvider,
|
|
226
|
+
SignEvmHashRuleSchema: () => SignEvmHashRuleSchema,
|
|
227
|
+
SignEvmMessageRuleSchema: () => SignEvmMessageRuleSchema,
|
|
228
|
+
SignEvmTransactionRuleSchema: () => SignEvmTransactionRuleSchema,
|
|
229
|
+
SignEvmTypedDataRuleSchema: () => SignEvmTypedDataRuleSchema,
|
|
157
230
|
SignResponseObject: () => SignResponseObject,
|
|
231
|
+
SignSolMessageRuleSchema: () => SignSolMessageRuleSchema,
|
|
232
|
+
SignSolTransactionRuleSchema: () => SignSolTransactionRuleSchema,
|
|
158
233
|
SmsProviderMESSAGEBIRD: () => SmsProviderMESSAGEBIRD,
|
|
159
234
|
SmsProviderSMSAPI: () => SmsProviderSMSAPI,
|
|
160
235
|
SmsProviderTWILIO: () => SmsProviderTWILIO,
|
|
161
236
|
SmsProviderTXTLOCAL: () => SmsProviderTXTLOCAL,
|
|
162
237
|
SmsProviderVONAGE: () => SmsProviderVONAGE,
|
|
238
|
+
SolAddressCriterionOperator: () => SolAddressCriterionOperator,
|
|
239
|
+
SolAddressCriterionRequestOperator: () => SolAddressCriterionRequestOperator,
|
|
240
|
+
SolAddressCriterionRequestType: () => SolAddressCriterionRequestType,
|
|
241
|
+
SolAddressCriterionSchema: () => SolAddressCriterionSchema,
|
|
242
|
+
SolDataCriterionRequestOperator: () => SolDataCriterionRequestOperator,
|
|
243
|
+
SolDataCriterionRequestType: () => SolDataCriterionRequestType,
|
|
244
|
+
SolDataCriterionSchema: () => SolDataCriterionSchema,
|
|
245
|
+
SolMessageCriterionRequestOperator: () => SolMessageCriterionRequestOperator,
|
|
246
|
+
SolMessageCriterionRequestType: () => SolMessageCriterionRequestType,
|
|
247
|
+
SolMessageCriterionSchema: () => SolMessageCriterionSchema,
|
|
248
|
+
SolNetworkCriterionOperator: () => SolNetworkCriterionOperator,
|
|
249
|
+
SolNetworkCriterionRequestOperator: () => SolNetworkCriterionRequestOperator,
|
|
250
|
+
SolNetworkCriterionRequestType: () => SolNetworkCriterionRequestType,
|
|
251
|
+
SolNetworkCriterionSchema: () => SolNetworkCriterionSchema,
|
|
252
|
+
SolValueCriterionOperator: () => SolValueCriterionOperator,
|
|
253
|
+
SolValueCriterionRequestOperator: () => SolValueCriterionRequestOperator,
|
|
254
|
+
SolValueCriterionRequestType: () => SolValueCriterionRequestType,
|
|
255
|
+
SolValueCriterionSchema: () => SolValueCriterionSchema,
|
|
163
256
|
SolanaClient: () => SolanaClient,
|
|
257
|
+
SolanaCriteriaType: () => SolanaCriteriaType,
|
|
258
|
+
SolanaCriteriaTypeMINTADDRESS: () => SolanaCriteriaTypeMINTADDRESS,
|
|
259
|
+
SolanaCriteriaTypePROGRAMID: () => SolanaCriteriaTypePROGRAMID,
|
|
260
|
+
SolanaCriteriaTypeSOLADDRESS: () => SolanaCriteriaTypeSOLADDRESS,
|
|
261
|
+
SolanaCriteriaTypeSOLDATA: () => SolanaCriteriaTypeSOLDATA,
|
|
262
|
+
SolanaCriteriaTypeSOLMESSAGE: () => SolanaCriteriaTypeSOLMESSAGE,
|
|
263
|
+
SolanaCriteriaTypeSOLNETWORK: () => SolanaCriteriaTypeSOLNETWORK,
|
|
264
|
+
SolanaCriteriaTypeSOLVALUE: () => SolanaCriteriaTypeSOLVALUE,
|
|
265
|
+
SolanaCriteriaTypeSPLADDRESS: () => SolanaCriteriaTypeSPLADDRESS,
|
|
266
|
+
SolanaCriteriaTypeSPLVALUE: () => SolanaCriteriaTypeSPLVALUE,
|
|
267
|
+
SplAddressCriterionOperator: () => SplAddressCriterionOperator,
|
|
268
|
+
SplAddressCriterionRequestOperator: () => SplAddressCriterionRequestOperator,
|
|
269
|
+
SplAddressCriterionRequestType: () => SplAddressCriterionRequestType,
|
|
270
|
+
SplAddressCriterionSchema: () => SplAddressCriterionSchema,
|
|
271
|
+
SplValueCriterionOperator: () => SplValueCriterionOperator,
|
|
272
|
+
SplValueCriterionRequestOperator: () => SplValueCriterionRequestOperator,
|
|
273
|
+
SplValueCriterionRequestType: () => SplValueCriterionRequestType,
|
|
274
|
+
SplValueCriterionSchema: () => SplValueCriterionSchema,
|
|
164
275
|
SponsorSchema: () => SponsorSchema,
|
|
165
276
|
SponsorSchemaCHARGECUSTOMTOKENS: () => SponsorSchemaCHARGECUSTOMTOKENS,
|
|
166
277
|
SponsorSchemaFIXEDRATE: () => SponsorSchemaFIXEDRATE,
|
|
@@ -182,6 +293,7 @@ __export(index_exports, {
|
|
|
182
293
|
TransactionIntentResponseExpandable: () => TransactionIntentResponseExpandable,
|
|
183
294
|
TransactionStatus: () => TransactionStatus,
|
|
184
295
|
UnknownError: () => UnknownError,
|
|
296
|
+
UpdatePolicyBodySchema: () => UpdatePolicyBodySchema,
|
|
185
297
|
UserInputValidationError: () => UserInputValidationError,
|
|
186
298
|
UserProjectCreateRequestRole: () => UserProjectCreateRequestRole,
|
|
187
299
|
UserProjectRole: () => UserProjectRole,
|
|
@@ -195,8 +307,6 @@ __export(index_exports, {
|
|
|
195
307
|
authorize: () => authorize,
|
|
196
308
|
callbackOAuth: () => callbackOAuth,
|
|
197
309
|
cancelTransferAccountOwnership: () => cancelTransferAccountOwnership,
|
|
198
|
-
cancelTransferOwnership: () => cancelTransferOwnership,
|
|
199
|
-
completeRecovery: () => completeRecovery,
|
|
200
310
|
configure: () => configure,
|
|
201
311
|
create: () => create,
|
|
202
312
|
createAccount: () => createAccount,
|
|
@@ -213,6 +323,7 @@ __export(index_exports, {
|
|
|
213
323
|
createPlayer: () => createPlayer,
|
|
214
324
|
createPolicy: () => createPolicy,
|
|
215
325
|
createPolicyRule: () => createPolicyRule,
|
|
326
|
+
createPolicyV2: () => createPolicyV2,
|
|
216
327
|
createPolicyWithdrawal: () => createPolicyWithdrawal,
|
|
217
328
|
createSession: () => createSession,
|
|
218
329
|
createSubscription: () => createSubscription,
|
|
@@ -231,16 +342,17 @@ __export(index_exports, {
|
|
|
231
342
|
deletePlayer: () => deletePlayer,
|
|
232
343
|
deletePolicy: () => deletePolicy,
|
|
233
344
|
deletePolicyRule: () => deletePolicyRule,
|
|
345
|
+
deletePolicyV2: () => deletePolicyV2,
|
|
234
346
|
deleteSubscription: () => deleteSubscription,
|
|
235
347
|
deleteTrigger: () => deleteTrigger,
|
|
236
348
|
deleteUser: () => deleteUser,
|
|
237
|
-
deployAccount: () => deployAccount,
|
|
238
349
|
deprecatedCallbackOAuth: () => deprecatedCallbackOAuth,
|
|
239
350
|
disableAccount: () => disableAccount,
|
|
240
351
|
disablePolicy: () => disablePolicy,
|
|
241
352
|
enablePolicy: () => enablePolicy,
|
|
242
353
|
encryptForImport: () => encryptForImport,
|
|
243
354
|
estimateTransactionIntentCost: () => estimateTransactionIntentCost,
|
|
355
|
+
evaluatePolicyV2: () => evaluatePolicyV2,
|
|
244
356
|
exportPrivateKey: () => exportPrivateKey,
|
|
245
357
|
generateRSAKeyPair: () => generateRSAKeyPair,
|
|
246
358
|
getAccount: () => getAccount,
|
|
@@ -273,6 +385,7 @@ __export(index_exports, {
|
|
|
273
385
|
getPolicyReportTransactionIntents: () => getPolicyReportTransactionIntents,
|
|
274
386
|
getPolicyRules: () => getPolicyRules,
|
|
275
387
|
getPolicyTotalGasUsage: () => getPolicyTotalGasUsage,
|
|
388
|
+
getPolicyV2: () => getPolicyV2,
|
|
276
389
|
getProjectLogs: () => getProjectLogs,
|
|
277
390
|
getSession: () => getSession,
|
|
278
391
|
getSignerIdByAddress: () => getSignerIdByAddress,
|
|
@@ -302,6 +415,7 @@ __export(index_exports, {
|
|
|
302
415
|
listForwarderContracts: () => listForwarderContracts,
|
|
303
416
|
listOAuthConfig: () => listOAuthConfig,
|
|
304
417
|
listPaymasters: () => listPaymasters,
|
|
418
|
+
listPolicies: () => listPolicies,
|
|
305
419
|
listSubscriptionLogs: () => listSubscriptionLogs,
|
|
306
420
|
loginEmailPassword: () => loginEmailPassword,
|
|
307
421
|
loginOIDC: () => loginOIDC,
|
|
@@ -320,20 +434,16 @@ __export(index_exports, {
|
|
|
320
434
|
requestEmailVerification: () => requestEmailVerification,
|
|
321
435
|
requestResetPassword: () => requestResetPassword,
|
|
322
436
|
requestTransferAccountOwnership: () => requestTransferAccountOwnership,
|
|
323
|
-
requestTransferOwnership: () => requestTransferOwnership,
|
|
324
437
|
resetPassword: () => resetPassword,
|
|
325
438
|
revokeSession: () => revokeSession,
|
|
326
439
|
revokeWalletSecret: () => revokeWalletSecret,
|
|
327
440
|
rotateWalletSecret: () => rotateWalletSecret,
|
|
328
441
|
sign: () => sign,
|
|
329
|
-
signPayload: () => signPayload,
|
|
330
442
|
signPayloadDeveloperAccount: () => signPayloadDeveloperAccount,
|
|
331
443
|
signature: () => signature,
|
|
332
444
|
signatureSession: () => signatureSession,
|
|
333
445
|
signupEmailPassword: () => signupEmailPassword,
|
|
334
|
-
startRecovery: () => startRecovery,
|
|
335
446
|
switchChainV2: () => switchChainV2,
|
|
336
|
-
syncAccount: () => syncAccount,
|
|
337
447
|
testTrigger: () => testTrigger,
|
|
338
448
|
thirdParty: () => thirdParty,
|
|
339
449
|
thirdPartyV2: () => thirdPartyV2,
|
|
@@ -349,6 +459,7 @@ __export(index_exports, {
|
|
|
349
459
|
updatePlayer: () => updatePlayer,
|
|
350
460
|
updatePolicy: () => updatePolicy,
|
|
351
461
|
updatePolicyRule: () => updatePolicyRule,
|
|
462
|
+
updatePolicyV2: () => updatePolicyV2,
|
|
352
463
|
verifyAuthToken: () => verifyAuthToken,
|
|
353
464
|
verifyEmail: () => verifyEmail,
|
|
354
465
|
verifyOAuthToken: () => verifyOAuthToken
|
|
@@ -719,7 +830,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
|
|
|
719
830
|
}
|
|
720
831
|
|
|
721
832
|
// src/version.ts
|
|
722
|
-
var VERSION = "0.
|
|
833
|
+
var VERSION = "0.8.1";
|
|
723
834
|
var PACKAGE = "@openfort/openfort-node";
|
|
724
835
|
|
|
725
836
|
// src/openapi-client/openfortApiClient.ts
|
|
@@ -788,6 +899,10 @@ var configure = (options) => {
|
|
|
788
899
|
retryDelay: import_axios_retry.exponentialDelay,
|
|
789
900
|
retries: 3,
|
|
790
901
|
retryCondition: (error) => {
|
|
902
|
+
const hasWalletAuth = error.config?.headers?.["X-Wallet-Auth"] !== void 0;
|
|
903
|
+
if (hasWalletAuth) {
|
|
904
|
+
return false;
|
|
905
|
+
}
|
|
791
906
|
return import_axios_retry.default.isNetworkOrIdempotentRequestError(error) || error.response?.status !== void 0 && error.response.status >= 500;
|
|
792
907
|
}
|
|
793
908
|
});
|
|
@@ -923,7 +1038,8 @@ function handleResponseError(statusCode, responseData, cause) {
|
|
|
923
1038
|
const correlationId = isOpenfortError(responseData) ? responseData.correlationId : void 0;
|
|
924
1039
|
let errorMessage;
|
|
925
1040
|
if (isOpenfortError(responseData)) {
|
|
926
|
-
|
|
1041
|
+
const nestedMessage = responseData.error && typeof responseData.error === "object" ? responseData.error.message : void 0;
|
|
1042
|
+
errorMessage = responseData.message || nestedMessage || (typeof responseData.error === "string" ? responseData.error : void 0) || "Unknown error";
|
|
927
1043
|
} else if (typeof responseData === "string") {
|
|
928
1044
|
errorMessage = responseData;
|
|
929
1045
|
} else if (responseData) {
|
|
@@ -949,7 +1065,7 @@ function handleResponseError(statusCode, responseData, cause) {
|
|
|
949
1065
|
throw new APIError(
|
|
950
1066
|
statusCode,
|
|
951
1067
|
"unauthorized",
|
|
952
|
-
"Unauthorized. Check your API key.",
|
|
1068
|
+
errorMessage || "Unauthorized. Check your API key.",
|
|
953
1069
|
correlationId,
|
|
954
1070
|
`${ERROR_DOCS_URL}#unauthorized`,
|
|
955
1071
|
cause
|
|
@@ -1104,81 +1220,6 @@ var disableAccount = (id, options) => {
|
|
|
1104
1220
|
options
|
|
1105
1221
|
);
|
|
1106
1222
|
};
|
|
1107
|
-
var requestTransferOwnership = (id, transferOwnershipRequest, options) => {
|
|
1108
|
-
return openfortApiClient(
|
|
1109
|
-
{
|
|
1110
|
-
url: `/v1/accounts/${id}/request_transfer_ownership`,
|
|
1111
|
-
method: "POST",
|
|
1112
|
-
headers: { "Content-Type": "application/json" },
|
|
1113
|
-
data: transferOwnershipRequest
|
|
1114
|
-
},
|
|
1115
|
-
options
|
|
1116
|
-
);
|
|
1117
|
-
};
|
|
1118
|
-
var cancelTransferOwnership = (id, cancelTransferOwnershipRequest, options) => {
|
|
1119
|
-
return openfortApiClient(
|
|
1120
|
-
{
|
|
1121
|
-
url: `/v1/accounts/${id}/cancel_transfer_ownership`,
|
|
1122
|
-
method: "POST",
|
|
1123
|
-
headers: { "Content-Type": "application/json" },
|
|
1124
|
-
data: cancelTransferOwnershipRequest
|
|
1125
|
-
},
|
|
1126
|
-
options
|
|
1127
|
-
);
|
|
1128
|
-
};
|
|
1129
|
-
var signPayload = (id, signPayloadRequest, options) => {
|
|
1130
|
-
return openfortApiClient(
|
|
1131
|
-
{
|
|
1132
|
-
url: `/v1/accounts/${id}/sign_payload`,
|
|
1133
|
-
method: "POST",
|
|
1134
|
-
headers: { "Content-Type": "application/json" },
|
|
1135
|
-
data: signPayloadRequest
|
|
1136
|
-
},
|
|
1137
|
-
options
|
|
1138
|
-
);
|
|
1139
|
-
};
|
|
1140
|
-
var syncAccount = (id, options) => {
|
|
1141
|
-
return openfortApiClient(
|
|
1142
|
-
{
|
|
1143
|
-
url: `/v1/accounts/${id}/sync`,
|
|
1144
|
-
method: "POST"
|
|
1145
|
-
},
|
|
1146
|
-
options
|
|
1147
|
-
);
|
|
1148
|
-
};
|
|
1149
|
-
var deployAccount = (id, deployRequest, options) => {
|
|
1150
|
-
return openfortApiClient(
|
|
1151
|
-
{
|
|
1152
|
-
url: `/v1/accounts/${id}/deploy`,
|
|
1153
|
-
method: "POST",
|
|
1154
|
-
headers: { "Content-Type": "application/json" },
|
|
1155
|
-
data: deployRequest
|
|
1156
|
-
},
|
|
1157
|
-
options
|
|
1158
|
-
);
|
|
1159
|
-
};
|
|
1160
|
-
var startRecovery = (id, startRecoveryRequest, options) => {
|
|
1161
|
-
return openfortApiClient(
|
|
1162
|
-
{
|
|
1163
|
-
url: `/v1/accounts/${id}/start_recovery`,
|
|
1164
|
-
method: "POST",
|
|
1165
|
-
headers: { "Content-Type": "application/json" },
|
|
1166
|
-
data: startRecoveryRequest
|
|
1167
|
-
},
|
|
1168
|
-
options
|
|
1169
|
-
);
|
|
1170
|
-
};
|
|
1171
|
-
var completeRecovery = (id, completeRecoveryRequest, options) => {
|
|
1172
|
-
return openfortApiClient(
|
|
1173
|
-
{
|
|
1174
|
-
url: `/v1/accounts/${id}/complete_recovery`,
|
|
1175
|
-
method: "POST",
|
|
1176
|
-
headers: { "Content-Type": "application/json" },
|
|
1177
|
-
data: completeRecoveryRequest
|
|
1178
|
-
},
|
|
1179
|
-
options
|
|
1180
|
-
);
|
|
1181
|
-
};
|
|
1182
1223
|
|
|
1183
1224
|
// src/openapi-client/generated/accs-v2/accs-v2.ts
|
|
1184
1225
|
var getAccountsV2 = (params, options) => {
|
|
@@ -2613,7 +2654,11 @@ var APITopic = {
|
|
|
2613
2654
|
balanceproject: "balance.project",
|
|
2614
2655
|
balancecontract: "balance.contract",
|
|
2615
2656
|
balancedev_account: "balance.dev_account",
|
|
2616
|
-
test: "test"
|
|
2657
|
+
test: "test",
|
|
2658
|
+
usercreated: "user.created",
|
|
2659
|
+
userupdated: "user.updated",
|
|
2660
|
+
userdeleted: "user.deleted",
|
|
2661
|
+
accountcreated: "account.created"
|
|
2617
2662
|
};
|
|
2618
2663
|
var APITriggerType = {
|
|
2619
2664
|
webhook: "webhook",
|
|
@@ -2774,6 +2819,285 @@ var PregenerateUserRequestV2ChainType = {
|
|
|
2774
2819
|
EVM: "EVM",
|
|
2775
2820
|
SVM: "SVM"
|
|
2776
2821
|
};
|
|
2822
|
+
var PolicyV2Scope = {
|
|
2823
|
+
project: "project",
|
|
2824
|
+
account: "account"
|
|
2825
|
+
};
|
|
2826
|
+
var PolicyV2Action = {
|
|
2827
|
+
accept: "accept",
|
|
2828
|
+
reject: "reject"
|
|
2829
|
+
};
|
|
2830
|
+
var EvmCriteriaTypeEVMADDRESS = {
|
|
2831
|
+
evmAddress: "evmAddress"
|
|
2832
|
+
};
|
|
2833
|
+
var CriteriaOperatorIN = {
|
|
2834
|
+
in: "in"
|
|
2835
|
+
};
|
|
2836
|
+
var CriteriaOperatorNOTIN = {
|
|
2837
|
+
not_in: "not in"
|
|
2838
|
+
};
|
|
2839
|
+
var EvmCriteriaType = {
|
|
2840
|
+
evmAddress: "evmAddress",
|
|
2841
|
+
ethValue: "ethValue",
|
|
2842
|
+
evmNetwork: "evmNetwork",
|
|
2843
|
+
evmMessage: "evmMessage",
|
|
2844
|
+
evmData: "evmData",
|
|
2845
|
+
evmTypedDataVerifyingContract: "evmTypedDataVerifyingContract",
|
|
2846
|
+
evmTypedDataField: "evmTypedDataField",
|
|
2847
|
+
netUSDChange: "netUSDChange"
|
|
2848
|
+
};
|
|
2849
|
+
var SolanaCriteriaType = {
|
|
2850
|
+
solAddress: "solAddress",
|
|
2851
|
+
solValue: "solValue",
|
|
2852
|
+
splAddress: "splAddress",
|
|
2853
|
+
splValue: "splValue",
|
|
2854
|
+
mintAddress: "mintAddress",
|
|
2855
|
+
solData: "solData",
|
|
2856
|
+
programId: "programId",
|
|
2857
|
+
solNetwork: "solNetwork",
|
|
2858
|
+
solMessage: "solMessage"
|
|
2859
|
+
};
|
|
2860
|
+
var CriteriaType = { ...EvmCriteriaType, ...SolanaCriteriaType };
|
|
2861
|
+
var CriteriaOperator = {
|
|
2862
|
+
in: "in",
|
|
2863
|
+
not_in: "not in",
|
|
2864
|
+
"<": "<",
|
|
2865
|
+
"<=": "<=",
|
|
2866
|
+
">": ">",
|
|
2867
|
+
">=": ">=",
|
|
2868
|
+
"==": "==",
|
|
2869
|
+
match: "match"
|
|
2870
|
+
};
|
|
2871
|
+
var EvmAddressCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorNOTIN };
|
|
2872
|
+
var EvmCriteriaTypeETHVALUE = {
|
|
2873
|
+
ethValue: "ethValue"
|
|
2874
|
+
};
|
|
2875
|
+
var CriteriaOperatorLESSTHANOREQUAL = {
|
|
2876
|
+
"<=": "<="
|
|
2877
|
+
};
|
|
2878
|
+
var CriteriaOperatorGREATERTHANOREQUAL = {
|
|
2879
|
+
">=": ">="
|
|
2880
|
+
};
|
|
2881
|
+
var CriteriaOperatorLESSTHAN = {
|
|
2882
|
+
"<": "<"
|
|
2883
|
+
};
|
|
2884
|
+
var CriteriaOperatorGREATERTHAN = {
|
|
2885
|
+
">": ">"
|
|
2886
|
+
};
|
|
2887
|
+
var EthValueCriterionOperator = { ...CriteriaOperatorLESSTHANOREQUAL, ...CriteriaOperatorGREATERTHANOREQUAL, ...CriteriaOperatorLESSTHAN, ...CriteriaOperatorGREATERTHAN };
|
|
2888
|
+
var EvmCriteriaTypeEVMNETWORK = {
|
|
2889
|
+
evmNetwork: "evmNetwork"
|
|
2890
|
+
};
|
|
2891
|
+
var EvmNetworkCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorNOTIN };
|
|
2892
|
+
var EvmCriteriaTypeEVMMESSAGE = {
|
|
2893
|
+
evmMessage: "evmMessage"
|
|
2894
|
+
};
|
|
2895
|
+
var CriteriaOperatorMATCH = {
|
|
2896
|
+
match: "match"
|
|
2897
|
+
};
|
|
2898
|
+
var EvmCriteriaTypeEVMDATA = {
|
|
2899
|
+
evmData: "evmData"
|
|
2900
|
+
};
|
|
2901
|
+
var EvmCriteriaTypeEVMTYPEDDATAVERIFYINGCONTRACT = {
|
|
2902
|
+
evmTypedDataVerifyingContract: "evmTypedDataVerifyingContract"
|
|
2903
|
+
};
|
|
2904
|
+
var EvmTypedDataVerifyingContractCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorNOTIN };
|
|
2905
|
+
var EvmCriteriaTypeEVMTYPEDDATAFIELD = {
|
|
2906
|
+
evmTypedDataField: "evmTypedDataField"
|
|
2907
|
+
};
|
|
2908
|
+
var EvmTypedDataFieldCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorLESSTHANOREQUAL, ...CriteriaOperatorMATCH };
|
|
2909
|
+
var EvmCriteriaTypeNETUSDCHANGE = {
|
|
2910
|
+
netUSDChange: "netUSDChange"
|
|
2911
|
+
};
|
|
2912
|
+
var NetUSDChangeCriterionOperator = { ...CriteriaOperatorLESSTHANOREQUAL, ...CriteriaOperatorGREATERTHANOREQUAL };
|
|
2913
|
+
var SolanaCriteriaTypeSOLADDRESS = {
|
|
2914
|
+
solAddress: "solAddress"
|
|
2915
|
+
};
|
|
2916
|
+
var SolAddressCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorNOTIN };
|
|
2917
|
+
var SolanaCriteriaTypeSOLVALUE = {
|
|
2918
|
+
solValue: "solValue"
|
|
2919
|
+
};
|
|
2920
|
+
var SolValueCriterionOperator = { ...CriteriaOperatorLESSTHANOREQUAL, ...CriteriaOperatorGREATERTHANOREQUAL };
|
|
2921
|
+
var SolanaCriteriaTypeSPLADDRESS = {
|
|
2922
|
+
splAddress: "splAddress"
|
|
2923
|
+
};
|
|
2924
|
+
var SplAddressCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorNOTIN };
|
|
2925
|
+
var SolanaCriteriaTypeSPLVALUE = {
|
|
2926
|
+
splValue: "splValue"
|
|
2927
|
+
};
|
|
2928
|
+
var SplValueCriterionOperator = { ...CriteriaOperatorLESSTHANOREQUAL, ...CriteriaOperatorGREATERTHANOREQUAL };
|
|
2929
|
+
var SolanaCriteriaTypeMINTADDRESS = {
|
|
2930
|
+
mintAddress: "mintAddress"
|
|
2931
|
+
};
|
|
2932
|
+
var CriteriaOperatorEQUAL = {
|
|
2933
|
+
"==": "=="
|
|
2934
|
+
};
|
|
2935
|
+
var MintAddressCriterionOperator = { ...CriteriaOperatorEQUAL, ...CriteriaOperatorIN };
|
|
2936
|
+
var SolanaCriteriaTypeSOLDATA = {
|
|
2937
|
+
solData: "solData"
|
|
2938
|
+
};
|
|
2939
|
+
var SolanaCriteriaTypePROGRAMID = {
|
|
2940
|
+
programId: "programId"
|
|
2941
|
+
};
|
|
2942
|
+
var ProgramIdCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorNOTIN };
|
|
2943
|
+
var SolanaCriteriaTypeSOLNETWORK = {
|
|
2944
|
+
solNetwork: "solNetwork"
|
|
2945
|
+
};
|
|
2946
|
+
var SolNetworkCriterionOperator = { ...CriteriaOperatorIN, ...CriteriaOperatorNOTIN };
|
|
2947
|
+
var SolanaCriteriaTypeSOLMESSAGE = {
|
|
2948
|
+
solMessage: "solMessage"
|
|
2949
|
+
};
|
|
2950
|
+
var EntityTypePOLICYV2RULE = {
|
|
2951
|
+
policyV2Rule: "policyV2Rule"
|
|
2952
|
+
};
|
|
2953
|
+
var EntityTypePOLICYV2 = {
|
|
2954
|
+
policyV2: "policyV2"
|
|
2955
|
+
};
|
|
2956
|
+
var PolicyV2ListQueriesScope = {
|
|
2957
|
+
project: "project",
|
|
2958
|
+
account: "account"
|
|
2959
|
+
};
|
|
2960
|
+
var EvmAddressCriterionRequestType = {
|
|
2961
|
+
evmAddress: "evmAddress"
|
|
2962
|
+
};
|
|
2963
|
+
var EvmAddressCriterionRequestOperator = {
|
|
2964
|
+
in: "in",
|
|
2965
|
+
not_in: "not in"
|
|
2966
|
+
};
|
|
2967
|
+
var EthValueCriterionRequestType = {
|
|
2968
|
+
ethValue: "ethValue"
|
|
2969
|
+
};
|
|
2970
|
+
var EthValueCriterionRequestOperator = {
|
|
2971
|
+
"<=": "<=",
|
|
2972
|
+
">=": ">=",
|
|
2973
|
+
"<": "<",
|
|
2974
|
+
">": ">"
|
|
2975
|
+
};
|
|
2976
|
+
var EvmNetworkCriterionRequestType = {
|
|
2977
|
+
evmNetwork: "evmNetwork"
|
|
2978
|
+
};
|
|
2979
|
+
var EvmNetworkCriterionRequestOperator = {
|
|
2980
|
+
in: "in",
|
|
2981
|
+
not_in: "not in"
|
|
2982
|
+
};
|
|
2983
|
+
var EvmMessageCriterionRequestType = {
|
|
2984
|
+
evmMessage: "evmMessage"
|
|
2985
|
+
};
|
|
2986
|
+
var EvmMessageCriterionRequestOperator = {
|
|
2987
|
+
match: "match"
|
|
2988
|
+
};
|
|
2989
|
+
var EvmDataCriterionRequestType = {
|
|
2990
|
+
evmData: "evmData"
|
|
2991
|
+
};
|
|
2992
|
+
var EvmDataCriterionRequestOperator = {
|
|
2993
|
+
in: "in",
|
|
2994
|
+
not_in: "not in",
|
|
2995
|
+
"<": "<",
|
|
2996
|
+
"<=": "<=",
|
|
2997
|
+
">": ">",
|
|
2998
|
+
">=": ">=",
|
|
2999
|
+
"==": "==",
|
|
3000
|
+
match: "match"
|
|
3001
|
+
};
|
|
3002
|
+
var EvmTypedDataVerifyingContractCriterionRequestType = {
|
|
3003
|
+
evmTypedDataVerifyingContract: "evmTypedDataVerifyingContract"
|
|
3004
|
+
};
|
|
3005
|
+
var EvmTypedDataVerifyingContractCriterionRequestOperator = {
|
|
3006
|
+
in: "in",
|
|
3007
|
+
not_in: "not in"
|
|
3008
|
+
};
|
|
3009
|
+
var EvmTypedDataFieldCriterionRequestType = {
|
|
3010
|
+
evmTypedDataField: "evmTypedDataField"
|
|
3011
|
+
};
|
|
3012
|
+
var EvmTypedDataFieldCriterionRequestOperator = {
|
|
3013
|
+
in: "in",
|
|
3014
|
+
"<=": "<=",
|
|
3015
|
+
match: "match"
|
|
3016
|
+
};
|
|
3017
|
+
var NetUSDChangeCriterionRequestType = {
|
|
3018
|
+
netUSDChange: "netUSDChange"
|
|
3019
|
+
};
|
|
3020
|
+
var NetUSDChangeCriterionRequestOperator = {
|
|
3021
|
+
"<=": "<=",
|
|
3022
|
+
">=": ">="
|
|
3023
|
+
};
|
|
3024
|
+
var SolAddressCriterionRequestType = {
|
|
3025
|
+
solAddress: "solAddress"
|
|
3026
|
+
};
|
|
3027
|
+
var SolAddressCriterionRequestOperator = {
|
|
3028
|
+
in: "in",
|
|
3029
|
+
not_in: "not in"
|
|
3030
|
+
};
|
|
3031
|
+
var SolValueCriterionRequestType = {
|
|
3032
|
+
solValue: "solValue"
|
|
3033
|
+
};
|
|
3034
|
+
var SolValueCriterionRequestOperator = {
|
|
3035
|
+
"<=": "<=",
|
|
3036
|
+
">=": ">="
|
|
3037
|
+
};
|
|
3038
|
+
var SplAddressCriterionRequestType = {
|
|
3039
|
+
splAddress: "splAddress"
|
|
3040
|
+
};
|
|
3041
|
+
var SplAddressCriterionRequestOperator = {
|
|
3042
|
+
in: "in",
|
|
3043
|
+
not_in: "not in"
|
|
3044
|
+
};
|
|
3045
|
+
var SplValueCriterionRequestType = {
|
|
3046
|
+
splValue: "splValue"
|
|
3047
|
+
};
|
|
3048
|
+
var SplValueCriterionRequestOperator = {
|
|
3049
|
+
"<=": "<=",
|
|
3050
|
+
">=": ">="
|
|
3051
|
+
};
|
|
3052
|
+
var MintAddressCriterionRequestType = {
|
|
3053
|
+
mintAddress: "mintAddress"
|
|
3054
|
+
};
|
|
3055
|
+
var MintAddressCriterionRequestOperator = {
|
|
3056
|
+
"==": "==",
|
|
3057
|
+
in: "in"
|
|
3058
|
+
};
|
|
3059
|
+
var SolDataCriterionRequestType = {
|
|
3060
|
+
solData: "solData"
|
|
3061
|
+
};
|
|
3062
|
+
var SolDataCriterionRequestOperator = {
|
|
3063
|
+
in: "in",
|
|
3064
|
+
not_in: "not in",
|
|
3065
|
+
"<=": "<=",
|
|
3066
|
+
">=": ">=",
|
|
3067
|
+
"==": "==",
|
|
3068
|
+
match: "match"
|
|
3069
|
+
};
|
|
3070
|
+
var ProgramIdCriterionRequestType = {
|
|
3071
|
+
programId: "programId"
|
|
3072
|
+
};
|
|
3073
|
+
var ProgramIdCriterionRequestOperator = {
|
|
3074
|
+
in: "in",
|
|
3075
|
+
not_in: "not in"
|
|
3076
|
+
};
|
|
3077
|
+
var SolNetworkCriterionRequestType = {
|
|
3078
|
+
solNetwork: "solNetwork"
|
|
3079
|
+
};
|
|
3080
|
+
var SolNetworkCriterionRequestOperator = {
|
|
3081
|
+
in: "in",
|
|
3082
|
+
not_in: "not in"
|
|
3083
|
+
};
|
|
3084
|
+
var SolMessageCriterionRequestType = {
|
|
3085
|
+
solMessage: "solMessage"
|
|
3086
|
+
};
|
|
3087
|
+
var SolMessageCriterionRequestOperator = {
|
|
3088
|
+
match: "match"
|
|
3089
|
+
};
|
|
3090
|
+
var CreatePolicyV2RuleRequestAction = {
|
|
3091
|
+
accept: "accept",
|
|
3092
|
+
reject: "reject"
|
|
3093
|
+
};
|
|
3094
|
+
var CreatePolicyV2RequestScope = {
|
|
3095
|
+
project: "project",
|
|
3096
|
+
account: "account"
|
|
3097
|
+
};
|
|
3098
|
+
var EvaluatePolicyV2ResponseObject = {
|
|
3099
|
+
policy_evaluation: "policy_evaluation"
|
|
3100
|
+
};
|
|
2777
3101
|
var CreateEmbeddedRequestAccountType = {
|
|
2778
3102
|
Externally_Owned_Account: "Externally Owned Account",
|
|
2779
3103
|
Smart_Account: "Smart Account",
|
|
@@ -3055,6 +3379,10 @@ var AuthenticationType = {
|
|
|
3055
3379
|
var GetPolicyRulesExpandItem = {
|
|
3056
3380
|
contract: "contract"
|
|
3057
3381
|
};
|
|
3382
|
+
var ListPoliciesScope = {
|
|
3383
|
+
project: "project",
|
|
3384
|
+
account: "account"
|
|
3385
|
+
};
|
|
3058
3386
|
var ListBackendWalletsChainType = {
|
|
3059
3387
|
EVM: "EVM",
|
|
3060
3388
|
SVM: "SVM"
|
|
@@ -3310,6 +3638,67 @@ var createPolicyWithdrawal = (id, withdrawalPolicyRequest, options) => {
|
|
|
3310
3638
|
options
|
|
3311
3639
|
);
|
|
3312
3640
|
};
|
|
3641
|
+
var listPolicies = (params, options) => {
|
|
3642
|
+
return openfortApiClient(
|
|
3643
|
+
{
|
|
3644
|
+
url: `/v2/policies`,
|
|
3645
|
+
method: "GET",
|
|
3646
|
+
params
|
|
3647
|
+
},
|
|
3648
|
+
options
|
|
3649
|
+
);
|
|
3650
|
+
};
|
|
3651
|
+
var createPolicyV2 = (createPolicyV2Request, options) => {
|
|
3652
|
+
return openfortApiClient(
|
|
3653
|
+
{
|
|
3654
|
+
url: `/v2/policies`,
|
|
3655
|
+
method: "POST",
|
|
3656
|
+
headers: { "Content-Type": "application/json" },
|
|
3657
|
+
data: createPolicyV2Request
|
|
3658
|
+
},
|
|
3659
|
+
options
|
|
3660
|
+
);
|
|
3661
|
+
};
|
|
3662
|
+
var getPolicyV2 = (policyId, options) => {
|
|
3663
|
+
return openfortApiClient(
|
|
3664
|
+
{
|
|
3665
|
+
url: `/v2/policies/${policyId}`,
|
|
3666
|
+
method: "GET"
|
|
3667
|
+
},
|
|
3668
|
+
options
|
|
3669
|
+
);
|
|
3670
|
+
};
|
|
3671
|
+
var updatePolicyV2 = (policyId, updatePolicyV2Request, options) => {
|
|
3672
|
+
return openfortApiClient(
|
|
3673
|
+
{
|
|
3674
|
+
url: `/v2/policies/${policyId}`,
|
|
3675
|
+
method: "POST",
|
|
3676
|
+
headers: { "Content-Type": "application/json" },
|
|
3677
|
+
data: updatePolicyV2Request
|
|
3678
|
+
},
|
|
3679
|
+
options
|
|
3680
|
+
);
|
|
3681
|
+
};
|
|
3682
|
+
var deletePolicyV2 = (policyId, options) => {
|
|
3683
|
+
return openfortApiClient(
|
|
3684
|
+
{
|
|
3685
|
+
url: `/v2/policies/${policyId}`,
|
|
3686
|
+
method: "DELETE"
|
|
3687
|
+
},
|
|
3688
|
+
options
|
|
3689
|
+
);
|
|
3690
|
+
};
|
|
3691
|
+
var evaluatePolicyV2 = (evaluatePolicyV2Request, options) => {
|
|
3692
|
+
return openfortApiClient(
|
|
3693
|
+
{
|
|
3694
|
+
url: `/v2/policies/evaluate`,
|
|
3695
|
+
method: "POST",
|
|
3696
|
+
headers: { "Content-Type": "application/json" },
|
|
3697
|
+
data: evaluatePolicyV2Request
|
|
3698
|
+
},
|
|
3699
|
+
options
|
|
3700
|
+
);
|
|
3701
|
+
};
|
|
3313
3702
|
|
|
3314
3703
|
// src/openapi-client/generated/policy-rules/policy-rules.ts
|
|
3315
3704
|
var getPolicyRules = (params, options) => {
|
|
@@ -3854,7 +4243,8 @@ function toEvmAccount(data) {
|
|
|
3854
4243
|
},
|
|
3855
4244
|
async signTransaction(transaction) {
|
|
3856
4245
|
const serialized = (0, import_viem.serializeTransaction)(transaction);
|
|
3857
|
-
const
|
|
4246
|
+
const hash = (0, import_viem.keccak256)(serialized);
|
|
4247
|
+
const response = await sign(id, { data: hash });
|
|
3858
4248
|
const signature2 = (0, import_viem.parseSignature)(response.signature);
|
|
3859
4249
|
const signedTransaction = (0, import_viem.serializeTransaction)(
|
|
3860
4250
|
transaction,
|
|
@@ -4378,6 +4768,279 @@ SolanaClient.type = "solanaWallet";
|
|
|
4378
4768
|
// src/index.ts
|
|
4379
4769
|
var import_shield_js2 = require("@openfort/shield-js");
|
|
4380
4770
|
|
|
4771
|
+
// src/policies/evmSchema.ts
|
|
4772
|
+
var import_zod = require("zod");
|
|
4773
|
+
var EthValueOperatorEnum = import_zod.z.enum(["<=", ">=", "<", ">"]);
|
|
4774
|
+
var EvmAddressOperatorEnum = import_zod.z.enum(["in", "not in"]);
|
|
4775
|
+
var EvmNetworkOperatorEnum = import_zod.z.enum(["in", "not in"]);
|
|
4776
|
+
var EvmDataOperatorEnum = import_zod.z.enum([
|
|
4777
|
+
"in",
|
|
4778
|
+
"not in",
|
|
4779
|
+
"<",
|
|
4780
|
+
"<=",
|
|
4781
|
+
">",
|
|
4782
|
+
">=",
|
|
4783
|
+
"==",
|
|
4784
|
+
"match"
|
|
4785
|
+
]);
|
|
4786
|
+
var EvmTypedDataVerifyingContractOperatorEnum = import_zod.z.enum([
|
|
4787
|
+
"in",
|
|
4788
|
+
"not in"
|
|
4789
|
+
]);
|
|
4790
|
+
var EvmTypedDataFieldOperatorEnum = import_zod.z.enum(["in", "<=", "match"]);
|
|
4791
|
+
var ActionEnum = import_zod.z.enum(["reject", "accept"]);
|
|
4792
|
+
var EthValueCriterionSchema = import_zod.z.object({
|
|
4793
|
+
type: import_zod.z.literal("ethValue"),
|
|
4794
|
+
operator: EthValueOperatorEnum,
|
|
4795
|
+
/** Value in wei as a string. */
|
|
4796
|
+
ethValue: import_zod.z.string().regex(/^[0-9]+$/)
|
|
4797
|
+
});
|
|
4798
|
+
var EvmAddressCriterionSchema = import_zod.z.object({
|
|
4799
|
+
type: import_zod.z.literal("evmAddress"),
|
|
4800
|
+
operator: EvmAddressOperatorEnum,
|
|
4801
|
+
/** List of EVM addresses (hex format with 0x prefix). */
|
|
4802
|
+
addresses: import_zod.z.array(import_zod.z.string().regex(/^0x[0-9a-fA-F]{40}$/))
|
|
4803
|
+
});
|
|
4804
|
+
var EvmNetworkCriterionSchema = import_zod.z.object({
|
|
4805
|
+
type: import_zod.z.literal("evmNetwork"),
|
|
4806
|
+
operator: EvmNetworkOperatorEnum,
|
|
4807
|
+
/** List of chain IDs. */
|
|
4808
|
+
chainIds: import_zod.z.array(import_zod.z.number().int().positive())
|
|
4809
|
+
});
|
|
4810
|
+
var EvmMessageCriterionSchema = import_zod.z.object({
|
|
4811
|
+
type: import_zod.z.literal("evmMessage"),
|
|
4812
|
+
operator: import_zod.z.literal("match"),
|
|
4813
|
+
/** RE2 regex pattern to match against the message. */
|
|
4814
|
+
pattern: import_zod.z.string().min(1)
|
|
4815
|
+
});
|
|
4816
|
+
var EvmDataCriterionSchema = import_zod.z.object({
|
|
4817
|
+
type: import_zod.z.literal("evmData"),
|
|
4818
|
+
operator: EvmDataOperatorEnum,
|
|
4819
|
+
/** Contract ABI as JSON string. */
|
|
4820
|
+
abi: import_zod.z.string().min(1),
|
|
4821
|
+
/** Function name to match. */
|
|
4822
|
+
functionName: import_zod.z.string().min(1),
|
|
4823
|
+
/** Argument constraints. */
|
|
4824
|
+
args: import_zod.z.record(import_zod.z.unknown()).optional()
|
|
4825
|
+
});
|
|
4826
|
+
var EvmTypedDataVerifyingContractCriterionSchema = import_zod.z.object({
|
|
4827
|
+
type: import_zod.z.literal("evmTypedDataVerifyingContract"),
|
|
4828
|
+
operator: EvmTypedDataVerifyingContractOperatorEnum,
|
|
4829
|
+
/** List of verifying contract addresses. */
|
|
4830
|
+
addresses: import_zod.z.array(import_zod.z.string().regex(/^0x[0-9a-fA-F]{40}$/))
|
|
4831
|
+
});
|
|
4832
|
+
var EvmTypedDataFieldCriterionSchema = import_zod.z.object({
|
|
4833
|
+
type: import_zod.z.literal("evmTypedDataField"),
|
|
4834
|
+
operator: EvmTypedDataFieldOperatorEnum,
|
|
4835
|
+
/** Dot-notation path to the field (e.g. "order.buyer"). */
|
|
4836
|
+
fieldPath: import_zod.z.string().min(1),
|
|
4837
|
+
/** Values for "in" operator. */
|
|
4838
|
+
values: import_zod.z.array(import_zod.z.string()).optional(),
|
|
4839
|
+
/** Value for "<=" or "match" operators. */
|
|
4840
|
+
value: import_zod.z.string().optional()
|
|
4841
|
+
});
|
|
4842
|
+
var SignEvmTransactionCriteriaSchema = import_zod.z.array(
|
|
4843
|
+
import_zod.z.discriminatedUnion("type", [
|
|
4844
|
+
EthValueCriterionSchema,
|
|
4845
|
+
EvmAddressCriterionSchema,
|
|
4846
|
+
EvmDataCriterionSchema
|
|
4847
|
+
])
|
|
4848
|
+
).max(10);
|
|
4849
|
+
var SendEvmTransactionCriteriaSchema = import_zod.z.array(
|
|
4850
|
+
import_zod.z.discriminatedUnion("type", [
|
|
4851
|
+
EthValueCriterionSchema,
|
|
4852
|
+
EvmAddressCriterionSchema,
|
|
4853
|
+
EvmNetworkCriterionSchema,
|
|
4854
|
+
EvmDataCriterionSchema
|
|
4855
|
+
])
|
|
4856
|
+
).max(10);
|
|
4857
|
+
var SignEvmMessageCriteriaSchema = import_zod.z.array(import_zod.z.discriminatedUnion("type", [EvmMessageCriterionSchema])).max(10);
|
|
4858
|
+
var SignEvmTypedDataCriteriaSchema = import_zod.z.array(
|
|
4859
|
+
import_zod.z.discriminatedUnion("type", [
|
|
4860
|
+
EvmTypedDataFieldCriterionSchema,
|
|
4861
|
+
EvmTypedDataVerifyingContractCriterionSchema
|
|
4862
|
+
])
|
|
4863
|
+
).max(10);
|
|
4864
|
+
var SignEvmTransactionRuleSchema = import_zod.z.object({
|
|
4865
|
+
action: ActionEnum,
|
|
4866
|
+
operation: import_zod.z.literal("signEvmTransaction"),
|
|
4867
|
+
criteria: SignEvmTransactionCriteriaSchema
|
|
4868
|
+
});
|
|
4869
|
+
var SendEvmTransactionRuleSchema = import_zod.z.object({
|
|
4870
|
+
action: ActionEnum,
|
|
4871
|
+
operation: import_zod.z.literal("sendEvmTransaction"),
|
|
4872
|
+
criteria: SendEvmTransactionCriteriaSchema
|
|
4873
|
+
});
|
|
4874
|
+
var SignEvmMessageRuleSchema = import_zod.z.object({
|
|
4875
|
+
action: ActionEnum,
|
|
4876
|
+
operation: import_zod.z.literal("signEvmMessage"),
|
|
4877
|
+
criteria: SignEvmMessageCriteriaSchema
|
|
4878
|
+
});
|
|
4879
|
+
var SignEvmTypedDataRuleSchema = import_zod.z.object({
|
|
4880
|
+
action: ActionEnum,
|
|
4881
|
+
operation: import_zod.z.literal("signEvmTypedData"),
|
|
4882
|
+
criteria: SignEvmTypedDataCriteriaSchema
|
|
4883
|
+
});
|
|
4884
|
+
var SignEvmHashRuleSchema = import_zod.z.object({
|
|
4885
|
+
action: ActionEnum,
|
|
4886
|
+
operation: import_zod.z.literal("signEvmHash")
|
|
4887
|
+
});
|
|
4888
|
+
|
|
4889
|
+
// src/policies/solanaSchema.ts
|
|
4890
|
+
var import_zod2 = require("zod");
|
|
4891
|
+
var SolAddressOperatorEnum = import_zod2.z.enum(["in", "not in"]);
|
|
4892
|
+
var SolValueOperatorEnum = import_zod2.z.enum(["<=", ">="]);
|
|
4893
|
+
var SplAddressOperatorEnum = import_zod2.z.enum(["in", "not in"]);
|
|
4894
|
+
var SplValueOperatorEnum = import_zod2.z.enum(["<=", ">="]);
|
|
4895
|
+
var MintAddressOperatorEnum = import_zod2.z.enum(["==", "in"]);
|
|
4896
|
+
var SolDataOperatorEnum = import_zod2.z.enum([
|
|
4897
|
+
"in",
|
|
4898
|
+
"not in",
|
|
4899
|
+
"<=",
|
|
4900
|
+
">=",
|
|
4901
|
+
"==",
|
|
4902
|
+
"match"
|
|
4903
|
+
]);
|
|
4904
|
+
var ProgramIdOperatorEnum = import_zod2.z.enum(["in", "not in"]);
|
|
4905
|
+
var SolNetworkOperatorEnum = import_zod2.z.enum(["in", "not in"]);
|
|
4906
|
+
var SolNetworkEnum = import_zod2.z.enum(["mainnet-beta", "devnet", "testnet"]);
|
|
4907
|
+
var base58Address = import_zod2.z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/);
|
|
4908
|
+
var SolAddressCriterionSchema = import_zod2.z.object({
|
|
4909
|
+
type: import_zod2.z.literal("solAddress"),
|
|
4910
|
+
operator: SolAddressOperatorEnum,
|
|
4911
|
+
/** List of Solana addresses (Base58). */
|
|
4912
|
+
addresses: import_zod2.z.array(base58Address)
|
|
4913
|
+
});
|
|
4914
|
+
var SolValueCriterionSchema = import_zod2.z.object({
|
|
4915
|
+
type: import_zod2.z.literal("solValue"),
|
|
4916
|
+
operator: SolValueOperatorEnum,
|
|
4917
|
+
/** Value in lamports as string. */
|
|
4918
|
+
value: import_zod2.z.string().regex(/^[0-9]+$/)
|
|
4919
|
+
});
|
|
4920
|
+
var SplAddressCriterionSchema = import_zod2.z.object({
|
|
4921
|
+
type: import_zod2.z.literal("splAddress"),
|
|
4922
|
+
operator: SplAddressOperatorEnum,
|
|
4923
|
+
/** List of recipient addresses (Base58). */
|
|
4924
|
+
addresses: import_zod2.z.array(base58Address)
|
|
4925
|
+
});
|
|
4926
|
+
var SplValueCriterionSchema = import_zod2.z.object({
|
|
4927
|
+
type: import_zod2.z.literal("splValue"),
|
|
4928
|
+
operator: SplValueOperatorEnum,
|
|
4929
|
+
/** Token amount as string. */
|
|
4930
|
+
value: import_zod2.z.string().regex(/^[0-9]+$/)
|
|
4931
|
+
});
|
|
4932
|
+
var MintAddressCriterionSchema = import_zod2.z.object({
|
|
4933
|
+
type: import_zod2.z.literal("mintAddress"),
|
|
4934
|
+
operator: MintAddressOperatorEnum,
|
|
4935
|
+
/** List of mint addresses (Base58). */
|
|
4936
|
+
addresses: import_zod2.z.array(base58Address)
|
|
4937
|
+
});
|
|
4938
|
+
var SolDataCriterionSchema = import_zod2.z.object({
|
|
4939
|
+
type: import_zod2.z.literal("solData"),
|
|
4940
|
+
operator: SolDataOperatorEnum,
|
|
4941
|
+
/** Anchor IDL JSON (v0.30+). */
|
|
4942
|
+
idl: import_zod2.z.string().min(1),
|
|
4943
|
+
/** Instruction name. */
|
|
4944
|
+
instructionName: import_zod2.z.string().min(1),
|
|
4945
|
+
/** Argument constraints. */
|
|
4946
|
+
args: import_zod2.z.record(import_zod2.z.unknown()).optional()
|
|
4947
|
+
});
|
|
4948
|
+
var ProgramIdCriterionSchema = import_zod2.z.object({
|
|
4949
|
+
type: import_zod2.z.literal("programId"),
|
|
4950
|
+
operator: ProgramIdOperatorEnum,
|
|
4951
|
+
/** List of program IDs (Base58). */
|
|
4952
|
+
programIds: import_zod2.z.array(base58Address)
|
|
4953
|
+
});
|
|
4954
|
+
var SolNetworkCriterionSchema = import_zod2.z.object({
|
|
4955
|
+
type: import_zod2.z.literal("solNetwork"),
|
|
4956
|
+
operator: SolNetworkOperatorEnum,
|
|
4957
|
+
/** List of networks: "mainnet-beta", "devnet", "testnet". */
|
|
4958
|
+
networks: import_zod2.z.array(SolNetworkEnum)
|
|
4959
|
+
});
|
|
4960
|
+
var SolMessageCriterionSchema = import_zod2.z.object({
|
|
4961
|
+
type: import_zod2.z.literal("solMessage"),
|
|
4962
|
+
operator: import_zod2.z.literal("match"),
|
|
4963
|
+
/** RE2 regex pattern. */
|
|
4964
|
+
pattern: import_zod2.z.string().min(1)
|
|
4965
|
+
});
|
|
4966
|
+
var SignSolTransactionCriteriaSchema = import_zod2.z.array(
|
|
4967
|
+
import_zod2.z.discriminatedUnion("type", [
|
|
4968
|
+
SolAddressCriterionSchema,
|
|
4969
|
+
SolValueCriterionSchema,
|
|
4970
|
+
SplAddressCriterionSchema,
|
|
4971
|
+
SplValueCriterionSchema,
|
|
4972
|
+
MintAddressCriterionSchema,
|
|
4973
|
+
SolDataCriterionSchema,
|
|
4974
|
+
ProgramIdCriterionSchema
|
|
4975
|
+
])
|
|
4976
|
+
).max(10);
|
|
4977
|
+
var SendSolTransactionCriteriaSchema = import_zod2.z.array(
|
|
4978
|
+
import_zod2.z.discriminatedUnion("type", [
|
|
4979
|
+
SolAddressCriterionSchema,
|
|
4980
|
+
SolValueCriterionSchema,
|
|
4981
|
+
SplAddressCriterionSchema,
|
|
4982
|
+
SplValueCriterionSchema,
|
|
4983
|
+
MintAddressCriterionSchema,
|
|
4984
|
+
SolDataCriterionSchema,
|
|
4985
|
+
ProgramIdCriterionSchema,
|
|
4986
|
+
SolNetworkCriterionSchema
|
|
4987
|
+
])
|
|
4988
|
+
).max(10);
|
|
4989
|
+
var SignSolMessageCriteriaSchema = import_zod2.z.array(SolMessageCriterionSchema).max(10);
|
|
4990
|
+
var SignSolTransactionRuleSchema = import_zod2.z.object({
|
|
4991
|
+
action: ActionEnum,
|
|
4992
|
+
operation: import_zod2.z.literal("signSolTransaction"),
|
|
4993
|
+
criteria: SignSolTransactionCriteriaSchema
|
|
4994
|
+
});
|
|
4995
|
+
var SendSolTransactionRuleSchema = import_zod2.z.object({
|
|
4996
|
+
action: ActionEnum,
|
|
4997
|
+
operation: import_zod2.z.literal("sendSolTransaction"),
|
|
4998
|
+
criteria: SendSolTransactionCriteriaSchema
|
|
4999
|
+
});
|
|
5000
|
+
var SignSolMessageRuleSchema = import_zod2.z.object({
|
|
5001
|
+
action: ActionEnum,
|
|
5002
|
+
operation: import_zod2.z.literal("signSolMessage"),
|
|
5003
|
+
criteria: SignSolMessageCriteriaSchema
|
|
5004
|
+
});
|
|
5005
|
+
|
|
5006
|
+
// src/policies/types.ts
|
|
5007
|
+
var import_zod3 = require("zod");
|
|
5008
|
+
var PolicyScopeEnum = import_zod3.z.enum(["project", "account"]);
|
|
5009
|
+
var RuleSchema = import_zod3.z.discriminatedUnion("operation", [
|
|
5010
|
+
SignEvmTransactionRuleSchema,
|
|
5011
|
+
SendEvmTransactionRuleSchema,
|
|
5012
|
+
SignEvmMessageRuleSchema,
|
|
5013
|
+
SignEvmTypedDataRuleSchema,
|
|
5014
|
+
SignEvmHashRuleSchema,
|
|
5015
|
+
SignSolTransactionRuleSchema,
|
|
5016
|
+
SendSolTransactionRuleSchema,
|
|
5017
|
+
SignSolMessageRuleSchema
|
|
5018
|
+
]);
|
|
5019
|
+
var CreatePolicyBodySchema = import_zod3.z.object({
|
|
5020
|
+
/** The scope of the policy. 'project' applies to all accounts, 'account' applies to a specific account. */
|
|
5021
|
+
scope: PolicyScopeEnum,
|
|
5022
|
+
/** A description of what this policy does. */
|
|
5023
|
+
description: import_zod3.z.string().optional(),
|
|
5024
|
+
/** The account ID for account-scoped policies (starts with acc_). Required when scope is 'account'. */
|
|
5025
|
+
accountId: import_zod3.z.string().optional(),
|
|
5026
|
+
/** Whether the policy is enabled. */
|
|
5027
|
+
enabled: import_zod3.z.boolean().optional(),
|
|
5028
|
+
/** Priority of the policy. Higher priority policies are evaluated first. */
|
|
5029
|
+
priority: import_zod3.z.number().int().optional(),
|
|
5030
|
+
/** The rules that make up this policy. Maximum 10 rules per policy. */
|
|
5031
|
+
rules: import_zod3.z.array(RuleSchema).min(1).max(10)
|
|
5032
|
+
});
|
|
5033
|
+
var UpdatePolicyBodySchema = import_zod3.z.object({
|
|
5034
|
+
/** A description of what this policy does. */
|
|
5035
|
+
description: import_zod3.z.string().optional(),
|
|
5036
|
+
/** Whether the policy is enabled. */
|
|
5037
|
+
enabled: import_zod3.z.boolean().optional(),
|
|
5038
|
+
/** Priority of the policy. Higher priority policies are evaluated first. */
|
|
5039
|
+
priority: import_zod3.z.number().int().optional(),
|
|
5040
|
+
/** The rules that make up this policy. If provided, replaces all existing rules. Maximum 10 rules. */
|
|
5041
|
+
rules: import_zod3.z.array(RuleSchema).min(1).max(10).optional()
|
|
5042
|
+
});
|
|
5043
|
+
|
|
4381
5044
|
// src/wallets/evm/actions/signMessage.ts
|
|
4382
5045
|
var import_viem2 = require("viem");
|
|
4383
5046
|
|
|
@@ -4523,14 +5186,7 @@ var Openfort = class {
|
|
|
4523
5186
|
v1: {
|
|
4524
5187
|
list: getAccounts,
|
|
4525
5188
|
create: createAccount,
|
|
4526
|
-
get: getAccount
|
|
4527
|
-
requestTransferOwnership,
|
|
4528
|
-
cancelTransferOwnership,
|
|
4529
|
-
signPayload,
|
|
4530
|
-
sync: syncAccount,
|
|
4531
|
-
deploy: deployAccount,
|
|
4532
|
-
startRecovery,
|
|
4533
|
-
completeRecovery
|
|
5189
|
+
get: getAccount
|
|
4534
5190
|
}
|
|
4535
5191
|
};
|
|
4536
5192
|
}
|
|
@@ -4539,6 +5195,7 @@ var Openfort = class {
|
|
|
4539
5195
|
// ============================================
|
|
4540
5196
|
/**
|
|
4541
5197
|
* Player management endpoints
|
|
5198
|
+
* @deprecated
|
|
4542
5199
|
*/
|
|
4543
5200
|
get players() {
|
|
4544
5201
|
return {
|
|
@@ -4578,41 +5235,77 @@ var Openfort = class {
|
|
|
4578
5235
|
// Policies API
|
|
4579
5236
|
// ============================================
|
|
4580
5237
|
/**
|
|
4581
|
-
* Policy management endpoints
|
|
5238
|
+
* Policy management endpoints for controlling account operations.
|
|
5239
|
+
*
|
|
5240
|
+
* Policies define rules that govern what operations accounts can perform,
|
|
5241
|
+
* including transaction signing, message signing, and more.
|
|
5242
|
+
*
|
|
5243
|
+
* @example
|
|
5244
|
+
* ```typescript
|
|
5245
|
+
* // List all policies
|
|
5246
|
+
* const all = await openfort.policies.list();
|
|
5247
|
+
*
|
|
5248
|
+
* // Create a policy
|
|
5249
|
+
* const policy = await openfort.policies.create({
|
|
5250
|
+
* scope: 'project',
|
|
5251
|
+
* rules: [{ action: 'reject', operation: 'signEvmHash' }],
|
|
5252
|
+
* });
|
|
5253
|
+
*
|
|
5254
|
+
* // Evaluate whether an operation would be allowed
|
|
5255
|
+
* const result = await openfort.policies.evaluate({ operation: 'signEvmTransaction', accountId: 'acc_...' });
|
|
5256
|
+
* ```
|
|
4582
5257
|
*/
|
|
4583
5258
|
get policies() {
|
|
4584
5259
|
return {
|
|
4585
5260
|
/** List policies */
|
|
4586
|
-
list:
|
|
5261
|
+
list: listPolicies,
|
|
4587
5262
|
/** Create a policy */
|
|
4588
|
-
create:
|
|
5263
|
+
create: createPolicyV2,
|
|
4589
5264
|
/** Get a policy by ID */
|
|
4590
|
-
get:
|
|
5265
|
+
get: getPolicyV2,
|
|
4591
5266
|
/** Update a policy */
|
|
4592
|
-
update:
|
|
5267
|
+
update: updatePolicyV2,
|
|
4593
5268
|
/** Delete a policy */
|
|
4594
|
-
delete:
|
|
4595
|
-
/**
|
|
4596
|
-
|
|
4597
|
-
/** Enable a policy */
|
|
4598
|
-
enable: enablePolicy,
|
|
4599
|
-
/** Get policy total gas usage */
|
|
4600
|
-
getTotalGasUsage: getPolicyTotalGasUsage
|
|
5269
|
+
delete: deletePolicyV2,
|
|
5270
|
+
/** Evaluate an operation against policies */
|
|
5271
|
+
evaluate: evaluatePolicyV2
|
|
4601
5272
|
};
|
|
4602
5273
|
}
|
|
5274
|
+
// ============================================
|
|
5275
|
+
// Fee Sponsorship API
|
|
5276
|
+
// ============================================
|
|
4603
5277
|
/**
|
|
4604
|
-
*
|
|
5278
|
+
* Fee sponsorship (gas policy) management endpoints
|
|
4605
5279
|
*/
|
|
4606
|
-
get
|
|
5280
|
+
get feeSponsorship() {
|
|
4607
5281
|
return {
|
|
4608
|
-
/** List
|
|
4609
|
-
list:
|
|
4610
|
-
/** Create a policy
|
|
4611
|
-
create:
|
|
4612
|
-
/**
|
|
4613
|
-
|
|
4614
|
-
/**
|
|
4615
|
-
|
|
5282
|
+
/** List fee sponsorship policies */
|
|
5283
|
+
list: getPolicies,
|
|
5284
|
+
/** Create a fee sponsorship policy */
|
|
5285
|
+
create: createPolicy,
|
|
5286
|
+
/** Get a fee sponsorship policy by ID */
|
|
5287
|
+
get: getPolicy,
|
|
5288
|
+
/** Update a fee sponsorship policy */
|
|
5289
|
+
update: updatePolicy,
|
|
5290
|
+
/** Delete a fee sponsorship policy */
|
|
5291
|
+
delete: deletePolicy,
|
|
5292
|
+
/** Disable a fee sponsorship policy */
|
|
5293
|
+
disable: disablePolicy,
|
|
5294
|
+
/** Enable a fee sponsorship policy */
|
|
5295
|
+
enable: enablePolicy,
|
|
5296
|
+
/** Get fee sponsorship policy total gas usage */
|
|
5297
|
+
getTotalGasUsage: getPolicyTotalGasUsage,
|
|
5298
|
+
/** Fee sponsorship policy rules */
|
|
5299
|
+
rules: {
|
|
5300
|
+
/** List policy rules */
|
|
5301
|
+
list: getPolicyRules,
|
|
5302
|
+
/** Create a policy rule */
|
|
5303
|
+
create: createPolicyRule,
|
|
5304
|
+
/** Update a policy rule */
|
|
5305
|
+
update: updatePolicyRule,
|
|
5306
|
+
/** Delete a policy rule */
|
|
5307
|
+
delete: deletePolicyRule
|
|
5308
|
+
}
|
|
4616
5309
|
};
|
|
4617
5310
|
}
|
|
4618
5311
|
// ============================================
|
|
@@ -4660,6 +5353,7 @@ var Openfort = class {
|
|
|
4660
5353
|
// ============================================
|
|
4661
5354
|
/**
|
|
4662
5355
|
* Settings / Developer account management endpoints
|
|
5356
|
+
* @deprecated
|
|
4663
5357
|
*/
|
|
4664
5358
|
get settings() {
|
|
4665
5359
|
return {
|
|
@@ -5002,6 +5696,19 @@ var index_default = Openfort;
|
|
|
5002
5696
|
CreateBackendWalletResponseObject,
|
|
5003
5697
|
CreateEmbeddedRequestAccountType,
|
|
5004
5698
|
CreateEmbeddedRequestChainType,
|
|
5699
|
+
CreatePolicyBodySchema,
|
|
5700
|
+
CreatePolicyV2RequestScope,
|
|
5701
|
+
CreatePolicyV2RuleRequestAction,
|
|
5702
|
+
CriteriaOperator,
|
|
5703
|
+
CriteriaOperatorEQUAL,
|
|
5704
|
+
CriteriaOperatorGREATERTHAN,
|
|
5705
|
+
CriteriaOperatorGREATERTHANOREQUAL,
|
|
5706
|
+
CriteriaOperatorIN,
|
|
5707
|
+
CriteriaOperatorLESSTHAN,
|
|
5708
|
+
CriteriaOperatorLESSTHANOREQUAL,
|
|
5709
|
+
CriteriaOperatorMATCH,
|
|
5710
|
+
CriteriaOperatorNOTIN,
|
|
5711
|
+
CriteriaType,
|
|
5005
5712
|
Currency,
|
|
5006
5713
|
DeleteBackendWalletResponseObject,
|
|
5007
5714
|
DeveloperAccountResponseExpandable,
|
|
@@ -5021,6 +5728,8 @@ var index_default = Openfort;
|
|
|
5021
5728
|
EntityTypePLAYER,
|
|
5022
5729
|
EntityTypePOLICY,
|
|
5023
5730
|
EntityTypePOLICYRULE,
|
|
5731
|
+
EntityTypePOLICYV2,
|
|
5732
|
+
EntityTypePOLICYV2RULE,
|
|
5024
5733
|
EntityTypePROJECT,
|
|
5025
5734
|
EntityTypeREADCONTRACT,
|
|
5026
5735
|
EntityTypeSESSION,
|
|
@@ -5032,7 +5741,43 @@ var index_default = Openfort;
|
|
|
5032
5741
|
EntityTypeUSER,
|
|
5033
5742
|
EntityTypeWALLET,
|
|
5034
5743
|
ErrorTypeINVALIDREQUESTERROR,
|
|
5744
|
+
EthValueCriterionOperator,
|
|
5745
|
+
EthValueCriterionRequestOperator,
|
|
5746
|
+
EthValueCriterionRequestType,
|
|
5747
|
+
EthValueCriterionSchema,
|
|
5748
|
+
EvaluatePolicyV2ResponseObject,
|
|
5749
|
+
EvmAddressCriterionOperator,
|
|
5750
|
+
EvmAddressCriterionRequestOperator,
|
|
5751
|
+
EvmAddressCriterionRequestType,
|
|
5752
|
+
EvmAddressCriterionSchema,
|
|
5035
5753
|
EvmClient,
|
|
5754
|
+
EvmCriteriaType,
|
|
5755
|
+
EvmCriteriaTypeETHVALUE,
|
|
5756
|
+
EvmCriteriaTypeEVMADDRESS,
|
|
5757
|
+
EvmCriteriaTypeEVMDATA,
|
|
5758
|
+
EvmCriteriaTypeEVMMESSAGE,
|
|
5759
|
+
EvmCriteriaTypeEVMNETWORK,
|
|
5760
|
+
EvmCriteriaTypeEVMTYPEDDATAFIELD,
|
|
5761
|
+
EvmCriteriaTypeEVMTYPEDDATAVERIFYINGCONTRACT,
|
|
5762
|
+
EvmCriteriaTypeNETUSDCHANGE,
|
|
5763
|
+
EvmDataCriterionRequestOperator,
|
|
5764
|
+
EvmDataCriterionRequestType,
|
|
5765
|
+
EvmDataCriterionSchema,
|
|
5766
|
+
EvmMessageCriterionRequestOperator,
|
|
5767
|
+
EvmMessageCriterionRequestType,
|
|
5768
|
+
EvmMessageCriterionSchema,
|
|
5769
|
+
EvmNetworkCriterionOperator,
|
|
5770
|
+
EvmNetworkCriterionRequestOperator,
|
|
5771
|
+
EvmNetworkCriterionRequestType,
|
|
5772
|
+
EvmNetworkCriterionSchema,
|
|
5773
|
+
EvmTypedDataFieldCriterionOperator,
|
|
5774
|
+
EvmTypedDataFieldCriterionRequestOperator,
|
|
5775
|
+
EvmTypedDataFieldCriterionRequestType,
|
|
5776
|
+
EvmTypedDataFieldCriterionSchema,
|
|
5777
|
+
EvmTypedDataVerifyingContractCriterionOperator,
|
|
5778
|
+
EvmTypedDataVerifyingContractCriterionRequestOperator,
|
|
5779
|
+
EvmTypedDataVerifyingContractCriterionRequestType,
|
|
5780
|
+
EvmTypedDataVerifyingContractCriterionSchema,
|
|
5036
5781
|
ExportPrivateKeyResponseObject,
|
|
5037
5782
|
GetAccountsV2AccountType,
|
|
5038
5783
|
GetAccountsV2ChainType,
|
|
@@ -5049,9 +5794,17 @@ var index_default = Openfort;
|
|
|
5049
5794
|
JsonRpcRequestJsonrpc,
|
|
5050
5795
|
JsonRpcSuccessResponseAnyJsonrpc,
|
|
5051
5796
|
ListBackendWalletsChainType,
|
|
5797
|
+
ListPoliciesScope,
|
|
5798
|
+
MintAddressCriterionOperator,
|
|
5799
|
+
MintAddressCriterionRequestOperator,
|
|
5800
|
+
MintAddressCriterionRequestType,
|
|
5801
|
+
MintAddressCriterionSchema,
|
|
5052
5802
|
MissingAPIKeyError,
|
|
5053
5803
|
MissingPublishableKeyError,
|
|
5054
5804
|
MissingWalletSecretError,
|
|
5805
|
+
NetUSDChangeCriterionOperator,
|
|
5806
|
+
NetUSDChangeCriterionRequestOperator,
|
|
5807
|
+
NetUSDChangeCriterionRequestType,
|
|
5055
5808
|
NetworkError,
|
|
5056
5809
|
NextActionType,
|
|
5057
5810
|
OAuthProvider,
|
|
@@ -5076,25 +5829,77 @@ var index_default = Openfort;
|
|
|
5076
5829
|
PolicyRuleTypeACCOUNT,
|
|
5077
5830
|
PolicyRuleTypeCONTRACT,
|
|
5078
5831
|
PolicyRuleTypeRATELIMIT,
|
|
5832
|
+
PolicyV2Action,
|
|
5833
|
+
PolicyV2ListQueriesScope,
|
|
5834
|
+
PolicyV2Scope,
|
|
5079
5835
|
PregenerateAccountResponseCustody,
|
|
5080
5836
|
PregenerateUserRequestV2AccountType,
|
|
5081
5837
|
PregenerateUserRequestV2ChainType,
|
|
5082
5838
|
PrismaSortOrder,
|
|
5083
5839
|
PrivateKeyPolicy,
|
|
5840
|
+
ProgramIdCriterionOperator,
|
|
5841
|
+
ProgramIdCriterionRequestOperator,
|
|
5842
|
+
ProgramIdCriterionRequestType,
|
|
5843
|
+
ProgramIdCriterionSchema,
|
|
5084
5844
|
ProjectStatsRequestTimeFrame,
|
|
5085
5845
|
RegisterWalletSecretResponseObject,
|
|
5086
5846
|
ResponseTypeLIST,
|
|
5087
5847
|
RevokeWalletSecretResponseObject,
|
|
5088
5848
|
RotateWalletSecretResponseObject,
|
|
5849
|
+
RuleSchema,
|
|
5850
|
+
SendEvmTransactionRuleSchema,
|
|
5851
|
+
SendSolTransactionRuleSchema,
|
|
5089
5852
|
SessionResponseExpandable,
|
|
5090
5853
|
ShieldAuthProvider,
|
|
5854
|
+
SignEvmHashRuleSchema,
|
|
5855
|
+
SignEvmMessageRuleSchema,
|
|
5856
|
+
SignEvmTransactionRuleSchema,
|
|
5857
|
+
SignEvmTypedDataRuleSchema,
|
|
5091
5858
|
SignResponseObject,
|
|
5859
|
+
SignSolMessageRuleSchema,
|
|
5860
|
+
SignSolTransactionRuleSchema,
|
|
5092
5861
|
SmsProviderMESSAGEBIRD,
|
|
5093
5862
|
SmsProviderSMSAPI,
|
|
5094
5863
|
SmsProviderTWILIO,
|
|
5095
5864
|
SmsProviderTXTLOCAL,
|
|
5096
5865
|
SmsProviderVONAGE,
|
|
5866
|
+
SolAddressCriterionOperator,
|
|
5867
|
+
SolAddressCriterionRequestOperator,
|
|
5868
|
+
SolAddressCriterionRequestType,
|
|
5869
|
+
SolAddressCriterionSchema,
|
|
5870
|
+
SolDataCriterionRequestOperator,
|
|
5871
|
+
SolDataCriterionRequestType,
|
|
5872
|
+
SolDataCriterionSchema,
|
|
5873
|
+
SolMessageCriterionRequestOperator,
|
|
5874
|
+
SolMessageCriterionRequestType,
|
|
5875
|
+
SolMessageCriterionSchema,
|
|
5876
|
+
SolNetworkCriterionOperator,
|
|
5877
|
+
SolNetworkCriterionRequestOperator,
|
|
5878
|
+
SolNetworkCriterionRequestType,
|
|
5879
|
+
SolNetworkCriterionSchema,
|
|
5880
|
+
SolValueCriterionOperator,
|
|
5881
|
+
SolValueCriterionRequestOperator,
|
|
5882
|
+
SolValueCriterionRequestType,
|
|
5883
|
+
SolValueCriterionSchema,
|
|
5097
5884
|
SolanaClient,
|
|
5885
|
+
SolanaCriteriaType,
|
|
5886
|
+
SolanaCriteriaTypeMINTADDRESS,
|
|
5887
|
+
SolanaCriteriaTypePROGRAMID,
|
|
5888
|
+
SolanaCriteriaTypeSOLADDRESS,
|
|
5889
|
+
SolanaCriteriaTypeSOLDATA,
|
|
5890
|
+
SolanaCriteriaTypeSOLMESSAGE,
|
|
5891
|
+
SolanaCriteriaTypeSOLNETWORK,
|
|
5892
|
+
SolanaCriteriaTypeSOLVALUE,
|
|
5893
|
+
SolanaCriteriaTypeSPLADDRESS,
|
|
5894
|
+
SolanaCriteriaTypeSPLVALUE,
|
|
5895
|
+
SplAddressCriterionOperator,
|
|
5896
|
+
SplAddressCriterionRequestOperator,
|
|
5897
|
+
SplAddressCriterionRequestType,
|
|
5898
|
+
SplAddressCriterionSchema,
|
|
5899
|
+
SplValueCriterionOperator,
|
|
5900
|
+
SplValueCriterionRequestOperator,
|
|
5901
|
+
SplValueCriterionRequestType,
|
|
5902
|
+
SplValueCriterionSchema,
|
|
5098
5903
|
SponsorSchema,
|
|
5099
5904
|
SponsorSchemaCHARGECUSTOMTOKENS,
|
|
5100
5905
|
SponsorSchemaFIXEDRATE,
|
|
@@ -5116,6 +5921,7 @@ var index_default = Openfort;
|
|
|
5116
5921
|
TransactionIntentResponseExpandable,
|
|
5117
5922
|
TransactionStatus,
|
|
5118
5923
|
UnknownError,
|
|
5924
|
+
UpdatePolicyBodySchema,
|
|
5119
5925
|
UserInputValidationError,
|
|
5120
5926
|
UserProjectCreateRequestRole,
|
|
5121
5927
|
UserProjectRole,
|
|
@@ -5129,8 +5935,6 @@ var index_default = Openfort;
|
|
|
5129
5935
|
authorize,
|
|
5130
5936
|
callbackOAuth,
|
|
5131
5937
|
cancelTransferAccountOwnership,
|
|
5132
|
-
cancelTransferOwnership,
|
|
5133
|
-
completeRecovery,
|
|
5134
5938
|
configure,
|
|
5135
5939
|
create,
|
|
5136
5940
|
createAccount,
|
|
@@ -5147,6 +5951,7 @@ var index_default = Openfort;
|
|
|
5147
5951
|
createPlayer,
|
|
5148
5952
|
createPolicy,
|
|
5149
5953
|
createPolicyRule,
|
|
5954
|
+
createPolicyV2,
|
|
5150
5955
|
createPolicyWithdrawal,
|
|
5151
5956
|
createSession,
|
|
5152
5957
|
createSubscription,
|
|
@@ -5164,16 +5969,17 @@ var index_default = Openfort;
|
|
|
5164
5969
|
deletePlayer,
|
|
5165
5970
|
deletePolicy,
|
|
5166
5971
|
deletePolicyRule,
|
|
5972
|
+
deletePolicyV2,
|
|
5167
5973
|
deleteSubscription,
|
|
5168
5974
|
deleteTrigger,
|
|
5169
5975
|
deleteUser,
|
|
5170
|
-
deployAccount,
|
|
5171
5976
|
deprecatedCallbackOAuth,
|
|
5172
5977
|
disableAccount,
|
|
5173
5978
|
disablePolicy,
|
|
5174
5979
|
enablePolicy,
|
|
5175
5980
|
encryptForImport,
|
|
5176
5981
|
estimateTransactionIntentCost,
|
|
5982
|
+
evaluatePolicyV2,
|
|
5177
5983
|
exportPrivateKey,
|
|
5178
5984
|
generateRSAKeyPair,
|
|
5179
5985
|
getAccount,
|
|
@@ -5206,6 +6012,7 @@ var index_default = Openfort;
|
|
|
5206
6012
|
getPolicyReportTransactionIntents,
|
|
5207
6013
|
getPolicyRules,
|
|
5208
6014
|
getPolicyTotalGasUsage,
|
|
6015
|
+
getPolicyV2,
|
|
5209
6016
|
getProjectLogs,
|
|
5210
6017
|
getSession,
|
|
5211
6018
|
getSignerIdByAddress,
|
|
@@ -5235,6 +6042,7 @@ var index_default = Openfort;
|
|
|
5235
6042
|
listForwarderContracts,
|
|
5236
6043
|
listOAuthConfig,
|
|
5237
6044
|
listPaymasters,
|
|
6045
|
+
listPolicies,
|
|
5238
6046
|
listSubscriptionLogs,
|
|
5239
6047
|
loginEmailPassword,
|
|
5240
6048
|
loginOIDC,
|
|
@@ -5253,20 +6061,16 @@ var index_default = Openfort;
|
|
|
5253
6061
|
requestEmailVerification,
|
|
5254
6062
|
requestResetPassword,
|
|
5255
6063
|
requestTransferAccountOwnership,
|
|
5256
|
-
requestTransferOwnership,
|
|
5257
6064
|
resetPassword,
|
|
5258
6065
|
revokeSession,
|
|
5259
6066
|
revokeWalletSecret,
|
|
5260
6067
|
rotateWalletSecret,
|
|
5261
6068
|
sign,
|
|
5262
|
-
signPayload,
|
|
5263
6069
|
signPayloadDeveloperAccount,
|
|
5264
6070
|
signature,
|
|
5265
6071
|
signatureSession,
|
|
5266
6072
|
signupEmailPassword,
|
|
5267
|
-
startRecovery,
|
|
5268
6073
|
switchChainV2,
|
|
5269
|
-
syncAccount,
|
|
5270
6074
|
testTrigger,
|
|
5271
6075
|
thirdParty,
|
|
5272
6076
|
thirdPartyV2,
|
|
@@ -5282,6 +6086,7 @@ var index_default = Openfort;
|
|
|
5282
6086
|
updatePlayer,
|
|
5283
6087
|
updatePolicy,
|
|
5284
6088
|
updatePolicyRule,
|
|
6089
|
+
updatePolicyV2,
|
|
5285
6090
|
verifyAuthToken,
|
|
5286
6091
|
verifyEmail,
|
|
5287
6092
|
verifyOAuthToken
|