@gardenfi/core 2.0.4 → 2.0.6
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/dist/index.cjs +15 -15
- package/dist/index.js +2762 -2542
- package/dist/src/lib/quote/quote.d.ts +2 -2
- package/dist/src/lib/quote/quote.types.d.ts +2 -2
- package/dist/src/lib/switchOrAddNetwork.d.ts +0 -37
- package/dist/src/lib/utils.d.ts +2 -2
- package/package.json +2 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AsyncResult } from '@catalogfi/utils';
|
|
1
|
+
import { AsyncResult, Request } from '@catalogfi/utils';
|
|
2
2
|
import { IQuote, QuoteResponse, Strategies } from './quote.types';
|
|
3
3
|
import { CreateOrderRequestWithAdditionalData, CreateOrderReqWithStrategyId } from '@gardenfi/orderbook';
|
|
4
4
|
|
|
5
5
|
export declare class Quote implements IQuote {
|
|
6
6
|
private quoteUrl;
|
|
7
7
|
constructor(quoteUrl: string);
|
|
8
|
-
getQuote(orderpair: string, amount: number, isExactOut?: boolean): Promise<import('@catalogfi/utils').Result<never, string> | import('@catalogfi/utils').Result<QuoteResponse, never>>;
|
|
8
|
+
getQuote(orderpair: string, amount: number, isExactOut?: boolean, request?: Request): Promise<import('@catalogfi/utils').Result<never, string> | import('@catalogfi/utils').Result<QuoteResponse, never>>;
|
|
9
9
|
getAttestedQuote(order: CreateOrderReqWithStrategyId): AsyncResult<CreateOrderRequestWithAdditionalData, string>;
|
|
10
10
|
getStrategies(): Promise<import('@catalogfi/utils').Result<never, string> | import('@catalogfi/utils').Result<Strategies, never>>;
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsyncResult } from '@catalogfi/utils';
|
|
1
|
+
import { AsyncResult, Request } from '@catalogfi/utils';
|
|
2
2
|
import { Chain, CreateOrderRequestWithAdditionalData, CreateOrderReqWithStrategyId } from '@gardenfi/orderbook';
|
|
3
3
|
import { APIResponse } from '@gardenfi/utils';
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ export interface IQuote {
|
|
|
13
13
|
* @param amount - The amount to quote
|
|
14
14
|
* @param isExactOut - Whether the amount is exact out
|
|
15
15
|
*/
|
|
16
|
-
getQuote(orderpair: string, amount: number, isExactOut: boolean): AsyncResult<QuoteResponse, string>;
|
|
16
|
+
getQuote(orderpair: string, amount: number, isExactOut: boolean, request?: Request): AsyncResult<QuoteResponse, string>;
|
|
17
17
|
/**
|
|
18
18
|
* Attest the quote, server will return a signature by verifying and signing the quote according to the provided `strategy_id`
|
|
19
19
|
* @param order - The order for which the attestation is requested. Order should include `strategy_id` in the `additional_data` field.
|
|
@@ -40,43 +40,6 @@ export declare const citreaTestnet: {
|
|
|
40
40
|
formatters?: undefined;
|
|
41
41
|
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
42
42
|
};
|
|
43
|
-
export declare const monadTestnet: {
|
|
44
|
-
blockExplorers: {
|
|
45
|
-
readonly default: {
|
|
46
|
-
readonly name: "Monad Explorer";
|
|
47
|
-
readonly url: "https://explorer.monad-devnet.devnet101.com";
|
|
48
|
-
readonly apiUrl: "https://explorer.monad-devnet.devnet101.com/api/";
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
contracts?: import('viem').Prettify<{
|
|
52
|
-
[key: string]: import('viem').ChainContract | {
|
|
53
|
-
[sourceId: number]: import('viem').ChainContract | undefined;
|
|
54
|
-
} | undefined;
|
|
55
|
-
} & {
|
|
56
|
-
ensRegistry?: import('viem').ChainContract | undefined;
|
|
57
|
-
ensUniversalResolver?: import('viem').ChainContract | undefined;
|
|
58
|
-
multicall3?: import('viem').ChainContract | undefined;
|
|
59
|
-
universalSignatureVerifier?: import('viem').ChainContract | undefined;
|
|
60
|
-
}> | undefined;
|
|
61
|
-
id: 10143;
|
|
62
|
-
name: "Monad Testnet";
|
|
63
|
-
nativeCurrency: {
|
|
64
|
-
readonly name: "Monad";
|
|
65
|
-
readonly symbol: "MON";
|
|
66
|
-
readonly decimals: 18;
|
|
67
|
-
};
|
|
68
|
-
rpcUrls: {
|
|
69
|
-
readonly default: {
|
|
70
|
-
readonly http: readonly ["https://rpc.monad-testnet.category.xyz/rpc/SPa4TbSgMJxz5ywmzYvvc9O5nkAVGTgOcsi7yErG"];
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
sourceId?: number | undefined;
|
|
74
|
-
testnet: true;
|
|
75
|
-
custom?: Record<string, unknown> | undefined;
|
|
76
|
-
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
77
|
-
formatters?: undefined;
|
|
78
|
-
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
79
|
-
};
|
|
80
43
|
export declare const evmToViemChainMap: Record<EvmChain, viemChain>;
|
|
81
44
|
/**
|
|
82
45
|
* Switches or adds a network to the wallet
|
package/dist/src/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BitcoinNetwork, IBaseWallet } from '@catalogfi/wallets';
|
|
2
2
|
import { Environment } from '@gardenfi/utils';
|
|
3
|
-
import { Chain
|
|
3
|
+
import { Chain } from '@gardenfi/orderbook';
|
|
4
4
|
|
|
5
5
|
export declare const computeSecret: (fromChain: Chain, toChain: Chain, wallets: Partial<Record<Chain, IBaseWallet>>, nonce: number) => Promise<string>;
|
|
6
6
|
export declare const isFromChainBitcoin: (chain: Chain) => chain is "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest";
|
|
@@ -21,5 +21,5 @@ export declare function sortLeaves(leaf1: Buffer, leaf2: Buffer): Buffer[];
|
|
|
21
21
|
export declare const toXOnly: (pubKey: string) => string;
|
|
22
22
|
export declare const isValidBitcoinPubKey: (pubKey: string) => boolean;
|
|
23
23
|
export declare const constructOrderPair: (sourceChain: Chain, sourceAsset: string, destChain: Chain, destAsset: string) => string;
|
|
24
|
-
export declare function validateBTCAddress(address: string, networkType:
|
|
24
|
+
export declare function validateBTCAddress(address: string, networkType: Environment): boolean;
|
|
25
25
|
export declare const getBitcoinNetwork: (network: Environment) => BitcoinNetwork;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
"registry": "https://registry.npmjs.org/"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@catalogfi/utils": "^0.1.6",
|
|
30
29
|
"@catalogfi/wallets": "^0.2.51",
|
|
31
|
-
"@gardenfi/orderbook": "^2.0.
|
|
30
|
+
"@gardenfi/orderbook": "^2.0.0",
|
|
32
31
|
"@gardenfi/utils": "^2.0.0",
|
|
33
32
|
"bignumber.js": "^9.1.2",
|
|
34
33
|
"bitcoinjs-lib": "^6.1.6",
|