@sogni-ai/sogni-client 3.0.0-alpha.9 → 3.0.1

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 (67) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/README.md +23 -27
  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 +42 -13
  7. package/dist/Account/index.js +132 -29
  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 +9 -18
  23. package/dist/Projects/Project.js.map +1 -1
  24. package/dist/Projects/createJobRequestMessage.js +1 -1
  25. package/dist/Projects/createJobRequestMessage.js.map +1 -1
  26. package/dist/Projects/index.d.ts +7 -2
  27. package/dist/Projects/index.js +48 -10
  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/index.d.ts +10 -6
  36. package/dist/index.js +6 -15
  37. package/dist/index.js.map +1 -1
  38. package/dist/lib/utils.d.ts +1 -0
  39. package/dist/lib/utils.js +15 -0
  40. package/dist/lib/utils.js.map +1 -1
  41. package/dist/types/token.d.ts +1 -0
  42. package/dist/types/token.js +3 -0
  43. package/dist/types/token.js.map +1 -0
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +2 -1
  46. package/dist/version.js.map +1 -1
  47. package/package.json +1 -1
  48. package/src/Account/CurrentAccount.ts +14 -6
  49. package/src/Account/index.ts +163 -59
  50. package/src/Account/types.ts +26 -0
  51. package/src/ApiClient/WebSocketClient/events.ts +59 -7
  52. package/src/ApiClient/WebSocketClient/index.ts +1 -1
  53. package/src/ApiClient/index.ts +15 -4
  54. package/src/ApiGroup.ts +0 -4
  55. package/src/Projects/Job.ts +98 -0
  56. package/src/Projects/Project.ts +11 -19
  57. package/src/Projects/createJobRequestMessage.ts +2 -1
  58. package/src/Projects/index.ts +53 -13
  59. package/src/Projects/types/ControlNetParams.ts +8 -2
  60. package/src/Projects/types/events.ts +6 -0
  61. package/src/Projects/types/index.ts +17 -3
  62. package/src/Projects/utils.ts +12 -0
  63. package/src/Stats/index.ts +2 -2
  64. package/src/index.ts +23 -19
  65. package/src/lib/utils.ts +4 -0
  66. package/src/types/token.ts +1 -0
  67. package/src/version.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,325 @@
