@1stdex/first-sdk 1.0.92-beta.4 → 1.0.92-beta.5
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/cjs/views/book.js +7 -6
- package/dist/cjs/views/book.js.map +1 -1
- package/dist/esm/views/book.js +14 -13
- package/dist/esm/views/book.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/views/book.d.ts +8 -11
- package/dist/types/views/book.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CHAIN_IDS } from '../constants/chain-configs/chain';
|
|
2
|
-
import {
|
|
2
|
+
import { CurrencyAmount } from '../entities/currency/types';
|
|
3
3
|
/**
|
|
4
4
|
* Gets trade information for a specific book, tick and quote units.
|
|
5
5
|
*
|
|
@@ -8,11 +8,9 @@ import { Currency } from '../entities/currency/types';
|
|
|
8
8
|
* @param {bigint} tick - The tick for the trade
|
|
9
9
|
* @param {bigint} quoteUnits - The number of quote units
|
|
10
10
|
*
|
|
11
|
-
* @returns {Promise<{
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* - baseCurrency: The base currency information
|
|
15
|
-
* - baseAmount: The raw base token amount
|
|
11
|
+
* @returns {Promise<{ quote: CurrencyAmount; base: CurrencyAmount }>} An object containing:
|
|
12
|
+
* - quote: The quote currency and formatted amount
|
|
13
|
+
* - base: The base currency and formatted amount
|
|
16
14
|
*
|
|
17
15
|
* @example
|
|
18
16
|
* import { getTradeInfo } from '@1stdex/first-sdk'
|
|
@@ -23,7 +21,8 @@ import { Currency } from '../entities/currency/types';
|
|
|
23
21
|
* tick: 1000n,
|
|
24
22
|
* quoteUnits: 5n,
|
|
25
23
|
* })
|
|
26
|
-
*
|
|
24
|
+
* console.log(`Quote: ${result.quote.value} ${result.quote.currency.symbol}`)
|
|
25
|
+
* console.log(`Base: ${result.base.value} ${result.base.currency.symbol}`)
|
|
27
26
|
*/
|
|
28
27
|
export declare const getTradeInfo: ({ chainId, bookId, tick, quoteUnits, }: {
|
|
29
28
|
chainId: CHAIN_IDS;
|
|
@@ -31,9 +30,7 @@ export declare const getTradeInfo: ({ chainId, bookId, tick, quoteUnits, }: {
|
|
|
31
30
|
tick: bigint;
|
|
32
31
|
quoteUnits: bigint;
|
|
33
32
|
}) => Promise<{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
baseCurrency: Currency;
|
|
37
|
-
baseAmount: bigint;
|
|
33
|
+
quote: CurrencyAmount;
|
|
34
|
+
base: CurrencyAmount;
|
|
38
35
|
}>;
|
|
39
36
|
//# sourceMappingURL=book.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../../src/views/book.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../../src/views/book.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,EAAY,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGtE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,YAAY,2CAKtB;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,KAAG,QAAQ;IACV,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,cAAc,CAAC;CACtB,CAiEA,CAAC"}
|