@atomiqlabs/chain-solana 13.0.9 → 13.0.10

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.
@@ -76,7 +76,7 @@ export declare class SolanaBtcRelay<B extends BtcBlock> extends SolanaProgramBas
76
76
  */
77
77
  private _saveHeaders;
78
78
  /**
79
- * Returns data about current main chain tip stored in the btc relay
79
+ * @inheritDoc
80
80
  */
81
81
  getTipData(): Promise<{
82
82
  commitHash: string;
@@ -85,11 +85,7 @@ export declare class SolanaBtcRelay<B extends BtcBlock> extends SolanaProgramBas
85
85
  blockheight: number;
86
86
  } | null>;
87
87
  /**
88
- * Retrieves blockheader with a specific blockhash, returns null if requiredBlockheight is provided and
89
- * btc relay contract is not synced up to the desired blockheight
90
- *
91
- * @param blockData
92
- * @param requiredBlockheight
88
+ * @inheritDoc
93
89
  */
94
90
  retrieveLogAndBlockheight(blockData: {
95
91
  blockhash: string;
@@ -98,41 +94,27 @@ export declare class SolanaBtcRelay<B extends BtcBlock> extends SolanaProgramBas
98
94
  height: number;
99
95
  } | null>;
100
96
  /**
101
- * Retrieves blockheader data by blockheader's commit hash,
102
- *
103
- * @param commitmentHashStr
104
- * @param blockData
97
+ * @inheritDoc
105
98
  */
106
99
  retrieveLogByCommitHash(commitmentHashStr: string, blockData: {
107
100
  blockhash: string;
108
101
  }): Promise<SolanaBtcStoredHeader | null>;
109
102
  /**
110
- * Retrieves latest known stored blockheader & blockheader from bitcoin RPC that is in the main chain
103
+ * @inheritDoc
111
104
  */
112
105
  retrieveLatestKnownBlockLog(): Promise<{
113
106
  resultStoredHeader: SolanaBtcStoredHeader;
114
107
  resultBitcoinHeader: B;
115
108
  } | null>;
116
109
  /**
117
- * Saves initial block header when the btc relay is in uninitialized state
118
- *
119
- * @param signer
120
- * @param header a bitcoin blockheader to submit
121
- * @param epochStart timestamp of the start of the epoch (block timestamp at blockheight-(blockheight%2016))
122
- * @param pastBlocksTimestamps timestamp of the past 10 blocks
123
- * @param feeRate fee rate to use for the transaction
110
+ * @inheritDoc
124
111
  */
125
112
  saveInitialHeader(signer: string, header: B, epochStart: number, pastBlocksTimestamps: number[], feeRate?: string): Promise<{
126
113
  tx: Transaction;
127
114
  signers: Signer[];
128
115
  }>;
129
116
  /**
130
- * Saves blockheaders as a bitcoin main chain to the btc relay
131
- *
132
- * @param signer
133
- * @param mainHeaders
134
- * @param storedHeader
135
- * @param feeRate
117
+ * @inheritDoc
136
118
  */
137
119
  saveMainHeaders(signer: string, mainHeaders: BtcBlock[], storedHeader: SolanaBtcStoredHeader, feeRate?: string): Promise<{
138
120
  forkId: number;
@@ -144,13 +126,7 @@ export declare class SolanaBtcRelay<B extends BtcBlock> extends SolanaProgramBas
144
126
  computedCommitedHeaders: SolanaBtcStoredHeader[];
145
127
  }>;
146
128
  /**
147
- * Creates a new long fork and submits the headers to it
148
- *
149
- * @param signer
150
- * @param forkHeaders
151
- * @param storedHeader
152
- * @param tipWork
153
- * @param feeRate
129
+ * @inheritDoc
154
130
  */
155
131
  saveNewForkHeaders(signer: string, forkHeaders: BtcBlock[], storedHeader: SolanaBtcStoredHeader, tipWork: Buffer, feeRate?: string): Promise<{
156
132
  forkId: number;
@@ -162,14 +138,7 @@ export declare class SolanaBtcRelay<B extends BtcBlock> extends SolanaProgramBas
162
138
  computedCommitedHeaders: SolanaBtcStoredHeader[];
163
139
  }>;
164
140
  /**
165
- * Continues submitting blockheaders to a given fork
166
- *
167
- * @param signer
168
- * @param forkHeaders
169
- * @param storedHeader
170
- * @param forkId
171
- * @param tipWork
172
- * @param feeRate
141
+ * @inheritDoc
173
142
  */
174
143
  saveForkHeaders(signer: string, forkHeaders: BtcBlock[], storedHeader: SolanaBtcStoredHeader, forkId: number, tipWork: Buffer, feeRate?: string): Promise<{
175
144
  forkId: number;
@@ -181,13 +150,7 @@ export declare class SolanaBtcRelay<B extends BtcBlock> extends SolanaProgramBas
181
150
  computedCommitedHeaders: SolanaBtcStoredHeader[];
182
151
  }>;
183
152
  /**
184
- * Submits short fork with given blockheaders
185
- *
186
- * @param signer
187
- * @param forkHeaders
188
- * @param storedHeader
189
- * @param tipWork
190
- * @param feeRate
153
+ * @inheritDoc
191
154
  */
192
155
  saveShortForkHeaders(signer: string, forkHeaders: BtcBlock[], storedHeader: SolanaBtcStoredHeader, tipWork: Buffer, feeRate?: string): Promise<{
193
156
  forkId: number;
@@ -199,32 +162,23 @@ export declare class SolanaBtcRelay<B extends BtcBlock> extends SolanaProgramBas
199
162
  computedCommitedHeaders: SolanaBtcStoredHeader[];
200
163
  }>;
201
164
  /**
202
- * Sweeps fork data PDAs back to self
203
- *
204
- * @param signer
205
- * @param lastSweepId lastCheckedId returned from the previous sweepForkData() call
206
- * @returns {number} lastCheckedId that should be passed to the next call of sweepForkData()
165
+ * @inheritDoc
207
166
  */
208
167
  sweepForkData(signer: SolanaSigner, lastSweepId?: number): Promise<number | null>;
209
168
  /**
210
- * Estimate required synchronization fee (worst case) to synchronize btc relay to the required blockheight
211
- *
212
- * @param requiredBlockheight
213
- * @param feeRate
169
+ * @inheritDoc
214
170
  */
215
171
  estimateSynchronizeFee(requiredBlockheight: number, feeRate?: string): Promise<bigint>;
216
172
  /**
217
- * Returns fee required (in SOL) to synchronize a single block to btc relay
218
- *
219
- * @param feeRate
173
+ * @inheritDoc
220
174
  */
221
175
  getFeePerBlock(feeRate?: string): Promise<bigint>;
222
176
  /**
223
- * Gets fee rate required for submitting blockheaders to the main chain
177
+ * @inheritDoc
224
178
  */
225
179
  getMainFeeRate(signer: string | null): Promise<string>;
226
180
  /**
227
- * Gets fee rate required for submitting blockheaders to the specific fork
181
+ * @inheritDoc
228
182
  */
229
183
  getForkFeeRate(signer: string, forkId: number): Promise<string>;
230
184
  }
