@covalenthq/client-sdk 2.3.1 → 2.3.2
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/index.js → index.js} +12 -28
- package/dist/index.js.map +1 -0
- package/dist/{esm/src → src}/utils/types/Generic.types.d.ts +11 -27
- package/package.json +9 -13
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/src/utils/types/Generic.types.d.ts +0 -391
- package/dist/esm/index.d.ts +0 -16
- package/dist/esm/index.js +0 -5696
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/src/GoldRushClient.d.ts +0 -27
- package/dist/esm/src/services/AllChainsService.d.ts +0 -63
- package/dist/esm/src/services/BalanceService.d.ts +0 -125
- package/dist/esm/src/services/BaseService.d.ts +0 -163
- package/dist/esm/src/services/BitcoinService.d.ts +0 -40
- package/dist/esm/src/services/NftService.d.ts +0 -193
- package/dist/esm/src/services/PricingService.d.ts +0 -36
- package/dist/esm/src/services/SecurityService.d.ts +0 -28
- package/dist/esm/src/services/StreamingService.d.ts +0 -151
- package/dist/esm/src/services/TransactionService.d.ts +0 -134
- package/dist/esm/src/utils/functions/bigIntParser.d.ts +0 -1
- package/dist/esm/src/utils/functions/calculatePrettyBalance.d.ts +0 -1
- package/dist/esm/src/utils/functions/debugOutput.d.ts +0 -2
- package/dist/esm/src/utils/functions/endpointGenerator.d.ts +0 -4
- package/dist/esm/src/utils/functions/execution.d.ts +0 -11
- package/dist/esm/src/utils/functions/isValidApiKey.d.ts +0 -1
- package/dist/esm/src/utils/functions/paginateEndpoint.d.ts +0 -7
- package/dist/esm/src/utils/functions/prettifyCurrency.d.ts +0 -2
- package/dist/esm/src/utils/functions/timestamp-parser.d.ts +0 -1
- package/dist/esm/src/utils/types/AllChainService.types.d.ts +0 -123
- package/dist/esm/src/utils/types/BalanceService.types.d.ts +0 -442
- package/dist/esm/src/utils/types/BaseService.types.d.ts +0 -312
- package/dist/esm/src/utils/types/BitcoinService.types.d.ts +0 -88
- package/dist/esm/src/utils/types/NftService.types.d.ts +0 -355
- package/dist/esm/src/utils/types/PricingService.types.d.ts +0 -80
- package/dist/esm/src/utils/types/SecurityService.types.d.ts +0 -124
- package/dist/esm/src/utils/types/StreamingService.types.d.ts +0 -201
- package/dist/esm/src/utils/types/TransactionService.types.d.ts +0 -392
- /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/src → src}/GoldRushClient.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/AllChainsService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/BalanceService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/BaseService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/BitcoinService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/NftService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/PricingService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/SecurityService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/StreamingService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/TransactionService.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/bigIntParser.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/calculatePrettyBalance.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/debugOutput.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/endpointGenerator.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/execution.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/isValidApiKey.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/paginateEndpoint.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/prettifyCurrency.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/timestamp-parser.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/AllChainService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/BalanceService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/BaseService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/BitcoinService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/NftService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/PricingService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/SecurityService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/StreamingService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/TransactionService.types.d.ts +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type Execution } from "../utils/functions/execution";
|
|
2
|
-
import type { Chain, GoldRushResponse, Quote } from "../utils/types/Generic.types";
|
|
3
|
-
import type { GetTokenPricesQueryParamOpts, PoolSpotPriceQueryParamsOpts, PoolSpotPricesResponse, TokenPricesResponse } from "../utils/types/PricingService.types";
|
|
4
|
-
/**
|
|
5
|
-
* Pricing API
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare class PricingService {
|
|
9
|
-
private execution;
|
|
10
|
-
constructor(execution: Execution);
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* Commonly used to get historic prices of a token between date ranges. Supports native tokens.
|
|
14
|
-
*
|
|
15
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
16
|
-
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
17
|
-
* @param {string} contractAddress - Contract address for the token. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically. Supports multiple contract addresses separated by commas.
|
|
18
|
-
* @param {GetTokenPricesQueryParamOpts} queryParamOpts
|
|
19
|
-
* - `from`: The start day of the historical price range (YYYY-MM-DD).
|
|
20
|
-
* - `to`: The end day of the historical price range (YYYY-MM-DD).
|
|
21
|
-
* - `pricesAtAsc`: Sort the prices in chronological ascending order. By default, it's set to `false` and returns prices in chronological descending order.
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
getTokenPrices(chainName: Chain, quoteCurrency: Quote, contractAddress: string, queryParamOpts?: GetTokenPricesQueryParamOpts): Promise<GoldRushResponse<TokenPricesResponse[]>>;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks.
|
|
28
|
-
*
|
|
29
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
30
|
-
* @param {string} contractAddress - The pool contract address.
|
|
31
|
-
* @param {GetTokenPricesQueryParamOpts} queryParamOpts
|
|
32
|
-
* - `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`.
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
getPoolSpotPrices(chainName: Chain, contractAddress: string, queryParamOpts?: PoolSpotPriceQueryParamsOpts): Promise<GoldRushResponse<PoolSpotPricesResponse[]>>;
|
|
36
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type Execution } from "../utils/functions/execution";
|
|
2
|
-
import { type Chain, type GoldRushResponse } from "../utils/types/Generic.types";
|
|
3
|
-
import { type ApprovalsResponse, type NftApprovalsResponse } from "../utils/types/SecurityService.types";
|
|
4
|
-
/**
|
|
5
|
-
* Approvals API
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare class SecurityService {
|
|
9
|
-
private execution;
|
|
10
|
-
constructor(execution: Execution);
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet’s assets.
|
|
14
|
-
*
|
|
15
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
16
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
getApprovals(chainName: Chain, walletAddress: string): Promise<GoldRushResponse<ApprovalsResponse>>;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
23
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
getNftApprovals(chainName: Chain, walletAddress: string): Promise<GoldRushResponse<NftApprovalsResponse>>;
|
|
28
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { type NewPairsStreamParams, type NewPairsStreamResponse, type OHLCVPairsStreamParams, type OHLCVPairsStreamResponse, type OHLCVTokensStreamParams, type OHLCVTokensStreamResponse, type StreamingServiceConfig, type StreamSubscriptionOptions, type TokenBalancesStreamParams, type TokenBalancesStreamResponse, type UnsubscribeFunction, type WalletActivityStreamParams, type WalletActivityStreamResponse } from "../utils/types/StreamingService.types";
|
|
2
|
-
import { type Client } from "graphql-ws";
|
|
3
|
-
/**
|
|
4
|
-
* Streaming API Service
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare class StreamingService {
|
|
8
|
-
private defaultConfig;
|
|
9
|
-
constructor(apiKey: string, config?: StreamingServiceConfig);
|
|
10
|
-
/**
|
|
11
|
-
* Initialize the streaming connection
|
|
12
|
-
*/
|
|
13
|
-
getClient(): Client;
|
|
14
|
-
/**
|
|
15
|
-
* Disconnect from the streaming service
|
|
16
|
-
*/
|
|
17
|
-
disconnect(): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Check if the client is connected
|
|
20
|
-
*/
|
|
21
|
-
get isConnected(): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Subscribe to a custom GraphQL subscription
|
|
24
|
-
* This allows for advanced usage and future extensibility
|
|
25
|
-
*
|
|
26
|
-
* @param query - GraphQL subscription query
|
|
27
|
-
* @param variables - Query variables
|
|
28
|
-
* @param callbacks - Subscription callbacks
|
|
29
|
-
* @returns Unsubscribe function
|
|
30
|
-
*/
|
|
31
|
-
rawQuery<T = Array<object>>(query: string, variables: Record<string, unknown>, callbacks: StreamSubscriptionOptions<T>): UnsubscribeFunction;
|
|
32
|
-
/**
|
|
33
|
-
* Subscribe to OHLCV data for specific pairs
|
|
34
|
-
*
|
|
35
|
-
* @param params - Parameters for the OHLCV pairs stream
|
|
36
|
-
* @param callbacks - Subscription callbacks
|
|
37
|
-
* @returns Unsubscribe function
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* const unsubscribe = streamingService.subscribeToOHLCVPairs(
|
|
42
|
-
* {
|
|
43
|
-
* chain_name: StreamingChain.BASE_MAINNET,
|
|
44
|
-
* pair_addresses: ["0x9c087Eb773291e50CF6c6a90ef0F4500e349B903"],
|
|
45
|
-
* interval: StreamingInterval.ONE_MINUTE,
|
|
46
|
-
* timeframe: StreamingTimeframe.ONE_HOUR
|
|
47
|
-
* },
|
|
48
|
-
* {
|
|
49
|
-
* next: (data) => console.log("OHLCV Data:", data),
|
|
50
|
-
* error: (err) => console.error("Error:", err),
|
|
51
|
-
* complete: () => console.log("Stream completed")
|
|
52
|
-
* }
|
|
53
|
-
* );
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
subscribeToOHLCVPairs(params: OHLCVPairsStreamParams, callbacks: StreamSubscriptionOptions<OHLCVPairsStreamResponse[]>): UnsubscribeFunction;
|
|
57
|
-
/**
|
|
58
|
-
* Subscribe to OHLCV data for specific tokens
|
|
59
|
-
*
|
|
60
|
-
* @param params - Parameters for the OHLCV tokens stream
|
|
61
|
-
* @param callbacks - Subscription callbacks
|
|
62
|
-
* @returns Unsubscribe function
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```typescript
|
|
66
|
-
* const unsubscribe = streamingService.subscribeToOHLCVTokens(
|
|
67
|
-
* {
|
|
68
|
-
* chain_name: StreamingChain.BASE_MAINNET,
|
|
69
|
-
* token_addresses: ["0x4B6104755AfB5Da4581B81C552DA3A25608c73B8"],
|
|
70
|
-
* interval: StreamingInterval.ONE_MINUTE,
|
|
71
|
-
* timeframe: StreamingTimeframe.ONE_HOUR
|
|
72
|
-
* },
|
|
73
|
-
* {
|
|
74
|
-
* next: (data) => console.log("OHLCV Token Data:", data),
|
|
75
|
-
* error: (err) => console.error("Error:", err),
|
|
76
|
-
* complete: () => console.log("Stream completed")
|
|
77
|
-
* }
|
|
78
|
-
* );
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
subscribeToOHLCVTokens(params: OHLCVTokensStreamParams, callbacks: StreamSubscriptionOptions<OHLCVTokensStreamResponse[]>): UnsubscribeFunction;
|
|
82
|
-
/**
|
|
83
|
-
* Subscribe to new DEX pairs created on supported decentralized exchanges
|
|
84
|
-
*
|
|
85
|
-
* @param params - Parameters for the new pairs stream
|
|
86
|
-
* @param callbacks - Subscription callbacks
|
|
87
|
-
* @returns Unsubscribe function
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```typescript
|
|
91
|
-
* const unsubscribe = streamingService.subscribeToNewPairs(
|
|
92
|
-
* {
|
|
93
|
-
* chain_name: StreamingChain.BASE_MAINNET,
|
|
94
|
-
* protocols: [StreamingProtocol.UNISWAP_V2, StreamingProtocol.UNISWAP_V3]
|
|
95
|
-
* },
|
|
96
|
-
* {
|
|
97
|
-
* next: (data) => console.log("New Pairs:", data),
|
|
98
|
-
* error: (err) => console.error("Error:", err),
|
|
99
|
-
* complete: () => console.log("Stream completed")
|
|
100
|
-
* }
|
|
101
|
-
* );
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
subscribeToNewPairs(params: NewPairsStreamParams, callbacks: StreamSubscriptionOptions<NewPairsStreamResponse[]>): UnsubscribeFunction;
|
|
105
|
-
/**
|
|
106
|
-
* Subscribe to real-time token balance updates for a specific wallet address
|
|
107
|
-
*
|
|
108
|
-
* @param params - Parameters for the token balances stream
|
|
109
|
-
* @param callbacks - Subscription callbacks
|
|
110
|
-
* @returns Unsubscribe function
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* const unsubscribe = streamingService.subscribeToTokenBalances(
|
|
115
|
-
* {
|
|
116
|
-
* chain_name: StreamingChain.BASE_MAINNET,
|
|
117
|
-
* wallet_address: "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc"
|
|
118
|
-
* },
|
|
119
|
-
* {
|
|
120
|
-
* next: (data) => console.log("Token Balances:", data),
|
|
121
|
-
* error: (err) => console.error("Error:", err),
|
|
122
|
-
* complete: () => console.log("Stream completed")
|
|
123
|
-
* }
|
|
124
|
-
* );
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
subscribeToTokenBalances(params: TokenBalancesStreamParams, callbacks: StreamSubscriptionOptions<TokenBalancesStreamResponse>): UnsubscribeFunction;
|
|
128
|
-
/**
|
|
129
|
-
* Subscribe to real-time wallet activity including transactions, token transfers, and smart contract interactions
|
|
130
|
-
*
|
|
131
|
-
* @param params - Parameters for the wallet activity stream
|
|
132
|
-
* @param callbacks - Subscription callbacks
|
|
133
|
-
* @returns Unsubscribe function
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```typescript
|
|
137
|
-
* const unsubscribe = streamingService.subscribeToWalletActivity(
|
|
138
|
-
* {
|
|
139
|
-
* chain_name: StreamingChain.BASE_MAINNET,
|
|
140
|
-
* wallet_addresses: ["0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc"]
|
|
141
|
-
* },
|
|
142
|
-
* {
|
|
143
|
-
* next: (data) => console.log("Wallet Activity:", data),
|
|
144
|
-
* error: (err) => console.error("Error:", err),
|
|
145
|
-
* complete: () => console.log("Stream completed")
|
|
146
|
-
* }
|
|
147
|
-
* );
|
|
148
|
-
* ```
|
|
149
|
-
*/
|
|
150
|
-
subscribeToWalletActivity(params: WalletActivityStreamParams, callbacks: StreamSubscriptionOptions<WalletActivityStreamResponse[]>): UnsubscribeFunction;
|
|
151
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { type Execution } from "../utils/functions/execution";
|
|
2
|
-
import type { Chain, GoldRushResponse } from "../utils/types/Generic.types";
|
|
3
|
-
import type { EarliestTransactionsForAddressResponse, GetAllTransactionsForAddressQueryParamOpts, GetEarliestTransactionsForAddressQueryParamOpts, getPaginatedTransactionsForAddressQueryParamOpts, GetTimeBucketTransactionsForAddressQueryParamOpts, GetTransactionQueryParamOpts, getTransactionsForBlockByPageQueryParamOpts, GetTransactionSummaryQueryParamOpts, RecentTransactionsResponse, TransactionResponse, TransactionsBlockResponse, TransactionsForBlockResponse, TransactionsResponse, TransactionsSummaryResponse, TransactionsTimeBucketResponse } from "../utils/types/TransactionService.types";
|
|
4
|
-
/**
|
|
5
|
-
* Transactions API
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare class TransactionService {
|
|
9
|
-
private execution;
|
|
10
|
-
constructor(execution: Execution);
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* Commonly used to fetch and render a single transaction including its decoded log events.
|
|
14
|
-
*
|
|
15
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
16
|
-
* @param {string} txHash - The transaction hash.
|
|
17
|
-
* @param {GetTransactionQueryParamOpts} queryParamOpts
|
|
18
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
19
|
-
* - `noLogs`: Omit log events.
|
|
20
|
-
* - `withInternal`: Include internal transfers/transactions.
|
|
21
|
-
* - `withState`: Include all transaction state changes with before and after values.
|
|
22
|
-
* - `withInputData`: Include the transaction's input data such as the Method ID.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
getTransaction(chainName: Chain, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<GoldRushResponse<TransactionResponse>>;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* Commonly used to fetch the earliest and latest transactions, and the transaction count for a wallet. Calculate the age of the wallet and the time it has been idle and quickly gain insights into their engagement with web3.
|
|
29
|
-
*
|
|
30
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
31
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
32
|
-
* @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
|
|
33
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
34
|
-
* - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
getTransactionSummary(chainName: Chain, walletAddress: string, queryParamOpts?: GetTransactionSummaryQueryParamOpts): Promise<GoldRushResponse<TransactionsSummaryResponse>>;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* Commonly used to fetch and render the earliest transactions involving an address. Frequently seen in wallet applications.
|
|
41
|
-
*
|
|
42
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
43
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
44
|
-
* @param {GetEarliestTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
45
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
46
|
-
* - `noLogs`: Omit log events.
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
getEarliestTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetEarliestTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<EarliestTransactionsForAddressResponse>>;
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
53
|
-
*
|
|
54
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
55
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
56
|
-
* @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
57
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
58
|
-
* - `noLogs`: Omit log events.
|
|
59
|
-
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
60
|
-
* - `withInternal`: Include internal transfers/transactions.
|
|
61
|
-
* - `withState`: Include all transaction state changes with before and after values.
|
|
62
|
-
* - `withInputData`: Include the transaction's input data such as the Method ID.
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
getAllTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable<GoldRushResponse<RecentTransactionsResponse>>;
|
|
66
|
-
/**
|
|
67
|
-
*
|
|
68
|
-
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
69
|
-
*
|
|
70
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
71
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
72
|
-
* @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
73
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
74
|
-
* - `noLogs`: Omit log events.
|
|
75
|
-
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
76
|
-
* - `withInternal`: Include internal transfers/transactions.
|
|
77
|
-
* - `withState`: Include all transaction state changes with before and after values.
|
|
78
|
-
* - `withInputData`: Include the transaction's input data such as the Method ID.
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
getAllTransactionsForAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<RecentTransactionsResponse>>;
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
85
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
86
|
-
* @param {number} page - The requested page, 0-indexed.
|
|
87
|
-
* @param {getPaginatedTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
88
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
89
|
-
* - `noLogs`: Omit log events.
|
|
90
|
-
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
91
|
-
*
|
|
92
|
-
*/
|
|
93
|
-
getPaginatedTransactionsForAddress(chainName: Chain, walletAddress: string, page: number, queryParamOpts?: getPaginatedTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<TransactionsResponse>>;
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
97
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
98
|
-
* @param {number} timeBucket - The 0-indexed 15-minute time bucket. E.g. 27 Feb 2023 05:23 GMT = 1677475383 (Unix time). 1677475383/900=1863861 timeBucket.
|
|
99
|
-
* @param {GetTimeBucketTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
100
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
101
|
-
* - `noLogs`: Omit log events.
|
|
102
|
-
*
|
|
103
|
-
*/
|
|
104
|
-
getTimeBucketTransactionsForAddress(chainName: Chain, walletAddress: string, timeBucket: number, queryParamOpts?: GetTimeBucketTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<TransactionsTimeBucketResponse>>;
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
108
|
-
*
|
|
109
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
110
|
-
* @param {number} blockHeight - The requested block height.
|
|
111
|
-
* @param {number} page - The requested page, 0-indexed.
|
|
112
|
-
* @param {getTransactionsForBlockByPageQueryParamOpts} queryParamOpts
|
|
113
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
114
|
-
* - `noLogs`: Omit log events.
|
|
115
|
-
*
|
|
116
|
-
*/
|
|
117
|
-
getTransactionsForBlockByPage(chainName: Chain, blockHeight: number | string | "latest", page: number, queryParamOpts?: getTransactionsForBlockByPageQueryParamOpts): Promise<GoldRushResponse<TransactionsBlockResponse>>;
|
|
118
|
-
/**
|
|
119
|
-
*
|
|
120
|
-
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
121
|
-
*
|
|
122
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
123
|
-
* @param {string} blockHash - The requested block hash.
|
|
124
|
-
* @param {getTransactionsForBlockByPageQueryParamOpts} queryParamOpts
|
|
125
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
126
|
-
* - `noLogs`: Omit log events.
|
|
127
|
-
*
|
|
128
|
-
*/
|
|
129
|
-
getTransactionsForBlock(chainName: Chain, blockHash: string, queryParamOpts?: getTransactionsForBlockByPageQueryParamOpts): Promise<GoldRushResponse<TransactionsForBlockResponse>>;
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated This method has been deprecated and will be removed in future releases. Use `getPaginatedTransactionsForAddress` instead.
|
|
132
|
-
*/
|
|
133
|
-
getTransactionsForAddressV3(chainName: Chain, walletAddress: string, page: number, queryParamOpts?: getPaginatedTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<TransactionsResponse>>;
|
|
134
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const bigIntParser: (val: null | undefined | string | number | bigint) => bigint | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const calculatePrettyBalance: (value: number | bigint, decimals?: number, roundOff?: boolean, precision?: number) => string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type GoldRushClientSettings, type GoldRushResponse } from "../types/Generic.types";
|
|
2
|
-
export declare class Execution {
|
|
3
|
-
private settings;
|
|
4
|
-
private headers;
|
|
5
|
-
private maxRetries;
|
|
6
|
-
private retryDelay;
|
|
7
|
-
private enableRetry;
|
|
8
|
-
private processes;
|
|
9
|
-
constructor(settings: GoldRushClientSettings, headers: Record<string, string>);
|
|
10
|
-
execute<T>(endpoint: URL, parseData: (data: GoldRushResponse<T>) => GoldRushResponse<T>): Promise<GoldRushResponse<T>>;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isValidApiKey: (apiKey: string) => boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type GoldRushResponse, type Nullable, type Pagination, type PaginationLinks } from "../types/Generic.types";
|
|
2
|
-
import { type Execution } from "./execution";
|
|
3
|
-
export declare function paginateEndpoint<T extends Nullable<{
|
|
4
|
-
pagination: Pagination;
|
|
5
|
-
}> | Nullable<{
|
|
6
|
-
links: PaginationLinks;
|
|
7
|
-
}> | null>(endpoint: URL, execution: Execution, parseData: (data: GoldRushResponse<T>) => GoldRushResponse<T>, implementation: "pagination" | "links"): AsyncIterable<GoldRushResponse<T>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const timestampParser: (timestamp: string | Date, type: "descriptive" | "DD MMM YY" | "relative" | "YYYY-MM-DD") => string;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { type ChainItem } from "./BaseService.types";
|
|
2
|
-
import { type Chain, type ChainID, type ChainName, type CryptocurrencyQuote, type LogoUrls, type Nullable, type Quote } from "./Generic.types";
|
|
3
|
-
import { type Transaction } from "./TransactionService.types";
|
|
4
|
-
export type ChainActivityEvent = Nullable<{
|
|
5
|
-
/** * The timestamp when the address was last seen on the chain. */
|
|
6
|
-
last_seen_at: Date;
|
|
7
|
-
} & ChainItem>;
|
|
8
|
-
export type ChainActivityResponse = Nullable<{
|
|
9
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
10
|
-
updated_at: Date;
|
|
11
|
-
/** * The requested address. */
|
|
12
|
-
address: string;
|
|
13
|
-
/** * List of response items. */
|
|
14
|
-
items: ChainActivityEvent[];
|
|
15
|
-
}>;
|
|
16
|
-
export type GetAddressActivityQueryParamOpts = Nullable<{
|
|
17
|
-
/** * Set to true to include testnets with activity in the response. By default, it's set to `false` and only returns mainnet activity. */
|
|
18
|
-
testnets?: boolean;
|
|
19
|
-
}>;
|
|
20
|
-
export type MultiChainTransaction = Transaction & {
|
|
21
|
-
/** * The requested chain ID eg: `1`. */
|
|
22
|
-
chain_id: ChainID;
|
|
23
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
24
|
-
chain_name: ChainName;
|
|
25
|
-
};
|
|
26
|
-
export type MultiChainMultiAddressTransactionsResponse = Nullable<{
|
|
27
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
28
|
-
updated_at: Date;
|
|
29
|
-
/** * The the pagination cursor to get the previous page of results */
|
|
30
|
-
cursor_before: string;
|
|
31
|
-
/** * The the pagination cursor to get the next page of results */
|
|
32
|
-
cursor_after: string;
|
|
33
|
-
/** * The requested quote currency eg: `USD`. */
|
|
34
|
-
quote_currency: Quote | CryptocurrencyQuote;
|
|
35
|
-
/** * List of response items. */
|
|
36
|
-
items: MultiChainTransaction[];
|
|
37
|
-
}>;
|
|
38
|
-
export type GetMultiChainMultiAddressTransactionsParamOtps = Nullable<{
|
|
39
|
-
/** * An array of the chain names or IDs to retrieve transactions from. Defaults to all foundational chains. */
|
|
40
|
-
chains?: Chain[];
|
|
41
|
-
/** * An array of addresses for which transactions are fetched. Does not support name resolution. */
|
|
42
|
-
addresses?: string[];
|
|
43
|
-
/** * Number of transactions to return per page, up to the default max of 100 items. */
|
|
44
|
-
limit?: number;
|
|
45
|
-
/** * Pagination cursor pointing to fetch transactions before a certain point. */
|
|
46
|
-
before?: string;
|
|
47
|
-
/** * Pagination cursor pointing to fetch transactions after a certain point. */
|
|
48
|
-
after?: string;
|
|
49
|
-
/** * Whether to include raw logs in the response. */
|
|
50
|
-
withLogs?: boolean;
|
|
51
|
-
/** * Whether to include decoded logs in the response. */
|
|
52
|
-
withDecodedLogs?: boolean;
|
|
53
|
-
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, `GBP`, "BTC" and "ETH". */
|
|
54
|
-
quoteCurrency?: Quote | CryptocurrencyQuote;
|
|
55
|
-
}>;
|
|
56
|
-
export type MultiChainBalanceItem = Nullable<{
|
|
57
|
-
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
58
|
-
contract_decimals: number;
|
|
59
|
-
/** * The string returned by the `name()` method. */
|
|
60
|
-
contract_name: string;
|
|
61
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
62
|
-
contract_ticker_symbol: string;
|
|
63
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
64
|
-
contract_address: string;
|
|
65
|
-
/** * A display-friendly name for the contract. */
|
|
66
|
-
contract_display_name: string;
|
|
67
|
-
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
68
|
-
supports_erc: string[];
|
|
69
|
-
/** * The contract logo URL. */
|
|
70
|
-
logo_url: string;
|
|
71
|
-
/** * The contract logo URLs. */
|
|
72
|
-
logo_urls: LogoUrls;
|
|
73
|
-
/** * The timestamp when the token was transferred. */
|
|
74
|
-
last_transferred_at: Date;
|
|
75
|
-
/** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
|
|
76
|
-
is_native_token: boolean;
|
|
77
|
-
/** * One of `cryptocurrency`, `stablecoin`, `nft` or `dust`. */
|
|
78
|
-
type: string;
|
|
79
|
-
/** * Denotes whether the token is suspected spam. */
|
|
80
|
-
is_spam: boolean;
|
|
81
|
-
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
82
|
-
balance: bigint;
|
|
83
|
-
/** * The 24h asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
84
|
-
balance_24h: bigint;
|
|
85
|
-
/** * The exchange rate for the requested quote currency. */
|
|
86
|
-
quote_rate: number;
|
|
87
|
-
/** * The 24h exchange rate for the requested quote currency. */
|
|
88
|
-
quote_rate_24h: number;
|
|
89
|
-
/** * The current balance converted to fiat in `quote-currency`. */
|
|
90
|
-
quote: number;
|
|
91
|
-
/** * The 24h balance converted to fiat in `quote-currency`. */
|
|
92
|
-
quote_24h: number;
|
|
93
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
94
|
-
pretty_quote: string;
|
|
95
|
-
/** * A prettier version of the 24h quote for rendering purposes. */
|
|
96
|
-
pretty_quote_24h: string;
|
|
97
|
-
/** * The requested chain ID eg: `1`. */
|
|
98
|
-
chain_id: ChainID;
|
|
99
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
100
|
-
chain_name: ChainName;
|
|
101
|
-
}>;
|
|
102
|
-
export type GetMultiChainBalanceQueryParamOpts = Nullable<{
|
|
103
|
-
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, `GBP`, `ETH`, and `BTC`. */
|
|
104
|
-
quoteCurrency?: Quote | CryptocurrencyQuote;
|
|
105
|
-
/** * The cursor for pagination. */
|
|
106
|
-
before?: string;
|
|
107
|
-
/** * The number of items per page. Omitting this parameter defaults to 100. */
|
|
108
|
-
limit?: number;
|
|
109
|
-
/** * The requested chain ID or chain names eg: `[1,137], ["eth-mainnet", "bsc-mainnet"]`. Defaults to Foundational Chains. */
|
|
110
|
-
chains?: ChainID[] | ChainName[];
|
|
111
|
-
/** * The timestamp to query balances at. If omitted, the latest balances are returned. */
|
|
112
|
-
cutoffTimestamp?: number;
|
|
113
|
-
}>;
|
|
114
|
-
export type MultiChainBalanceResponse = Nullable<{
|
|
115
|
-
/** * Next cursor for pagination. */
|
|
116
|
-
cursor_before: string;
|
|
117
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
118
|
-
updated_at: Date;
|
|
119
|
-
/** * The requested quote currency eg: `USD`. */
|
|
120
|
-
quote_currency: Quote | CryptocurrencyQuote;
|
|
121
|
-
/** * List of response items. */
|
|
122
|
-
items: MultiChainBalanceItem[];
|
|
123
|
-
}>;
|