@coinbase/agentkit 0.0.0-nightly-20250807210405 → 0.0.0-nightly-20250815210416
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 +106 -54
- package/dist/action-providers/cdp/cdpEvmWalletActionProvider.d.ts +43 -0
- package/dist/action-providers/cdp/cdpEvmWalletActionProvider.js +151 -0
- package/dist/action-providers/cdp/cdpEvmWalletActionProvider.test.d.ts +1 -0
- package/dist/action-providers/cdp/cdpEvmWalletActionProvider.test.js +242 -0
- package/dist/action-providers/cdp/cdpSmartWalletActionProvider.d.ts +42 -0
- package/dist/action-providers/cdp/cdpSmartWalletActionProvider.js +132 -0
- package/dist/action-providers/cdp/cdpSmartWalletActionProvider.test.d.ts +1 -0
- package/dist/action-providers/cdp/cdpSmartWalletActionProvider.test.js +199 -0
- package/dist/action-providers/cdp/index.d.ts +3 -0
- package/dist/action-providers/cdp/index.js +3 -0
- package/dist/action-providers/cdp/schemas.d.ts +29 -0
- package/dist/action-providers/cdp/schemas.js +32 -1
- package/dist/action-providers/cdp/spendPermissionUtils.d.ts +24 -0
- package/dist/action-providers/cdp/spendPermissionUtils.js +66 -0
- package/dist/action-providers/flaunch/flaunchActionProvider.js +3 -11
- package/dist/action-providers/flaunch/flaunchActionProvider.test.js +5 -0
- package/dist/action-providers/index.d.ts +1 -0
- package/dist/action-providers/index.js +1 -0
- package/dist/action-providers/truemarkets/truemarketsActionProvider.d.ts +4 -16
- package/dist/action-providers/truemarkets/truemarketsActionProvider.js +10 -31
- package/dist/action-providers/truemarkets/truemarketsActionProvider.test.js +11 -33
- package/dist/action-providers/zerion/constants.d.ts +1 -0
- package/dist/action-providers/zerion/constants.js +4 -0
- package/dist/action-providers/zerion/index.d.ts +2 -0
- package/dist/action-providers/zerion/index.js +18 -0
- package/dist/action-providers/zerion/schemas.d.ts +11 -0
- package/dist/action-providers/zerion/schemas.js +15 -0
- package/dist/action-providers/zerion/types.d.ts +125 -0
- package/dist/action-providers/zerion/types.js +16 -0
- package/dist/action-providers/zerion/utils.d.ts +3 -0
- package/dist/action-providers/zerion/utils.js +45 -0
- package/dist/action-providers/zerion/zerionActionProvider.d.ts +57 -0
- package/dist/action-providers/zerion/zerionActionProvider.js +159 -0
- package/dist/action-providers/zerion/zerionActionProvider.test.d.ts +1 -0
- package/dist/action-providers/zerion/zerionActionProvider.test.js +213 -0
- package/dist/wallet-providers/cdpEvmWalletProvider.d.ts +7 -1
- package/dist/wallet-providers/cdpEvmWalletProvider.js +10 -1
- package/dist/wallet-providers/cdpShared.d.ts +5 -0
- package/dist/wallet-providers/cdpSmartWalletProvider.d.ts +9 -2
- package/dist/wallet-providers/cdpSmartWalletProvider.js +20 -12
- package/dist/wallet-providers/evmWalletProvider.d.ts +5 -1
- package/dist/wallet-providers/legacyCdpSmartWalletProvider.d.ts +8 -1
- package/dist/wallet-providers/legacyCdpSmartWalletProvider.js +11 -1
- package/dist/wallet-providers/legacyCdpWalletProvider.d.ts +11 -1
- package/dist/wallet-providers/legacyCdpWalletProvider.js +10 -1
- package/dist/wallet-providers/privyEvmDelegatedEmbeddedWalletProvider.d.ts +9 -1
- package/dist/wallet-providers/privyEvmDelegatedEmbeddedWalletProvider.js +10 -1
- package/dist/wallet-providers/privyEvmWalletProvider.d.ts +2 -0
- package/dist/wallet-providers/privyEvmWalletProvider.js +2 -1
- package/dist/wallet-providers/viemWalletProvider.d.ts +7 -1
- package/dist/wallet-providers/viemWalletProvider.js +8 -0
- package/dist/wallet-providers/zeroDevWalletProvider.d.ts +9 -1
- package/dist/wallet-providers/zeroDevWalletProvider.js +10 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReadContractParameters, ReadContractReturnType, TransactionRequest, TransactionSerializable, Abi, ContractFunctionName, ContractFunctionArgs, Address, Hex } from "viem";
|
|
1
|
+
import { ReadContractParameters, ReadContractReturnType, TransactionRequest, TransactionSerializable, PublicClient, Abi, ContractFunctionName, ContractFunctionArgs, Address, Hex } from "viem";
|
|
2
2
|
import { EvmWalletProvider } from "./evmWalletProvider";
|
|
3
3
|
import { Network } from "../network";
|
|
4
4
|
import { Coinbase, CreateERC20Options, CreateTradeOptions, SmartContract, Trade, Wallet, WalletData } from "@coinbase/coinbase-sdk";
|
|
@@ -50,6 +50,10 @@ export interface LegacyCdpWalletProviderConfig extends LegacyCdpProviderConfig {
|
|
|
50
50
|
*/
|
|
51
51
|
feePerGasMultiplier?: number;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Optional RPC URL for Viem public client.
|
|
55
|
+
*/
|
|
56
|
+
rpcUrl?: string;
|
|
53
57
|
}
|
|
54
58
|
/**
|
|
55
59
|
* Configuration options for the CDP Agentkit with a Wallet.
|
|
@@ -148,6 +152,12 @@ export declare class LegacyCdpWalletProvider extends EvmWalletProvider {
|
|
|
148
152
|
* @returns The name of the wallet provider.
|
|
149
153
|
*/
|
|
150
154
|
getName(): string;
|
|
155
|
+
/**
|
|
156
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
157
|
+
*
|
|
158
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
159
|
+
*/
|
|
160
|
+
getPublicClient(): PublicClient;
|
|
151
161
|
/**
|
|
152
162
|
* Gets the balance of the wallet.
|
|
153
163
|
*
|
|
@@ -43,9 +43,10 @@ class LegacyCdpWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
|
|
|
43
43
|
__classPrivateFieldSet(this, _LegacyCdpWalletProvider_cdpWallet, config.wallet, "f");
|
|
44
44
|
__classPrivateFieldSet(this, _LegacyCdpWalletProvider_address, config.address, "f");
|
|
45
45
|
__classPrivateFieldSet(this, _LegacyCdpWalletProvider_network, config.network, "f");
|
|
46
|
+
const rpcUrl = config.rpcUrl || process.env.RPC_URL;
|
|
46
47
|
__classPrivateFieldSet(this, _LegacyCdpWalletProvider_publicClient, (0, viem_1.createPublicClient)({
|
|
47
48
|
chain: network_1.NETWORK_ID_TO_VIEM_CHAIN[config.network.networkId],
|
|
48
|
-
transport: (0, viem_1.http)(),
|
|
49
|
+
transport: rpcUrl ? (0, viem_1.http)(rpcUrl) : (0, viem_1.http)(),
|
|
49
50
|
}), "f");
|
|
50
51
|
__classPrivateFieldSet(this, _LegacyCdpWalletProvider_gasLimitMultiplier, Math.max(config.gas?.gasLimitMultiplier ?? 1.2, 1), "f");
|
|
51
52
|
__classPrivateFieldSet(this, _LegacyCdpWalletProvider_feePerGasMultiplier, Math.max(config.gas?.feePerGasMultiplier ?? 1, 1), "f");
|
|
@@ -268,6 +269,14 @@ class LegacyCdpWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
|
|
|
268
269
|
getName() {
|
|
269
270
|
return "legacy_cdp_wallet_provider";
|
|
270
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
274
|
+
*
|
|
275
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
276
|
+
*/
|
|
277
|
+
getPublicClient() {
|
|
278
|
+
return __classPrivateFieldGet(this, _LegacyCdpWalletProvider_publicClient, "f");
|
|
279
|
+
}
|
|
271
280
|
/**
|
|
272
281
|
* Gets the balance of the wallet.
|
|
273
282
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Abi, ContractFunctionArgs, ContractFunctionName, Hex, ReadContractParameters, ReadContractReturnType, TransactionReceipt, TransactionRequest } from "viem";
|
|
1
|
+
import { Abi, ContractFunctionArgs, ContractFunctionName, Hex, PublicClient, ReadContractParameters, ReadContractReturnType, TransactionReceipt, TransactionRequest } from "viem";
|
|
2
2
|
import { Network } from "../network";
|
|
3
3
|
import { PrivyWalletConfig, PrivyWalletExport } from "./privyShared";
|
|
4
4
|
import { WalletProvider } from "./walletProvider";
|
|
@@ -14,6 +14,8 @@ export interface PrivyEvmDelegatedEmbeddedWalletConfig extends PrivyWalletConfig
|
|
|
14
14
|
chainId?: string;
|
|
15
15
|
/** The wallet type to use */
|
|
16
16
|
walletType: "embedded";
|
|
17
|
+
/** Optional RPC URL for Viem public client */
|
|
18
|
+
rpcUrl?: string;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* A wallet provider that uses Privy's embedded wallets with delegation.
|
|
@@ -64,6 +66,12 @@ export declare class PrivyEvmDelegatedEmbeddedWalletProvider extends WalletProvi
|
|
|
64
66
|
* @returns The name of the wallet provider.
|
|
65
67
|
*/
|
|
66
68
|
getName(): string;
|
|
69
|
+
/**
|
|
70
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
71
|
+
*
|
|
72
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
73
|
+
*/
|
|
74
|
+
getPublicClient(): PublicClient;
|
|
67
75
|
/**
|
|
68
76
|
* Gets the balance of the wallet.
|
|
69
77
|
*
|
|
@@ -59,9 +59,10 @@ class PrivyEvmDelegatedEmbeddedWalletProvider extends walletProvider_1.WalletPro
|
|
|
59
59
|
if (!chain) {
|
|
60
60
|
throw new Error(`Chain with ID ${chainId} not found`);
|
|
61
61
|
}
|
|
62
|
+
const rpcUrl = config.rpcUrl || process.env.RPC_URL;
|
|
62
63
|
__classPrivateFieldSet(this, _PrivyEvmDelegatedEmbeddedWalletProvider_publicClient, (0, viem_1.createPublicClient)({
|
|
63
64
|
chain,
|
|
64
|
-
transport: (0, viem_1.http)(),
|
|
65
|
+
transport: rpcUrl ? (0, viem_1.http)(rpcUrl) : (0, viem_1.http)(),
|
|
65
66
|
}), "f");
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
@@ -142,6 +143,14 @@ class PrivyEvmDelegatedEmbeddedWalletProvider extends walletProvider_1.WalletPro
|
|
|
142
143
|
getName() {
|
|
143
144
|
return "privy_evm_embedded_wallet_provider";
|
|
144
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
148
|
+
*
|
|
149
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
150
|
+
*/
|
|
151
|
+
getPublicClient() {
|
|
152
|
+
return __classPrivateFieldGet(this, _PrivyEvmDelegatedEmbeddedWalletProvider_publicClient, "f");
|
|
153
|
+
}
|
|
145
154
|
/**
|
|
146
155
|
* Gets the balance of the wallet.
|
|
147
156
|
*
|
|
@@ -8,6 +8,8 @@ import { PrivyWalletConfig, PrivyWalletExport } from "./privyShared";
|
|
|
8
8
|
export interface PrivyEvmWalletConfig extends PrivyWalletConfig {
|
|
9
9
|
/** Optional chain ID to connect to */
|
|
10
10
|
chainId?: string;
|
|
11
|
+
/** Optional RPC URL override for Viem wallet/public clients */
|
|
12
|
+
rpcUrl?: string;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* A wallet provider that uses Privy's server wallet API.
|
|
@@ -107,10 +107,11 @@ class PrivyEvmWalletProvider extends viemWalletProvider_1.ViemWalletProvider {
|
|
|
107
107
|
if (!chain) {
|
|
108
108
|
throw new Error(`Chain with ID ${chainId} not found`);
|
|
109
109
|
}
|
|
110
|
+
const rpcUrl = config.rpcUrl || process.env.RPC_URL;
|
|
110
111
|
const walletClient = (0, viem_2.createWalletClient)({
|
|
111
112
|
account,
|
|
112
113
|
chain,
|
|
113
|
-
transport: (0, viem_2.http)(),
|
|
114
|
+
transport: rpcUrl ? (0, viem_2.http)(rpcUrl) : (0, viem_2.http)(),
|
|
114
115
|
});
|
|
115
116
|
return new PrivyEvmWalletProvider(walletClient, { ...config, walletId });
|
|
116
117
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WalletClient as ViemWalletClient, TransactionRequest, ReadContractParameters, ReadContractReturnType, Abi, ContractFunctionName, ContractFunctionArgs } from "viem";
|
|
1
|
+
import { WalletClient as ViemWalletClient, TransactionRequest, PublicClient as ViemPublicClient, ReadContractParameters, ReadContractReturnType, Abi, ContractFunctionName, ContractFunctionArgs } from "viem";
|
|
2
2
|
import { EvmWalletProvider } from "./evmWalletProvider";
|
|
3
3
|
import { Network } from "../network";
|
|
4
4
|
/**
|
|
@@ -72,6 +72,12 @@ export declare class ViemWalletProvider extends EvmWalletProvider {
|
|
|
72
72
|
* @returns The name of the wallet provider.
|
|
73
73
|
*/
|
|
74
74
|
getName(): string;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
77
|
+
*
|
|
78
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
79
|
+
*/
|
|
80
|
+
getPublicClient(): ViemPublicClient;
|
|
75
81
|
/**
|
|
76
82
|
* Gets the balance of the wallet.
|
|
77
83
|
*
|
|
@@ -152,6 +152,14 @@ class ViemWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
|
|
|
152
152
|
getName() {
|
|
153
153
|
return "viem_wallet_provider";
|
|
154
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
157
|
+
*
|
|
158
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
159
|
+
*/
|
|
160
|
+
getPublicClient() {
|
|
161
|
+
return __classPrivateFieldGet(this, _ViemWalletProvider_publicClient, "f");
|
|
162
|
+
}
|
|
155
163
|
/**
|
|
156
164
|
* Gets the balance of the wallet.
|
|
157
165
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KernelSmartAccountImplementation } from "@zerodev/sdk";
|
|
2
2
|
import { createIntentClient, type GetCABParameters, type GetCABResult } from "@zerodev/intent";
|
|
3
|
-
import { Abi, Address, ContractFunctionArgs, ContractFunctionName, ReadContractParameters, ReadContractReturnType, TransactionRequest, Hex, Hash, Account } from "viem";
|
|
3
|
+
import { Abi, Address, ContractFunctionArgs, ContractFunctionName, PublicClient, ReadContractParameters, ReadContractReturnType, TransactionRequest, Hex, Hash, Account } from "viem";
|
|
4
4
|
import { SmartAccount } from "viem/account-abstraction";
|
|
5
5
|
import { EvmWalletProvider } from "./evmWalletProvider";
|
|
6
6
|
import { type Network } from "../network";
|
|
@@ -30,6 +30,8 @@ export interface ZeroDevWalletProviderConfig {
|
|
|
30
30
|
* If not provided, it will be computed from the signer.
|
|
31
31
|
*/
|
|
32
32
|
address?: Address;
|
|
33
|
+
/** Optional RPC URL override for Viem public client */
|
|
34
|
+
rpcUrl?: string;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* A wallet provider that uses ZeroDev's account abstraction.
|
|
@@ -111,6 +113,12 @@ export declare class ZeroDevWalletProvider extends EvmWalletProvider {
|
|
|
111
113
|
* @returns The name of the wallet provider.
|
|
112
114
|
*/
|
|
113
115
|
getName(): string;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
118
|
+
*
|
|
119
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
120
|
+
*/
|
|
121
|
+
getPublicClient(): PublicClient;
|
|
114
122
|
/**
|
|
115
123
|
* Gets the balance of the wallet.
|
|
116
124
|
*
|
|
@@ -51,9 +51,10 @@ class ZeroDevWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
|
|
|
51
51
|
__classPrivateFieldSet(this, _ZeroDevWalletProvider_kernelAccount, kernelAccount, "f");
|
|
52
52
|
__classPrivateFieldSet(this, _ZeroDevWalletProvider_intentClient, intentClient, "f");
|
|
53
53
|
// Create public client
|
|
54
|
+
const rpcUrl = config.rpcUrl || process.env.RPC_URL;
|
|
54
55
|
__classPrivateFieldSet(this, _ZeroDevWalletProvider_publicClient, (0, viem_1.createPublicClient)({
|
|
55
56
|
chain: network_1.NETWORK_ID_TO_VIEM_CHAIN[__classPrivateFieldGet(this, _ZeroDevWalletProvider_network, "f").networkId],
|
|
56
|
-
transport: (0, viem_1.http)(),
|
|
57
|
+
transport: rpcUrl ? (0, viem_1.http)(rpcUrl) : (0, viem_1.http)(),
|
|
57
58
|
}), "f");
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
@@ -228,6 +229,14 @@ class ZeroDevWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
|
|
|
228
229
|
getName() {
|
|
229
230
|
return "zerodev_wallet_provider";
|
|
230
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Gets the Viem PublicClient used for read-only operations.
|
|
234
|
+
*
|
|
235
|
+
* @returns The Viem PublicClient instance used for read-only operations.
|
|
236
|
+
*/
|
|
237
|
+
getPublicClient() {
|
|
238
|
+
return __classPrivateFieldGet(this, _ZeroDevWalletProvider_publicClient, "f");
|
|
239
|
+
}
|
|
231
240
|
/**
|
|
232
241
|
* Gets the balance of the wallet.
|
|
233
242
|
*
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@coinbase/agentkit",
|
|
3
3
|
"description": "Coinbase AgentKit core primitives",
|
|
4
4
|
"repository": "https://github.com/coinbase/agentkit",
|
|
5
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"version": "0.0.0-nightly-20250815210416",
|
|
6
6
|
"author": "Coinbase Inc.",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@across-protocol/app-sdk": "^0.2.0",
|
|
26
26
|
"@alloralabs/allora-sdk": "^0.1.0",
|
|
27
|
-
"@coinbase/cdp-sdk": "^1.
|
|
27
|
+
"@coinbase/cdp-sdk": "^1.34.0",
|
|
28
28
|
"@coinbase/coinbase-sdk": "^0.20.0",
|
|
29
29
|
"@jup-ag/api": "^6.0.39",
|
|
30
30
|
"@privy-io/public-api": "2.18.5",
|