@openfort/openfort-node 0.8.4 → 0.9.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 +6 -0
- package/README.md +29 -37
- package/dist/index.d.mts +2370 -678
- package/dist/index.d.ts +2370 -678
- package/dist/index.js +447 -271
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +419 -253
- package/dist/index.mjs.map +1 -1
- package/examples/README.md +7 -16
- package/examples/evm/accounts/getAccount.ts +0 -6
- package/examples/evm/embedded/pregenerate.ts +1 -1
- package/examples/fee-sponsorship/createPolicy.ts +24 -8
- package/examples/fee-sponsorship/disableEnablePolicy.ts +22 -9
- package/examples/fee-sponsorship/getPolicy.ts +24 -11
- package/examples/fee-sponsorship/listPolicies.ts +7 -5
- package/examples/fee-sponsorship/updatePolicy.ts +20 -7
- package/examples/iam/getSession.ts +0 -2
- package/examples/transactions/createTransactionIntent.ts +17 -11
- package/examples/transactions/estimateGas.ts +16 -14
- package/examples/transactions/getTransactionIntent.ts +16 -15
- package/openapi.json +742 -59
- package/package.json +1 -1
- package/examples/fee-sponsorship/createPolicyRule.ts +0 -43
- package/examples/fee-sponsorship/listPolicyRules.ts +0 -37
package/dist/index.js
CHANGED
|
@@ -94,6 +94,7 @@ __export(index_exports, {
|
|
|
94
94
|
EntityTypeDEVICE: () => EntityTypeDEVICE,
|
|
95
95
|
EntityTypeEMAILSAMPLE: () => EntityTypeEMAILSAMPLE,
|
|
96
96
|
EntityTypeEVENT: () => EntityTypeEVENT,
|
|
97
|
+
EntityTypeFEESPONSORSHIP: () => EntityTypeFEESPONSORSHIP,
|
|
97
98
|
EntityTypeFORWARDERCONTRACT: () => EntityTypeFORWARDERCONTRACT,
|
|
98
99
|
EntityTypeLOG: () => EntityTypeLOG,
|
|
99
100
|
EntityTypePAYMASTER: () => EntityTypePAYMASTER,
|
|
@@ -154,7 +155,7 @@ __export(index_exports, {
|
|
|
154
155
|
GetAccountsV2AccountType: () => GetAccountsV2AccountType,
|
|
155
156
|
GetAccountsV2ChainType: () => GetAccountsV2ChainType,
|
|
156
157
|
GetAccountsV2Custody: () => GetAccountsV2Custody,
|
|
157
|
-
|
|
158
|
+
GetGasPolicyRulesLegacyExpandItem: () => GetGasPolicyRulesLegacyExpandItem,
|
|
158
159
|
IMPORT_ENCRYPTION_PUBLIC_KEY: () => IMPORT_ENCRYPTION_PUBLIC_KEY,
|
|
159
160
|
ImportPrivateKeyRequestChainType: () => ImportPrivateKeyRequestChainType,
|
|
160
161
|
ImportPrivateKeyResponseChainType: () => ImportPrivateKeyResponseChainType,
|
|
@@ -166,7 +167,7 @@ __export(index_exports, {
|
|
|
166
167
|
JsonRpcRequestJsonrpc: () => JsonRpcRequestJsonrpc,
|
|
167
168
|
JsonRpcSuccessResponseAnyJsonrpc: () => JsonRpcSuccessResponseAnyJsonrpc,
|
|
168
169
|
ListBackendWalletsChainType: () => ListBackendWalletsChainType,
|
|
169
|
-
|
|
170
|
+
ListPoliciesScopeItem: () => ListPoliciesScopeItem,
|
|
170
171
|
MintAddressCriterionOperator: () => MintAddressCriterionOperator,
|
|
171
172
|
MintAddressCriterionRequestOperator: () => MintAddressCriterionRequestOperator,
|
|
172
173
|
MintAddressCriterionRequestType: () => MintAddressCriterionRequestType,
|
|
@@ -202,7 +203,7 @@ __export(index_exports, {
|
|
|
202
203
|
PolicyRuleTypeCONTRACT: () => PolicyRuleTypeCONTRACT,
|
|
203
204
|
PolicyRuleTypeRATELIMIT: () => PolicyRuleTypeRATELIMIT,
|
|
204
205
|
PolicyV2Action: () => PolicyV2Action,
|
|
205
|
-
|
|
206
|
+
PolicyV2ListQueriesScopeItem: () => PolicyV2ListQueriesScopeItem,
|
|
206
207
|
PolicyV2Scope: () => PolicyV2Scope,
|
|
207
208
|
PregenerateAccountResponseCustody: () => PregenerateAccountResponseCustody,
|
|
208
209
|
PregenerateUserRequestV2AccountType: () => PregenerateUserRequestV2AccountType,
|
|
@@ -272,10 +273,12 @@ __export(index_exports, {
|
|
|
272
273
|
SplValueCriterionRequestOperator: () => SplValueCriterionRequestOperator,
|
|
273
274
|
SplValueCriterionRequestType: () => SplValueCriterionRequestType,
|
|
274
275
|
SplValueCriterionSchema: () => SplValueCriterionSchema,
|
|
276
|
+
SponsorEvmTransactionRuleSchema: () => SponsorEvmTransactionRuleSchema,
|
|
275
277
|
SponsorSchema: () => SponsorSchema,
|
|
276
278
|
SponsorSchemaCHARGECUSTOMTOKENS: () => SponsorSchemaCHARGECUSTOMTOKENS,
|
|
277
279
|
SponsorSchemaFIXEDRATE: () => SponsorSchemaFIXEDRATE,
|
|
278
280
|
SponsorSchemaPAYFORUSER: () => SponsorSchemaPAYFORUSER,
|
|
281
|
+
SponsorSolTransactionRuleSchema: () => SponsorSolTransactionRuleSchema,
|
|
279
282
|
Status: () => Status,
|
|
280
283
|
ThirdPartyOAuthProvider: () => ThirdPartyOAuthProvider,
|
|
281
284
|
ThirdPartyOAuthProviderACCELBYTE: () => ThirdPartyOAuthProviderACCELBYTE,
|
|
@@ -316,15 +319,16 @@ __export(index_exports, {
|
|
|
316
319
|
createContract: () => createContract,
|
|
317
320
|
createDeveloperAccount: () => createDeveloperAccount,
|
|
318
321
|
createEvent: () => createEvent,
|
|
322
|
+
createFeeSponsorship: () => createFeeSponsorship,
|
|
319
323
|
createForwarderContract: () => createForwarderContract,
|
|
324
|
+
createGasPolicyLegacy: () => createGasPolicyLegacy,
|
|
325
|
+
createGasPolicyRuleLegacy: () => createGasPolicyRuleLegacy,
|
|
326
|
+
createGasPolicyWithdrawalLegacy: () => createGasPolicyWithdrawalLegacy,
|
|
320
327
|
createOAuthConfig: () => createOAuthConfig,
|
|
321
328
|
createOnrampSession: () => createOnrampSession,
|
|
322
329
|
createPaymaster: () => createPaymaster,
|
|
323
330
|
createPlayer: () => createPlayer,
|
|
324
|
-
createPolicy: () => createPolicy,
|
|
325
|
-
createPolicyRule: () => createPolicyRule,
|
|
326
331
|
createPolicyV2: () => createPolicyV2,
|
|
327
|
-
createPolicyWithdrawal: () => createPolicyWithdrawal,
|
|
328
332
|
createSession: () => createSession,
|
|
329
333
|
createSubscription: () => createSubscription,
|
|
330
334
|
createTransactionIntent: () => createTransactionIntent,
|
|
@@ -336,20 +340,23 @@ __export(index_exports, {
|
|
|
336
340
|
deleteContract: () => deleteContract,
|
|
337
341
|
deleteDeveloperAccount: () => deleteDeveloperAccount,
|
|
338
342
|
deleteEvent: () => deleteEvent,
|
|
343
|
+
deleteFeeSponsorship: () => deleteFeeSponsorship,
|
|
339
344
|
deleteForwarderContract: () => deleteForwarderContract,
|
|
345
|
+
deleteGasPolicyLegacy: () => deleteGasPolicyLegacy,
|
|
346
|
+
deleteGasPolicyRuleLegacy: () => deleteGasPolicyRuleLegacy,
|
|
340
347
|
deleteOAuthConfig: () => deleteOAuthConfig,
|
|
341
348
|
deletePaymaster: () => deletePaymaster,
|
|
342
349
|
deletePlayer: () => deletePlayer,
|
|
343
|
-
deletePolicy: () => deletePolicy,
|
|
344
|
-
deletePolicyRule: () => deletePolicyRule,
|
|
345
350
|
deletePolicyV2: () => deletePolicyV2,
|
|
346
351
|
deleteSubscription: () => deleteSubscription,
|
|
347
352
|
deleteTrigger: () => deleteTrigger,
|
|
348
353
|
deleteUser: () => deleteUser,
|
|
349
354
|
deprecatedCallbackOAuth: () => deprecatedCallbackOAuth,
|
|
350
355
|
disableAccount: () => disableAccount,
|
|
351
|
-
|
|
352
|
-
|
|
356
|
+
disableFeeSponsorship: () => disableFeeSponsorship,
|
|
357
|
+
disableGasPolicyLegacy: () => disableGasPolicyLegacy,
|
|
358
|
+
enableFeeSponsorship: () => enableFeeSponsorship,
|
|
359
|
+
enableGasPolicyLegacy: () => enableGasPolicyLegacy,
|
|
353
360
|
encryptForImport: () => encryptForImport,
|
|
354
361
|
estimateTransactionIntentCost: () => estimateTransactionIntentCost,
|
|
355
362
|
evaluatePolicyV2: () => evaluatePolicyV2,
|
|
@@ -371,7 +378,14 @@ __export(index_exports, {
|
|
|
371
378
|
getDeveloperAccounts: () => getDeveloperAccounts,
|
|
372
379
|
getEvent: () => getEvent,
|
|
373
380
|
getEvents: () => getEvents,
|
|
381
|
+
getFeeSponsorship: () => getFeeSponsorship,
|
|
374
382
|
getForwarderContract: () => getForwarderContract,
|
|
383
|
+
getGasPoliciesLegacy: () => getGasPoliciesLegacy,
|
|
384
|
+
getGasPolicyBalanceLegacy: () => getGasPolicyBalanceLegacy,
|
|
385
|
+
getGasPolicyLegacy: () => getGasPolicyLegacy,
|
|
386
|
+
getGasPolicyReportTransactionIntentsLegacy: () => getGasPolicyReportTransactionIntentsLegacy,
|
|
387
|
+
getGasPolicyRulesLegacy: () => getGasPolicyRulesLegacy,
|
|
388
|
+
getGasPolicyTotalGasUsageLegacy: () => getGasPolicyTotalGasUsageLegacy,
|
|
375
389
|
getJwks: () => getJwks,
|
|
376
390
|
getOAuthConfig: () => getOAuthConfig,
|
|
377
391
|
getOnrampQuote: () => getOnrampQuote,
|
|
@@ -379,12 +393,6 @@ __export(index_exports, {
|
|
|
379
393
|
getPlayer: () => getPlayer,
|
|
380
394
|
getPlayerSessions: () => getPlayerSessions,
|
|
381
395
|
getPlayers: () => getPlayers,
|
|
382
|
-
getPolicies: () => getPolicies,
|
|
383
|
-
getPolicy: () => getPolicy,
|
|
384
|
-
getPolicyBalance: () => getPolicyBalance,
|
|
385
|
-
getPolicyReportTransactionIntents: () => getPolicyReportTransactionIntents,
|
|
386
|
-
getPolicyRules: () => getPolicyRules,
|
|
387
|
-
getPolicyTotalGasUsage: () => getPolicyTotalGasUsage,
|
|
388
396
|
getPolicyV2: () => getPolicyV2,
|
|
389
397
|
getProjectLogs: () => getProjectLogs,
|
|
390
398
|
getSession: () => getSession,
|
|
@@ -412,6 +420,7 @@ __export(index_exports, {
|
|
|
412
420
|
linkThirdParty: () => linkThirdParty,
|
|
413
421
|
list: () => list,
|
|
414
422
|
listBackendWallets: () => listBackendWallets,
|
|
423
|
+
listFeeSponsorships: () => listFeeSponsorships,
|
|
415
424
|
listForwarderContracts: () => listForwarderContracts,
|
|
416
425
|
listOAuthConfig: () => listOAuthConfig,
|
|
417
426
|
listPaymasters: () => listPaymasters,
|
|
@@ -454,17 +463,19 @@ __export(index_exports, {
|
|
|
454
463
|
unlinkSIWE: () => unlinkSIWE,
|
|
455
464
|
updateContract: () => updateContract,
|
|
456
465
|
updateDeveloperAccount: () => updateDeveloperAccount,
|
|
466
|
+
updateFeeSponsorship: () => updateFeeSponsorship,
|
|
457
467
|
updateForwarderContract: () => updateForwarderContract,
|
|
468
|
+
updateGasPolicyLegacy: () => updateGasPolicyLegacy,
|
|
469
|
+
updateGasPolicyRuleLegacy: () => updateGasPolicyRuleLegacy,
|
|
458
470
|
updatePaymaster: () => updatePaymaster,
|
|
459
471
|
updatePlayer: () => updatePlayer,
|
|
460
|
-
updatePolicy: () => updatePolicy,
|
|
461
|
-
updatePolicyRule: () => updatePolicyRule,
|
|
462
472
|
updatePolicyV2: () => updatePolicyV2,
|
|
463
473
|
verifyAuthToken: () => verifyAuthToken,
|
|
464
474
|
verifyEmail: () => verifyEmail,
|
|
465
475
|
verifyOAuthToken: () => verifyOAuthToken
|
|
466
476
|
});
|
|
467
477
|
module.exports = __toCommonJS(index_exports);
|
|
478
|
+
var import_node_crypto4 = require("crypto");
|
|
468
479
|
var import_shield_js = require("@openfort/shield-js");
|
|
469
480
|
var import_node_fetch = __toESM(require("node-fetch"));
|
|
470
481
|
|
|
@@ -830,7 +841,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
|
|
|
830
841
|
}
|
|
831
842
|
|
|
832
843
|
// src/version.ts
|
|
833
|
-
var VERSION = "0.
|
|
844
|
+
var VERSION = "0.9.0";
|
|
834
845
|
var PACKAGE = "@openfort/openfort-node";
|
|
835
846
|
|
|
836
847
|
// src/openapi-client/openfortApiClient.ts
|
|
@@ -2457,6 +2468,76 @@ var deleteEvent = (id, options) => {
|
|
|
2457
2468
|
);
|
|
2458
2469
|
};
|
|
2459
2470
|
|
|
2471
|
+
// src/openapi-client/generated/fee-sponsorship/fee-sponsorship.ts
|
|
2472
|
+
var listFeeSponsorships = (params, options) => {
|
|
2473
|
+
return openfortApiClient(
|
|
2474
|
+
{
|
|
2475
|
+
url: `/v2/fee-sponsorship`,
|
|
2476
|
+
method: "GET",
|
|
2477
|
+
params
|
|
2478
|
+
},
|
|
2479
|
+
options
|
|
2480
|
+
);
|
|
2481
|
+
};
|
|
2482
|
+
var createFeeSponsorship = (createFeeSponsorshipRequest, options) => {
|
|
2483
|
+
return openfortApiClient(
|
|
2484
|
+
{
|
|
2485
|
+
url: `/v2/fee-sponsorship`,
|
|
2486
|
+
method: "POST",
|
|
2487
|
+
headers: { "Content-Type": "application/json" },
|
|
2488
|
+
data: createFeeSponsorshipRequest
|
|
2489
|
+
},
|
|
2490
|
+
options
|
|
2491
|
+
);
|
|
2492
|
+
};
|
|
2493
|
+
var getFeeSponsorship = (feeSponsorshipId, options) => {
|
|
2494
|
+
return openfortApiClient(
|
|
2495
|
+
{
|
|
2496
|
+
url: `/v2/fee-sponsorship/${feeSponsorshipId}`,
|
|
2497
|
+
method: "GET"
|
|
2498
|
+
},
|
|
2499
|
+
options
|
|
2500
|
+
);
|
|
2501
|
+
};
|
|
2502
|
+
var updateFeeSponsorship = (feeSponsorshipId, updateFeeSponsorshipRequest, options) => {
|
|
2503
|
+
return openfortApiClient(
|
|
2504
|
+
{
|
|
2505
|
+
url: `/v2/fee-sponsorship/${feeSponsorshipId}`,
|
|
2506
|
+
method: "PUT",
|
|
2507
|
+
headers: { "Content-Type": "application/json" },
|
|
2508
|
+
data: updateFeeSponsorshipRequest
|
|
2509
|
+
},
|
|
2510
|
+
options
|
|
2511
|
+
);
|
|
2512
|
+
};
|
|
2513
|
+
var deleteFeeSponsorship = (feeSponsorshipId, options) => {
|
|
2514
|
+
return openfortApiClient(
|
|
2515
|
+
{
|
|
2516
|
+
url: `/v2/fee-sponsorship/${feeSponsorshipId}`,
|
|
2517
|
+
method: "DELETE"
|
|
2518
|
+
},
|
|
2519
|
+
options
|
|
2520
|
+
);
|
|
2521
|
+
};
|
|
2522
|
+
var enableFeeSponsorship = (feeSponsorshipId, options) => {
|
|
2523
|
+
return openfortApiClient(
|
|
2524
|
+
{
|
|
2525
|
+
url: `/v2/fee-sponsorship/${feeSponsorshipId}/enable`,
|
|
2526
|
+
method: "PUT"
|
|
2527
|
+
},
|
|
2528
|
+
options
|
|
2529
|
+
);
|
|
2530
|
+
};
|
|
2531
|
+
var disableFeeSponsorship = (feeSponsorshipId, options) => {
|
|
2532
|
+
return openfortApiClient(
|
|
2533
|
+
{
|
|
2534
|
+
url: `/v2/fee-sponsorship/${feeSponsorshipId}/disable`,
|
|
2535
|
+
method: "PUT"
|
|
2536
|
+
},
|
|
2537
|
+
options
|
|
2538
|
+
);
|
|
2539
|
+
};
|
|
2540
|
+
|
|
2460
2541
|
// src/openapi-client/generated/forwarder-contract/forwarder-contract.ts
|
|
2461
2542
|
var createForwarderContract = (createForwarderContractRequest, options) => {
|
|
2462
2543
|
return openfortApiClient(
|
|
@@ -2509,6 +2590,160 @@ var deleteForwarderContract = (id, options) => {
|
|
|
2509
2590
|
);
|
|
2510
2591
|
};
|
|
2511
2592
|
|
|
2593
|
+
// src/openapi-client/generated/gas-policies-legacy/gas-policies-legacy.ts
|
|
2594
|
+
var getGasPoliciesLegacy = (params, options) => {
|
|
2595
|
+
return openfortApiClient(
|
|
2596
|
+
{
|
|
2597
|
+
url: `/v1/policies`,
|
|
2598
|
+
method: "GET",
|
|
2599
|
+
params
|
|
2600
|
+
},
|
|
2601
|
+
options
|
|
2602
|
+
);
|
|
2603
|
+
};
|
|
2604
|
+
var createGasPolicyLegacy = (createPolicyRequest, options) => {
|
|
2605
|
+
return openfortApiClient(
|
|
2606
|
+
{
|
|
2607
|
+
url: `/v1/policies`,
|
|
2608
|
+
method: "POST",
|
|
2609
|
+
headers: { "Content-Type": "application/json" },
|
|
2610
|
+
data: createPolicyRequest
|
|
2611
|
+
},
|
|
2612
|
+
options
|
|
2613
|
+
);
|
|
2614
|
+
};
|
|
2615
|
+
var getGasPolicyLegacy = (id, params, options) => {
|
|
2616
|
+
return openfortApiClient(
|
|
2617
|
+
{
|
|
2618
|
+
url: `/v1/policies/${id}`,
|
|
2619
|
+
method: "GET",
|
|
2620
|
+
params
|
|
2621
|
+
},
|
|
2622
|
+
options
|
|
2623
|
+
);
|
|
2624
|
+
};
|
|
2625
|
+
var updateGasPolicyLegacy = (id, updatePolicyRequest, options) => {
|
|
2626
|
+
return openfortApiClient(
|
|
2627
|
+
{
|
|
2628
|
+
url: `/v1/policies/${id}`,
|
|
2629
|
+
method: "POST",
|
|
2630
|
+
headers: { "Content-Type": "application/json" },
|
|
2631
|
+
data: updatePolicyRequest
|
|
2632
|
+
},
|
|
2633
|
+
options
|
|
2634
|
+
);
|
|
2635
|
+
};
|
|
2636
|
+
var deleteGasPolicyLegacy = (id, options) => {
|
|
2637
|
+
return openfortApiClient(
|
|
2638
|
+
{
|
|
2639
|
+
url: `/v1/policies/${id}`,
|
|
2640
|
+
method: "DELETE"
|
|
2641
|
+
},
|
|
2642
|
+
options
|
|
2643
|
+
);
|
|
2644
|
+
};
|
|
2645
|
+
var disableGasPolicyLegacy = (id, options) => {
|
|
2646
|
+
return openfortApiClient(
|
|
2647
|
+
{
|
|
2648
|
+
url: `/v1/policies/${id}/disable`,
|
|
2649
|
+
method: "PUT"
|
|
2650
|
+
},
|
|
2651
|
+
options
|
|
2652
|
+
);
|
|
2653
|
+
};
|
|
2654
|
+
var enableGasPolicyLegacy = (id, options) => {
|
|
2655
|
+
return openfortApiClient(
|
|
2656
|
+
{
|
|
2657
|
+
url: `/v1/policies/${id}/enable`,
|
|
2658
|
+
method: "PUT"
|
|
2659
|
+
},
|
|
2660
|
+
options
|
|
2661
|
+
);
|
|
2662
|
+
};
|
|
2663
|
+
var getGasPolicyTotalGasUsageLegacy = (id, params, options) => {
|
|
2664
|
+
return openfortApiClient(
|
|
2665
|
+
{
|
|
2666
|
+
url: `/v1/policies/${id}/reports`,
|
|
2667
|
+
method: "GET",
|
|
2668
|
+
params
|
|
2669
|
+
},
|
|
2670
|
+
options
|
|
2671
|
+
);
|
|
2672
|
+
};
|
|
2673
|
+
var getGasPolicyReportTransactionIntentsLegacy = (id, params, options) => {
|
|
2674
|
+
return openfortApiClient(
|
|
2675
|
+
{
|
|
2676
|
+
url: `/v1/policies/${id}/reports/transaction_intents`,
|
|
2677
|
+
method: "GET",
|
|
2678
|
+
params
|
|
2679
|
+
},
|
|
2680
|
+
options
|
|
2681
|
+
);
|
|
2682
|
+
};
|
|
2683
|
+
var getGasPolicyBalanceLegacy = (id, options) => {
|
|
2684
|
+
return openfortApiClient(
|
|
2685
|
+
{
|
|
2686
|
+
url: `/v1/policies/${id}/withdraw`,
|
|
2687
|
+
method: "GET"
|
|
2688
|
+
},
|
|
2689
|
+
options
|
|
2690
|
+
);
|
|
2691
|
+
};
|
|
2692
|
+
var createGasPolicyWithdrawalLegacy = (id, withdrawalPolicyRequest, options) => {
|
|
2693
|
+
return openfortApiClient(
|
|
2694
|
+
{
|
|
2695
|
+
url: `/v1/policies/${id}/withdraw`,
|
|
2696
|
+
method: "POST",
|
|
2697
|
+
headers: { "Content-Type": "application/json" },
|
|
2698
|
+
data: withdrawalPolicyRequest
|
|
2699
|
+
},
|
|
2700
|
+
options
|
|
2701
|
+
);
|
|
2702
|
+
};
|
|
2703
|
+
|
|
2704
|
+
// src/openapi-client/generated/gas-policy-rules-legacy/gas-policy-rules-legacy.ts
|
|
2705
|
+
var getGasPolicyRulesLegacy = (params, options) => {
|
|
2706
|
+
return openfortApiClient(
|
|
2707
|
+
{
|
|
2708
|
+
url: `/v1/policy_rules`,
|
|
2709
|
+
method: "GET",
|
|
2710
|
+
params
|
|
2711
|
+
},
|
|
2712
|
+
options
|
|
2713
|
+
);
|
|
2714
|
+
};
|
|
2715
|
+
var createGasPolicyRuleLegacy = (createPolicyRuleRequest, options) => {
|
|
2716
|
+
return openfortApiClient(
|
|
2717
|
+
{
|
|
2718
|
+
url: `/v1/policy_rules`,
|
|
2719
|
+
method: "POST",
|
|
2720
|
+
headers: { "Content-Type": "application/json" },
|
|
2721
|
+
data: createPolicyRuleRequest
|
|
2722
|
+
},
|
|
2723
|
+
options
|
|
2724
|
+
);
|
|
2725
|
+
};
|
|
2726
|
+
var updateGasPolicyRuleLegacy = (id, updatePolicyRuleRequest, options) => {
|
|
2727
|
+
return openfortApiClient(
|
|
2728
|
+
{
|
|
2729
|
+
url: `/v1/policy_rules/${id}`,
|
|
2730
|
+
method: "POST",
|
|
2731
|
+
headers: { "Content-Type": "application/json" },
|
|
2732
|
+
data: updatePolicyRuleRequest
|
|
2733
|
+
},
|
|
2734
|
+
options
|
|
2735
|
+
);
|
|
2736
|
+
};
|
|
2737
|
+
var deleteGasPolicyRuleLegacy = (id, options) => {
|
|
2738
|
+
return openfortApiClient(
|
|
2739
|
+
{
|
|
2740
|
+
url: `/v1/policy_rules/${id}`,
|
|
2741
|
+
method: "DELETE"
|
|
2742
|
+
},
|
|
2743
|
+
options
|
|
2744
|
+
);
|
|
2745
|
+
};
|
|
2746
|
+
|
|
2512
2747
|
// src/openapi-client/generated/graph-q-l/graph-q-l.ts
|
|
2513
2748
|
var query = (queryBody, options) => {
|
|
2514
2749
|
return openfortApiClient(
|
|
@@ -2821,7 +3056,8 @@ var PregenerateUserRequestV2ChainType = {
|
|
|
2821
3056
|
};
|
|
2822
3057
|
var PolicyV2Scope = {
|
|
2823
3058
|
project: "project",
|
|
2824
|
-
account: "account"
|
|
3059
|
+
account: "account",
|
|
3060
|
+
transaction: "transaction"
|
|
2825
3061
|
};
|
|
2826
3062
|
var PolicyV2Action = {
|
|
2827
3063
|
accept: "accept",
|
|
@@ -2953,9 +3189,10 @@ var EntityTypePOLICYV2RULE = {
|
|
|
2953
3189
|
var EntityTypePOLICYV2 = {
|
|
2954
3190
|
policyV2: "policyV2"
|
|
2955
3191
|
};
|
|
2956
|
-
var
|
|
3192
|
+
var PolicyV2ListQueriesScopeItem = {
|
|
2957
3193
|
project: "project",
|
|
2958
|
-
account: "account"
|
|
3194
|
+
account: "account",
|
|
3195
|
+
transaction: "transaction"
|
|
2959
3196
|
};
|
|
2960
3197
|
var EvmAddressCriterionRequestType = {
|
|
2961
3198
|
evmAddress: "evmAddress"
|
|
@@ -3093,11 +3330,15 @@ var CreatePolicyV2RuleRequestAction = {
|
|
|
3093
3330
|
};
|
|
3094
3331
|
var CreatePolicyV2RequestScope = {
|
|
3095
3332
|
project: "project",
|
|
3096
|
-
account: "account"
|
|
3333
|
+
account: "account",
|
|
3334
|
+
transaction: "transaction"
|
|
3097
3335
|
};
|
|
3098
3336
|
var EvaluatePolicyV2ResponseObject = {
|
|
3099
3337
|
policy_evaluation: "policy_evaluation"
|
|
3100
3338
|
};
|
|
3339
|
+
var EntityTypeFEESPONSORSHIP = {
|
|
3340
|
+
feeSponsorship: "feeSponsorship"
|
|
3341
|
+
};
|
|
3101
3342
|
var CreateEmbeddedRequestAccountType = {
|
|
3102
3343
|
Externally_Owned_Account: "Externally Owned Account",
|
|
3103
3344
|
Smart_Account: "Smart Account",
|
|
@@ -3376,12 +3617,13 @@ var AuthenticationType = {
|
|
|
3376
3617
|
basic: "basic",
|
|
3377
3618
|
third_party: "third_party"
|
|
3378
3619
|
};
|
|
3379
|
-
var
|
|
3620
|
+
var GetGasPolicyRulesLegacyExpandItem = {
|
|
3380
3621
|
contract: "contract"
|
|
3381
3622
|
};
|
|
3382
|
-
var
|
|
3623
|
+
var ListPoliciesScopeItem = {
|
|
3383
3624
|
project: "project",
|
|
3384
|
-
account: "account"
|
|
3625
|
+
account: "account",
|
|
3626
|
+
transaction: "transaction"
|
|
3385
3627
|
};
|
|
3386
3628
|
var ListBackendWalletsChainType = {
|
|
3387
3629
|
EVM: "EVM",
|
|
@@ -3529,115 +3771,6 @@ var cancelTransferAccountOwnership = (id, playerCancelTransferOwnershipRequest,
|
|
|
3529
3771
|
};
|
|
3530
3772
|
|
|
3531
3773
|
// src/openapi-client/generated/policies/policies.ts
|
|
3532
|
-
var getPolicies = (params, options) => {
|
|
3533
|
-
return openfortApiClient(
|
|
3534
|
-
{
|
|
3535
|
-
url: `/v1/policies`,
|
|
3536
|
-
method: "GET",
|
|
3537
|
-
params
|
|
3538
|
-
},
|
|
3539
|
-
options
|
|
3540
|
-
);
|
|
3541
|
-
};
|
|
3542
|
-
var createPolicy = (createPolicyRequest, options) => {
|
|
3543
|
-
return openfortApiClient(
|
|
3544
|
-
{
|
|
3545
|
-
url: `/v1/policies`,
|
|
3546
|
-
method: "POST",
|
|
3547
|
-
headers: { "Content-Type": "application/json" },
|
|
3548
|
-
data: createPolicyRequest
|
|
3549
|
-
},
|
|
3550
|
-
options
|
|
3551
|
-
);
|
|
3552
|
-
};
|
|
3553
|
-
var getPolicy = (id, params, options) => {
|
|
3554
|
-
return openfortApiClient(
|
|
3555
|
-
{
|
|
3556
|
-
url: `/v1/policies/${id}`,
|
|
3557
|
-
method: "GET",
|
|
3558
|
-
params
|
|
3559
|
-
},
|
|
3560
|
-
options
|
|
3561
|
-
);
|
|
3562
|
-
};
|
|
3563
|
-
var updatePolicy = (id, updatePolicyRequest, options) => {
|
|
3564
|
-
return openfortApiClient(
|
|
3565
|
-
{
|
|
3566
|
-
url: `/v1/policies/${id}`,
|
|
3567
|
-
method: "POST",
|
|
3568
|
-
headers: { "Content-Type": "application/json" },
|
|
3569
|
-
data: updatePolicyRequest
|
|
3570
|
-
},
|
|
3571
|
-
options
|
|
3572
|
-
);
|
|
3573
|
-
};
|
|
3574
|
-
var deletePolicy = (id, options) => {
|
|
3575
|
-
return openfortApiClient(
|
|
3576
|
-
{
|
|
3577
|
-
url: `/v1/policies/${id}`,
|
|
3578
|
-
method: "DELETE"
|
|
3579
|
-
},
|
|
3580
|
-
options
|
|
3581
|
-
);
|
|
3582
|
-
};
|
|
3583
|
-
var disablePolicy = (id, options) => {
|
|
3584
|
-
return openfortApiClient(
|
|
3585
|
-
{
|
|
3586
|
-
url: `/v1/policies/${id}/disable`,
|
|
3587
|
-
method: "PUT"
|
|
3588
|
-
},
|
|
3589
|
-
options
|
|
3590
|
-
);
|
|
3591
|
-
};
|
|
3592
|
-
var enablePolicy = (id, options) => {
|
|
3593
|
-
return openfortApiClient(
|
|
3594
|
-
{
|
|
3595
|
-
url: `/v1/policies/${id}/enable`,
|
|
3596
|
-
method: "PUT"
|
|
3597
|
-
},
|
|
3598
|
-
options
|
|
3599
|
-
);
|
|
3600
|
-
};
|
|
3601
|
-
var getPolicyTotalGasUsage = (id, params, options) => {
|
|
3602
|
-
return openfortApiClient(
|
|
3603
|
-
{
|
|
3604
|
-
url: `/v1/policies/${id}/reports`,
|
|
3605
|
-
method: "GET",
|
|
3606
|
-
params
|
|
3607
|
-
},
|
|
3608
|
-
options
|
|
3609
|
-
);
|
|
3610
|
-
};
|
|
3611
|
-
var getPolicyReportTransactionIntents = (id, params, options) => {
|
|
3612
|
-
return openfortApiClient(
|
|
3613
|
-
{
|
|
3614
|
-
url: `/v1/policies/${id}/reports/transaction_intents`,
|
|
3615
|
-
method: "GET",
|
|
3616
|
-
params
|
|
3617
|
-
},
|
|
3618
|
-
options
|
|
3619
|
-
);
|
|
3620
|
-
};
|
|
3621
|
-
var getPolicyBalance = (id, options) => {
|
|
3622
|
-
return openfortApiClient(
|
|
3623
|
-
{
|
|
3624
|
-
url: `/v1/policies/${id}/withdraw`,
|
|
3625
|
-
method: "GET"
|
|
3626
|
-
},
|
|
3627
|
-
options
|
|
3628
|
-
);
|
|
3629
|
-
};
|
|
3630
|
-
var createPolicyWithdrawal = (id, withdrawalPolicyRequest, options) => {
|
|
3631
|
-
return openfortApiClient(
|
|
3632
|
-
{
|
|
3633
|
-
url: `/v1/policies/${id}/withdraw`,
|
|
3634
|
-
method: "POST",
|
|
3635
|
-
headers: { "Content-Type": "application/json" },
|
|
3636
|
-
data: withdrawalPolicyRequest
|
|
3637
|
-
},
|
|
3638
|
-
options
|
|
3639
|
-
);
|
|
3640
|
-
};
|
|
3641
3774
|
var listPolicies = (params, options) => {
|
|
3642
3775
|
return openfortApiClient(
|
|
3643
3776
|
{
|
|
@@ -3700,49 +3833,6 @@ var evaluatePolicyV2 = (evaluatePolicyV2Request, options) => {
|
|
|
3700
3833
|
);
|
|
3701
3834
|
};
|
|
3702
3835
|
|
|
3703
|
-
// src/openapi-client/generated/policy-rules/policy-rules.ts
|
|
3704
|
-
var getPolicyRules = (params, options) => {
|
|
3705
|
-
return openfortApiClient(
|
|
3706
|
-
{
|
|
3707
|
-
url: `/v1/policy_rules`,
|
|
3708
|
-
method: "GET",
|
|
3709
|
-
params
|
|
3710
|
-
},
|
|
3711
|
-
options
|
|
3712
|
-
);
|
|
3713
|
-
};
|
|
3714
|
-
var createPolicyRule = (createPolicyRuleRequest, options) => {
|
|
3715
|
-
return openfortApiClient(
|
|
3716
|
-
{
|
|
3717
|
-
url: `/v1/policy_rules`,
|
|
3718
|
-
method: "POST",
|
|
3719
|
-
headers: { "Content-Type": "application/json" },
|
|
3720
|
-
data: createPolicyRuleRequest
|
|
3721
|
-
},
|
|
3722
|
-
options
|
|
3723
|
-
);
|
|
3724
|
-
};
|
|
3725
|
-
var updatePolicyRule = (id, updatePolicyRuleRequest, options) => {
|
|
3726
|
-
return openfortApiClient(
|
|
3727
|
-
{
|
|
3728
|
-
url: `/v1/policy_rules/${id}`,
|
|
3729
|
-
method: "POST",
|
|
3730
|
-
headers: { "Content-Type": "application/json" },
|
|
3731
|
-
data: updatePolicyRuleRequest
|
|
3732
|
-
},
|
|
3733
|
-
options
|
|
3734
|
-
);
|
|
3735
|
-
};
|
|
3736
|
-
var deletePolicyRule = (id, options) => {
|
|
3737
|
-
return openfortApiClient(
|
|
3738
|
-
{
|
|
3739
|
-
url: `/v1/policy_rules/${id}`,
|
|
3740
|
-
method: "DELETE"
|
|
3741
|
-
},
|
|
3742
|
-
options
|
|
3743
|
-
);
|
|
3744
|
-
};
|
|
3745
|
-
|
|
3746
3836
|
// src/openapi-client/generated/rpc/rpc.ts
|
|
3747
3837
|
var handleRpcRequest = (jsonRpcRequest, options) => {
|
|
3748
3838
|
return openfortApiClient(
|
|
@@ -4877,6 +4967,19 @@ var SignEvmHashRuleSchema = import_zod.z.object({
|
|
|
4877
4967
|
action: ActionEnum,
|
|
4878
4968
|
operation: import_zod.z.literal("signEvmHash")
|
|
4879
4969
|
});
|
|
4970
|
+
var SponsorEvmTransactionCriteriaSchema = import_zod.z.array(
|
|
4971
|
+
import_zod.z.discriminatedUnion("type", [
|
|
4972
|
+
EthValueCriterionSchema,
|
|
4973
|
+
EvmAddressCriterionSchema,
|
|
4974
|
+
EvmNetworkCriterionSchema,
|
|
4975
|
+
EvmDataCriterionSchema
|
|
4976
|
+
])
|
|
4977
|
+
).max(10);
|
|
4978
|
+
var SponsorEvmTransactionRuleSchema = import_zod.z.object({
|
|
4979
|
+
action: ActionEnum,
|
|
4980
|
+
operation: import_zod.z.literal("sponsorEvmTransaction"),
|
|
4981
|
+
criteria: SponsorEvmTransactionCriteriaSchema
|
|
4982
|
+
});
|
|
4880
4983
|
|
|
4881
4984
|
// src/policies/solanaSchema.ts
|
|
4882
4985
|
var import_zod2 = require("zod");
|
|
@@ -4994,6 +5097,23 @@ var SignSolMessageRuleSchema = import_zod2.z.object({
|
|
|
4994
5097
|
operation: import_zod2.z.literal("signSolMessage"),
|
|
4995
5098
|
criteria: SignSolMessageCriteriaSchema
|
|
4996
5099
|
});
|
|
5100
|
+
var SponsorSolTransactionCriteriaSchema = import_zod2.z.array(
|
|
5101
|
+
import_zod2.z.discriminatedUnion("type", [
|
|
5102
|
+
SolAddressCriterionSchema,
|
|
5103
|
+
SolValueCriterionSchema,
|
|
5104
|
+
SplAddressCriterionSchema,
|
|
5105
|
+
SplValueCriterionSchema,
|
|
5106
|
+
MintAddressCriterionSchema,
|
|
5107
|
+
SolDataCriterionSchema,
|
|
5108
|
+
ProgramIdCriterionSchema,
|
|
5109
|
+
SolNetworkCriterionSchema
|
|
5110
|
+
])
|
|
5111
|
+
).max(10);
|
|
5112
|
+
var SponsorSolTransactionRuleSchema = import_zod2.z.object({
|
|
5113
|
+
action: ActionEnum,
|
|
5114
|
+
operation: import_zod2.z.literal("sponsorSolTransaction"),
|
|
5115
|
+
criteria: SponsorSolTransactionCriteriaSchema
|
|
5116
|
+
});
|
|
4997
5117
|
|
|
4998
5118
|
// src/policies/types.ts
|
|
4999
5119
|
var import_zod3 = require("zod");
|
|
@@ -5004,9 +5124,11 @@ var RuleSchema = import_zod3.z.discriminatedUnion("operation", [
|
|
|
5004
5124
|
SignEvmMessageRuleSchema,
|
|
5005
5125
|
SignEvmTypedDataRuleSchema,
|
|
5006
5126
|
SignEvmHashRuleSchema,
|
|
5127
|
+
SponsorEvmTransactionRuleSchema,
|
|
5007
5128
|
SignSolTransactionRuleSchema,
|
|
5008
5129
|
SendSolTransactionRuleSchema,
|
|
5009
|
-
SignSolMessageRuleSchema
|
|
5130
|
+
SignSolMessageRuleSchema,
|
|
5131
|
+
SponsorSolTransactionRuleSchema
|
|
5010
5132
|
]);
|
|
5011
5133
|
var CreatePolicyBodySchema = import_zod3.z.object({
|
|
5012
5134
|
/** The scope of the policy. 'project' applies to all accounts, 'account' applies to a specific account. */
|
|
@@ -5186,8 +5308,8 @@ var Openfort = class {
|
|
|
5186
5308
|
// Players API
|
|
5187
5309
|
// ============================================
|
|
5188
5310
|
/**
|
|
5189
|
-
* Player management endpoints
|
|
5190
|
-
* @deprecated
|
|
5311
|
+
* Player management endpoints.
|
|
5312
|
+
* @deprecated Use `openfort.iam.users` for V2 user management.
|
|
5191
5313
|
*/
|
|
5192
5314
|
get players() {
|
|
5193
5315
|
return {
|
|
@@ -5227,39 +5349,60 @@ var Openfort = class {
|
|
|
5227
5349
|
// Policies API
|
|
5228
5350
|
// ============================================
|
|
5229
5351
|
/**
|
|
5230
|
-
* Policy management endpoints for
|
|
5352
|
+
* Policy management endpoints for criteria-based access control.
|
|
5231
5353
|
*
|
|
5232
5354
|
* Policies define rules that govern what operations accounts can perform,
|
|
5233
|
-
* including transaction signing, message signing, and
|
|
5355
|
+
* including transaction signing, message signing, and gas sponsorship.
|
|
5356
|
+
* Each policy has a scope (project, account, or transaction), a priority,
|
|
5357
|
+
* and an ordered list of rules. Each rule specifies an action (accept/reject),
|
|
5358
|
+
* an operation, and criteria that must all match (AND logic).
|
|
5359
|
+
*
|
|
5360
|
+
* **Supported operations:**
|
|
5361
|
+
* - EVM: `signEvmTransaction`, `sendEvmTransaction`, `signEvmTypedData`, `signEvmMessage`, `signEvmHash`, `sponsorEvmTransaction`
|
|
5362
|
+
* - Solana: `signSolTransaction`, `sendSolTransaction`, `signSolMessage`, `sponsorSolTransaction`
|
|
5363
|
+
*
|
|
5364
|
+
* **Supported criteria types:**
|
|
5365
|
+
* - EVM: `evmAddress`, `ethValue`, `evmNetwork`, `evmData`, `evmMessage`, `evmTypedDataVerifyingContract`, `evmTypedDataField`
|
|
5366
|
+
* - Solana: `solAddress`, `solValue`, `splAddress`, `splValue`, `mintAddress`, `programId`, `solNetwork`, `solMessage`, `solData`
|
|
5367
|
+
*
|
|
5368
|
+
* Policies are evaluated in priority order (highest first). The first matching rule determines the outcome.
|
|
5369
|
+
* If policies exist but no rule matches, the operation is rejected (fail-closed).
|
|
5234
5370
|
*
|
|
5235
5371
|
* @example
|
|
5236
5372
|
* ```typescript
|
|
5237
|
-
* //
|
|
5238
|
-
* const all = await openfort.policies.list();
|
|
5239
|
-
*
|
|
5240
|
-
* // Create a policy
|
|
5373
|
+
* // Create a policy that only allows transactions to specific addresses on certain chains
|
|
5241
5374
|
* const policy = await openfort.policies.create({
|
|
5242
5375
|
* scope: 'project',
|
|
5243
|
-
* rules: [{
|
|
5376
|
+
* rules: [{
|
|
5377
|
+
* action: 'accept',
|
|
5378
|
+
* operation: 'sponsorEvmTransaction',
|
|
5379
|
+
* criteria: [
|
|
5380
|
+
* { type: 'evmNetwork', operator: 'in', chainIds: [1, 137] },
|
|
5381
|
+
* { type: 'evmAddress', operator: 'in', addresses: ['0x...'] },
|
|
5382
|
+
* ],
|
|
5383
|
+
* }],
|
|
5244
5384
|
* });
|
|
5245
5385
|
*
|
|
5246
5386
|
* // Evaluate whether an operation would be allowed
|
|
5247
|
-
* const result = await openfort.policies.evaluate({
|
|
5387
|
+
* const result = await openfort.policies.evaluate({
|
|
5388
|
+
* operation: 'signEvmTransaction',
|
|
5389
|
+
* accountId: 'acc_...',
|
|
5390
|
+
* });
|
|
5248
5391
|
* ```
|
|
5249
5392
|
*/
|
|
5250
5393
|
get policies() {
|
|
5251
5394
|
return {
|
|
5252
|
-
/** List policies */
|
|
5395
|
+
/** List policies, optionally filtered by scope, enabled status, or account */
|
|
5253
5396
|
list: listPolicies,
|
|
5254
|
-
/** Create a policy */
|
|
5397
|
+
/** Create a policy with scope, priority, and criteria-based rules */
|
|
5255
5398
|
create: createPolicyV2,
|
|
5256
|
-
/** Get a policy by ID */
|
|
5399
|
+
/** Get a policy by ID (ply_...) */
|
|
5257
5400
|
get: getPolicyV2,
|
|
5258
|
-
/** Update a policy */
|
|
5401
|
+
/** Update a policy's description, priority, enabled status, or rules */
|
|
5259
5402
|
update: updatePolicyV2,
|
|
5260
|
-
/**
|
|
5403
|
+
/** Soft-delete a policy */
|
|
5261
5404
|
delete: deletePolicyV2,
|
|
5262
|
-
/**
|
|
5405
|
+
/** Pre-flight check: evaluate whether an operation would be allowed without executing it */
|
|
5263
5406
|
evaluate: evaluatePolicyV2
|
|
5264
5407
|
};
|
|
5265
5408
|
}
|
|
@@ -5267,56 +5410,83 @@ var Openfort = class {
|
|
|
5267
5410
|
// Fee Sponsorship API
|
|
5268
5411
|
// ============================================
|
|
5269
5412
|
/**
|
|
5270
|
-
* Fee sponsorship
|
|
5413
|
+
* Fee sponsorship endpoints for sponsoring gas costs on behalf of users.
|
|
5414
|
+
*
|
|
5415
|
+
* A fee sponsorship links a strategy (how gas is paid) to a policy (which
|
|
5416
|
+
* transactions qualify). Create a policy first via `openfort.policies.create()`,
|
|
5417
|
+
* then create a fee sponsorship referencing it.
|
|
5418
|
+
*
|
|
5419
|
+
* **Strategies (`sponsorSchema`):**
|
|
5420
|
+
* - `pay_for_user` — Developer fully sponsors gas costs
|
|
5421
|
+
* - `charge_custom_tokens` — User pays in ERC-20 tokens (fixed or dynamic exchange rate)
|
|
5422
|
+
* - `fixed_rate` — User pays a fixed token amount per transaction
|
|
5423
|
+
*
|
|
5424
|
+
* **Workflow:**
|
|
5425
|
+
* 1. Create a policy via `openfort.policies.create()` with criteria rules
|
|
5426
|
+
* 2. Create a fee sponsorship via `openfort.feeSponsorship.create()` linking to that policy
|
|
5427
|
+
*
|
|
5428
|
+
* When a transaction is submitted without an explicit policy, project-scoped fee
|
|
5429
|
+
* sponsorships are auto-discovered and the first matching one is applied.
|
|
5430
|
+
*
|
|
5431
|
+
* @example
|
|
5432
|
+
* ```typescript
|
|
5433
|
+
* // 1. Create a policy to sponsor transactions on Polygon
|
|
5434
|
+
* const policy = await openfort.policies.create({
|
|
5435
|
+
* scope: 'project',
|
|
5436
|
+
* rules: [{
|
|
5437
|
+
* action: 'accept',
|
|
5438
|
+
* operation: 'sponsorEvmTransaction',
|
|
5439
|
+
* criteria: [{ type: 'evmNetwork', operator: 'in', chainIds: [137] }],
|
|
5440
|
+
* }],
|
|
5441
|
+
* });
|
|
5442
|
+
*
|
|
5443
|
+
* // 2. Create a fee sponsorship with pay_for_user strategy
|
|
5444
|
+
* const sponsorship = await openfort.feeSponsorship.create({
|
|
5445
|
+
* name: 'Polygon Gas Sponsorship',
|
|
5446
|
+
* strategy: { sponsorSchema: 'pay_for_user' },
|
|
5447
|
+
* policyId: policy.id,
|
|
5448
|
+
* });
|
|
5449
|
+
* ```
|
|
5271
5450
|
*/
|
|
5272
5451
|
get feeSponsorship() {
|
|
5273
5452
|
return {
|
|
5274
|
-
/** List fee
|
|
5275
|
-
list:
|
|
5276
|
-
/** Create a fee sponsorship policy */
|
|
5277
|
-
create:
|
|
5278
|
-
/** Get a fee sponsorship
|
|
5279
|
-
get:
|
|
5280
|
-
/** Update a fee sponsorship policy */
|
|
5281
|
-
update:
|
|
5282
|
-
/**
|
|
5283
|
-
delete:
|
|
5284
|
-
/** Disable a fee sponsorship
|
|
5285
|
-
disable:
|
|
5286
|
-
/** Enable a fee sponsorship
|
|
5287
|
-
enable:
|
|
5288
|
-
/** Get fee sponsorship policy total gas usage */
|
|
5289
|
-
getTotalGasUsage: getPolicyTotalGasUsage,
|
|
5290
|
-
/** Fee sponsorship policy rules */
|
|
5291
|
-
rules: {
|
|
5292
|
-
/** List policy rules */
|
|
5293
|
-
list: getPolicyRules,
|
|
5294
|
-
/** Create a policy rule */
|
|
5295
|
-
create: createPolicyRule,
|
|
5296
|
-
/** Update a policy rule */
|
|
5297
|
-
update: updatePolicyRule,
|
|
5298
|
-
/** Delete a policy rule */
|
|
5299
|
-
delete: deletePolicyRule
|
|
5300
|
-
}
|
|
5453
|
+
/** List fee sponsorships, optionally filtered by name, chainId, or enabled status */
|
|
5454
|
+
list: listFeeSponsorships,
|
|
5455
|
+
/** Create a fee sponsorship linked to a policy (policyId required) */
|
|
5456
|
+
create: createFeeSponsorship,
|
|
5457
|
+
/** Get a fee sponsorship by ID (pol_...) */
|
|
5458
|
+
get: getFeeSponsorship,
|
|
5459
|
+
/** Update a fee sponsorship's name, strategy, or linked policy */
|
|
5460
|
+
update: updateFeeSponsorship,
|
|
5461
|
+
/** Soft-delete a fee sponsorship */
|
|
5462
|
+
delete: deleteFeeSponsorship,
|
|
5463
|
+
/** Disable a fee sponsorship (stops it from being applied to transactions) */
|
|
5464
|
+
disable: disableFeeSponsorship,
|
|
5465
|
+
/** Enable a previously disabled fee sponsorship */
|
|
5466
|
+
enable: enableFeeSponsorship
|
|
5301
5467
|
};
|
|
5302
5468
|
}
|
|
5303
5469
|
// ============================================
|
|
5304
5470
|
// Transaction Intents API
|
|
5305
5471
|
// ============================================
|
|
5306
5472
|
/**
|
|
5307
|
-
* Transaction intent
|
|
5473
|
+
* Transaction intent endpoints for creating and managing on-chain transactions.
|
|
5474
|
+
*
|
|
5475
|
+
* Transaction intents represent a desired on-chain action (contract calls, transfers).
|
|
5476
|
+
* When a fee sponsorship policy is provided (or auto-discovered from project-scoped policies),
|
|
5477
|
+
* gas costs are sponsored according to the policy's strategy.
|
|
5308
5478
|
*/
|
|
5309
5479
|
get transactionIntents() {
|
|
5310
5480
|
return {
|
|
5311
5481
|
/** List transaction intents */
|
|
5312
5482
|
list: getTransactionIntents,
|
|
5313
|
-
/** Create a transaction intent */
|
|
5483
|
+
/** Create a transaction intent with contract interactions */
|
|
5314
5484
|
create: createTransactionIntent,
|
|
5315
5485
|
/** Get a transaction intent by ID */
|
|
5316
5486
|
get: getTransactionIntent,
|
|
5317
5487
|
/** Sign a transaction intent */
|
|
5318
5488
|
signature,
|
|
5319
|
-
/** Estimate cost */
|
|
5489
|
+
/** Estimate gas cost for a transaction before creating it */
|
|
5320
5490
|
estimateCost: estimateTransactionIntentCost
|
|
5321
5491
|
};
|
|
5322
5492
|
}
|
|
@@ -5341,27 +5511,6 @@ var Openfort = class {
|
|
|
5341
5511
|
};
|
|
5342
5512
|
}
|
|
5343
5513
|
// ============================================
|
|
5344
|
-
// Settings API
|
|
5345
|
-
// ============================================
|
|
5346
|
-
/**
|
|
5347
|
-
* Settings / Developer account management endpoints
|
|
5348
|
-
* @deprecated
|
|
5349
|
-
*/
|
|
5350
|
-
get settings() {
|
|
5351
|
-
return {
|
|
5352
|
-
/** List developer accounts */
|
|
5353
|
-
getDeveloperAccounts,
|
|
5354
|
-
/** Create a developer account */
|
|
5355
|
-
createDeveloperAccount,
|
|
5356
|
-
/** Get a developer account by ID */
|
|
5357
|
-
getDeveloperAccount,
|
|
5358
|
-
/** Delete a developer account */
|
|
5359
|
-
deleteDeveloperAccount,
|
|
5360
|
-
/** Get verification payload */
|
|
5361
|
-
getVerificationPayload
|
|
5362
|
-
};
|
|
5363
|
-
}
|
|
5364
|
-
// ============================================
|
|
5365
5514
|
// Subscriptions API
|
|
5366
5515
|
// ============================================
|
|
5367
5516
|
/**
|
|
@@ -5510,7 +5659,10 @@ var Openfort = class {
|
|
|
5510
5659
|
const { recoveryShare: _, ...accountResponse } = response;
|
|
5511
5660
|
return accountResponse;
|
|
5512
5661
|
} catch (error) {
|
|
5513
|
-
|
|
5662
|
+
try {
|
|
5663
|
+
await deleteUser(response.user);
|
|
5664
|
+
} catch {
|
|
5665
|
+
}
|
|
5514
5666
|
throw error;
|
|
5515
5667
|
}
|
|
5516
5668
|
}
|
|
@@ -5541,6 +5693,11 @@ var Openfort = class {
|
|
|
5541
5693
|
* @internal
|
|
5542
5694
|
*/
|
|
5543
5695
|
async preRegisterWithShield(recoveryShare, openfortUserId, thirdPartyUserId, config) {
|
|
5696
|
+
if (!config.shieldApiKey || !config.shieldApiSecret || !config.encryptionShare) {
|
|
5697
|
+
throw new Error(
|
|
5698
|
+
"Shield configuration requires shieldApiKey, shieldApiSecret, and encryptionShare"
|
|
5699
|
+
);
|
|
5700
|
+
}
|
|
5544
5701
|
let externalUserId;
|
|
5545
5702
|
if (config.shieldAuthProvider === import_shield_js.ShieldAuthProvider.OPENFORT) {
|
|
5546
5703
|
externalUserId = openfortUserId;
|
|
@@ -5575,13 +5732,16 @@ var Openfort = class {
|
|
|
5575
5732
|
// Paymasters API
|
|
5576
5733
|
// ============================================
|
|
5577
5734
|
/**
|
|
5578
|
-
* Paymaster endpoints
|
|
5735
|
+
* Paymaster endpoints for managing ERC-4337 paymasters.
|
|
5736
|
+
*
|
|
5737
|
+
* Paymasters handle gas payment on-chain for account abstraction (ERC-4337).
|
|
5738
|
+
* Fee sponsorships reference a paymaster to determine how user operations are sponsored.
|
|
5579
5739
|
*/
|
|
5580
5740
|
get paymasters() {
|
|
5581
5741
|
return {
|
|
5582
5742
|
/** Create a paymaster */
|
|
5583
5743
|
create: createPaymaster,
|
|
5584
|
-
/** Get a paymaster by ID */
|
|
5744
|
+
/** Get a paymaster by ID (pay_...) */
|
|
5585
5745
|
get: getPaymaster,
|
|
5586
5746
|
/** Update a paymaster */
|
|
5587
5747
|
update: updatePaymaster,
|
|
@@ -5600,10 +5760,16 @@ var Openfort = class {
|
|
|
5600
5760
|
*/
|
|
5601
5761
|
async constructWebhookEvent(body, signature2) {
|
|
5602
5762
|
const signedPayload = await sign2(this._apiKey, body);
|
|
5603
|
-
|
|
5604
|
-
|
|
5763
|
+
const expectedBuffer = Buffer.from(signedPayload, "hex");
|
|
5764
|
+
const receivedBuffer = Buffer.from(signature2, "hex");
|
|
5765
|
+
if (expectedBuffer.length !== receivedBuffer.length || !(0, import_node_crypto4.timingSafeEqual)(expectedBuffer, receivedBuffer)) {
|
|
5766
|
+
throw new Error("Invalid signature");
|
|
5767
|
+
}
|
|
5768
|
+
try {
|
|
5769
|
+
return JSON.parse(body);
|
|
5770
|
+
} catch {
|
|
5771
|
+
throw new Error("Failed to parse webhook payload");
|
|
5605
5772
|
}
|
|
5606
|
-
return JSON.parse(body);
|
|
5607
5773
|
}
|
|
5608
5774
|
/**
|
|
5609
5775
|
* Creates an encryption session with Shield.
|
|
@@ -5714,6 +5880,7 @@ var index_default = Openfort;
|
|
|
5714
5880
|
EntityTypeDEVICE,
|
|
5715
5881
|
EntityTypeEMAILSAMPLE,
|
|
5716
5882
|
EntityTypeEVENT,
|
|
5883
|
+
EntityTypeFEESPONSORSHIP,
|
|
5717
5884
|
EntityTypeFORWARDERCONTRACT,
|
|
5718
5885
|
EntityTypeLOG,
|
|
5719
5886
|
EntityTypePAYMASTER,
|
|
@@ -5774,7 +5941,7 @@ var index_default = Openfort;
|
|
|
5774
5941
|
GetAccountsV2AccountType,
|
|
5775
5942
|
GetAccountsV2ChainType,
|
|
5776
5943
|
GetAccountsV2Custody,
|
|
5777
|
-
|
|
5944
|
+
GetGasPolicyRulesLegacyExpandItem,
|
|
5778
5945
|
IMPORT_ENCRYPTION_PUBLIC_KEY,
|
|
5779
5946
|
ImportPrivateKeyRequestChainType,
|
|
5780
5947
|
ImportPrivateKeyResponseChainType,
|
|
@@ -5786,7 +5953,7 @@ var index_default = Openfort;
|
|
|
5786
5953
|
JsonRpcRequestJsonrpc,
|
|
5787
5954
|
JsonRpcSuccessResponseAnyJsonrpc,
|
|
5788
5955
|
ListBackendWalletsChainType,
|
|
5789
|
-
|
|
5956
|
+
ListPoliciesScopeItem,
|
|
5790
5957
|
MintAddressCriterionOperator,
|
|
5791
5958
|
MintAddressCriterionRequestOperator,
|
|
5792
5959
|
MintAddressCriterionRequestType,
|
|
@@ -5822,7 +5989,7 @@ var index_default = Openfort;
|
|
|
5822
5989
|
PolicyRuleTypeCONTRACT,
|
|
5823
5990
|
PolicyRuleTypeRATELIMIT,
|
|
5824
5991
|
PolicyV2Action,
|
|
5825
|
-
|
|
5992
|
+
PolicyV2ListQueriesScopeItem,
|
|
5826
5993
|
PolicyV2Scope,
|
|
5827
5994
|
PregenerateAccountResponseCustody,
|
|
5828
5995
|
PregenerateUserRequestV2AccountType,
|
|
@@ -5892,10 +6059,12 @@ var index_default = Openfort;
|
|
|
5892
6059
|
SplValueCriterionRequestOperator,
|
|
5893
6060
|
SplValueCriterionRequestType,
|
|
5894
6061
|
SplValueCriterionSchema,
|
|
6062
|
+
SponsorEvmTransactionRuleSchema,
|
|
5895
6063
|
SponsorSchema,
|
|
5896
6064
|
SponsorSchemaCHARGECUSTOMTOKENS,
|
|
5897
6065
|
SponsorSchemaFIXEDRATE,
|
|
5898
6066
|
SponsorSchemaPAYFORUSER,
|
|
6067
|
+
SponsorSolTransactionRuleSchema,
|
|
5899
6068
|
Status,
|
|
5900
6069
|
ThirdPartyOAuthProvider,
|
|
5901
6070
|
ThirdPartyOAuthProviderACCELBYTE,
|
|
@@ -5936,15 +6105,16 @@ var index_default = Openfort;
|
|
|
5936
6105
|
createContract,
|
|
5937
6106
|
createDeveloperAccount,
|
|
5938
6107
|
createEvent,
|
|
6108
|
+
createFeeSponsorship,
|
|
5939
6109
|
createForwarderContract,
|
|
6110
|
+
createGasPolicyLegacy,
|
|
6111
|
+
createGasPolicyRuleLegacy,
|
|
6112
|
+
createGasPolicyWithdrawalLegacy,
|
|
5940
6113
|
createOAuthConfig,
|
|
5941
6114
|
createOnrampSession,
|
|
5942
6115
|
createPaymaster,
|
|
5943
6116
|
createPlayer,
|
|
5944
|
-
createPolicy,
|
|
5945
|
-
createPolicyRule,
|
|
5946
6117
|
createPolicyV2,
|
|
5947
|
-
createPolicyWithdrawal,
|
|
5948
6118
|
createSession,
|
|
5949
6119
|
createSubscription,
|
|
5950
6120
|
createTransactionIntent,
|
|
@@ -5955,20 +6125,23 @@ var index_default = Openfort;
|
|
|
5955
6125
|
deleteContract,
|
|
5956
6126
|
deleteDeveloperAccount,
|
|
5957
6127
|
deleteEvent,
|
|
6128
|
+
deleteFeeSponsorship,
|
|
5958
6129
|
deleteForwarderContract,
|
|
6130
|
+
deleteGasPolicyLegacy,
|
|
6131
|
+
deleteGasPolicyRuleLegacy,
|
|
5959
6132
|
deleteOAuthConfig,
|
|
5960
6133
|
deletePaymaster,
|
|
5961
6134
|
deletePlayer,
|
|
5962
|
-
deletePolicy,
|
|
5963
|
-
deletePolicyRule,
|
|
5964
6135
|
deletePolicyV2,
|
|
5965
6136
|
deleteSubscription,
|
|
5966
6137
|
deleteTrigger,
|
|
5967
6138
|
deleteUser,
|
|
5968
6139
|
deprecatedCallbackOAuth,
|
|
5969
6140
|
disableAccount,
|
|
5970
|
-
|
|
5971
|
-
|
|
6141
|
+
disableFeeSponsorship,
|
|
6142
|
+
disableGasPolicyLegacy,
|
|
6143
|
+
enableFeeSponsorship,
|
|
6144
|
+
enableGasPolicyLegacy,
|
|
5972
6145
|
encryptForImport,
|
|
5973
6146
|
estimateTransactionIntentCost,
|
|
5974
6147
|
evaluatePolicyV2,
|
|
@@ -5990,7 +6163,14 @@ var index_default = Openfort;
|
|
|
5990
6163
|
getDeveloperAccounts,
|
|
5991
6164
|
getEvent,
|
|
5992
6165
|
getEvents,
|
|
6166
|
+
getFeeSponsorship,
|
|
5993
6167
|
getForwarderContract,
|
|
6168
|
+
getGasPoliciesLegacy,
|
|
6169
|
+
getGasPolicyBalanceLegacy,
|
|
6170
|
+
getGasPolicyLegacy,
|
|
6171
|
+
getGasPolicyReportTransactionIntentsLegacy,
|
|
6172
|
+
getGasPolicyRulesLegacy,
|
|
6173
|
+
getGasPolicyTotalGasUsageLegacy,
|
|
5994
6174
|
getJwks,
|
|
5995
6175
|
getOAuthConfig,
|
|
5996
6176
|
getOnrampQuote,
|
|
@@ -5998,12 +6178,6 @@ var index_default = Openfort;
|
|
|
5998
6178
|
getPlayer,
|
|
5999
6179
|
getPlayerSessions,
|
|
6000
6180
|
getPlayers,
|
|
6001
|
-
getPolicies,
|
|
6002
|
-
getPolicy,
|
|
6003
|
-
getPolicyBalance,
|
|
6004
|
-
getPolicyReportTransactionIntents,
|
|
6005
|
-
getPolicyRules,
|
|
6006
|
-
getPolicyTotalGasUsage,
|
|
6007
6181
|
getPolicyV2,
|
|
6008
6182
|
getProjectLogs,
|
|
6009
6183
|
getSession,
|
|
@@ -6031,6 +6205,7 @@ var index_default = Openfort;
|
|
|
6031
6205
|
linkThirdParty,
|
|
6032
6206
|
list,
|
|
6033
6207
|
listBackendWallets,
|
|
6208
|
+
listFeeSponsorships,
|
|
6034
6209
|
listForwarderContracts,
|
|
6035
6210
|
listOAuthConfig,
|
|
6036
6211
|
listPaymasters,
|
|
@@ -6073,11 +6248,12 @@ var index_default = Openfort;
|
|
|
6073
6248
|
unlinkSIWE,
|
|
6074
6249
|
updateContract,
|
|
6075
6250
|
updateDeveloperAccount,
|
|
6251
|
+
updateFeeSponsorship,
|
|
6076
6252
|
updateForwarderContract,
|
|
6253
|
+
updateGasPolicyLegacy,
|
|
6254
|
+
updateGasPolicyRuleLegacy,
|
|
6077
6255
|
updatePaymaster,
|
|
6078
6256
|
updatePlayer,
|
|
6079
|
-
updatePolicy,
|
|
6080
|
-
updatePolicyRule,
|
|
6081
6257
|
updatePolicyV2,
|
|
6082
6258
|
verifyAuthToken,
|
|
6083
6259
|
verifyEmail,
|