@one-source/api-mcp 1.0.0
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/LICENSE +21 -0
- package/README.md +147 -0
- package/dist/analytics.d.ts +53 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.fix-verification.test.d.ts +11 -0
- package/dist/analytics.fix-verification.test.d.ts.map +1 -0
- package/dist/analytics.fix-verification.test.js +146 -0
- package/dist/analytics.fix-verification.test.js.map +1 -0
- package/dist/analytics.js +126 -0
- package/dist/analytics.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +144 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +52 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +126 -0
- package/dist/client.js.map +1 -0
- package/dist/create-server.d.ts +28 -0
- package/dist/create-server.d.ts.map +1 -0
- package/dist/create-server.js +133 -0
- package/dist/create-server.js.map +1 -0
- package/dist/tools/chain/contract-code.d.ts +6 -0
- package/dist/tools/chain/contract-code.d.ts.map +1 -0
- package/dist/tools/chain/contract-code.js +19 -0
- package/dist/tools/chain/contract-code.js.map +1 -0
- package/dist/tools/chain/ens-resolve.d.ts +3 -0
- package/dist/tools/chain/ens-resolve.d.ts.map +1 -0
- package/dist/tools/chain/ens-resolve.js +25 -0
- package/dist/tools/chain/ens-resolve.js.map +1 -0
- package/dist/tools/chain/estimate-gas.d.ts +6 -0
- package/dist/tools/chain/estimate-gas.d.ts.map +1 -0
- package/dist/tools/chain/estimate-gas.js +31 -0
- package/dist/tools/chain/estimate-gas.js.map +1 -0
- package/dist/tools/chain/network-info.d.ts +6 -0
- package/dist/tools/chain/network-info.d.ts.map +1 -0
- package/dist/tools/chain/network-info.js +18 -0
- package/dist/tools/chain/network-info.js.map +1 -0
- package/dist/tools/chain/nonce.d.ts +6 -0
- package/dist/tools/chain/nonce.d.ts.map +1 -0
- package/dist/tools/chain/nonce.js +19 -0
- package/dist/tools/chain/nonce.js.map +1 -0
- package/dist/tools/chain/pending-block.d.ts +6 -0
- package/dist/tools/chain/pending-block.d.ts.map +1 -0
- package/dist/tools/chain/pending-block.js +18 -0
- package/dist/tools/chain/pending-block.js.map +1 -0
- package/dist/tools/chain/proxy-detect.d.ts +6 -0
- package/dist/tools/chain/proxy-detect.d.ts.map +1 -0
- package/dist/tools/chain/proxy-detect.js +19 -0
- package/dist/tools/chain/proxy-detect.js.map +1 -0
- package/dist/tools/chain/simulate-call.d.ts +6 -0
- package/dist/tools/chain/simulate-call.d.ts.map +1 -0
- package/dist/tools/chain/simulate-call.js +33 -0
- package/dist/tools/chain/simulate-call.js.map +1 -0
- package/dist/tools/chain/storage-read.d.ts +3 -0
- package/dist/tools/chain/storage-read.d.ts.map +1 -0
- package/dist/tools/chain/storage-read.js +22 -0
- package/dist/tools/chain/storage-read.js.map +1 -0
- package/dist/tools/chain/tx-receipt.d.ts +6 -0
- package/dist/tools/chain/tx-receipt.d.ts.map +1 -0
- package/dist/tools/chain/tx-receipt.js +18 -0
- package/dist/tools/chain/tx-receipt.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +77 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/indexed/address-txs.d.ts +6 -0
- package/dist/tools/indexed/address-txs.d.ts.map +1 -0
- package/dist/tools/indexed/address-txs.js +25 -0
- package/dist/tools/indexed/address-txs.js.map +1 -0
- package/dist/tools/indexed/block.d.ts +3 -0
- package/dist/tools/indexed/block.d.ts.map +1 -0
- package/dist/tools/indexed/block.js +23 -0
- package/dist/tools/indexed/block.js.map +1 -0
- package/dist/tools/indexed/contract-info.d.ts +6 -0
- package/dist/tools/indexed/contract-info.d.ts.map +1 -0
- package/dist/tools/indexed/contract-info.js +18 -0
- package/dist/tools/indexed/contract-info.js.map +1 -0
- package/dist/tools/indexed/erc1155-balance.d.ts +6 -0
- package/dist/tools/indexed/erc1155-balance.d.ts.map +1 -0
- package/dist/tools/indexed/erc1155-balance.js +24 -0
- package/dist/tools/indexed/erc1155-balance.js.map +1 -0
- package/dist/tools/indexed/erc20-balance.d.ts +6 -0
- package/dist/tools/indexed/erc20-balance.d.ts.map +1 -0
- package/dist/tools/indexed/erc20-balance.js +22 -0
- package/dist/tools/indexed/erc20-balance.js.map +1 -0
- package/dist/tools/indexed/erc20-transfers.d.ts +6 -0
- package/dist/tools/indexed/erc20-transfers.d.ts.map +1 -0
- package/dist/tools/indexed/erc20-transfers.js +24 -0
- package/dist/tools/indexed/erc20-transfers.js.map +1 -0
- package/dist/tools/indexed/events.d.ts +3 -0
- package/dist/tools/indexed/events.d.ts.map +1 -0
- package/dist/tools/indexed/events.js +32 -0
- package/dist/tools/indexed/events.js.map +1 -0
- package/dist/tools/indexed/nft-media.d.ts +6 -0
- package/dist/tools/indexed/nft-media.d.ts.map +1 -0
- package/dist/tools/indexed/nft-media.js +22 -0
- package/dist/tools/indexed/nft-media.js.map +1 -0
- package/dist/tools/indexed/nft-metadata.d.ts +6 -0
- package/dist/tools/indexed/nft-metadata.d.ts.map +1 -0
- package/dist/tools/indexed/nft-metadata.js +22 -0
- package/dist/tools/indexed/nft-metadata.js.map +1 -0
- package/dist/tools/indexed/nft-owner.d.ts +6 -0
- package/dist/tools/indexed/nft-owner.d.ts.map +1 -0
- package/dist/tools/indexed/nft-owner.js +22 -0
- package/dist/tools/indexed/nft-owner.js.map +1 -0
- package/dist/tools/indexed/tx-details.d.ts +6 -0
- package/dist/tools/indexed/tx-details.d.ts.map +1 -0
- package/dist/tools/indexed/tx-details.js +19 -0
- package/dist/tools/indexed/tx-details.js.map +1 -0
- package/dist/tools/indexed/wallet-nfts.d.ts +6 -0
- package/dist/tools/indexed/wallet-nfts.d.ts.map +1 -0
- package/dist/tools/indexed/wallet-nfts.js +22 -0
- package/dist/tools/indexed/wallet-nfts.js.map +1 -0
- package/dist/tools/live/allowance.d.ts +6 -0
- package/dist/tools/live/allowance.d.ts.map +1 -0
- package/dist/tools/live/allowance.js +24 -0
- package/dist/tools/live/allowance.js.map +1 -0
- package/dist/tools/live/contract-info.d.ts +6 -0
- package/dist/tools/live/contract-info.d.ts.map +1 -0
- package/dist/tools/live/contract-info.js +19 -0
- package/dist/tools/live/contract-info.js.map +1 -0
- package/dist/tools/live/erc1155-balance.d.ts +6 -0
- package/dist/tools/live/erc1155-balance.d.ts.map +1 -0
- package/dist/tools/live/erc1155-balance.js +24 -0
- package/dist/tools/live/erc1155-balance.js.map +1 -0
- package/dist/tools/live/erc20-balance.d.ts +6 -0
- package/dist/tools/live/erc20-balance.d.ts.map +1 -0
- package/dist/tools/live/erc20-balance.js +22 -0
- package/dist/tools/live/erc20-balance.js.map +1 -0
- package/dist/tools/live/erc20-transfers.d.ts +3 -0
- package/dist/tools/live/erc20-transfers.d.ts.map +1 -0
- package/dist/tools/live/erc20-transfers.js +26 -0
- package/dist/tools/live/erc20-transfers.js.map +1 -0
- package/dist/tools/live/erc721-tokens.d.ts +6 -0
- package/dist/tools/live/erc721-tokens.d.ts.map +1 -0
- package/dist/tools/live/erc721-tokens.js +22 -0
- package/dist/tools/live/erc721-tokens.js.map +1 -0
- package/dist/tools/live/events.d.ts +3 -0
- package/dist/tools/live/events.d.ts.map +1 -0
- package/dist/tools/live/events.js +26 -0
- package/dist/tools/live/events.js.map +1 -0
- package/dist/tools/live/multi-balance.d.ts +3 -0
- package/dist/tools/live/multi-balance.d.ts.map +1 -0
- package/dist/tools/live/multi-balance.js +26 -0
- package/dist/tools/live/multi-balance.js.map +1 -0
- package/dist/tools/live/nft-metadata.d.ts +6 -0
- package/dist/tools/live/nft-metadata.d.ts.map +1 -0
- package/dist/tools/live/nft-metadata.js +22 -0
- package/dist/tools/live/nft-metadata.js.map +1 -0
- package/dist/tools/live/nft-owner.d.ts +6 -0
- package/dist/tools/live/nft-owner.d.ts.map +1 -0
- package/dist/tools/live/nft-owner.js +22 -0
- package/dist/tools/live/nft-owner.js.map +1 -0
- package/dist/tools/live/total-supply.d.ts +6 -0
- package/dist/tools/live/total-supply.d.ts.map +1 -0
- package/dist/tools/live/total-supply.js +20 -0
- package/dist/tools/live/total-supply.js.map +1 -0
- package/dist/tools/live/tx-details.d.ts +6 -0
- package/dist/tools/live/tx-details.d.ts.map +1 -0
- package/dist/tools/live/tx-details.js +19 -0
- package/dist/tools/live/tx-details.js.map +1 -0
- package/dist/types.d.ts +74 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +86 -0
- package/dist/types.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-info.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/network-info.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAgBlB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { networkParam, formatResponse } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_network_info',
|
|
4
|
+
description: 'Get basic network information: chain ID, latest block number, and current gas price. ' +
|
|
5
|
+
'Use this to verify which chain you are connected to or to check current gas conditions. ' +
|
|
6
|
+
'Returns hex-encoded values; gas price is in wei.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
network: networkParam,
|
|
10
|
+
},
|
|
11
|
+
handler: async (input, client) => {
|
|
12
|
+
const res = await client.get('/api/chain/network', {
|
|
13
|
+
network: input.network,
|
|
14
|
+
});
|
|
15
|
+
return formatResponse(res);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=network-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-info.js","sourceRoot":"","sources":["../../../src/tools/chain/network-info.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,uFAAuF;QACvF,0FAA0F;QAC1F,kDAAkD;IACpD,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE;YACjD,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonce.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/nonce.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAiBlB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { networkParam, addressParam, formatResponse, safePath } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_nonce',
|
|
4
|
+
description: 'Get the transaction count (nonce) for an address via eth_getTransactionCount. ' +
|
|
5
|
+
'Use this to set the correct nonce when constructing transactions. ' +
|
|
6
|
+
'Returns the count as a hex value.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
address: addressParam,
|
|
10
|
+
network: networkParam,
|
|
11
|
+
},
|
|
12
|
+
handler: async (input, client) => {
|
|
13
|
+
const res = await client.get(`/api/chain/nonce/${safePath(input.address)}`, {
|
|
14
|
+
network: input.network,
|
|
15
|
+
});
|
|
16
|
+
return formatResponse(res);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=nonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonce.js","sourceRoot":"","sources":["../../../src/tools/chain/nonce.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEtF,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,gFAAgF;QAChF,oEAAoE;QACpE,mCAAmC;IACrC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,KAAK,CAAC,OAAiB,CAAC,EAAE,EAAE;YACpF,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-block.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/pending-block.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAgBlB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { networkParam, formatResponse } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_pending_block',
|
|
4
|
+
description: 'Get the current pending block from the mempool. ' +
|
|
5
|
+
'Use this to see transactions waiting for inclusion. ' +
|
|
6
|
+
'Not all nodes expose pending block data; results vary by RPC provider.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
network: networkParam,
|
|
10
|
+
},
|
|
11
|
+
handler: async (input, client) => {
|
|
12
|
+
const res = await client.get('/api/chain/pending', {
|
|
13
|
+
network: input.network,
|
|
14
|
+
});
|
|
15
|
+
return formatResponse(res);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=pending-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-block.js","sourceRoot":"","sources":["../../../src/tools/chain/pending-block.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,kDAAkD;QAClD,sDAAsD;QACtD,wEAAwE;IAC1E,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE;YACjD,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-detect.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/proxy-detect.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAiBlB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { networkParam, addressParam, formatResponse, safePath } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_proxy_detect',
|
|
4
|
+
description: 'Detect if a contract is a proxy and read its implementation address. ' +
|
|
5
|
+
'Checks EIP-1967 (transparent/UUPS/beacon) storage slots. ' +
|
|
6
|
+
'Returns the proxy type, implementation address, and admin if applicable.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
address: addressParam,
|
|
10
|
+
network: networkParam,
|
|
11
|
+
},
|
|
12
|
+
handler: async (input, client) => {
|
|
13
|
+
const res = await client.get(`/api/chain/proxy/${safePath(input.address)}`, {
|
|
14
|
+
network: input.network,
|
|
15
|
+
});
|
|
16
|
+
return formatResponse(res);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=proxy-detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-detect.js","sourceRoot":"","sources":["../../../src/tools/chain/proxy-detect.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEtF,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,uEAAuE;QACvE,2DAA2D;QAC3D,0EAA0E;IAC5E,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,KAAK,CAAC,OAAiB,CAAC,EAAE,EAAE;YACpF,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulate-call.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/simulate-call.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OA6BlB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { networkParam, addressParam, formatResponse, hexDataParam, optionalHexParam } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_simulate_call',
|
|
4
|
+
description: 'Simulate a contract call via eth_call without sending a transaction. ' +
|
|
5
|
+
'Use this to preview call results, decode return data, or check for reverts before sending. ' +
|
|
6
|
+
'Returns the raw hex result or revert reason.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
to: addressParam.describe('Target contract address'),
|
|
10
|
+
data: hexDataParam.describe('ABI-encoded call data (hex)'),
|
|
11
|
+
from: addressParam.optional().describe('Sender address for msg.sender context'),
|
|
12
|
+
value: optionalHexParam.describe('ETH value in wei (hex)'),
|
|
13
|
+
gas: optionalHexParam.describe('Gas limit (hex)'),
|
|
14
|
+
network: networkParam,
|
|
15
|
+
},
|
|
16
|
+
handler: async (input, client) => {
|
|
17
|
+
const body = {
|
|
18
|
+
to: input.to,
|
|
19
|
+
data: input.data,
|
|
20
|
+
};
|
|
21
|
+
if (input.from !== undefined)
|
|
22
|
+
body.from = input.from;
|
|
23
|
+
if (input.value !== undefined)
|
|
24
|
+
body.value = input.value;
|
|
25
|
+
if (input.gas !== undefined)
|
|
26
|
+
body.gas = input.gas;
|
|
27
|
+
const res = await client.post('/api/chain/call', body, {
|
|
28
|
+
network: input.network,
|
|
29
|
+
});
|
|
30
|
+
return formatResponse(res);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=simulate-call.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulate-call.js","sourceRoot":"","sources":["../../../src/tools/chain/simulate-call.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAA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@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-read.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/storage-read.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAoBlB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { networkParam, addressParam, formatResponse, hexDataParam } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_storage_read',
|
|
4
|
+
description: 'Read a raw storage slot from a contract via eth_getStorageAt. ' +
|
|
5
|
+
'Use this for low-level state inspection (e.g. reading proxy implementation slots, packed storage). ' +
|
|
6
|
+
'Slot must be a hex-encoded 32-byte value.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
contract: addressParam.describe('Contract address to read from'),
|
|
10
|
+
slot: hexDataParam.describe('Storage slot (hex-encoded, e.g. 0x0)'),
|
|
11
|
+
network: networkParam,
|
|
12
|
+
},
|
|
13
|
+
handler: async (input, client) => {
|
|
14
|
+
const res = await client.get('/api/chain/storage', {
|
|
15
|
+
contract: input.contract,
|
|
16
|
+
slot: input.slot,
|
|
17
|
+
network: input.network,
|
|
18
|
+
});
|
|
19
|
+
return formatResponse(res);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=storage-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-read.js","sourceRoot":"","sources":["../../../src/tools/chain/storage-read.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1F,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,gEAAgE;QAChE,qGAAqG;QACrG,2CAA2C;IAC7C,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAChE,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QACnE,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE;YACjD,QAAQ,EAAE,KAAK,CAAC,QAAkB;YAClC,IAAI,EAAE,KAAK,CAAC,IAAc;YAC1B,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx-receipt.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/tx-receipt.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAgBlB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { networkParam, txHashParam, formatResponse, safePath } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_tx_receipt',
|
|
4
|
+
description: 'Get a transaction receipt via RPC. Returns status (1=success, 0=revert), gas used, logs, and contract address if deployment. ' +
|
|
5
|
+
'Use 1s_tx_details_live for both transaction data and receipt together.',
|
|
6
|
+
category: 'chain',
|
|
7
|
+
schema: {
|
|
8
|
+
hash: txHashParam,
|
|
9
|
+
network: networkParam,
|
|
10
|
+
},
|
|
11
|
+
handler: async (input, client) => {
|
|
12
|
+
const res = await client.get(`/api/chain/receipt/${safePath(input.hash)}`, {
|
|
13
|
+
network: input.network,
|
|
14
|
+
});
|
|
15
|
+
return formatResponse(res);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=tx-receipt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx-receipt.js","sourceRoot":"","sources":["../../../src/tools/chain/tx-receipt.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAErF,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,+HAA+H;QAC/H,wEAAwE;IAC1E,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,sBAAsB,QAAQ,CAAC,KAAK,CAAC,IAAc,CAAC,EAAE,EAAE;YACnF,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AA0C3C,eAAO,MAAM,QAAQ,EAAE,OAAO,EAwC7B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// --- Indexed data (12 tools) ---
|
|
2
|
+
import { tool as addressTxs } from './indexed/address-txs.js';
|
|
3
|
+
import { tool as block } from './indexed/block.js';
|
|
4
|
+
import { tool as contractInfo } from './indexed/contract-info.js';
|
|
5
|
+
import { tool as erc1155Balance } from './indexed/erc1155-balance.js';
|
|
6
|
+
import { tool as erc20Balance } from './indexed/erc20-balance.js';
|
|
7
|
+
import { tool as erc20Transfers } from './indexed/erc20-transfers.js';
|
|
8
|
+
import { tool as events } from './indexed/events.js';
|
|
9
|
+
import { tool as nftMedia } from './indexed/nft-media.js';
|
|
10
|
+
import { tool as nftMetadata } from './indexed/nft-metadata.js';
|
|
11
|
+
import { tool as nftOwner } from './indexed/nft-owner.js';
|
|
12
|
+
import { tool as txDetails } from './indexed/tx-details.js';
|
|
13
|
+
import { tool as walletNfts } from './indexed/wallet-nfts.js';
|
|
14
|
+
// --- Live chain data (12 tools) ---
|
|
15
|
+
import { tool as allowanceLive } from './live/allowance.js';
|
|
16
|
+
import { tool as contractInfoLive } from './live/contract-info.js';
|
|
17
|
+
import { tool as erc1155BalanceLive } from './live/erc1155-balance.js';
|
|
18
|
+
import { tool as erc20BalanceLive } from './live/erc20-balance.js';
|
|
19
|
+
import { tool as erc20TransfersLive } from './live/erc20-transfers.js';
|
|
20
|
+
import { tool as erc721TokensLive } from './live/erc721-tokens.js';
|
|
21
|
+
import { tool as eventsLive } from './live/events.js';
|
|
22
|
+
import { tool as multiBalanceLive } from './live/multi-balance.js';
|
|
23
|
+
import { tool as nftMetadataLive } from './live/nft-metadata.js';
|
|
24
|
+
import { tool as nftOwnerLive } from './live/nft-owner.js';
|
|
25
|
+
import { tool as totalSupplyLive } from './live/total-supply.js';
|
|
26
|
+
import { tool as txDetailsLive } from './live/tx-details.js';
|
|
27
|
+
// --- Chain utilities (10 tools) ---
|
|
28
|
+
import { tool as contractCode } from './chain/contract-code.js';
|
|
29
|
+
import { tool as ensResolve } from './chain/ens-resolve.js';
|
|
30
|
+
import { tool as estimateGas } from './chain/estimate-gas.js';
|
|
31
|
+
import { tool as networkInfo } from './chain/network-info.js';
|
|
32
|
+
import { tool as nonce } from './chain/nonce.js';
|
|
33
|
+
import { tool as pendingBlock } from './chain/pending-block.js';
|
|
34
|
+
import { tool as proxyDetect } from './chain/proxy-detect.js';
|
|
35
|
+
import { tool as simulateCall } from './chain/simulate-call.js';
|
|
36
|
+
import { tool as storageRead } from './chain/storage-read.js';
|
|
37
|
+
import { tool as txReceipt } from './chain/tx-receipt.js';
|
|
38
|
+
export const allTools = [
|
|
39
|
+
// Indexed data
|
|
40
|
+
addressTxs,
|
|
41
|
+
block,
|
|
42
|
+
contractInfo,
|
|
43
|
+
erc1155Balance,
|
|
44
|
+
erc20Balance,
|
|
45
|
+
erc20Transfers,
|
|
46
|
+
events,
|
|
47
|
+
nftMedia,
|
|
48
|
+
nftMetadata,
|
|
49
|
+
nftOwner,
|
|
50
|
+
txDetails,
|
|
51
|
+
walletNfts,
|
|
52
|
+
// Live chain data
|
|
53
|
+
allowanceLive,
|
|
54
|
+
contractInfoLive,
|
|
55
|
+
erc1155BalanceLive,
|
|
56
|
+
erc20BalanceLive,
|
|
57
|
+
erc20TransfersLive,
|
|
58
|
+
erc721TokensLive,
|
|
59
|
+
eventsLive,
|
|
60
|
+
multiBalanceLive,
|
|
61
|
+
nftMetadataLive,
|
|
62
|
+
nftOwnerLive,
|
|
63
|
+
totalSupplyLive,
|
|
64
|
+
txDetailsLive,
|
|
65
|
+
// Chain utilities
|
|
66
|
+
contractCode,
|
|
67
|
+
ensResolve,
|
|
68
|
+
estimateGas,
|
|
69
|
+
networkInfo,
|
|
70
|
+
nonce,
|
|
71
|
+
pendingBlock,
|
|
72
|
+
proxyDetect,
|
|
73
|
+
simulateCall,
|
|
74
|
+
storageRead,
|
|
75
|
+
txReceipt,
|
|
76
|
+
];
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAMA,kCAAkC;AAClC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,4BA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AAY;IACZ,WAAW;IACX,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-txs.d.ts","sourceRoot":"","sources":["../../../src/tools/indexed/address-txs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAuBlB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { networkParam, formatResponse, addressParam, limitParam, blockNumberParam, safePath } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_address_txs',
|
|
4
|
+
description: 'Get transaction history for an address (sent and received). ' +
|
|
5
|
+
'Sorted by block number descending. ' +
|
|
6
|
+
'Use from_block/to_block to narrow the range.',
|
|
7
|
+
category: 'indexed',
|
|
8
|
+
schema: {
|
|
9
|
+
address: addressParam.describe('Address to get transaction history for'),
|
|
10
|
+
limit: limitParam,
|
|
11
|
+
from_block: blockNumberParam.describe('Start block number (inclusive)'),
|
|
12
|
+
to_block: blockNumberParam.describe('End block number (inclusive)'),
|
|
13
|
+
network: networkParam,
|
|
14
|
+
},
|
|
15
|
+
handler: async (input, client) => {
|
|
16
|
+
const res = await client.get(`/api/address/${safePath(input.address)}/transactions`, {
|
|
17
|
+
limit: input.limit,
|
|
18
|
+
from_block: input.from_block,
|
|
19
|
+
to_block: input.to_block,
|
|
20
|
+
network: input.network,
|
|
21
|
+
});
|
|
22
|
+
return formatResponse(res);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=address-txs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-txs.js","sourceRoot":"","sources":["../../../src/tools/indexed/address-txs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEpH,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,8DAA8D;QAC9D,qCAAqC;QACrC,8CAA8C;IAChD,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QACxE,KAAK,EAAE,UAAU;QACjB,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QACvE,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QACnE,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,gBAAgB,QAAQ,CAAC,KAAK,CAAC,OAAiB,CAAC,eAAe,EAAE;YAC7F,KAAK,EAAE,KAAK,CAAC,KAA2B;YACxC,UAAU,EAAE,KAAK,CAAC,UAAgC;YAClD,QAAQ,EAAE,KAAK,CAAC,QAA8B;YAC9C,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/tools/indexed/block.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAiBlB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 1s_block — Get indexed block details by block number.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { networkParam, formatResponse, safePath } from '../../types.js';
|
|
6
|
+
export const tool = {
|
|
7
|
+
name: '1s_block',
|
|
8
|
+
description: 'Get indexed block details by block number. ' +
|
|
9
|
+
'Returns block metadata including timestamp, transaction count, and gas used. ' +
|
|
10
|
+
'For the latest pending block, use 1s_pending_block instead.',
|
|
11
|
+
category: 'indexed',
|
|
12
|
+
schema: {
|
|
13
|
+
block_number: z.number().int().min(0).describe('Block number'),
|
|
14
|
+
network: networkParam,
|
|
15
|
+
},
|
|
16
|
+
handler: async (input, client) => {
|
|
17
|
+
const res = await client.get(`/api/block/${safePath(String(input.block_number))}`, {
|
|
18
|
+
network: input.network,
|
|
19
|
+
});
|
|
20
|
+
return formatResponse(res);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.js","sourceRoot":"","sources":["../../../src/tools/indexed/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAExE,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,6CAA6C;QAC7C,+EAA+E;QAC/E,6DAA6D;IAC/D,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE;QACN,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC9D,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,cAAc,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,EAAE;YACjF,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-info.d.ts","sourceRoot":"","sources":["../../../src/tools/indexed/contract-info.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAgBlB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { networkParam, formatResponse, addressParam, safePath } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_contract_info',
|
|
4
|
+
description: 'Get indexed contract metadata including deployment info and detected standards. ' +
|
|
5
|
+
'Use this for enriched contract data; use 1s_contract_info_live for real-time ERC standard detection via RPC.',
|
|
6
|
+
category: 'indexed',
|
|
7
|
+
schema: {
|
|
8
|
+
address: addressParam.describe('Contract address'),
|
|
9
|
+
network: networkParam,
|
|
10
|
+
},
|
|
11
|
+
handler: async (input, client) => {
|
|
12
|
+
const res = await client.get(`/api/contract/${safePath(input.address)}`, {
|
|
13
|
+
network: input.network,
|
|
14
|
+
});
|
|
15
|
+
return formatResponse(res);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=contract-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-info.js","sourceRoot":"","sources":["../../../src/tools/indexed/contract-info.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEtF,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,kFAAkF;QAClF,8GAA8G;IAChH,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAClD,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,QAAQ,CAAC,KAAK,CAAC,OAAiB,CAAC,EAAE,EAAE;YACjF,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc1155-balance.d.ts","sourceRoot":"","sources":["../../../src/tools/indexed/erc1155-balance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAsBlB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { networkParam, formatResponse, addressParam, tokenIdParam } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_erc1155_balance',
|
|
4
|
+
description: 'Get indexed ERC1155 token balance. ' +
|
|
5
|
+
'Use this for cached lookups; use 1s_erc1155_balance_live for real-time data. ' +
|
|
6
|
+
'Requires the contract address and specific token ID.',
|
|
7
|
+
category: 'indexed',
|
|
8
|
+
schema: {
|
|
9
|
+
account: addressParam.describe('Wallet address to check balance for'),
|
|
10
|
+
contract: addressParam.describe('ERC1155 contract address'),
|
|
11
|
+
token_id: tokenIdParam,
|
|
12
|
+
network: networkParam,
|
|
13
|
+
},
|
|
14
|
+
handler: async (input, client) => {
|
|
15
|
+
const res = await client.get('/api/balance/erc1155', {
|
|
16
|
+
account: input.account,
|
|
17
|
+
contract: input.contract,
|
|
18
|
+
token_id: input.token_id,
|
|
19
|
+
network: input.network,
|
|
20
|
+
});
|
|
21
|
+
return formatResponse(res);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=erc1155-balance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc1155-balance.js","sourceRoot":"","sources":["../../../src/tools/indexed/erc1155-balance.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1F,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,qCAAqC;QACrC,+EAA+E;QAC/E,sDAAsD;IACxD,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QACrE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAC3D,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE;YACnD,OAAO,EAAE,KAAK,CAAC,OAAiB;YAChC,QAAQ,EAAE,KAAK,CAAC,QAAkB;YAClC,QAAQ,EAAE,KAAK,CAAC,QAAkB;YAClC,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20-balance.d.ts","sourceRoot":"","sources":["../../../src/tools/indexed/erc20-balance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAoBlB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { networkParam, formatResponse, addressParam } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_erc20_balance',
|
|
4
|
+
description: 'Get indexed ERC20 token balance for a wallet. ' +
|
|
5
|
+
'Use this for historical or cached balance lookups; use 1s_erc20_balance_live for real-time data. ' +
|
|
6
|
+
'Returns token metadata (name, symbol, decimals) alongside the balance.',
|
|
7
|
+
category: 'indexed',
|
|
8
|
+
schema: {
|
|
9
|
+
account: addressParam.describe('Wallet address to check balance for'),
|
|
10
|
+
token: addressParam.describe('ERC20 token contract address'),
|
|
11
|
+
network: networkParam,
|
|
12
|
+
},
|
|
13
|
+
handler: async (input, client) => {
|
|
14
|
+
const res = await client.get('/api/balance/erc20', {
|
|
15
|
+
account: input.account,
|
|
16
|
+
token: input.token,
|
|
17
|
+
network: input.network,
|
|
18
|
+
});
|
|
19
|
+
return formatResponse(res);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=erc20-balance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20-balance.js","sourceRoot":"","sources":["../../../src/tools/indexed/erc20-balance.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5E,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,gDAAgD;QAChD,mGAAmG;QACnG,wEAAwE;IAC1E,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QACrE,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QAC5D,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE;YACjD,OAAO,EAAE,KAAK,CAAC,OAAiB;YAChC,KAAK,EAAE,KAAK,CAAC,KAAe;YAC5B,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20-transfers.d.ts","sourceRoot":"","sources":["../../../src/tools/indexed/erc20-transfers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAsBlB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { networkParam, formatResponse, limitParam, optionalAddressParam } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_erc20_transfers',
|
|
4
|
+
description: 'Get ERC20 transfer history filtered by token and/or wallet. ' +
|
|
5
|
+
'Use this for indexed transfer records; use 1s_erc20_transfers_live for raw Transfer event logs. ' +
|
|
6
|
+
'Sorted by block number descending.',
|
|
7
|
+
category: 'indexed',
|
|
8
|
+
schema: {
|
|
9
|
+
token: optionalAddressParam.describe('ERC20 token contract address to filter by'),
|
|
10
|
+
wallet: optionalAddressParam.describe('Wallet address to filter transfers by'),
|
|
11
|
+
limit: limitParam,
|
|
12
|
+
network: networkParam,
|
|
13
|
+
},
|
|
14
|
+
handler: async (input, client) => {
|
|
15
|
+
const res = await client.get('/api/transfers/erc20', {
|
|
16
|
+
token: input.token,
|
|
17
|
+
wallet: input.wallet,
|
|
18
|
+
limit: input.limit,
|
|
19
|
+
network: input.network,
|
|
20
|
+
});
|
|
21
|
+
return formatResponse(res);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=erc20-transfers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20-transfers.js","sourceRoot":"","sources":["../../../src/tools/indexed/erc20-transfers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEhG,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,8DAA8D;QAC9D,kGAAkG;QAClG,oCAAoC;IACtC,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE;QACN,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QACjF,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QAC9E,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE;YACnD,KAAK,EAAE,KAAK,CAAC,KAA2B;YACxC,MAAM,EAAE,KAAK,CAAC,MAA4B;YAC1C,KAAK,EAAE,KAAK,CAAC,KAA2B;YACxC,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/tools/indexed/events.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OA0BlB,CAAC"}
|