@atomiqlabs/base 10.0.0-dev.10 → 10.0.0-dev.13
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.
|
@@ -111,6 +111,18 @@ export interface SpvVaultContract<TX = any, Signer extends AbstractSigner = Abst
|
|
|
111
111
|
* @param withdrawal Withdrawal transaction to check the fronting for
|
|
112
112
|
*/
|
|
113
113
|
getFronterAddress(owner: string, vaultId: bigint, withdrawal: WithdrawalTX): Promise<string | null>;
|
|
114
|
+
/**
|
|
115
|
+
* Returns the parties which currently fronted the withdrawal transactions
|
|
116
|
+
*
|
|
117
|
+
* @param withdrawals withdrawals to query
|
|
118
|
+
*/
|
|
119
|
+
getFronterAddresses(withdrawals: {
|
|
120
|
+
owner: string;
|
|
121
|
+
vaultId: bigint;
|
|
122
|
+
withdrawal: WithdrawalTX;
|
|
123
|
+
}[]): Promise<{
|
|
124
|
+
[btcTxId: string]: string | null;
|
|
125
|
+
}>;
|
|
114
126
|
/**
|
|
115
127
|
* Returns current vault data
|
|
116
128
|
*
|
|
@@ -118,6 +130,39 @@ export interface SpvVaultContract<TX = any, Signer extends AbstractSigner = Abst
|
|
|
118
130
|
* @param vaultId Vault ID
|
|
119
131
|
*/
|
|
120
132
|
getVaultData(owner: string, vaultId: bigint): Promise<Data>;
|
|
133
|
+
/**
|
|
134
|
+
* Returns current vault data for multiple vaults
|
|
135
|
+
*
|
|
136
|
+
* @param vaults Vault data to query
|
|
137
|
+
*/
|
|
138
|
+
getMultipleVaultData(vaults: {
|
|
139
|
+
owner: string;
|
|
140
|
+
vaultId: bigint;
|
|
141
|
+
}[]): Promise<{
|
|
142
|
+
[owner: string]: {
|
|
143
|
+
[vaultId: string]: Data;
|
|
144
|
+
};
|
|
145
|
+
}>;
|
|
146
|
+
/**
|
|
147
|
+
* Returns the latest utxo of a vault (or null if vault closed or not found)
|
|
148
|
+
*
|
|
149
|
+
* @param owner Owner of the vault
|
|
150
|
+
* @param vaultId Vault ID
|
|
151
|
+
*/
|
|
152
|
+
getVaultLatestUtxo(owner: string, vaultId: bigint): Promise<string | null>;
|
|
153
|
+
/**
|
|
154
|
+
* Returns the latest utxos of for multiple vaults (or null if vault closed or not found)
|
|
155
|
+
*
|
|
156
|
+
* @param vaults Vault data to query
|
|
157
|
+
*/
|
|
158
|
+
getVaultLatestUtxos(vaults: {
|
|
159
|
+
owner: string;
|
|
160
|
+
vaultId: bigint;
|
|
161
|
+
}[]): Promise<{
|
|
162
|
+
[owner: string]: {
|
|
163
|
+
[vaultId: string]: string | null;
|
|
164
|
+
};
|
|
165
|
+
}>;
|
|
121
166
|
/**
|
|
122
167
|
* Returns all currently opened vaults
|
|
123
168
|
* NOTE: This will take a long time, since the implementation will have to go through all the prior events
|
|
@@ -129,6 +174,14 @@ export interface SpvVaultContract<TX = any, Signer extends AbstractSigner = Abst
|
|
|
129
174
|
* @param btcTxId
|
|
130
175
|
*/
|
|
131
176
|
getWithdrawalState(btcTxId: string): Promise<SpvWithdrawalState>;
|
|
177
|
+
/**
|
|
178
|
+
* Returns current state of the withdrawals as specified by the bitcoin transaction IDs
|
|
179
|
+
*
|
|
180
|
+
* @param btcTxIds
|
|
181
|
+
*/
|
|
182
|
+
getWithdrawalStates(btcTxIds: string[]): Promise<{
|
|
183
|
+
[btcTxId: string]: SpvWithdrawalState;
|
|
184
|
+
}>;
|
|
132
185
|
/**
|
|
133
186
|
* Parses withdrawal data from the parsed bitcoin transaction
|
|
134
187
|
*
|
|
@@ -190,6 +190,17 @@ export interface SwapContract<T extends SwapData = SwapData, TX = any, PreFetchD
|
|
|
190
190
|
* @param swapData
|
|
191
191
|
*/
|
|
192
192
|
getCommitStatus(signer: string, swapData: T): Promise<SwapCommitState>;
|
|
193
|
+
/**
|
|
194
|
+
* Returns the full status of the passed swaps, expiry is handled by the isExpired function so also requires a signer/sender
|
|
195
|
+
*
|
|
196
|
+
* @param request
|
|
197
|
+
*/
|
|
198
|
+
getCommitStatuses(request: {
|
|
199
|
+
signer: string;
|
|
200
|
+
swapData: T;
|
|
201
|
+
}[]): Promise<{
|
|
202
|
+
[escrowHash: string]: SwapCommitState;
|
|
203
|
+
}>;
|
|
193
204
|
/**
|
|
194
205
|
* Checks whether a given swap is refundable by us, i.e. it is already expired, we are offerer & swap is committed on-chain
|
|
195
206
|
*
|
package/package.json
CHANGED
|
@@ -136,6 +136,13 @@ export interface SpvVaultContract<
|
|
|
136
136
|
*/
|
|
137
137
|
getFronterAddress(owner: string, vaultId: bigint, withdrawal: WithdrawalTX): Promise<string | null>;
|
|
138
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Returns the parties which currently fronted the withdrawal transactions
|
|
141
|
+
*
|
|
142
|
+
* @param withdrawals withdrawals to query
|
|
143
|
+
*/
|
|
144
|
+
getFronterAddresses(withdrawals: {owner: string, vaultId: bigint, withdrawal: WithdrawalTX}[]): Promise<{[btcTxId: string]: string | null}>;
|
|
145
|
+
|
|
139
146
|
/**
|
|
140
147
|
* Returns current vault data
|
|
141
148
|
*
|
|
@@ -144,6 +151,28 @@ export interface SpvVaultContract<
|
|
|
144
151
|
*/
|
|
145
152
|
getVaultData(owner: string, vaultId: bigint): Promise<Data>;
|
|
146
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Returns current vault data for multiple vaults
|
|
156
|
+
*
|
|
157
|
+
* @param vaults Vault data to query
|
|
158
|
+
*/
|
|
159
|
+
getMultipleVaultData(vaults: {owner: string, vaultId: bigint}[]): Promise<{[owner: string]: {[vaultId: string]: Data}}>;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Returns the latest utxo of a vault (or null if vault closed or not found)
|
|
163
|
+
*
|
|
164
|
+
* @param owner Owner of the vault
|
|
165
|
+
* @param vaultId Vault ID
|
|
166
|
+
*/
|
|
167
|
+
getVaultLatestUtxo(owner: string, vaultId: bigint): Promise<string | null>;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Returns the latest utxos of for multiple vaults (or null if vault closed or not found)
|
|
171
|
+
*
|
|
172
|
+
* @param vaults Vault data to query
|
|
173
|
+
*/
|
|
174
|
+
getVaultLatestUtxos(vaults: {owner: string, vaultId: bigint}[]): Promise<{[owner: string]: {[vaultId: string]: string | null}}>;
|
|
175
|
+
|
|
147
176
|
/**
|
|
148
177
|
* Returns all currently opened vaults
|
|
149
178
|
* NOTE: This will take a long time, since the implementation will have to go through all the prior events
|
|
@@ -157,6 +186,13 @@ export interface SpvVaultContract<
|
|
|
157
186
|
*/
|
|
158
187
|
getWithdrawalState(btcTxId: string): Promise<SpvWithdrawalState>;
|
|
159
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Returns current state of the withdrawals as specified by the bitcoin transaction IDs
|
|
191
|
+
*
|
|
192
|
+
* @param btcTxIds
|
|
193
|
+
*/
|
|
194
|
+
getWithdrawalStates(btcTxIds: string[]): Promise<{[btcTxId: string]: SpvWithdrawalState}>;
|
|
195
|
+
|
|
160
196
|
/**
|
|
161
197
|
* Parses withdrawal data from the parsed bitcoin transaction
|
|
162
198
|
*
|
|
@@ -238,6 +238,13 @@ export interface SwapContract<
|
|
|
238
238
|
*/
|
|
239
239
|
getCommitStatus(signer: string, swapData: T): Promise<SwapCommitState>;
|
|
240
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Returns the full status of the passed swaps, expiry is handled by the isExpired function so also requires a signer/sender
|
|
243
|
+
*
|
|
244
|
+
* @param request
|
|
245
|
+
*/
|
|
246
|
+
getCommitStatuses(request: {signer: string, swapData: T}[]): Promise<{[escrowHash: string]: SwapCommitState}>;
|
|
247
|
+
|
|
241
248
|
/**
|
|
242
249
|
* Checks whether a given swap is refundable by us, i.e. it is already expired, we are offerer & swap is committed on-chain
|
|
243
250
|
*
|