@atomiqlabs/base 10.0.0-dev.2 → 10.0.0-dev.3
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/LICENSE +201 -201
- package/dist/btc/BitcoinNetwork.d.ts +6 -6
- package/dist/btc/BitcoinNetwork.js +10 -10
- package/dist/btc/rpc/BitcoinRpc.d.ts +68 -68
- package/dist/btc/rpc/BitcoinRpc.js +2 -2
- package/dist/btcrelay/BtcRelay.d.ts +61 -61
- package/dist/btcrelay/BtcRelay.js +2 -2
- package/dist/btcrelay/synchronizer/RelaySynchronizer.d.ts +18 -18
- package/dist/btcrelay/synchronizer/RelaySynchronizer.js +2 -2
- package/dist/btcrelay/types/BtcBlock.d.ts +13 -13
- package/dist/btcrelay/types/BtcBlock.js +2 -2
- package/dist/btcrelay/types/BtcHeader.d.ts +10 -10
- package/dist/btcrelay/types/BtcHeader.js +2 -2
- package/dist/btcrelay/types/BtcStoredHeader.d.ts +11 -11
- package/dist/btcrelay/types/BtcStoredHeader.js +2 -2
- package/dist/btcrelay/utils/StatePredictorUtils.d.ts +11 -11
- package/dist/btcrelay/utils/StatePredictorUtils.js +80 -80
- package/dist/chains/ChainData.d.ts +31 -31
- package/dist/chains/ChainData.js +2 -2
- package/dist/chains/ChainInterface.d.ts +110 -110
- package/dist/chains/ChainInterface.js +2 -2
- package/dist/chains/ChainType.d.ts +23 -23
- package/dist/chains/ChainType.js +2 -2
- package/dist/errors/CannotInitializeATAError.d.ts +3 -3
- package/dist/errors/CannotInitializeATAError.js +11 -11
- package/dist/errors/SignatureVerificationError.d.ts +3 -3
- package/dist/errors/SignatureVerificationError.js +11 -11
- package/dist/errors/SwapDataVerificationError.d.ts +3 -3
- package/dist/errors/SwapDataVerificationError.js +11 -11
- package/dist/events/ChainEvents.d.ts +9 -9
- package/dist/events/ChainEvents.js +2 -2
- package/dist/events/types/ChainEvent.d.ts +7 -7
- package/dist/events/types/ChainEvent.js +6 -6
- package/dist/events/types/spv_vault/SpvVaultClaimEvent.d.ts +12 -12
- package/dist/events/types/spv_vault/SpvVaultClaimEvent.js +18 -18
- package/dist/events/types/spv_vault/SpvVaultCloseEvent.d.ts +7 -7
- package/dist/events/types/spv_vault/SpvVaultCloseEvent.js +13 -13
- package/dist/events/types/spv_vault/SpvVaultDepositEvent.d.ts +7 -7
- package/dist/events/types/spv_vault/SpvVaultDepositEvent.js +13 -13
- package/dist/events/types/spv_vault/SpvVaultEvent.d.ts +15 -15
- package/dist/events/types/spv_vault/SpvVaultEvent.js +20 -20
- package/dist/events/types/spv_vault/SpvVaultFrontEvent.d.ts +10 -10
- package/dist/events/types/spv_vault/SpvVaultFrontEvent.js +16 -16
- package/dist/events/types/spv_vault/SpvVaultOpenEvent.d.ts +7 -7
- package/dist/events/types/spv_vault/SpvVaultOpenEvent.js +13 -13
- package/dist/events/types/swap/ClaimEvent.d.ts +7 -7
- package/dist/events/types/swap/ClaimEvent.js +11 -11
- package/dist/events/types/swap/InitializeEvent.d.ts +9 -9
- package/dist/events/types/swap/InitializeEvent.js +12 -12
- package/dist/events/types/swap/RefundEvent.d.ts +5 -5
- package/dist/events/types/swap/RefundEvent.js +7 -7
- package/dist/events/types/swap/SwapEvent.d.ts +12 -12
- package/dist/events/types/swap/SwapEvent.js +17 -17
- package/dist/index.d.ts +41 -38
- package/dist/index.js +57 -54
- package/dist/lockable/Lockable.d.ts +6 -6
- package/dist/lockable/Lockable.js +28 -28
- package/dist/messaging/EventMessaging.d.ts +8 -0
- package/dist/messaging/EventMessaging.js +2 -0
- package/dist/messaging/Messenger.d.ts +8 -0
- package/dist/messaging/Messenger.js +2 -0
- package/dist/messaging/messages/Message.d.ts +8 -0
- package/dist/messaging/messages/Message.js +24 -0
- package/dist/messaging/messages/SwapClaimWitnessMessage.d.ts +13 -0
- package/dist/messaging/messages/SwapClaimWitnessMessage.js +26 -0
- package/dist/spv_swap/SpvVaultContract.d.ts +199 -199
- package/dist/spv_swap/SpvVaultContract.js +2 -2
- package/dist/spv_swap/SpvVaultData.d.ts +35 -35
- package/dist/spv_swap/SpvVaultData.js +37 -37
- package/dist/spv_swap/SpvWithdrawalState.d.ts +31 -31
- package/dist/spv_swap/SpvWithdrawalState.js +10 -10
- package/dist/spv_swap/SpvWithdrawalTransactionData.d.ts +43 -43
- package/dist/spv_swap/SpvWithdrawalTransactionData.js +143 -143
- package/dist/storage/IStorageManager.d.ts +15 -15
- package/dist/storage/IStorageManager.js +2 -2
- package/dist/storage/StorageObject.d.ts +3 -3
- package/dist/storage/StorageObject.js +2 -2
- package/dist/swaps/ChainSwapType.d.ts +6 -6
- package/dist/swaps/ChainSwapType.js +10 -10
- package/dist/swaps/SwapCommitState.d.ts +38 -38
- package/dist/swaps/SwapCommitState.js +11 -11
- package/dist/swaps/SwapContract.d.ts +467 -467
- package/dist/swaps/SwapContract.js +2 -2
- package/dist/swaps/SwapData.d.ts +36 -36
- package/dist/swaps/SwapData.js +14 -14
- package/dist/utils/BigIntBufferUtils.d.ts +6 -6
- package/dist/utils/BigIntBufferUtils.js +31 -31
- package/package.json +31 -31
- package/src/btc/BitcoinNetwork.ts +6 -6
- package/src/btc/rpc/BitcoinRpc.ts +77 -77
- package/src/btcrelay/BtcRelay.ts +70 -70
- package/src/btcrelay/synchronizer/RelaySynchronizer.ts +17 -17
- package/src/btcrelay/types/BtcBlock.ts +15 -15
- package/src/btcrelay/types/BtcHeader.ts +11 -11
- package/src/btcrelay/types/BtcStoredHeader.ts +12 -12
- package/src/btcrelay/utils/StatePredictorUtils.ts +108 -108
- package/src/chains/ChainData.ts +40 -40
- package/src/chains/ChainInterface.ts +132 -132
- package/src/chains/ChainType.ts +38 -38
- package/src/errors/CannotInitializeATAError.ts +11 -11
- package/src/errors/SignatureVerificationError.ts +11 -11
- package/src/errors/SwapDataVerificationError.ts +11 -11
- package/src/events/ChainEvents.ts +13 -13
- package/src/events/types/ChainEvent.ts +10 -10
- package/src/events/types/spv_vault/SpvVaultClaimEvent.ts +31 -31
- package/src/events/types/spv_vault/SpvVaultCloseEvent.ts +17 -17
- package/src/events/types/spv_vault/SpvVaultDepositEvent.ts +17 -17
- package/src/events/types/spv_vault/SpvVaultEvent.ts +25 -25
- package/src/events/types/spv_vault/SpvVaultFrontEvent.ts +27 -27
- package/src/events/types/spv_vault/SpvVaultOpenEvent.ts +16 -16
- package/src/events/types/swap/ClaimEvent.ts +15 -15
- package/src/events/types/swap/InitializeEvent.ts +18 -18
- package/src/events/types/swap/RefundEvent.ts +6 -6
- package/src/events/types/swap/SwapEvent.ts +21 -21
- package/src/index.ts +50 -46
- package/src/lockable/Lockable.ts +30 -30
- package/src/messaging/Messenger.ts +11 -0
- package/src/messaging/messages/Message.ts +27 -0
- package/src/messaging/messages/SwapClaimWitnessMessage.ts +31 -0
- package/src/spv_swap/SpvVaultContract.ts +230 -230
- package/src/spv_swap/SpvVaultData.ts +70 -70
- package/src/spv_swap/SpvWithdrawalState.ts +40 -40
- package/src/spv_swap/SpvWithdrawalTransactionData.ts +169 -169
- package/src/storage/IStorageManager.ts +16 -16
- package/src/storage/StorageObject.ts +6 -6
- package/src/swaps/ChainSwapType.ts +6 -6
- package/src/swaps/SwapCommitState.ts +39 -39
- package/src/swaps/SwapContract.ts +556 -556
- package/src/swaps/SwapData.ts +65 -65
- package/src/utils/BigIntBufferUtils.ts +31 -31
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
export enum SwapCommitStateType {
|
|
2
|
-
EXPIRED=0,
|
|
3
|
-
NOT_COMMITED=1,
|
|
4
|
-
COMMITED=2,
|
|
5
|
-
PAID=3,
|
|
6
|
-
REFUNDABLE=4
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type SwapNotCommitedState = {
|
|
10
|
-
type: SwapCommitStateType.NOT_COMMITED,
|
|
11
|
-
getRefundTxId?: () => Promise<string>,
|
|
12
|
-
getTxBlock?: () => Promise<{blockHeight: number, blockTime: number}>
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type SwapExpiredState = {
|
|
16
|
-
type: SwapCommitStateType.EXPIRED,
|
|
17
|
-
getRefundTxId?: () => Promise<string>,
|
|
18
|
-
getTxBlock?: () => Promise<{blockHeight: number, blockTime: number}>
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type SwapRefundableState = {
|
|
22
|
-
type: SwapCommitStateType.REFUNDABLE
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type SwapCommitedState = {
|
|
26
|
-
type: SwapCommitStateType.COMMITED
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type SwapPaidState = {
|
|
30
|
-
type: SwapCommitStateType.PAID,
|
|
31
|
-
getClaimTxId: () => Promise<string>,
|
|
32
|
-
getTxBlock: () => Promise<{blockHeight: number, blockTime: number}>
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type SwapCommitState = SwapNotCommitedState |
|
|
36
|
-
SwapExpiredState |
|
|
37
|
-
SwapRefundableState |
|
|
38
|
-
SwapCommitedState |
|
|
39
|
-
SwapPaidState;
|
|
1
|
+
export enum SwapCommitStateType {
|
|
2
|
+
EXPIRED=0,
|
|
3
|
+
NOT_COMMITED=1,
|
|
4
|
+
COMMITED=2,
|
|
5
|
+
PAID=3,
|
|
6
|
+
REFUNDABLE=4
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type SwapNotCommitedState = {
|
|
10
|
+
type: SwapCommitStateType.NOT_COMMITED,
|
|
11
|
+
getRefundTxId?: () => Promise<string>,
|
|
12
|
+
getTxBlock?: () => Promise<{blockHeight: number, blockTime: number}>
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type SwapExpiredState = {
|
|
16
|
+
type: SwapCommitStateType.EXPIRED,
|
|
17
|
+
getRefundTxId?: () => Promise<string>,
|
|
18
|
+
getTxBlock?: () => Promise<{blockHeight: number, blockTime: number}>
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type SwapRefundableState = {
|
|
22
|
+
type: SwapCommitStateType.REFUNDABLE
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type SwapCommitedState = {
|
|
26
|
+
type: SwapCommitStateType.COMMITED
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type SwapPaidState = {
|
|
30
|
+
type: SwapCommitStateType.PAID,
|
|
31
|
+
getClaimTxId: () => Promise<string>,
|
|
32
|
+
getTxBlock: () => Promise<{blockHeight: number, blockTime: number}>
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type SwapCommitState = SwapNotCommitedState |
|
|
36
|
+
SwapExpiredState |
|
|
37
|
+
SwapRefundableState |
|
|
38
|
+
SwapCommitedState |
|
|
39
|
+
SwapPaidState;
|