@sogni-ai/sogni-client 3.0.0-alpha.8 → 3.0.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.
- package/CHANGELOG.md +335 -0
- package/README.md +4 -11
- package/dist/Account/CurrentAccount.d.ts +3 -3
- package/dist/Account/CurrentAccount.js +12 -4
- package/dist/Account/CurrentAccount.js.map +1 -1
- package/dist/Account/index.d.ts +42 -13
- package/dist/Account/index.js +132 -29
- package/dist/Account/index.js.map +1 -1
- package/dist/Account/types.d.ts +21 -0
- package/dist/ApiClient/WebSocketClient/events.d.ts +55 -7
- package/dist/ApiClient/WebSocketClient/index.js +1 -1
- package/dist/ApiClient/index.d.ts +4 -2
- package/dist/ApiClient/index.js +12 -3
- package/dist/ApiClient/index.js.map +1 -1
- package/dist/ApiGroup.d.ts +0 -3
- package/dist/ApiGroup.js +0 -1
- package/dist/ApiGroup.js.map +1 -1
- package/dist/Projects/Job.d.ts +43 -0
- package/dist/Projects/Job.js +76 -0
- package/dist/Projects/Job.js.map +1 -1
- package/dist/Projects/Project.d.ts +1 -1
- package/dist/Projects/Project.js +9 -18
- package/dist/Projects/Project.js.map +1 -1
- package/dist/Projects/createJobRequestMessage.js +2 -2
- package/dist/Projects/createJobRequestMessage.js.map +1 -1
- package/dist/Projects/index.d.ts +7 -2
- package/dist/Projects/index.js +48 -10
- package/dist/Projects/index.js.map +1 -1
- package/dist/Projects/types/ControlNetParams.d.ts +7 -2
- package/dist/Projects/types/events.d.ts +6 -0
- package/dist/Projects/types/index.d.ts +16 -3
- package/dist/Projects/utils.d.ts +2 -0
- package/dist/Projects/utils.js +14 -0
- package/dist/Projects/utils.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.js +6 -15
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +15 -0
- package/dist/lib/utils.js.map +1 -1
- package/dist/types/token.d.ts +1 -0
- package/dist/types/token.js +3 -0
- package/dist/types/token.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +2 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/Account/CurrentAccount.ts +14 -6
- package/src/Account/index.ts +163 -59
- package/src/Account/types.ts +26 -0
- package/src/ApiClient/WebSocketClient/events.ts +59 -7
- package/src/ApiClient/WebSocketClient/index.ts +1 -1
- package/src/ApiClient/index.ts +15 -4
- package/src/ApiGroup.ts +0 -4
- package/src/Projects/Job.ts +98 -0
- package/src/Projects/Project.ts +11 -19
- package/src/Projects/createJobRequestMessage.ts +4 -2
- package/src/Projects/index.ts +53 -13
- package/src/Projects/types/ControlNetParams.ts +8 -2
- package/src/Projects/types/events.ts +6 -0
- package/src/Projects/types/index.ts +17 -3
- package/src/Projects/utils.ts +12 -0
- package/src/Stats/index.ts +2 -2
- package/src/index.ts +23 -19
- package/src/lib/utils.ts +4 -0
- package/src/types/token.ts +1 -0
- package/src/version.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,324 @@
|
|
|
1
|
+
# [3.0.0](https://github.com/Sogni-AI/sogni-client/compare/v2.0.4...v3.0.0) (2025-07-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Copy size preset when enhancing image ([06ab629](https://github.com/Sogni-AI/sogni-client/commit/06ab629a9b10377c87406817d1e72a0cd35bd025))
|
|
7
|
+
* Discard enhancement project before starting new one ([4293b2b](https://github.com/Sogni-AI/sogni-client/commit/4293b2b535ed8cfe76ce307de71c99bec799bd79))
|
|
8
|
+
* Do not mark project as completed if not all jobs started yet ([812e5ac](https://github.com/Sogni-AI/sogni-client/commit/812e5accd8605a6a742beb16a53bca2be50b9a81))
|
|
9
|
+
* Fix job.getResultUrl() bug ([ea90083](https://github.com/Sogni-AI/sogni-client/commit/ea900831cd578c5962236b70564cab0da4f2f7a8))
|
|
10
|
+
* Fix project sync attempt counter ([b112c06](https://github.com/Sogni-AI/sogni-client/commit/b112c064b443186b1992a80da5612af001919107))
|
|
11
|
+
* Pass tokenType to jobRequest message. Make tokenType optional for project estimation ([9550d76](https://github.com/Sogni-AI/sogni-client/commit/9550d76ee3d40fb4321a157d0a5feb0fb680f183))
|
|
12
|
+
* Prevent job progress going down ([5cf69d3](https://github.com/Sogni-AI/sogni-client/commit/5cf69d375d3a284964ba423c4287d592538cd273))
|
|
13
|
+
* Set scheduler and timeStepSpacing to null by default ([ccc1fc8](https://github.com/Sogni-AI/sogni-client/commit/ccc1fc842b408f905fd786807be5b5df8895690b))
|
|
14
|
+
* Update typings to indicate that `unclaimed` field may be absent from balance ([a661e17](https://github.com/Sogni-AI/sogni-client/commit/a661e17f549c3a51003557acb5e3ee5e34877f9d))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Add `provider` parameter to `client.account.transactionHistory` ([9de208a](https://github.com/Sogni-AI/sogni-client/commit/9de208aa478d745a0706d8960e033e4cc9e25d35))
|
|
20
|
+
* Add basic ControlNet support ([220991d](https://github.com/Sogni-AI/sogni-client/commit/220991db5b16740b159d2cb0c3e746141fa4906f))
|
|
21
|
+
* Add job.getResultUrl() method to retrieve fresh download URL for a job ([82ce8d3](https://github.com/Sogni-AI/sogni-client/commit/82ce8d3cc9681800616185aac50e8f2102314ed4))
|
|
22
|
+
* Add new leaderboard types ([d6d3fb8](https://github.com/Sogni-AI/sogni-client/commit/d6d3fb8a7c5a84ff089d6b51bc448da26821174a))
|
|
23
|
+
* Add prompt and style overrides for image enhancer ([35cd4a0](https://github.com/Sogni-AI/sogni-client/commit/35cd4a017361f919d42a2568fff6e2e7b4367949))
|
|
24
|
+
* Add support for `authenticated` socket event ([bc3d345](https://github.com/Sogni-AI/sogni-client/commit/bc3d3451e7640eb15f1368144bbc112298f640fa))
|
|
25
|
+
* 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))
|
|
26
|
+
* Add support for toast message events ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/2b032a83b3c28798a4df692c1cb6f090915191a6))
|
|
27
|
+
* add TokenType export and update LIB_VERSION from package.json ([f6110b5](https://github.com/Sogni-AI/sogni-client/commit/f6110b521715a076a7abb3010c68fbde8ea64b71))
|
|
28
|
+
* add tokenType to estimateCost and estimateEnhancementCost methods ([1c97258](https://github.com/Sogni-AI/sogni-client/commit/1c97258facb2ddd687361a5172d5318329a70c43))
|
|
29
|
+
* add tokenType to transaction list ([ee5951e](https://github.com/Sogni-AI/sogni-client/commit/ee5951ef9014ec6eed6a5b52acb5b8b1c5d1227d))
|
|
30
|
+
* Add turnstile token parameter to claimReward ([a96f5e2](https://github.com/Sogni-AI/sogni-client/commit/a96f5e2b22fd879a717aae1c3fe6f60ad675d031))
|
|
31
|
+
* Allow insecure socket connections ([5da2b0a](https://github.com/Sogni-AI/sogni-client/commit/5da2b0abb57e0e8ab7c7c5de449ea7a04183b753))
|
|
32
|
+
* Allow passing string to `account.deposit` and `account.withdraw` ([c9397f1](https://github.com/Sogni-AI/sogni-client/commit/c9397f1436b7c198ba4be860414815c6fc637bf6))
|
|
33
|
+
* Allow setting token type for image enhancement ([7420274](https://github.com/Sogni-AI/sogni-client/commit/7420274caf852b078d47e008b6065da70a456714))
|
|
34
|
+
* Bump PROTOCOL_VERSION ([6e5f6b9](https://github.com/Sogni-AI/sogni-client/commit/6e5f6b91870fbd557ce235d0508216c1b4e93cad))
|
|
35
|
+
* Cloudflare Turnstile token is required during signup ([768b9c8](https://github.com/Sogni-AI/sogni-client/commit/768b9c8a46f05f7b196976d3a7aa8a1e512ca172))
|
|
36
|
+
* Decouple fetching balance from the refresh method ([a7d4f62](https://github.com/Sogni-AI/sogni-client/commit/a7d4f625fc29831fdd72fda65af622d303ef1d32))
|
|
37
|
+
* Default client to mainnet ([5f9e44f](https://github.com/Sogni-AI/sogni-client/commit/5f9e44f462cd1b6f5bddc30e523567fa8b671736))
|
|
38
|
+
* Default rewards provider to `base`, add provider param to queried rewards ([d84dcff](https://github.com/Sogni-AI/sogni-client/commit/d84dcff1d3e01b7154e62724d078cfd158d12317))
|
|
39
|
+
* emit jobStarted, jobCompleted, and jobFailed events for better job tracking ([0e3bb33](https://github.com/Sogni-AI/sogni-client/commit/0e3bb33703868a3491edfac2c9f08325db0eb278))
|
|
40
|
+
* Expose getNonce method as public ([694c041](https://github.com/Sogni-AI/sogni-client/commit/694c041431b99c4bae2d5dc8f22d327fed45771d))
|
|
41
|
+
* Expose option to disable socket connection (Experimental) ([048adcf](https://github.com/Sogni-AI/sogni-client/commit/048adcfad99acd8ffb8197ad55f7d54679aacde8))
|
|
42
|
+
* Image enhancement with Flux model ([82488e7](https://github.com/Sogni-AI/sogni-client/commit/82488e7658b56902cee25e58bc1763c1392c5d46))
|
|
43
|
+
* Migrate account deposit to v3 ([71bfaac](https://github.com/Sogni-AI/sogni-client/commit/71bfaacca89c3a7f721b91ca39226650a2eb4ff5))
|
|
44
|
+
* Refactor image enhancement logic ([6728875](https://github.com/Sogni-AI/sogni-client/commit/67288759637c4b22266455ce1f1220d2590d7592))
|
|
45
|
+
* Remove blockchain provider since SDK does not need to call Base ([d5f8609](https://github.com/Sogni-AI/sogni-client/commit/d5f8609f29b9f9843913ecaf514516f490a60c61))
|
|
46
|
+
* 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))
|
|
47
|
+
* Support for EIP712 on mainnet ([5e04e81](https://github.com/Sogni-AI/sogni-client/commit/5e04e8129f59bfac0ed6d65cc7c847ad622111b2))
|
|
48
|
+
* Support passing `provider` parameter when claiming reward ([71a045e](https://github.com/Sogni-AI/sogni-client/commit/71a045e60dbda63efe9f513bc9ffe8328f5e3dd2))
|
|
49
|
+
* Support rewards v4 API to query rewards scoped to ([ff0a713](https://github.com/Sogni-AI/sogni-client/commit/ff0a71387f602faba7da9a2e494f886a98881d95))
|
|
50
|
+
* Support uploading starting image and ControlNet input image before creating a project ([4fd8a5a](https://github.com/Sogni-AI/sogni-client/commit/4fd8a5a3597e7b3bb85c4a8c94cd2df798ca6bfe))
|
|
51
|
+
* 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))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### BREAKING CHANGES
|
|
55
|
+
|
|
56
|
+
* `client.account.claimRewards` signature changed
|
|
57
|
+
* client.projects.estimateCost and client.projects.estimateEnhancementCost signature changed
|
|
58
|
+
* Balance data format has changed
|
|
59
|
+
* Signup signature is changed.Turnstile token is required for Signup
|
|
60
|
+
|
|
61
|
+
# [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)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Bug Fixes
|
|
65
|
+
|
|
66
|
+
* remove provider instance as it is not actually used ([62f384e](https://github.com/Sogni-AI/sogni-client/commit/62f384e82c4e5ae453bbec567ce58aa5ae1e7c72))
|
|
67
|
+
* update documentation ([5d09f39](https://github.com/Sogni-AI/sogni-client/commit/5d09f39181e058bd6d5706d8d919d7855bb6dd81))
|
|
68
|
+
|
|
69
|
+
# [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)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
### Features
|
|
73
|
+
|
|
74
|
+
* Allow passing string to `account.deposit` and `account.withdraw` ([c9397f1](https://github.com/Sogni-AI/sogni-client/commit/c9397f1436b7c198ba4be860414815c6fc637bf6))
|
|
75
|
+
|
|
76
|
+
# [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)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Features
|
|
80
|
+
|
|
81
|
+
* Default client to mainnet ([5f9e44f](https://github.com/Sogni-AI/sogni-client/commit/5f9e44f462cd1b6f5bddc30e523567fa8b671736))
|
|
82
|
+
|
|
83
|
+
# [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)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Features
|
|
87
|
+
|
|
88
|
+
* Support for EIP712 on mainnet ([5e04e81](https://github.com/Sogni-AI/sogni-client/commit/5e04e8129f59bfac0ed6d65cc7c847ad622111b2))
|
|
89
|
+
|
|
90
|
+
# [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)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Features
|
|
94
|
+
|
|
95
|
+
* Migrate account deposit to v3 ([71bfaac](https://github.com/Sogni-AI/sogni-client/commit/71bfaacca89c3a7f721b91ca39226650a2eb4ff5))
|
|
96
|
+
|
|
97
|
+
# [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)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
### Features
|
|
101
|
+
|
|
102
|
+
* Add support for `authenticated` socket event ([bc3d345](https://github.com/Sogni-AI/sogni-client/commit/bc3d3451e7640eb15f1368144bbc112298f640fa))
|
|
103
|
+
|
|
104
|
+
# [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)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Features
|
|
108
|
+
|
|
109
|
+
* Expose option to disable socket connection (Experimental) ([048adcf](https://github.com/Sogni-AI/sogni-client/commit/048adcfad99acd8ffb8197ad55f7d54679aacde8))
|
|
110
|
+
|
|
111
|
+
# [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)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### Features
|
|
115
|
+
|
|
116
|
+
* Expose getNonce method as public ([694c041](https://github.com/Sogni-AI/sogni-client/commit/694c041431b99c4bae2d5dc8f22d327fed45771d))
|
|
117
|
+
|
|
118
|
+
# [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)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### Features
|
|
122
|
+
|
|
123
|
+
* Decouple fetching balance from the refresh method ([a7d4f62](https://github.com/Sogni-AI/sogni-client/commit/a7d4f625fc29831fdd72fda65af622d303ef1d32))
|
|
124
|
+
|
|
125
|
+
# [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)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
### Bug Fixes
|
|
129
|
+
|
|
130
|
+
* Update typings to indicate that `unclaimed` field may be absent from balance ([a661e17](https://github.com/Sogni-AI/sogni-client/commit/a661e17f549c3a51003557acb5e3ee5e34877f9d))
|
|
131
|
+
|
|
132
|
+
# [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)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
* Add `provider` parameter to `client.account.transactionHistory` ([9de208a](https://github.com/Sogni-AI/sogni-client/commit/9de208aa478d745a0706d8960e033e4cc9e25d35))
|
|
138
|
+
|
|
139
|
+
# [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)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### Features
|
|
143
|
+
|
|
144
|
+
* Default rewards provider to `base`, add provider param to queried rewards ([d84dcff](https://github.com/Sogni-AI/sogni-client/commit/d84dcff1d3e01b7154e62724d078cfd158d12317))
|
|
145
|
+
|
|
146
|
+
# [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)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Features
|
|
150
|
+
|
|
151
|
+
* Support passing `provider` parameter when claiming reward ([71a045e](https://github.com/Sogni-AI/sogni-client/commit/71a045e60dbda63efe9f513bc9ffe8328f5e3dd2))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### BREAKING CHANGES
|
|
155
|
+
|
|
156
|
+
* `client.account.claimRewards` signature changed
|
|
157
|
+
|
|
158
|
+
# [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)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Features
|
|
162
|
+
|
|
163
|
+
* Support rewards v4 API to query rewards scoped to ([ff0a713](https://github.com/Sogni-AI/sogni-client/commit/ff0a71387f602faba7da9a2e494f886a98881d95))
|
|
164
|
+
|
|
165
|
+
# [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)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### Features
|
|
169
|
+
|
|
170
|
+
* Support uploading starting image and ControlNet input image before creating a project ([4fd8a5a](https://github.com/Sogni-AI/sogni-client/commit/4fd8a5a3597e7b3bb85c4a8c94cd2df798ca6bfe))
|
|
171
|
+
|
|
172
|
+
# [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)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
### Features
|
|
176
|
+
|
|
177
|
+
* Allow setting token type for image enhancement ([7420274](https://github.com/Sogni-AI/sogni-client/commit/7420274caf852b078d47e008b6065da70a456714))
|
|
178
|
+
|
|
179
|
+
# [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)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
### Bug Fixes
|
|
183
|
+
|
|
184
|
+
* Pass tokenType to jobRequest message. Make tokenType optional for project estimation ([9550d76](https://github.com/Sogni-AI/sogni-client/commit/9550d76ee3d40fb4321a157d0a5feb0fb680f183))
|
|
185
|
+
|
|
186
|
+
# [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)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
### Features
|
|
190
|
+
|
|
191
|
+
* Remove blockchain provider since SDK does not need to call Base ([d5f8609](https://github.com/Sogni-AI/sogni-client/commit/d5f8609f29b9f9843913ecaf514516f490a60c61))
|
|
192
|
+
|
|
193
|
+
# [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)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
### Features
|
|
197
|
+
|
|
198
|
+
* add tokenType to transaction list ([ee5951e](https://github.com/Sogni-AI/sogni-client/commit/ee5951ef9014ec6eed6a5b52acb5b8b1c5d1227d))
|
|
199
|
+
|
|
200
|
+
# [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)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### Features
|
|
204
|
+
|
|
205
|
+
* add tokenType to estimateCost and estimateEnhancementCost methods ([1c97258](https://github.com/Sogni-AI/sogni-client/commit/1c97258facb2ddd687361a5172d5318329a70c43))
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### BREAKING CHANGES
|
|
209
|
+
|
|
210
|
+
* client.projects.estimateCost and client.projects.estimateEnhancementCost signature changed
|
|
211
|
+
|
|
212
|
+
# [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)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### Features
|
|
216
|
+
|
|
217
|
+
* Bump PROTOCOL_VERSION ([6e5f6b9](https://github.com/Sogni-AI/sogni-client/commit/6e5f6b91870fbd557ce235d0508216c1b4e93cad))
|
|
218
|
+
|
|
219
|
+
# [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)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
### Features
|
|
223
|
+
|
|
224
|
+
* add TokenType export and update LIB_VERSION from package.json ([f6110b5](https://github.com/Sogni-AI/sogni-client/commit/f6110b521715a076a7abb3010c68fbde8ea64b71))
|
|
225
|
+
|
|
226
|
+
# [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)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### Features
|
|
230
|
+
|
|
231
|
+
* 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))
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
### BREAKING CHANGES
|
|
235
|
+
|
|
236
|
+
* Balance data format has changed
|
|
237
|
+
|
|
238
|
+
# [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)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
### Features
|
|
242
|
+
|
|
243
|
+
* emit jobStarted, jobCompleted, and jobFailed events for better job tracking ([0e3bb33](https://github.com/Sogni-AI/sogni-client/commit/0e3bb33703868a3491edfac2c9f08325db0eb278))
|
|
244
|
+
|
|
245
|
+
# [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)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
### Features
|
|
249
|
+
|
|
250
|
+
* 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))
|
|
251
|
+
|
|
252
|
+
# [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)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
### Bug Fixes
|
|
256
|
+
|
|
257
|
+
* Do not mark project as completed if not all jobs started yet ([812e5ac](https://github.com/Sogni-AI/sogni-client/commit/812e5accd8605a6a742beb16a53bca2be50b9a81))
|
|
258
|
+
|
|
259
|
+
# [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)
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
### Bug Fixes
|
|
263
|
+
|
|
264
|
+
* Discard enhancement project before starting new one ([4293b2b](https://github.com/Sogni-AI/sogni-client/commit/4293b2b535ed8cfe76ce307de71c99bec799bd79))
|
|
265
|
+
|
|
266
|
+
# [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)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
### Bug Fixes
|
|
270
|
+
|
|
271
|
+
* Prevent job progress going down ([5cf69d3](https://github.com/Sogni-AI/sogni-client/commit/5cf69d375d3a284964ba423c4287d592538cd273))
|
|
272
|
+
|
|
273
|
+
# [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)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
### Features
|
|
277
|
+
|
|
278
|
+
* Refactor image enhancement logic ([6728875](https://github.com/Sogni-AI/sogni-client/commit/67288759637c4b22266455ce1f1220d2590d7592))
|
|
279
|
+
|
|
280
|
+
# [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)
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
### Features
|
|
284
|
+
|
|
285
|
+
* Add prompt and style overrides for image enhancer ([35cd4a0](https://github.com/Sogni-AI/sogni-client/commit/35cd4a017361f919d42a2568fff6e2e7b4367949))
|
|
286
|
+
|
|
287
|
+
# [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)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
### Bug Fixes
|
|
291
|
+
|
|
292
|
+
* Copy size preset when enhancing image ([06ab629](https://github.com/Sogni-AI/sogni-client/commit/06ab629a9b10377c87406817d1e72a0cd35bd025))
|
|
293
|
+
|
|
294
|
+
# [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)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
### Features
|
|
298
|
+
|
|
299
|
+
* Image enhancement with Flux model ([82488e7](https://github.com/Sogni-AI/sogni-client/commit/82488e7658b56902cee25e58bc1763c1392c5d46))
|
|
300
|
+
|
|
301
|
+
# [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)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
### Features
|
|
305
|
+
|
|
306
|
+
* Add support for InstantID ControlNet ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/dbaa1e464d15635dc5e7db6c785bf25b0e8788a7))
|
|
307
|
+
|
|
308
|
+
# [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)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
### Features
|
|
312
|
+
|
|
313
|
+
* Add support for toast message events ([2b032a8](https://github.com/Sogni-AI/sogni-client/commit/2b032a83b3c28798a4df692c1cb6f090915191a6))
|
|
314
|
+
|
|
315
|
+
# [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)
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
### Bug Fixes
|
|
319
|
+
|
|
320
|
+
* Set scheduler and timeStepSpacing to null by default ([ccc1fc8](https://github.com/Sogni-AI/sogni-client/commit/ccc1fc842b408f905fd786807be5b5df8895690b))
|
|
321
|
+
|
|
1
322
|
# [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)
|
|
2
323
|
|
|
3
324
|
|
|
@@ -66,6 +387,20 @@
|
|
|
66
387
|
|
|
67
388
|
* Add basic ControlNet support ([220991d](https://github.com/Sogni-AI/sogni-client/commit/220991db5b16740b159d2cb0c3e746141fa4906f))
|
|
68
389
|
|
|
390
|
+
## [2.0.4](https://github.com/Sogni-AI/sogni-client/compare/v2.0.3...v2.0.4) (2025-05-14)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
### Bug Fixes
|
|
394
|
+
|
|
395
|
+
* update documentation ([5d09f39](https://github.com/Sogni-AI/sogni-client/commit/5d09f39181e058bd6d5706d8d919d7855bb6dd81))
|
|
396
|
+
|
|
397
|
+
## [2.0.3](https://github.com/Sogni-AI/sogni-client/compare/v2.0.2...v2.0.3) (2025-05-14)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
### Bug Fixes
|
|
401
|
+
|
|
402
|
+
* remove provider instance as it is not actually used ([62f384e](https://github.com/Sogni-AI/sogni-client/commit/62f384e82c4e5ae453bbec567ce58aa5ae1e7c72))
|
|
403
|
+
|
|
69
404
|
## [2.0.2](https://github.com/Sogni-AI/sogni-client/compare/v2.0.1...v2.0.2) (2025-02-04)
|
|
70
405
|
|
|
71
406
|
|
package/README.md
CHANGED
|
@@ -19,8 +19,6 @@ You can create a free account in our [Web App](https://app.sogni.ai) or [Mac App
|
|
|
19
19
|
|
|
20
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.
|
|
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.
|
|
23
|
-
|
|
24
22
|
### Supernet Types
|
|
25
23
|
There are 2 worker network types available:
|
|
26
24
|
- `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.
|
|
@@ -44,17 +42,11 @@ import { SogniClient } from '@sogni-ai/sogni-client';
|
|
|
44
42
|
const USERNAME = 'your-username';
|
|
45
43
|
const PASSWORD = 'your-password';
|
|
46
44
|
|
|
47
|
-
// If using default provider
|
|
48
45
|
const options = {
|
|
49
46
|
appId: 'your-app-id', // Required, must be unique string, UUID is recommended
|
|
50
47
|
network: 'fast', // Network to use, 'fast' or 'relaxed'
|
|
51
48
|
}
|
|
52
|
-
|
|
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
|
-
}
|
|
49
|
+
|
|
58
50
|
const client = await SogniClient.createInstance(options);
|
|
59
51
|
// Login to Sogni account and establish WebSocket connection to Supernet
|
|
60
52
|
await client.account.login(USERNAME, PASSWORD);
|
|
@@ -65,7 +57,6 @@ const models = await client.projects.waitForModels();
|
|
|
65
57
|
```
|
|
66
58
|
**Important Note:**
|
|
67
59
|
- 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
60
|
- `appId` must be unique string, UUID is recommended. It is used to identify your application.
|
|
70
61
|
- 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
62
|
|
|
@@ -308,6 +299,7 @@ To use ControlNet in your project you need to provide `controlNet` object with t
|
|
|
308
299
|
- `shuffle`
|
|
309
300
|
- `softedge`
|
|
310
301
|
- `tile`
|
|
302
|
+
- `instantid`
|
|
311
303
|
- `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
304
|
- `strength` - ControlNet strength 0 to 1. 0 full control to prompt, 1 full control to ControlNet
|
|
313
305
|
- `mode` - How control and prompt should be weighted. Can be:
|
|
@@ -349,7 +341,8 @@ export type ControlNetName =
|
|
|
349
341
|
| 'segmentation'
|
|
350
342
|
| 'shuffle'
|
|
351
343
|
| 'softedge'
|
|
352
|
-
| 'tile'
|
|
344
|
+
| 'tile'
|
|
345
|
+
| 'instantid';
|
|
353
346
|
|
|
354
347
|
export type ControlNetMode = 'balanced' | 'prompt_priority' | 'cn_priority';
|
|
355
348
|
export interface ControlNetParams {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import DataEntity from '../lib/DataEntity';
|
|
2
|
-
import {
|
|
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:
|
|
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():
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
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"}
|
package/dist/Account/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AccountCreateData, AccountCreateParams,
|
|
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 {
|
|
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
|
-
|
|
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<
|
|
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
|
-
|
|
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 |
|
|
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,14 +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
|
|
179
|
-
* @param
|
|
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
|
|
180
199
|
*/
|
|
181
|
-
claimRewards(rewardIds: string[], turnstileToken?:
|
|
200
|
+
claimRewards(rewardIds: string[], { turnstileToken, provider }?: ClaimOptions): Promise<void>;
|
|
182
201
|
/**
|
|
183
202
|
* Withdraw funds from the current account to wallet.
|
|
184
203
|
* @example withdraw to current wallet address
|
|
@@ -189,7 +208,7 @@ declare class AccountApi extends ApiGroup {
|
|
|
189
208
|
* @param password - account password
|
|
190
209
|
* @param amount - amount of tokens to withdraw from account to wallet
|
|
191
210
|
*/
|
|
192
|
-
withdraw(password: string, amount: number): Promise<void>;
|
|
211
|
+
withdraw(password: string, amount: number | string): Promise<void>;
|
|
193
212
|
/**
|
|
194
213
|
* Deposit tokens from wallet to account
|
|
195
214
|
* @example withdraw to current wallet address
|
|
@@ -200,6 +219,16 @@ declare class AccountApi extends ApiGroup {
|
|
|
200
219
|
* @param password - account password
|
|
201
220
|
* @param amount - amount to transfer
|
|
202
221
|
*/
|
|
203
|
-
deposit(password: string, amount: number): Promise<void>;
|
|
222
|
+
deposit(password: string, amount: number | string): 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>;
|
|
204
233
|
}
|
|
205
234
|
export default AccountApi;
|