@atomiqlabs/base 13.1.9 → 13.1.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.
- package/dist/btc/lightning/LightningNetworkApi.d.ts +2 -2
- package/dist/btcrelay/BtcRelay.d.ts +1 -1
- package/dist/btcrelay/synchronizer/RelaySynchronizer.d.ts +1 -1
- package/dist/btcrelay/types/BtcHeader.d.ts +1 -1
- package/dist/btcrelay/types/BtcStoredHeader.d.ts +1 -1
- package/dist/chains/ChainInterface.d.ts +6 -2
- package/dist/events/ChainEvents.d.ts +2 -2
- package/dist/spv_swap/SpvVaultContract.d.ts +1 -1
- package/dist/spv_swap/SpvVaultData.d.ts +3 -3
- package/dist/spv_swap/SpvVaultData.js +1 -1
- package/dist/spv_swap/SpvWithdrawalState.d.ts +1 -1
- package/dist/spv_swap/SpvWithdrawalState.js +1 -1
- package/dist/spv_swap/SpvWithdrawalTransactionData.d.ts +3 -1
- package/dist/spv_swap/SpvWithdrawalTransactionData.js +1 -1
- package/dist/swaps/ChainSwapType.d.ts +1 -1
- package/dist/swaps/ChainSwapType.js +1 -1
- package/dist/swaps/SwapCommitState.d.ts +1 -1
- package/dist/swaps/SwapCommitState.js +1 -1
- package/dist/swaps/SwapContract.d.ts +1 -1
- package/dist/swaps/SwapData.d.ts +1 -1
- package/dist/swaps/SwapData.js +1 -1
- package/package.json +1 -1
- package/src/btc/lightning/LightningNetworkApi.ts +2 -2
- package/src/btcrelay/BtcRelay.ts +1 -1
- package/src/btcrelay/synchronizer/RelaySynchronizer.ts +1 -1
- package/src/btcrelay/types/BtcHeader.ts +1 -1
- package/src/btcrelay/types/BtcStoredHeader.ts +1 -1
- package/src/chains/ChainInterface.ts +5 -2
- package/src/events/ChainEvents.ts +2 -2
- package/src/spv_swap/SpvVaultContract.ts +1 -1
- package/src/spv_swap/SpvVaultData.ts +3 -3
- package/src/spv_swap/SpvWithdrawalState.ts +1 -1
- package/src/spv_swap/SpvWithdrawalTransactionData.ts +3 -1
- package/src/swaps/ChainSwapType.ts +1 -1
- package/src/swaps/SwapCommitState.ts +1 -1
- package/src/swaps/SwapContract.ts +1 -1
- package/src/swaps/SwapData.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A type defining total capacity of a given lightning network node
|
|
3
3
|
*
|
|
4
|
-
* @category
|
|
4
|
+
* @category Lightning
|
|
5
5
|
*/
|
|
6
6
|
export type LNNodeLiquidity = {
|
|
7
7
|
publicKey: string;
|
|
@@ -11,7 +11,7 @@ export type LNNodeLiquidity = {
|
|
|
11
11
|
/**
|
|
12
12
|
* An interface for Lightning API, provides view of the public lightning network data like channel graph
|
|
13
13
|
*
|
|
14
|
-
* @category
|
|
14
|
+
* @category Lightning
|
|
15
15
|
*/
|
|
16
16
|
export interface LightningNetworkApi {
|
|
17
17
|
/**
|
|
@@ -6,7 +6,7 @@ import { AbstractSigner } from "../chains/ChainInterface";
|
|
|
6
6
|
/**
|
|
7
7
|
* Represents a BTC relay bitcoin light client contract, which verifies the bitcoin blockheaders on smart chains
|
|
8
8
|
*
|
|
9
|
-
* @category
|
|
9
|
+
* @category Chains
|
|
10
10
|
*/
|
|
11
11
|
export interface BtcRelay<V extends BtcStoredHeader<any>, T, B extends BtcBlock, Signer extends AbstractSigner = AbstractSigner> {
|
|
12
12
|
/**
|
|
@@ -43,7 +43,7 @@ export type SynchronizationResponse<V extends BtcStoredHeader<any>, T, B extends
|
|
|
43
43
|
* necessary to synchronize the underlying relay contract to the current tip of the canonical chain,
|
|
44
44
|
* automatically handles forking if necessary
|
|
45
45
|
*
|
|
46
|
-
* @category
|
|
46
|
+
* @category Chains
|
|
47
47
|
*/
|
|
48
48
|
export interface RelaySynchronizer<V extends BtcStoredHeader<any>, T, B extends BtcBlock> {
|
|
49
49
|
/**
|
|
@@ -5,7 +5,7 @@ import { Buffer } from "buffer";
|
|
|
5
5
|
* Represents a bitcoin blockheader that has already been synchronized and saved (committed) in the BTC relay
|
|
6
6
|
* contract
|
|
7
7
|
*
|
|
8
|
-
* @category
|
|
8
|
+
* @category Chains
|
|
9
9
|
*/
|
|
10
10
|
export interface BtcStoredHeader<T extends BtcHeader> {
|
|
11
11
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
/**
|
|
2
|
-
* @category
|
|
3
|
+
* @category Chains
|
|
3
4
|
*/
|
|
4
5
|
export type TransactionConfirmationOptions = {
|
|
5
6
|
waitForConfirmation?: boolean;
|
|
@@ -10,11 +11,12 @@ export type TransactionConfirmationOptions = {
|
|
|
10
11
|
* Defines of a signer, contains an address getter and optionally init() & stop() functions
|
|
11
12
|
* to initiate internal processes inside the signer (if required and exposed)
|
|
12
13
|
*
|
|
13
|
-
* @category
|
|
14
|
+
* @category Chains
|
|
14
15
|
*/
|
|
15
16
|
export type AbstractSigner = {
|
|
16
17
|
type: "AtomiqAbstractSigner";
|
|
17
18
|
getAddress: () => string;
|
|
19
|
+
getReproducibleEntropy?: (appName: string) => Buffer;
|
|
18
20
|
init?: () => Promise<void>;
|
|
19
21
|
stop?: () => Promise<void>;
|
|
20
22
|
};
|
|
@@ -26,6 +28,8 @@ export type AbstractSigner = {
|
|
|
26
28
|
export declare function isAbstractSigner(val: any): val is AbstractSigner;
|
|
27
29
|
/**
|
|
28
30
|
* An interface representing a smart chain, allowing basic operations on the chain and reading chain data
|
|
31
|
+
*
|
|
32
|
+
* @category Chains
|
|
29
33
|
*/
|
|
30
34
|
export interface ChainInterface<TX = any, SignedTX = any, Signer extends AbstractSigner = AbstractSigner, ChainId extends string = string, NativeSigner = any> {
|
|
31
35
|
/**
|
|
@@ -3,13 +3,13 @@ import { ChainEvent } from "./types/ChainEvent";
|
|
|
3
3
|
/**
|
|
4
4
|
* A type of the on-chain event listener callback
|
|
5
5
|
*
|
|
6
|
-
* @category
|
|
6
|
+
* @category Chains
|
|
7
7
|
*/
|
|
8
8
|
export type EventListener<T extends SwapData> = (obj: ChainEvent<T>[]) => Promise<boolean>;
|
|
9
9
|
/**
|
|
10
10
|
* An interface defining an on-chain events listener, allowing registering callbacks to receive on-chain events
|
|
11
11
|
*
|
|
12
|
-
* @category
|
|
12
|
+
* @category Chains
|
|
13
13
|
*/
|
|
14
14
|
export interface ChainEvents<T extends SwapData, S extends any = any> {
|
|
15
15
|
/**
|
|
@@ -10,7 +10,7 @@ import { BtcTx } from "../btc/rpc/BitcoinRpc";
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an SPV vault (UTXO-controlled vault) contract, exposes operations on the vaults
|
|
12
12
|
*
|
|
13
|
-
* @category
|
|
13
|
+
* @category Chains
|
|
14
14
|
*/
|
|
15
15
|
export interface SpvVaultContract<TX = any, Signer extends AbstractSigner = AbstractSigner, ChainId extends string = string, WithdrawalTX extends SpvWithdrawalTransactionData = SpvWithdrawalTransactionData, Data extends SpvVaultData<WithdrawalTX> = SpvVaultData<WithdrawalTX>> {
|
|
16
16
|
/**
|
|
@@ -7,7 +7,7 @@ import { SpvVaultDepositEvent } from "../events/types/spv_vault/SpvVaultDepositE
|
|
|
7
7
|
/**
|
|
8
8
|
* Balance for a specific token inside a vault
|
|
9
9
|
*
|
|
10
|
-
* @category
|
|
10
|
+
* @category Chains
|
|
11
11
|
*/
|
|
12
12
|
export type SpvVaultTokenBalance = SpvVaultTokenData & {
|
|
13
13
|
/**
|
|
@@ -22,7 +22,7 @@ export type SpvVaultTokenBalance = SpvVaultTokenData & {
|
|
|
22
22
|
/**
|
|
23
23
|
* Configuration for a specific token inside an SPV vault (UTXO-controlled vault)
|
|
24
24
|
*
|
|
25
|
-
* @category
|
|
25
|
+
* @category Chains
|
|
26
26
|
*/
|
|
27
27
|
export type SpvVaultTokenData = {
|
|
28
28
|
/**
|
|
@@ -37,7 +37,7 @@ export type SpvVaultTokenData = {
|
|
|
37
37
|
/**
|
|
38
38
|
* Represents the state of a single SPV vault (UTXO-controlled vault)
|
|
39
39
|
*
|
|
40
|
-
* @category
|
|
40
|
+
* @category Chains
|
|
41
41
|
*/
|
|
42
42
|
export declare abstract class SpvVaultData<T extends SpvWithdrawalTransactionData = SpvWithdrawalTransactionData> implements StorageObject {
|
|
43
43
|
/**
|
|
@@ -4,6 +4,8 @@ import { Buffer } from "buffer";
|
|
|
4
4
|
import { StorageObject } from "../storage/StorageObject";
|
|
5
5
|
/**
|
|
6
6
|
* Execution data assigned to the withdrawal
|
|
7
|
+
*
|
|
8
|
+
* @category Chains
|
|
7
9
|
*/
|
|
8
10
|
export type ExecutionData = {
|
|
9
11
|
executionHash: string;
|
|
@@ -12,7 +14,7 @@ export type ExecutionData = {
|
|
|
12
14
|
/**
|
|
13
15
|
* Represents the data of a single SPV vault (UTXO-controlled) vault withdrawal
|
|
14
16
|
*
|
|
15
|
-
* @category
|
|
17
|
+
* @category Chains
|
|
16
18
|
*/
|
|
17
19
|
export declare abstract class SpvWithdrawalTransactionData implements StorageObject {
|
|
18
20
|
/**
|
|
@@ -55,7 +55,7 @@ export type BitcoinTransactionData = {
|
|
|
55
55
|
/**
|
|
56
56
|
* A contract for interacting with escrow manager swaps - escrow based swaps like HTLCs and PrTLCs
|
|
57
57
|
*
|
|
58
|
-
* @category
|
|
58
|
+
* @category Chains
|
|
59
59
|
*/
|
|
60
60
|
export interface SwapContract<T extends SwapData = SwapData, TX = any, PreFetchData = any, PreFetchVerification = any, Signer extends AbstractSigner = AbstractSigner, ChainId extends string = string> {
|
|
61
61
|
/**
|
package/dist/swaps/SwapData.d.ts
CHANGED
package/dist/swaps/SwapData.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* A type defining total capacity of a given lightning network node
|
|
4
4
|
*
|
|
5
|
-
* @category
|
|
5
|
+
* @category Lightning
|
|
6
6
|
*/
|
|
7
7
|
export type LNNodeLiquidity = {
|
|
8
8
|
publicKey: string,
|
|
@@ -13,7 +13,7 @@ export type LNNodeLiquidity = {
|
|
|
13
13
|
/**
|
|
14
14
|
* An interface for Lightning API, provides view of the public lightning network data like channel graph
|
|
15
15
|
*
|
|
16
|
-
* @category
|
|
16
|
+
* @category Lightning
|
|
17
17
|
*/
|
|
18
18
|
export interface LightningNetworkApi {
|
|
19
19
|
|
package/src/btcrelay/BtcRelay.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {AbstractSigner} from "../chains/ChainInterface";
|
|
|
6
6
|
/**
|
|
7
7
|
* Represents a BTC relay bitcoin light client contract, which verifies the bitcoin blockheaders on smart chains
|
|
8
8
|
*
|
|
9
|
-
* @category
|
|
9
|
+
* @category Chains
|
|
10
10
|
*/
|
|
11
11
|
export interface BtcRelay<
|
|
12
12
|
V extends BtcStoredHeader<any>,
|
|
@@ -41,7 +41,7 @@ export type SynchronizationResponse<V extends BtcStoredHeader<any>, T, B extends
|
|
|
41
41
|
* necessary to synchronize the underlying relay contract to the current tip of the canonical chain,
|
|
42
42
|
* automatically handles forking if necessary
|
|
43
43
|
*
|
|
44
|
-
* @category
|
|
44
|
+
* @category Chains
|
|
45
45
|
*/
|
|
46
46
|
export interface RelaySynchronizer<V extends BtcStoredHeader<any>, T, B extends BtcBlock> {
|
|
47
47
|
|
|
@@ -5,7 +5,7 @@ import {Buffer} from "buffer";
|
|
|
5
5
|
* Represents a bitcoin blockheader that has already been synchronized and saved (committed) in the BTC relay
|
|
6
6
|
* contract
|
|
7
7
|
*
|
|
8
|
-
* @category
|
|
8
|
+
* @category Chains
|
|
9
9
|
*/
|
|
10
10
|
export interface BtcStoredHeader<T extends BtcHeader> {
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @category
|
|
2
|
+
* @category Chains
|
|
3
3
|
*/
|
|
4
4
|
export type TransactionConfirmationOptions = {
|
|
5
5
|
waitForConfirmation?: boolean,
|
|
@@ -11,11 +11,12 @@ export type TransactionConfirmationOptions = {
|
|
|
11
11
|
* Defines of a signer, contains an address getter and optionally init() & stop() functions
|
|
12
12
|
* to initiate internal processes inside the signer (if required and exposed)
|
|
13
13
|
*
|
|
14
|
-
* @category
|
|
14
|
+
* @category Chains
|
|
15
15
|
*/
|
|
16
16
|
export type AbstractSigner = {
|
|
17
17
|
type: "AtomiqAbstractSigner",
|
|
18
18
|
getAddress: () => string,
|
|
19
|
+
getReproducibleEntropy?: (appName: string) => Buffer,
|
|
19
20
|
init?: () => Promise<void>,
|
|
20
21
|
stop?: () => Promise<void>
|
|
21
22
|
};
|
|
@@ -31,6 +32,8 @@ export function isAbstractSigner(val: any): val is AbstractSigner {
|
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* An interface representing a smart chain, allowing basic operations on the chain and reading chain data
|
|
35
|
+
*
|
|
36
|
+
* @category Chains
|
|
34
37
|
*/
|
|
35
38
|
export interface ChainInterface<
|
|
36
39
|
TX = any,
|
|
@@ -4,14 +4,14 @@ import {ChainEvent} from "./types/ChainEvent";
|
|
|
4
4
|
/**
|
|
5
5
|
* A type of the on-chain event listener callback
|
|
6
6
|
*
|
|
7
|
-
* @category
|
|
7
|
+
* @category Chains
|
|
8
8
|
*/
|
|
9
9
|
export type EventListener<T extends SwapData> = (obj: ChainEvent<T>[]) => Promise<boolean>;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* An interface defining an on-chain events listener, allowing registering callbacks to receive on-chain events
|
|
13
13
|
*
|
|
14
|
-
* @category
|
|
14
|
+
* @category Chains
|
|
15
15
|
*/
|
|
16
16
|
export interface ChainEvents<T extends SwapData, S extends any = any> {
|
|
17
17
|
|
|
@@ -8,7 +8,7 @@ import {SpvVaultDepositEvent} from "../events/types/spv_vault/SpvVaultDepositEve
|
|
|
8
8
|
/**
|
|
9
9
|
* Balance for a specific token inside a vault
|
|
10
10
|
*
|
|
11
|
-
* @category
|
|
11
|
+
* @category Chains
|
|
12
12
|
*/
|
|
13
13
|
export type SpvVaultTokenBalance = SpvVaultTokenData & {
|
|
14
14
|
/**
|
|
@@ -24,7 +24,7 @@ export type SpvVaultTokenBalance = SpvVaultTokenData & {
|
|
|
24
24
|
/**
|
|
25
25
|
* Configuration for a specific token inside an SPV vault (UTXO-controlled vault)
|
|
26
26
|
*
|
|
27
|
-
* @category
|
|
27
|
+
* @category Chains
|
|
28
28
|
*/
|
|
29
29
|
export type SpvVaultTokenData = {
|
|
30
30
|
/**
|
|
@@ -40,7 +40,7 @@ export type SpvVaultTokenData = {
|
|
|
40
40
|
/**
|
|
41
41
|
* Represents the state of a single SPV vault (UTXO-controlled vault)
|
|
42
42
|
*
|
|
43
|
-
* @category
|
|
43
|
+
* @category Chains
|
|
44
44
|
*/
|
|
45
45
|
export abstract class SpvVaultData<T extends SpvWithdrawalTransactionData = SpvWithdrawalTransactionData> implements StorageObject {
|
|
46
46
|
|
|
@@ -4,6 +4,8 @@ import {StorageObject} from "../storage/StorageObject";
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Execution data assigned to the withdrawal
|
|
7
|
+
*
|
|
8
|
+
* @category Chains
|
|
7
9
|
*/
|
|
8
10
|
export type ExecutionData = {
|
|
9
11
|
executionHash: string,
|
|
@@ -13,7 +15,7 @@ export type ExecutionData = {
|
|
|
13
15
|
/**
|
|
14
16
|
* Represents the data of a single SPV vault (UTXO-controlled) vault withdrawal
|
|
15
17
|
*
|
|
16
|
-
* @category
|
|
18
|
+
* @category Chains
|
|
17
19
|
*/
|
|
18
20
|
export abstract class SpvWithdrawalTransactionData implements StorageObject {
|
|
19
21
|
|
|
@@ -58,7 +58,7 @@ export type BitcoinTransactionData = {
|
|
|
58
58
|
/**
|
|
59
59
|
* A contract for interacting with escrow manager swaps - escrow based swaps like HTLCs and PrTLCs
|
|
60
60
|
*
|
|
61
|
-
* @category
|
|
61
|
+
* @category Chains
|
|
62
62
|
*/
|
|
63
63
|
export interface SwapContract<
|
|
64
64
|
T extends SwapData = SwapData,
|