@stellar-broker/client 0.6.4 → 0.6.5

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/README.md CHANGED
@@ -161,6 +161,6 @@ if (mediator.hasObsoleteMediators) {
161
161
  }
162
162
  //or using static methods
163
163
  if (Mediator.hasObsoleteMediators(source)) {
164
- await Mediator.disposeObsoleteMediators(source)
164
+ await Mediator.disposeObsoleteMediators(source, signTx)
165
165
  }
166
166
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-broker/client",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Client library for StellarBroker service",
5
5
  "author": "team@stellar.broker",
6
6
  "homepage": "https://stellar.broker",
package/src/index.d.ts CHANGED
@@ -249,7 +249,7 @@ export class Mediator {
249
249
  * @param source - Initiator account that created a mediator
250
250
  * @param [storagePrefix] - Local storage key prefix
251
251
  */
252
- static hasObsoleteMediators(source: string, storagePrefix? :string): boolean
252
+ static hasObsoleteMediators(source: string, storagePrefix?: string): boolean
253
253
 
254
254
  /**
255
255
  * Retrieve funds from mediator accounts that belong to lost swap sessions
@@ -259,9 +259,10 @@ export class Mediator {
259
259
  /**
260
260
  * Retrieve funds from mediator accounts that belong to lost swap sessions
261
261
  * @param source - Initiator account that created a mediator
262
+ * @param authorization - Authorization callback or secret key
262
263
  * @param [storagePrefix] - Local storage key prefix
263
264
  */
264
- static disposeObsoleteMediators(source:string, storagePrefix?:string): Promise<void>;
265
+ static disposeObsoleteMediators(source: string, authorization: ClientAuthorizationParams, storagePrefix?: string): Promise<void>;
265
266
 
266
267
  /**
267
268
  * Create mediator account and deposit tokens to sell
package/src/mediator.js CHANGED
@@ -14,7 +14,7 @@ export class Mediator {
14
14
  * @param {string|Asset} sellingAsset - Identifier of the asset to sell
15
15
  * @param {string|Asset} buyingAsset - Identifier of the asset to buy
16
16
  * @param {string} sellingAmount - Asset amount to sell
17
- * @param {ClientAuthorizationParams} authorization - Authorization
17
+ * @param {ClientAuthorizationParams} authorization - Authorization callback or secret key
18
18
  */
19
19
  constructor(source, sellingAsset, buyingAsset, sellingAmount, authorization) {
20
20
  if (!StrKey.isValidEd25519PublicKey(source))
@@ -38,9 +38,7 @@ export class Mediator {
38
38
  console.error(e)
39
39
  throw new Error('Invalid selling amount')
40
40
  }
41
- if (authorization) {
42
- this.authorization = new AuthorizationWrapper(authorization)
43
- }
41
+ this.authorization = new AuthorizationWrapper(authorization)
44
42
  }
45
43
 
46
44
  /**
@@ -120,11 +118,13 @@ export class Mediator {
120
118
  /**
121
119
  * Retrieve funds from mediator accounts that belong to lost swap sessions
122
120
  * @param {string} source - Initiator account that created a mediator
121
+ * @param {ClientAuthorizationParams} authorization - Authorization callback or secret key
123
122
  * @param {string} [storagePrefix] - Local storage key prefix
124
123
  * @return {Promise}
125
124
  */
126
- static async disposeObsoleteMediators(source, storagePrefix = defaultStoragePrefix) {
127
- const wrapper = new Mediator(source, 'XLM', 'XLM', '0', null)
125
+ static async disposeObsoleteMediators(source, authorization, storagePrefix = defaultStoragePrefix) {
126
+ const wrapper = new Mediator(source, 'XLM', 'XLM', '0', authorization)
127
+ wrapper.storagePrefix = storagePrefix
128
128
  await wrapper.disposeObsoleteMediators()
129
129
  }
130
130