@exagent/sdk 0.1.11 → 0.1.12
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -6
- package/dist/index.mjs +17 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1353,7 +1353,7 @@ declare class ExagentStaking {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
|
|
1355
1355
|
/** SDK version — sent to API for version gating */
|
|
1356
|
-
declare const SDK_VERSION = "0.1.
|
|
1356
|
+
declare const SDK_VERSION = "0.1.12";
|
|
1357
1357
|
/**
|
|
1358
1358
|
* Default RPC URL for Base mainnet.
|
|
1359
1359
|
* Uses a higher-limit public endpoint to avoid rate-limiting.
|
package/dist/index.d.ts
CHANGED
|
@@ -1353,7 +1353,7 @@ declare class ExagentStaking {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
|
|
1355
1355
|
/** SDK version — sent to API for version gating */
|
|
1356
|
-
declare const SDK_VERSION = "0.1.
|
|
1356
|
+
declare const SDK_VERSION = "0.1.12";
|
|
1357
1357
|
/**
|
|
1358
1358
|
* Default RPC URL for Base mainnet.
|
|
1359
1359
|
* Uses a higher-limit public endpoint to avoid rate-limiting.
|
package/dist/index.js
CHANGED
|
@@ -236,10 +236,10 @@ var EXAGENT_REGISTRY_ABI = [
|
|
|
236
236
|
// Config Epochs
|
|
237
237
|
{
|
|
238
238
|
type: "function",
|
|
239
|
-
name: "
|
|
239
|
+
name: "setConfig",
|
|
240
240
|
inputs: [
|
|
241
241
|
{ name: "agentId", type: "uint256" },
|
|
242
|
-
{ name: "
|
|
242
|
+
{ name: "configHash", type: "bytes32" }
|
|
243
243
|
],
|
|
244
244
|
outputs: [],
|
|
245
245
|
stateMutability: "nonpayable"
|
|
@@ -655,7 +655,7 @@ var ExagentRegistry = class {
|
|
|
655
655
|
chain: this.chain,
|
|
656
656
|
address: this.address,
|
|
657
657
|
abi: EXAGENT_REGISTRY_ABI,
|
|
658
|
-
functionName: "
|
|
658
|
+
functionName: "setConfig",
|
|
659
659
|
args: [agentId, configHash]
|
|
660
660
|
});
|
|
661
661
|
return hash;
|
|
@@ -2105,7 +2105,7 @@ var ExagentStaking = class {
|
|
|
2105
2105
|
|
|
2106
2106
|
// src/constants.ts
|
|
2107
2107
|
var import_chains = require("viem/chains");
|
|
2108
|
-
var SDK_VERSION = "0.1.
|
|
2108
|
+
var SDK_VERSION = "0.1.12";
|
|
2109
2109
|
var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
|
|
2110
2110
|
function getRpcUrl() {
|
|
2111
2111
|
if (typeof process !== "undefined" && process.env) {
|
|
@@ -2374,13 +2374,24 @@ var ExagentClient = class {
|
|
|
2374
2374
|
amount
|
|
2375
2375
|
);
|
|
2376
2376
|
}
|
|
2377
|
-
const
|
|
2377
|
+
const txParams = {
|
|
2378
2378
|
account: this.account,
|
|
2379
2379
|
chain: CHAIN_CONFIG[this.network],
|
|
2380
2380
|
to: routerTrade.transaction.to,
|
|
2381
2381
|
data: routerTrade.transaction.data,
|
|
2382
2382
|
value: BigInt(routerTrade.transaction.value)
|
|
2383
|
-
}
|
|
2383
|
+
};
|
|
2384
|
+
try {
|
|
2385
|
+
const estimated = await this.publicClient.estimateGas({
|
|
2386
|
+
account: this.account,
|
|
2387
|
+
to: routerTrade.transaction.to,
|
|
2388
|
+
data: routerTrade.transaction.data,
|
|
2389
|
+
value: BigInt(routerTrade.transaction.value)
|
|
2390
|
+
});
|
|
2391
|
+
txParams.gas = estimated * 150n / 100n;
|
|
2392
|
+
} catch {
|
|
2393
|
+
}
|
|
2394
|
+
const hash = await this.walletClient.sendTransaction(txParams);
|
|
2384
2395
|
return {
|
|
2385
2396
|
hash,
|
|
2386
2397
|
agentId,
|
package/dist/index.mjs
CHANGED
|
@@ -201,10 +201,10 @@ var EXAGENT_REGISTRY_ABI = [
|
|
|
201
201
|
// Config Epochs
|
|
202
202
|
{
|
|
203
203
|
type: "function",
|
|
204
|
-
name: "
|
|
204
|
+
name: "setConfig",
|
|
205
205
|
inputs: [
|
|
206
206
|
{ name: "agentId", type: "uint256" },
|
|
207
|
-
{ name: "
|
|
207
|
+
{ name: "configHash", type: "bytes32" }
|
|
208
208
|
],
|
|
209
209
|
outputs: [],
|
|
210
210
|
stateMutability: "nonpayable"
|
|
@@ -620,7 +620,7 @@ var ExagentRegistry = class {
|
|
|
620
620
|
chain: this.chain,
|
|
621
621
|
address: this.address,
|
|
622
622
|
abi: EXAGENT_REGISTRY_ABI,
|
|
623
|
-
functionName: "
|
|
623
|
+
functionName: "setConfig",
|
|
624
624
|
args: [agentId, configHash]
|
|
625
625
|
});
|
|
626
626
|
return hash;
|
|
@@ -2070,7 +2070,7 @@ var ExagentStaking = class {
|
|
|
2070
2070
|
|
|
2071
2071
|
// src/constants.ts
|
|
2072
2072
|
import { base } from "viem/chains";
|
|
2073
|
-
var SDK_VERSION = "0.1.
|
|
2073
|
+
var SDK_VERSION = "0.1.12";
|
|
2074
2074
|
var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
|
|
2075
2075
|
function getRpcUrl() {
|
|
2076
2076
|
if (typeof process !== "undefined" && process.env) {
|
|
@@ -2339,13 +2339,24 @@ var ExagentClient = class {
|
|
|
2339
2339
|
amount
|
|
2340
2340
|
);
|
|
2341
2341
|
}
|
|
2342
|
-
const
|
|
2342
|
+
const txParams = {
|
|
2343
2343
|
account: this.account,
|
|
2344
2344
|
chain: CHAIN_CONFIG[this.network],
|
|
2345
2345
|
to: routerTrade.transaction.to,
|
|
2346
2346
|
data: routerTrade.transaction.data,
|
|
2347
2347
|
value: BigInt(routerTrade.transaction.value)
|
|
2348
|
-
}
|
|
2348
|
+
};
|
|
2349
|
+
try {
|
|
2350
|
+
const estimated = await this.publicClient.estimateGas({
|
|
2351
|
+
account: this.account,
|
|
2352
|
+
to: routerTrade.transaction.to,
|
|
2353
|
+
data: routerTrade.transaction.data,
|
|
2354
|
+
value: BigInt(routerTrade.transaction.value)
|
|
2355
|
+
});
|
|
2356
|
+
txParams.gas = estimated * 150n / 100n;
|
|
2357
|
+
} catch {
|
|
2358
|
+
}
|
|
2359
|
+
const hash = await this.walletClient.sendTransaction(txParams);
|
|
2349
2360
|
return {
|
|
2350
2361
|
hash,
|
|
2351
2362
|
agentId,
|