@@ -155,7 +155,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
155
155
  };
156
156
  }
157
157
  /**
158
- * Returns data about current main chain tip stored in the btc relay
158
+ * @inheritDoc
159
159
  */
160
160
  async getTipData() {
161
161
  const data = await this.program.account.mainState.fetchNullable(this.BtcRelayMainState);
@@ -169,11 +169,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
169
169
  };
170
170
  }
171
171
  /**
172
- * Retrieves blockheader with a specific blockhash, returns null if requiredBlockheight is provided and
173
- * btc relay contract is not synced up to the desired blockheight
174
- *
175
- * @param blockData
176
- * @param requiredBlockheight
172
+ * @inheritDoc
177
173
  */
178
174
  async retrieveLogAndBlockheight(blockData, requiredBlockheight) {
179
175
  const mainState = await this.program.account.mainState.fetch(this.BtcRelayMainState);
@@ -201,10 +197,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
201
197
  return data;
202
198
  }
203
199
  /**
204
- * Retrieves blockheader data by blockheader's commit hash,
205
- *
206
- * @param commitmentHashStr
207
- * @param blockData
200
+ * @inheritDoc
208
201
  */
209
202
  async retrieveLogByCommitHash(commitmentHashStr, blockData) {
210
203
  const blockHashBuffer = buffer_1.Buffer.from(blockData.blockhash, "hex").reverse();
@@ -223,7 +216,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
223
216
  return data;
224
217
  }
