@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.mjs CHANGED
@@ -375,7 +375,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
375
375
  }
376
376
 
377
377
  // src/version.ts
378
- var VERSION = "0.9.0";
378
+ var VERSION = "0.9.2";
379
379
  var PACKAGE = "@openfort/openfort-node";
380
380
 
381
381
  // src/openapi-client/openfortApiClient.ts
@@ -1823,6 +1823,17 @@ var getBackendWallet = (id, options) => {
1823
1823
  options
1824
1824
  );
1825
1825
  };
1826
+ var updateBackendWallet = (id, updateBackendWalletRequest, options) => {
1827
+ return openfortApiClient(
1828
+ {
1829
+ url: `/v2/accounts/backend/${id}`,
1830
+ method: "PUT",
1831
+ headers: { "Content-Type": "application/json" },
1832
+ data: updateBackendWalletRequest
1833
+ },
1834
+ options
1835
+ );
1836
+ };
1826
1837
  var deleteBackendWallet = (id, options) => {
1827
1838
  return openfortApiClient(
1828
1839
  {
@@ -2910,6 +2921,27 @@ var CreateBackendWalletRequestChainType = {
2910
2921
  EVM: "EVM",
2911
2922
  SVM: "SVM"
2912
2923
  };
2924
+ var UpdateBackendWalletResponseObject = {
2925
+ backendWallet: "backendWallet"
2926
+ };
2927
+ var UpdateBackendWalletResponseChainType = {
2928
+ EVM: "EVM",
2929
+ SVM: "SVM"
2930
+ };
2931
+ var UpdateBackendWalletResponseCustody = {
2932
+ Developer: "Developer"
2933
+ };
2934
+ var UpdateBackendWalletResponseDelegatedAccountChainChainType = {
2935
+ EVM: "EVM",
2936
+ SVM: "SVM"
2937
+ };
2938
+ var UpdateBackendWalletRequestAccountType = {
2939
+ Delegated_Account: "Delegated Account"
2940
+ };
2941
+ var UpdateBackendWalletRequestChainType = {
2942
+ EVM: "EVM",
2943
+ SVM: "SVM"
2944
+ };
2913
2945
  var DeleteBackendWalletResponseObject = {
2914
2946
  backendWallet: "backendWallet"
2915
2947
  };
@@ -2981,6 +3013,11 @@ var UserProjectRoleMEMBER = {
2981
3013
  };
2982
3014
  var UserProjectCreateRequestRole = { ...UserProjectRoleADMIN, ...UserProjectRoleMEMBER };
2983
3015
  var UserProjectUpdateRequestRole = { ...UserProjectRoleMEMBER, ...UserProjectRoleADMIN };
3016
+ var UsageAlertType = {
3017
+ warning: "warning",
3018
+ critical: "critical",
3019
+ info: "info"
3020
+ };
2984
3021
  var EntityTypePROJECT = {
2985
3022
  project: "project"
2986
3023
  };
@@ -3842,12 +3879,22 @@ import {
3842
3879
  toPrefixedMessage
3843
3880
  } from "viem";
3844
3881
 
3882
+ // src/wallets/evm/actions/normalizeSignature.ts
3883
+ function normalizeSignature(sig) {
3884
+ const v = parseInt(sig.slice(-2), 16);
3885
+ if (v < 27) {
3886
+ return sig.slice(0, -2) + (v + 27).toString(16);
3887
+ }
3888
+ return sig;
3889
+ }
3890
+
3845
3891
  // src/wallets/evm/actions/signHash.ts
3846
3892
  async function signHash(options) {
3847
3893
  const { accountId, hash } = options;
3848
3894
  const response = await sign(accountId, { data: hash });
3895
+ const signature2 = normalizeSignature(response.signature);
3849
3896
  return {
3850
- signature: response.signature
3897
+ signature: signature2
3851
3898
  };
3852
3899
  }
3853
3900
 
@@ -4114,6 +4161,28 @@ var EvmClient = class {
4114
4161
  });
4115
4162
  return response.signature;
4116
4163
  }
4164
+ /**
4165
+ * Updates an EVM backend wallet.
4166
+ *
4167
+ * Currently supports upgrading an EVM EOA to a Delegated Account (EIP-7702).
4168
+ *
4169
+ * @param options - Update options including account ID and delegation parameters
4170
+ * @returns The updated backend wallet response
4171
+ *
4172
+ * @example
4173
+ * ```typescript
4174
+ * const updated = await openfort.accounts.evm.backend.update({
4175
+ * id: 'acc_...',
4176
+ * accountType: 'Delegated Account',
4177
+ * chain: { chainType: 'EVM', chainId: 8453 },
4178
+ * implementationType: 'Calibur',
4179
+ * });
4180
+ * ```
4181
+ */
4182
+ async update(options) {
4183
+ const { id, ...req } = options;
4184
+ return updateBackendWallet(id, req);
4185
+ }
4117
4186
  };
4118
4187
  EvmClient.type = "evmWallet";
4119
4188
 
@@ -4806,7 +4875,9 @@ var Openfort = class {
4806
4875
  /** Import private key (with E2E encryption) */
4807
4876
  import: evmClient.importAccount.bind(evmClient),
4808
4877
  /** Export private key (with E2E encryption) */
4809
- export: evmClient.exportAccount.bind(evmClient)
4878
+ export: evmClient.exportAccount.bind(evmClient),
4879
+ /** Update EOA to delegated account */
4880
+ update: evmClient.update.bind(evmClient)
4810
4881
  },
4811
4882
  /** Embedded wallet operations (User custody) */
4812
4883
  embedded: {
@@ -5630,7 +5701,14 @@ export {
5630
5701
  TransactionIntentResponseExpandable,
5631
5702
  TransactionStatus,
5632
5703
  UnknownError,
5704
+ UpdateBackendWalletRequestAccountType,
5705
+ UpdateBackendWalletRequestChainType,
5706
+ UpdateBackendWalletResponseChainType,
5707
+ UpdateBackendWalletResponseCustody,
5708
+ UpdateBackendWalletResponseDelegatedAccountChainChainType,
5709
+ UpdateBackendWalletResponseObject,
5633
5710
  UpdatePolicyBodySchema,
5711
+ UsageAlertType,
5634
5712
  UserInputValidationError,
5635
5713
  UserProjectCreateRequestRole,
5636
5714
  UserProjectRole,
@@ -5795,6 +5873,7 @@ export {
5795
5873
  unlinkEmail,
5796
5874
  unlinkOAuth,
5797
5875
  unlinkSIWE,
5876
+ updateBackendWallet,
5798
5877
  updateContract,
5799
5878
  updateDeveloperAccount,
5800
5879
  updateFeeSponsorship,