@gardenfi/core 0.2.0-beta.44 → 0.2.0-beta.46

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.
@@ -1,5 +1,7 @@
1
1
  export { Garden } from './lib/garden/garden';
2
2
  export type { IGardenJS, SwapParams, TimeLocks, OrderActions, GardenEvents, IOrderExecutorCache, OrderCacheValue, EventCallback, } from './lib/garden/garden.types';
3
+ export { BlockNumberFetcher } from './lib/garden/blockNumber';
4
+ export type { IBlockNumberFetcher, Network } from './lib/garden/blockNumber';
3
5
  export { EvmRelay } from './lib/evm/relay/evmRelay';
4
6
  export type { IEVMRelay } from './lib/evm/relay/evmRelay.types';
5
7
  export type { OrderStatus, SwapStatus } from './lib/status';
@@ -0,0 +1,16 @@
1
+ import { AsyncResult } from '@catalogfi/utils';
2
+ import { Chain } from '@gardenfi/orderbook';
3
+
4
+ export type Network = 'testnet' | 'mainnet';
5
+ type Response = {
6
+ [key in Chain]: number;
7
+ };
8
+ export interface IBlockNumberFetcher {
9
+ fetchBlockNumbers(): AsyncResult<Response, string>;
10
+ }
11
+ export declare class BlockNumberFetcher implements IBlockNumberFetcher {
12
+ private url;
13
+ constructor(url: string, network: Network);
14
+ fetchBlockNumbers(): AsyncResult<Response, string>;
15
+ }
16
+ export {};
@@ -6,6 +6,7 @@ import { IAuth } from '@gardenfi/utils';
6
6
  import { IQuote } from '../quote/quote.types';
7
7
  import { WalletClient } from 'viem';
8
8
  import { IBitcoinWallet } from '@catalogfi/wallets';
9
+ import { Network } from './blockNumber';
9
10
 
10
11
  export declare class Garden implements IGardenJS {
11
12
  private secretManager;
@@ -20,6 +21,7 @@ export declare class Garden implements IGardenJS {
20
21
  private wallets;
21
22
  private evmAddress;
22
23
  private orderExecutorCache;
24
+ private blockNumberFetcher;
23
25
  constructor(config: {
24
26
  orderbookURl: string;
25
27
  secretManager: ISecretManager;
@@ -29,6 +31,10 @@ export declare class Garden implements IGardenJS {
29
31
  evmWallet: WalletClient;
30
32
  btcWallet?: IBitcoinWallet;
31
33
  };
34
+ blockNumberFetcher?: {
35
+ url: string;
36
+ network: Network;
37
+ };
32
38
  });
33
39
  getPendingOrderCount(): number;
34
40
  setUseRelay(useRelay: boolean): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/core",
3
- "version": "0.2.0-beta.44",
3
+ "version": "0.2.0-beta.46",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"