@atomiqlabs/chain-solana 13.5.13 → 13.5.14
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/README.md +73 -73
- package/dist/index.d.ts +81 -81
- package/dist/index.js +102 -102
- package/dist/node/index.d.ts +9 -9
- package/dist/node/index.js +13 -13
- package/dist/solana/SolanaChainType.d.ts +15 -15
- package/dist/solana/SolanaChainType.js +2 -2
- package/dist/solana/SolanaChains.d.ts +12 -12
- package/dist/solana/SolanaChains.js +45 -45
- package/dist/solana/SolanaInitializer.d.ts +94 -94
- package/dist/solana/SolanaInitializer.js +174 -174
- package/dist/solana/btcrelay/SolanaBtcRelay.d.ts +222 -222
- package/dist/solana/btcrelay/SolanaBtcRelay.js +455 -455
- package/dist/solana/btcrelay/headers/SolanaBtcHeader.d.ts +84 -84
- package/dist/solana/btcrelay/headers/SolanaBtcHeader.js +70 -70
- package/dist/solana/btcrelay/headers/SolanaBtcStoredHeader.d.ts +92 -92
- package/dist/solana/btcrelay/headers/SolanaBtcStoredHeader.js +109 -109
- package/dist/solana/btcrelay/program/programIdl.json +671 -671
- package/dist/solana/chain/SolanaAction.d.ts +26 -26
- package/dist/solana/chain/SolanaAction.js +87 -87
- package/dist/solana/chain/SolanaChainInterface.d.ts +224 -224
- package/dist/solana/chain/SolanaChainInterface.js +275 -275
- package/dist/solana/chain/SolanaModule.d.ts +14 -14
- package/dist/solana/chain/SolanaModule.js +13 -13
- package/dist/solana/chain/modules/SolanaAddresses.d.ts +8 -8
- package/dist/solana/chain/modules/SolanaAddresses.js +22 -22
- package/dist/solana/chain/modules/SolanaBlocks.d.ts +32 -32
- package/dist/solana/chain/modules/SolanaBlocks.js +78 -78
- package/dist/solana/chain/modules/SolanaEvents.d.ts +68 -68
- package/dist/solana/chain/modules/SolanaEvents.js +238 -238
- package/dist/solana/chain/modules/SolanaFees.d.ts +189 -189
- package/dist/solana/chain/modules/SolanaFees.js +434 -434
- package/dist/solana/chain/modules/SolanaSignatures.d.ts +24 -24
- package/dist/solana/chain/modules/SolanaSignatures.js +39 -39
- package/dist/solana/chain/modules/SolanaSlots.d.ts +33 -33
- package/dist/solana/chain/modules/SolanaSlots.js +72 -72
- package/dist/solana/chain/modules/SolanaTokens.d.ts +123 -123
- package/dist/solana/chain/modules/SolanaTokens.js +242 -242
- package/dist/solana/chain/modules/SolanaTransactions.d.ts +149 -149
- package/dist/solana/chain/modules/SolanaTransactions.js +445 -445
- package/dist/solana/connection/ConnectionWithRetries.d.ts +35 -35
- package/dist/solana/connection/ConnectionWithRetries.js +86 -71
- package/dist/solana/events/SolanaChainEvents.d.ts +45 -45
- package/dist/solana/events/SolanaChainEvents.js +108 -108
- package/dist/solana/events/SolanaChainEventsBrowser.d.ts +205 -205
- package/dist/solana/events/SolanaChainEventsBrowser.js +404 -404
- package/dist/solana/program/SolanaProgramBase.d.ts +73 -73
- package/dist/solana/program/SolanaProgramBase.js +54 -54
- package/dist/solana/program/SolanaProgramModule.d.ts +8 -8
- package/dist/solana/program/SolanaProgramModule.js +11 -11
- package/dist/solana/program/modules/SolanaProgramEvents.d.ts +53 -53
- package/dist/solana/program/modules/SolanaProgramEvents.js +117 -117
- package/dist/solana/swaps/SolanaSwapData.d.ts +333 -333
- package/dist/solana/swaps/SolanaSwapData.js +535 -535
- package/dist/solana/swaps/SolanaSwapModule.d.ts +11 -11
- package/dist/solana/swaps/SolanaSwapModule.js +12 -12
- package/dist/solana/swaps/SolanaSwapProgram.d.ts +376 -376
- package/dist/solana/swaps/SolanaSwapProgram.js +769 -769
- package/dist/solana/swaps/SwapTypeEnum.d.ts +11 -11
- package/dist/solana/swaps/SwapTypeEnum.js +43 -43
- package/dist/solana/swaps/modules/SolanaDataAccount.d.ts +95 -95
- package/dist/solana/swaps/modules/SolanaDataAccount.js +232 -232
- package/dist/solana/swaps/modules/SolanaLpVault.d.ts +69 -69
- package/dist/solana/swaps/modules/SolanaLpVault.js +171 -171
- package/dist/solana/swaps/modules/SwapClaim.d.ts +126 -126
- package/dist/solana/swaps/modules/SwapClaim.js +294 -294
- package/dist/solana/swaps/modules/SwapInit.d.ts +213 -213
- package/dist/solana/swaps/modules/SwapInit.js +658 -658
- package/dist/solana/swaps/modules/SwapRefund.d.ts +87 -87
- package/dist/solana/swaps/modules/SwapRefund.js +293 -293
- package/dist/solana/swaps/programIdl.json +945 -945
- package/dist/solana/swaps/programTypes.d.ts +943 -943
- package/dist/solana/swaps/programTypes.js +945 -945
- package/dist/solana/swaps/v1/programIdl.json +945 -945
- package/dist/solana/swaps/v1/programTypes.d.ts +943 -943
- package/dist/solana/swaps/v1/programTypes.js +945 -945
- package/dist/solana/swaps/v2/programIdl.json +952 -952
- package/dist/solana/swaps/v2/programTypes.d.ts +950 -950
- package/dist/solana/swaps/v2/programTypes.js +952 -952
- package/dist/solana/wallet/SolanaKeypairWallet.d.ts +29 -29
- package/dist/solana/wallet/SolanaKeypairWallet.js +50 -50
- package/dist/solana/wallet/SolanaSigner.d.ts +30 -30
- package/dist/solana/wallet/SolanaSigner.js +30 -30
- package/dist/utils/Utils.d.ts +58 -58
- package/dist/utils/Utils.js +170 -170
- package/node/index.d.ts +1 -1
- package/node/index.js +3 -3
- package/package.json +46 -46
- package/src/index.ts +87 -87
- package/src/node/index.ts +9 -9
- package/src/solana/SolanaChainType.ts +32 -32
- package/src/solana/SolanaChains.ts +46 -46
- package/src/solana/SolanaInitializer.ts +278 -278
- package/src/solana/btcrelay/SolanaBtcRelay.ts +615 -615
- package/src/solana/btcrelay/headers/SolanaBtcHeader.ts +116 -116
- package/src/solana/btcrelay/headers/SolanaBtcStoredHeader.ts +148 -148
- package/src/solana/btcrelay/program/programIdl.json +670 -670
- package/src/solana/chain/SolanaAction.ts +109 -109
- package/src/solana/chain/SolanaChainInterface.ts +404 -404
- package/src/solana/chain/SolanaModule.ts +20 -20
- package/src/solana/chain/modules/SolanaAddresses.ts +20 -20
- package/src/solana/chain/modules/SolanaBlocks.ts +89 -89
- package/src/solana/chain/modules/SolanaEvents.ts +271 -271
- package/src/solana/chain/modules/SolanaFees.ts +522 -522
- package/src/solana/chain/modules/SolanaSignatures.ts +39 -39
- package/src/solana/chain/modules/SolanaSlots.ts +85 -85
- package/src/solana/chain/modules/SolanaTokens.ts +300 -300
- package/src/solana/chain/modules/SolanaTransactions.ts +503 -503
- package/src/solana/connection/ConnectionWithRetries.ts +113 -96
- package/src/solana/events/SolanaChainEvents.ts +127 -127
- package/src/solana/events/SolanaChainEventsBrowser.ts +495 -495
- package/src/solana/program/SolanaProgramBase.ts +119 -119
- package/src/solana/program/SolanaProgramModule.ts +15 -15
- package/src/solana/program/modules/SolanaProgramEvents.ts +157 -157
- package/src/solana/swaps/SolanaSwapData.ts +735 -735
- package/src/solana/swaps/SolanaSwapModule.ts +19 -19
- package/src/solana/swaps/SolanaSwapProgram.ts +1074 -1074
- package/src/solana/swaps/SwapTypeEnum.ts +30 -30
- package/src/solana/swaps/modules/SolanaDataAccount.ts +302 -302
- package/src/solana/swaps/modules/SolanaLpVault.ts +208 -208
- package/src/solana/swaps/modules/SwapClaim.ts +387 -387
- package/src/solana/swaps/modules/SwapInit.ts +785 -785
- package/src/solana/swaps/modules/SwapRefund.ts +353 -353
- package/src/solana/swaps/v1/programIdl.json +944 -944
- package/src/solana/swaps/v1/programTypes.ts +1885 -1885
- package/src/solana/swaps/v2/programIdl.json +951 -951
- package/src/solana/swaps/v2/programTypes.ts +1899 -1899
- package/src/solana/wallet/SolanaKeypairWallet.ts +56 -56
- package/src/solana/wallet/SolanaSigner.ts +43 -43
- package/src/utils/Utils.ts +194 -194
|
@@ -1,376 +1,376 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { SolanaSwapData } from "./SolanaSwapData";
|
|
4
|
-
import { Program } from "@coral-xyz/anchor";
|
|
5
|
-
import { PublicKey } from "@solana/web3.js";
|
|
6
|
-
import { SolanaBtcRelay } from "../btcrelay/SolanaBtcRelay";
|
|
7
|
-
import { IStorageManager, SwapContract, ChainSwapType, IntermediaryReputationType, TransactionConfirmationOptions, SignatureData, RelaySynchronizer, SwapCommitState, SwapCommitStateType, BitcoinNetwork } from "@atomiqlabs/base";
|
|
8
|
-
import { SolanaBtcStoredHeader } from "../btcrelay/headers/SolanaBtcStoredHeader";
|
|
9
|
-
import { SwapProgram } from "./v1/programTypes";
|
|
10
|
-
import { SolanaChainInterface } from "../chain/SolanaChainInterface";
|
|
11
|
-
import { SolanaProgramBase } from "../program/SolanaProgramBase";
|
|
12
|
-
import { SolanaTx } from "../chain/modules/SolanaTransactions";
|
|
13
|
-
import { SolanaPreFetchData, SolanaPreFetchVerification } from "./modules/SwapInit";
|
|
14
|
-
import { SolanaDataAccount, StoredDataAccount } from "./modules/SolanaDataAccount";
|
|
15
|
-
import { Buffer } from "buffer";
|
|
16
|
-
import { SolanaSigner } from "../wallet/SolanaSigner";
|
|
17
|
-
import { SwapProgramV2 } from "./v2/programTypes";
|
|
18
|
-
export declare function isSwapProgramV1(obj: any): obj is Program<SwapProgram>;
|
|
19
|
-
export declare function isSwapProgramV2(obj: any): obj is Program<SwapProgramV2>;
|
|
20
|
-
/**
|
|
21
|
-
* Solana swap (escrow manager) program representation handling PrTLC (on-chain) and HTLC (lightning) based swaps.
|
|
22
|
-
*
|
|
23
|
-
* @category Swaps
|
|
24
|
-
*/
|
|
25
|
-
export declare class SolanaSwapProgram<Version extends "v1" | "v2" = "v1" | "v2"> extends SolanaProgramBase<SwapProgram | SwapProgramV2> implements SwapContract<SolanaSwapData, SolanaTx, SolanaPreFetchData, SolanaPreFetchVerification, SolanaSigner, "SOLANA"> {
|
|
26
|
-
/**
|
|
27
|
-
* Rent-exempt amount (lamports) for escrow state accounts.
|
|
28
|
-
*/
|
|
29
|
-
readonly ESCROW_STATE_RENT_EXEMPT: number;
|
|
30
|
-
readonly version: Version;
|
|
31
|
-
readonly supportsInitWithoutClaimer: Version extends "v1" ? false : true;
|
|
32
|
-
/**
|
|
33
|
-
* PDA of the swap vault authority.
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
static readonly _SwapVaultAuthority: (programId: PublicKey) => PublicKey;
|
|
37
|
-
readonly _SwapVaultAuthority: PublicKey;
|
|
38
|
-
/**
|
|
39
|
-
* PDA helper for global token vault accounts.
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
static readonly _SwapVault: (programId: PublicKey, tokenAddress: PublicKey) => PublicKey;
|
|
43
|
-
readonly _SwapVault: (tokenAddress: PublicKey) => PublicKey;
|
|
44
|
-
/**
|
|
45
|
-
* PDA helper for per-user token vault accounts.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
static readonly _SwapUserVault: (programId: PublicKey, publicKey: PublicKey, tokenAddress: PublicKey) => PublicKey;
|
|
49
|
-
readonly _SwapUserVault: (publicKey: PublicKey, tokenAddress: PublicKey) => PublicKey;
|
|
50
|
-
/**
|
|
51
|
-
* PDA helper for escrow state accounts.
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
static readonly _SwapEscrowState: (programId: PublicKey, hash: Buffer) => PublicKey;
|
|
55
|
-
readonly _SwapEscrowState: (hash: Buffer) => PublicKey;
|
|
56
|
-
/**
|
|
57
|
-
* @inheritDoc
|
|
58
|
-
*/
|
|
59
|
-
readonly chainId: "SOLANA";
|
|
60
|
-
/**
|
|
61
|
-
* @inheritDoc
|
|
62
|
-
*/
|
|
63
|
-
readonly claimWithSecretTimeout: number;
|
|
64
|
-
/**
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
readonly claimWithTxDataTimeout: number;
|
|
68
|
-
/**
|
|
69
|
-
* @inheritDoc
|
|
70
|
-
*/
|
|
71
|
-
readonly refundTimeout: number;
|
|
72
|
-
/**
|
|
73
|
-
* Grace period (seconds) applied to claimer-side expiry checks.
|
|
74
|
-
*/
|
|
75
|
-
private readonly claimGracePeriod;
|
|
76
|
-
/**
|
|
77
|
-
* Grace period (seconds) applied to offerer-side expiry checks.
|
|
78
|
-
*/
|
|
79
|
-
private readonly refundGracePeriod;
|
|
80
|
-
/**
|
|
81
|
-
* Authorization grace period in seconds.
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
|
-
readonly _authGracePeriod: number;
|
|
85
|
-
/**
|
|
86
|
-
* Swap initialization service.
|
|
87
|
-
*/
|
|
88
|
-
private readonly Init;
|
|
89
|
-
/**
|
|
90
|
-
* Swap refund service.
|
|
91
|
-
*/
|
|
92
|
-
private readonly Refund;
|
|
93
|
-
/**
|
|
94
|
-
* Swap claim service.
|
|
95
|
-
*/
|
|
96
|
-
private readonly Claim;
|
|
97
|
-
/**
|
|
98
|
-
* LP vault interaction service.
|
|
99
|
-
*/
|
|
100
|
-
private readonly LpVault;
|
|
101
|
-
/**
|
|
102
|
-
* Temporary data-account lifecycle service.
|
|
103
|
-
* @internal
|
|
104
|
-
*/
|
|
105
|
-
readonly _DataAccount: SolanaDataAccount;
|
|
106
|
-
constructor(chainInterface: SolanaChainInterface, btcRelay: SolanaBtcRelay<any>, storage: IStorageManager<StoredDataAccount>, programAddress?: string, bitcoinNetwork?: BitcoinNetwork, version?: Version);
|
|
107
|
-
/**
|
|
108
|
-
* @inheritDoc
|
|
109
|
-
*/
|
|
110
|
-
start(): Promise<void>;
|
|
111
|
-
/**
|
|
112
|
-
* @inheritDoc
|
|
113
|
-
*/
|
|
114
|
-
getClaimableDeposits(signer: string): Promise<{
|
|
115
|
-
count: number;
|
|
116
|
-
totalValue: bigint;
|
|
117
|
-
}>;
|
|
118
|
-
/**
|
|
119
|
-
* @inheritDoc
|
|
120
|
-
*/
|
|
121
|
-
claimDeposits(signer: SolanaSigner): Promise<{
|
|
122
|
-
txIds: string[];
|
|
123
|
-
count: number;
|
|
124
|
-
totalValue: bigint;
|
|
125
|
-
}>;
|
|
126
|
-
/**
|
|
127
|
-
* @inheritDoc
|
|
128
|
-
*/
|
|
129
|
-
preFetchForInitSignatureVerification(data: SolanaPreFetchData): Promise<SolanaPreFetchVerification>;
|
|
130
|
-
/**
|
|
131
|
-
* @inheritDoc
|
|
132
|
-
*/
|
|
133
|
-
preFetchBlockDataForSignatures(): Promise<SolanaPreFetchData>;
|
|
134
|
-
/**
|
|
135
|
-
* @inheritDoc
|
|
136
|
-
*/
|
|
137
|
-
getInitSignature(signer: SolanaSigner, swapData: SolanaSwapData, authorizationTimeout: number, preFetchedBlockData?: SolanaPreFetchData, feeRate?: string): Promise<SignatureData>;
|
|
138
|
-
/**
|
|
139
|
-
* @inheritDoc
|
|
140
|
-
*/
|
|
141
|
-
isValidInitAuthorization(signer: string, swapData: SolanaSwapData, sig: SignatureData, feeRate?: string, preFetchedData?: SolanaPreFetchVerification): Promise<Buffer>;
|
|
142
|
-
/**
|
|
143
|
-
* @inheritDoc
|
|
144
|
-
*/
|
|
145
|
-
getInitAuthorizationExpiry(swapData: SolanaSwapData, sig: SignatureData, preFetchedData?: SolanaPreFetchVerification): Promise<number>;
|
|
146
|
-
/**
|
|
147
|
-
* @inheritDoc
|
|
148
|
-
*/
|
|
149
|
-
isInitAuthorizationExpired(swapData: SolanaSwapData, sig: SignatureData): Promise<boolean>;
|
|
150
|
-
/**
|
|
151
|
-
* @inheritDoc
|
|
152
|
-
*/
|
|
153
|
-
getRefundSignature(signer: SolanaSigner, swapData: SolanaSwapData, authorizationTimeout: number): Promise<SignatureData>;
|
|
154
|
-
/**
|
|
155
|
-
* @inheritDoc
|
|
156
|
-
*/
|
|
157
|
-
isValidRefundAuthorization(swapData: SolanaSwapData, sig: SignatureData): Promise<Buffer>;
|
|
158
|
-
/**
|
|
159
|
-
* @inheritDoc
|
|
160
|
-
*/
|
|
161
|
-
getDataSignature(signer: SolanaSigner, data: Buffer): Promise<string>;
|
|
162
|
-
/**
|
|
163
|
-
* @inheritDoc
|
|
164
|
-
*/
|
|
165
|
-
isValidDataSignature(data: Buffer, signature: string, publicKey: string): Promise<boolean>;
|
|
166
|
-
/**
|
|
167
|
-
* @inheritDoc
|
|
168
|
-
*/
|
|
169
|
-
isClaimable(signer: string, data: SolanaSwapData): Promise<boolean>;
|
|
170
|
-
/**
|
|
171
|
-
* @inheritDoc
|
|
172
|
-
*/
|
|
173
|
-
isCommited(swapData: SolanaSwapData): Promise<boolean>;
|
|
174
|
-
/**
|
|
175
|
-
* @inheritDoc
|
|
176
|
-
*/
|
|
177
|
-
isExpired(signer: string, data: SolanaSwapData, refundSide?: boolean): Promise<boolean>;
|
|
178
|
-
/**
|
|
179
|
-
* @inheritDoc
|
|
180
|
-
*/
|
|
181
|
-
isRequestRefundable(signer: string, data: SolanaSwapData): Promise<boolean>;
|
|
182
|
-
/**
|
|
183
|
-
* @inheritDoc
|
|
184
|
-
*/
|
|
185
|
-
getHashForOnchain(outputScript: Buffer, amount: bigint, confirmations: number, nonce?: bigint): Buffer;
|
|
186
|
-
/**
|
|
187
|
-
* @inheritDoc
|
|
188
|
-
*/
|
|
189
|
-
getHashForHtlc(swapHash: Buffer): Buffer;
|
|
190
|
-
/**
|
|
191
|
-
* @inheritDoc
|
|
192
|
-
*/
|
|
193
|
-
getHashForTxId(txId: string, confirmations: number): Buffer;
|
|
194
|
-
/**
|
|
195
|
-
* @inheritDoc
|
|
196
|
-
*/
|
|
197
|
-
getCommitStatus(signer: string, data: SolanaSwapData): Promise<SwapCommitState>;
|
|
198
|
-
/**
|
|
199
|
-
* @inheritDoc
|
|
200
|
-
*/
|
|
201
|
-
getCommitStatuses(request: {
|
|
202
|
-
signer: string;
|
|
203
|
-
swapData: SolanaSwapData;
|
|
204
|
-
}[]): Promise<{
|
|
205
|
-
[p: string]: SwapCommitState;
|
|
206
|
-
}>;
|
|
207
|
-
/**
|
|
208
|
-
* @inheritDoc
|
|
209
|
-
*/
|
|
210
|
-
getClaimHashStatus(claimHash: string): Promise<SwapCommitStateType>;
|
|
211
|
-
/**
|
|
212
|
-
* @inheritDoc
|
|
213
|
-
*/
|
|
214
|
-
getCommitedData(claimHashHex: string): Promise<SolanaSwapData | null>;
|
|
215
|
-
/**
|
|
216
|
-
* @inheritDoc
|
|
217
|
-
*/
|
|
218
|
-
getHistoricalSwaps(signer: string, startBlockheight?: number): Promise<{
|
|
219
|
-
swaps: {
|
|
220
|
-
[escrowHash: string]: {
|
|
221
|
-
init?: {
|
|
222
|
-
data: SolanaSwapData;
|
|
223
|
-
getInitTxId: () => Promise<string>;
|
|
224
|
-
getTxBlock: () => Promise<{
|
|
225
|
-
blockTime: number;
|
|
226
|
-
blockHeight: number;
|
|
227
|
-
}>;
|
|
228
|
-
};
|
|
229
|
-
state: SwapCommitState;
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
latestBlockheight?: number;
|
|
233
|
-
}>;
|
|
234
|
-
/**
|
|
235
|
-
* @inheritDoc
|
|
236
|
-
*/
|
|
237
|
-
createSwapData(type: ChainSwapType, offerer: string, claimer: string, token: string, amount: bigint, claimHash: string, sequence: bigint, expiry: bigint, payIn: boolean, payOut: boolean, securityDeposit: bigint, claimerBounty: bigint, depositToken?: string): Promise<SolanaSwapData>;
|
|
238
|
-
/**
|
|
239
|
-
* @inheritDoc
|
|
240
|
-
*/
|
|
241
|
-
getBalance(signer: string, tokenAddress: string, inContract: boolean): Promise<bigint>;
|
|
242
|
-
/**
|
|
243
|
-
* @inheritDoc
|
|
244
|
-
*/
|
|
245
|
-
getIntermediaryData(address: string, token: string): Promise<{
|
|
246
|
-
balance: bigint;
|
|
247
|
-
reputation: IntermediaryReputationType;
|
|
248
|
-
} | null>;
|
|
249
|
-
/**
|
|
250
|
-
* @inheritDoc
|
|
251
|
-
*/
|
|
252
|
-
getIntermediaryReputation(address: string, token: string): Promise<IntermediaryReputationType | null>;
|
|
253
|
-
/**
|
|
254
|
-
* Returns intermediary vault balance for a specific token.
|
|
255
|
-
*
|
|
256
|
-
* @param address Intermediary address
|
|
257
|
-
* @param token Token mint
|
|
258
|
-
*/
|
|
259
|
-
getIntermediaryBalance(address: PublicKey, token: PublicKey): Promise<bigint>;
|
|
260
|
-
/**
|
|
261
|
-
* @inheritDoc
|
|
262
|
-
*/
|
|
263
|
-
txsClaimWithSecret(signer: string | SolanaSigner, swapData: SolanaSwapData, secret: string, checkExpiry?: boolean, initAta?: boolean, feeRate?: string, skipAtaCheck?: boolean): Promise<SolanaTx[]>;
|
|
264
|
-
/**
|
|
265
|
-
* @inheritDoc
|
|
266
|
-
*/
|
|
267
|
-
txsClaimWithTxData(signer: string | SolanaSigner, swapData: SolanaSwapData, tx: {
|
|
268
|
-
blockhash: string;
|
|
269
|
-
confirmations: number;
|
|
270
|
-
txid: string;
|
|
271
|
-
hex: string;
|
|
272
|
-
height: number;
|
|
273
|
-
}, requiredConfirmations: number, vout: number, commitedHeader?: SolanaBtcStoredHeader, synchronizer?: RelaySynchronizer<any, SolanaTx, any>, initAta?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
274
|
-
/**
|
|
275
|
-
* @inheritDoc
|
|
276
|
-
*/
|
|
277
|
-
txsRefund(signer: string, swapData: SolanaSwapData, check?: boolean, initAta?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
278
|
-
/**
|
|
279
|
-
* @inheritDoc
|
|
280
|
-
*/
|
|
281
|
-
txsRefundWithAuthorization(signer: string, swapData: SolanaSwapData, sig: SignatureData, check?: boolean, initAta?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
282
|
-
/**
|
|
283
|
-
* @inheritDoc
|
|
284
|
-
*/
|
|
285
|
-
txsInit(sender: string, swapData: SolanaSwapData, sig: SignatureData, skipChecks?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
286
|
-
/**
|
|
287
|
-
* @inheritDoc
|
|
288
|
-
*/
|
|
289
|
-
txsWithdraw(signer: string, token: string, amount: bigint, feeRate?: string): Promise<SolanaTx[]>;
|
|
290
|
-
/**
|
|
291
|
-
* @inheritDoc
|
|
292
|
-
*/
|
|
293
|
-
txsDeposit(signer: string, token: string, amount: bigint, feeRate?: string): Promise<SolanaTx[]>;
|
|
294
|
-
/**
|
|
295
|
-
* @inheritDoc
|
|
296
|
-
*/
|
|
297
|
-
claimWithSecret(signer: SolanaSigner, swapData: SolanaSwapData, secret: string, checkExpiry?: boolean, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
298
|
-
/**
|
|
299
|
-
* @inheritDoc
|
|
300
|
-
*/
|
|
301
|
-
claimWithTxData(signer: SolanaSigner, swapData: SolanaSwapData, tx: {
|
|
302
|
-
blockhash: string;
|
|
303
|
-
confirmations: number;
|
|
304
|
-
txid: string;
|
|
305
|
-
hex: string;
|
|
306
|
-
height: number;
|
|
307
|
-
}, requiredConfirmations: number, vout: number, commitedHeader?: SolanaBtcStoredHeader, synchronizer?: RelaySynchronizer<any, SolanaTx, any>, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
308
|
-
/**
|
|
309
|
-
* @inheritDoc
|
|
310
|
-
*/
|
|
311
|
-
refund(signer: SolanaSigner, swapData: SolanaSwapData, check?: boolean, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
312
|
-
/**
|
|
313
|
-
* @inheritDoc
|
|
314
|
-
*/
|
|
315
|
-
refundWithAuthorization(signer: SolanaSigner, swapData: SolanaSwapData, signature: SignatureData, check?: boolean, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
316
|
-
/**
|
|
317
|
-
* @inheritDoc
|
|
318
|
-
*/
|
|
319
|
-
init(signer: SolanaSigner, swapData: SolanaSwapData, signature: SignatureData, skipChecks?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
320
|
-
/**
|
|
321
|
-
* @inheritDoc
|
|
322
|
-
*/
|
|
323
|
-
initAndClaimWithSecret(signer: SolanaSigner, swapData: SolanaSwapData, signature: SignatureData, secret: string, skipChecks?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string[]>;
|
|
324
|
-
/**
|
|
325
|
-
* @inheritDoc
|
|
326
|
-
*/
|
|
327
|
-
withdraw(signer: SolanaSigner, token: string, amount: bigint, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
328
|
-
/**
|
|
329
|
-
* @inheritDoc
|
|
330
|
-
*/
|
|
331
|
-
deposit(signer: SolanaSigner, token: string, amount: bigint, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
332
|
-
/**
|
|
333
|
-
* @inheritDoc
|
|
334
|
-
*/
|
|
335
|
-
getInitPayInFeeRate(offerer?: string, claimer?: string, token?: string, claimHash?: string): Promise<string>;
|
|
336
|
-
/**
|
|
337
|
-
* @inheritDoc
|
|
338
|
-
*/
|
|
339
|
-
getInitFeeRate(offerer?: string, claimer?: string, token?: string, claimHash?: string): Promise<string>;
|
|
340
|
-
/**
|
|
341
|
-
* @inheritDoc
|
|
342
|
-
*/
|
|
343
|
-
getRefundFeeRate(swapData: SolanaSwapData): Promise<string>;
|
|
344
|
-
/**
|
|
345
|
-
* @inheritDoc
|
|
346
|
-
*/
|
|
347
|
-
getClaimFeeRate(signer: string, swapData: SolanaSwapData): Promise<string>;
|
|
348
|
-
/**
|
|
349
|
-
* @inheritDoc
|
|
350
|
-
*/
|
|
351
|
-
getClaimFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
352
|
-
/**
|
|
353
|
-
* @inheritDoc
|
|
354
|
-
*/
|
|
355
|
-
getRawClaimFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
356
|
-
/**
|
|
357
|
-
* @inheritDoc
|
|
358
|
-
*/
|
|
359
|
-
getCommitFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
360
|
-
/**
|
|
361
|
-
* @inheritDoc
|
|
362
|
-
*/
|
|
363
|
-
getRawCommitFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
364
|
-
/**
|
|
365
|
-
* @inheritDoc
|
|
366
|
-
*/
|
|
367
|
-
getRefundFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
368
|
-
/**
|
|
369
|
-
* @inheritDoc
|
|
370
|
-
*/
|
|
371
|
-
getRawRefundFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
372
|
-
/**
|
|
373
|
-
* @inheritDoc
|
|
374
|
-
*/
|
|
375
|
-
getExtraData(outputScript: Buffer, amount: bigint, confirmations: number, nonce?: bigint): Buffer;
|
|
376
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { SolanaSwapData } from "./SolanaSwapData";
|
|
4
|
+
import { Program } from "@coral-xyz/anchor";
|
|
5
|
+
import { PublicKey } from "@solana/web3.js";
|
|
6
|
+
import { SolanaBtcRelay } from "../btcrelay/SolanaBtcRelay";
|
|
7
|
+
import { IStorageManager, SwapContract, ChainSwapType, IntermediaryReputationType, TransactionConfirmationOptions, SignatureData, RelaySynchronizer, SwapCommitState, SwapCommitStateType, BitcoinNetwork } from "@atomiqlabs/base";
|
|
8
|
+
import { SolanaBtcStoredHeader } from "../btcrelay/headers/SolanaBtcStoredHeader";
|
|
9
|
+
import { SwapProgram } from "./v1/programTypes";
|
|
10
|
+
import { SolanaChainInterface } from "../chain/SolanaChainInterface";
|
|
11
|
+
import { SolanaProgramBase } from "../program/SolanaProgramBase";
|
|
12
|
+
import { SolanaTx } from "../chain/modules/SolanaTransactions";
|
|
13
|
+
import { SolanaPreFetchData, SolanaPreFetchVerification } from "./modules/SwapInit";
|
|
14
|
+
import { SolanaDataAccount, StoredDataAccount } from "./modules/SolanaDataAccount";
|
|
15
|
+
import { Buffer } from "buffer";
|
|
16
|
+
import { SolanaSigner } from "../wallet/SolanaSigner";
|
|
17
|
+
import { SwapProgramV2 } from "./v2/programTypes";
|
|
18
|
+
export declare function isSwapProgramV1(obj: any): obj is Program<SwapProgram>;
|
|
19
|
+
export declare function isSwapProgramV2(obj: any): obj is Program<SwapProgramV2>;
|
|
20
|
+
/**
|
|
21
|
+
* Solana swap (escrow manager) program representation handling PrTLC (on-chain) and HTLC (lightning) based swaps.
|
|
22
|
+
*
|
|
23
|
+
* @category Swaps
|
|
24
|
+
*/
|
|
25
|
+
export declare class SolanaSwapProgram<Version extends "v1" | "v2" = "v1" | "v2"> extends SolanaProgramBase<SwapProgram | SwapProgramV2> implements SwapContract<SolanaSwapData, SolanaTx, SolanaPreFetchData, SolanaPreFetchVerification, SolanaSigner, "SOLANA"> {
|
|
26
|
+
/**
|
|
27
|
+
* Rent-exempt amount (lamports) for escrow state accounts.
|
|
28
|
+
*/
|
|
29
|
+
readonly ESCROW_STATE_RENT_EXEMPT: number;
|
|
30
|
+
readonly version: Version;
|
|
31
|
+
readonly supportsInitWithoutClaimer: Version extends "v1" ? false : true;
|
|
32
|
+
/**
|
|
33
|
+
* PDA of the swap vault authority.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
static readonly _SwapVaultAuthority: (programId: PublicKey) => PublicKey;
|
|
37
|
+
readonly _SwapVaultAuthority: PublicKey;
|
|
38
|
+
/**
|
|
39
|
+
* PDA helper for global token vault accounts.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
static readonly _SwapVault: (programId: PublicKey, tokenAddress: PublicKey) => PublicKey;
|
|
43
|
+
readonly _SwapVault: (tokenAddress: PublicKey) => PublicKey;
|
|
44
|
+
/**
|
|
45
|
+
* PDA helper for per-user token vault accounts.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
static readonly _SwapUserVault: (programId: PublicKey, publicKey: PublicKey, tokenAddress: PublicKey) => PublicKey;
|
|
49
|
+
readonly _SwapUserVault: (publicKey: PublicKey, tokenAddress: PublicKey) => PublicKey;
|
|
50
|
+
/**
|
|
51
|
+
* PDA helper for escrow state accounts.
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
static readonly _SwapEscrowState: (programId: PublicKey, hash: Buffer) => PublicKey;
|
|
55
|
+
readonly _SwapEscrowState: (hash: Buffer) => PublicKey;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
readonly chainId: "SOLANA";
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
readonly claimWithSecretTimeout: number;
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
readonly claimWithTxDataTimeout: number;
|
|
68
|
+
/**
|
|
69
|
+
* @inheritDoc
|
|
70
|
+
*/
|
|
71
|
+
readonly refundTimeout: number;
|
|
72
|
+
/**
|
|
73
|
+
* Grace period (seconds) applied to claimer-side expiry checks.
|
|
74
|
+
*/
|
|
75
|
+
private readonly claimGracePeriod;
|
|
76
|
+
/**
|
|
77
|
+
* Grace period (seconds) applied to offerer-side expiry checks.
|
|
78
|
+
*/
|
|
79
|
+
private readonly refundGracePeriod;
|
|
80
|
+
/**
|
|
81
|
+
* Authorization grace period in seconds.
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
readonly _authGracePeriod: number;
|
|
85
|
+
/**
|
|
86
|
+
* Swap initialization service.
|
|
87
|
+
*/
|
|
88
|
+
private readonly Init;
|
|
89
|
+
/**
|
|
90
|
+
* Swap refund service.
|
|
91
|
+
*/
|
|
92
|
+
private readonly Refund;
|
|
93
|
+
/**
|
|
94
|
+
* Swap claim service.
|
|
95
|
+
*/
|
|
96
|
+
private readonly Claim;
|
|
97
|
+
/**
|
|
98
|
+
* LP vault interaction service.
|
|
99
|
+
*/
|
|
100
|
+
private readonly LpVault;
|
|
101
|
+
/**
|
|
102
|
+
* Temporary data-account lifecycle service.
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
readonly _DataAccount: SolanaDataAccount;
|
|
106
|
+
constructor(chainInterface: SolanaChainInterface, btcRelay: SolanaBtcRelay<any>, storage: IStorageManager<StoredDataAccount>, programAddress?: string, bitcoinNetwork?: BitcoinNetwork, version?: Version);
|
|
107
|
+
/**
|
|
108
|
+
* @inheritDoc
|
|
109
|
+
*/
|
|
110
|
+
start(): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* @inheritDoc
|
|
113
|
+
*/
|
|
114
|
+
getClaimableDeposits(signer: string): Promise<{
|
|
115
|
+
count: number;
|
|
116
|
+
totalValue: bigint;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* @inheritDoc
|
|
120
|
+
*/
|
|
121
|
+
claimDeposits(signer: SolanaSigner): Promise<{
|
|
122
|
+
txIds: string[];
|
|
123
|
+
count: number;
|
|
124
|
+
totalValue: bigint;
|
|
125
|
+
}>;
|
|
126
|
+
/**
|
|
127
|
+
* @inheritDoc
|
|
128
|
+
*/
|
|
129
|
+
preFetchForInitSignatureVerification(data: SolanaPreFetchData): Promise<SolanaPreFetchVerification>;
|
|
130
|
+
/**
|
|
131
|
+
* @inheritDoc
|
|
132
|
+
*/
|
|
133
|
+
preFetchBlockDataForSignatures(): Promise<SolanaPreFetchData>;
|
|
134
|
+
/**
|
|
135
|
+
* @inheritDoc
|
|
136
|
+
*/
|
|
137
|
+
getInitSignature(signer: SolanaSigner, swapData: SolanaSwapData, authorizationTimeout: number, preFetchedBlockData?: SolanaPreFetchData, feeRate?: string): Promise<SignatureData>;
|
|
138
|
+
/**
|
|
139
|
+
* @inheritDoc
|
|
140
|
+
*/
|
|
141
|
+
isValidInitAuthorization(signer: string, swapData: SolanaSwapData, sig: SignatureData, feeRate?: string, preFetchedData?: SolanaPreFetchVerification): Promise<Buffer>;
|
|
142
|
+
/**
|
|
143
|
+
* @inheritDoc
|
|
144
|
+
*/
|
|
145
|
+
getInitAuthorizationExpiry(swapData: SolanaSwapData, sig: SignatureData, preFetchedData?: SolanaPreFetchVerification): Promise<number>;
|
|
146
|
+
/**
|
|
147
|
+
* @inheritDoc
|
|
148
|
+
*/
|
|
149
|
+
isInitAuthorizationExpired(swapData: SolanaSwapData, sig: SignatureData): Promise<boolean>;
|
|
150
|
+
/**
|
|
151
|
+
* @inheritDoc
|
|
152
|
+
*/
|
|
153
|
+
getRefundSignature(signer: SolanaSigner, swapData: SolanaSwapData, authorizationTimeout: number): Promise<SignatureData>;
|
|
154
|
+
/**
|
|
155
|
+
* @inheritDoc
|
|
156
|
+
*/
|
|
157
|
+
isValidRefundAuthorization(swapData: SolanaSwapData, sig: SignatureData): Promise<Buffer>;
|
|
158
|
+
/**
|
|
159
|
+
* @inheritDoc
|
|
160
|
+
*/
|
|
161
|
+
getDataSignature(signer: SolanaSigner, data: Buffer): Promise<string>;
|
|
162
|
+
/**
|
|
163
|
+
* @inheritDoc
|
|
164
|
+
*/
|
|
165
|
+
isValidDataSignature(data: Buffer, signature: string, publicKey: string): Promise<boolean>;
|
|
166
|
+
/**
|
|
167
|
+
* @inheritDoc
|
|
168
|
+
*/
|
|
169
|
+
isClaimable(signer: string, data: SolanaSwapData): Promise<boolean>;
|
|
170
|
+
/**
|
|
171
|
+
* @inheritDoc
|
|
172
|
+
*/
|
|
173
|
+
isCommited(swapData: SolanaSwapData): Promise<boolean>;
|
|
174
|
+
/**
|
|
175
|
+
* @inheritDoc
|
|
176
|
+
*/
|
|
177
|
+
isExpired(signer: string, data: SolanaSwapData, refundSide?: boolean): Promise<boolean>;
|
|
178
|
+
/**
|
|
179
|
+
* @inheritDoc
|
|
180
|
+
*/
|
|
181
|
+
isRequestRefundable(signer: string, data: SolanaSwapData): Promise<boolean>;
|
|
182
|
+
/**
|
|
183
|
+
* @inheritDoc
|
|
184
|
+
*/
|
|
185
|
+
getHashForOnchain(outputScript: Buffer, amount: bigint, confirmations: number, nonce?: bigint): Buffer;
|
|
186
|
+
/**
|
|
187
|
+
* @inheritDoc
|
|
188
|
+
*/
|
|
189
|
+
getHashForHtlc(swapHash: Buffer): Buffer;
|
|
190
|
+
/**
|
|
191
|
+
* @inheritDoc
|
|
192
|
+
*/
|
|
193
|
+
getHashForTxId(txId: string, confirmations: number): Buffer;
|
|
194
|
+
/**
|
|
195
|
+
* @inheritDoc
|
|
196
|
+
*/
|
|
197
|
+
getCommitStatus(signer: string, data: SolanaSwapData): Promise<SwapCommitState>;
|
|
198
|
+
/**
|
|
199
|
+
* @inheritDoc
|
|
200
|
+
*/
|
|
201
|
+
getCommitStatuses(request: {
|
|
202
|
+
signer: string;
|
|
203
|
+
swapData: SolanaSwapData;
|
|
204
|
+
}[]): Promise<{
|
|
205
|
+
[p: string]: SwapCommitState;
|
|
206
|
+
}>;
|
|
207
|
+
/**
|
|
208
|
+
* @inheritDoc
|
|
209
|
+
*/
|
|
210
|
+
getClaimHashStatus(claimHash: string): Promise<SwapCommitStateType>;
|
|
211
|
+
/**
|
|
212
|
+
* @inheritDoc
|
|
213
|
+
*/
|
|
214
|
+
getCommitedData(claimHashHex: string): Promise<SolanaSwapData | null>;
|
|
215
|
+
/**
|
|
216
|
+
* @inheritDoc
|
|
217
|
+
*/
|
|
218
|
+
getHistoricalSwaps(signer: string, startBlockheight?: number): Promise<{
|
|
219
|
+
swaps: {
|
|
220
|
+
[escrowHash: string]: {
|
|
221
|
+
init?: {
|
|
222
|
+
data: SolanaSwapData;
|
|
223
|
+
getInitTxId: () => Promise<string>;
|
|
224
|
+
getTxBlock: () => Promise<{
|
|
225
|
+
blockTime: number;
|
|
226
|
+
blockHeight: number;
|
|
227
|
+
}>;
|
|
228
|
+
};
|
|
229
|
+
state: SwapCommitState;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
latestBlockheight?: number;
|
|
233
|
+
}>;
|
|
234
|
+
/**
|
|
235
|
+
* @inheritDoc
|
|
236
|
+
*/
|
|
237
|
+
createSwapData(type: ChainSwapType, offerer: string, claimer: string, token: string, amount: bigint, claimHash: string, sequence: bigint, expiry: bigint, payIn: boolean, payOut: boolean, securityDeposit: bigint, claimerBounty: bigint, depositToken?: string): Promise<SolanaSwapData>;
|
|
238
|
+
/**
|
|
239
|
+
* @inheritDoc
|
|
240
|
+
*/
|
|
241
|
+
getBalance(signer: string, tokenAddress: string, inContract: boolean): Promise<bigint>;
|
|
242
|
+
/**
|
|
243
|
+
* @inheritDoc
|
|
244
|
+
*/
|
|
245
|
+
getIntermediaryData(address: string, token: string): Promise<{
|
|
246
|
+
balance: bigint;
|
|
247
|
+
reputation: IntermediaryReputationType;
|
|
248
|
+
} | null>;
|
|
249
|
+
/**
|
|
250
|
+
* @inheritDoc
|
|
251
|
+
*/
|
|
252
|
+
getIntermediaryReputation(address: string, token: string): Promise<IntermediaryReputationType | null>;
|
|
253
|
+
/**
|
|
254
|
+
* Returns intermediary vault balance for a specific token.
|
|
255
|
+
*
|
|
256
|
+
* @param address Intermediary address
|
|
257
|
+
* @param token Token mint
|
|
258
|
+
*/
|
|
259
|
+
getIntermediaryBalance(address: PublicKey, token: PublicKey): Promise<bigint>;
|
|
260
|
+
/**
|
|
261
|
+
* @inheritDoc
|
|
262
|
+
*/
|
|
263
|
+
txsClaimWithSecret(signer: string | SolanaSigner, swapData: SolanaSwapData, secret: string, checkExpiry?: boolean, initAta?: boolean, feeRate?: string, skipAtaCheck?: boolean): Promise<SolanaTx[]>;
|
|
264
|
+
/**
|
|
265
|
+
* @inheritDoc
|
|
266
|
+
*/
|
|
267
|
+
txsClaimWithTxData(signer: string | SolanaSigner, swapData: SolanaSwapData, tx: {
|
|
268
|
+
blockhash: string;
|
|
269
|
+
confirmations: number;
|
|
270
|
+
txid: string;
|
|
271
|
+
hex: string;
|
|
272
|
+
height: number;
|
|
273
|
+
}, requiredConfirmations: number, vout: number, commitedHeader?: SolanaBtcStoredHeader, synchronizer?: RelaySynchronizer<any, SolanaTx, any>, initAta?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
274
|
+
/**
|
|
275
|
+
* @inheritDoc
|
|
276
|
+
*/
|
|
277
|
+
txsRefund(signer: string, swapData: SolanaSwapData, check?: boolean, initAta?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
278
|
+
/**
|
|
279
|
+
* @inheritDoc
|
|
280
|
+
*/
|
|
281
|
+
txsRefundWithAuthorization(signer: string, swapData: SolanaSwapData, sig: SignatureData, check?: boolean, initAta?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
282
|
+
/**
|
|
283
|
+
* @inheritDoc
|
|
284
|
+
*/
|
|
285
|
+
txsInit(sender: string, swapData: SolanaSwapData, sig: SignatureData, skipChecks?: boolean, feeRate?: string): Promise<SolanaTx[]>;
|
|
286
|
+
/**
|
|
287
|
+
* @inheritDoc
|
|
288
|
+
*/
|
|
289
|
+
txsWithdraw(signer: string, token: string, amount: bigint, feeRate?: string): Promise<SolanaTx[]>;
|
|
290
|
+
/**
|
|
291
|
+
* @inheritDoc
|
|
292
|
+
*/
|
|
293
|
+
txsDeposit(signer: string, token: string, amount: bigint, feeRate?: string): Promise<SolanaTx[]>;
|
|
294
|
+
/**
|
|
295
|
+
* @inheritDoc
|
|
296
|
+
*/
|
|
297
|
+
claimWithSecret(signer: SolanaSigner, swapData: SolanaSwapData, secret: string, checkExpiry?: boolean, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
298
|
+
/**
|
|
299
|
+
* @inheritDoc
|
|
300
|
+
*/
|
|
301
|
+
claimWithTxData(signer: SolanaSigner, swapData: SolanaSwapData, tx: {
|
|
302
|
+
blockhash: string;
|
|
303
|
+
confirmations: number;
|
|
304
|
+
txid: string;
|
|
305
|
+
hex: string;
|
|
306
|
+
height: number;
|
|
307
|
+
}, requiredConfirmations: number, vout: number, commitedHeader?: SolanaBtcStoredHeader, synchronizer?: RelaySynchronizer<any, SolanaTx, any>, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
308
|
+
/**
|
|
309
|
+
* @inheritDoc
|
|
310
|
+
*/
|
|
311
|
+
refund(signer: SolanaSigner, swapData: SolanaSwapData, check?: boolean, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
312
|
+
/**
|
|
313
|
+
* @inheritDoc
|
|
314
|
+
*/
|
|
315
|
+
refundWithAuthorization(signer: SolanaSigner, swapData: SolanaSwapData, signature: SignatureData, check?: boolean, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
316
|
+
/**
|
|
317
|
+
* @inheritDoc
|
|
318
|
+
*/
|
|
319
|
+
init(signer: SolanaSigner, swapData: SolanaSwapData, signature: SignatureData, skipChecks?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
320
|
+
/**
|
|
321
|
+
* @inheritDoc
|
|
322
|
+
*/
|
|
323
|
+
initAndClaimWithSecret(signer: SolanaSigner, swapData: SolanaSwapData, signature: SignatureData, secret: string, skipChecks?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string[]>;
|
|
324
|
+
/**
|
|
325
|
+
* @inheritDoc
|
|
326
|
+
*/
|
|
327
|
+
withdraw(signer: SolanaSigner, token: string, amount: bigint, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
328
|
+
/**
|
|
329
|
+
* @inheritDoc
|
|
330
|
+
*/
|
|
331
|
+
deposit(signer: SolanaSigner, token: string, amount: bigint, txOptions?: TransactionConfirmationOptions): Promise<string>;
|
|
332
|
+
/**
|
|
333
|
+
* @inheritDoc
|
|
334
|
+
*/
|
|
335
|
+
getInitPayInFeeRate(offerer?: string, claimer?: string, token?: string, claimHash?: string): Promise<string>;
|
|
336
|
+
/**
|
|
337
|
+
* @inheritDoc
|
|
338
|
+
*/
|
|
339
|
+
getInitFeeRate(offerer?: string, claimer?: string, token?: string, claimHash?: string): Promise<string>;
|
|
340
|
+
/**
|
|
341
|
+
* @inheritDoc
|
|
342
|
+
*/
|
|
343
|
+
getRefundFeeRate(swapData: SolanaSwapData): Promise<string>;
|
|
344
|
+
/**
|
|
345
|
+
* @inheritDoc
|
|
346
|
+
*/
|
|
347
|
+
getClaimFeeRate(signer: string, swapData: SolanaSwapData): Promise<string>;
|
|
348
|
+
/**
|
|
349
|
+
* @inheritDoc
|
|
350
|
+
*/
|
|
351
|
+
getClaimFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
352
|
+
/**
|
|
353
|
+
* @inheritDoc
|
|
354
|
+
*/
|
|
355
|
+
getRawClaimFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
356
|
+
/**
|
|
357
|
+
* @inheritDoc
|
|
358
|
+
*/
|
|
359
|
+
getCommitFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
360
|
+
/**
|
|
361
|
+
* @inheritDoc
|
|
362
|
+
*/
|
|
363
|
+
getRawCommitFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
364
|
+
/**
|
|
365
|
+
* @inheritDoc
|
|
366
|
+
*/
|
|
367
|
+
getRefundFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
368
|
+
/**
|
|
369
|
+
* @inheritDoc
|
|
370
|
+
*/
|
|
371
|
+
getRawRefundFee(signer: string, swapData: SolanaSwapData, feeRate?: string): Promise<bigint>;
|
|
372
|
+
/**
|
|
373
|
+
* @inheritDoc
|
|
374
|
+
*/
|
|
375
|
+
getExtraData(outputScript: Buffer, amount: bigint, confirmations: number, nonce?: bigint): Buffer;
|
|
376
|
+
}
|