@coinbase/agentkit 0.0.0-nightly-20250725210423 → 0.0.0-nightly-20250806210443

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.
@@ -111,6 +111,8 @@ class CdpApiActionProvider extends actionProvider_1.ActionProvider {
111
111
  amount: args.amount,
112
112
  slippageBps: 100, // 1% slippage tolerance
113
113
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
+ paymasterUrl: walletProvider.getPaymasterUrl?.(),
115
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
116
  });
115
117
  return `Successfully swapped ${args.amount} ${args.fromAssetId.toUpperCase()} to ${args.toAssetId.toUpperCase()}. Transaction hash: ${swapResult.transactionHash}`;
116
118
  }
@@ -40,6 +40,10 @@ export interface CdpSmartWalletProviderConfig extends CdpWalletProviderConfig {
40
40
  * The name of the smart wallet.
41
41
  */
42
42
  smartAccountName?: string;
43
+ /**
44
+ * The paymaster URL for gasless transactions.
45
+ */
46
+ paymasterUrl?: string;
43
47
  }
44
48
  /**
45
49
  * A wallet provider that can be used to interact with the CDP.
@@ -84,6 +84,12 @@ export declare class CdpSmartWalletProvider extends EvmWalletProvider implements
84
84
  * @returns The CDP client.
85
85
  */
86
86
  getClient(): CdpClient;
