@openfort/openfort-node 0.9.0 → 0.9.2

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/dist/index.js CHANGED
@@ -296,7 +296,14 @@ __export(index_exports, {
296
296
  TransactionIntentResponseExpandable: () => TransactionIntentResponseExpandable,
297
297
  TransactionStatus: () => TransactionStatus,
298
298
  UnknownError: () => UnknownError,
299
+ UpdateBackendWalletRequestAccountType: () => UpdateBackendWalletRequestAccountType,
300
+ UpdateBackendWalletRequestChainType: () => UpdateBackendWalletRequestChainType,
301
+ UpdateBackendWalletResponseChainType: () => UpdateBackendWalletResponseChainType,
302
+ UpdateBackendWalletResponseCustody: () => UpdateBackendWalletResponseCustody,
303
+ UpdateBackendWalletResponseDelegatedAccountChainChainType: () => UpdateBackendWalletResponseDelegatedAccountChainChainType,
304
+ UpdateBackendWalletResponseObject: () => UpdateBackendWalletResponseObject,
299
305
  UpdatePolicyBodySchema: () => UpdatePolicyBodySchema,
306
+ UsageAlertType: () => UsageAlertType,
300
307
  UserInputValidationError: () => UserInputValidationError,
301
308
  UserProjectCreateRequestRole: () => UserProjectCreateRequestRole,
302
309
  UserProjectRole: () => UserProjectRole,
@@ -461,6 +468,7 @@ __export(index_exports, {
461
468
  unlinkEmail: () => unlinkEmail,
462
469
  unlinkOAuth: () => unlinkOAuth,
463
470
  unlinkSIWE: () => unlinkSIWE,
471
+ updateBackendWallet: () => updateBackendWallet,
464
472
  updateContract: () => updateContract,
465
473
  updateDeveloperAccount: () => updateDeveloperAccount,
466
474
  updateFeeSponsorship: () => updateFeeSponsorship,
@@ -841,7 +849,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
841
849
  }
842
850
 
843
851
  // src/version.ts
844
- var VERSION = "0.9.0";
852
+ var VERSION = "0.9.2";
845
853
  var PACKAGE = "@openfort/openfort-node";
846
854
 
847
855
  // src/openapi-client/openfortApiClient.ts
@@ -2289,6 +2297,17 @@ var getBackendWallet = (id, options) => {
2289
2297
  options
2290
2298
  );
2291
2299
  };
2300
+ var updateBackendWallet = (id, updateBackendWalletRequest, options) => {
2301
+ return openfortApiClient(
2302
+ {
2303
+ url: `/v2/accounts/backend/${id}`,
2304
+ method: "PUT",
2305
+ headers: { "Content-Type": "application/json" },
2306
+ data: updateBackendWalletRequest
2307
+ },
2308
+ options
2309
+ );
2310
+ };
2292
2311
  var deleteBackendWallet = (id, options) => {
2293
2312
  return openfortApiClient(
2294
2313
  {
@@ -3376,6 +3395,27 @@ var CreateBackendWalletRequestChainType = {
3376
3395
  EVM: "EVM",
3377
3396
  SVM: "SVM"
3378
3397
  };
3398
+ var UpdateBackendWalletResponseObject = {
3399
+ backendWallet: "backendWallet"
3400
+ };
3401
+ var UpdateBackendWalletResponseChainType = {
3402
+ EVM: "EVM",
3403
+ SVM: "SVM"
3404
+ };
3405
+ var UpdateBackendWalletResponseCustody = {
3406
+ Developer: "Developer"
3407
+ };
3408
+ var UpdateBackendWalletResponseDelegatedAccountChainChainType = {
3409
+ EVM: "EVM",
3410
+ SVM: "SVM"
3411
+ };
3412
+ var UpdateBackendWalletRequestAccountType = {
3413
+ Delegated_Account: "Delegated Account"
3414
+ };
3415
+ var UpdateBackendWalletRequestChainType = {
3416
+ EVM: "EVM",
3417
+ SVM: "SVM"
3418
+ };
3379
3419
  var DeleteBackendWalletResponseObject = {
3380
3420
  backendWallet: "backendWallet"
3381
3421
  };
@@ -3447,6 +3487,11 @@ var UserProjectRoleMEMBER = {
3447
3487
  };
3448
3488
  var UserProjectCreateRequestRole = { ...UserProjectRoleADMIN, ...UserProjectRoleMEMBER };
3449
3489
  var UserProjectUpdateRequestRole = { ...UserProjectRoleMEMBER, ...UserProjectRoleADMIN };
3490
+ var UsageAlertType = {
3491
+ warning: "warning",
3492
+ critical: "critical",
3493
+ info: "info"
3494
+ };
3450
3495
  var EntityTypePROJECT = {
3451
3496
  project: "project"
3452
3497
  };
@@ -4297,12 +4342,22 @@ var decryptExportedPrivateKey = (encryptedPrivateKeyBase64, privateKeyPem) => {
4297
4342
  // src/wallets/evm/accounts/evmAccount.ts
4298
4343
  var import_viem = require("viem");
4299
4344
 
4345
+ // src/wallets/evm/actions/normalizeSignature.ts
4346
+ function normalizeSignature(sig) {
4347
+ const v = parseInt(sig.slice(-2), 16);
4348
+ if (v < 27) {
4349
+ return sig.slice(0, -2) + (v + 27).toString(16);
4350
+ }
4351
+ return sig;
4352
+ }
4353
+
4300
4354
  // src/wallets/evm/actions/signHash.ts
4301
4355
  async function signHash(options) {
4302
4356
  const { accountId, hash } = options;
4303
4357
  const response = await sign(accountId, { data: hash });
4358
+ const signature2 = normalizeSignature(response.signature);
4304
4359
  return {
4305
- signature: response.signature
4360
+ signature: signature2
4306
4361
  };
4307
4362
  }
4308
4363
 
@@ -4569,6 +4624,28 @@ var EvmClient = class {
4569
4624
  });
4570
4625
  return response.signature;
4571
4626
  }
4627
+ /**
4628
+ * Updates an EVM backend wallet.
4629
+ *
4630
+ * Currently supports upgrading an EVM EOA to a Delegated Account (EIP-7702).
4631
+ *
4632
+ * @param options - Update options including account ID and delegation parameters
4633
+ * @returns The updated backend wallet response
4634
+ *
4635
+ * @example
4636
+ * ```typescript
4637
+ * const updated = await openfort.accounts.evm.backend.update({
4638
+ * id: 'acc_...',
4639
+ * accountType: 'Delegated Account',
4640
+ * chain: { chainType: 'EVM', chainId: 8453 },
4641
+ * implementationType: 'Calibur',
4642
+ * });
4643
+ * ```
4644
+ */
4645
+ async update(options) {
4646
+ const { id, ...req } = options;
4647
+ return updateBackendWallet(id, req);
4648
+ }
4572
4649
  };
4573
4650
  EvmClient.type = "evmWallet";
4574
4651
 
@@ -5257,7 +5334,9 @@ var Openfort = class {
5257
5334
  /** Import private key (with E2E encryption) */
5258
5335
  import: evmClient.importAccount.bind(evmClient),
5259
5336
  /** Export private key (with E2E encryption) */
5260
- export: evmClient.exportAccount.bind(evmClient)
5337
+ export: evmClient.exportAccount.bind(evmClient),
5338
+ /** Update EOA to delegated account */
5339
+ update: evmClient.update.bind(evmClient)
5261
5340
  },
5262
5341
  /** Embedded wallet operations (User custody) */
5263
5342
  embedded: {
@@ -6082,7 +6161,14 @@ var index_default = Openfort;
6082
6161
  TransactionIntentResponseExpandable,
6083
6162
  TransactionStatus,
6084
6163
  UnknownError,
6164
+ UpdateBackendWalletRequestAccountType,
6165
+ UpdateBackendWalletRequestChainType,
6166
+ UpdateBackendWalletResponseChainType,
6167
+ UpdateBackendWalletResponseCustody,
6168
+ UpdateBackendWalletResponseDelegatedAccountChainChainType,
6169
+ UpdateBackendWalletResponseObject,
6085
6170
  UpdatePolicyBodySchema,
6171
+ UsageAlertType,
6086
6172
  UserInputValidationError,
6087
6173
  UserProjectCreateRequestRole,
6088
6174
  UserProjectRole,
@@ -6246,6 +6332,7 @@ var index_default = Openfort;
6246
6332
  unlinkEmail,
6247
6333
  unlinkOAuth,
6248
6334
  unlinkSIWE,
6335
+ updateBackendWallet,
6249
6336
  updateContract,
6250
6337
  updateDeveloperAccount,
6251
6338
  updateFeeSponsorship,