@coinbase/cdp-sdk 1.44.1 → 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 +28 -2
- package/README.md +164 -43
- package/_cjs/accounts/evm/eip6492.js +49 -0
- package/_cjs/accounts/evm/eip6492.js.map +1 -0
- package/_cjs/accounts/evm/toEvmDelegatedAccount.js +27 -0
- package/_cjs/accounts/evm/toEvmDelegatedAccount.js.map +1 -0
- package/_cjs/accounts/evm/toEvmServerAccount.js +127 -55
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js +115 -45
- 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/accounts/solana/toSolanaAccount.js +49 -19
- package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
- package/_cjs/actions/evm/waitForEvmEip7702DelegationStatus.js +37 -0
- package/_cjs/actions/evm/waitForEvmEip7702DelegationStatus.js.map +1 -0
- 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/analytics.js +10 -228
- package/_cjs/analytics.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 -7
- 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/evm/evm.js +482 -227
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/client/policies/policies.js +41 -11
- package/_cjs/client/policies/policies.js.map +1 -1
- package/_cjs/client/solana/solana.js +215 -118
- package/_cjs/client/solana/solana.js.map +1 -1
- package/_cjs/index.js +3 -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 +178 -9
- 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 +30 -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 +15 -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/policies/evmSchema.js +127 -1
- package/_cjs/policies/evmSchema.js.map +1 -1
- package/_cjs/policies/solanaSchema.js +102 -1
- package/_cjs/policies/solanaSchema.js.map +1 -1
- package/_cjs/policies/types.js +7 -0
- package/_cjs/policies/types.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/toEvmDelegatedAccount.js +24 -0
- package/_esm/accounts/evm/toEvmDelegatedAccount.js.map +1 -0
- package/_esm/accounts/evm/toEvmServerAccount.js +127 -55
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js +115 -45
- 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/accounts/solana/toSolanaAccount.js +49 -19
- package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
- package/_esm/actions/evm/waitForEvmEip7702DelegationStatus.js +34 -0
- package/_esm/actions/evm/waitForEvmEip7702DelegationStatus.js.map +1 -0
- 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/analytics.js +9 -227
- package/_esm/analytics.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 -7
- 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/evm/evm.js +482 -227
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/client/policies/policies.js +41 -11
- package/_esm/client/policies/policies.js.map +1 -1
- package/_esm/client/solana/solana.js +215 -118
- package/_esm/client/solana/solana.js.map +1 -1
- package/_esm/index.js +1 -0
- 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 +175 -7
- 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 +27 -0
- 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 +13 -0
- 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/policies/evmSchema.js +126 -0
- package/_esm/policies/evmSchema.js.map +1 -1
- package/_esm/policies/solanaSchema.js +101 -0
- package/_esm/policies/solanaSchema.js.map +1 -1
- package/_esm/policies/types.js +9 -2
- package/_esm/policies/types.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/toEvmDelegatedAccount.d.ts +13 -0
- package/_types/accounts/evm/toEvmDelegatedAccount.d.ts.map +1 -0
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- 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/accounts/solana/toSolanaAccount.d.ts.map +1 -1
- package/_types/actions/evm/waitForEvmEip7702DelegationStatus.d.ts +32 -0
- package/_types/actions/evm/waitForEvmEip7702DelegationStatus.d.ts.map +1 -0
- 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/analytics.d.ts +5 -38
- package/_types/analytics.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.d.ts +54 -1
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts +29 -2
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/client/policies/policies.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 +3 -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 +884 -90
- 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 +35 -15
- 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 +12 -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 +23 -3
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/evmSchema.d.ts +3128 -1064
- package/_types/policies/evmSchema.d.ts.map +1 -1
- package/_types/policies/solanaSchema.d.ts +1411 -47
- package/_types/policies/solanaSchema.d.ts.map +1 -1
- package/_types/policies/types.d.ts +8427 -2942
- 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/toEvmDelegatedAccount.ts +26 -0
- package/accounts/evm/toEvmServerAccount.ts +115 -67
- package/accounts/evm/toEvmSmartAccount.ts +114 -57
- package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +44 -5
- package/accounts/evm/types.ts +8 -3
- package/accounts/solana/toSolanaAccount.ts +44 -24
- package/actions/evm/waitForEvmEip7702DelegationStatus.ts +57 -0
- package/actions/solana/transfer.ts +3 -3
- package/actions/solana/types.ts +79 -29
- package/actions/solana/utils.ts +13 -11
- package/analytics.ts +8 -294
- package/auth/utils/http.ts +1 -0
- package/client/cdp.ts +6 -8
- 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.ts +517 -282
- package/client/evm/evm.types.ts +45 -2
- package/client/policies/policies.ts +41 -16
- package/client/solana/solana.ts +233 -153
- package/index.ts +36 -1
- package/openapi-client/cdpApiClient.ts +34 -0
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +1155 -172
- 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 +66 -14
- 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 +28 -4
- 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/policies/evmSchema.ts +164 -0
- package/policies/solanaSchema.ts +130 -0
- package/policies/types.ts +14 -0
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v7.
|
|
2
|
+
* Generated by orval v7.21.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Coinbase Developer Platform APIs
|
|
5
5
|
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
|
|
@@ -25,7 +25,7 @@ export const listSolanaTokenBalances = (
|
|
|
25
25
|
network: ListSolanaTokenBalancesNetwork,
|
|
26
26
|
address: string,
|
|
27
27
|
params?: ListSolanaTokenBalancesParams,
|
|
28
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
28
|
+
options?: SecondParameter<typeof cdpApiClient<ListSolanaTokenBalances200>>,
|
|
29
29
|
) => {
|
|
30
30
|
return cdpApiClient<ListSolanaTokenBalances200>(
|
|
31
31
|
{ url: `/v2/solana/token-balances/${network}/${address}`, method: "GET", params },
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v7.21.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
|
+
|
|
22
|
+
Queries are executed against optimized data structures for high-performance analytics.
|
|
23
|
+
|
|
24
|
+
### Allowed Queries
|
|
25
|
+
|
|
26
|
+
- Standard SQL syntax (CoinbaSeQL dialect, based on ClickHouse dialect)
|
|
27
|
+
- Read-only queries (SELECT statements)
|
|
28
|
+
- No DDL or DML operations
|
|
29
|
+
- Query that follow limits (defined below)
|
|
30
|
+
|
|
31
|
+
### Supported Tables
|
|
32
|
+
|
|
33
|
+
- `<network>.events` - Base mainnet decoded event logs with parameters, event signature, topics, and more.
|
|
34
|
+
- `<network>.transactions` - Base mainnet transaction data including hash, block number, gas usage.
|
|
35
|
+
- `<network>.blocks` - Base mainnet block information.
|
|
36
|
+
- `<network>.encoded_logs` - Encoded log data of event logs that aren't able to be decoded by our event decoder (ex: log0 opcode).
|
|
37
|
+
- `<network>.decoded_user_operations` - Decoded user operations data including hash, block number, gas usage, builder codes, entrypoint version, and more.
|
|
38
|
+
- `<network>.transaction_attributions` - Information about the attributions of a transaction to a builder and associated builder codes.
|
|
39
|
+
|
|
40
|
+
### Supported Networks
|
|
41
|
+
|
|
42
|
+
- Base Mainnet: `base`
|
|
43
|
+
- Base Sepolia: `base_sepolia`
|
|
44
|
+
|
|
45
|
+
So for example, valid tables are: `base.events`, `base_sepolia.events`, `base.transactions`, etc.
|
|
46
|
+
|
|
47
|
+
### Query Limits
|
|
48
|
+
|
|
49
|
+
- Maximum result set: 50,000 rows
|
|
50
|
+
- Maximum query length: 10,000 characters
|
|
51
|
+
- Maximum on-disk data to read: 100GB
|
|
52
|
+
- Maximum memory usage: 15GB
|
|
53
|
+
- Query timeout: 30 seconds
|
|
54
|
+
- Maximum JOINs: 12
|
|
55
|
+
|
|
56
|
+
### Query Caching
|
|
57
|
+
|
|
58
|
+
By default, each query result is returned from cache so long as the result is from an identical query and less than 750ms old. This freshness tolerance can be modified upwards, to a maximum of 900000ms (i.e. 900s, 15m).
|
|
59
|
+
This can be helpful for users who wish to reduce expensive calls to the SQL API by reusing cached results.
|
|
60
|
+
|
|
61
|
+
* @summary Run SQL Query
|
|
62
|
+
*/
|
|
63
|
+
export const runSQLQuery = (
|
|
64
|
+
onchainDataQuery: OnchainDataQuery,
|
|
65
|
+
options?: SecondParameter<typeof cdpApiClient<OnchainDataResult>>,
|
|
66
|
+
) => {
|
|
67
|
+
return cdpApiClient<OnchainDataResult>(
|
|
68
|
+
{
|
|
69
|
+
url: `/v2/data/query/run`,
|
|
70
|
+
method: "POST",
|
|
71
|
+
headers: { "Content-Type": "application/json" },
|
|
72
|
+
data: onchainDataQuery,
|
|
73
|
+
},
|
|
74
|
+
options,
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Retrieve the SQL grammar for the SQL API.
|
|
79
|
+
|
|
80
|
+
The SQL queries that are supported by the SQL API are defined in ANTLR4 grammar which is evaluated by server before executing the query. This ensures the safety and soundness of the SQL query before execution.
|
|
81
|
+
|
|
82
|
+
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.
|
|
83
|
+
|
|
84
|
+
LLMs interact well with ANTLR4 grammar. You can feed the grammar directly into the LLMs to help generate SQL queries.
|
|
85
|
+
|
|
86
|
+
* @summary Get SQL grammar
|
|
87
|
+
*/
|
|
88
|
+
export const getSQLGrammar = (options?: SecondParameter<typeof cdpApiClient<string>>) => {
|
|
89
|
+
return cdpApiClient<string>({ url: `/v2/data/query/grammar`, method: "GET" }, options);
|
|
90
|
+
};
|
|
91
|
+
export type RunSQLQueryResult = NonNullable<Awaited<ReturnType<typeof runSQLQuery>>>;
|
|
92
|
+
export type GetSQLGrammarResult = NonNullable<Awaited<ReturnType<typeof getSQLGrammar>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v7.
|
|
2
|
+
* Generated by orval v7.21.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Coinbase Developer Platform APIs
|
|
5
5
|
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
|
|
@@ -31,7 +31,7 @@ in descending order by creation time.
|
|
|
31
31
|
*/
|
|
32
32
|
export const listWebhookSubscriptions = (
|
|
33
33
|
params?: ListWebhookSubscriptionsParams,
|
|
34
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
34
|
+
options?: SecondParameter<typeof cdpApiClient<WebhookSubscriptionListResponse>>,
|
|
35
35
|
) => {
|
|
36
36
|
return cdpApiClient<WebhookSubscriptionListResponse>(
|
|
37
37
|
{ url: `/v2/data/webhooks/subscriptions`, method: "GET", params },
|
|
@@ -94,7 +94,7 @@ For `onchain.activity.detected` events, use `labels` for precise filtering with
|
|
|
94
94
|
*/
|
|
95
95
|
export const createWebhookSubscription = (
|
|
96
96
|
webhookSubscriptionRequest: WebhookSubscriptionRequest,
|
|
97
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
97
|
+
options?: SecondParameter<typeof cdpApiClient<WebhookSubscriptionResponse>>,
|
|
98
98
|
) => {
|
|
99
99
|
return cdpApiClient<WebhookSubscriptionResponse>(
|
|
100
100
|
{
|
|
@@ -120,7 +120,7 @@ configuration, status, creation timestamp, and webhook signature secret.
|
|
|
120
120
|
*/
|
|
121
121
|
export const getWebhookSubscription = (
|
|
122
122
|
subscriptionId: string,
|
|
123
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
123
|
+
options?: SecondParameter<typeof cdpApiClient<WebhookSubscriptionResponse>>,
|
|
124
124
|
) => {
|
|
125
125
|
return cdpApiClient<WebhookSubscriptionResponse>(
|
|
126
126
|
{ url: `/v2/data/webhooks/subscriptions/${subscriptionId}`, method: "GET" },
|
|
@@ -143,7 +143,7 @@ All required fields must be provided, even if they are not being changed.
|
|
|
143
143
|
export const updateWebhookSubscription = (
|
|
144
144
|
subscriptionId: string,
|
|
145
145
|
webhookSubscriptionUpdateRequest: WebhookSubscriptionUpdateRequest,
|
|
146
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
146
|
+
options?: SecondParameter<typeof cdpApiClient<WebhookSubscriptionResponse>>,
|
|
147
147
|
) => {
|
|
148
148
|
return cdpApiClient<WebhookSubscriptionResponse>(
|
|
149
149
|
{
|
|
@@ -168,7 +168,7 @@ This action cannot be undone.
|
|
|
168
168
|
*/
|
|
169
169
|
export const deleteWebhookSubscription = (
|
|
170
170
|
subscriptionId: string,
|
|
171
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
171
|
+
options?: SecondParameter<typeof cdpApiClient<void>>,
|
|
172
172
|
) => {
|
|
173
173
|
return cdpApiClient<void>(
|
|
174
174
|
{ url: `/v2/data/webhooks/subscriptions/${subscriptionId}`, method: "DELETE" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v7.
|
|
2
|
+
* Generated by orval v7.21.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Coinbase Developer Platform APIs
|
|
5
5
|
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
|
|
@@ -23,7 +23,7 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
23
23
|
*/
|
|
24
24
|
export const verifyX402Payment = (
|
|
25
25
|
verifyX402PaymentBody: VerifyX402PaymentBody,
|
|
26
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
26
|
+
options?: SecondParameter<typeof cdpApiClient<X402VerifyResponseResponse>>,
|
|
27
27
|
) => {
|
|
28
28
|
return cdpApiClient<X402VerifyResponseResponse>(
|
|
29
29
|
{
|
|
@@ -41,7 +41,7 @@ export const verifyX402Payment = (
|
|
|
41
41
|
*/
|
|
42
42
|
export const settleX402Payment = (
|
|
43
43
|
settleX402PaymentBody: SettleX402PaymentBody,
|
|
44
|
-
options?: SecondParameter<typeof cdpApiClient
|
|
44
|
+
options?: SecondParameter<typeof cdpApiClient<X402SettleResponseResponse>>,
|
|
45
45
|
) => {
|
|
46
46
|
return cdpApiClient<X402SettleResponseResponse>(
|
|
47
47
|
{
|
|
@@ -57,7 +57,9 @@ export const settleX402Payment = (
|
|
|
57
57
|
* Get the supported x402 protocol payment schemes and networks that the facilitator is able to verify and settle payments for.
|
|
58
58
|
* @summary Get supported payment schemes and networks
|
|
59
59
|
*/
|
|
60
|
-
export const supportedX402PaymentKinds = (
|
|
60
|
+
export const supportedX402PaymentKinds = (
|
|
61
|
+
options?: SecondParameter<typeof cdpApiClient<X402SupportedPaymentKindsResponseResponse>>,
|
|
62
|
+
) => {
|
|
61
63
|
return cdpApiClient<X402SupportedPaymentKindsResponseResponse>(
|
|
62
64
|
{ url: `/v2/x402/supported`, method: "GET" },
|
|
63
65
|
options,
|
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/policies/evmSchema.ts
CHANGED
|
@@ -508,6 +508,78 @@ export const SendUserOperationCriteriaSchema = z
|
|
|
508
508
|
*/
|
|
509
509
|
export type SendUserOperationCriteria = z.infer<typeof SendUserOperationCriteriaSchema>;
|
|
510
510
|
|
|
511
|
+
/**
|
|
512
|
+
* Schema for criteria used in SignEndUserEvmTransaction operations
|
|
513
|
+
*/
|
|
514
|
+
export const SignEndUserEvmTransactionCriteriaSchema = z
|
|
515
|
+
.array(
|
|
516
|
+
z.discriminatedUnion("type", [
|
|
517
|
+
EthValueCriterionSchema,
|
|
518
|
+
EvmAddressCriterionSchema,
|
|
519
|
+
EvmDataCriterionSchema,
|
|
520
|
+
NetUSDChangeCriterionSchema,
|
|
521
|
+
]),
|
|
522
|
+
)
|
|
523
|
+
.max(10)
|
|
524
|
+
.min(1);
|
|
525
|
+
/**
|
|
526
|
+
* Type representing a set of criteria for the signEndUserEvmTransaction operation.
|
|
527
|
+
*/
|
|
528
|
+
export type SignEndUserEvmTransactionCriteria = z.infer<
|
|
529
|
+
typeof SignEndUserEvmTransactionCriteriaSchema
|
|
530
|
+
>;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Schema for criteria used in SendEndUserEvmTransaction operations
|
|
534
|
+
*/
|
|
535
|
+
export const SendEndUserEvmTransactionCriteriaSchema = z
|
|
536
|
+
.array(
|
|
537
|
+
z.discriminatedUnion("type", [
|
|
538
|
+
EthValueCriterionSchema,
|
|
539
|
+
EvmAddressCriterionSchema,
|
|
540
|
+
PrepareUserOperationEvmNetworkCriterionSchema,
|
|
541
|
+
EvmDataCriterionSchema,
|
|
542
|
+
NetUSDChangeCriterionSchema,
|
|
543
|
+
]),
|
|
544
|
+
)
|
|
545
|
+
.max(10)
|
|
546
|
+
.min(1);
|
|
547
|
+
/**
|
|
548
|
+
* Type representing a set of criteria for the sendEndUserEvmTransaction operation.
|
|
549
|
+
*/
|
|
550
|
+
export type SendEndUserEvmTransactionCriteria = z.infer<
|
|
551
|
+
typeof SendEndUserEvmTransactionCriteriaSchema
|
|
552
|
+
>;
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Schema for criteria used in SignEndUserEvmMessage operations
|
|
556
|
+
*/
|
|
557
|
+
export const SignEndUserEvmMessageCriteriaSchema = z
|
|
558
|
+
.array(z.discriminatedUnion("type", [EvmMessageCriterionSchema]))
|
|
559
|
+
.max(10)
|
|
560
|
+
.min(1);
|
|
561
|
+
/**
|
|
562
|
+
* Type representing a set of criteria for the signEndUserEvmMessage operation.
|
|
563
|
+
*/
|
|
564
|
+
export type SignEndUserEvmMessageCriteria = z.infer<typeof SignEndUserEvmMessageCriteriaSchema>;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Schema for criteria used in SignEndUserEvmTypedData operations
|
|
568
|
+
*/
|
|
569
|
+
export const SignEndUserEvmTypedDataCriteriaSchema = z
|
|
570
|
+
.array(
|
|
571
|
+
z.discriminatedUnion("type", [
|
|
572
|
+
SignEvmTypedDataFieldCriterionSchema,
|
|
573
|
+
SignEvmTypedDataVerifyingContractCriterionSchema,
|
|
574
|
+
]),
|
|
575
|
+
)
|
|
576
|
+
.max(10)
|
|
577
|
+
.min(1);
|
|
578
|
+
/**
|
|
579
|
+
* Type representing a set of criteria for the signEndUserEvmTypedData operation.
|
|
580
|
+
*/
|
|
581
|
+
export type SignEndUserEvmTypedDataCriteria = z.infer<typeof SignEndUserEvmTypedDataCriteriaSchema>;
|
|
582
|
+
|
|
511
583
|
/**
|
|
512
584
|
* Enum for Evm Operation types
|
|
513
585
|
*/
|
|
@@ -691,3 +763,95 @@ export const SendUserOperationRuleSchema = z.object({
|
|
|
691
763
|
criteria: SendUserOperationCriteriaSchema,
|
|
692
764
|
});
|
|
693
765
|
export type SendUserOperationRule = z.infer<typeof SendUserOperationRuleSchema>;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Type representing a 'signEndUserEvmTransaction' policy rule that can accept or reject specific operations
|
|
769
|
+
* based on a set of criteria.
|
|
770
|
+
*/
|
|
771
|
+
export const SignEndUserEvmTransactionRuleSchema = z.object({
|
|
772
|
+
/**
|
|
773
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
774
|
+
* "accept" will allow the transaction, "reject" will block it.
|
|
775
|
+
*/
|
|
776
|
+
action: ActionEnum,
|
|
777
|
+
/**
|
|
778
|
+
* The operation to which this rule applies.
|
|
779
|
+
* Must be "signEndUserEvmTransaction".
|
|
780
|
+
*/
|
|
781
|
+
operation: z.literal("signEndUserEvmTransaction"),
|
|
782
|
+
/**
|
|
783
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
784
|
+
* Must be compatible with the specified operation type.
|
|
785
|
+
*/
|
|
786
|
+
criteria: SignEndUserEvmTransactionCriteriaSchema,
|
|
787
|
+
});
|
|
788
|
+
export type SignEndUserEvmTransactionRule = z.infer<typeof SignEndUserEvmTransactionRuleSchema>;
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Type representing a 'sendEndUserEvmTransaction' policy rule that can accept or reject specific operations
|
|
792
|
+
* based on a set of criteria.
|
|
793
|
+
*/
|
|
794
|
+
export const SendEndUserEvmTransactionRuleSchema = z.object({
|
|
795
|
+
/**
|
|
796
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
797
|
+
* "accept" will allow the transaction, "reject" will block it.
|
|
798
|
+
*/
|
|
799
|
+
action: ActionEnum,
|
|
800
|
+
/**
|
|
801
|
+
* The operation to which this rule applies.
|
|
802
|
+
* Must be "sendEndUserEvmTransaction".
|
|
803
|
+
*/
|
|
804
|
+
operation: z.literal("sendEndUserEvmTransaction"),
|
|
805
|
+
/**
|
|
806
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
807
|
+
* Must be compatible with the specified operation type.
|
|
808
|
+
*/
|
|
809
|
+
criteria: SendEndUserEvmTransactionCriteriaSchema,
|
|
810
|
+
});
|
|
811
|
+
export type SendEndUserEvmTransactionRule = z.infer<typeof SendEndUserEvmTransactionRuleSchema>;
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Type representing a 'signEndUserEvmMessage' policy rule that can accept or reject specific operations
|
|
815
|
+
* based on a set of criteria.
|
|
816
|
+
*/
|
|
817
|
+
export const SignEndUserEvmMessageRuleSchema = z.object({
|
|
818
|
+
/**
|
|
819
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
820
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
821
|
+
*/
|
|
822
|
+
action: ActionEnum,
|
|
823
|
+
/**
|
|
824
|
+
* The operation to which this rule applies.
|
|
825
|
+
* Must be "signEndUserEvmMessage".
|
|
826
|
+
*/
|
|
827
|
+
operation: z.literal("signEndUserEvmMessage"),
|
|
828
|
+
/**
|
|
829
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
830
|
+
* Must be compatible with the specified operation type.
|
|
831
|
+
*/
|
|
832
|
+
criteria: SignEndUserEvmMessageCriteriaSchema,
|
|
833
|
+
});
|
|
834
|
+
export type SignEndUserEvmMessageRule = z.infer<typeof SignEndUserEvmMessageRuleSchema>;
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Type representing a 'signEndUserEvmTypedData' policy rule that can accept or reject specific operations
|
|
838
|
+
* based on a set of criteria.
|
|
839
|
+
*/
|
|
840
|
+
export const SignEndUserEvmTypedDataRuleSchema = z.object({
|
|
841
|
+
/**
|
|
842
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
843
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
844
|
+
*/
|
|
845
|
+
action: ActionEnum,
|
|
846
|
+
/**
|
|
847
|
+
* The operation to which this rule applies.
|
|
848
|
+
* Must be "signEndUserEvmTypedData".
|
|
849
|
+
*/
|
|
850
|
+
operation: z.literal("signEndUserEvmTypedData"),
|
|
851
|
+
/**
|
|
852
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
853
|
+
* Must be compatible with the specified operation type.
|
|
854
|
+
*/
|
|
855
|
+
criteria: SignEndUserEvmTypedDataCriteriaSchema,
|
|
856
|
+
});
|
|
857
|
+
export type SignEndUserEvmTypedDataRule = z.infer<typeof SignEndUserEvmTypedDataRuleSchema>;
|
package/policies/solanaSchema.ts
CHANGED
|
@@ -378,6 +378,67 @@ export const SendSolTransactionCriteriaSchema = z
|
|
|
378
378
|
*/
|
|
379
379
|
export type SendSolTransactionCriteria = z.infer<typeof SendSolTransactionCriteriaSchema>;
|
|
380
380
|
|
|
381
|
+
/**
|
|
382
|
+
* Schema for criteria used in SignEndUserSolTransaction operations
|
|
383
|
+
*/
|
|
384
|
+
export const SignEndUserSolTransactionCriteriaSchema = z
|
|
385
|
+
.array(
|
|
386
|
+
z.discriminatedUnion("type", [
|
|
387
|
+
SolAddressCriterionSchema,
|
|
388
|
+
SolValueCriterionSchema,
|
|
389
|
+
SplAddressCriterionSchema,
|
|
390
|
+
SplValueCriterionSchema,
|
|
391
|
+
MintAddressCriterionSchema,
|
|
392
|
+
SolDataCriterionSchema,
|
|
393
|
+
ProgramIdCriterionSchema,
|
|
394
|
+
]),
|
|
395
|
+
)
|
|
396
|
+
.max(10)
|
|
397
|
+
.min(1);
|
|
398
|
+
/**
|
|
399
|
+
* Type representing a set of criteria for the signEndUserSolTransaction operation.
|
|
400
|
+
*/
|
|
401
|
+
export type SignEndUserSolTransactionCriteria = z.infer<
|
|
402
|
+
typeof SignEndUserSolTransactionCriteriaSchema
|
|
403
|
+
>;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Schema for criteria used in SendEndUserSolTransaction operations
|
|
407
|
+
*/
|
|
408
|
+
export const SendEndUserSolTransactionCriteriaSchema = z
|
|
409
|
+
.array(
|
|
410
|
+
z.discriminatedUnion("type", [
|
|
411
|
+
SolAddressCriterionSchema,
|
|
412
|
+
SolValueCriterionSchema,
|
|
413
|
+
SplAddressCriterionSchema,
|
|
414
|
+
SplValueCriterionSchema,
|
|
415
|
+
MintAddressCriterionSchema,
|
|
416
|
+
SolDataCriterionSchema,
|
|
417
|
+
ProgramIdCriterionSchema,
|
|
418
|
+
SolNetworkCriterionSchema,
|
|
419
|
+
]),
|
|
420
|
+
)
|
|
421
|
+
.max(10)
|
|
422
|
+
.min(1);
|
|
423
|
+
/**
|
|
424
|
+
* Type representing a set of criteria for the sendEndUserSolTransaction operation.
|
|
425
|
+
*/
|
|
426
|
+
export type SendEndUserSolTransactionCriteria = z.infer<
|
|
427
|
+
typeof SendEndUserSolTransactionCriteriaSchema
|
|
428
|
+
>;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Schema for criteria used in SignEndUserSolMessage operations
|
|
432
|
+
*/
|
|
433
|
+
export const SignEndUserSolMessageCriteriaSchema = z
|
|
434
|
+
.array(SolMessageCriterionSchema)
|
|
435
|
+
.max(10)
|
|
436
|
+
.min(1);
|
|
437
|
+
/**
|
|
438
|
+
* Type representing a set of criteria for the signEndUserSolMessage operation.
|
|
439
|
+
*/
|
|
440
|
+
export type SignEndUserSolMessageCriteria = z.infer<typeof SignEndUserSolMessageCriteriaSchema>;
|
|
441
|
+
|
|
381
442
|
/**
|
|
382
443
|
* Enum for Solana Operation types
|
|
383
444
|
*/
|
|
@@ -470,3 +531,72 @@ export const SignSolMessageRuleSchema = z.object({
|
|
|
470
531
|
criteria: SignSolMessageCriteriaSchema,
|
|
471
532
|
});
|
|
472
533
|
export type SignSolMessageRule = z.infer<typeof SignSolMessageRuleSchema>;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Type representing a 'signEndUserSolTransaction' policy rule that can accept or reject specific operations
|
|
537
|
+
* based on a set of criteria.
|
|
538
|
+
*/
|
|
539
|
+
export const SignEndUserSolTransactionRuleSchema = z.object({
|
|
540
|
+
/**
|
|
541
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
542
|
+
* "accept" will allow the transaction, "reject" will block it.
|
|
543
|
+
*/
|
|
544
|
+
action: ActionEnum,
|
|
545
|
+
/**
|
|
546
|
+
* The operation to which this rule applies.
|
|
547
|
+
* Must be "signEndUserSolTransaction".
|
|
548
|
+
*/
|
|
549
|
+
operation: z.literal("signEndUserSolTransaction"),
|
|
550
|
+
/**
|
|
551
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
552
|
+
* Must be compatible with the specified operation type.
|
|
553
|
+
*/
|
|
554
|
+
criteria: SignEndUserSolTransactionCriteriaSchema,
|
|
555
|
+
});
|
|
556
|
+
export type SignEndUserSolTransactionRule = z.infer<typeof SignEndUserSolTransactionRuleSchema>;
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Type representing a 'sendEndUserSolTransaction' policy rule that can accept or reject specific operations
|
|
560
|
+
* based on a set of criteria.
|
|
561
|
+
*/
|
|
562
|
+
export const SendEndUserSolTransactionRuleSchema = z.object({
|
|
563
|
+
/**
|
|
564
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
565
|
+
* "accept" will allow the transaction, "reject" will block it.
|
|
566
|
+
*/
|
|
567
|
+
action: ActionEnum,
|
|
568
|
+
/**
|
|
569
|
+
* The operation to which this rule applies.
|
|
570
|
+
* Must be "sendEndUserSolTransaction".
|
|
571
|
+
*/
|
|
572
|
+
operation: z.literal("sendEndUserSolTransaction"),
|
|
573
|
+
/**
|
|
574
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
575
|
+
* Must be compatible with the specified operation type.
|
|
576
|
+
*/
|
|
577
|
+
criteria: SendEndUserSolTransactionCriteriaSchema,
|
|
578
|
+
});
|
|
579
|
+
export type SendEndUserSolTransactionRule = z.infer<typeof SendEndUserSolTransactionRuleSchema>;
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Type representing a 'signEndUserSolMessage' policy rule that can accept or reject specific operations
|
|
583
|
+
* based on a set of criteria.
|
|
584
|
+
*/
|
|
585
|
+
export const SignEndUserSolMessageRuleSchema = z.object({
|
|
586
|
+
/**
|
|
587
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
588
|
+
* "accept" will allow the message signing, "reject" will block it.
|
|
589
|
+
*/
|
|
590
|
+
action: ActionEnum,
|
|
591
|
+
/**
|
|
592
|
+
* The operation to which this rule applies.
|
|
593
|
+
* Must be "signEndUserSolMessage".
|
|
594
|
+
*/
|
|
595
|
+
operation: z.literal("signEndUserSolMessage"),
|
|
596
|
+
/**
|
|
597
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
598
|
+
* Must be compatible with the specified operation type.
|
|
599
|
+
*/
|
|
600
|
+
criteria: SignEndUserSolMessageCriteriaSchema,
|
|
601
|
+
});
|
|
602
|
+
export type SignEndUserSolMessageRule = z.infer<typeof SignEndUserSolMessageRuleSchema>;
|
package/policies/types.ts
CHANGED
|
@@ -8,11 +8,18 @@ import {
|
|
|
8
8
|
SignEvmTransactionRuleSchema,
|
|
9
9
|
SignEvmTypedDataRuleSchema,
|
|
10
10
|
SendUserOperationRuleSchema,
|
|
11
|
+
SignEndUserEvmTransactionRuleSchema,
|
|
12
|
+
SendEndUserEvmTransactionRuleSchema,
|
|
13
|
+
SignEndUserEvmMessageRuleSchema,
|
|
14
|
+
SignEndUserEvmTypedDataRuleSchema,
|
|
11
15
|
} from "./evmSchema.js";
|
|
12
16
|
import {
|
|
13
17
|
SendSolTransactionRuleSchema,
|
|
14
18
|
SignSolTransactionRuleSchema,
|
|
15
19
|
SignSolMessageRuleSchema,
|
|
20
|
+
SignEndUserSolTransactionRuleSchema,
|
|
21
|
+
SendEndUserSolTransactionRuleSchema,
|
|
22
|
+
SignEndUserSolMessageRuleSchema,
|
|
16
23
|
} from "./solanaSchema.js";
|
|
17
24
|
|
|
18
25
|
/**
|
|
@@ -57,6 +64,13 @@ export const RuleSchema = z.discriminatedUnion("operation", [
|
|
|
57
64
|
SignSolMessageRuleSchema,
|
|
58
65
|
PrepareUserOperationRuleSchema,
|
|
59
66
|
SendUserOperationRuleSchema,
|
|
67
|
+
SignEndUserEvmTransactionRuleSchema,
|
|
68
|
+
SendEndUserEvmTransactionRuleSchema,
|
|
69
|
+
SignEndUserEvmMessageRuleSchema,
|
|
70
|
+
SignEndUserEvmTypedDataRuleSchema,
|
|
71
|
+
SignEndUserSolTransactionRuleSchema,
|
|
72
|
+
SendEndUserSolTransactionRuleSchema,
|
|
73
|
+
SignEndUserSolMessageRuleSchema,
|
|
60
74
|
]);
|
|
61
75
|
|
|
62
76
|
/**
|
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";
|