@covalenthq/client-sdk 2.1.2 → 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.
- package/README.md +22 -6
- package/dist/cjs/index.js +90 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/GoldRushClient.d.ts +3 -1
- package/dist/cjs/src/services/AllChainsService.d.ts +26 -0
- package/dist/cjs/src/utils/functions/endpointGenerator.d.ts +1 -1
- package/dist/cjs/src/utils/functions/timestamp-parser.d.ts +1 -1
- package/dist/cjs/src/utils/types/AllChainService.types.d.ts +32 -0
- package/dist/cjs/src/utils/types/BaseService.types.d.ts +2 -0
- package/dist/cjs/src/utils/types/Generic.types.d.ts +8 -0
- package/dist/cjs/src/utils/types/PricingService.types.d.ts +3 -2
- package/dist/cjs/src/utils/types/TransactionService.types.d.ts +1 -0
- package/dist/esm/index.js +90 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/GoldRushClient.d.ts +3 -1
- package/dist/esm/src/services/AllChainsService.d.ts +26 -0
- package/dist/esm/src/utils/functions/endpointGenerator.d.ts +1 -1
- package/dist/esm/src/utils/functions/timestamp-parser.d.ts +1 -1
- package/dist/esm/src/utils/types/AllChainService.types.d.ts +32 -0
- package/dist/esm/src/utils/types/BaseService.types.d.ts +2 -0
- package/dist/esm/src/utils/types/Generic.types.d.ts +8 -0
- package/dist/esm/src/utils/types/PricingService.types.d.ts +3 -2
- package/dist/esm/src/utils/types/TransactionService.types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AllChainsService } from "./services/AllChainsService";
|
|
1
2
|
import { BalanceService } from "./services/BalanceService";
|
|
2
3
|
import { BaseService } from "./services/BaseService";
|
|
3
4
|
import { NftService } from "./services/NftService";
|
|
@@ -10,11 +11,12 @@ import { type GoldRushClientSettings } from "./utils/types/Generic.types";
|
|
|
10
11
|
*/
|
|
11
12
|
export declare class GoldRushClient {
|
|
12
13
|
private readonly userAgent;
|
|
13
|
-
|
|
14
|
+
AllChainsService: AllChainsService;
|
|
14
15
|
BalanceService: BalanceService;
|
|
15
16
|
BaseService: BaseService;
|
|
16
17
|
NftService: NftService;
|
|
17
18
|
PricingService: PricingService;
|
|
19
|
+
SecurityService: SecurityService;
|
|
18
20
|
TransactionService: TransactionService;
|
|
19
21
|
constructor(apiKey: string, settings?: GoldRushClientSettings);
|
|
20
22
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Execution } from "../utils/functions/execution";
|
|
2
|
+
import { type GetMultiChainAndMultiAddressTransactionsParamOtps, type MultiChainMultiAddressTransactionsResponse } from "../utils/types/AllChainService.types";
|
|
3
|
+
import { type GoldRushResponse } from "../utils/types/Generic.types";
|
|
4
|
+
/**
|
|
5
|
+
* Cross Chain API
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare class AllChainsService {
|
|
9
|
+
private execution;
|
|
10
|
+
constructor(execution: Execution);
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* Commonly used to get transactions cross chains and addresses.
|
|
14
|
+
*
|
|
15
|
+
* @param {Chain[]} chains - An array of the chain names or IDs to retrieve transactions from. Defaults to all foundational chains.
|
|
16
|
+
* @param {string[]} addresses - An array of addresses for which transactions are fetched. Does not support name resolution.
|
|
17
|
+
* @param {number} limit - Number of transactions to return per page, up to the default max of 100 items.
|
|
18
|
+
* @param {string} before - Pagination cursor pointing to fetch transactions before a certain point.
|
|
19
|
+
* @param {string} after - Pagination cursor pointing to fetch transactions after a certain point.
|
|
20
|
+
* @param {boolean} withLogs - Whether to include raw logs in the response.
|
|
21
|
+
* @param {boolean} withDecodedLogs - Whether to include decoded logs in the response.
|
|
22
|
+
* @param {Quote | "BTC" | "ETH"} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, `GBP`, "BTC" and "ETH".
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
getMultiChainAndMultiAddressTransactions(queryParamOpts?: GetMultiChainAndMultiAddressTransactionsParamOtps): Promise<GoldRushResponse<MultiChainMultiAddressTransactionsResponse>>;
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const timestampParser: (timestamp: string | Date, type: "descriptive" | "DD MMM YY" | "relative" | "YYYY
|
|
1
|
+
export declare const timestampParser: (timestamp: string | Date, type: "descriptive" | "DD MMM YY" | "relative" | "YYYY-MM-DD") => string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Chain, type Nullable, type Quote } from "./Generic.types";
|
|
2
|
+
import { type Transaction } from "./TransactionService.types";
|
|
3
|
+
export type MultiChainMultiAddressTransactionsResponse = Nullable<{
|
|
4
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
5
|
+
updated_at: Date;
|
|
6
|
+
/** * The the pagination cursor to get the previous page of results */
|
|
7
|
+
cursor_before: string;
|
|
8
|
+
/** * The the pagination cursor to get the next page of results */
|
|
9
|
+
cursor_after: string;
|
|
10
|
+
/** * The requested quote currency eg: `USD`. */
|
|
11
|
+
quote_currency: Quote | "ETH" | "BTC";
|
|
12
|
+
/** * List of response items. */
|
|
13
|
+
items: Transaction[];
|
|
14
|
+
}>;
|
|
15
|
+
export type GetMultiChainAndMultiAddressTransactionsParamOtps = Nullable<{
|
|
16
|
+
/** * An array of the chain names or IDs to retrieve transactions from. Defaults to all foundational chains. */
|
|
17
|
+
chains?: Chain[];
|
|
18
|
+
/** * An array of addresses for which transactions are fetched. Does not support name resolution. */
|
|
19
|
+
addresses?: string[];
|
|
20
|
+
/** * Number of transactions to return per page, up to the default max of 100 items. */
|
|
21
|
+
limit?: number;
|
|
22
|
+
/** * Pagination cursor pointing to fetch transactions before a certain point. */
|
|
23
|
+
before?: string;
|
|
24
|
+
/** * Pagination cursor pointing to fetch transactions after a certain point. */
|
|
25
|
+
after?: string;
|
|
26
|
+
/** * Whether to include raw logs in the response. */
|
|
27
|
+
withLogs?: boolean;
|
|
28
|
+
/** * Whether to include decoded logs in the response. */
|
|
29
|
+
withDecodedLogs?: boolean;
|
|
30
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, `GBP`, "BTC" and "ETH". */
|
|
31
|
+
quoteCurrency?: Quote | "BTC" | "ETH";
|
|
32
|
+
}>;
|
|
@@ -181,6 +181,8 @@ export type ChainItem = Nullable<{
|
|
|
181
181
|
is_appchain: boolean;
|
|
182
182
|
/** * The ChainItem the appchain is a part of. */
|
|
183
183
|
appchain_of: ChainItem;
|
|
184
|
+
/** * A classification of the chain */
|
|
185
|
+
priority_label: "Foundational" | "Frontier" | "Community";
|
|
184
186
|
}>;
|
|
185
187
|
export type ColorTheme = Nullable<{
|
|
186
188
|
/** * The red color code. */
|
|
@@ -381,6 +381,14 @@ export interface NftExternalData {
|
|
|
381
381
|
animation_url: string;
|
|
382
382
|
external_url: string;
|
|
383
383
|
attributes: NftCollectionAttribute[];
|
|
384
|
+
thumbnails: NFTThumbnails;
|
|
385
|
+
}
|
|
386
|
+
export interface NFTThumbnails {
|
|
387
|
+
image256: string;
|
|
388
|
+
image512: string;
|
|
389
|
+
image1024: string;
|
|
390
|
+
image_opengraph_url: string;
|
|
391
|
+
thumbhash: string;
|
|
384
392
|
}
|
|
385
393
|
export interface DecodedItem {
|
|
386
394
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ContractMetadata, type LogoUrls, type Nullable } from "./Generic.types";
|
|
1
|
+
import { type ContractMetadata, type LogoUrls, type Nullable, type Quote } from "./Generic.types";
|
|
2
2
|
export type TokenPricesResponse = Nullable<{
|
|
3
3
|
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
4
4
|
contract_decimals: number;
|
|
@@ -12,9 +12,10 @@ export type TokenPricesResponse = Nullable<{
|
|
|
12
12
|
supports_erc: string[];
|
|
13
13
|
/** * The contract logo URL. */
|
|
14
14
|
logo_url: string;
|
|
15
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
15
16
|
update_at: Date;
|
|
16
17
|
/** * The requested quote currency eg: `USD`. */
|
|
17
|
-
quote_currency:
|
|
18
|
+
quote_currency: Quote;
|
|
18
19
|
/** * The contract logo URLs. */
|
|
19
20
|
logo_urls: LogoUrls;
|
|
20
21
|
/** * List of response items. */
|
|
@@ -40,6 +40,7 @@ export type Transaction = Nullable<{
|
|
|
40
40
|
pretty_value_quote: string;
|
|
41
41
|
/** * The requested chain native gas token metadata. */
|
|
42
42
|
gas_metadata: ContractMetadata;
|
|
43
|
+
/** * The gas offered for this tx. */
|
|
43
44
|
gas_offered: number;
|
|
44
45
|
/** * The gas spent for this tx. */
|
|
45
46
|
gas_spent: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@covalenthq/client-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"test": "jest",
|
|
45
45
|
"build": "rollup -c rollup.config.js",
|
|
46
|
-
"clean": "rm -
|
|
46
|
+
"clean": "([ ! -d dist ] || rm -r dist)",
|
|
47
47
|
"start": "rollup -c",
|
|
48
48
|
"lint": "eslint .",
|
|
49
49
|
"pretty": "prettier . --write",
|