87
+ /**
88
+ * Gets the paymaster URL for gasless transactions.
89
+ *
90
+ * @returns The paymaster URL if configured, undefined otherwise.
91
+ */
92
+ getPaymasterUrl(): string | undefined;
87
93
  /**
88
94
  * Gets the balance of the smart wallet.
89
95
  *
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var _CdpSmartWalletProvider_instances, _CdpSmartWalletProvider_publicClient, _CdpSmartWalletProvider_smartAccount, _CdpSmartWalletProvider_ownerAccount, _CdpSmartWalletProvider_cdp, _CdpSmartWalletProvider_network, _CdpSmartWalletProvider_getCdpSdkNetwork;
13
+ var _CdpSmartWalletProvider_instances, _CdpSmartWalletProvider_publicClient, _CdpSmartWalletProvider_smartAccount, _CdpSmartWalletProvider_ownerAccount, _CdpSmartWalletProvider_cdp, _CdpSmartWalletProvider_network, _CdpSmartWalletProvider_paymasterUrl, _CdpSmartWalletProvider_getCdpSdkNetwork;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CdpSmartWalletProvider = void 0;
16
16
  const cdp_sdk_1 = require("@coinbase/cdp-sdk");
@@ -34,11 +34,13 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
34
34
  _CdpSmartWalletProvider_ownerAccount.set(this, void 0);
35
35
  _CdpSmartWalletProvider_cdp.set(this, void 0);
36
36
  _CdpSmartWalletProvider_network.set(this, void 0);
37
+ _CdpSmartWalletProvider_paymasterUrl.set(this, void 0);
37
38
  __classPrivateFieldSet(this, _CdpSmartWalletProvider_smartAccount, config.smartAccount, "f");
38
39
  __classPrivateFieldSet(this, _CdpSmartWalletProvider_ownerAccount, config.ownerAccount, "f");
39
40
  __classPrivateFieldSet(this, _CdpSmartWalletProvider_cdp, config.cdp, "f");
40
41
  __classPrivateFieldSet(this, _CdpSmartWalletProvider_publicClient, config.publicClient, "f");
41
42
  __classPrivateFieldSet(this, _CdpSmartWalletProvider_network, config.network, "f");
43
+ __classPrivateFieldSet(this, _CdpSmartWalletProvider_paymasterUrl, config.paymasterUrl, "f");
42
44
  }
43
45
  /**
44
46
  * Configures a new CdpSmartWalletProvider with a smart wallet.
@@ -52,6 +54,7 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
52
54
  const apiKeySecret = config.apiKeySecret || process.env.CDP_API_KEY_SECRET;
53
55
  const walletSecret = config.walletSecret || process.env.CDP_WALLET_SECRET;
54
56
  const idempotencyKey = config.idempotencyKey || process.env.IDEMPOTENCY_KEY;
57
+ const paymasterUrl = config.paymasterUrl || process.env.PAYMASTER_URL;
55
58
  if (!apiKeyId || !apiKeySecret || !walletSecret) {
56
59
  throw new Error("Missing required environment variables. CDP_API_KEY_ID, CDP_API_KEY_SECRET, CDP_WALLET_SECRET are required.");
57
60
  }
@@ -100,6 +103,7 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
100
103
  smartAccount,
101
104
  ownerAccount,
102
105
  network,
106
+ paymasterUrl,
103
107
  });
104
108
  }
105
109
  /**
@@ -167,6 +171,7 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
167
171
  smartAccount: __classPrivateFieldGet(this, _CdpSmartWalletProvider_smartAccount, "f"),
168
172
  network: __classPrivateFieldGet(this, _CdpSmartWalletProvider_instances, "m", _CdpSmartWalletProvider_getCdpSdkNetwork).call(this),
169
173
  calls,
174
+ paymasterUrl: __classPrivateFieldGet(this, _CdpSmartWalletProvider_paymasterUrl, "f"),
170
175
  });
171
176
  return userOperation.userOpHash;
172
177
  }
@@ -202,6 +207,14 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
202
207
  getClient() {
203
208
  return __classPrivateFieldGet(this, _CdpSmartWalletProvider_cdp, "f");
204
209
  }
210
+ /**
211
+ * Gets the paymaster URL for gasless transactions.
212
+ *
213
+ * @returns The paymaster URL if configured, undefined otherwise.
214
+ */
215
+ getPaymasterUrl() {
216
+ return __classPrivateFieldGet(this, _CdpSmartWalletProvider_paymasterUrl, "f");
217
+ }
205
218
  /**
206
219
  * Gets the balance of the smart wallet.
207
220
  *
@@ -251,7 +264,7 @@ class CdpSmartWalletProvider extends evmWalletProvider_1.EvmWalletProvider {
251
264
  }
252
265
  }
253
266
  exports.CdpSmartWalletProvider = CdpSmartWalletProvider;
254
- _CdpSmartWalletProvider_publicClient = new WeakMap(), _CdpSmartWalletProvider_smartAccount = new WeakMap(), _CdpSmartWalletProvider_ownerAccount = new WeakMap(), _CdpSmartWalletProvider_cdp = new WeakMap(), _CdpSmartWalletProvider_network = new WeakMap(), _CdpSmartWalletProvider_instances = new WeakSet(), _CdpSmartWalletProvider_getCdpSdkNetwork = function _CdpSmartWalletProvider_getCdpSdkNetwork() {
267
+ _CdpSmartWalletProvider_publicClient = new WeakMap(), _CdpSmartWalletProvider_smartAccount = new WeakMap(), _CdpSmartWalletProvider_ownerAccount = new WeakMap(), _CdpSmartWalletProvider_cdp = new WeakMap(), _CdpSmartWalletProvider_network = new WeakMap(), _CdpSmartWalletProvider_paymasterUrl = new WeakMap(), _CdpSmartWalletProvider_instances = new WeakSet(), _CdpSmartWalletProvider_getCdpSdkNetwork = function _CdpSmartWalletProvider_getCdpSdkNetwork() {
255
268
  switch (__classPrivateFieldGet(this, _CdpSmartWalletProvider_network, "f").networkId) {
256
269
  case "base-sepolia":
257
270
  return "base-sepolia";
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-20250725210423",
5
+ "version": "0.0.0-nightly-20250806210443",
6
6
  "author": "Coinbase Inc.",
7
7
  "license": "Apache-2.0",
8
8
  "main": "dist/index.js",