1
+ ## [3.0.1](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0...v3.0.1) (2025-07-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Bring back package-lock.json ([28d21e1](https://github.com/Sogni-AI/sogni-client/commit/28d21e192c15fca5b76254572d6fcbd1e8140b29))
7
+ * Update README.md ([3348834](https://github.com/Sogni-AI/sogni-client/commit/3348834163d438ce99c3dfa9d466649544e9b777))
8
+
9
+ # [3.0.0](https://github.com/Sogni-AI/sogni-client/compare/v2.0.4...v3.0.0) (2025-07-15)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * Copy size preset when enhancing image ([06ab629](https://github.com/Sogni-AI/sogni-client/commit/06ab629a9b10377c87406817d1e72a0cd35bd025))
15
+ * Discard enhancement project before starting new one ([4293b2b](https://github.com/Sogni-AI/sogni-client/commit/4293b2b535ed8cfe76ce307de71c99bec799bd79))
16
+ * Do not mark project as completed if not all jobs started yet ([812e5ac](https://github.com/Sogni-AI/sogni-client/commit/812e5accd8605a6a742beb16a53bca2be50b9a81))
17
+ * Fix job.getResultUrl() bug ([ea90083](https://github.com/Sogni-AI/sogni-client/commit/ea900831cd578c5962236b70564cab0da4f2f7a8))
18
+ * Fix project sync attempt counter ([b112c06](https://github.com/Sogni-AI/sogni-client/commit/b112c064b443186b1992a80da5612af001919107))
19
+ * Pass tokenType to jobRequest message. Make tokenType optional for project estimation ([9550d76](https://github.com/Sogni-AI/sogni-client/commit/9550d76ee3d40fb4321a157d0a5feb0fb680f183))
20
+ * Prevent job progress going down ([5cf69d3](https://github.com/Sogni-AI/sogni-client/commit/5cf69d375d3a284964ba423c4287d592538cd273))
21
+ * Set scheduler and timeStepSpacing to null by default ([ccc1fc8](https://github.com/Sogni-AI/sogni-client/commit/ccc1fc842b408f905fd786807be5b5df8895690b))
22
+ * Update typings to indicate that `unclaimed` field may be absent from balance ([a661e17](https://github.com/Sogni-AI/sogni-client/commit/a661e17f549c3a51003557acb5e3ee5e34877f9d))
23
+
24
+
25
+ ### Features
26
+
27
+ * Add `provider` parameter to `client.account.transactionHistory` ([9de208a](https://github.com/Sogni-AI/sogni-client/commit/9de208aa478d745a0706d8960e033e4cc9e25d35))
28
+ * Add basic ControlNet support ([220991d](https://github.com/Sogni-AI/sogni-client/commit/220991db5b16740b159d2cb0c3e746141fa4906f))
29
+ * Add job.getResultUrl() method to retrieve fresh download URL for a job ([82ce8d3](https://github.com/Sogni-AI/sogni-client/commit/82ce8d3cc9681800616185aac50e8f2102314ed4))
30
+ * Add new leaderboard types ([d6d3fb8](https://github.com/Sogni-AI/sogni-client/commit/d6d3fb8a7c5a84ff089d6b51bc448da26821174a))
31
+ * Add prompt and style overrides for image enhancer ([35cd4a0](https://github.com/Sogni-AI/sogni-client/commit/35cd4a017361f919d42a2568fff6e2e7b4367949))
32
+ * Add support for `authenticated` socket event ([bc3d345](https://github.com/Sogni-AI/sogni-client/commit/bc3d3451e7640eb15f1368144bbc112298f640fa))
33
+ * 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))
34
+ * Add support for toast message events ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/2b032a83b3c28798a4df692c1cb6f090915191a6))
35
+ * add TokenType export and update LIB_VERSION from package.json ([f6110b5](https://github.com/Sogni-AI/sogni-client/commit/f6110b521715a076a7abb3010c68fbde8ea64b71))
36
+ * add tokenType to estimateCost and estimateEnhancementCost methods ([1c97258](https://github.com/Sogni-AI/sogni-client/commit/1c97258facb2ddd687361a5172d5318329a70c43))
37
+ * add tokenType to transaction list ([ee5951e](https://github.com/Sogni-AI/sogni-client/commit/ee5951ef9014ec6eed6a5b52acb5b8b1c5d1227d))
38
+ * Add turnstile token parameter to claimReward ([a96f5e2](https://github.com/Sogni-AI/sogni-client/commit/a96f5e2b22fd879a717aae1c3fe6f60ad675d031))
39
+ * Allow insecure socket connections ([5da2b0a](https://github.com/Sogni-AI/sogni-client/commit/5da2b0abb57e0e8ab7c7c5de449ea7a04183b753))
40
+ * Allow passing string to `account.deposit` and `account.withdraw` ([c9397f1](https://github.com/Sogni-AI/sogni-client/commit/c9397f1436b7c198ba4be860414815c6fc637bf6))
41
+ * Allow setting token type for image enhancement ([7420274](https://github.com/Sogni-AI/sogni-client/commit/7420274caf852b078d47e008b6065da70a456714))
42
+ * Bump PROTOCOL_VERSION ([6e5f6b9](https://github.com/Sogni-AI/sogni-client/commit/6e5f6b91870fbd557ce235d0508216c1b4e93cad))
43
+ * Cloudflare Turnstile token is required during signup ([768b9c8](https://github.com/Sogni-AI/sogni-client/commit/768b9c8a46f05f7b196976d3a7aa8a1e512ca172))
44
+ * Decouple fetching balance from the refresh method ([a7d4f62](https://github.com/Sogni-AI/sogni-client/commit/a7d4f625fc29831fdd72fda65af622d303ef1d32))
45
+ * Default client to mainnet ([5f9e44f](https://github.com/Sogni-AI/sogni-client/commit/5f9e44f462cd1b6f5bddc30e523567fa8b671736))
46
+ * Default rewards provider to `base`, add provider param to queried rewards ([d84dcff](https://github.com/Sogni-AI/sogni-client/commit/d84dcff1d3e01b7154e62724d078cfd158d12317))
47
+ * emit jobStarted, jobCompleted, and jobFailed events for better job tracking ([0e3bb33](https://github.com/Sogni-AI/sogni-client/commit/0e3bb33703868a3491edfac2c9f08325db0eb278))
48
+ * Expose getNonce method as public ([694c041](https://github.com/Sogni-AI/sogni-client/commit/694c041431b99c4bae2d5dc8f22d327fed45771d))
49
+ * Expose option to disable socket connection (Experimental) ([048adcf](https://github.com/Sogni-AI/sogni-client/commit/048adcfad99acd8ffb8197ad55f7d54679aacde8))
50
+ * Image enhancement with Flux model ([82488e7](https://github.com/Sogni-AI/sogni-client/commit/82488e7658b56902cee25e58bc1763c1392c5d46))
51
+ * Migrate account deposit to v3 ([71bfaac](https://github.com/Sogni-AI/sogni-client/commit/71bfaacca89c3a7f721b91ca39226650a2eb4ff5))
52
+ * Refactor image enhancement logic ([6728875](https://github.com/Sogni-AI/sogni-client/commit/67288759637c4b22266455ce1f1220d2590d7592))
53
+ * Remove blockchain provider since SDK does not need to call Base ([d5f8609](https://github.com/Sogni-AI/sogni-client/commit/d5f8609f29b9f9843913ecaf514516f490a60c61))
54
+ * 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))
55
+ * Support for EIP712 on mainnet ([5e04e81](https://github.com/Sogni-AI/sogni-client/commit/5e04e8129f59bfac0ed6d65cc7c847ad622111b2))
56
+ * Support passing `provider` parameter when claiming reward ([71a045e](https://github.com/Sogni-AI/sogni-client/commit/71a045e60dbda63efe9f513bc9ffe8328f5e3dd2))
57
+ * Support rewards v4 API to query rewards scoped to ([ff0a713](https://github.com/Sogni-AI/sogni-client/commit/ff0a71387f602faba7da9a2e494f886a98881d95))
58
+ * Support uploading starting image and ControlNet input image before creating a project ([4fd8a5a](https://github.com/Sogni-AI/sogni-client/commit/4fd8a5a3597e7b3bb85c4a8c94cd2df798ca6bfe))
59
+ * 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))
60
+
61
+
62
+ ### BREAKING CHANGES
63
+
64
+ * `client.account.claimRewards` signature changed
65
+ * client.projects.estimateCost and client.projects.estimateEnhancementCost signature changed
66
+ * Balance data format has changed
67
+ * Signup signature is changed.Turnstile token is required for Signup
68
+
69
+ # [3.0.0-alpha.42](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.41...v3.0.0-alpha.42) (2025-07-15)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * remove provider instance as it is not actually used ([62f384e](https://github.com/Sogni-AI/sogni-client/commit/62f384e82c4e5ae453bbec567ce58aa5ae1e7c72))
75
+ * update documentation ([5d09f39](https://github.com/Sogni-AI/sogni-client/commit/5d09f39181e058bd6d5706d8d919d7855bb6dd81))
76
+
77
+ # [3.0.0-alpha.41](https://github.com/Sogni-AI/sogni-client/compare/v3.0.0-alpha.40...v3.0.0-alpha.41) (2025-07-15)
78
+
79
+
80
+ ### Features
81
+
82
+ * Allow passing string to `account.deposit` and `account.withdraw` ([c9397f1](https://github.com/Sogni-AI/sogni-client/commit/c9397f1436b7c198ba4be860414815c6fc637bf6))
83
+
84
+ # [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)
85
+
86
+
87
+ ### Features
88
+
89
+ * Default client to mainnet ([5f9e44f](https://github.com/Sogni-AI/sogni-client/commit/5f9e44f462cd1b6f5bddc30e523567fa8b671736))
90
+
91
+ # [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)
92
+
93
+
94
+ ### Features
95
+
96
+ * Support for EIP712 on mainnet ([5e04e81](https://github.com/Sogni-AI/sogni-client/commit/5e04e8129f59bfac0ed6d65cc7c847ad622111b2))
97
+
98
+ # [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)
99
+
100
+
101
+ ### Features
102
+
103
+ * Migrate account deposit to v3 ([71bfaac](https://github.com/Sogni-AI/sogni-client/commit/71bfaacca89c3a7f721b91ca39226650a2eb4ff5))
104
+
105
+ # [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)
106
+
107
+
108
+ ### Features
109
+
110
+ * Add support for `authenticated` socket event ([bc3d345](https://github.com/Sogni-AI/sogni-client/commit/bc3d3451e7640eb15f1368144bbc112298f640fa))
111
+
112
+ # [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)
113
+
114
+
115
+ ### Features
116
+
117
+ * Expose option to disable socket connection (Experimental) ([048adcf](https://github.com/Sogni-AI/sogni-client/commit/048adcfad99acd8ffb8197ad55f7d54679aacde8))
118
+
119
+ # [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)
120
+
121
+
122
+ ### Features
123
+
124
+ * Expose getNonce method as public ([694c041](https://github.com/Sogni-AI/sogni-client/commit/694c041431b99c4bae2d5dc8f22d327fed45771d))
125
+
126
+ # [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)
127
+
128
+
129
+ ### Features
130
+
131
+ * Decouple fetching balance from the refresh method ([a7d4f62](https://github.com/Sogni-AI/sogni-client/commit/a7d4f625fc29831fdd72fda65af622d303ef1d32))
132
+
133
+ # [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)
134
+
135
+
136
+ ### Bug Fixes
137
+
138
+ * Update typings to indicate that `unclaimed` field may be absent from balance ([a661e17](https://github.com/Sogni-AI/sogni-client/commit/a661e17f549c3a51003557acb5e3ee5e34877f9d))
139
+
140
+ # [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)
141
+
142
+
143
+ ### Features
144
+
145
+ * Add `provider` parameter to `client.account.transactionHistory` ([9de208a](https://github.com/Sogni-AI/sogni-client/commit/9de208aa478d745a0706d8960e033e4cc9e25d35))
146
+
147
+ # [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)
148
+
149
+
150
+ ### Features
151
+
152
+ * Default rewards provider to `base`, add provider param to queried rewards ([d84dcff](https://github.com/Sogni-AI/sogni-client/commit/d84dcff1d3e01b7154e62724d078cfd158d12317))
153
+
154
+ # [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)
155
+
156
+
157
+ ### Features
158
+
159
+ * Support passing `provider` parameter when claiming reward ([71a045e](https://github.com/Sogni-AI/sogni-client/commit/71a045e60dbda63efe9f513bc9ffe8328f5e3dd2))
160
+
161
+
162
+ ### BREAKING CHANGES
163
+
164
+ * `client.account.claimRewards` signature changed
165
+
166
+ # [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)
167
+
168
+
169
+ ### Features
170
+
171
+ * Support rewards v4 API to query rewards scoped to ([ff0a713](https://github.com/Sogni-AI/sogni-client/commit/ff0a71387f602faba7da9a2e494f886a98881d95))
172
+
173
+ # [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)
174
+
175
+
176
+ ### Features
177
+
178
+ * Support uploading starting image and ControlNet input image before creating a project ([4fd8a5a](https://github.com/Sogni-AI/sogni-client/commit/4fd8a5a3597e7b3bb85c4a8c94cd2df798ca6bfe))
179
+
180
+ # [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)
181
+
182
+
183
+ ### Features
184
+
185
+ * Allow setting token type for image enhancement ([7420274](https://github.com/Sogni-AI/sogni-client/commit/7420274caf852b078d47e008b6065da70a456714))
186
+
187
+ # [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)
188
+
189
+
190
+ ### Bug Fixes
191
+
192
+ * Pass tokenType to jobRequest message. Make tokenType optional for project estimation ([9550d76](https://github.com/Sogni-AI/sogni-client/commit/9550d76ee3d40fb4321a157d0a5feb0fb680f183))
193
+
194
+ # [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)
195
+
196
+
197
+ ### Features
198
+
199
+ * Remove blockchain provider since SDK does not need to call Base ([d5f8609](https://github.com/Sogni-AI/sogni-client/commit/d5f8609f29b9f9843913ecaf514516f490a60c61))
200
+
201
+ # [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)
202
+
203
+
204
+ ### Features
205
+
206
+ * add tokenType to transaction list ([ee5951e](https://github.com/Sogni-AI/sogni-client/commit/ee5951ef9014ec6eed6a5b52acb5b8b1c5d1227d))
207
+
208
+ # [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)
209
+
210
+
211
+ ### Features
212
+
213
+ * add tokenType to estimateCost and estimateEnhancementCost methods ([1c97258](https://github.com/Sogni-AI/sogni-client/commit/1c97258facb2ddd687361a5172d5318329a70c43))
214
+
215
+
216
+ ### BREAKING CHANGES
217
+
218
+ * client.projects.estimateCost and client.projects.estimateEnhancementCost signature changed
219
+
220
+ # [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)
221
+
222
+
223
+ ### Features
224
+
225
+ * Bump PROTOCOL_VERSION ([6e5f6b9](https://github.com/Sogni-AI/sogni-client/commit/6e5f6b91870fbd557ce235d0508216c1b4e93cad))
226
+
227
+ # [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)
228
+
229
+
230
+ ### Features
231
+
232
+ * add TokenType export and update LIB_VERSION from package.json ([f6110b5](https://github.com/Sogni-AI/sogni-client/commit/f6110b521715a076a7abb3010c68fbde8ea64b71))
233
+
234
+ # [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)
235
+
236
+
237
+ ### Features
238
+
239
+ * 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))
240
+
241
+
242
+ ### BREAKING CHANGES
243
+
244
+ * Balance data format has changed
245
+
246
+ # [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)
247
+
248
+
249
+ ### Features
250
+
251
+ * emit jobStarted, jobCompleted, and jobFailed events for better job tracking ([0e3bb33](https://github.com/Sogni-AI/sogni-client/commit/0e3bb33703868a3491edfac2c9f08325db0eb278))
252
+
253
+ # [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)
254
+
255
+
256
+ ### Features
257
+
258
+ * 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))
259
+
260
+ # [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)
261
+
262
+
263
+ ### Bug Fixes
264
+
265
+ * Do not mark project as completed if not all jobs started yet ([812e5ac](https://github.com/Sogni-AI/sogni-client/commit/812e5accd8605a6a742beb16a53bca2be50b9a81))
266
+
267
+ # [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)
268
+
269
+
270
+ ### Bug Fixes
271
+
272
+ * Discard enhancement project before starting new one ([4293b2b](https://github.com/Sogni-AI/sogni-client/commit/4293b2b535ed8cfe76ce307de71c99bec799bd79))
273
+
274
+ # [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)
275
+
276
+
277
+ ### Bug Fixes
278
+
279
+ * Prevent job progress going down ([5cf69d3](https://github.com/Sogni-AI/sogni-client/commit/5cf69d375d3a284964ba423c4287d592538cd273))
280
+
281
+ # [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)
282
+
283
+
284
+ ### Features
285
+
286
+ * Refactor image enhancement logic ([6728875](https://github.com/Sogni-AI/sogni-client/commit/67288759637c4b22266455ce1f1220d2590d7592))
287
+
288
+ # [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)
289
+
290
+
291
+ ### Features
292
+
293
+ * Add prompt and style overrides for image enhancer ([35cd4a0](https://github.com/Sogni-AI/sogni-client/commit/35cd4a017361f919d42a2568fff6e2e7b4367949))
294
+
295
+ # [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)
296
+
297
+
298
+ ### Bug Fixes
299
+
300
+ * Copy size preset when enhancing image ([06ab629](https://github.com/Sogni-AI/sogni-client/commit/06ab629a9b10377c87406817d1e72a0cd35bd025))
301
+
302
+ # [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)
303
+
304
+
305
+ ### Features
306
+
307
+ * Image enhancement with Flux model ([82488e7](https://github.com/Sogni-AI/sogni-client/commit/82488e7658b56902cee25e58bc1763c1392c5d46))
308
+
309
+ # [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)
310
+
311
+
312
+ ### Features
313
+
314
+ * Add support for InstantID ControlNet ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/dbaa1e464d15635dc5e7db6c785bf25b0e8788a7))
315
+
316
+ # [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)
317
+
318
+
319
+ ### Features
320
+
321
+ * Add support for toast message events ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/2b032a83b3c28798a4df692c1cb6f090915191a6))
322
+
1
323
  # [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)
2
324
 
3
325
 
@@ -73,6 +395,20 @@
73
395
 
74
396
  * Add basic ControlNet support ([220991d](https://github.com/Sogni-AI/sogni-client/commit/220991db5b16740b159d2cb0c3e746141fa4906f))
75
397
 
398
+ ## [2.0.4](https://github.com/Sogni-AI/sogni-client/compare/v2.0.3...v2.0.4) (2025-05-14)
399
+
400
+
401
+ ### Bug Fixes
402
+
403
+ * update documentation ([5d09f39](https://github.com/Sogni-AI/sogni-client/commit/5d09f39181e058bd6d5706d8d919d7855bb6dd81))
404
+
405
+ ## [2.0.3](https://github.com/Sogni-AI/sogni-client/compare/v2.0.2...v2.0.3) (2025-05-14)
406
+
407
+
408
+ ### Bug Fixes
409
+
410
+ * remove provider instance as it is not actually used ([62f384e](https://github.com/Sogni-AI/sogni-client/commit/62f384e82c4e5ae453bbec567ce58aa5ae1e7c72))
411
+
76
412
  ## [2.0.2](https://github.com/Sogni-AI/sogni-client/compare/v2.0.1...v2.0.2) (2025-02-04)
77
413
 
78
414
 
package/README.md CHANGED
@@ -14,29 +14,29 @@ or
14
14
  yarn add @sogni-ai/sogni-client
15
15
  ```
16
16
  ## Core concepts
17
- In order to use Sogni Supernet you need an active Sogni account (in the form of a username and password) with a positive $tSOGNI balance.
17
+ In order to use Sogni Supernet, you need an active Sogni account (in the form of a username and password) with a positive SOGNI or Spark token balance.
18
18
  You can create a free account in our [Web App](https://app.sogni.ai) or [Mac App](https://www.sogni.ai/studio) which will give you tokens just for signing up and confirming your email. You can get daily bonus tokens by claiming them (under rewards) each 24-hours.
19
19
 
20
- Your account is tied to a [Base](https://www.base.org/) Wallet that is created during signup. The current network is [Base Sepolia](https://chainlist.org/chain/84532) and will be [Base Mainnet](https://chainlist.org/chain/8453) after mainnet launch.
20
+ Spark tokens can be purchased with a credit card in a Mac or Web app.
21
21
 
22
- The Library will use a default provider if none is provided, but note that it is not guaranteed to be always available. It is recommended to use your own Node endpoint such as alchemy.com (free and paid plans). You can specify your own node in `jsonRpcUrl` settings below.
22
+ Your account is tied to a [Base](https://www.base.org/) Wallet that is created during signup.
23
23
 
24
24
  ### Supernet Types
25
25
  There are 2 worker network types available:
26
- - `fast` - this network runs on high-end GPUs and is optimized for speed. It is more expensive than `relaxed` network at roughly 1 $tSOGNI token per render.
27
- - `relaxed` - this network runs on Apple Mac devices and is optimized for cost. It is cheaper than `fast` network at roughly 0.5 $tSOGNI token per render.
26
+ - `fast` - this network runs on high-end GPUs and is optimized for speed. It is more expensive than `relaxed` network.
27
+ - `relaxed` - this network runs on Apple Mac devices and is optimized for cost. It is cheaper than `fast` network.
28
28
 
29
- In both options the more complex your query is (the more steps) the higher the cost in tokens.
29
+ In both options, the more complex your query is (the more steps), the higher the cost in tokens.
30
30
 
31
31
  ### Inference definitions: Projects and Jobs
32
32
  One request for image generation is called a **Project**. Project can generate one or more images.
33
33
  Each image is represented by a **Job**.
34
34
 
35
35
  When you send a project to Supernet, it will be processed by one or more workers. The resulting images will be encrypted and
36
- uploaded to Sogni servers where it will be stored for 24 hours. After this period images will be auto-deleted.
36
+ uploaded to Sogni servers where it will be stored for 24 hours. After this period images will be auto-deleted.
37
37
 
38
38
  ## Client initialization
39
- To initialize client you need to provide `appId`, and account credentials.
39
+ To initialize a client, you need to provide `appId`, and account credentials.
40
40
 
41
41
  ```javascript
42
42
  import { SogniClient } from '@sogni-ai/sogni-client';
@@ -44,17 +44,11 @@ import { SogniClient } from '@sogni-ai/sogni-client';
44
44
  const USERNAME = 'your-username';
45
45
  const PASSWORD = 'your-password';
46
46
 
47
- // If using default provider
48
47
  const options = {
49
48
  appId: 'your-app-id', // Required, must be unique string, UUID is recommended
50
49
  network: 'fast', // Network to use, 'fast' or 'relaxed'
51
50
  }
52
- // If using custom provider
53
- const options ={
54
- appId: 'your-app-id', // Required, must be unique string, UUID is recommended
55
- jsonRpcUrl: 'https://sepolia.base.org', // Put your custom JSON-RPC URL here
56
- network: 'fast', // Network to use, 'fast' or 'relaxed'
57
- }
51
+
58
52
  const client = await SogniClient.createInstance(options);
59
53
  // Login to Sogni account and establish WebSocket connection to Supernet
60
54
  await client.account.login(USERNAME, PASSWORD);
@@ -65,13 +59,12 @@ const models = await client.projects.waitForModels();
65
59
  ```
66
60
  **Important Note:**
67
61
  - This sample assume you are using ES modules, which allow `await` on the top level, if you are CommomJS you will need to wrap `await` calls in an async function.
68
- - Sogni is currently in Testnet phase, so you need to provide Base Sepolia network URL.
69
62
  - `appId` must be unique string, UUID is recommended. It is used to identify your application.
70
63
  - Only one connection per `appId` is allowed. If you try to connect with the same `appId` multiple times, the previous connection will be closed.
71
64
 
72
65
  ## Usage
73
66
  After calling `login` method, the client will establish a WebSocket connection to Sogni Supernet. Within a short period of time the
74
- client will receive current balance and list of available models. After this you can start using the client to generate images.
67
+ client will receive the current balance and list of available models. After this you can start using the client to generate images.
75
68
 
76
69
  ### Creating project
77
70
  ```javascript
@@ -94,9 +87,9 @@ const project = await client.projects.create({
94
87
  **Note:** Full project parameter list can be found in [ProjectParams](https://sdk-docs.sogni.ai/interfaces/ProjectParams.html) docs.
95
88
 
96
89
  ### Getting project status and results
97
- In general there are 2 ways to work with API:
90
+ In general, there are 2 ways to work with API:
98
91
  1. Using promises or `async/await` syntax.
99
- 2. Listening events on `Project` and `Job` class instances.
92
+ 2. Listening to events on `Project` and `Job` class instances.
100
93
 
101
94
  #### Using promises
102
95
  ```javascript
@@ -162,12 +155,13 @@ project.on('failed', async (errorData) => {
162
155
  ```
163
156
 
164
157
  ### Project parameters
165
- Here is full list of project parameters that you can use:
158
+ Here is a full list of project parameters that you can use:
166
159
  - `modelId` - ID of the model to use for image generation.
167
- - `positivePrompt` - text prompt that describes what you want to see in the image. Can be empty string.
168
- - `negativePrompt` - text prompt that describes what you don't want to see in the image. Can be empty string.
169
- - `stylePrompt` - text prompt that describes the style of the image. Can be empty string.
160
+ - `positivePrompt` - text prompt that describes what you want to see in the image. Can be an empty string.
161
+ - `negativePrompt` - text prompt that describes what you don't want to see in the image. Can be an empty string.
162
+ - `stylePrompt` - text prompt that describes the style of the image. Can be an empty string.
170
163
  - `numberOfImages` - number of images to generate.
164
+ - `tokenType` - select token type to pay for render. Can be either `sogni` or `spark`.
171
165
  - `sizePreset` - optionally pass the ID of a size preset to use. If not passed, the default output is a square at
172
166
  either 512x512, 768x768 or 1024x1024 (SDXL and Flux) based on the default resolution of the selected model.
173
167
  See **Detecting available output presets** section below for available presets for your model. The token cost and
@@ -183,7 +177,7 @@ quality images and more details but varies by model, prompt, guidance, and desir
183
177
  models 20-40 steps is ideal with 20 being 2x faster to render than 40. For Flux 4 steps is optimal. Lightning,
184
178
  Turbo and LCM models are designed for quality output in as little as 1 step. ([More info](https://docs.sogni.ai/learn/basics/inference-steps)).
185
179
  - `guidance` - guidance scale. For most Stable Diffusion models, optimal value is 7.5 ([More info](https://docs.sogni.ai/learn/basics/guidance-scale)).
186
- - `network` - network type to use, 'fast' or 'relaxed'. This parameter allow to override default network type for this project.
180
+ - `network` - network type to use, `fast` or `relaxed`. This parameter allows to override default network type for this project.
187
181
  - `disableNSFWFilter` - disable NSFW filter for this project. NSFW filter is enabled by default and workers won't upload resulting images if they are detected as NSFW.
188
182
  - `seed` - uint32 number to use as seed. If not provided, random seed will be used. If `numberOfImages` is greater than 1, provided seed will be user only for one of them. ([More info](https://docs.sogni.ai/learn/basics/generation-seed)).
189
183
  - `numberOfPreviews` - number of preview images to generate. If not provided, no preview images will be generated.
@@ -196,7 +190,7 @@ Turbo and LCM models are designed for quality output in as little as 1 step. ([M
196
190
  TypeScript type definitions for project parameters can be found in [ProjectParams](https://sdk-docs.sogni.ai/interfaces/ProjectParams.html) docs.
197
191
 
198
192
  ### Detecting available output presets
199
- You can get list of available output presets for a specific network and model using `client.projects.getOutputPresets` method.
193
+ You can get a list of available output presets for a specific network and model using `client.projects.getOutputPresets` method.
200
194
  ```javascript
201
195
  const presets = await client.projects.getSizePresets('fast', 'flux1-schnell-fp8');
202
196
  console.log('Available output presets:', presets);
@@ -292,7 +286,7 @@ Sample response:
292
286
  ControlNet is a neural network that controls image generation in Stable Diffusion by adding extra conditions. See more
293
287
  info and usage samples in [ControlNets](https://docs.sogni.ai/learn/basics/controlnet) docs for Sogni Studio.
294
288
 
295
- To use ControlNet in your project you need to provide `controlNet` object with the following properties:
289
+ To use ControlNet in your project, you need to provide `controlNet` object with the following properties:
296
290
  - `name` - name of the ControlNet to use. Currently supported:
297
291
  - `canny`
298
292
  - `depth`
@@ -308,6 +302,7 @@ To use ControlNet in your project you need to provide `controlNet` object with t
308
302
  - `shuffle`
309
303
  - `softedge`
310
304
  - `tile`
305
+ - `instantid`
311
306
  - `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
307
  - `strength` - ControlNet strength 0 to 1. 0 full control to prompt, 1 full control to ControlNet
313
308
  - `mode` - How control and prompt should be weighted. Can be:
@@ -349,7 +344,8 @@ export type ControlNetName =
349
344
  | 'segmentation'
350
345
  | 'shuffle'
351
346
  | 'softedge'
352
- | 'tile';
347
+ | 'tile'
348
+ | 'instantid';
353
349
 
354
350
  export type ControlNetMode = 'balanced' | 'prompt_priority' | 'cn_priority';
355
351
  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"}