@coinbase/cdp-sdk 1.45.0 → 1.46.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/CHANGELOG.md +14 -2
- package/README.md +47 -43
- package/_cjs/accounts/evm/eip6492.js +49 -0
- package/_cjs/accounts/evm/eip6492.js.map +1 -0
- package/_cjs/accounts/evm/toEvmSmartAccount.js +6 -2
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +31 -0
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
- package/_cjs/actions/solana/transfer.js.map +1 -1
- package/_cjs/actions/solana/utils.js +9 -9
- package/_cjs/actions/solana/utils.js.map +1 -1
- package/_cjs/auth/utils/http.js +1 -0
- package/_cjs/auth/utils/http.js.map +1 -1
- package/_cjs/client/cdp.js +4 -1
- package/_cjs/client/cdp.js.map +1 -1
- package/_cjs/client/end-user/endUser.js +385 -4
- package/_cjs/client/end-user/endUser.js.map +1 -1
- package/_cjs/client/end-user/toEndUserAccount.js +201 -23
- package/_cjs/client/end-user/toEndUserAccount.js.map +1 -1
- package/_cjs/client/solana/solana.js +39 -13
- package/_cjs/client/solana/solana.js.map +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/openapi-client/cdpApiClient.js +32 -0
- package/_cjs/openapi-client/cdpApiClient.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +52 -15
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js +261 -0
- package/_cjs/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js.map +1 -0
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +2 -2
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-token-balances/evm-token-balances.js.map +1 -1
- package/_cjs/openapi-client/generated/faucets/faucets.js +6 -5
- package/_cjs/openapi-client/generated/faucets/faucets.js.map +1 -1
- package/_cjs/openapi-client/generated/onchain-data/onchain-data.js.map +1 -1
- package/_cjs/openapi-client/generated/onramp/onramp.js.map +1 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-token-balances/solana-token-balances.js.map +1 -1
- package/_cjs/openapi-client/generated/sql-api/sql-api.js +75 -0
- package/_cjs/openapi-client/generated/sql-api/sql-api.js.map +1 -0
- package/_cjs/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -1
- package/_cjs/openapi-client/index.js +4 -1
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/utils/export.js +6 -5
- package/_cjs/utils/export.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/eip6492.js +46 -0
- package/_esm/accounts/evm/eip6492.js.map +1 -0
- package/_esm/accounts/evm/toEvmSmartAccount.js +6 -2
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +31 -0
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
- package/_esm/actions/solana/transfer.js.map +1 -1
- package/_esm/actions/solana/utils.js +9 -9
- package/_esm/actions/solana/utils.js.map +1 -1
- package/_esm/auth/utils/http.js +1 -0
- package/_esm/auth/utils/http.js.map +1 -1
- package/_esm/client/cdp.js +4 -1
- package/_esm/client/cdp.js.map +1 -1
- package/_esm/client/end-user/endUser.js +385 -4
- package/_esm/client/end-user/endUser.js.map +1 -1
- package/_esm/client/end-user/toEndUserAccount.js +201 -23
- package/_esm/client/end-user/toEndUserAccount.js.map +1 -1
- package/_esm/client/solana/solana.js +39 -13
- package/_esm/client/solana/solana.js.map +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/openapi-client/cdpApiClient.js +32 -0
- package/_esm/openapi-client/cdpApiClient.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +49 -12
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js +243 -0
- package/_esm/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js.map +1 -0
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +2 -2
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/evm-swaps/evm-swaps.js.map +1 -1
- package/_esm/openapi-client/generated/evm-token-balances/evm-token-balances.js.map +1 -1
- package/_esm/openapi-client/generated/faucets/faucets.js +6 -5
- package/_esm/openapi-client/generated/faucets/faucets.js.map +1 -1
- package/_esm/openapi-client/generated/onchain-data/onchain-data.js.map +1 -1
- package/_esm/openapi-client/generated/onramp/onramp.js.map +1 -1
- package/_esm/openapi-client/generated/policy-engine/policy-engine.js.map +1 -1
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/solana-token-balances/solana-token-balances.js.map +1 -1
- package/_esm/openapi-client/generated/sql-api/sql-api.js +70 -0
- package/_esm/openapi-client/generated/sql-api/sql-api.js.map +1 -0
- package/_esm/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -1
- package/_esm/openapi-client/index.js +4 -1
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/utils/export.js +6 -5
- package/_esm/utils/export.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/eip6492.d.ts +17 -0
- package/_types/accounts/evm/eip6492.d.ts.map +1 -0
- package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts +4 -4
- package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/types.d.ts +3 -2
- package/_types/accounts/evm/types.d.ts.map +1 -1
- package/_types/actions/solana/transfer.d.ts +3 -4
- package/_types/actions/solana/transfer.d.ts.map +1 -1
- package/_types/actions/solana/types.d.ts +79 -29
- package/_types/actions/solana/types.d.ts.map +1 -1
- package/_types/actions/solana/utils.d.ts +10 -9
- package/_types/actions/solana/utils.d.ts.map +1 -1
- package/_types/auth/utils/http.d.ts.map +1 -1
- package/_types/client/cdp.d.ts +4 -0
- package/_types/client/cdp.d.ts.map +1 -1
- package/_types/client/end-user/endUser.d.ts +272 -1
- package/_types/client/end-user/endUser.d.ts.map +1 -1
- package/_types/client/end-user/endUser.types.d.ts +491 -1
- package/_types/client/end-user/endUser.types.d.ts.map +1 -1
- package/_types/client/end-user/toEndUserAccount.d.ts +4 -1
- package/_types/client/end-user/toEndUserAccount.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/client/solana/solana.d.ts +38 -12
- package/_types/client/solana/solana.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/cdpApiClient.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +487 -119
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.d.ts +163 -0
- package/_types/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.d.ts.map +1 -0
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts +9 -9
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts +16 -16
- package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +14 -14
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-swaps/evm-swaps.d.ts +3 -3
- package/_types/openapi-client/generated/evm-swaps/evm-swaps.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.d.ts +2 -2
- package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.d.ts.map +1 -1
- package/_types/openapi-client/generated/faucets/faucets.d.ts +9 -8
- package/_types/openapi-client/generated/faucets/faucets.d.ts.map +1 -1
- package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts +3 -3
- package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts.map +1 -1
- package/_types/openapi-client/generated/onramp/onramp.d.ts +5 -5
- package/_types/openapi-client/generated/onramp/onramp.d.ts.map +1 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts +6 -6
- package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts +12 -12
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-token-balances/solana-token-balances.d.ts +2 -2
- package/_types/openapi-client/generated/solana-token-balances/solana-token-balances.d.ts.map +1 -1
- package/_types/openapi-client/generated/sql-api/sql-api.d.ts +73 -0
- package/_types/openapi-client/generated/sql-api/sql-api.d.ts.map +1 -0
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts +6 -6
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -1
- package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts +4 -4
- package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +19 -3
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/evmSchema.d.ts +26 -78
- package/_types/policies/evmSchema.d.ts.map +1 -1
- package/_types/policies/types.d.ts.map +1 -1
- package/_types/types/contract.d.ts.map +1 -1
- package/_types/utils/export.d.ts +1 -1
- package/_types/utils/export.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/accounts/evm/eip6492.ts +60 -0
- package/accounts/evm/toEvmSmartAccount.ts +17 -4
- package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +44 -5
- package/accounts/evm/types.ts +8 -3
- package/actions/solana/transfer.ts +3 -3
- package/actions/solana/types.ts +79 -29
- package/actions/solana/utils.ts +13 -11
- package/auth/utils/http.ts +1 -0
- package/client/cdp.ts +6 -1
- package/client/end-user/endUser.ts +513 -4
- package/client/end-user/endUser.types.ts +598 -0
- package/client/end-user/toEndUserAccount.ts +330 -26
- package/client/evm/evm.types.ts +4 -2
- package/client/solana/solana.ts +39 -13
- package/index.ts +31 -1
- package/openapi-client/cdpApiClient.ts +34 -0
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +566 -152
- package/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.ts +455 -0
- package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +12 -9
- package/openapi-client/generated/evm-accounts/evm-accounts.ts +19 -16
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +16 -16
- package/openapi-client/generated/evm-swaps/evm-swaps.ts +3 -3
- package/openapi-client/generated/evm-token-balances/evm-token-balances.ts +2 -2
- package/openapi-client/generated/faucets/faucets.ts +9 -8
- package/openapi-client/generated/onchain-data/onchain-data.ts +3 -3
- package/openapi-client/generated/onramp/onramp.ts +5 -5
- package/openapi-client/generated/policy-engine/policy-engine.ts +12 -6
- package/openapi-client/generated/solana-accounts/solana-accounts.ts +12 -12
- package/openapi-client/generated/solana-token-balances/solana-token-balances.ts +2 -2
- package/openapi-client/generated/sql-api/sql-api.ts +92 -0
- package/openapi-client/generated/webhooks/webhooks.ts +6 -6
- package/openapi-client/generated/x402-facilitator/x402-facilitator.ts +6 -4
- package/openapi-client/index.ts +4 -1
- package/package.json +7 -8
- package/types/contract.ts +2 -4
- package/utils/export.ts +6 -5
- package/version.ts +1 -1
- package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +0 -55
- package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +0 -1
- package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +0 -50
- package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +0 -1
- package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts +0 -53
- package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts.map +0 -1
- package/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts +0 -72
package/openapi-client/index.ts
CHANGED
|
@@ -10,10 +10,11 @@ export * from "./generated/policy-engine/policy-engine.js";
|
|
|
10
10
|
export * from "./generated/onramp/onramp.js";
|
|
11
11
|
export * from "./generated/onchain-data/onchain-data.js";
|
|
12
12
|
export * from "./generated/end-user-accounts/end-user-accounts.js";
|
|
13
|
+
export * from "./generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js";
|
|
13
14
|
export * from "./generated/x402-facilitator/x402-facilitator.js";
|
|
14
|
-
export * from "./generated/sql-api-alpha/sql-api-alpha.js";
|
|
15
15
|
|
|
16
16
|
import { configure } from "./cdpApiClient.js";
|
|
17
|
+
import * as embeddedWallets from "./generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js";
|
|
17
18
|
import * as endUserAccounts from "./generated/end-user-accounts/end-user-accounts.js";
|
|
18
19
|
import * as evm from "./generated/evm-accounts/evm-accounts.js";
|
|
19
20
|
import * as evmSmartAccounts from "./generated/evm-smart-accounts/evm-smart-accounts.js";
|
|
@@ -38,6 +39,7 @@ export const CdpOpenApiClient = {
|
|
|
38
39
|
...onchainData,
|
|
39
40
|
...policies,
|
|
40
41
|
...endUserAccounts,
|
|
42
|
+
...embeddedWallets,
|
|
41
43
|
configure,
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -59,3 +61,4 @@ export const OpenApiPoliciesMethods = {
|
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
export type CdpOpenApiClientType = typeof CdpOpenApiClient;
|
|
64
|
+
export * from "./generated/sql-api/sql-api.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.46.0",
|
|
4
4
|
"description": "SDK for interacting with the Coinbase Developer Platform Wallet API",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
@@ -18,18 +18,17 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@solana/kit": "^5.1.0",
|
|
22
|
-
"@solana-program/token": "^0.9.0",
|
|
23
21
|
"@solana-program/system": "^0.10.0",
|
|
24
|
-
"@solana/
|
|
22
|
+
"@solana-program/token": "^0.9.0",
|
|
23
|
+
"@solana/kit": "^5.5.1",
|
|
25
24
|
"abitype": "1.0.6",
|
|
26
|
-
"axios": "^1.
|
|
25
|
+
"axios": "^1.13.6",
|
|
27
26
|
"axios-retry": "^4.5.0",
|
|
28
|
-
"jose": "^6.0
|
|
27
|
+
"jose": "^6.2.0",
|
|
29
28
|
"md5": "^2.3.0",
|
|
30
29
|
"uncrypto": "^0.1.3",
|
|
31
|
-
"viem": "^2.
|
|
32
|
-
"zod": "^3.
|
|
30
|
+
"viem": "^2.47.0",
|
|
31
|
+
"zod": "^3.25.76"
|
|
33
32
|
},
|
|
34
33
|
"author": "Coinbase Inc.",
|
|
35
34
|
"repository": "https://github.com/coinbase/cdp-sdk",
|
package/types/contract.ts
CHANGED
|
@@ -88,10 +88,8 @@ type CheckArgs<
|
|
|
88
88
|
abiFunction extends AbiFunction,
|
|
89
89
|
args,
|
|
90
90
|
///
|
|
91
|
-
targetArgs extends AbiParametersToPrimitiveTypes<
|
|
92
|
-
abiFunction["inputs"],
|
|
93
|
-
"inputs"
|
|
94
|
-
> = AbiParametersToPrimitiveTypes<abiFunction["inputs"], "inputs">,
|
|
91
|
+
targetArgs extends AbiParametersToPrimitiveTypes<abiFunction["inputs"], "inputs"> =
|
|
92
|
+
AbiParametersToPrimitiveTypes<abiFunction["inputs"], "inputs">,
|
|
95
93
|
> = (readonly [] extends args ? readonly [] : args) extends targetArgs // fallback to `readonly []` if `args` has no value (e.g. `args` property not provided)
|
|
96
94
|
? abiFunction
|
|
97
95
|
: never;
|
package/utils/export.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { generateKeyPair, privateDecrypt, constants, createPrivateKey } from "crypto";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { createKeyPairFromPrivateKeyBytes } from "@solana/kit";
|
|
4
4
|
import bs58 from "bs58";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -81,9 +81,10 @@ export const decryptWithPrivateKey = (b64PrivateKey: string, b64Cipher: string):
|
|
|
81
81
|
* @param privateKey - The private key as a hex string
|
|
82
82
|
* @returns The formatted private key as a base58 string
|
|
83
83
|
*/
|
|
84
|
-
export const formatSolanaPrivateKey = (privateKey: string): string => {
|
|
85
|
-
const privateKeyBytes = Buffer.from(privateKey, "hex");
|
|
86
|
-
const
|
|
87
|
-
const
|
|
84
|
+
export const formatSolanaPrivateKey = async (privateKey: string): Promise<string> => {
|
|
85
|
+
const privateKeyBytes = new Uint8Array(Buffer.from(privateKey, "hex"));
|
|
86
|
+
const keyPair = await createKeyPairFromPrivateKeyBytes(privateKeyBytes);
|
|
87
|
+
const publicKeyBytes = new Uint8Array(await crypto.subtle.exportKey("raw", keyPair.publicKey));
|
|
88
|
+
const fullKey = Buffer.concat([privateKeyBytes, publicKeyBytes]);
|
|
88
89
|
return bs58.encode(fullKey);
|
|
89
90
|
};
|
package/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "1.
|
|
1
|
+
export const version = "1.46.0";
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSQLGrammar = exports.runSQLQuery = void 0;
|
|
4
|
-
const cdpApiClient_js_1 = require("../../cdpApiClient.js");
|
|
5
|
-
/**
|
|
6
|
-
* Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs.
|
|
7
|
-
|
|
8
|
-
This endpoint provides direct SQL access to comprehensive blockchain data across supported networks.
|
|
9
|
-
Queries are executed against optimized data structures for high-performance analytics.
|
|
10
|
-
|
|
11
|
-
### Allowed Queries
|
|
12
|
-
|
|
13
|
-
- Standard SQL syntax (ClickHouse dialect)
|
|
14
|
-
- Read-only queries (SELECT statements)
|
|
15
|
-
- No DDL or DML operations
|
|
16
|
-
- No cartesian products
|
|
17
|
-
|
|
18
|
-
### Supported Tables
|
|
19
|
-
|
|
20
|
-
- `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more.
|
|
21
|
-
- `base.transactions` - Base mainnet transaction data including hash, block number, gas usage.
|
|
22
|
-
- `base.blocks` - Base mainnet block information.
|
|
23
|
-
- `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode).
|
|
24
|
-
- `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included.
|
|
25
|
-
|
|
26
|
-
### Query Limits
|
|
27
|
-
|
|
28
|
-
- Maximum result set: 100,000 rows
|
|
29
|
-
- Query timeout: 30 seconds
|
|
30
|
-
|
|
31
|
-
* @summary Run SQL Query
|
|
32
|
-
*/
|
|
33
|
-
const runSQLQuery = (onchainDataQuery, options) => {
|
|
34
|
-
return (0, cdpApiClient_js_1.cdpApiClient)({
|
|
35
|
-
url: `/v2/data/query/run`,
|
|
36
|
-
method: "POST",
|
|
37
|
-
headers: { "Content-Type": "application/json" },
|
|
38
|
-
data: onchainDataQuery,
|
|
39
|
-
}, options);
|
|
40
|
-
};
|
|
41
|
-
exports.runSQLQuery = runSQLQuery;
|
|
42
|
-
/**
|
|
43
|
-
* Retrieve the SQL grammar for the SQL API.
|
|
44
|
-
|
|
45
|
-
The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API.
|
|
46
|
-
|
|
47
|
-
This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well.
|
|
48
|
-
|
|
49
|
-
* @summary Get SQL grammar
|
|
50
|
-
*/
|
|
51
|
-
const getSQLGrammar = (options) => {
|
|
52
|
-
return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/data/query/grammar`, method: "GET" }, options);
|
|
53
|
-
};
|
|
54
|
-
exports.getSQLGrammar = getSQLGrammar;
|
|
55
|
-
//# sourceMappingURL=sql-api-alpha.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sql-api-alpha.js","sourceRoot":"","sources":["../../../../openapi-client/generated/sql-api-alpha/sql-api-alpha.ts"],"names":[],"mappings":";;;AAYA,2DAAqD;AAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,MAAM,WAAW,GAAG,CACzB,gBAAkC,EAClC,OAA8C,EAC9C,EAAE;IACF,OAAO,IAAA,8BAAY,EACjB;QACE,GAAG,EAAE,oBAAoB;QACzB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,gBAAgB;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,WAAW,eAatB;AACF;;;;;;;;GAQG;AACI,MAAM,aAAa,GAAG,CAAC,OAA8C,EAAE,EAAE;IAC9E,OAAO,IAAA,8BAAY,EAAS,EAAE,GAAG,EAAE,wBAAwB,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACzF,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { cdpApiClient } from "../../cdpApiClient.js";
|
|
2
|
-
/**
|
|
3
|
-
* Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs.
|
|
4
|
-
|
|
5
|
-
This endpoint provides direct SQL access to comprehensive blockchain data across supported networks.
|
|
6
|
-
Queries are executed against optimized data structures for high-performance analytics.
|
|
7
|
-
|
|
8
|
-
### Allowed Queries
|
|
9
|
-
|
|
10
|
-
- Standard SQL syntax (ClickHouse dialect)
|
|
11
|
-
- Read-only queries (SELECT statements)
|
|
12
|
-
- No DDL or DML operations
|
|
13
|
-
- No cartesian products
|
|
14
|
-
|
|
15
|
-
### Supported Tables
|
|
16
|
-
|
|
17
|
-
- `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more.
|
|
18
|
-
- `base.transactions` - Base mainnet transaction data including hash, block number, gas usage.
|
|
19
|
-
- `base.blocks` - Base mainnet block information.
|
|
20
|
-
- `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode).
|
|
21
|
-
- `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included.
|
|
22
|
-
|
|
23
|
-
### Query Limits
|
|
24
|
-
|
|
25
|
-
- Maximum result set: 100,000 rows
|
|
26
|
-
- Query timeout: 30 seconds
|
|
27
|
-
|
|
28
|
-
* @summary Run SQL Query
|
|
29
|
-
*/
|
|
30
|
-
export const runSQLQuery = (onchainDataQuery, options) => {
|
|
31
|
-
return cdpApiClient({
|
|
32
|
-
url: `/v2/data/query/run`,
|
|
33
|
-
method: "POST",
|
|
34
|
-
headers: { "Content-Type": "application/json" },
|
|
35
|
-
data: onchainDataQuery,
|
|
36
|
-
}, options);
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Retrieve the SQL grammar for the SQL API.
|
|
40
|
-
|
|
41
|
-
The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API.
|
|
42
|
-
|
|
43
|
-
This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well.
|
|
44
|
-
|
|
45
|
-
* @summary Get SQL grammar
|
|
46
|
-
*/
|
|
47
|
-
export const getSQLGrammar = (options) => {
|
|
48
|
-
return cdpApiClient({ url: `/v2/data/query/grammar`, method: "GET" }, options);
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=sql-api-alpha.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sql-api-alpha.js","sourceRoot":"","sources":["../../../../openapi-client/generated/sql-api-alpha/sql-api-alpha.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,gBAAkC,EAClC,OAA8C,EAC9C,EAAE;IACF,OAAO,YAAY,CACjB;QACE,GAAG,EAAE,oBAAoB;QACzB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,gBAAgB;KACvB,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AACF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAA8C,EAAE,EAAE;IAC9E,OAAO,YAAY,CAAS,EAAE,GAAG,EAAE,wBAAwB,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACzF,CAAC,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by orval v7.6.0 🍺
|
|
3
|
-
* Do not edit manually.
|
|
4
|
-
* Coinbase Developer Platform APIs
|
|
5
|
-
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
|
|
6
|
-
* OpenAPI spec version: 2.0.0
|
|
7
|
-
*/
|
|
8
|
-
import type { OnchainDataQuery, OnchainDataResult } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
|
|
9
|
-
import { cdpApiClient } from "../../cdpApiClient.js";
|
|
10
|
-
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
11
|
-
/**
|
|
12
|
-
* Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs.
|
|
13
|
-
|
|
14
|
-
This endpoint provides direct SQL access to comprehensive blockchain data across supported networks.
|
|
15
|
-
Queries are executed against optimized data structures for high-performance analytics.
|
|
16
|
-
|
|
17
|
-
### Allowed Queries
|
|
18
|
-
|
|
19
|
-
- Standard SQL syntax (ClickHouse dialect)
|
|
20
|
-
- Read-only queries (SELECT statements)
|
|
21
|
-
- No DDL or DML operations
|
|
22
|
-
- No cartesian products
|
|
23
|
-
|
|
24
|
-
### Supported Tables
|
|
25
|
-
|
|
26
|
-
- `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more.
|
|
27
|
-
- `base.transactions` - Base mainnet transaction data including hash, block number, gas usage.
|
|
28
|
-
- `base.blocks` - Base mainnet block information.
|
|
29
|
-
- `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode).
|
|
30
|
-
- `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included.
|
|
31
|
-
|
|
32
|
-
### Query Limits
|
|
33
|
-
|
|
34
|
-
- Maximum result set: 100,000 rows
|
|
35
|
-
- Query timeout: 30 seconds
|
|
36
|
-
|
|
37
|
-
* @summary Run SQL Query
|
|
38
|
-
*/
|
|
39
|
-
export declare const runSQLQuery: (onchainDataQuery: OnchainDataQuery, options?: SecondParameter<typeof cdpApiClient>) => Promise<OnchainDataResult>;
|
|
40
|
-
/**
|
|
41
|
-
* Retrieve the SQL grammar for the SQL API.
|
|
42
|
-
|
|
43
|
-
The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API.
|
|
44
|
-
|
|
45
|
-
This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well.
|
|
46
|
-
|
|
47
|
-
* @summary Get SQL grammar
|
|
48
|
-
*/
|
|
49
|
-
export declare const getSQLGrammar: (options?: SecondParameter<typeof cdpApiClient>) => Promise<string>;
|
|
50
|
-
export type RunSQLQueryResult = NonNullable<Awaited<ReturnType<typeof runSQLQuery>>>;
|
|
51
|
-
export type GetSQLGrammarResult = NonNullable<Awaited<ReturnType<typeof getSQLGrammar>>>;
|
|
52
|
-
export {};
|
|
53
|
-
//# sourceMappingURL=sql-api-alpha.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sql-api-alpha.d.ts","sourceRoot":"","sources":["../../../../openapi-client/generated/sql-api-alpha/sql-api-alpha.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,KAAK,eAAe,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,WAAW,GACtB,kBAAkB,gBAAgB,EAClC,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,+BAW/C,CAAC;AACF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,oBAE3E,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;AACrF,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by orval v7.6.0 🍺
|
|
3
|
-
* Do not edit manually.
|
|
4
|
-
* Coinbase Developer Platform APIs
|
|
5
|
-
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
|
|
6
|
-
* OpenAPI spec version: 2.0.0
|
|
7
|
-
*/
|
|
8
|
-
import type {
|
|
9
|
-
OnchainDataQuery,
|
|
10
|
-
OnchainDataResult,
|
|
11
|
-
} from "../coinbaseDeveloperPlatformAPIs.schemas.js";
|
|
12
|
-
|
|
13
|
-
import { cdpApiClient } from "../../cdpApiClient.js";
|
|
14
|
-
|
|
15
|
-
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Run a read-only SQL query against indexed blockchain data including transactions, events, and decoded logs.
|
|
19
|
-
|
|
20
|
-
This endpoint provides direct SQL access to comprehensive blockchain data across supported networks.
|
|
21
|
-
Queries are executed against optimized data structures for high-performance analytics.
|
|
22
|
-
|
|
23
|
-
### Allowed Queries
|
|
24
|
-
|
|
25
|
-
- Standard SQL syntax (ClickHouse dialect)
|
|
26
|
-
- Read-only queries (SELECT statements)
|
|
27
|
-
- No DDL or DML operations
|
|
28
|
-
- No cartesian products
|
|
29
|
-
|
|
30
|
-
### Supported Tables
|
|
31
|
-
|
|
32
|
-
- `base.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more.
|
|
33
|
-
- `base.transactions` - Base mainnet transaction data including hash, block number, gas usage.
|
|
34
|
-
- `base.blocks` - Base mainnet block information.
|
|
35
|
-
- `base.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode).
|
|
36
|
-
- `base.transfers` - All event logs with event signature `Transfer(address,address,uint256)`. ERC-20, ERC-721, and ERC-1155 transfers are all included.
|
|
37
|
-
|
|
38
|
-
### Query Limits
|
|
39
|
-
|
|
40
|
-
- Maximum result set: 100,000 rows
|
|
41
|
-
- Query timeout: 30 seconds
|
|
42
|
-
|
|
43
|
-
* @summary Run SQL Query
|
|
44
|
-
*/
|
|
45
|
-
export const runSQLQuery = (
|
|
46
|
-
onchainDataQuery: OnchainDataQuery,
|
|
47
|
-
options?: SecondParameter<typeof cdpApiClient>,
|
|
48
|
-
) => {
|
|
49
|
-
return cdpApiClient<OnchainDataResult>(
|
|
50
|
-
{
|
|
51
|
-
url: `/v2/data/query/run`,
|
|
52
|
-
method: "POST",
|
|
53
|
-
headers: { "Content-Type": "application/json" },
|
|
54
|
-
data: onchainDataQuery,
|
|
55
|
-
},
|
|
56
|
-
options,
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Retrieve the SQL grammar for the SQL API.
|
|
61
|
-
|
|
62
|
-
The SQL queries that are supported by the SQL API are defined via an ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL API.
|
|
63
|
-
|
|
64
|
-
This endpoint returns the ANTLR4 grammar that is used to evaluate the SQL queries so that developers can understand the SQL API and build SQL queries with high confidence and correctness. LLMs interact well with ANTLR4 grammar as well.
|
|
65
|
-
|
|
66
|
-
* @summary Get SQL grammar
|
|
67
|
-
*/
|
|
68
|
-
export const getSQLGrammar = (options?: SecondParameter<typeof cdpApiClient>) => {
|
|
69
|
-
return cdpApiClient<string>({ url: `/v2/data/query/grammar`, method: "GET" }, options);
|
|
70
|
-
};
|
|
71
|
-
export type RunSQLQueryResult = NonNullable<Awaited<ReturnType<typeof runSQLQuery>>>;
|
|
72
|
-
export type GetSQLGrammarResult = NonNullable<Awaited<ReturnType<typeof getSQLGrammar>>>;
|