225
218
  /**
226
- * Retrieves latest known stored blockheader & blockheader from bitcoin RPC that is in the main chain
219
+ * @inheritDoc
227
220
  */
228
221
  async retrieveLatestKnownBlockLog() {
229
222
  const mainState = await this.program.account.mainState.fetch(this.BtcRelayMainState);
@@ -254,13 +247,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
254
247
  return data;
255
248
  }
256
249
  /**
257
- * Saves initial block header when the btc relay is in uninitialized state
258
- *
259
- * @param signer
260
- * @param header a bitcoin blockheader to submit
261
- * @param epochStart timestamp of the start of the epoch (block timestamp at blockheight-(blockheight%2016))
262
- * @param pastBlocksTimestamps timestamp of the past 10 blocks
263
- * @param feeRate fee rate to use for the transaction
250
+ * @inheritDoc
264
251
  */
265
252
  async saveInitialHeader(signer, header, epochStart, pastBlocksTimestamps, feeRate) {
266
253
  if (pastBlocksTimestamps.length !== 10)
@@ -271,12 +258,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
271
258
  return await action.tx(feeRate);
272
259
  }
273
260
  /**
274
- * Saves blockheaders as a bitcoin main chain to the btc relay
275
- *
276
- * @param signer
277
- * @param mainHeaders
278
- * @param storedHeader
279
- * @param feeRate
261
+ * @inheritDoc
280
262
  */
281
263
  async saveMainHeaders(signer, mainHeaders, storedHeader, feeRate) {
282
264
  feeRate ?? (feeRate = await this.getMainFeeRate(signer));
@@ -290,13 +272,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
290
272
  }));
291
273
  }
292
274
  /**
293
- * Creates a new long fork and submits the headers to it
294
- *
295
- * @param signer
296
- * @param forkHeaders
297
- * @param storedHeader
298
- * @param tipWork
299
- * @param feeRate
275
+ * @inheritDoc
300
276
  */
301
277
  async saveNewForkHeaders(signer, forkHeaders, storedHeader, tipWork, feeRate) {
302
278
  const mainState = await this.program.account.mainState.fetch(this.BtcRelayMainState);
@@ -320,14 +296,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
320
296
  return result;
321
297
  }
322
298
  /**
323
- * Continues submitting blockheaders to a given fork
324
- *
325
- * @param signer
326
- * @param forkHeaders
327
- * @param storedHeader
328
- * @param forkId
329
- * @param tipWork
330
- * @param feeRate
299
+ * @inheritDoc
331
300
  */
332
301
  async saveForkHeaders(signer, forkHeaders, storedHeader, forkId, tipWork, feeRate) {
333
302
  feeRate ?? (feeRate = await this.getForkFeeRate(signer, forkId));
@@ -349,13 +318,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
349
318
  return result;
350
319
  }
351
320
  /**
352
- * Submits short fork with given blockheaders
353
- *
354
- * @param signer
355
- * @param forkHeaders
356
- * @param storedHeader
357
- * @param tipWork
358
- * @param feeRate
321
+ * @inheritDoc
359
322
  */
360
323
  async saveShortForkHeaders(signer, forkHeaders, storedHeader, tipWork, feeRate) {
361
324
  feeRate ?? (feeRate = await this.getMainFeeRate(signer));
@@ -375,11 +338,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
375
338
  return result;
376
339
  }
377
340
  /**
378
- * Sweeps fork data PDAs back to self
379
- *
380
- * @param signer
381
- * @param lastSweepId lastCheckedId returned from the previous sweepForkData() call
382
- * @returns {number} lastCheckedId that should be passed to the next call of sweepForkData()
341
+ * @inheritDoc
383
342
  */
384
343
  async sweepForkData(signer, lastSweepId) {
385
344
  const mainState = await this.program.account.mainState.fetch(this.BtcRelayMainState);
@@ -410,10 +369,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
410
369
  return lastCheckedId ?? null;
411
370
  }
