@sogni-ai/sogni-client 3.0.0-alpha.4 → 3.0.0-alpha.40

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 (69) hide show
  1. package/CHANGELOG.md +274 -0
  2. package/README.md +3 -1
  3. package/dist/Account/CurrentAccount.d.ts +3 -3
  4. package/dist/Account/CurrentAccount.js +12 -4
  5. package/dist/Account/CurrentAccount.js.map +1 -1
  6. package/dist/Account/index.d.ts +40 -10
  7. package/dist/Account/index.js +133 -28
  8. package/dist/Account/index.js.map +1 -1
  9. package/dist/Account/types.d.ts +21 -0
  10. package/dist/ApiClient/WebSocketClient/events.d.ts +55 -7
  11. package/dist/ApiClient/WebSocketClient/index.js +1 -1
  12. package/dist/ApiClient/index.d.ts +4 -2
  13. package/dist/ApiClient/index.js +12 -3
  14. package/dist/ApiClient/index.js.map +1 -1
  15. package/dist/ApiGroup.d.ts +0 -3
  16. package/dist/ApiGroup.js +0 -1
  17. package/dist/ApiGroup.js.map +1 -1
  18. package/dist/Projects/Job.d.ts +43 -0
  19. package/dist/Projects/Job.js +76 -0
  20. package/dist/Projects/Job.js.map +1 -1
  21. package/dist/Projects/Project.d.ts +1 -1
  22. package/dist/Projects/Project.js +22 -19
  23. package/dist/Projects/Project.js.map +1 -1
  24. package/dist/Projects/createJobRequestMessage.js +2 -2
  25. package/dist/Projects/createJobRequestMessage.js.map +1 -1
  26. package/dist/Projects/index.d.ts +7 -2
  27. package/dist/Projects/index.js +50 -12
  28. package/dist/Projects/index.js.map +1 -1
  29. package/dist/Projects/types/ControlNetParams.d.ts +7 -2
  30. package/dist/Projects/types/events.d.ts +6 -0
  31. package/dist/Projects/types/index.d.ts +16 -3
  32. package/dist/Projects/utils.d.ts +2 -0
  33. package/dist/Projects/utils.js +14 -0
  34. package/dist/Projects/utils.js.map +1 -0
  35. package/dist/Stats/types.d.ts +1 -1
  36. package/dist/index.d.ts +10 -6
  37. package/dist/index.js +6 -15
  38. package/dist/index.js.map +1 -1
  39. package/dist/lib/utils.d.ts +1 -0
  40. package/dist/lib/utils.js +15 -0
  41. package/dist/lib/utils.js.map +1 -1
  42. package/dist/types/token.d.ts +1 -0
  43. package/dist/types/token.js +3 -0
  44. package/dist/types/token.js.map +1 -0
  45. package/dist/version.d.ts +1 -1
  46. package/dist/version.js +2 -1
  47. package/dist/version.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/Account/CurrentAccount.ts +14 -6
  50. package/src/Account/index.ts +162 -56
  51. package/src/Account/types.ts +26 -0
  52. package/src/ApiClient/WebSocketClient/events.ts +59 -7
  53. package/src/ApiClient/WebSocketClient/index.ts +1 -1
  54. package/src/ApiClient/index.ts +15 -4
  55. package/src/ApiGroup.ts +0 -4
  56. package/src/Projects/Job.ts +98 -0
  57. package/src/Projects/Project.ts +24 -20
  58. package/src/Projects/createJobRequestMessage.ts +4 -2
  59. package/src/Projects/index.ts +55 -15
  60. package/src/Projects/types/ControlNetParams.ts +8 -2
  61. package/src/Projects/types/events.ts +6 -0
  62. package/src/Projects/types/index.ts +17 -3
  63. package/src/Projects/utils.ts +12 -0
  64. package/src/Stats/index.ts +2 -2
  65. package/src/Stats/types.ts +2 -0
  66. package/src/index.ts +23 -19
  67. package/src/lib/utils.ts +4 -0
  68. package/src/types/token.ts +1 -0
  69. package/src/version.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,277 @@
