@exagent/sdk 0.1.4 → 0.1.6
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 +16 -347
- package/dist/index.d.ts +16 -347
- package/dist/index.js +23 -46
- package/dist/index.mjs +22 -46
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14,15 +14,15 @@ import * as viem_chains from 'viem/chains';
|
|
|
14
14
|
* // Base mainnet agent #42
|
|
15
15
|
* "eip155:8453:0xABC...DEF:42"
|
|
16
16
|
*
|
|
17
|
-
* // Base
|
|
18
|
-
* "eip155:
|
|
17
|
+
* // Another Base mainnet agent
|
|
18
|
+
* "eip155:8453:0x123...789:7"
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
type GlobalAgentId = `eip155:${number}:${Address}:${number}`;
|
|
22
22
|
/**
|
|
23
23
|
* Build an ERC-8004 compliant global agent identifier
|
|
24
24
|
*
|
|
25
|
-
* @param chainId - EVM chain ID (8453 for Base
|
|
25
|
+
* @param chainId - EVM chain ID (8453 for Base)
|
|
26
26
|
* @param registryAddress - ExagentRegistry contract address
|
|
27
27
|
* @param agentId - On-chain agent ID (from ExagentRegistry)
|
|
28
28
|
* @returns Global agent identifier string
|
|
@@ -1337,7 +1337,17 @@ declare class ExagentStaking {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
1339
|
/** SDK version — sent to API for version gating */
|
|
1340
|
-
declare const SDK_VERSION = "0.1.
|
|
1340
|
+
declare const SDK_VERSION = "0.1.6";
|
|
1341
|
+
/**
|
|
1342
|
+
* Default RPC URL for Base mainnet.
|
|
1343
|
+
* Uses a higher-limit public endpoint to avoid rate-limiting.
|
|
1344
|
+
* Users should set BASE_RPC_URL env var for production use.
|
|
1345
|
+
*/
|
|
1346
|
+
declare const DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
|
|
1347
|
+
/**
|
|
1348
|
+
* Get RPC URL from environment or use default.
|
|
1349
|
+
*/
|
|
1350
|
+
declare function getRpcUrl(): string;
|
|
1341
1351
|
declare const CHAIN_CONFIG: {
|
|
1342
1352
|
readonly mainnet: {
|
|
1343
1353
|
blockExplorers: {
|
|
@@ -1656,332 +1666,8 @@ declare const CHAIN_CONFIG: {
|
|
|
1656
1666
|
};
|
|
1657
1667
|
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1658
1668
|
};
|
|
1659
|
-
readonly testnet: {
|
|
1660
|
-
blockExplorers: {
|
|
1661
|
-
readonly default: {
|
|
1662
|
-
readonly name: "Basescan";
|
|
1663
|
-
readonly url: "https://sepolia.basescan.org";
|
|
1664
|
-
readonly apiUrl: "https://api-sepolia.basescan.org/api";
|
|
1665
|
-
};
|
|
1666
|
-
};
|
|
1667
|
-
blockTime: 2000;
|
|
1668
|
-
contracts: {
|
|
1669
|
-
readonly disputeGameFactory: {
|
|
1670
|
-
readonly 11155111: {
|
|
1671
|
-
readonly address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1";
|
|
1672
|
-
};
|
|
1673
|
-
};
|
|
1674
|
-
readonly l2OutputOracle: {
|
|
1675
|
-
readonly 11155111: {
|
|
1676
|
-
readonly address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254";
|
|
1677
|
-
};
|
|
1678
|
-
};
|
|
1679
|
-
readonly portal: {
|
|
1680
|
-
readonly 11155111: {
|
|
1681
|
-
readonly address: "0x49f53e41452c74589e85ca1677426ba426459e85";
|
|
1682
|
-
readonly blockCreated: 4446677;
|
|
1683
|
-
};
|
|
1684
|
-
};
|
|
1685
|
-
readonly l1StandardBridge: {
|
|
1686
|
-
readonly 11155111: {
|
|
1687
|
-
readonly address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120";
|
|
1688
|
-
readonly blockCreated: 4446677;
|
|
1689
|
-
};
|
|
1690
|
-
};
|
|
1691
|
-
readonly multicall3: {
|
|
1692
|
-
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1693
|
-
readonly blockCreated: 1059647;
|
|
1694
|
-
};
|
|
1695
|
-
readonly gasPriceOracle: {
|
|
1696
|
-
readonly address: "0x420000000000000000000000000000000000000F";
|
|
1697
|
-
};
|
|
1698
|
-
readonly l1Block: {
|
|
1699
|
-
readonly address: "0x4200000000000000000000000000000000000015";
|
|
1700
|
-
};
|
|
1701
|
-
readonly l2CrossDomainMessenger: {
|
|
1702
|
-
readonly address: "0x4200000000000000000000000000000000000007";
|
|
1703
|
-
};
|
|
1704
|
-
readonly l2Erc721Bridge: {
|
|
1705
|
-
readonly address: "0x4200000000000000000000000000000000000014";
|
|
1706
|
-
};
|
|
1707
|
-
readonly l2StandardBridge: {
|
|
1708
|
-
readonly address: "0x4200000000000000000000000000000000000010";
|
|
1709
|
-
};
|
|
1710
|
-
readonly l2ToL1MessagePasser: {
|
|
1711
|
-
readonly address: "0x4200000000000000000000000000000000000016";
|
|
1712
|
-
};
|
|
1713
|
-
};
|
|
1714
|
-
ensTlds?: readonly string[] | undefined;
|
|
1715
|
-
id: 84532;
|
|
1716
|
-
name: "Base Sepolia";
|
|
1717
|
-
nativeCurrency: {
|
|
1718
|
-
readonly name: "Sepolia Ether";
|
|
1719
|
-
readonly symbol: "ETH";
|
|
1720
|
-
readonly decimals: 18;
|
|
1721
|
-
};
|
|
1722
|
-
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1723
|
-
rpcUrls: {
|
|
1724
|
-
readonly default: {
|
|
1725
|
-
readonly http: readonly ["https://sepolia.base.org"];
|
|
1726
|
-
};
|
|
1727
|
-
};
|
|
1728
|
-
sourceId: 11155111;
|
|
1729
|
-
testnet: true;
|
|
1730
|
-
custom?: Record<string, unknown> | undefined;
|
|
1731
|
-
extendSchema?: Record<string, unknown> | undefined;
|
|
1732
|
-
fees?: viem.ChainFees<undefined> | undefined;
|
|
1733
|
-
formatters: {
|
|
1734
|
-
readonly block: {
|
|
1735
|
-
exclude: [] | undefined;
|
|
1736
|
-
format: (args: viem_chains.OpStackRpcBlock, action
|
|
1737
|
-
/**
|
|
1738
|
-
* Validate that contract addresses are set for the given network.
|
|
1739
|
-
* Throws if mainnet addresses are all zero (not yet deployed).
|
|
1740
|
-
*/
|
|
1741
|
-
/** Phase 1 contracts — must be deployed on mainnet */
|
|
1742
|
-
?: string | undefined) => {
|
|
1743
|
-
baseFeePerGas: bigint | null;
|
|
1744
|
-
blobGasUsed: bigint;
|
|
1745
|
-
difficulty: bigint;
|
|
1746
|
-
excessBlobGas: bigint;
|
|
1747
|
-
extraData: viem.Hex;
|
|
1748
|
-
gasLimit: bigint;
|
|
1749
|
-
gasUsed: bigint;
|
|
1750
|
-
hash: `0x${string}` | null;
|
|
1751
|
-
logsBloom: `0x${string}` | null;
|
|
1752
|
-
miner: `0x${string}`;
|
|
1753
|
-
mixHash: viem.Hash;
|
|
1754
|
-
nonce: `0x${string}` | null;
|
|
1755
|
-
number: bigint | null;
|
|
1756
|
-
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
1757
|
-
parentHash: viem.Hash;
|
|
1758
|
-
receiptsRoot: viem.Hex;
|
|
1759
|
-
sealFields: viem.Hex[];
|
|
1760
|
-
sha3Uncles: viem.Hash;
|
|
1761
|
-
size: bigint;
|
|
1762
|
-
stateRoot: viem.Hash;
|
|
1763
|
-
timestamp: bigint;
|
|
1764
|
-
totalDifficulty: bigint | null;
|
|
1765
|
-
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
1766
|
-
transactionsRoot: viem.Hash;
|
|
1767
|
-
uncles: viem.Hash[];
|
|
1768
|
-
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
1769
|
-
withdrawalsRoot?: `0x${string}` | undefined;
|
|
1770
|
-
} & {};
|
|
1771
|
-
type: "block";
|
|
1772
|
-
};
|
|
1773
|
-
readonly transaction: {
|
|
1774
|
-
exclude: [] | undefined;
|
|
1775
|
-
format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
1776
|
-
blockHash: `0x${string}` | null;
|
|
1777
|
-
blockNumber: bigint | null;
|
|
1778
|
-
from: `0x${string}`;
|
|
1779
|
-
gas: bigint;
|
|
1780
|
-
hash: viem.Hash;
|
|
1781
|
-
input: viem.Hex;
|
|
1782
|
-
nonce: number;
|
|
1783
|
-
r: viem.Hex;
|
|
1784
|
-
s: viem.Hex;
|
|
1785
|
-
to: `0x${string}` | null;
|
|
1786
|
-
transactionIndex: number | null;
|
|
1787
|
-
typeHex: viem.Hex | null;
|
|
1788
|
-
v: bigint;
|
|
1789
|
-
value: bigint;
|
|
1790
|
-
yParity: number;
|
|
1791
|
-
gasPrice?: undefined | undefined;
|
|
1792
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1793
|
-
maxFeePerGas: bigint;
|
|
1794
|
-
maxPriorityFeePerGas: bigint;
|
|
1795
|
-
isSystemTx?: boolean;
|
|
1796
|
-
mint?: bigint | undefined | undefined;
|
|
1797
|
-
sourceHash: viem.Hex;
|
|
1798
|
-
type: "deposit";
|
|
1799
|
-
} | {
|
|
1800
|
-
r: viem.Hex;
|
|
1801
|
-
s: viem.Hex;
|
|
1802
|
-
v: bigint;
|
|
1803
|
-
to: `0x${string}` | null;
|
|
1804
|
-
from: `0x${string}`;
|
|
1805
|
-
gas: bigint;
|
|
1806
|
-
nonce: number;
|
|
1807
|
-
value: bigint;
|
|
1808
|
-
blockHash: `0x${string}` | null;
|
|
1809
|
-
blockNumber: bigint | null;
|
|
1810
|
-
hash: viem.Hash;
|
|
1811
|
-
input: viem.Hex;
|
|
1812
|
-
transactionIndex: number | null;
|
|
1813
|
-
typeHex: viem.Hex | null;
|
|
1814
|
-
accessList?: undefined | undefined;
|
|
1815
|
-
authorizationList?: undefined | undefined;
|
|
1816
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1817
|
-
chainId?: number | undefined;
|
|
1818
|
-
yParity?: undefined | undefined;
|
|
1819
|
-
type: "legacy";
|
|
1820
|
-
gasPrice: bigint;
|
|
1821
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1822
|
-
maxFeePerGas?: undefined | undefined;
|
|
1823
|
-
maxPriorityFeePerGas?: undefined | undefined;
|
|
1824
|
-
isSystemTx?: undefined | undefined;
|
|
1825
|
-
mint?: undefined | undefined;
|
|
1826
|
-
sourceHash?: undefined | undefined;
|
|
1827
|
-
} | {
|
|
1828
|
-
blockHash: `0x${string}` | null;
|
|
1829
|
-
blockNumber: bigint | null;
|
|
1830
|
-
from: `0x${string}`;
|
|
1831
|
-
gas: bigint;
|
|
1832
|
-
hash: viem.Hash;
|
|
1833
|
-
input: viem.Hex;
|
|
1834
|
-
nonce: number;
|
|
1835
|
-
r: viem.Hex;
|
|
1836
|
-
s: viem.Hex;
|
|
1837
|
-
to: `0x${string}` | null;
|
|
1838
|
-
transactionIndex: number | null;
|
|
1839
|
-
typeHex: viem.Hex | null;
|
|
1840
|
-
v: bigint;
|
|
1841
|
-
value: bigint;
|
|
1842
|
-
yParity: number;
|
|
1843
|
-
accessList: viem.AccessList;
|
|
1844
|
-
authorizationList?: undefined | undefined;
|
|
1845
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1846
|
-
chainId: number;
|
|
1847
|
-
type: "eip2930";
|
|
1848
|
-
gasPrice: bigint;
|
|
1849
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1850
|
-
maxFeePerGas?: undefined | undefined;
|
|
1851
|
-
maxPriorityFeePerGas?: undefined | undefined;
|
|
1852
|
-
isSystemTx?: undefined | undefined;
|
|
1853
|
-
mint?: undefined | undefined;
|
|
1854
|
-
sourceHash?: undefined | undefined;
|
|
1855
|
-
} | {
|
|
1856
|
-
blockHash: `0x${string}` | null;
|
|
1857
|
-
blockNumber: bigint | null;
|
|
1858
|
-
from: `0x${string}`;
|
|
1859
|
-
gas: bigint;
|
|
1860
|
-
hash: viem.Hash;
|
|
1861
|
-
input: viem.Hex;
|
|
1862
|
-
nonce: number;
|
|
1863
|
-
r: viem.Hex;
|
|
1864
|
-
s: viem.Hex;
|
|
1865
|
-
to: `0x${string}` | null;
|
|
1866
|
-
transactionIndex: number | null;
|
|
1867
|
-
typeHex: viem.Hex | null;
|
|
1868
|
-
v: bigint;
|
|
1869
|
-
value: bigint;
|
|
1870
|
-
yParity: number;
|
|
1871
|
-
accessList: viem.AccessList;
|
|
1872
|
-
authorizationList?: undefined | undefined;
|
|
1873
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1874
|
-
chainId: number;
|
|
1875
|
-
type: "eip1559";
|
|
1876
|
-
gasPrice?: undefined | undefined;
|
|
1877
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1878
|
-
maxFeePerGas: bigint;
|
|
1879
|
-
maxPriorityFeePerGas: bigint;
|
|
1880
|
-
isSystemTx?: undefined | undefined;
|
|
1881
|
-
mint?: undefined | undefined;
|
|
1882
|
-
sourceHash?: undefined | undefined;
|
|
1883
|
-
} | {
|
|
1884
|
-
blockHash: `0x${string}` | null;
|
|
1885
|
-
blockNumber: bigint | null;
|
|
1886
|
-
from: `0x${string}`;
|
|
1887
|
-
gas: bigint;
|
|
1888
|
-
hash: viem.Hash;
|
|
1889
|
-
input: viem.Hex;
|
|
1890
|
-
nonce: number;
|
|
1891
|
-
r: viem.Hex;
|
|
1892
|
-
s: viem.Hex;
|
|
1893
|
-
to: `0x${string}` | null;
|
|
1894
|
-
transactionIndex: number | null;
|
|
1895
|
-
typeHex: viem.Hex | null;
|
|
1896
|
-
v: bigint;
|
|
1897
|
-
value: bigint;
|
|
1898
|
-
yParity: number;
|
|
1899
|
-
accessList: viem.AccessList;
|
|
1900
|
-
authorizationList?: undefined | undefined;
|
|
1901
|
-
blobVersionedHashes: readonly viem.Hex[];
|
|
1902
|
-
chainId: number;
|
|
1903
|
-
type: "eip4844";
|
|
1904
|
-
gasPrice?: undefined | undefined;
|
|
1905
|
-
maxFeePerBlobGas: bigint;
|
|
1906
|
-
maxFeePerGas: bigint;
|
|
1907
|
-
maxPriorityFeePerGas: bigint;
|
|
1908
|
-
isSystemTx?: undefined | undefined;
|
|
1909
|
-
mint?: undefined | undefined;
|
|
1910
|
-
sourceHash?: undefined | undefined;
|
|
1911
|
-
} | {
|
|
1912
|
-
blockHash: `0x${string}` | null;
|
|
1913
|
-
blockNumber: bigint | null;
|
|
1914
|
-
from: `0x${string}`;
|
|
1915
|
-
gas: bigint;
|
|
1916
|
-
hash: viem.Hash;
|
|
1917
|
-
input: viem.Hex;
|
|
1918
|
-
nonce: number;
|
|
1919
|
-
r: viem.Hex;
|
|
1920
|
-
s: viem.Hex;
|
|
1921
|
-
to: `0x${string}` | null;
|
|
1922
|
-
transactionIndex: number | null;
|
|
1923
|
-
typeHex: viem.Hex | null;
|
|
1924
|
-
v: bigint;
|
|
1925
|
-
value: bigint;
|
|
1926
|
-
yParity: number;
|
|
1927
|
-
accessList: viem.AccessList;
|
|
1928
|
-
authorizationList: viem.SignedAuthorizationList;
|
|
1929
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1930
|
-
chainId: number;
|
|
1931
|
-
type: "eip7702";
|
|
1932
|
-
gasPrice?: undefined | undefined;
|
|
1933
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1934
|
-
maxFeePerGas: bigint;
|
|
1935
|
-
maxPriorityFeePerGas: bigint;
|
|
1936
|
-
isSystemTx?: undefined | undefined;
|
|
1937
|
-
mint?: undefined | undefined;
|
|
1938
|
-
sourceHash?: undefined | undefined;
|
|
1939
|
-
}) & {};
|
|
1940
|
-
type: "transaction";
|
|
1941
|
-
};
|
|
1942
|
-
readonly transactionReceipt: {
|
|
1943
|
-
exclude: [] | undefined;
|
|
1944
|
-
format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
1945
|
-
blobGasPrice?: bigint | undefined;
|
|
1946
|
-
blobGasUsed?: bigint | undefined;
|
|
1947
|
-
blockHash: viem.Hash;
|
|
1948
|
-
blockNumber: bigint;
|
|
1949
|
-
contractAddress: `0x${string}` | null | undefined;
|
|
1950
|
-
cumulativeGasUsed: bigint;
|
|
1951
|
-
effectiveGasPrice: bigint;
|
|
1952
|
-
from: `0x${string}`;
|
|
1953
|
-
gasUsed: bigint;
|
|
1954
|
-
logs: viem.Log<bigint, number, false>[];
|
|
1955
|
-
logsBloom: viem.Hex;
|
|
1956
|
-
root?: `0x${string}` | undefined;
|
|
1957
|
-
status: "success" | "reverted";
|
|
1958
|
-
to: `0x${string}` | null;
|
|
1959
|
-
transactionHash: viem.Hash;
|
|
1960
|
-
transactionIndex: number;
|
|
1961
|
-
type: viem.TransactionType;
|
|
1962
|
-
l1GasPrice: bigint | null;
|
|
1963
|
-
l1GasUsed: bigint | null;
|
|
1964
|
-
l1Fee: bigint | null;
|
|
1965
|
-
l1FeeScalar: number | null;
|
|
1966
|
-
} & {};
|
|
1967
|
-
type: "transactionReceipt";
|
|
1968
|
-
};
|
|
1969
|
-
};
|
|
1970
|
-
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1971
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1972
|
-
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1973
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1974
|
-
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1975
|
-
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1976
|
-
}] | undefined;
|
|
1977
|
-
serializers: {
|
|
1978
|
-
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
1979
|
-
};
|
|
1980
|
-
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1981
|
-
readonly network: "base-sepolia";
|
|
1982
|
-
};
|
|
1983
1669
|
};
|
|
1984
|
-
type NetworkType =
|
|
1670
|
+
type NetworkType = 'mainnet';
|
|
1985
1671
|
/**
|
|
1986
1672
|
* Contract addresses by network
|
|
1987
1673
|
*/
|
|
@@ -2018,7 +1704,6 @@ declare const ZERO_X_CONFIG: {
|
|
|
2018
1704
|
*/
|
|
2019
1705
|
declare const EXAGENT_API_CONFIG: {
|
|
2020
1706
|
readonly mainnet: "https://exagent-api.onrender.com";
|
|
2021
|
-
readonly testnet: "https://exagent-api.onrender.com";
|
|
2022
1707
|
};
|
|
2023
1708
|
|
|
2024
1709
|
/**
|
|
@@ -2659,20 +2344,4 @@ declare class ExagentVaultFactory {
|
|
|
2659
2344
|
}>;
|
|
2660
2345
|
}
|
|
2661
2346
|
|
|
2662
|
-
|
|
2663
|
-
* Quick access to testnet (Base Sepolia) contract addresses
|
|
2664
|
-
* Use these when interacting with contracts directly via viem
|
|
2665
|
-
*/
|
|
2666
|
-
declare const TESTNET_ADDRESSES: {
|
|
2667
|
-
readonly registry: "0xCF48C341e3FebeCA5ECB7eb2535f61A2Ba855d9C";
|
|
2668
|
-
readonly token: "0x66c39b0ad96B3f5eE198Fef913c6636353a48A87";
|
|
2669
|
-
readonly staking: "0x439441468e1b1b616E9D36b80969C241F261A011";
|
|
2670
|
-
readonly router: "0xc0c27eEE047E414CD716D06C2444CF2073113d5C";
|
|
2671
|
-
readonly vaultFactory: "0x5c099daaE33801a907Bb57011c6749655b55dc75";
|
|
2672
|
-
readonly feeCollector: "0xcB57b03a50df054b9C738Df1324C17A4fDe4fe46";
|
|
2673
|
-
readonly buyback: "0x35cdEa810A130A846265682e5c71A68A507aB895";
|
|
2674
|
-
readonly serviceEscrow: "0x74a3496b148DEE735ac388299aF9Ac2F7C4EdCBf";
|
|
2675
|
-
readonly usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
|
|
2676
|
-
};
|
|
2677
|
-
|
|
2678
|
-
export { type AgentMetadata, type AgentProfile, type StakingInfo$1 as ApiStakingInfo, CHAIN_CONFIG, CONTRACT_ADDRESSES, type CanCreateVaultResult, type CreateVaultOptions, DEX_ADDRESSES, type DepositInfo, EXAGENT_API_CONFIG, EXAGENT_STAKING_ABI, EXAGENT_VAULT_FACTORY_ABI, type EarningsTierInfo, ExagentClient, type ExagentClientConfig, ExagentRegistry, ExagentStaking, ExagentVault, ExagentVaultFactory, type GlobalAgentId, type LockInfo, type NetworkType, type PerformanceSnapshot, type PriceQuote, type RouteQuote, type RouteStep, type RouterTradeResponse, SDK_VERSION, type ServiceRequest, type StakeInfo, type StakingInfo, TESTNET_ADDRESSES, type TradeIntent, type TradeResult, type UserVaultPosition, type VaultActivityEntry, type VaultConfig, type VaultCreationRequirements, type VaultInfo, type VaultPosition, type VaultSummary, type VaultTradeEntry, type WithdrawalRequest, ZERO_X_CONFIG, buildGlobalAgentId, parseGlobalAgentId };
|
|
2347
|
+
export { type AgentMetadata, type AgentProfile, type StakingInfo$1 as ApiStakingInfo, CHAIN_CONFIG, CONTRACT_ADDRESSES, type CanCreateVaultResult, type CreateVaultOptions, DEFAULT_RPC_URL, DEX_ADDRESSES, type DepositInfo, EXAGENT_API_CONFIG, EXAGENT_STAKING_ABI, EXAGENT_VAULT_FACTORY_ABI, type EarningsTierInfo, ExagentClient, type ExagentClientConfig, ExagentRegistry, ExagentStaking, ExagentVault, ExagentVaultFactory, type GlobalAgentId, type LockInfo, type NetworkType, type PerformanceSnapshot, type PriceQuote, type RouteQuote, type RouteStep, type RouterTradeResponse, SDK_VERSION, type ServiceRequest, type StakeInfo, type StakingInfo, type TradeIntent, type TradeResult, type UserVaultPosition, type VaultActivityEntry, type VaultConfig, type VaultCreationRequirements, type VaultInfo, type VaultPosition, type VaultSummary, type VaultTradeEntry, type WithdrawalRequest, ZERO_X_CONFIG, buildGlobalAgentId, getRpcUrl, parseGlobalAgentId };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,15 +14,15 @@ import * as viem_chains from 'viem/chains';
|
|
|
14
14
|
* // Base mainnet agent #42
|
|
15
15
|
* "eip155:8453:0xABC...DEF:42"
|
|
16
16
|
*
|
|
17
|
-
* // Base
|
|
18
|
-
* "eip155:
|
|
17
|
+
* // Another Base mainnet agent
|
|
18
|
+
* "eip155:8453:0x123...789:7"
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
type GlobalAgentId = `eip155:${number}:${Address}:${number}`;
|
|
22
22
|
/**
|
|
23
23
|
* Build an ERC-8004 compliant global agent identifier
|
|
24
24
|
*
|
|
25
|
-
* @param chainId - EVM chain ID (8453 for Base
|
|
25
|
+
* @param chainId - EVM chain ID (8453 for Base)
|
|
26
26
|
* @param registryAddress - ExagentRegistry contract address
|
|
27
27
|
* @param agentId - On-chain agent ID (from ExagentRegistry)
|
|
28
28
|
* @returns Global agent identifier string
|
|
@@ -1337,7 +1337,17 @@ declare class ExagentStaking {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
1339
|
/** SDK version — sent to API for version gating */
|
|
1340
|
-
declare const SDK_VERSION = "0.1.
|
|
1340
|
+
declare const SDK_VERSION = "0.1.6";
|
|
1341
|
+
/**
|
|
1342
|
+
* Default RPC URL for Base mainnet.
|
|
1343
|
+
* Uses a higher-limit public endpoint to avoid rate-limiting.
|
|
1344
|
+
* Users should set BASE_RPC_URL env var for production use.
|
|
1345
|
+
*/
|
|
1346
|
+
declare const DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
|
|
1347
|
+
/**
|
|
1348
|
+
* Get RPC URL from environment or use default.
|
|
1349
|
+
*/
|
|
1350
|
+
declare function getRpcUrl(): string;
|
|
1341
1351
|
declare const CHAIN_CONFIG: {
|
|
1342
1352
|
readonly mainnet: {
|
|
1343
1353
|
blockExplorers: {
|
|
@@ -1656,332 +1666,8 @@ declare const CHAIN_CONFIG: {
|
|
|
1656
1666
|
};
|
|
1657
1667
|
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1658
1668
|
};
|
|
1659
|
-
readonly testnet: {
|
|
1660
|
-
blockExplorers: {
|
|
1661
|
-
readonly default: {
|
|
1662
|
-
readonly name: "Basescan";
|
|
1663
|
-
readonly url: "https://sepolia.basescan.org";
|
|
1664
|
-
readonly apiUrl: "https://api-sepolia.basescan.org/api";
|
|
1665
|
-
};
|
|
1666
|
-
};
|
|
1667
|
-
blockTime: 2000;
|
|
1668
|
-
contracts: {
|
|
1669
|
-
readonly disputeGameFactory: {
|
|
1670
|
-
readonly 11155111: {
|
|
1671
|
-
readonly address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1";
|
|
1672
|
-
};
|
|
1673
|
-
};
|
|
1674
|
-
readonly l2OutputOracle: {
|
|
1675
|
-
readonly 11155111: {
|
|
1676
|
-
readonly address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254";
|
|
1677
|
-
};
|
|
1678
|
-
};
|
|
1679
|
-
readonly portal: {
|
|
1680
|
-
readonly 11155111: {
|
|
1681
|
-
readonly address: "0x49f53e41452c74589e85ca1677426ba426459e85";
|
|
1682
|
-
readonly blockCreated: 4446677;
|
|
1683
|
-
};
|
|
1684
|
-
};
|
|
1685
|
-
readonly l1StandardBridge: {
|
|
1686
|
-
readonly 11155111: {
|
|
1687
|
-
readonly address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120";
|
|
1688
|
-
readonly blockCreated: 4446677;
|
|
1689
|
-
};
|
|
1690
|
-
};
|
|
1691
|
-
readonly multicall3: {
|
|
1692
|
-
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1693
|
-
readonly blockCreated: 1059647;
|
|
1694
|
-
};
|
|
1695
|
-
readonly gasPriceOracle: {
|
|
1696
|
-
readonly address: "0x420000000000000000000000000000000000000F";
|
|
1697
|
-
};
|
|
1698
|
-
readonly l1Block: {
|
|
1699
|
-
readonly address: "0x4200000000000000000000000000000000000015";
|
|
1700
|
-
};
|
|
1701
|
-
readonly l2CrossDomainMessenger: {
|
|
1702
|
-
readonly address: "0x4200000000000000000000000000000000000007";
|
|
1703
|
-
};
|
|
1704
|
-
readonly l2Erc721Bridge: {
|
|
1705
|
-
readonly address: "0x4200000000000000000000000000000000000014";
|
|
1706
|
-
};
|
|
1707
|
-
readonly l2StandardBridge: {
|
|
1708
|
-
readonly address: "0x4200000000000000000000000000000000000010";
|
|
1709
|
-
};
|
|
1710
|
-
readonly l2ToL1MessagePasser: {
|
|
1711
|
-
readonly address: "0x4200000000000000000000000000000000000016";
|
|
1712
|
-
};
|
|
1713
|
-
};
|
|
1714
|
-
ensTlds?: readonly string[] | undefined;
|
|
1715
|
-
id: 84532;
|
|
1716
|
-
name: "Base Sepolia";
|
|
1717
|
-
nativeCurrency: {
|
|
1718
|
-
readonly name: "Sepolia Ether";
|
|
1719
|
-
readonly symbol: "ETH";
|
|
1720
|
-
readonly decimals: 18;
|
|
1721
|
-
};
|
|
1722
|
-
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1723
|
-
rpcUrls: {
|
|
1724
|
-
readonly default: {
|
|
1725
|
-
readonly http: readonly ["https://sepolia.base.org"];
|
|
1726
|
-
};
|
|
1727
|
-
};
|
|
1728
|
-
sourceId: 11155111;
|
|
1729
|
-
testnet: true;
|
|
1730
|
-
custom?: Record<string, unknown> | undefined;
|
|
1731
|
-
extendSchema?: Record<string, unknown> | undefined;
|
|
1732
|
-
fees?: viem.ChainFees<undefined> | undefined;
|
|
1733
|
-
formatters: {
|
|
1734
|
-
readonly block: {
|
|
1735
|
-
exclude: [] | undefined;
|
|
1736
|
-
format: (args: viem_chains.OpStackRpcBlock, action
|
|
1737
|
-
/**
|
|
1738
|
-
* Validate that contract addresses are set for the given network.
|
|
1739
|
-
* Throws if mainnet addresses are all zero (not yet deployed).
|
|
1740
|
-
*/
|
|
1741
|
-
/** Phase 1 contracts — must be deployed on mainnet */
|
|
1742
|
-
?: string | undefined) => {
|
|
1743
|
-
baseFeePerGas: bigint | null;
|
|
1744
|
-
blobGasUsed: bigint;
|
|
1745
|
-
difficulty: bigint;
|
|
1746
|
-
excessBlobGas: bigint;
|
|
1747
|
-
extraData: viem.Hex;
|
|
1748
|
-
gasLimit: bigint;
|
|
1749
|
-
gasUsed: bigint;
|
|
1750
|
-
hash: `0x${string}` | null;
|
|
1751
|
-
logsBloom: `0x${string}` | null;
|
|
1752
|
-
miner: `0x${string}`;
|
|
1753
|
-
mixHash: viem.Hash;
|
|
1754
|
-
nonce: `0x${string}` | null;
|
|
1755
|
-
number: bigint | null;
|
|
1756
|
-
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
1757
|
-
parentHash: viem.Hash;
|
|
1758
|
-
receiptsRoot: viem.Hex;
|
|
1759
|
-
sealFields: viem.Hex[];
|
|
1760
|
-
sha3Uncles: viem.Hash;
|
|
1761
|
-
size: bigint;
|
|
1762
|
-
stateRoot: viem.Hash;
|
|
1763
|
-
timestamp: bigint;
|
|
1764
|
-
totalDifficulty: bigint | null;
|
|
1765
|
-
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
1766
|
-
transactionsRoot: viem.Hash;
|
|
1767
|
-
uncles: viem.Hash[];
|
|
1768
|
-
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
1769
|
-
withdrawalsRoot?: `0x${string}` | undefined;
|
|
1770
|
-
} & {};
|
|
1771
|
-
type: "block";
|
|
1772
|
-
};
|
|
1773
|
-
readonly transaction: {
|
|
1774
|
-
exclude: [] | undefined;
|
|
1775
|
-
format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
1776
|
-
blockHash: `0x${string}` | null;
|
|
1777
|
-
blockNumber: bigint | null;
|
|
1778
|
-
from: `0x${string}`;
|
|
1779
|
-
gas: bigint;
|
|
1780
|
-
hash: viem.Hash;
|
|
1781
|
-
input: viem.Hex;
|
|
1782
|
-
nonce: number;
|
|
1783
|
-
r: viem.Hex;
|
|
1784
|
-
s: viem.Hex;
|
|
1785
|
-
to: `0x${string}` | null;
|
|
1786
|
-
transactionIndex: number | null;
|
|
1787
|
-
typeHex: viem.Hex | null;
|
|
1788
|
-
v: bigint;
|
|
1789
|
-
value: bigint;
|
|
1790
|
-
yParity: number;
|
|
1791
|
-
gasPrice?: undefined | undefined;
|
|
1792
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1793
|
-
maxFeePerGas: bigint;
|
|
1794
|
-
maxPriorityFeePerGas: bigint;
|
|
1795
|
-
isSystemTx?: boolean;
|
|
1796
|
-
mint?: bigint | undefined | undefined;
|
|
1797
|
-
sourceHash: viem.Hex;
|
|
1798
|
-
type: "deposit";
|
|
1799
|
-
} | {
|
|
1800
|
-
r: viem.Hex;
|
|
1801
|
-
s: viem.Hex;
|
|
1802
|
-
v: bigint;
|
|
1803
|
-
to: `0x${string}` | null;
|
|
1804
|
-
from: `0x${string}`;
|
|
1805
|
-
gas: bigint;
|
|
1806
|
-
nonce: number;
|
|
1807
|
-
value: bigint;
|
|
1808
|
-
blockHash: `0x${string}` | null;
|
|
1809
|
-
blockNumber: bigint | null;
|
|
1810
|
-
hash: viem.Hash;
|
|
1811
|
-
input: viem.Hex;
|
|
1812
|
-
transactionIndex: number | null;
|
|
1813
|
-
typeHex: viem.Hex | null;
|
|
1814
|
-
accessList?: undefined | undefined;
|
|
1815
|
-
authorizationList?: undefined | undefined;
|
|
1816
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1817
|
-
chainId?: number | undefined;
|
|
1818
|
-
yParity?: undefined | undefined;
|
|
1819
|
-
type: "legacy";
|
|
1820
|
-
gasPrice: bigint;
|
|
1821
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1822
|
-
maxFeePerGas?: undefined | undefined;
|
|
1823
|
-
maxPriorityFeePerGas?: undefined | undefined;
|
|
1824
|
-
isSystemTx?: undefined | undefined;
|
|
1825
|
-
mint?: undefined | undefined;
|
|
1826
|
-
sourceHash?: undefined | undefined;
|
|
1827
|
-
} | {
|
|
1828
|
-
blockHash: `0x${string}` | null;
|
|
1829
|
-
blockNumber: bigint | null;
|
|
1830
|
-
from: `0x${string}`;
|
|
1831
|
-
gas: bigint;
|
|
1832
|
-
hash: viem.Hash;
|
|
1833
|
-
input: viem.Hex;
|
|
1834
|
-
nonce: number;
|
|
1835
|
-
r: viem.Hex;
|
|
1836
|
-
s: viem.Hex;
|
|
1837
|
-
to: `0x${string}` | null;
|
|
1838
|
-
transactionIndex: number | null;
|
|
1839
|
-
typeHex: viem.Hex | null;
|
|
1840
|
-
v: bigint;
|
|
1841
|
-
value: bigint;
|
|
1842
|
-
yParity: number;
|
|
1843
|
-
accessList: viem.AccessList;
|
|
1844
|
-
authorizationList?: undefined | undefined;
|
|
1845
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1846
|
-
chainId: number;
|
|
1847
|
-
type: "eip2930";
|
|
1848
|
-
gasPrice: bigint;
|
|
1849
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1850
|
-
maxFeePerGas?: undefined | undefined;
|
|
1851
|
-
maxPriorityFeePerGas?: undefined | undefined;
|
|
1852
|
-
isSystemTx?: undefined | undefined;
|
|
1853
|
-
mint?: undefined | undefined;
|
|
1854
|
-
sourceHash?: undefined | undefined;
|
|
1855
|
-
} | {
|
|
1856
|
-
blockHash: `0x${string}` | null;
|
|
1857
|
-
blockNumber: bigint | null;
|
|
1858
|
-
from: `0x${string}`;
|
|
1859
|
-
gas: bigint;
|
|
1860
|
-
hash: viem.Hash;
|
|
1861
|
-
input: viem.Hex;
|
|
1862
|
-
nonce: number;
|
|
1863
|
-
r: viem.Hex;
|
|
1864
|
-
s: viem.Hex;
|
|
1865
|
-
to: `0x${string}` | null;
|
|
1866
|
-
transactionIndex: number | null;
|
|
1867
|
-
typeHex: viem.Hex | null;
|
|
1868
|
-
v: bigint;
|
|
1869
|
-
value: bigint;
|
|
1870
|
-
yParity: number;
|
|
1871
|
-
accessList: viem.AccessList;
|
|
1872
|
-
authorizationList?: undefined | undefined;
|
|
1873
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1874
|
-
chainId: number;
|
|
1875
|
-
type: "eip1559";
|
|
1876
|
-
gasPrice?: undefined | undefined;
|
|
1877
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1878
|
-
maxFeePerGas: bigint;
|
|
1879
|
-
maxPriorityFeePerGas: bigint;
|
|
1880
|
-
isSystemTx?: undefined | undefined;
|
|
1881
|
-
mint?: undefined | undefined;
|
|
1882
|
-
sourceHash?: undefined | undefined;
|
|
1883
|
-
} | {
|
|
1884
|
-
blockHash: `0x${string}` | null;
|
|
1885
|
-
blockNumber: bigint | null;
|
|
1886
|
-
from: `0x${string}`;
|
|
1887
|
-
gas: bigint;
|
|
1888
|
-
hash: viem.Hash;
|
|
1889
|
-
input: viem.Hex;
|
|
1890
|
-
nonce: number;
|
|
1891
|
-
r: viem.Hex;
|
|
1892
|
-
s: viem.Hex;
|
|
1893
|
-
to: `0x${string}` | null;
|
|
1894
|
-
transactionIndex: number | null;
|
|
1895
|
-
typeHex: viem.Hex | null;
|
|
1896
|
-
v: bigint;
|
|
1897
|
-
value: bigint;
|
|
1898
|
-
yParity: number;
|
|
1899
|
-
accessList: viem.AccessList;
|
|
1900
|
-
authorizationList?: undefined | undefined;
|
|
1901
|
-
blobVersionedHashes: readonly viem.Hex[];
|
|
1902
|
-
chainId: number;
|
|
1903
|
-
type: "eip4844";
|
|
1904
|
-
gasPrice?: undefined | undefined;
|
|
1905
|
-
maxFeePerBlobGas: bigint;
|
|
1906
|
-
maxFeePerGas: bigint;
|
|
1907
|
-
maxPriorityFeePerGas: bigint;
|
|
1908
|
-
isSystemTx?: undefined | undefined;
|
|
1909
|
-
mint?: undefined | undefined;
|
|
1910
|
-
sourceHash?: undefined | undefined;
|
|
1911
|
-
} | {
|
|
1912
|
-
blockHash: `0x${string}` | null;
|
|
1913
|
-
blockNumber: bigint | null;
|
|
1914
|
-
from: `0x${string}`;
|
|
1915
|
-
gas: bigint;
|
|
1916
|
-
hash: viem.Hash;
|
|
1917
|
-
input: viem.Hex;
|
|
1918
|
-
nonce: number;
|
|
1919
|
-
r: viem.Hex;
|
|
1920
|
-
s: viem.Hex;
|
|
1921
|
-
to: `0x${string}` | null;
|
|
1922
|
-
transactionIndex: number | null;
|
|
1923
|
-
typeHex: viem.Hex | null;
|
|
1924
|
-
v: bigint;
|
|
1925
|
-
value: bigint;
|
|
1926
|
-
yParity: number;
|
|
1927
|
-
accessList: viem.AccessList;
|
|
1928
|
-
authorizationList: viem.SignedAuthorizationList;
|
|
1929
|
-
blobVersionedHashes?: undefined | undefined;
|
|
1930
|
-
chainId: number;
|
|
1931
|
-
type: "eip7702";
|
|
1932
|
-
gasPrice?: undefined | undefined;
|
|
1933
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
1934
|
-
maxFeePerGas: bigint;
|
|
1935
|
-
maxPriorityFeePerGas: bigint;
|
|
1936
|
-
isSystemTx?: undefined | undefined;
|
|
1937
|
-
mint?: undefined | undefined;
|
|
1938
|
-
sourceHash?: undefined | undefined;
|
|
1939
|
-
}) & {};
|
|
1940
|
-
type: "transaction";
|
|
1941
|
-
};
|
|
1942
|
-
readonly transactionReceipt: {
|
|
1943
|
-
exclude: [] | undefined;
|
|
1944
|
-
format: (args: viem_chains.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
1945
|
-
blobGasPrice?: bigint | undefined;
|
|
1946
|
-
blobGasUsed?: bigint | undefined;
|
|
1947
|
-
blockHash: viem.Hash;
|
|
1948
|
-
blockNumber: bigint;
|
|
1949
|
-
contractAddress: `0x${string}` | null | undefined;
|
|
1950
|
-
cumulativeGasUsed: bigint;
|
|
1951
|
-
effectiveGasPrice: bigint;
|
|
1952
|
-
from: `0x${string}`;
|
|
1953
|
-
gasUsed: bigint;
|
|
1954
|
-
logs: viem.Log<bigint, number, false>[];
|
|
1955
|
-
logsBloom: viem.Hex;
|
|
1956
|
-
root?: `0x${string}` | undefined;
|
|
1957
|
-
status: "success" | "reverted";
|
|
1958
|
-
to: `0x${string}` | null;
|
|
1959
|
-
transactionHash: viem.Hash;
|
|
1960
|
-
transactionIndex: number;
|
|
1961
|
-
type: viem.TransactionType;
|
|
1962
|
-
l1GasPrice: bigint | null;
|
|
1963
|
-
l1GasUsed: bigint | null;
|
|
1964
|
-
l1Fee: bigint | null;
|
|
1965
|
-
l1FeeScalar: number | null;
|
|
1966
|
-
} & {};
|
|
1967
|
-
type: "transactionReceipt";
|
|
1968
|
-
};
|
|
1969
|
-
};
|
|
1970
|
-
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1971
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1972
|
-
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
1973
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1974
|
-
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1975
|
-
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1976
|
-
}] | undefined;
|
|
1977
|
-
serializers: {
|
|
1978
|
-
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
1979
|
-
};
|
|
1980
|
-
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
1981
|
-
readonly network: "base-sepolia";
|
|
1982
|
-
};
|
|
1983
1669
|
};
|
|
1984
|
-
type NetworkType =
|
|
1670
|
+
type NetworkType = 'mainnet';
|
|
1985
1671
|
/**
|
|
1986
1672
|
* Contract addresses by network
|
|
1987
1673
|
*/
|
|
@@ -2018,7 +1704,6 @@ declare const ZERO_X_CONFIG: {
|
|
|
2018
1704
|
*/
|
|
2019
1705
|
declare const EXAGENT_API_CONFIG: {
|
|
2020
1706
|
readonly mainnet: "https://exagent-api.onrender.com";
|
|
2021
|
-
readonly testnet: "https://exagent-api.onrender.com";
|
|
2022
1707
|
};
|
|
2023
1708
|
|
|
2024
1709
|
/**
|
|
@@ -2659,20 +2344,4 @@ declare class ExagentVaultFactory {
|
|
|
2659
2344
|
}>;
|
|
2660
2345
|
}
|
|
2661
2346
|
|
|
2662
|
-
|
|
2663
|
-
* Quick access to testnet (Base Sepolia) contract addresses
|
|
2664
|
-
* Use these when interacting with contracts directly via viem
|
|
2665
|
-
*/
|
|
2666
|
-
declare const TESTNET_ADDRESSES: {
|
|
2667
|
-
readonly registry: "0xCF48C341e3FebeCA5ECB7eb2535f61A2Ba855d9C";
|
|
2668
|
-
readonly token: "0x66c39b0ad96B3f5eE198Fef913c6636353a48A87";
|
|
2669
|
-
readonly staking: "0x439441468e1b1b616E9D36b80969C241F261A011";
|
|
2670
|
-
readonly router: "0xc0c27eEE047E414CD716D06C2444CF2073113d5C";
|
|
2671
|
-
readonly vaultFactory: "0x5c099daaE33801a907Bb57011c6749655b55dc75";
|
|
2672
|
-
readonly feeCollector: "0xcB57b03a50df054b9C738Df1324C17A4fDe4fe46";
|
|
2673
|
-
readonly buyback: "0x35cdEa810A130A846265682e5c71A68A507aB895";
|
|
2674
|
-
readonly serviceEscrow: "0x74a3496b148DEE735ac388299aF9Ac2F7C4EdCBf";
|
|
2675
|
-
readonly usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
|
|
2676
|
-
};
|
|
2677
|
-
|
|
2678
|
-
export { type AgentMetadata, type AgentProfile, type StakingInfo$1 as ApiStakingInfo, CHAIN_CONFIG, CONTRACT_ADDRESSES, type CanCreateVaultResult, type CreateVaultOptions, DEX_ADDRESSES, type DepositInfo, EXAGENT_API_CONFIG, EXAGENT_STAKING_ABI, EXAGENT_VAULT_FACTORY_ABI, type EarningsTierInfo, ExagentClient, type ExagentClientConfig, ExagentRegistry, ExagentStaking, ExagentVault, ExagentVaultFactory, type GlobalAgentId, type LockInfo, type NetworkType, type PerformanceSnapshot, type PriceQuote, type RouteQuote, type RouteStep, type RouterTradeResponse, SDK_VERSION, type ServiceRequest, type StakeInfo, type StakingInfo, TESTNET_ADDRESSES, type TradeIntent, type TradeResult, type UserVaultPosition, type VaultActivityEntry, type VaultConfig, type VaultCreationRequirements, type VaultInfo, type VaultPosition, type VaultSummary, type VaultTradeEntry, type WithdrawalRequest, ZERO_X_CONFIG, buildGlobalAgentId, parseGlobalAgentId };
|
|
2347
|
+
export { type AgentMetadata, type AgentProfile, type StakingInfo$1 as ApiStakingInfo, CHAIN_CONFIG, CONTRACT_ADDRESSES, type CanCreateVaultResult, type CreateVaultOptions, DEFAULT_RPC_URL, DEX_ADDRESSES, type DepositInfo, EXAGENT_API_CONFIG, EXAGENT_STAKING_ABI, EXAGENT_VAULT_FACTORY_ABI, type EarningsTierInfo, ExagentClient, type ExagentClientConfig, ExagentRegistry, ExagentStaking, ExagentVault, ExagentVaultFactory, type GlobalAgentId, type LockInfo, type NetworkType, type PerformanceSnapshot, type PriceQuote, type RouteQuote, type RouteStep, type RouterTradeResponse, SDK_VERSION, type ServiceRequest, type StakeInfo, type StakingInfo, type TradeIntent, type TradeResult, type UserVaultPosition, type VaultActivityEntry, type VaultConfig, type VaultCreationRequirements, type VaultInfo, type VaultPosition, type VaultSummary, type VaultTradeEntry, type WithdrawalRequest, ZERO_X_CONFIG, buildGlobalAgentId, getRpcUrl, parseGlobalAgentId };
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
CHAIN_CONFIG: () => CHAIN_CONFIG,
|
|
24
24
|
CONTRACT_ADDRESSES: () => CONTRACT_ADDRESSES,
|
|
25
|
+
DEFAULT_RPC_URL: () => DEFAULT_RPC_URL,
|
|
25
26
|
DEX_ADDRESSES: () => DEX_ADDRESSES,
|
|
26
27
|
EXAGENT_API_CONFIG: () => EXAGENT_API_CONFIG,
|
|
27
28
|
EXAGENT_STAKING_ABI: () => EXAGENT_STAKING_ABI,
|
|
@@ -32,9 +33,9 @@ __export(index_exports, {
|
|
|
32
33
|
ExagentVault: () => ExagentVault,
|
|
33
34
|
ExagentVaultFactory: () => ExagentVaultFactory,
|
|
34
35
|
SDK_VERSION: () => SDK_VERSION,
|
|
35
|
-
TESTNET_ADDRESSES: () => TESTNET_ADDRESSES,
|
|
36
36
|
ZERO_X_CONFIG: () => ZERO_X_CONFIG,
|
|
37
37
|
buildGlobalAgentId: () => buildGlobalAgentId,
|
|
38
|
+
getRpcUrl: () => getRpcUrl,
|
|
38
39
|
parseGlobalAgentId: () => parseGlobalAgentId
|
|
39
40
|
});
|
|
40
41
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -2058,10 +2059,16 @@ var ExagentStaking = class {
|
|
|
2058
2059
|
|
|
2059
2060
|
// src/constants.ts
|
|
2060
2061
|
var import_chains = require("viem/chains");
|
|
2061
|
-
var SDK_VERSION = "0.1.
|
|
2062
|
+
var SDK_VERSION = "0.1.6";
|
|
2063
|
+
var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
|
|
2064
|
+
function getRpcUrl() {
|
|
2065
|
+
if (typeof process !== "undefined" && process.env) {
|
|
2066
|
+
return process.env.BASE_RPC_URL || process.env.EXAGENT_RPC_URL || DEFAULT_RPC_URL;
|
|
2067
|
+
}
|
|
2068
|
+
return DEFAULT_RPC_URL;
|
|
2069
|
+
}
|
|
2062
2070
|
var CHAIN_CONFIG = {
|
|
2063
|
-
mainnet: import_chains.base
|
|
2064
|
-
testnet: import_chains.baseSepolia
|
|
2071
|
+
mainnet: import_chains.base
|
|
2065
2072
|
};
|
|
2066
2073
|
var CONTRACT_ADDRESSES = {
|
|
2067
2074
|
mainnet: {
|
|
@@ -2076,20 +2083,6 @@ var CONTRACT_ADDRESSES = {
|
|
|
2076
2083
|
// Phase 2 — pending deploy
|
|
2077
2084
|
serviceEscrow: "0x0000000000000000000000000000000000000000"
|
|
2078
2085
|
// Phase 2 — pending deploy
|
|
2079
|
-
},
|
|
2080
|
-
testnet: {
|
|
2081
|
-
agentRegistry: "0xCF48C341e3FebeCA5ECB7eb2535f61A2Ba855d9C",
|
|
2082
|
-
// one-agent-per-wallet
|
|
2083
|
-
exaToken: "0x66c39b0ad96B3f5eE198Fef913c6636353a48A87",
|
|
2084
|
-
staking: "0x439441468e1b1b616E9D36b80969C241F261A011",
|
|
2085
|
-
// V2 with delegation
|
|
2086
|
-
router: "0xc0c27eEE047E414CD716D06C2444CF2073113d5C",
|
|
2087
|
-
// V3 with config epochs
|
|
2088
|
-
vaultFactory: "0x5c099daaE33801a907Bb57011c6749655b55dc75",
|
|
2089
|
-
// V2 with requirements
|
|
2090
|
-
feeCollector: "0xcB57b03a50df054b9C738Df1324C17A4fDe4fe46",
|
|
2091
|
-
buyback: "0x35cdEa810A130A846265682e5c71A68A507aB895",
|
|
2092
|
-
serviceEscrow: "0x74a3496b148DEE735ac388299aF9Ac2F7C4EdCBf"
|
|
2093
2086
|
}
|
|
2094
2087
|
};
|
|
2095
2088
|
var DEX_ADDRESSES = {
|
|
@@ -2109,8 +2102,7 @@ var ZERO_X_CONFIG = {
|
|
|
2109
2102
|
// Base
|
|
2110
2103
|
};
|
|
2111
2104
|
var EXAGENT_API_CONFIG = {
|
|
2112
|
-
mainnet: "https://exagent-api.onrender.com"
|
|
2113
|
-
testnet: "https://exagent-api.onrender.com"
|
|
2105
|
+
mainnet: "https://exagent-api.onrender.com"
|
|
2114
2106
|
};
|
|
2115
2107
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2116
2108
|
var PHASE_1_CONTRACTS = /* @__PURE__ */ new Set([
|
|
@@ -2122,13 +2114,11 @@ var PHASE_1_CONTRACTS = /* @__PURE__ */ new Set([
|
|
|
2122
2114
|
]);
|
|
2123
2115
|
function validateContractAddresses(network) {
|
|
2124
2116
|
const addresses = CONTRACT_ADDRESSES[network];
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
);
|
|
2131
|
-
}
|
|
2117
|
+
const missingPhase1 = Object.entries(addresses).filter(([name, addr]) => PHASE_1_CONTRACTS.has(name) && addr === ZERO_ADDRESS).map(([name]) => name);
|
|
2118
|
+
if (missingPhase1.length > 0) {
|
|
2119
|
+
throw new Error(
|
|
2120
|
+
`Mainnet Phase 1 contracts not deployed. Missing: ${missingPhase1.join(", ")}. Update @exagent/sdk to the latest version.`
|
|
2121
|
+
);
|
|
2132
2122
|
}
|
|
2133
2123
|
}
|
|
2134
2124
|
|
|
@@ -2163,13 +2153,14 @@ var ExagentClient = class {
|
|
|
2163
2153
|
// Cached agent ID
|
|
2164
2154
|
_agentId;
|
|
2165
2155
|
constructor(config) {
|
|
2166
|
-
this.network = config.network ?? "
|
|
2156
|
+
this.network = config.network ?? "mainnet";
|
|
2167
2157
|
this.apiKey = config.apiKey;
|
|
2168
2158
|
validateContractAddresses(this.network);
|
|
2169
2159
|
const chain = CHAIN_CONFIG[this.network];
|
|
2160
|
+
const rpcUrl = config.rpcUrl || getRpcUrl();
|
|
2170
2161
|
this.publicClient = (0, import_viem2.createPublicClient)({
|
|
2171
2162
|
chain,
|
|
2172
|
-
transport: (0, import_viem2.http)(
|
|
2163
|
+
transport: (0, import_viem2.http)(rpcUrl)
|
|
2173
2164
|
});
|
|
2174
2165
|
if (config.walletClient) {
|
|
2175
2166
|
this.walletClient = config.walletClient;
|
|
@@ -2179,7 +2170,7 @@ var ExagentClient = class {
|
|
|
2179
2170
|
this.walletClient = (0, import_viem2.createWalletClient)({
|
|
2180
2171
|
account: this.account,
|
|
2181
2172
|
chain,
|
|
2182
|
-
transport: (0, import_viem2.http)(
|
|
2173
|
+
transport: (0, import_viem2.http)(rpcUrl)
|
|
2183
2174
|
});
|
|
2184
2175
|
} else {
|
|
2185
2176
|
throw new Error("Either privateKey or walletClient must be provided");
|
|
@@ -3029,25 +3020,11 @@ var ExagentVaultFactory = class {
|
|
|
3029
3020
|
}
|
|
3030
3021
|
}
|
|
3031
3022
|
};
|
|
3032
|
-
|
|
3033
|
-
// src/index.ts
|
|
3034
|
-
var TESTNET_ADDRESSES = {
|
|
3035
|
-
registry: "0xCF48C341e3FebeCA5ECB7eb2535f61A2Ba855d9C",
|
|
3036
|
-
token: "0x66c39b0ad96B3f5eE198Fef913c6636353a48A87",
|
|
3037
|
-
staking: "0x439441468e1b1b616E9D36b80969C241F261A011",
|
|
3038
|
-
router: "0xc0c27eEE047E414CD716D06C2444CF2073113d5C",
|
|
3039
|
-
// V3 with config epochs
|
|
3040
|
-
vaultFactory: "0x5c099daaE33801a907Bb57011c6749655b55dc75",
|
|
3041
|
-
feeCollector: "0xcB57b03a50df054b9C738Df1324C17A4fDe4fe46",
|
|
3042
|
-
buyback: "0x35cdEa810A130A846265682e5c71A68A507aB895",
|
|
3043
|
-
serviceEscrow: "0x74a3496b148DEE735ac388299aF9Ac2F7C4EdCBf",
|
|
3044
|
-
usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
|
|
3045
|
-
// Circle's Base Sepolia USDC (only vault asset)
|
|
3046
|
-
};
|
|
3047
3023
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3048
3024
|
0 && (module.exports = {
|
|
3049
3025
|
CHAIN_CONFIG,
|
|
3050
3026
|
CONTRACT_ADDRESSES,
|
|
3027
|
+
DEFAULT_RPC_URL,
|
|
3051
3028
|
DEX_ADDRESSES,
|
|
3052
3029
|
EXAGENT_API_CONFIG,
|
|
3053
3030
|
EXAGENT_STAKING_ABI,
|
|
@@ -3058,8 +3035,8 @@ var TESTNET_ADDRESSES = {
|
|
|
3058
3035
|
ExagentVault,
|
|
3059
3036
|
ExagentVaultFactory,
|
|
3060
3037
|
SDK_VERSION,
|
|
3061
|
-
TESTNET_ADDRESSES,
|
|
3062
3038
|
ZERO_X_CONFIG,
|
|
3063
3039
|
buildGlobalAgentId,
|
|
3040
|
+
getRpcUrl,
|
|
3064
3041
|
parseGlobalAgentId
|
|
3065
3042
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -2023,11 +2023,17 @@ var ExagentStaking = class {
|
|
|
2023
2023
|
};
|
|
2024
2024
|
|
|
2025
2025
|
// src/constants.ts
|
|
2026
|
-
import { base
|
|
2027
|
-
var SDK_VERSION = "0.1.
|
|
2026
|
+
import { base } from "viem/chains";
|
|
2027
|
+
var SDK_VERSION = "0.1.6";
|
|
2028
|
+
var DEFAULT_RPC_URL = "https://base-rpc.publicnode.com";
|
|
2029
|
+
function getRpcUrl() {
|
|
2030
|
+
if (typeof process !== "undefined" && process.env) {
|
|
2031
|
+
return process.env.BASE_RPC_URL || process.env.EXAGENT_RPC_URL || DEFAULT_RPC_URL;
|
|
2032
|
+
}
|
|
2033
|
+
return DEFAULT_RPC_URL;
|
|
2034
|
+
}
|
|
2028
2035
|
var CHAIN_CONFIG = {
|
|
2029
|
-
mainnet: base
|
|
2030
|
-
testnet: baseSepolia
|
|
2036
|
+
mainnet: base
|
|
2031
2037
|
};
|
|
2032
2038
|
var CONTRACT_ADDRESSES = {
|
|
2033
2039
|
mainnet: {
|
|
@@ -2042,20 +2048,6 @@ var CONTRACT_ADDRESSES = {
|
|
|
2042
2048
|
// Phase 2 — pending deploy
|
|
2043
2049
|
serviceEscrow: "0x0000000000000000000000000000000000000000"
|
|
2044
2050
|
// Phase 2 — pending deploy
|
|
2045
|
-
},
|
|
2046
|
-
testnet: {
|
|
2047
|
-
agentRegistry: "0xCF48C341e3FebeCA5ECB7eb2535f61A2Ba855d9C",
|
|
2048
|
-
// one-agent-per-wallet
|
|
2049
|
-
exaToken: "0x66c39b0ad96B3f5eE198Fef913c6636353a48A87",
|
|
2050
|
-
staking: "0x439441468e1b1b616E9D36b80969C241F261A011",
|
|
2051
|
-
// V2 with delegation
|
|
2052
|
-
router: "0xc0c27eEE047E414CD716D06C2444CF2073113d5C",
|
|
2053
|
-
// V3 with config epochs
|
|
2054
|
-
vaultFactory: "0x5c099daaE33801a907Bb57011c6749655b55dc75",
|
|
2055
|
-
// V2 with requirements
|
|
2056
|
-
feeCollector: "0xcB57b03a50df054b9C738Df1324C17A4fDe4fe46",
|
|
2057
|
-
buyback: "0x35cdEa810A130A846265682e5c71A68A507aB895",
|
|
2058
|
-
serviceEscrow: "0x74a3496b148DEE735ac388299aF9Ac2F7C4EdCBf"
|
|
2059
2051
|
}
|
|
2060
2052
|
};
|
|
2061
2053
|
var DEX_ADDRESSES = {
|
|
@@ -2075,8 +2067,7 @@ var ZERO_X_CONFIG = {
|
|
|
2075
2067
|
// Base
|
|
2076
2068
|
};
|
|
2077
2069
|
var EXAGENT_API_CONFIG = {
|
|
2078
|
-
mainnet: "https://exagent-api.onrender.com"
|
|
2079
|
-
testnet: "https://exagent-api.onrender.com"
|
|
2070
|
+
mainnet: "https://exagent-api.onrender.com"
|
|
2080
2071
|
};
|
|
2081
2072
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2082
2073
|
var PHASE_1_CONTRACTS = /* @__PURE__ */ new Set([
|
|
@@ -2088,13 +2079,11 @@ var PHASE_1_CONTRACTS = /* @__PURE__ */ new Set([
|
|
|
2088
2079
|
]);
|
|
2089
2080
|
function validateContractAddresses(network) {
|
|
2090
2081
|
const addresses = CONTRACT_ADDRESSES[network];
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
);
|
|
2097
|
-
}
|
|
2082
|
+
const missingPhase1 = Object.entries(addresses).filter(([name, addr]) => PHASE_1_CONTRACTS.has(name) && addr === ZERO_ADDRESS).map(([name]) => name);
|
|
2083
|
+
if (missingPhase1.length > 0) {
|
|
2084
|
+
throw new Error(
|
|
2085
|
+
`Mainnet Phase 1 contracts not deployed. Missing: ${missingPhase1.join(", ")}. Update @exagent/sdk to the latest version.`
|
|
2086
|
+
);
|
|
2098
2087
|
}
|
|
2099
2088
|
}
|
|
2100
2089
|
|
|
@@ -2129,13 +2118,14 @@ var ExagentClient = class {
|
|
|
2129
2118
|
// Cached agent ID
|
|
2130
2119
|
_agentId;
|
|
2131
2120
|
constructor(config) {
|
|
2132
|
-
this.network = config.network ?? "
|
|
2121
|
+
this.network = config.network ?? "mainnet";
|
|
2133
2122
|
this.apiKey = config.apiKey;
|
|
2134
2123
|
validateContractAddresses(this.network);
|
|
2135
2124
|
const chain = CHAIN_CONFIG[this.network];
|
|
2125
|
+
const rpcUrl = config.rpcUrl || getRpcUrl();
|
|
2136
2126
|
this.publicClient = createPublicClient({
|
|
2137
2127
|
chain,
|
|
2138
|
-
transport: http(
|
|
2128
|
+
transport: http(rpcUrl)
|
|
2139
2129
|
});
|
|
2140
2130
|
if (config.walletClient) {
|
|
2141
2131
|
this.walletClient = config.walletClient;
|
|
@@ -2145,7 +2135,7 @@ var ExagentClient = class {
|
|
|
2145
2135
|
this.walletClient = createWalletClient({
|
|
2146
2136
|
account: this.account,
|
|
2147
2137
|
chain,
|
|
2148
|
-
transport: http(
|
|
2138
|
+
transport: http(rpcUrl)
|
|
2149
2139
|
});
|
|
2150
2140
|
} else {
|
|
2151
2141
|
throw new Error("Either privateKey or walletClient must be provided");
|
|
@@ -2995,24 +2985,10 @@ var ExagentVaultFactory = class {
|
|
|
2995
2985
|
}
|
|
2996
2986
|
}
|
|
2997
2987
|
};
|
|
2998
|
-
|
|
2999
|
-
// src/index.ts
|
|
3000
|
-
var TESTNET_ADDRESSES = {
|
|
3001
|
-
registry: "0xCF48C341e3FebeCA5ECB7eb2535f61A2Ba855d9C",
|
|
3002
|
-
token: "0x66c39b0ad96B3f5eE198Fef913c6636353a48A87",
|
|
3003
|
-
staking: "0x439441468e1b1b616E9D36b80969C241F261A011",
|
|
3004
|
-
router: "0xc0c27eEE047E414CD716D06C2444CF2073113d5C",
|
|
3005
|
-
// V3 with config epochs
|
|
3006
|
-
vaultFactory: "0x5c099daaE33801a907Bb57011c6749655b55dc75",
|
|
3007
|
-
feeCollector: "0xcB57b03a50df054b9C738Df1324C17A4fDe4fe46",
|
|
3008
|
-
buyback: "0x35cdEa810A130A846265682e5c71A68A507aB895",
|
|
3009
|
-
serviceEscrow: "0x74a3496b148DEE735ac388299aF9Ac2F7C4EdCBf",
|
|
3010
|
-
usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
|
|
3011
|
-
// Circle's Base Sepolia USDC (only vault asset)
|
|
3012
|
-
};
|
|
3013
2988
|
export {
|
|
3014
2989
|
CHAIN_CONFIG,
|
|
3015
2990
|
CONTRACT_ADDRESSES,
|
|
2991
|
+
DEFAULT_RPC_URL,
|
|
3016
2992
|
DEX_ADDRESSES,
|
|
3017
2993
|
EXAGENT_API_CONFIG,
|
|
3018
2994
|
EXAGENT_STAKING_ABI,
|
|
@@ -3023,8 +2999,8 @@ export {
|
|
|
3023
2999
|
ExagentVault,
|
|
3024
3000
|
ExagentVaultFactory,
|
|
3025
3001
|
SDK_VERSION,
|
|
3026
|
-
TESTNET_ADDRESSES,
|
|
3027
3002
|
ZERO_X_CONFIG,
|
|
3028
3003
|
buildGlobalAgentId,
|
|
3004
|
+
getRpcUrl,
|
|
3029
3005
|
parseGlobalAgentId
|
|
3030
3006
|
};
|