412
371
  /**
413
- * Estimate required synchronization fee (worst case) to synchronize btc relay to the required blockheight
414
- *
415
- * @param requiredBlockheight
416
- * @param feeRate
372
+ * @inheritDoc
417
373
  */
418
374
  async estimateSynchronizeFee(requiredBlockheight, feeRate) {
419
375
  const tipData = await this.getTipData();
@@ -429,9 +385,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
429
385
  return synchronizationFee;
430
386
  }
431
387
  /**
432
- * Returns fee required (in SOL) to synchronize a single block to btc relay
433
- *
434
- * @param feeRate
388
+ * @inheritDoc
435
389
  */
436
390
  async getFeePerBlock(feeRate) {
437
391
  // feeRate = feeRate || await this.getMainFeeRate(null);
@@ -439,7 +393,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
439
393
  return 50000n;
440
394
  }
441
395
  /**
442
- * Gets fee rate required for submitting blockheaders to the main chain
396
+ * @inheritDoc
443
397
  */
444
398
  getMainFeeRate(signer) {
445
399
  const _signer = signer == null ? null : new web3_js_1.PublicKey(signer);
@@ -449,7 +403,7 @@ class SolanaBtcRelay extends SolanaProgramBase_1.SolanaProgramBase {
449
403
  ]);
450
404
  }
451
405
  /**
452
- * Gets fee rate required for submitting blockheaders to the specific fork
406
+ * @inheritDoc
453
407
  */
454
408
  getForkFeeRate(signer, forkId) {
455
409
  const _signer = new web3_js_1.PublicKey(signer);
@@ -46,32 +46,101 @@ export declare class SolanaChainInterface implements ChainInterface<SolanaTx, Si
46
46
  error: (msg: string, ...args: any[]) => false | void;
47
47
  };
48
48
  constructor(connection: Connection, retryPolicy?: SolanaRetryPolicy, solanaFeeEstimator?: SolanaFees);
49
+ /**
50
+ * @inheritDoc
51
+ */
49
52
  getBalance(signer: string, tokenAddress: string): Promise<bigint>;
53
+ /**
54
+ * @inheritDoc
55
+ */
50
56
  isValidAddress(address: string): boolean;
57
+ /**
58
+ * @inheritDoc
59
+ */
51
60
  normalizeAddress(address: string): string;
61
+ /**
62
+ * @inheritDoc
63
+ */
52
64
  getNativeCurrencyAddress(): string;
65
+ /**
66
+ * @inheritDoc
67
+ */
53
68
  txsTransfer(signer: string, token: string, amount: bigint, dstAddress: string, feeRate?: string): Promise<SolanaTx[]>;
69
+ /**
70
+ * @inheritDoc
71
+ */
54
72
  transfer(signer: SolanaSigner, token: string, amount: bigint, dstAddress: string, txOptions?: TransactionConfirmationOptions): Promise<string>;
73
+ /**
74
+ * @inheritDoc
75
+ */
55
76
  sendAndConfirm(signer: SolanaSigner, txs: SolanaTx[], waitForConfirmation?: boolean, abortSignal?: AbortSignal, parallel?: boolean, onBeforePublish?: (txId: string, rawTx: string) => Promise<void>): Promise<string[]>;
77
+ /**
78
+ * @inheritDoc
79
+ */
56
80
  sendSignedAndConfirm(txs: SignedSolanaTx[], waitForConfirmation?: boolean, abortSignal?: AbortSignal, parallel?: boolean, onBeforePublish?: (txId: string, rawTx: string) => Promise<void>): Promise<string[]>;
81
+ /**
82
+ * @inheritDoc
83
+ */
57
84
  serializeTx(tx: SolanaTx): Promise<string>;
85
+ /**
86
+ * @inheritDoc
87
+ */
58
88
  deserializeTx(txData: string): Promise<SolanaTx>;
89
+ /**
90
+ * @inheritDoc
91
+ */
59
92
  serializeSignedTx(tx: Transaction): Promise<string>;
93
+ /**
94
+ * @inheritDoc
95
+ */
60
96
  deserializeSignedTx(txData: string): Promise<Transaction>;
