@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
@@ -2,7 +2,7 @@
2
2
  * ControlNet model names
3
3
  * @inline
4
4
  */
5
- export type ControlNetName = 'canny' | 'depth' | 'inpaint' | 'instrp2p' | 'lineart' | 'lineartanime' | 'mlsd' | 'normalbae' | 'openpose' | 'scribble' | 'segmentation' | 'shuffle' | 'softedge' | 'tile';
5
+ export type ControlNetName = 'canny' | 'depth' | 'inpaint' | 'instrp2p' | 'lineart' | 'lineartanime' | 'mlsd' | 'normalbae' | 'openpose' | 'scribble' | 'segmentation' | 'shuffle' | 'softedge' | 'tile' | 'instantid';
6
6
  /**
7
7
  * Raw ControlNet parameters passed to the API
8
8
  */
@@ -36,8 +36,13 @@ export interface ControlNetParams {
36
36
  name: ControlNetName;
37
37
  /**
38
38
  * ControlNet input image
39
+ * Supported types:
40
+ * `File` - file object from input[type=file]
41
+ * `Buffer` - Node.js buffer object with image data
42
+ * `Blob` - blob object with image data
43
+ * `true` - indicates that the image is already uploaded to the server
39
44
  */
40
- image?: File | Buffer | Blob;
45
+ image?: File | Buffer | Blob | boolean;
41
46
  /**
42
47
  * ControlNet strength 0 to 1. 0 full control to prompt, 1 full control to ControlNet
43
48
  */
@@ -22,10 +22,16 @@ export interface JobEventBase {
22
22
  export interface JobInitiating extends JobEventBase {
23
23
  type: 'initiating';
24
24
  workerName: string;
25
+ positivePrompt?: string;
26
+ negativePrompt?: string;
27
+ jobIndex?: number;
25
28
  }
26
29
  export interface JobStarted extends JobEventBase {
27
30
  type: 'started';
28
31
  workerName: string;
32
+ positivePrompt?: string;
33
+ negativePrompt?: string;
34
+ jobIndex?: number;
29
35
  }
30
36
  export interface JobProgress extends JobEventBase {
31
37
  type: 'progress';
@@ -1,5 +1,6 @@
1
1
  import { SupernetType } from '../../ApiClient/WebSocketClient/types';
2
2
  import { ControlNetParams } from './ControlNetParams';
3
+ import { TokenType } from '../../types/token';
3
4
  export interface SupportedModel {
4
5
  id: string;
5
6
  name: string;
@@ -90,12 +91,14 @@ export interface ProjectParams {
90
91
  */
91
92
  numberOfImages: number;
92
93
  /**
93
- * Generate images based on starting image.
94
+ * Generate images based on the starting image.
95
+ * Supported types:
94
96
  * `File` - file object from input[type=file]
95
- * `Buffer` - buffer object with image data
97
+ * `Buffer` - Node.js buffer object with image data
96
98
  * `Blob` - blob object with image data
99
+ * `true` - indicates that the image is already uploaded to the server
97
100
  */
98
- startingImage?: File | Buffer | Blob;
101
+ startingImage?: File | Buffer | Blob | boolean;
99
102
  /**
100
103
  * How strong effect of starting image should be. From 0 to 1, default 0.5
101
104
  */
@@ -129,6 +132,11 @@ export interface ProjectParams {
129
132
  * ControlNet model parameters
130
133
  */
131
134
  controlNet?: ControlNetParams;
135
+ /**
136
+ * Select which tokens to use for the project.
137
+ * If not specified, the Sogni token will be used.
138
+ */
139
+ tokenType?: TokenType;
132
140
  }
133
141
  export type ImageUrlParams = {
134
142
  imageId: string;
@@ -141,6 +149,10 @@ export interface EstimateRequest {
141
149
  * Network to use. Can be 'fast' or 'relaxed'
142
150
  */
143
151
  network: SupernetType;
152
+ /**
153
+ * Token type
154
+ */
155
+ tokenType?: TokenType;
144
156
  /**
145
157
  * Model ID
146
158
  */
@@ -180,3 +192,4 @@ export interface EstimateRequest {
180
192
  */
181
193
  height?: number;
182
194
  }
195
+ export type EnhancementStrength = 'light' | 'medium' | 'heavy';
@@ -0,0 +1,2 @@
1
+ import { EnhancementStrength } from './types';
2
+ export declare function getEnhacementStrength(strength: EnhancementStrength): number;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEnhacementStrength = getEnhacementStrength;
4
+ function getEnhacementStrength(strength) {
5
+ switch (strength) {
6
+ case 'light':
7
+ return 0.15;
8
+ case 'heavy':
9
+ return 0.49;
10
+ default:
11
+ return 0.35;
12
+ }
13
+ }
14
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/Projects/utils.ts"],"names":[],"mappings":";;AAEA,sDASC;AATD,SAAgB,qBAAqB,CAAC,QAA6B;IACjE,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC;QACd,KAAK,OAAO;YACV,OAAO,IAAI,CAAC;QACd;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -9,7 +9,8 @@ import Project, { ProjectStatus } from './Projects/Project';
9
9
  import { AvailableModel, ProjectParams, Scheduler, TimeStepSpacing } from './Projects/types';
10
10
  import StatsApi from './Stats';
11
11
  import ErrorData from './types/ErrorData';
12
- export type { AvailableModel, ErrorData, JobStatus, Logger, LogLevel, ProjectParams, ProjectStatus, Scheduler, SupernetType, TimeStepSpacing };
12
+ import { TokenType } from './types/token';
13
+ export type { AvailableModel, ErrorData, JobStatus, Logger, LogLevel, ProjectParams, ProjectStatus, Scheduler, SupernetType, TimeStepSpacing, TokenType };
13
14
  export { ApiError, CurrentAccount, Job, Project };
14
15
  export interface SogniClientConfig {
15
16
  /**
@@ -26,6 +27,13 @@ export interface SogniClientConfig {
26
27
  * @internal
27
28
  */
28
29
  socketEndpoint?: string;
30
+ /**
31
+ * Disable WebSocket connection. Useful for testing or when WebSocket is not needed.
32
+ * Note that many may not work without WebSocket connection.
33
+ * @experimental
34
+ * @internal
35
+ */
36
+ disableSocket?: boolean;
29
37
  /**
30
38
  * Which network to use after logging in. Can be 'fast' or 'relaxed'
31
39
  */
@@ -39,10 +47,6 @@ export interface SogniClientConfig {
39
47
  * @default 'warn'
40
48
  **/
41
49
  logLevel?: LogLevel;
42
- /**
43
- * If provided, the client will connect to this JSON-RPC endpoint to interact with the blockchain
44
- */
45
- jsonRpcUrl?: string;
46
50
  /**
47
51
  * If true, the client will connect to the testnet. Ignored if jsonRpcUrl is provided
48
52
  */
@@ -56,7 +60,7 @@ export declare class SogniClient {
56
60
  private constructor();
57
61
  get currentAccount(): CurrentAccount;
58
62
  /**
59
- * Instance creation may involve async operations, so we use a static method
63
+ * Create client instance, with default configuration
60
64
  * @param config
61
65
  */
62
66
  static createInstance(config: SogniClientConfig): Promise<SogniClient>;
package/dist/index.js CHANGED
@@ -36,7 +36,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  exports.SogniClient = exports.Project = exports.Job = exports.CurrentAccount = exports.ApiError = void 0;
39
- const ethers_1 = require("ethers");
40
39
  // Account API
41
40
  const Account_1 = __importDefault(require("./Account"));
42
41
  const CurrentAccount_1 = __importDefault(require("./Account/CurrentAccount"));
@@ -66,7 +65,7 @@ class SogniClient {
66
65
  return this.account.currentAccount;
67
66
  }
68
67
  /**
69
- * Instance creation may involve async operations, so we use a static method
68
+ * Create client instance, with default configuration
70
69
  * @param config
71
70
  */
72
71
  static createInstance(config) {
@@ -75,22 +74,14 @@ class SogniClient {
75
74
  const socketEndpoint = config.socketEndpoint || 'wss://socket.sogni.ai';
76
75
  const network = config.network || 'fast';
77
76
  const logger = config.logger || new DefaultLogger_1.DefaultLogger(config.logLevel || 'warn');
78
- const isTestnet = config.testnet !== undefined ? config.testnet : true;
79
- const client = new ApiClient_1.default(restEndpoint, socketEndpoint, config.appId, network, logger);
80
- let provider;
81
- if ('jsonRpcUrl' in config) {
82
- provider = new ethers_1.JsonRpcProvider(config.jsonRpcUrl);
83
- }
84
- else {
85
- provider = (0, ethers_1.getDefaultProvider)(isTestnet ? 84532 : 8453);
86
- }
87
- const chainId = yield provider.getNetwork().then((network) => network.chainId);
77
+ const isTestnet = config.testnet !== undefined ? config.testnet : false;
78
+ const client = new ApiClient_1.default(restEndpoint, socketEndpoint, config.appId, network, logger, config.disableSocket);
88
79
  const eip712 = new EIP712Helper_1.default({
89
- name: 'Sogni-testnet',
80
+ name: isTestnet ? 'Sogni-testnet' : 'Sogni AI',
90
81
  version: '1',
91
- chainId: chainId.toString()
82
+ chainId: isTestnet ? '84532' : '8453'
92
83
  });
93
- return new SogniClient({ client, provider, eip712 });
84
+ return new SogniClient({ client, eip712 });
94
85
  });
95
86
  }
96
87
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA+E;AAC/E,cAAc;AACd,wDAAmC;AACnC,8EAAsD;AA+BnC,yBA/BZ,wBAAc,CA+BY;AA9BjC,YAAY;AACZ,yDAAkD;AA6BzC,yFA7BW,oBAAQ,OA6BX;AA1BjB,QAAQ;AACR,uDAAsE;AACtE,sEAA8C;AAC9C,eAAe;AACf,0DAAqC;AACrC,yDAAgD;AAqBb,cArB5B,a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AC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAO,cAAc,CAAC,MAAyB;;YACnD,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,sBAAsB,CAAC;YACnE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,uBAAuB,CAAC;YACxE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC;YACzC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;YAC7E,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAExE,MAAM,MAAM,GAAG,IAAI,mBAAS,CAC1B,YAAY,EACZ,cAAc,EACd,MAAM,CAAC,KAAK,EACZ,OAAO,EACP,MAAM,EACN,MAAM,CAAC,aAAa,CACrB,CAAC;YACF,MAAM,MAAM,GAAG,IAAI,sBAAY,CAAC;gBAC9B,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU;gBAC9C,OAAO,EAAE,GAAG;gBACZ,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;aACtC,CAAC,CAAC;YACH,OAAO,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7C,CAAC;KAAA;CACF;AA7CD,kCA6CC"}
@@ -6,3 +6,4 @@ export declare function decodeRefreshToken(token: string): {
6
6
  env: string;
7
7
  expiresAt: Date;
8
8
  };
9
+ export declare function delay(ms: number): Promise<unknown>;
package/dist/lib/utils.js CHANGED
@@ -1,7 +1,17 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.decodeToken = decodeToken;
4
13
  exports.decodeRefreshToken = decodeRefreshToken;
14
+ exports.delay = delay;
5
15
  const jwt_decode_1 = require("jwt-decode");
6
16
  function decodeToken(token) {
7
17
  const data = (0, jwt_decode_1.jwtDecode)(token);
@@ -17,4 +27,9 @@ function decodeRefreshToken(token) {
17
27
  expiresAt: new Date(data.exp * 1000)
18
28
  };
19
29
  }
30
+ function delay(ms) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ return new Promise((resolve) => setTimeout(resolve, ms));
33
+ });
34
+ }
20
35
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":";;AAEA,kCAMC;AAED,gDAMC;AAhBD,2CAAuC;AAEvC,SAAgB,WAAW,CAAC,KAAa;IACvC,MAAM,IAAI,GAAG,IAAA,sBAAS,EAA0D,KAAK,CAAC,CAAC;IACvF,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,IAAI;QACxB,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;KACrC,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,MAAM,IAAI,GAAG,IAAA,sBAAS,EAA0D,KAAK,CAAC,CAAC;IACvF,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;KACrC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,kCAMC;AAED,gDAMC;AAED,sBAEC;AApBD,2CAAuC;AAEvC,SAAgB,WAAW,CAAC,KAAa;IACvC,MAAM,IAAI,GAAG,IAAA,sBAAS,EAA0D,KAAK,CAAC,CAAC;IACvF,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,IAAI;QACxB,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;KACrC,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,MAAM,IAAI,GAAG,IAAA,sBAAS,EAA0D,KAAK,CAAC,CAAC;IACvF,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;KACrC,CAAC;AACJ,CAAC;AAED,SAAsB,KAAK,CAAC,EAAU;;QACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;CAAA"}
@@ -0,0 +1 @@
1
+ export type TokenType = 'sogni' | 'spark';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/types/token.ts"],"names":[],"mappings":""}
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.0.0-alpha.4";
1
+ export declare const LIB_VERSION: string;
package/dist/version.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
- exports.LIB_VERSION = "1.0.0-alpha.4";
4
+ const package_json_1 = require("../package.json");
5
+ exports.LIB_VERSION = package_json_1.version;
5
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,kDAA0C;AAC7B,QAAA,WAAW,GAAG,sBAAO,CAAC"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.0.0-alpha.9",
6
+ "version": "3.0.1",
7
7
  "description": "Sogni Supernet Client",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -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;
@@ -28,10 +28,18 @@ function getDefaults(): AccountData {
28
28
  networkStatus: 'disconnected',
29
29
  network: null,
30
30
  balance: {
31
- credit: '0',
32
- debit: '0',
33
- net: '0',
34
- settled: '0'
31
+ sogni: {
32
+ credit: '0',
33
+ debit: '0',
34
+ net: '0',
35
+ settled: '0'
36
+ },
37
+ spark: {
38
+ credit: '0',
39
+ debit: '0',
40
+ net: '0',
41
+ settled: '0'
42
+ }
35
43
  },
36
44
  walletAddress: undefined,
37
45
  username: undefined,