@atomiqlabs/base 12.0.0 → 12.0.2
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Message } from "./messages/Message";
|
|
2
2
|
export interface Messenger {
|
|
3
3
|
init(): Promise<void>;
|
|
4
|
+
warmup?(): Promise<void>;
|
|
4
5
|
broadcast(msg: Message): Promise<void>;
|
|
5
6
|
subscribe(callback: (msg: Message) => void): Promise<void>;
|
|
6
7
|
unsubscribe(callback: (msg: Message) => void): Promise<boolean>;
|
|
@@ -201,6 +201,21 @@ export interface SwapContract<T extends SwapData = SwapData, TX = any, PreFetchD
|
|
|
201
201
|
}[]): Promise<{
|
|
202
202
|
[escrowHash: string]: SwapCommitState;
|
|
203
203
|
}>;
|
|
204
|
+
/**
|
|
205
|
+
* Returns the full history as fetched from the chain for a specific signer
|
|
206
|
+
*
|
|
207
|
+
* @param signer
|
|
208
|
+
* @param startBlockheight
|
|
209
|
+
*/
|
|
210
|
+
getHistoricalSwaps?(signer: string, startBlockheight?: number): Promise<{
|
|
211
|
+
swaps: {
|
|
212
|
+
[escrowHash: string]: {
|
|
213
|
+
data?: T;
|
|
214
|
+
state: SwapCommitState;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
latestBlockheight: number;
|
|
218
|
+
}>;
|
|
204
219
|
/**
|
|
205
220
|
* Checks whether a given swap is refundable by us, i.e. it is already expired, we are offerer & swap is committed on-chain
|
|
206
221
|
*
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import {Message} from "./messages/Message";
|
|
|
3
3
|
export interface Messenger {
|
|
4
4
|
|
|
5
5
|
init(): Promise<void>;
|
|
6
|
+
warmup?(): Promise<void>;
|
|
6
7
|
broadcast(msg: Message): Promise<void>;
|
|
7
8
|
subscribe(callback: (msg: Message) => void): Promise<void>;
|
|
8
9
|
unsubscribe(callback: (msg: Message) => void): Promise<boolean>;
|
|
@@ -245,6 +245,17 @@ export interface SwapContract<
|
|
|
245
245
|
*/
|
|
246
246
|
getCommitStatuses(request: {signer: string, swapData: T}[]): Promise<{[escrowHash: string]: SwapCommitState}>;
|
|
247
247
|
|
|
248
|
+
/**
|
|
249
|
+
* Returns the full history as fetched from the chain for a specific signer
|
|
250
|
+
*
|
|
251
|
+
* @param signer
|
|
252
|
+
* @param startBlockheight
|
|
253
|
+
*/
|
|
254
|
+
getHistoricalSwaps?(signer: string, startBlockheight?: number): Promise<{
|
|
255
|
+
swaps: {[escrowHash: string]: {data?: T, state: SwapCommitState}},
|
|
256
|
+
latestBlockheight: number
|
|
257
|
+
}>;
|
|
258
|
+
|
|
248
259
|
/**
|
|
249
260
|
* Checks whether a given swap is refundable by us, i.e. it is already expired, we are offerer & swap is committed on-chain
|
|
250
261
|
*
|