@exagent/sdk 0.1.13 → 0.1.15

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/dist/index.d.mts CHANGED
@@ -1795,13 +1795,13 @@ declare class ExagentStaking {
1795
1795
  }
1796
1796
 
1797
1797
  /** SDK version — sent to API for version gating */
1798
- declare const SDK_VERSION = "0.1.13";
1798
+ declare const SDK_VERSION = "0.1.14";
1799
1799
  /**
1800
1800
  * Default RPC URL for Base mainnet.
1801
- * Uses a higher-limit public endpoint to avoid rate-limiting.
1802
- * Users should set BASE_RPC_URL env var for production use.
1801
+ * Coinbase's official Base RPC reliable for reads and transactions.
1802
+ * Users should set BASE_RPC_URL env var for higher rate limits.
1803
1803
  */
1804
- declare const DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
1804
+ declare const DEFAULT_RPC_URL = "https://mainnet.base.org";
1805
1805
  /**
1806
1806
  * Get RPC URL from environment or use default.
1807
1807
  */
package/dist/index.d.ts CHANGED
@@ -1795,13 +1795,13 @@ declare class ExagentStaking {
1795
1795
  }
1796
1796
 
1797
1797
  /** SDK version — sent to API for version gating */
1798
- declare const SDK_VERSION = "0.1.13";
1798
+ declare const SDK_VERSION = "0.1.14";
1799
1799
  /**
1800
1800
  * Default RPC URL for Base mainnet.
1801
- * Uses a higher-limit public endpoint to avoid rate-limiting.
1802
- * Users should set BASE_RPC_URL env var for production use.
1801
+ * Coinbase's official Base RPC reliable for reads and transactions.
1802
+ * Users should set BASE_RPC_URL env var for higher rate limits.
1803
1803
  */
1804
- declare const DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
1804
+ declare const DEFAULT_RPC_URL = "https://mainnet.base.org";
1805
1805
  /**
1806
1806
  * Get RPC URL from environment or use default.
1807
1807
  */
package/dist/index.js CHANGED
@@ -2016,8 +2016,8 @@ var ExagentStaking = class {
2016
2016
 
2017
2017
  // src/constants.ts
2018
2018
  var import_chains = require("viem/chains");
2019
- var SDK_VERSION = "0.1.13";
2020
- var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
2019
+ var SDK_VERSION = "0.1.14";
2020
+ var DEFAULT_RPC_URL = "https://mainnet.base.org";
2021
2021
  function getRpcUrl() {
2022
2022
  if (typeof process !== "undefined" && process.env) {
2023
2023
  return process.env.BASE_RPC_URL || process.env.EXAGENT_RPC_URL || DEFAULT_RPC_URL;
@@ -2112,9 +2112,10 @@ var ExagentClient = class {
2112
2112
  validateContractAddresses(this.network);
2113
2113
  const chain = CHAIN_CONFIG[this.network];
2114
2114
  const rpcUrl = config.rpcUrl || getRpcUrl();
2115
+ const transport = (0, import_viem2.http)(rpcUrl, { timeout: 6e4 });
2115
2116
  this.publicClient = (0, import_viem2.createPublicClient)({
2116
2117
  chain,
2117
- transport: (0, import_viem2.http)(rpcUrl)
2118
+ transport
2118
2119
  });
2119
2120
  if (config.walletClient) {
2120
2121
  this.walletClient = config.walletClient;
@@ -2124,7 +2125,7 @@ var ExagentClient = class {
2124
2125
  this.walletClient = (0, import_viem2.createWalletClient)({
2125
2126
  account: this.account,
2126
2127
  chain,
2127
- transport: (0, import_viem2.http)(rpcUrl)
2128
+ transport
2128
2129
  });
2129
2130
  } else {
2130
2131
  throw new Error("Either privateKey or walletClient must be provided");
@@ -2279,6 +2280,10 @@ var ExagentClient = class {
2279
2280
  const key = `${approval.token.toLowerCase()}:${approval.spender.toLowerCase()}`;
2280
2281
  if (seen.has(key)) continue;
2281
2282
  seen.add(key);
2283
+ if (!approval.amount) {
2284
+ console.warn(`Skipping approval with missing amount for token ${approval.token} \u2014 0x did not return expected allowance`);
2285
+ continue;
2286
+ }
2282
2287
  const amount = BigInt(approval.amount);
2283
2288
  const existing = await this.getAllowance(
2284
2289
  approval.token,
package/dist/index.mjs CHANGED
@@ -1980,8 +1980,8 @@ var ExagentStaking = class {
1980
1980
 
1981
1981
  // src/constants.ts
1982
1982
  import { base } from "viem/chains";
1983
- var SDK_VERSION = "0.1.13";
1984
- var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
1983
+ var SDK_VERSION = "0.1.14";
1984
+ var DEFAULT_RPC_URL = "https://mainnet.base.org";
1985
1985
  function getRpcUrl() {
1986
1986
  if (typeof process !== "undefined" && process.env) {
1987
1987
  return process.env.BASE_RPC_URL || process.env.EXAGENT_RPC_URL || DEFAULT_RPC_URL;
@@ -2076,9 +2076,10 @@ var ExagentClient = class {
2076
2076
  validateContractAddresses(this.network);
2077
2077
  const chain = CHAIN_CONFIG[this.network];
2078
2078
  const rpcUrl = config.rpcUrl || getRpcUrl();
2079
+ const transport = http(rpcUrl, { timeout: 6e4 });
2079
2080
  this.publicClient = createPublicClient({
2080
2081
  chain,
2081
- transport: http(rpcUrl)
2082
+ transport
2082
2083
  });
2083
2084
  if (config.walletClient) {
2084
2085
  this.walletClient = config.walletClient;
@@ -2088,7 +2089,7 @@ var ExagentClient = class {
2088
2089
  this.walletClient = createWalletClient({
2089
2090
  account: this.account,
2090
2091
  chain,
2091
- transport: http(rpcUrl)
2092
+ transport
2092
2093
  });
2093
2094
  } else {
2094
2095
  throw new Error("Either privateKey or walletClient must be provided");
@@ -2243,6 +2244,10 @@ var ExagentClient = class {
2243
2244
  const key = `${approval.token.toLowerCase()}:${approval.spender.toLowerCase()}`;
2244
2245
  if (seen.has(key)) continue;
2245
2246
  seen.add(key);
2247
+ if (!approval.amount) {
2248
+ console.warn(`Skipping approval with missing amount for token ${approval.token} \u2014 0x did not return expected allowance`);
2249
+ continue;
2250
+ }
2246
2251
  const amount = BigInt(approval.amount);
2247
2252
  const existing = await this.getAllowance(
2248
2253
  approval.token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exagent/sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "TypeScript SDK for Exagent",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",