@atomiqlabs/chain-starknet 4.0.0-dev.14 → 4.0.0-dev.15

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.
@@ -61,7 +61,7 @@ export declare class StarknetBtcRelay<B extends BtcBlock> extends StarknetContra
61
61
  }, requiredBlockheight?: number): Promise<{
62
62
  header: StarknetBtcStoredHeader;
63
63
  height: number;
64
- } | null>;
64
+ }>;
65
65
  /**
66
66
  * Retrieves blockheader data by blockheader's commit hash,
67
67
  *
@@ -26,6 +26,13 @@ export declare class Rpc09ChannelWithRetries extends RPC09.RpcChannel {
26
26
  protected fetchEndpoint(method: any, params?: any): Promise<any>;
27
27
  }
28
28
  export declare class RpcProviderWithRetries extends RpcProvider {
29
+ /**
30
+ * Tries to do naive detection of the spec version based on the suffix of nodeUrl, better pass the `specVersion`
31
+ * in the options!
32
+ *
33
+ * @param options
34
+ * @param retryPolicy
35
+ */
29
36
  constructor(options?: RpcProviderOptions, retryPolicy?: {
30
37
  maxRetries?: number;
31
38
  delay?: number;
@@ -44,6 +44,13 @@ class Rpc09ChannelWithRetries extends starknet_1.RPC09.RpcChannel {
44
44
  }
45
45
  exports.Rpc09ChannelWithRetries = Rpc09ChannelWithRetries;
46
46
  class RpcProviderWithRetries extends starknet_1.RpcProvider {
47
+ /**
48
+ * Tries to do naive detection of the spec version based on the suffix of nodeUrl, better pass the `specVersion`
49
+ * in the options!
50
+ *
51
+ * @param options
52
+ * @param retryPolicy
53
+ */
47
54
  constructor(options, retryPolicy) {
48
55
  if (options.specVersion == null)
49
56
  options.specVersion = options.nodeUrl.endsWith("v0_8") ? "0.8.1" : "0.9.0";
@@ -148,7 +148,7 @@ export declare class StarknetSwapContract extends StarknetContractBase<typeof Es
148
148
  txid: string;
149
149
  hex: string;
150
150
  height: number;
151
- }, requiredConfirmations: number, vout: number, commitedHeader?: StarknetBtcStoredHeader, synchronizer?: RelaySynchronizer<StarknetBtcStoredHeader, StarknetTx, any>, initAta?: boolean, feeRate?: string): Promise<StarknetTx[] | null>;
151
+ }, requiredConfirmations: number, vout: number, commitedHeader?: StarknetBtcStoredHeader, synchronizer?: RelaySynchronizer<StarknetBtcStoredHeader, StarknetTx, any>, initAta?: boolean, feeRate?: string): Promise<StarknetTx[]>;
152
152
  txsRefund(signer: string, swapData: StarknetSwapData, check?: boolean, initAta?: boolean, feeRate?: string): Promise<StarknetTx[]>;
153
153
  txsRefundWithAuthorization(signer: string, swapData: StarknetSwapData, { timeout, prefix, signature }: {
154
154
  timeout: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/chain-starknet",
3
- "version": "4.0.0-dev.14",
3
+ "version": "4.0.0-dev.15",
4
4
  "description": "Starknet specific base implementation",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@atomiqlabs/base": "^10.0.0-dev.9",
32
32
  "@noble/hashes": "^1.7.1",
33
- "@scure/btc-signer": "1.6.0",
33
+ "@scure/btc-signer": "^1.6.0",
34
34
  "abi-wan-kanabi": "2.2.4",
35
35
  "buffer": "6.0.3"
36
36
  },
@@ -222,7 +222,7 @@ export class StarknetBtcRelay<B extends BtcBlock>
222
222
  public async retrieveLogAndBlockheight(blockData: {blockhash: string}, requiredBlockheight?: number): Promise<{
223
223
  header: StarknetBtcStoredHeader,
224
224
  height: number
225
- } | null> {
225
+ }> {
226
226
  //TODO: we can fetch the blockheight and events in parallel
227
227
  const blockHeight = await this.getBlockHeight();
228
228
  if(requiredBlockheight!=null && blockHeight < requiredBlockheight) {
@@ -59,6 +59,13 @@ export class Rpc09ChannelWithRetries extends RPC09.RpcChannel {
59
59
 
60
60
  export class RpcProviderWithRetries extends RpcProvider {
61
61
 
62
+ /**
63
+ * Tries to do naive detection of the spec version based on the suffix of nodeUrl, better pass the `specVersion`
64
+ * in the options!
65
+ *
66
+ * @param options
67
+ * @param retryPolicy
68
+ */
62
69
  constructor(options?: RpcProviderOptions, retryPolicy?: {
63
70
  maxRetries?: number, delay?: number, exponential?: boolean
64
71
  }) {
@@ -466,7 +466,7 @@ export class StarknetSwapContract
466
466
  synchronizer?: RelaySynchronizer<StarknetBtcStoredHeader, StarknetTx, any>,
467
467
  initAta?: boolean,
468
468
  feeRate?: string
469
- ): Promise<StarknetTx[] | null> {
469
+ ): Promise<StarknetTx[]> {
470
470
  return this.Claim.txsClaimWithTxData(
471
471
  typeof(signer)==="string" ? signer : signer.getAddress(),
472
472
  swapData,