@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 +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +3 -2
- package/src/mediator.js +6 -6
package/README.md
CHANGED
package/package.json
CHANGED
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
|
|
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
|
-
|
|
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',
|
|
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
|
|