@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/zero-x.d.ts ADDED
@@ -0,0 +1,204 @@
1
+ export interface ZeroExQuoteRequest {
2
+ chainId: string
3
+ buyToken: string
4
+ sellToken: string
5
+ sellAmount: string
6
+ txOrigin?: string
7
+ swapFeeRecipient?: string
8
+ swapFeeBps?: number
9
+ swapFeeToken?: string
10
+ tradeSurplusRecipient?: string
11
+ gasPrice?: string
12
+ slippageBps?: number
13
+ excludedSources?: string
14
+ sellEntireBalance?: 'true' | 'false'
15
+ }
16
+
17
+ export interface ZeroExQuoteResponse {
18
+ data: {
19
+ rawResponse: {
20
+ message?: string
21
+ blockNumber: string
22
+ buyAmount: string
23
+ buyToken: string
24
+ fees: {
25
+ integratorFee: {
26
+ amount: string
27
+ token: string
28
+ type: string
29
+ } | null
30
+ zeroExFee: {
31
+ amount: string
32
+ token: string
33
+ type: string
34
+ } | null
35
+ gasFee: {
36
+ amount: string
37
+ token: string
38
+ type: string
39
+ } | null
40
+ }
41
+ issues: {
42
+ allowance: {
43
+ actual: string
44
+ spender: string
45
+ }
46
+ balance: {
47
+ token: string
48
+ actual: string
49
+ expected: string
50
+ }
51
+ simulationIncomplete: boolean
52
+ invalidSourcesPassed: any[]
53
+ }
54
+ liquidityAvailable: boolean
55
+ minBuyAmount: string
56
+ route: {
57
+ fills: {
58
+ from: string
59
+ to: string
60
+ source: string
61
+ proportionBps: string
62
+ }[]
63
+ tokens: { address: string; symbol: string }[]
64
+ }
65
+ sellAmount: string
66
+ sellToken: string
67
+ tokenMetadata: {
68
+ buyToken: {
69
+ buyTaxBps: string
70
+ sellTaxBps: string
71
+ }
72
+ sellToken: {
73
+ buyTaxBps: string
74
+ sellTaxBps: string
75
+ }
76
+ }
77
+ totalNetworkFee: string
78
+ transaction: {
79
+ to: string
80
+ data: string
81
+ gas: string
82
+ gasPrice: string
83
+ value: string
84
+ }
85
+ }
86
+ }
87
+ metadata: {
88
+ buyToken: string
89
+ sellToken: string
90
+ sellAmount: string
91
+ chainId: string
92
+ clientId: string
93
+ clientEip155Address: string
94
+ }
95
+ }
96
+
97
+ export interface ZeroExSourcesRequest {
98
+ chainId: string
99
+ }
100
+
101
+ export interface ZeroExSourcesResponse {
102
+ metadata: {
103
+ chainId: string
104
+ clientId: string
105
+ }
106
+ data: {
107
+ rawResponse: { sources: string[]; zid: string }
108
+ }
109
+ }
110
+
111
+ export interface ZeroExPriceRequest {
112
+ chainId: string
113
+ buyToken: string
114
+ sellToken: string
115
+ sellAmount: string
116
+ txOrigin?: string
117
+ swapFeeRecipient?: string
118
+ swapFeeBps?: number
119
+ swapFeeToken?: string
120
+ tradeSurplusRecipient?: string
121
+ gasPrice?: string
122
+ slippageBps?: number
123
+ excludedSources?: string
124
+ sellEntireBalance?: 'true' | 'false'
125
+ }
126
+
127
+ export interface ZeroExPriceResponse {
128
+ data: {
129
+ rawResponse: {
130
+ message?: string
131
+ blockNumber: string
132
+ buyAmount: string
133
+ buyToken: string
134
+ fees: {
135
+ integratorFee: {
136
+ amount: string
137
+ token: string
138
+ type: string
139
+ } | null
140
+ zeroExFee: {
141
+ amount: string
142
+ token: string
143
+ type: string
144
+ } | null
145
+ gasFee: {
146
+ amount: string
147
+ token: string
148
+ type: string
149
+ } | null
150
+ }
151
+ gas: string
152
+ gasPrice: string
153
+ issues: {
154
+ allowance: {
155
+ actual: string
156
+ spender: string
157
+ }
158
+ balance: {
159
+ token: string
160
+ actual: string
161
+ expected: string
162
+ }
163
+ simulationIncomplete: boolean
164
+ invalidSourcesPassed: any[]
165
+ }
166
+ liquidityAvailable: boolean
167
+ minBuyAmount: string
168
+ route: {
169
+ fills: {
170
+ from: string
171
+ to: string
172
+ source: string
173
+ proportionBps: string
174
+ }[]
175
+ tokens: { address: string; symbol: string }[]
176
+ }
177
+ sellAmount: string
178
+ sellToken: string
179
+ tokenMetadata: {
180
+ buyToken: {
181
+ buyTaxBps: string
182
+ sellTaxBps: string
183
+ }
184
+ sellToken: {
185
+ buyTaxBps: string
186
+ sellTaxBps: string
187
+ }
188
+ }
189
+ totalNetworkFee: string
190
+ }
191
+ }
192
+ metadata: {
193
+ buyToken: string
194
+ sellToken: string
195
+ sellAmount: string
196
+ chainId: string
197
+ clientId: string
198
+ clientEip155Address: string
199
+ }
200
+ }
201
+
202
+ export interface ZeroExOptions {
203
+ zeroXApiKey?: string
204
+ }