@covalenthq/client-sdk 0.6.6 → 0.7.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 +16 -5
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +758 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/BalanceService.d.ts +11 -9
- package/dist/cjs/services/BaseService.d.ts +65 -11
- package/dist/cjs/services/CovalentClient.d.ts +3 -15
- package/dist/cjs/services/NftService.d.ts +18 -16
- package/dist/cjs/services/PricingService.d.ts +4 -2
- package/dist/cjs/services/SecurityService.d.ts +5 -3
- package/dist/cjs/services/TransactionService.d.ts +12 -10
- package/dist/cjs/services/XykService.d.ts +16 -14
- package/dist/cjs/util/ApiKeyValidator.d.ts +8 -0
- package/dist/cjs/util/Chains.d.ts +180 -0
- package/dist/cjs/util/types/BaseServiceTypes.d.ts +36 -0
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +3 -3
- package/dist/es/index.d.ts +2 -1
- package/dist/es/index.js +759 -26
- package/dist/es/index.js.map +1 -1
- package/dist/es/services/BalanceService.d.ts +11 -9
- package/dist/es/services/BaseService.d.ts +65 -11
- package/dist/es/services/CovalentClient.d.ts +3 -15
- package/dist/es/services/NftService.d.ts +18 -16
- package/dist/es/services/PricingService.d.ts +4 -2
- package/dist/es/services/SecurityService.d.ts +5 -3
- package/dist/es/services/TransactionService.d.ts +12 -10
- package/dist/es/services/XykService.d.ts +16 -14
- package/dist/es/util/ApiKeyValidator.d.ts +8 -0
- package/dist/es/util/Chains.d.ts +180 -0
- package/dist/es/util/types/BaseServiceTypes.d.ts +36 -0
- package/dist/es/util/types/TransactionServiceTypes.d.ts +3 -3
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +759 -26
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/BalanceService.d.ts +11 -9
- package/dist/esm/services/BaseService.d.ts +65 -11
- package/dist/esm/services/CovalentClient.d.ts +3 -15
- package/dist/esm/services/NftService.d.ts +18 -16
- package/dist/esm/services/PricingService.d.ts +4 -2
- package/dist/esm/services/SecurityService.d.ts +5 -3
- package/dist/esm/services/TransactionService.d.ts +12 -10
- package/dist/esm/services/XykService.d.ts +16 -14
- package/dist/esm/util/ApiKeyValidator.d.ts +8 -0
- package/dist/esm/util/Chains.d.ts +180 -0
- package/dist/esm/util/types/BaseServiceTypes.d.ts +36 -0
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/services/BalanceService.d.ts +11 -9
- package/dist/services/BalanceService.js +57 -1
- package/dist/services/BalanceService.js.map +1 -1
- package/dist/services/BaseService.d.ts +65 -11
- package/dist/services/BaseService.js +187 -1
- package/dist/services/BaseService.js.map +1 -1
- package/dist/services/CovalentClient.d.ts +3 -15
- package/dist/services/CovalentClient.js +20 -15
- package/dist/services/CovalentClient.js.map +1 -1
- package/dist/services/NftService.d.ts +18 -16
- package/dist/services/NftService.js +113 -1
- package/dist/services/NftService.js.map +1 -1
- package/dist/services/PricingService.d.ts +4 -2
- package/dist/services/PricingService.js +11 -1
- package/dist/services/PricingService.js.map +1 -1
- package/dist/services/SecurityService.d.ts +5 -3
- package/dist/services/SecurityService.js +19 -1
- package/dist/services/SecurityService.js.map +1 -1
- package/dist/services/TransactionService.d.ts +12 -10
- package/dist/services/TransactionService.js +49 -4
- package/dist/services/TransactionService.js.map +1 -1
- package/dist/services/XykService.d.ts +16 -14
- package/dist/services/XykService.js +115 -1
- package/dist/services/XykService.js.map +1 -1
- package/dist/util/ApiKeyValidator.d.ts +8 -0
- package/dist/util/ApiKeyValidator.js +13 -0
- package/dist/util/ApiKeyValidator.js.map +1 -0
- package/dist/util/Chains.d.ts +180 -0
- package/dist/util/Chains.js +182 -0
- package/dist/util/Chains.js.map +1 -0
- package/dist/util/types/BaseServiceTypes.d.ts +36 -0
- package/dist/util/types/TransactionServiceTypes.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,15 +22,25 @@ yarn add @covalenthq/client-sdk
|
|
|
22
22
|
After installing, you can import and use the SDK with:
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
|
-
import { CovalentClient } from "@covalenthq/client-sdk";
|
|
25
|
+
import { CovalentClient, Chains } from "@covalenthq/client-sdk";
|
|
26
26
|
|
|
27
27
|
const ApiServices = async () => {
|
|
28
28
|
const client = new CovalentClient("YOUR_API_KEY"); // Replace with your Covalent API key.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
|
|
30
|
+
// Example call with string literal type
|
|
31
|
+
const respWithStringLiteral = await client.BalanceService.getTokenBalancesForWalletAddress("eth-mainnet", "WALLET_ADDRESS");
|
|
32
|
+
if (!respWithStringLiteral.error) {
|
|
33
|
+
console.log(respWithStringLiteral.data);
|
|
32
34
|
} else {
|
|
33
|
-
console.log(
|
|
35
|
+
console.log(respWithStringLiteral.error_message);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Example call with enum
|
|
39
|
+
const respWithEnum = await client.BalanceService.getTokenBalancesForWalletAddress(Chains.ETH_MAINNET, "WALLET_ADDRESS");
|
|
40
|
+
if (!respWithEnum.error) {
|
|
41
|
+
console.log(respWithEnum.data);
|
|
42
|
+
} else {
|
|
43
|
+
console.log(respWithEnum.error_message);
|
|
34
44
|
}
|
|
35
45
|
}
|
|
36
46
|
```
|
|
@@ -133,6 +143,7 @@ The `BaseService` class refers to the [address activity, log events, chain statu
|
|
|
133
143
|
- `getAllChains()`: Used to build internal dashboards for all supported chains on Covalent.
|
|
134
144
|
- `getAllChainStatus()`: Used to build internal status dashboards of all supported chains.
|
|
135
145
|
- `getAddressActivity()`: Locate chains where an address is active on with a single API call.
|
|
146
|
+
- `getGasPrices()`: Get real-time gas estimates for different transaction speeds on a specific network, enabling users to optimize transaction costs and confirmation times.
|
|
136
147
|
|
|
137
148
|
### NftService
|
|
138
149
|
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CovalentClient, Client, Chain, Quote,
|
|
1
|
+
export { CovalentClient, Client, Chain, Quote, CovalentClientSettings } from "./services/CovalentClient";
|
|
2
2
|
export * from "./util/types/BalanceServiceTypes";
|
|
3
3
|
export * from "./util/types/BaseServiceTypes";
|
|
4
4
|
export * from "./util/types/NftServiceTypes";
|
|
@@ -9,3 +9,4 @@ export * from "./util/types/GenericTypes";
|
|
|
9
9
|
export * from "./util/types/TransactionServiceTypes";
|
|
10
10
|
export { calculatePrettyBalance } from "./util/CalculatePrettyBalance";
|
|
11
11
|
export { prettifyCurrency } from "./util/prettifyCurrency";
|
|
12
|
+
export { Chains } from "./util/Chains";
|