@portal-hq/web 3.6.2-alpha → 3.7.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.
Files changed (45) hide show
  1. package/hypernative.d.ts +346 -0
  2. package/lib/commonjs/index.js +144 -2
  3. package/lib/commonjs/index.test.js +119 -2
  4. package/lib/commonjs/integrations/security/hypernative/index.js +101 -0
  5. package/lib/commonjs/integrations/security/hypernative/index.test.js +151 -0
  6. package/lib/commonjs/integrations/security/index.js +16 -0
  7. package/lib/commonjs/integrations/trading/zero-x/index.js +17 -4
  8. package/lib/commonjs/integrations/trading/zero-x/index.test.js +61 -15
  9. package/lib/commonjs/mpc/index.js +156 -5
  10. package/lib/commonjs/mpc/index.test.js +794 -5
  11. package/lib/commonjs/passkeys/index.js +394 -0
  12. package/lib/commonjs/passkeys/types.js +2 -0
  13. package/lib/commonjs/provider/index.js +5 -2
  14. package/lib/esm/index.js +144 -2
  15. package/lib/esm/index.test.js +119 -2
  16. package/lib/esm/integrations/security/hypernative/index.js +98 -0
  17. package/lib/esm/integrations/security/hypernative/index.test.js +146 -0
  18. package/lib/esm/integrations/security/index.js +10 -0
  19. package/lib/esm/integrations/trading/zero-x/index.js +17 -4
  20. package/lib/esm/integrations/trading/zero-x/index.test.js +62 -16
  21. package/lib/esm/mpc/index.js +156 -5
  22. package/lib/esm/mpc/index.test.js +795 -6
  23. package/lib/esm/passkeys/index.js +390 -0
  24. package/lib/esm/passkeys/types.js +1 -0
  25. package/lib/esm/provider/index.js +5 -2
  26. package/lifi-types.d.ts +1236 -0
  27. package/package.json +6 -3
  28. package/src/__mocks/constants.ts +422 -5
  29. package/src/__mocks/portal/mpc.ts +1 -0
  30. package/src/index.test.ts +179 -3
  31. package/src/index.ts +212 -4
  32. package/src/integrations/security/hypernative/index.test.ts +196 -0
  33. package/src/integrations/security/hypernative/index.ts +106 -0
  34. package/src/integrations/security/index.ts +14 -0
  35. package/src/integrations/trading/zero-x/index.test.ts +98 -19
  36. package/src/integrations/trading/zero-x/index.ts +29 -9
  37. package/src/mpc/index.test.ts +944 -7
  38. package/src/mpc/index.ts +200 -10
  39. package/src/passkeys/index.ts +536 -0
  40. package/src/passkeys/types.ts +78 -0
  41. package/src/provider/index.ts +5 -0
  42. package/tsconfig.json +7 -1
  43. package/types.d.ts +45 -12
  44. package/yieldxyz-types.d.ts +778 -0
  45. package/zero-x.d.ts +204 -0
package/types.d.ts CHANGED
@@ -31,8 +31,14 @@ export interface BackupArgs extends MpcOperationArgs {
31
31
  backupConfigs: BackupConfigs = {}
32
32
  }
33
33
 
34
+
35
+ export interface CustomBackupConfig {
36
+ encryptionKey: string
37
+ }
38
+
34
39
  export interface BackupConfigs {
35
40
  passwordStorage?: PasswordConfig
41
+ customStorage?: CustomBackupConfig
36
42
  }
37
43
 
38
44
  export interface OrgBackupShares {
@@ -51,6 +57,7 @@ export interface BackupData {
51
57
  export interface BackupResult {
52
58
  backupIds: string[]
53
59
  cipherText: string
60
+ encryptionKey?: string
54
61
  }
55
62
 
56
63
  export interface Address {
@@ -62,6 +69,41 @@ export interface Address {
62
69
  export interface BackupResponse {
63
70
  cipherText: string
64
71
  storageCallback: () => Promise<void>
72
+ encryptionKey?: string
73
+ }
74
+
75
+ export interface BackupShareResult {
76
+ cipherText: string
77
+ encryptionKey: string
78
+ }
79
+
80
+ export interface PasskeyOptions {
81
+ /**
82
+ * Toggle legacy popup behaviour. Defaults to true to preserve existing integrations.
83
+ */
84
+ usePopup?: boolean
85
+ /**
86
+ * Fully qualified domain or hostname that hosts passkey endpoints.
87
+ * Example: `passkeys.wigwam.app`
88
+ */
89
+ customDomain?: string
90
+ /**
91
+ * Human-friendly name rendered in the browser passkey prompt.
92
+ */
93
+ relyingPartyName?: string
94
+ /**
95
+ * Override the relying party ID. Useful when the TBS domain differs from the browser origin.
96
+ * Example: Use `localhost` when testing locally against a staging TBS.
97
+ */
98
+ relyingPartyId?: string
99
+ }
100
+
101
+ export interface BackupOptions extends PasskeyOptions {
102
+ /**
103
+ * Backup method to use when running combined flows.
104
+ * Defaults to `BackupMethods.passkey` for direct passkey flows.
105
+ */
106
+ backupMethod?: BackupMethods
65
107
  }
66
108
 
67
109
  export interface Balance {
@@ -73,18 +115,7 @@ export interface SendAssetParams {
73
115
  amount: string
74
116
  to: string
75
117
  token: string
76
- }
77
-
78
- export interface SendAssetResponse {
79
- transactionHash: string
80
- metadata: {
81
- amount?: string
82
- lastValidBlockHeight?: string
83
- rawAmount?: string
84
- tokenAddress?: string
85
- tokenDecimals?: number
86
- tokenSymbol?: string
87
- }
118
+ sponsorGas?: boolean
88
119
  }
89
120
 
90
121
  export interface FundParams {
@@ -468,6 +499,7 @@ export interface RequestArguments {
468
499
  chainId?: string
469
500
  method: RequestMethod
470
501
  params?: unknown[] | SigningRequestParams
502
+ sponsorGas?: boolean
471
503
  }
472
504
 
473
505
  export interface RecoverArgs extends MpcOperationArgs {
@@ -502,6 +534,7 @@ export interface SignArgs {
502
534
  method: string
503
535
  params: string
504
536
  rpcUrl: string
537
+ sponsorGas?: boolean
505
538
  }
506
539
 
507
540
  export interface SignData {