@avail-project/ca-common 2.0.0 → 2.2.0

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.
@@ -0,0 +1,54 @@
1
+ import { Hex } from "viem";
2
+ import { Aggregator, Quote, QuoteRequestExactInput, QuoteRequestExactOutput } from "./iface";
3
+ export type FibrousToken = {
4
+ name: string;
5
+ symbol?: string;
6
+ address: Hex;
7
+ decimals: number;
8
+ price: number | string | null;
9
+ };
10
+ export type FibrousResponse = {
11
+ route: {
12
+ success: boolean;
13
+ routeSwapType: number;
14
+ inputToken: FibrousToken;
15
+ inputAmount: string;
16
+ outputToken: FibrousToken;
17
+ outputAmount: string;
18
+ };
19
+ calldata: {
20
+ route: {
21
+ token_in: Hex;
22
+ token_out: Hex;
23
+ amount_in: string;
24
+ amount_out: string;
25
+ min_received: string;
26
+ destination: Hex;
27
+ swap_type: number;
28
+ };
29
+ swap_parameters: Array<{
30
+ token_in: Hex;
31
+ token_out: Hex;
32
+ rate: string;
33
+ protocol_id: string;
34
+ pool_address: Hex;
35
+ swap_type: number;
36
+ extra_data: Hex;
37
+ }>;
38
+ };
39
+ router_address: Hex;
40
+ };
41
+ export type FibrousQuote = Quote & {
42
+ originalResponse: FibrousResponse;
43
+ };
44
+ export type FibrousAggregatorOptions = {
45
+ apiKey?: string;
46
+ slippage?: number;
47
+ };
48
+ export declare class FibrousAggregator implements Aggregator {
49
+ private static readonly BASE_URL;
50
+ private readonly axios;
51
+ private readonly slippage;
52
+ constructor(options?: FibrousAggregatorOptions);
53
+ getQuotes(requests: (QuoteRequestExactInput | QuoteRequestExactOutput)[]): Promise<(Quote | null)[]>;
54
+ }
@@ -49,6 +49,7 @@ export interface Quote {
49
49
  }
50
50
  type CommonQuoteParameters = {
51
51
  userAddress: Bytes;
52
+ receiverAddress?: Bytes;
52
53
  chain: OmniversalChainID;
53
54
  inputToken: Bytes;
54
55
  outputToken: Bytes;
@@ -1,4 +1,5 @@
1
1
  export * from './iface';
2
2
  export * from './lifi-agg';
3
3
  export * from './bebop-agg';
4
+ export * from './fibrous-agg';
4
5
  export * from './autochoice';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avail-project/ca-common",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "common utilities for CA",
5
5
  "files": [
6
6
  "dist"
@@ -63,7 +63,10 @@
63
63
  "es-toolkit": "^1.39.7",
64
64
  "tslib": "^2.8.1"
65
65
  },
66
+ "publishConfig": {
67
+ "provenance": true
68
+ },
66
69
  "repository": {
67
- "url": "https://github.com/availproject/ca-common"
70
+ "url": "git+https://github.com/availproject/ca-common.git"
68
71
  }
69
72
  }