1
+ # [3.0.0-alpha.40](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.39...v3.0.0-alpha.40) (2025-07-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * Default client to mainnet ([5f9e44f](https://github.com/Sogni-AI/sogni-client/commit/5f9e44f462cd1b6f5bddc30e523567fa8b671736))
7
+
8
+ # [3.0.0-alpha.39](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.38...v3.0.0-alpha.39) (2025-07-02)
9
+
10
+
11
+ ### Features
12
+
13
+ * Support for EIP712 on mainnet ([5e04e81](https://github.com/Sogni-AI/sogni-client/commit/5e04e8129f59bfac0ed6d65cc7c847ad622111b2))
14
+
15
+ # [3.0.0-alpha.38](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.37...v3.0.0-alpha.38) (2025-06-30)
16
+
17
+
18
+ ### Features
19
+
20
+ * Migrate account deposit to v3 ([71bfaac](https://github.com/Sogni-AI/sogni-client/commit/71bfaacca89c3a7f721b91ca39226650a2eb4ff5))
21
+
22
+ # [3.0.0-alpha.37](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.36...v3.0.0-alpha.37) (2025-06-29)
23
+
24
+
25
+ ### Features
26
+
27
+ * Add support for `authenticated` socket event ([bc3d345](https://github.com/Sogni-AI/sogni-client/commit/bc3d3451e7640eb15f1368144bbc112298f640fa))
28
+
29
+ # [3.0.0-alpha.36](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.35...v3.0.0-alpha.36) (2025-06-29)
30
+
31
+
32
+ ### Features
33
+
34
+ * Expose option to disable socket connection (Experimental) ([048adcf](https://github.com/Sogni-AI/sogni-client/commit/048adcfad99acd8ffb8197ad55f7d54679aacde8))
35
+
36
+ # [3.0.0-alpha.35](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.34...v3.0.0-alpha.35) (2025-06-25)
37
+
38
+
39
+ ### Features
40
+
41
+ * Expose getNonce method as public ([694c041](https://github.com/Sogni-AI/sogni-client/commit/694c041431b99c4bae2d5dc8f22d327fed45771d))
42
+
43
+ # [3.0.0-alpha.34](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.33...v3.0.0-alpha.34) (2025-06-18)
44
+
45
+
46
+ ### Features
47
+
48
+ * Decouple fetching balance from the refresh method ([a7d4f62](https://github.com/Sogni-AI/sogni-client/commit/a7d4f625fc29831fdd72fda65af622d303ef1d32))
49
+
50
+ # [3.0.0-alpha.33](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.32...v3.0.0-alpha.33) (2025-06-18)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * Update typings to indicate that `unclaimed` field may be absent from balance ([a661e17](https://github.com/Sogni-AI/sogni-client/commit/a661e17f549c3a51003557acb5e3ee5e34877f9d))
56
+
57
+ # [3.0.0-alpha.32](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.31...v3.0.0-alpha.32) (2025-06-03)
58
+
59
+
60
+ ### Features
61
+
62
+ * Add `provider` parameter to `client.account.transactionHistory` ([9de208a](https://github.com/Sogni-AI/sogni-client/commit/9de208aa478d745a0706d8960e033e4cc9e25d35))
63
+
64
+ # [3.0.0-alpha.31](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.30...v3.0.0-alpha.31) (2025-05-26)
65
+
66
+
67
+ ### Features
68
+
69
+ * Default rewards provider to `base`, add provider param to queried rewards ([d84dcff](https://github.com/Sogni-AI/sogni-client/commit/d84dcff1d3e01b7154e62724d078cfd158d12317))
70
+
71
+ # [3.0.0-alpha.30](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.29...v3.0.0-alpha.30) (2025-05-26)
72
+
73
+
74
+ ### Features
75
+
76
+ * Support passing `provider` parameter when claiming reward ([71a045e](https://github.com/Sogni-AI/sogni-client/commit/71a045e60dbda63efe9f513bc9ffe8328f5e3dd2))
77
+
78
+
79
+ ### BREAKING CHANGES
80
+
81
+ * `client.account.claimRewards` signature changed
82
+
83
+ # [3.0.0-alpha.29](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.28...v3.0.0-alpha.29) (2025-05-26)
84
+
85
+
86
+ ### Features
87
+
88
+ * Support rewards v4 API to query rewards scoped to ([ff0a713](https://github.com/Sogni-AI/sogni-client/commit/ff0a71387f602faba7da9a2e494f886a98881d95))
89
+
90
+ # [3.0.0-alpha.28](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.27...v3.0.0-alpha.28) (2025-05-15)
91
+
92
+
93
+ ### Features
94
+
95
+ * Support uploading starting image and ControlNet input image before creating a project ([4fd8a5a](https://github.com/Sogni-AI/sogni-client/commit/4fd8a5a3597e7b3bb85c4a8c94cd2df798ca6bfe))
96
+
97
+ # [3.0.0-alpha.27](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.26...v3.0.0-alpha.27) (2025-05-14)
98
+
99
+
100
+ ### Features
101
+
102
+ * Allow setting token type for image enhancement ([7420274](https://github.com/Sogni-AI/sogni-client/commit/7420274caf852b078d47e008b6065da70a456714))
103
+
104
+ # [3.0.0-alpha.26](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.25...v3.0.0-alpha.26) (2025-05-14)
105
+
106
+
107
+ ### Bug Fixes
108
+
109
+ * Pass tokenType to jobRequest message. Make tokenType optional for project estimation ([9550d76](https://github.com/Sogni-AI/sogni-client/commit/9550d76ee3d40fb4321a157d0a5feb0fb680f183))
110
+
111
+ # [3.0.0-alpha.25](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.24...v3.0.0-alpha.25) (2025-05-13)
112
+
113
+
114
+ ### Features
115
+
116
+ * Remove blockchain provider since SDK does not need to call Base ([d5f8609](https://github.com/Sogni-AI/sogni-client/commit/d5f8609f29b9f9843913ecaf514516f490a60c61))
117
+
118
+ # [3.0.0-alpha.24](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.23...v3.0.0-alpha.24) (2025-05-13)
119
+
120
+
121
+ ### Features
122
+
123
+ * add tokenType to transaction list ([ee5951e](https://github.com/Sogni-AI/sogni-client/commit/ee5951ef9014ec6eed6a5b52acb5b8b1c5d1227d))
124
+
125
+ # [3.0.0-alpha.23](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.22...v3.0.0-alpha.23) (2025-05-13)
126
+
127
+
128
+ ### Features
129
+
130
+ * add tokenType to estimateCost and estimateEnhancementCost methods ([1c97258](https://github.com/Sogni-AI/sogni-client/commit/1c97258facb2ddd687361a5172d5318329a70c43))
131
+
132
+
133
+ ### BREAKING CHANGES
134
+
135
+ * client.projects.estimateCost and client.projects.estimateEnhancementCost signature changed
136
+
137
+ # [3.0.0-alpha.22](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.21...v3.0.0-alpha.22) (2025-05-12)
138
+
139
+
140
+ ### Features
141
+
142
+ * Bump PROTOCOL_VERSION ([6e5f6b9](https://github.com/Sogni-AI/sogni-client/commit/6e5f6b91870fbd557ce235d0508216c1b4e93cad))
143
+
144
+ # [3.0.0-alpha.21](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.20...v3.0.0-alpha.21) (2025-05-12)
145
+
146
+
147
+ ### Features
148
+
149
+ * add TokenType export and update LIB_VERSION from package.json ([f6110b5](https://github.com/Sogni-AI/sogni-client/commit/f6110b521715a076a7abb3010c68fbde8ea64b71))
150
+
151
+ # [3.0.0-alpha.20](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.19...v3.0.0-alpha.20) (2025-05-12)
152
+
153
+
154
+ ### Features
155
+
156
+ * update balance API and data format to support multiple token types. Support passing token type in Project request ([f227467](https://github.com/Sogni-AI/sogni-client/commit/f22746748f7da3df8dfd9f8fd0cb90a8f7269cac))
157
+
158
+
159
+ ### BREAKING CHANGES
160
+
161
+ * Balance data format has changed
162
+
163
+ # [3.0.0-alpha.19](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.18...v3.0.0-alpha.19) (2025-05-10)
164
+
165
+
166
+ ### Features
167
+
168
+ * emit jobStarted, jobCompleted, and jobFailed events for better job tracking ([0e3bb33](https://github.com/Sogni-AI/sogni-client/commit/0e3bb33703868a3491edfac2c9f08325db0eb278))
169
+
170
+ # [3.0.0-alpha.18](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.17...v3.0.0-alpha.18) (2025-05-09)
171
+
172
+
173
+ ### Features
174
+
175
+ * add support for receiving positivePrompt, negativePrompt, and jobIndex from jobInitiating and jobStarted events, these are useful for dynamic prompt result mapping ([d9873fa](https://github.com/Sogni-AI/sogni-client/commit/d9873fad77709afb72a02eb52ee5fd95e72244be))
176
+
177
+ # [3.0.0-alpha.17](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.16...v3.0.0-alpha.17) (2025-04-30)
178
+
179
+
180
+ ### Bug Fixes
181
+
182
+ * Do not mark project as completed if not all jobs started yet ([812e5ac](https://github.com/Sogni-AI/sogni-client/commit/812e5accd8605a6a742beb16a53bca2be50b9a81))
183
+
184
+ # [3.0.0-alpha.16](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.15...v3.0.0-alpha.16) (2025-04-24)
185
+
186
+
187
+ ### Bug Fixes
188
+
189
+ * Discard enhancement project before starting new one ([4293b2b](https://github.com/Sogni-AI/sogni-client/commit/4293b2b535ed8cfe76ce307de71c99bec799bd79))
190
+
191
+ # [3.0.0-alpha.15](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.14...v3.0.0-alpha.15) (2025-04-24)
192
+
193
+
194
+ ### Bug Fixes
195
+
196
+ * Prevent job progress going down ([5cf69d3](https://github.com/Sogni-AI/sogni-client/commit/5cf69d375d3a284964ba423c4287d592538cd273))
197
+
198
+ # [3.0.0-alpha.14](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.13...v3.0.0-alpha.14) (2025-04-24)
199
+
200
+
201
+ ### Features
202
+
203
+ * Refactor image enhancement logic ([6728875](https://github.com/Sogni-AI/sogni-client/commit/67288759637c4b22266455ce1f1220d2590d7592))
204
+
205
+ # [3.0.0-alpha.13](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2025-04-24)
206
+
207
+
208
+ ### Features
209
+
210
+ * Add prompt and style overrides for image enhancer ([35cd4a0](https://github.com/Sogni-AI/sogni-client/commit/35cd4a017361f919d42a2568fff6e2e7b4367949))
211
+
212
+ # [3.0.0-alpha.12](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2025-04-23)
213
+
214
+
215
+ ### Bug Fixes
216
+
217
+ * Copy size preset when enhancing image ([06ab629](https://github.com/Sogni-AI/sogni-client/commit/06ab629a9b10377c87406817d1e72a0cd35bd025))
218
+
219
+ # [3.0.0-alpha.11](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2025-04-23)
220
+
221
+
222
+ ### Features
223
+
224
+ * Image enhancement with Flux model ([82488e7](https://github.com/Sogni-AI/sogni-client/commit/82488e7658b56902cee25e58bc1763c1392c5d46))
225
+
226
+ # [3.0.0-alpha.11](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2025-04-20)
227
+
228
+
229
+ ### Features
230
+
231
+ * Add support for InstantID ControlNet ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/dbaa1e464d15635dc5e7db6c785bf25b0e8788a7))
232
+
233
+ # [3.0.0-alpha.10](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2025-04-11)
234
+
235
+
236
+ ### Features
237
+
238
+ * Add support for toast message events ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/2b032a83b3c28798a4df692c1cb6f090915191a6))
239
+
240
+ # [3.0.0-alpha.9](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2025-04-07)
241
+
242
+
243
+ ### Bug Fixes
244
+
245
+ * Set scheduler and timeStepSpacing to null by default ([ccc1fc8](https://github.com/Sogni-AI/sogni-client/commit/ccc1fc842b408f905fd786807be5b5df8895690b))
246
+
247
+ # [3.0.0-alpha.8](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2025-04-02)
248
+
249
+
250
+ ### Bug Fixes
251
+
252
+ * Fix project sync attempt counter ([b112c06](https://github.com/Sogni-AI/sogni-client/commit/b112c064b443186b1992a80da5612af001919107))
253
+
254
+ # [3.0.0-alpha.7](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2025-04-02)
255
+
256
+
257
+ ### Features
258
+
259
+ * Set project to error state if failed to sync it to server after not receiving any socket updates ([7ac63c4](https://github.com/Sogni-AI/sogni-client/commit/7ac63c40c5441578cc7beca4363a5301e6450fc3))
260
+
261
+ # [3.0.0-alpha.6](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2025-04-02)
262
+
263
+
264
+ ### Features
265
+
266
+ * Add new leaderboard types ([d6d3fb8](https://github.com/Sogni-AI/sogni-client/commit/d6d3fb8a7c5a84ff089d6b51bc448da26821174a))
267
+
268
+ # [3.0.0-alpha.5](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2025-03-27)
269
+
270
+
271
+ ### Features
272
+
273
+ * Add turnstile token parameter to claimReward ([a96f5e2](https://github.com/Sogni-AI/sogni-client/commit/a96f5e2b22fd879a717aae1c3fe6f60ad675d031))
274
+
1
275
  # [3.0.0-alpha.4](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2025-03-25)
2
276
 
3
277
 
package/README.md CHANGED
@@ -308,6 +308,7 @@ To use ControlNet in your project you need to provide `controlNet` object with t
308
308
  - `shuffle`
309
309
  - `softedge`
310
310
  - `tile`
311
+ - `instantid`
311
312
  - `image` - input image. Image size should match the size of the generated image. Can be [File](https://developer.mozilla.org/en-US/docs/Web/API/File), [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) or [Buffer](https://nodejs.org/api/buffer.html)
312
313
  - `strength` - ControlNet strength 0 to 1. 0 full control to prompt, 1 full control to ControlNet
313
314
  - `mode` - How control and prompt should be weighted. Can be:
@@ -349,7 +350,8 @@ export type ControlNetName =
349
350
  | 'segmentation'
350
351
  | 'shuffle'
351
352
  | 'softedge'
352
- | 'tile';
353
+ | 'tile'
354
+ | 'instantid';
353
355
 
354
356
  export type ControlNetMode = 'balanced' | 'prompt_priority' | 'cn_priority';
355
357
  export interface ControlNetParams {
@@ -1,5 +1,5 @@
1
1
  import DataEntity from '../lib/DataEntity';
2
- import { BalanceData } from './types';
2
+ import { Balances } from './types';
3
3
  import { SupernetType } from '../ApiClient/WebSocketClient/types';
4
4
  /**
5
5
  * @inline
@@ -16,7 +16,7 @@ export interface AccountData {
16
16
  */
17
17
  networkStatus: 'connected' | 'disconnected' | 'connecting' | 'switching';
18
18
  network: SupernetType | null;
19
- balance: BalanceData;
19
+ balance: Balances;
20
20
  walletAddress?: string;
21
21
  username?: string;
22
22
  token?: string;
@@ -32,7 +32,7 @@ declare class CurrentAccount extends DataEntity<AccountData> {
32
32
  get isAuthenicated(): boolean;
33
33
  get networkStatus(): "connected" | "disconnected" | "connecting" | "switching";
34
34
  get network(): SupernetType | null;
35
- get balance(): BalanceData;
35
+ get balance(): Balances;
36
36
  get walletAddress(): string | undefined;
37
37
  get username(): string | undefined;
38
38
  get token(): string | undefined;
@@ -9,10 +9,18 @@ function getDefaults() {
9
9
  networkStatus: 'disconnected',
10
10
  network: null,
11
11
  balance: {
12
- credit: '0',
13
- debit: '0',
14
- net: '0',
15
- settled: '0'
12
+ sogni: {
13
+ credit: '0',
14
+ debit: '0',
15
+ net: '0',
16
+ settled: '0'
17
+ },
18
+ spark: {
19
+ credit: '0',
20
+ debit: '0',
21
+ net: '0',
22
+ settled: '0'
23
+ }
16
24
  },
17
25
  walletAddress: undefined,
18
26
  username: undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentAccount.js","sourceRoot":"","sources":["../../src/Account/CurrentAccount.ts"],"names":[],"mappings":";;;;;AAAA,mEAA2C;AAyB3C,SAAS,WAAW;IAClB,OAAO;QACL,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE,IAAI;QACb,OAAO,EAAE;YACP,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;YACV,GAAG,EAAE,GAAG;YACR,OAAO,EAAE,GAAG;SACb;QACD,aAAa,EAAE,SAAS;QACxB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,SAAS;KACxB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,cAAe,SAAQ,oBAAuB;IAClD,YAAY,IAAkB;QAC5B,KAAK,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAClC,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;IACjC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;IACjC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC5B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAChC,CAAC;CACF;AAED,kBAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"CurrentAccount.js","sourceRoot":"","sources":["../../src/Account/CurrentAccount.ts"],"names":[],"mappings":";;;;;AAAA,mEAA2C;AAyB3C,SAAS,WAAW;IAClB,OAAO;QACL,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE,IAAI;QACb,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,GAAG;gBACX,KAAK,EAAE,GAAG;gBACV,GAAG,EAAE,GAAG;gBACR,OAAO,EAAE,GAAG;aACb;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,GAAG;gBACX,KAAK,EAAE,GAAG;gBACV,GAAG,EAAE,GAAG;gBACR,OAAO,EAAE,GAAG;aACb;SACF;QACD,aAAa,EAAE,SAAS;QACxB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,SAAS;KACxB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,cAAe,SAAQ,oBAAuB;IAClD,YAAY,IAAkB;QAC5B,KAAK,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAClC,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;IACjC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;IACjC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC5B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAChC,CAAC;CACF;AAED,kBAAe,cAAc,CAAC"}
@@ -1,7 +1,7 @@
1
- import { AccountCreateData, AccountCreateParams, BalanceData, LoginData, Reward, TxHistoryEntry, TxHistoryParams } from './types';
1
+ import { AccountCreateData, AccountCreateParams, Balances, ClaimOptions, FullBalances, LoginData, Reward, RewardsQuery, TxHistoryEntry, TxHistoryParams } from './types';
2
2
  import ApiGroup, { ApiConfig } from '../ApiGroup';
3
3
  import { Wallet } from 'ethers';
4
- import { ApiReponse } from '../ApiClient';
4
+ import { ApiResponse } from '../ApiClient';
5
5
  import CurrentAccount from './CurrentAccount';
6
6
  import { SupernetType } from '../ApiClient/WebSocketClient/types';
7
7
  import { Tokens } from '../lib/AuthManager';
@@ -23,7 +23,12 @@ declare class AccountApi extends ApiGroup {
23
23
  private handleServerConnected;
24
24
  private handleServerDisconnected;
25
25
  private handleAuthUpdated;
26
- private getNonce;
26
+ /**
27
+ * Get the nonce for the given wallet address.
28
+ * @param walletAddress
29
+ * @internal
30
+ */
31
+ getNonce(walletAddress: string): Promise<string>;
27
32
  /**
28
33
  * Create Ethers.js Wallet instance from username and password.
29
34
  * This method is used internally to create a wallet for the user.
@@ -99,16 +104,27 @@ declare class AccountApi extends ApiGroup {
99
104
  * Refresh the balance of the current account.
100
105
  *
101
106
  * Usually, you don't need to call this method manually. Balance is updated automatically
102
- * through WebSocket events. But you can call this method to force a balance refresh.
107
+ * through WebSocket events. But you can call this method to force a balance refresh. Note that
108
+ * will also trigger updated event on the current account.
103
109
  *
104
110
  * @example Refresh user account balance
105
111
  * ```typescript
106
112
  * const balance = await client.account.refreshBalance();
107
113
  * console.log(balance);
108
- * // { net: '100.000000', settled: '100.000000', credit: '0.000000', debit: '0.000000' }
109
114
  * ```
110
115
  */
111
- refreshBalance(): Promise<BalanceData>;
116
+ refreshBalance(): Promise<Balances>;
117
+ /**
118
+ * Get the account balance of the current account.
119
+ * This method returns the account balance of the current user, including settled, credit, debit, and unclaimed earnings amounts.
120
+ *
121
+ * @example Get the account balance of the current user
122
+ * ```typescript
123
+ * const balance = await client.account.accountBalance();
124
+ * console.log(balance);
125
+ * ```
126
+ */
127
+ accountBalance(): Promise<FullBalances>;
112
128
  /**
113
129
  * Get the balance of the wallet address.
114
130
  *
@@ -125,7 +141,8 @@ declare class AccountApi extends ApiGroup {
125
141
  * @param walletAddress
126
142
  */
127
143
  walletBalance(walletAddress: string): Promise<{
128
- token: string;
144
+ sogni: string;
145
+ spark: string;
129
146
  ether: string;
130
147
  }>;
131
148
  /**
@@ -133,7 +150,7 @@ declare class AccountApi extends ApiGroup {
133
150
  * @internal
134
151
  * @param username
135
152
  */
136
- validateUsername(username: string): Promise<import("../ApiClient").ApiErrorResponse | ApiReponse<undefined>>;
153
+ validateUsername(username: string): Promise<import("../ApiClient").ApiErrorResponse | ApiResponse<undefined>>;
137
154
  /**
138
155
  * Switch between fast and relaxed networks.
139
156
  * This will change default network used to process projects. After switching, client will receive
@@ -171,13 +188,16 @@ declare class AccountApi extends ApiGroup {
171
188
  * Get the rewards of the current account.
172
189
  * @internal
173
190
  */
174
- rewards(): Promise<Reward[]>;
191
+ rewards(query?: RewardsQuery): Promise<Reward[]>;
175
192
  /**
176
193
  * Claim rewards by reward IDs.
177
194
  * @internal
178
195
  * @param rewardIds
196
+ * @param options - Options for claiming rewards
197
+ * @param options.turnstileToken - Turnstile token for anti-bot protection
198
+ * @param options.provider - Provider name for the rewards
179
199
  */
180
- claimRewards(rewardIds: string[]): Promise<void>;
200
+ claimRewards(rewardIds: string[], { turnstileToken, provider }?: ClaimOptions): Promise<void>;
181
201
  /**
182
202
  * Withdraw funds from the current account to wallet.
183
203
  * @example withdraw to current wallet address
@@ -200,5 +220,15 @@ declare class AccountApi extends ApiGroup {
200
220
  * @param amount - amount to transfer
201
221
  */
202
222
  deposit(password: string, amount: number): Promise<void>;
223
+ private _deposit;
224
+ /**
225
+ * Approve SOGNI token usage for the specified spender.
226
+ * @internal
227
+ *
228
+ * @param password - user account password
229
+ * @param spender - Spender type, either 'account' for deposit or 'staker' for staking contract
230
+ * @param provider - Provider name, defaults to 'base', can be 'base', 'etherlink', etc.
231
+ */
232
+ approveTokenUsage(password: string, spender: 'account' | 'staker', provider?: string): Promise<void>;
203
233
  }
204
234
  export default AccountApi;