97
+ /**
98
+ * @inheritDoc
99
+ */
61
100
  getTxIdStatus(txId: string): Promise<"not_found" | "pending" | "success" | "reverted">;
101
+ /**
102
+ * @inheritDoc
103
+ */
62
104
  getTxStatus(tx: string): Promise<"not_found" | "pending" | "success" | "reverted">;
105
+ /**
106
+ * @inheritDoc
107
+ */
63
108
  getFinalizedBlock(): Promise<{
64
109
  height: number;
65
110
  blockHash: string;
66
111
  }>;
112
+ /**
113
+ * @inheritDoc
114
+ */
67
115
  offBeforeTxReplace(callback: (oldTx: string, oldTxId: string, newTx: string, newTxId: string) => Promise<void>): boolean;
116
+ /**
117
+ * @inheritDoc
118
+ */
68
119
  onBeforeTxReplace(callback: (oldTx: string, oldTxId: string, newTx: string, newTxId: string) => Promise<void>): void;
120
+ /**
121
+ * @inheritDoc
122
+ */
69
123
  onBeforeTxSigned(callback: (tx: SolanaTx) => Promise<void>): void;
124
+ /**
125
+ * @inheritDoc
126
+ */
70
127
  offBeforeTxSigned(callback: (tx: SolanaTx) => Promise<void>): boolean;
71
128
  onSendTransaction(callback: (tx: Buffer, options?: SendOptions) => Promise<string>): void;
72
129
  offSendTransaction(callback: (tx: Buffer, options?: SendOptions) => Promise<string>): boolean;
130
+ /**
131
+ * @inheritDoc
132
+ */
73
133
  isValidToken(tokenIdentifier: string): boolean;
134
+ /**
135
+ * @inheritDoc
136
+ */
74
137
  randomAddress(): string;
138
+ /**
139
+ * @inheritDoc
140
+ */
75
141
  randomSigner(): SolanaSigner;
142
+ /**
143
+ * @inheritDoc
144
+ */
76
145
  wrapSigner(signer: Wallet): Promise<SolanaSigner>;
77
146
  }
@@ -33,6 +33,9 @@ class SolanaChainInterface {
33
33
  this.Signatures = new SolanaSignatures_1.SolanaSignatures(this);
34
34
  this.Events = new SolanaEvents_1.SolanaEvents(this);
35
35
  }
36
+ /**
37
+ * @inheritDoc
38
+ */
36
39
  async getBalance(signer, tokenAddress) {
37
40
  const token = new web3_js_1.PublicKey(tokenAddress);
38
41
  const publicKey = new web3_js_1.PublicKey(signer);
@@ -46,18 +49,33 @@ class SolanaChainInterface {
46
49
  this.logger.debug("getBalance(): token balance, token: " + token.toBase58() + " balance: " + balance.toString(10));
47
50
  return balance;
48
51
  }
52
+ /**
53
+ * @inheritDoc
54
+ */
49
55
  isValidAddress(address) {
50
56
  return SolanaAddresses_1.SolanaAddresses.isValidAddress(address);
51
57
  }
58
+ /**
59
+ * @inheritDoc
60
+ */
52
61
  normalizeAddress(address) {
53
62
  return address;
54
63
  }
64
+ /**
65
+ * @inheritDoc
66
+ */
55
67
  getNativeCurrencyAddress() {
56
68
  return this.Tokens.getNativeCurrencyAddress().toString();
57
69
  }
70
+ /**
71
+ * @inheritDoc
72
+ */
58
73
  txsTransfer(signer, token, amount, dstAddress, feeRate) {
59
74
  return this.Tokens.txsTransfer(new web3_js_1.PublicKey(signer), new web3_js_1.PublicKey(token), amount, new web3_js_1.PublicKey(dstAddress), feeRate);
60
75
  }
76
+ /**
77
+ * @inheritDoc
78
+ */
61
79
  async transfer(signer, token, amount, dstAddress, txOptions) {
62
80
  const txs = await this.Tokens.txsTransfer(signer.getPublicKey(), new web3_js_1.PublicKey(token), amount, new web3_js_1.PublicKey(dstAddress), txOptions?.feeRate);
63
81
  const [txId] = await this.Transactions.sendAndConfirm(signer, txs, txOptions?.waitForConfirmation, txOptions?.abortSignal, false);
@@ -65,30 +83,57 @@ class SolanaChainInterface {
65
83
  }
66
84
  ////////////////////////////////////////////
67
85
  //// Transactions
86
+ /**
87
+ * @inheritDoc
88
+ */
68
89
  sendAndConfirm(signer, txs, waitForConfirmation, abortSignal, parallel, onBeforePublish) {
69
90
  return this.Transactions.sendAndConfirm(signer, txs, waitForConfirmation, abortSignal, parallel, onBeforePublish);
70
91
  }
92
+ /**
93
+ * @inheritDoc
94
+ */
71
95
  sendSignedAndConfirm(txs, waitForConfirmation, abortSignal, parallel, onBeforePublish) {
72
96
  return this.Transactions.sendSignedAndConfirm(txs, waitForConfirmation, abortSignal, parallel, onBeforePublish);
73
97
  }
98
+ /**
99
+ * @inheritDoc
100
+ */
74
101
  serializeTx(tx) {
75
102
  return Promise.resolve(this.Transactions.serializeUnsignedTx(tx));
76
103
  }
104
+ /**
105
+ * @inheritDoc
106
+ */
77
107
  deserializeTx(txData) {
78
108
  return Promise.resolve(this.Transactions.deserializeUnsignedTx(txData));
79
109
  }
110
+ /**
111
+ * @inheritDoc
112
+ */
80
113
  serializeSignedTx(tx) {
81
114
  return Promise.resolve(this.Transactions.serializeSignedTx(tx));
82
115
  }
116
+ /**
117
+ * @inheritDoc
118
+ */
83
119
  deserializeSignedTx(txData) {
84
120
  return Promise.resolve(this.Transactions.deserializeSignedTransaction(txData));
85
121
  }
122
+ /**
123
+ * @inheritDoc
124
+ */
86
125
  getTxIdStatus(txId) {
87
126
  return this.Transactions.getTxIdStatus(txId);
88
127
  }
128
+ /**
129
+ * @inheritDoc
130
+ */
89
131
  getTxStatus(tx) {
90
132
  return this.Transactions.getTxStatus(tx);
91
133
  }
134
+ /**
135
+ * @inheritDoc
136
+ */
92
137
  async getFinalizedBlock() {
93
138
  const { block } = await this.Blocks.findLatestParsedBlock("finalized");
94
139
  return {
@@ -98,13 +143,25 @@ class SolanaChainInterface {
98
143
  }
99
144
  ///////////////////////////////////
100
145
  //// Callbacks & handlers
146
+ /**
147
+ * @inheritDoc
148
+ */
101
149
  offBeforeTxReplace(callback) {
102
150
  return true;
103
151
  }
152
+ /**
153
+ * @inheritDoc
154
+ */
104
155
  onBeforeTxReplace(callback) { }
156
+ /**
157
+ * @inheritDoc
158
+ */
105
159
  onBeforeTxSigned(callback) {
106
160
  this.Transactions.onBeforeTxSigned(callback);
107
161
  }
162
+ /**
163
+ * @inheritDoc
164
+ */
108
165
  offBeforeTxSigned(callback) {
109
166
  return this.Transactions.offBeforeTxSigned(callback);
110
167
  }
@@ -114,6 +171,9 @@ class SolanaChainInterface {
114
171
  offSendTransaction(callback) {
115
172
  return this.Transactions.offSendTransaction(callback);
116
173
  }
174
+ /**
175
+ * @inheritDoc
176
+ */
117
177
  isValidToken(tokenIdentifier) {
118
178
  try {
119
179
  new web3_js_1.PublicKey(tokenIdentifier);
@@ -123,14 +183,23 @@ class SolanaChainInterface {
123
183
  return false;
124
184
  }
125
185
  }
186
+ /**
187
+ * @inheritDoc
188
+ */
126
189
  randomAddress() {
127
190
  return web3_js_1.Keypair.generate().publicKey.toString();
128
191
  }
192
+ /**
193
+ * @inheritDoc
194
+ */
129
195
  randomSigner() {
130
196
  const keypair = web3_js_1.Keypair.generate();
131
197
  const wallet = new SolanaKeypairWallet_1.SolanaKeypairWallet(keypair);
132
198
  return new SolanaSigner_1.SolanaSigner(wallet, keypair);
133
199
  }
200
+ /**
201
+ * @inheritDoc
202
+ */
134
203
  wrapSigner(signer) {
135
204
  return Promise.resolve(new SolanaSigner_1.SolanaSigner(signer));
136
205
  }
@@ -24,10 +24,9 @@ class SolanaBlocks extends SolanaModule_1.SolanaModule {
24
24
  return val;
25
25
  });
26
26
  this.blockCache.set(slot, blockCacheData);
27
- blockCacheData.catch(e => {
27
+ blockCacheData.catch(() => {
28
28
  if (this.blockCache.get(slot) == blockCacheData)
29
29
  this.blockCache.delete(slot);
30
- throw e;
31
30
  });
32
31
  return blockCacheData;
33
32
  }
@@ -22,11 +22,10 @@ class SolanaSlots extends SolanaModule_1.SolanaModule {
22
22
  slot: slotPromise,
23
23
  timestamp
24
24
  };
25
- slotPromise.catch(e => {
25
+ slotPromise.catch(() => {
26
26
  const slotCache = this.slotCache[commitment];
27
27
  if (slotCache != null && slotCache.slot === slotPromise)
28
28
  delete this.slotCache[commitment];
29
- throw e;
30
29
  });
31
30
  return {
32
31
  slot: slotPromise,
@@ -116,13 +116,23 @@ export declare class SolanaChainEventsBrowser implements ChainEvents<SolanaSwapD
116
116
  */
117
117
  private processSignatures;
118
118
  /**
119
- * Polls for new events & processes them
120
- *
121
- * @private
119
+ * @inheritDoc
122
120
  */
123
121
  poll(lastSignature?: SolanaEventListenerState): Promise<SolanaEventListenerState | null>;
122
+ /**
123
+ * @inheritDoc
124
+ */
124
125
  init(noAutomaticPoll?: boolean): Promise<void>;
126
+ /**
127
+ * @inheritDoc
128
+ */
125
129
  stop(): Promise<void>;
130
+ /**
131
+ * @inheritDoc
132
+ */
126
133
  registerListener(cbk: EventListener<SolanaSwapData>): void;
134
+ /**
135
+ * @inheritDoc
136
+ */
127
137
  unregisterListener(cbk: EventListener<SolanaSwapData>): boolean;
128
138
  }
@@ -297,9 +297,7 @@ class SolanaChainEventsBrowser {
297
297
  return lastSuccessfulSignature;
298
298
  }
299
299
  /**
300
- * Polls for new events & processes them
301
- *
302
- * @private
300
+ * @inheritDoc
303
301
  */
304
302
  async poll(lastSignature) {
305
303
  let signatures = lastSignature == null
@@ -310,21 +308,33 @@ class SolanaChainEventsBrowser {
310
308
  let lastSuccessfulSignature = await this.processSignatures(signatures);
311
309
  return lastSuccessfulSignature ?? lastSignature ?? null;
312
310
  }
311
+ /**
312
+ * @inheritDoc
313
+ */
313
314
  init(noAutomaticPoll) {
314
315
  if (noAutomaticPoll)
315
316
  return Promise.resolve();
316
317
  this.setupWebsocket();
317
318
  return Promise.resolve();
318
319
  }
320
+ /**
321
+ * @inheritDoc
322
+ */
319
323
  async stop() {
320
324
  for (let num of this.eventListeners) {
321
325
  await this.solanaSwapProgram.program.removeEventListener(num);
322
326
  }
323
327
  this.eventListeners = [];
324
328
  }
329
+ /**
330
+ * @inheritDoc
331
+ */
325
332
  registerListener(cbk) {
326
333
  this.listeners.push(cbk);
327
334
  }
335
+ /**
336
+ * @inheritDoc
337
+ */
328
338
  unregisterListener(cbk) {
329
339
  const index = this.listeners.indexOf(cbk);
330
340
  if (index >= 0) {