@agnocon/piece-blockscout 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.
Files changed (217) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +52 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/addresses/address-blocks-validated.d.ts +4 -0
  7. package/dist/lib/actions/addresses/address-blocks-validated.d.ts.map +1 -0
  8. package/dist/lib/actions/addresses/address-blocks-validated.js +36 -0
  9. package/dist/lib/actions/addresses/address-blocks-validated.js.map +1 -0
  10. package/dist/lib/actions/addresses/address-by-hash.d.ts +4 -0
  11. package/dist/lib/actions/addresses/address-by-hash.d.ts.map +1 -0
  12. package/dist/lib/actions/addresses/address-by-hash.js +36 -0
  13. package/dist/lib/actions/addresses/address-by-hash.js.map +1 -0
  14. package/dist/lib/actions/addresses/address-coin-balance-history-by-day.d.ts +4 -0
  15. package/dist/lib/actions/addresses/address-coin-balance-history-by-day.d.ts.map +1 -0
  16. package/dist/lib/actions/addresses/address-coin-balance-history-by-day.js +36 -0
  17. package/dist/lib/actions/addresses/address-coin-balance-history-by-day.js.map +1 -0
  18. package/dist/lib/actions/addresses/address-coin-balance-history.d.ts +4 -0
  19. package/dist/lib/actions/addresses/address-coin-balance-history.d.ts.map +1 -0
  20. package/dist/lib/actions/addresses/address-coin-balance-history.js +36 -0
  21. package/dist/lib/actions/addresses/address-coin-balance-history.js.map +1 -0
  22. package/dist/lib/actions/addresses/address-counters.d.ts +4 -0
  23. package/dist/lib/actions/addresses/address-counters.d.ts.map +1 -0
  24. package/dist/lib/actions/addresses/address-counters.js +36 -0
  25. package/dist/lib/actions/addresses/address-counters.js.map +1 -0
  26. package/dist/lib/actions/addresses/address-internal-transactions.d.ts +4 -0
  27. package/dist/lib/actions/addresses/address-internal-transactions.d.ts.map +1 -0
  28. package/dist/lib/actions/addresses/address-internal-transactions.js +36 -0
  29. package/dist/lib/actions/addresses/address-internal-transactions.js.map +1 -0
  30. package/dist/lib/actions/addresses/address-logs.d.ts +4 -0
  31. package/dist/lib/actions/addresses/address-logs.d.ts.map +1 -0
  32. package/dist/lib/actions/addresses/address-logs.js +36 -0
  33. package/dist/lib/actions/addresses/address-logs.js.map +1 -0
  34. package/dist/lib/actions/addresses/address-token-balances.d.ts +4 -0
  35. package/dist/lib/actions/addresses/address-token-balances.d.ts.map +1 -0
  36. package/dist/lib/actions/addresses/address-token-balances.js +36 -0
  37. package/dist/lib/actions/addresses/address-token-balances.js.map +1 -0
  38. package/dist/lib/actions/addresses/address-token-transfers.d.ts +4 -0
  39. package/dist/lib/actions/addresses/address-token-transfers.d.ts.map +1 -0
  40. package/dist/lib/actions/addresses/address-token-transfers.js +36 -0
  41. package/dist/lib/actions/addresses/address-token-transfers.js.map +1 -0
  42. package/dist/lib/actions/addresses/address-tokens.d.ts +4 -0
  43. package/dist/lib/actions/addresses/address-tokens.d.ts.map +1 -0
  44. package/dist/lib/actions/addresses/address-tokens.js +36 -0
  45. package/dist/lib/actions/addresses/address-tokens.js.map +1 -0
  46. package/dist/lib/actions/addresses/address-transactions.d.ts +4 -0
  47. package/dist/lib/actions/addresses/address-transactions.d.ts.map +1 -0
  48. package/dist/lib/actions/addresses/address-transactions.js +36 -0
  49. package/dist/lib/actions/addresses/address-transactions.js.map +1 -0
  50. package/dist/lib/actions/addresses/address-withdrawals.d.ts +4 -0
  51. package/dist/lib/actions/addresses/address-withdrawals.d.ts.map +1 -0
  52. package/dist/lib/actions/addresses/address-withdrawals.js +36 -0
  53. package/dist/lib/actions/addresses/address-withdrawals.js.map +1 -0
  54. package/dist/lib/actions/addresses/addresses.d.ts +2 -0
  55. package/dist/lib/actions/addresses/addresses.d.ts.map +1 -0
  56. package/dist/lib/actions/addresses/addresses.js +30 -0
  57. package/dist/lib/actions/addresses/addresses.js.map +1 -0
  58. package/dist/lib/actions/addresses/index.d.ts +14 -0
  59. package/dist/lib/actions/addresses/index.d.ts.map +1 -0
  60. package/dist/lib/actions/addresses/index.js +19 -0
  61. package/dist/lib/actions/addresses/index.js.map +1 -0
  62. package/dist/lib/actions/blocks/block-by-hash.d.ts +4 -0
  63. package/dist/lib/actions/blocks/block-by-hash.d.ts.map +1 -0
  64. package/dist/lib/actions/blocks/block-by-hash.js +36 -0
  65. package/dist/lib/actions/blocks/block-by-hash.js.map +1 -0
  66. package/dist/lib/actions/blocks/block-transactions.d.ts +4 -0
  67. package/dist/lib/actions/blocks/block-transactions.d.ts.map +1 -0
  68. package/dist/lib/actions/blocks/block-transactions.js +36 -0
  69. package/dist/lib/actions/blocks/block-transactions.js.map +1 -0
  70. package/dist/lib/actions/blocks/block-withdrawals.d.ts +4 -0
  71. package/dist/lib/actions/blocks/block-withdrawals.d.ts.map +1 -0
  72. package/dist/lib/actions/blocks/block-withdrawals.js +36 -0
  73. package/dist/lib/actions/blocks/block-withdrawals.js.map +1 -0
  74. package/dist/lib/actions/blocks/blocks.d.ts +2 -0
  75. package/dist/lib/actions/blocks/blocks.d.ts.map +1 -0
  76. package/dist/lib/actions/blocks/blocks.js +30 -0
  77. package/dist/lib/actions/blocks/blocks.js.map +1 -0
  78. package/dist/lib/actions/blocks/index.d.ts +6 -0
  79. package/dist/lib/actions/blocks/index.d.ts.map +1 -0
  80. package/dist/lib/actions/blocks/index.js +11 -0
  81. package/dist/lib/actions/blocks/index.js.map +1 -0
  82. package/dist/lib/actions/blocks/main-page-blocks.d.ts +2 -0
  83. package/dist/lib/actions/blocks/main-page-blocks.d.ts.map +1 -0
  84. package/dist/lib/actions/blocks/main-page-blocks.js +30 -0
  85. package/dist/lib/actions/blocks/main-page-blocks.js.map +1 -0
  86. package/dist/lib/actions/index.d.ts +7 -0
  87. package/dist/lib/actions/index.d.ts.map +1 -0
  88. package/dist/lib/actions/index.js +12 -0
  89. package/dist/lib/actions/index.js.map +1 -0
  90. package/dist/lib/actions/search/index.d.ts +2 -0
  91. package/dist/lib/actions/search/index.d.ts.map +1 -0
  92. package/dist/lib/actions/search/index.js +7 -0
  93. package/dist/lib/actions/search/index.js.map +1 -0
  94. package/dist/lib/actions/search/search.d.ts +4 -0
  95. package/dist/lib/actions/search/search.d.ts.map +1 -0
  96. package/dist/lib/actions/search/search.js +39 -0
  97. package/dist/lib/actions/search/search.js.map +1 -0
  98. package/dist/lib/actions/search-redirect/check-redirect.d.ts +4 -0
  99. package/dist/lib/actions/search-redirect/check-redirect.d.ts.map +1 -0
  100. package/dist/lib/actions/search-redirect/check-redirect.js +39 -0
  101. package/dist/lib/actions/search-redirect/check-redirect.js.map +1 -0
  102. package/dist/lib/actions/search-redirect/index.d.ts +2 -0
  103. package/dist/lib/actions/search-redirect/index.d.ts.map +1 -0
  104. package/dist/lib/actions/search-redirect/index.js +7 -0
  105. package/dist/lib/actions/search-redirect/index.js.map +1 -0
  106. package/dist/lib/actions/tokens/index.d.ts +7 -0
  107. package/dist/lib/actions/tokens/index.d.ts.map +1 -0
  108. package/dist/lib/actions/tokens/index.js +12 -0
  109. package/dist/lib/actions/tokens/index.js.map +1 -0
  110. package/dist/lib/actions/tokens/token-by-address.d.ts +4 -0
  111. package/dist/lib/actions/tokens/token-by-address.d.ts.map +1 -0
  112. package/dist/lib/actions/tokens/token-by-address.js +36 -0
  113. package/dist/lib/actions/tokens/token-by-address.js.map +1 -0
  114. package/dist/lib/actions/tokens/token-counters.d.ts +4 -0
  115. package/dist/lib/actions/tokens/token-counters.d.ts.map +1 -0
  116. package/dist/lib/actions/tokens/token-counters.js +36 -0
  117. package/dist/lib/actions/tokens/token-counters.js.map +1 -0
  118. package/dist/lib/actions/tokens/token-holders.d.ts +4 -0
  119. package/dist/lib/actions/tokens/token-holders.d.ts.map +1 -0
  120. package/dist/lib/actions/tokens/token-holders.js +36 -0
  121. package/dist/lib/actions/tokens/token-holders.js.map +1 -0
  122. package/dist/lib/actions/tokens/token-instances.d.ts +4 -0
  123. package/dist/lib/actions/tokens/token-instances.d.ts.map +1 -0
  124. package/dist/lib/actions/tokens/token-instances.js +36 -0
  125. package/dist/lib/actions/tokens/token-instances.js.map +1 -0
  126. package/dist/lib/actions/tokens/token-transfers.d.ts +4 -0
  127. package/dist/lib/actions/tokens/token-transfers.d.ts.map +1 -0
  128. package/dist/lib/actions/tokens/token-transfers.js +36 -0
  129. package/dist/lib/actions/tokens/token-transfers.js.map +1 -0
  130. package/dist/lib/actions/tokens/tokens.d.ts +2 -0
  131. package/dist/lib/actions/tokens/tokens.d.ts.map +1 -0
  132. package/dist/lib/actions/tokens/tokens.js +30 -0
  133. package/dist/lib/actions/tokens/tokens.js.map +1 -0
  134. package/dist/lib/actions/transactions/index.d.ts +10 -0
  135. package/dist/lib/actions/transactions/index.d.ts.map +1 -0
  136. package/dist/lib/actions/transactions/index.js +15 -0
  137. package/dist/lib/actions/transactions/index.js.map +1 -0
  138. package/dist/lib/actions/transactions/main-page-transactions.d.ts +2 -0
  139. package/dist/lib/actions/transactions/main-page-transactions.d.ts.map +1 -0
  140. package/dist/lib/actions/transactions/main-page-transactions.js +30 -0
  141. package/dist/lib/actions/transactions/main-page-transactions.js.map +1 -0
  142. package/dist/lib/actions/transactions/transaction-by-hash.d.ts +4 -0
  143. package/dist/lib/actions/transactions/transaction-by-hash.d.ts.map +1 -0
  144. package/dist/lib/actions/transactions/transaction-by-hash.js +36 -0
  145. package/dist/lib/actions/transactions/transaction-by-hash.js.map +1 -0
  146. package/dist/lib/actions/transactions/transaction-internal-transactions.d.ts +4 -0
  147. package/dist/lib/actions/transactions/transaction-internal-transactions.d.ts.map +1 -0
  148. package/dist/lib/actions/transactions/transaction-internal-transactions.js +36 -0
  149. package/dist/lib/actions/transactions/transaction-internal-transactions.js.map +1 -0
  150. package/dist/lib/actions/transactions/transaction-logs.d.ts +4 -0
  151. package/dist/lib/actions/transactions/transaction-logs.d.ts.map +1 -0
  152. package/dist/lib/actions/transactions/transaction-logs.js +36 -0
  153. package/dist/lib/actions/transactions/transaction-logs.js.map +1 -0
  154. package/dist/lib/actions/transactions/transaction-raw-trace.d.ts +4 -0
  155. package/dist/lib/actions/transactions/transaction-raw-trace.d.ts.map +1 -0
  156. package/dist/lib/actions/transactions/transaction-raw-trace.js +36 -0
  157. package/dist/lib/actions/transactions/transaction-raw-trace.js.map +1 -0
  158. package/dist/lib/actions/transactions/transaction-state-changes.d.ts +4 -0
  159. package/dist/lib/actions/transactions/transaction-state-changes.d.ts.map +1 -0
  160. package/dist/lib/actions/transactions/transaction-state-changes.js +36 -0
  161. package/dist/lib/actions/transactions/transaction-state-changes.js.map +1 -0
  162. package/dist/lib/actions/transactions/transaction-summary.d.ts +4 -0
  163. package/dist/lib/actions/transactions/transaction-summary.d.ts.map +1 -0
  164. package/dist/lib/actions/transactions/transaction-summary.js +36 -0
  165. package/dist/lib/actions/transactions/transaction-summary.js.map +1 -0
  166. package/dist/lib/actions/transactions/transaction-token-transfers.d.ts +4 -0
  167. package/dist/lib/actions/transactions/transaction-token-transfers.d.ts.map +1 -0
  168. package/dist/lib/actions/transactions/transaction-token-transfers.js +36 -0
  169. package/dist/lib/actions/transactions/transaction-token-transfers.js.map +1 -0
  170. package/dist/lib/actions/transactions/transactions.d.ts +2 -0
  171. package/dist/lib/actions/transactions/transactions.d.ts.map +1 -0
  172. package/dist/lib/actions/transactions/transactions.js +30 -0
  173. package/dist/lib/actions/transactions/transactions.js.map +1 -0
  174. package/package.json +46 -0
  175. package/src/index.ts +84 -0
  176. package/src/lib/actions/addresses/address-blocks-validated.ts +28 -0
  177. package/src/lib/actions/addresses/address-by-hash.ts +28 -0
  178. package/src/lib/actions/addresses/address-coin-balance-history-by-day.ts +28 -0
  179. package/src/lib/actions/addresses/address-coin-balance-history.ts +28 -0
  180. package/src/lib/actions/addresses/address-counters.ts +28 -0
  181. package/src/lib/actions/addresses/address-internal-transactions.ts +28 -0
  182. package/src/lib/actions/addresses/address-logs.ts +28 -0
  183. package/src/lib/actions/addresses/address-token-balances.ts +28 -0
  184. package/src/lib/actions/addresses/address-token-transfers.ts +28 -0
  185. package/src/lib/actions/addresses/address-tokens.ts +28 -0
  186. package/src/lib/actions/addresses/address-transactions.ts +28 -0
  187. package/src/lib/actions/addresses/address-withdrawals.ts +28 -0
  188. package/src/lib/actions/addresses/addresses.ts +22 -0
  189. package/src/lib/actions/addresses/index.ts +13 -0
  190. package/src/lib/actions/blocks/block-by-hash.ts +28 -0
  191. package/src/lib/actions/blocks/block-transactions.ts +28 -0
  192. package/src/lib/actions/blocks/block-withdrawals.ts +28 -0
  193. package/src/lib/actions/blocks/blocks.ts +22 -0
  194. package/src/lib/actions/blocks/index.ts +5 -0
  195. package/src/lib/actions/blocks/main-page-blocks.ts +22 -0
  196. package/src/lib/actions/index.ts +6 -0
  197. package/src/lib/actions/search/index.ts +1 -0
  198. package/src/lib/actions/search/search.ts +31 -0
  199. package/src/lib/actions/search-redirect/check-redirect.ts +31 -0
  200. package/src/lib/actions/search-redirect/index.ts +1 -0
  201. package/src/lib/actions/tokens/index.ts +6 -0
  202. package/src/lib/actions/tokens/token-by-address.ts +28 -0
  203. package/src/lib/actions/tokens/token-counters.ts +28 -0
  204. package/src/lib/actions/tokens/token-holders.ts +28 -0
  205. package/src/lib/actions/tokens/token-instances.ts +28 -0
  206. package/src/lib/actions/tokens/token-transfers.ts +28 -0
  207. package/src/lib/actions/tokens/tokens.ts +23 -0
  208. package/src/lib/actions/transactions/index.ts +9 -0
  209. package/src/lib/actions/transactions/main-page-transactions.ts +22 -0
  210. package/src/lib/actions/transactions/transaction-by-hash.ts +28 -0
  211. package/src/lib/actions/transactions/transaction-internal-transactions.ts +28 -0
  212. package/src/lib/actions/transactions/transaction-logs.ts +28 -0
  213. package/src/lib/actions/transactions/transaction-raw-trace.ts +28 -0
  214. package/src/lib/actions/transactions/transaction-state-changes.ts +28 -0
  215. package/src/lib/actions/transactions/transaction-summary.ts +28 -0
  216. package/src/lib/actions/transactions/transaction-token-transfers.ts +28 -0
  217. package/src/lib/actions/transactions/transactions.ts +22 -0
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getAddressTokenBalances = createAction({
5
+ name: 'get_address_token_balances',
6
+ displayName: 'Get Address Token Balances',
7
+ description: 'Get list of token balances for an address',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Get the full current token holdings of an address as a flat list of balances. Choose this for a snapshot of what tokens an account holds and how much; use Get Address Token Transfers for movement history or Get Address Tokens for the paginated/filterable variant. Read-only lookup on eth.blockscout.com; requires a 0x address hash.', idempotent: true },
10
+ // category: 'Addresses',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Address Hash',
14
+ description: 'Hash of the address to fetch token balances for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/addresses/${context.propsValue.addressHash}/token-balances`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getAddressTokenTransfers = createAction({
5
+ name: 'get_address_token_transfers',
6
+ displayName: 'Get Address Token Transfers',
7
+ description: 'Get list of token transfers for an address',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the token transfer events (ERC-20/721/1155) in which an address sent or received tokens. Pick this for token movement history; use Get Address Token Balances for current holdings or Get Address Transactions for native-coin transfers. Read-only lookup on eth.blockscout.com; requires a 0x address hash.', idempotent: true },
10
+ // category: 'Addresses',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Address Hash',
14
+ description: 'Hash of the address to fetch token transfers for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/addresses/${context.propsValue.addressHash}/token-transfers`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getAddressTokens = createAction({
5
+ name: 'get_address_tokens',
6
+ displayName: 'Get Address Tokens',
7
+ description: 'Get list of tokens owned by an address with filtering options',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the tokens owned by an address, the paginated/filterable view of its holdings (e.g. by token type). Choose this when iterating through many holdings; use Get Address Token Balances for a simple full snapshot. Read-only lookup on eth.blockscout.com; requires a 0x address hash.', idempotent: true },
10
+ // category: 'Addresses',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Address Hash',
14
+ description: 'Hash of the address to fetch tokens for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/addresses/${context.propsValue.addressHash}/tokens`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getAddressTransactions = createAction({
5
+ name: 'get_address_transactions',
6
+ displayName: 'Get Address Transactions',
7
+ description: 'Get list of transactions for an address',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the top-level transactions in which an address was the sender or receiver. Pick this for an account’s normal transaction history; use Get Address Internal Transactions for contract-internal value moves or Get Address Token Transfers for token movements. Read-only lookup on eth.blockscout.com; requires a 0x address hash.', idempotent: true },
10
+ // category: 'Addresses',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Address Hash',
14
+ description: 'Hash of the address to fetch transactions for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/addresses/${context.propsValue.addressHash}/transactions`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getAddressWithdrawals = createAction({
5
+ name: 'get_address_withdrawals',
6
+ displayName: 'Get Address Withdrawals',
7
+ description: 'Get list of withdrawals for an address',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List beacon-chain (staking) withdrawals credited to an address. Choose this to inspect validator-staking payout history for an account; returns empty for addresses that received no withdrawals. Read-only lookup on eth.blockscout.com; requires a 0x address hash.', idempotent: true },
10
+ // category: 'Addresses',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Address Hash',
14
+ description: 'Hash of the address to fetch withdrawals for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/addresses/${context.propsValue.addressHash}/withdrawals`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,22 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getAddresses = createAction({
5
+ name: 'get_addresses',
6
+ displayName: 'Get Addresses',
7
+ description: 'Get list of native coin holders',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the top native-coin (ETH) holding addresses on the chain, ordered by balance. Pick this to discover or rank wealthy accounts; it takes no input and does not target a specific address (use Get Address by Hash for a single account). Read-only lookup on eth.blockscout.com.', idempotent: true },
10
+ // category: 'Addresses',
11
+ props: {},
12
+ async run(context) {
13
+ const response = await httpClient.sendRequest({
14
+ method: HttpMethod.GET,
15
+ url: `https://eth.blockscout.com/api/v2/addresses`,
16
+ });
17
+ if (response.status !== 200) {
18
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
19
+ }
20
+ return response.body;
21
+ },
22
+ });
@@ -0,0 +1,13 @@
1
+ export * from './addresses';
2
+ export * from './address-by-hash';
3
+ export * from './address-counters';
4
+ export * from './address-transactions';
5
+ export * from './address-token-transfers';
6
+ export * from './address-internal-transactions';
7
+ export * from './address-logs';
8
+ export * from './address-blocks-validated';
9
+ export * from './address-token-balances';
10
+ export * from './address-tokens';
11
+ export * from './address-withdrawals';
12
+ export * from './address-coin-balance-history';
13
+ export * from './address-coin-balance-history-by-day';
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getBlockByHash = createAction({
5
+ name: 'get_block_by_hash',
6
+ displayName: 'Get Block by Hash or Number',
7
+ description: 'Get block info by its hash or block number',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Look up a single Ethereum block by either its hash or its block number and return its details (miner, timestamp, gas, transaction count). Read-only; accepts both identifier forms. Use this when you know which block you want; to browse recent blocks without an identifier use Get Blocks.', idempotent: true },
10
+ // category: 'Blocks',
11
+ props: {
12
+ blockIdentifier: Property.ShortText({
13
+ displayName: 'Block Hash or Number',
14
+ description: 'Block hash or block number to fetch',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/blocks/${context.propsValue.blockIdentifier}`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getBlockTransactions = createAction({
5
+ name: 'get_block_transactions',
6
+ displayName: 'Get Block Transactions',
7
+ description: 'Get list of transactions for a specific block',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the transactions contained in one Ethereum block, identified by its hash or number. Read-only. Use this to scope transactions to a single block; for chain-wide recent transactions use the Transactions Get Transactions action, and for that block\'s staking withdrawals use Get Block Withdrawals.', idempotent: true },
10
+ // category: 'Blocks',
11
+ props: {
12
+ blockIdentifier: Property.ShortText({
13
+ displayName: 'Block Hash or Number',
14
+ description: 'Block hash or block number to fetch transactions for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/blocks/${context.propsValue.blockIdentifier}/transactions`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getBlockWithdrawals = createAction({
5
+ name: 'get_block_withdrawals',
6
+ displayName: 'Get Block Withdrawals',
7
+ description: 'Get list of withdrawals for a specific block',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the validator (beacon-chain) staking withdrawals included in one Ethereum block, identified by its hash or number. Read-only. Use this for post-Merge withdrawal data of a specific block; for the regular transactions in that block use Get Block Transactions instead.', idempotent: true },
10
+ // category: 'Blocks',
11
+ props: {
12
+ blockIdentifier: Property.ShortText({
13
+ displayName: 'Block Hash or Number',
14
+ description: 'Block hash or block number to fetch withdrawals for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/blocks/${context.propsValue.blockIdentifier}/withdrawals`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,22 @@
1
+ import { createAction } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getBlocks = createAction({
5
+ name: 'get_blocks',
6
+ displayName: 'Get Blocks',
7
+ description: 'Get list of blocks',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List recent Ethereum blocks across the chain (newest first), takes no inputs. Read-only. Use this for chain-wide block browsing; to fetch one specific block use Get Block by Hash or Number.', idempotent: true },
10
+ // category: 'Blocks',
11
+ props: {},
12
+ async run(context) {
13
+ const response = await httpClient.sendRequest({
14
+ method: HttpMethod.GET,
15
+ url: `https://eth.blockscout.com/api/v2/blocks`,
16
+ });
17
+ if (response.status !== 200) {
18
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
19
+ }
20
+ return response.body;
21
+ },
22
+ });
@@ -0,0 +1,5 @@
1
+ export * from './blocks';
2
+ export * from './main-page-blocks';
3
+ export * from './block-by-hash';
4
+ export * from './block-transactions';
5
+ export * from './block-withdrawals';
@@ -0,0 +1,22 @@
1
+ import { createAction } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getMainPageBlocks = createAction({
5
+ name: 'get_main_page_blocks',
6
+ displayName: 'Get Main Page Blocks',
7
+ description: 'Get blocks for main page display',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Get the short list of latest blocks shown on the Blockscout explorer home page, takes no inputs. Read-only. Use this for a quick at-a-glance feed of the newest blocks; for a fuller paginated block list use Get Blocks.', idempotent: true },
10
+ // category: 'Blocks',
11
+ props: {},
12
+ async run(context) {
13
+ const response = await httpClient.sendRequest({
14
+ method: HttpMethod.GET,
15
+ url: `https://eth.blockscout.com/api/v2/main-page/blocks`,
16
+ });
17
+ if (response.status !== 200) {
18
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
19
+ }
20
+ return response.body;
21
+ },
22
+ });
@@ -0,0 +1,6 @@
1
+ export * from './search';
2
+ export * from './search-redirect';
3
+ export * from './blocks';
4
+ export * from './transactions';
5
+ export * from './addresses';
6
+ export * from './tokens';
@@ -0,0 +1 @@
1
+ export * from './search';
@@ -0,0 +1,31 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const search = createAction({
5
+ name: 'search',
6
+ displayName: 'Search',
7
+ description: 'Search for addresses, transactions, blocks, or tokens',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Run a free-text search across the chain for addresses, transactions, blocks, and tokens, returning ranked matches. Pick this when you have a name, symbol, or partial identifier and need to resolve it to an entity; use the dedicated by-hash lookups when you already hold an exact hash. Read-only lookup on eth.blockscout.com.', idempotent: true },
10
+ // category: 'Search',
11
+ props: {
12
+ query: Property.ShortText({
13
+ displayName: 'Search Query',
14
+ description: 'Search query for addresses, transactions, blocks, or tokens',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/search`,
22
+ queryParams: {
23
+ q: context.propsValue['query']
24
+ },
25
+ });
26
+ if (response.status !== 200) {
27
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
28
+ }
29
+ return response.body;
30
+ },
31
+ });
@@ -0,0 +1,31 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const checkRedirect = createAction({
5
+ name: 'check_redirect',
6
+ displayName: 'Check Search Redirect',
7
+ description: 'Check if a search query should redirect to a specific resource',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Check whether a search query maps unambiguously to a single resource (address, transaction, block, or token) and should redirect straight to it. Pick this to disambiguate an exact identifier into one entity rather than browsing ranked results from Search. Read-only lookup on eth.blockscout.com.', idempotent: true },
10
+ // category: 'Search',
11
+ props: {
12
+ query: Property.ShortText({
13
+ displayName: 'Search Query',
14
+ description: 'Search query to check for redirect',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/search/check-redirect`,
22
+ queryParams: {
23
+ q: context.propsValue.query
24
+ },
25
+ });
26
+ if (response.status !== 200) {
27
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
28
+ }
29
+ return response.body;
30
+ },
31
+ });
@@ -0,0 +1 @@
1
+ export * from './check-redirect';
@@ -0,0 +1,6 @@
1
+ export * from './tokens';
2
+ export * from './token-by-address';
3
+ export * from './token-transfers';
4
+ export * from './token-holders';
5
+ export * from './token-counters';
6
+ export * from './token-instances';
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getTokenByAddress = createAction({
5
+ name: 'get_token_by_address',
6
+ displayName: 'Get Token by Address',
7
+ description: 'Get token info by its contract address',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Look up the metadata for a single token by its contract address (name, symbol, decimals, type, total supply). Read-only. Use this when you have a specific token contract address; to discover tokens without an address use Get Tokens, and for holder or transfer detail use the dedicated token actions.', idempotent: true },
10
+ // category: 'Tokens',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Token Address',
14
+ description: 'Contract address of the token to fetch info for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/tokens/${context.propsValue.addressHash}`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getTokenCounters = createAction({
5
+ name: 'get_token_counters',
6
+ displayName: 'Get Token Counters',
7
+ description: 'Get token counters (holders count, transfers count, etc.)',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Get aggregate counts for one token by its contract address, such as total number of holders and total transfers. Read-only. Use this when you just need the summary numbers; to enumerate the actual holders or transfers use Get Token Holders or Get Token Transfers instead.', idempotent: true },
10
+ // category: 'Tokens',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Token Address',
14
+ description: 'Contract address of the token to fetch counters for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/tokens/${context.propsValue.addressHash}/counters`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getTokenHolders = createAction({
5
+ name: 'get_token_holders',
6
+ displayName: 'Get Token Holders',
7
+ description: 'Get list of token holders',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the addresses holding one token, identified by its contract address, with their balances (largest holders first). Read-only. Use this to see who owns a token; for just the total holder count use Get Token Counters, and for NFT item IDs use Get Token Instances.', idempotent: true },
10
+ // category: 'Tokens',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Token Address',
14
+ description: 'Contract address of the token to fetch holders for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/tokens/${context.propsValue.addressHash}/holders`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getTokenInstances = createAction({
5
+ name: 'get_token_instances',
6
+ displayName: 'Get Token Instances',
7
+ description: 'Get list of token instances (NFTs)',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List the individual NFT instances (token IDs) minted under one NFT contract, identified by its address. Read-only and only meaningful for ERC-721/1155 collections. Use this to enumerate items in a collection; for fungible token holders use Get Token Holders and for general token info use Get Token by Address.', idempotent: true },
10
+ // category: 'Tokens',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Token Address',
14
+ description: 'Contract address of the token to fetch instances for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/tokens/${context.propsValue.addressHash}/instances`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getTokenTransfers = createAction({
5
+ name: 'get_token_transfers',
6
+ displayName: 'Get Token Transfers',
7
+ description: 'Get list of token transfers',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List recent transfers of one token, identified by its contract address, across all holders (newest first). Read-only. Use this to track movement of a specific token over time; for the token transfers inside a single transaction use the Transactions Get Transaction Token Transfers action instead.', idempotent: true },
10
+ // category: 'Tokens',
11
+ props: {
12
+ addressHash: Property.ShortText({
13
+ displayName: 'Token Address',
14
+ description: 'Contract address of the token to fetch transfers for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/tokens/${context.propsValue.addressHash}/transfers`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });
@@ -0,0 +1,23 @@
1
+ import { createAction } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getTokens = createAction({
5
+ name: 'get_tokens',
6
+ displayName: 'Get Tokens',
7
+ description: 'Get list of tokens',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'List tokens tracked on the chain (ERC-20/721/1155), takes no inputs. Read-only. Use this to browse or discover tokens when you do not have a specific contract address; once you have an address use Get Token by Address for its details.', idempotent: true },
10
+
11
+ // category: 'Tokens',
12
+ props: {},
13
+ async run(context) {
14
+ const response = await httpClient.sendRequest({
15
+ method: HttpMethod.GET,
16
+ url: `https://eth.blockscout.com/api/v2/tokens`,
17
+ });
18
+ if (response.status !== 200) {
19
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
20
+ }
21
+ return response.body;
22
+ },
23
+ });
@@ -0,0 +1,9 @@
1
+ export * from './transactions';
2
+ export * from './main-page-transactions';
3
+ export * from './transaction-by-hash';
4
+ export * from './transaction-token-transfers';
5
+ export * from './transaction-internal-transactions';
6
+ export * from './transaction-logs';
7
+ export * from './transaction-raw-trace';
8
+ export * from './transaction-state-changes';
9
+ export * from './transaction-summary';
@@ -0,0 +1,22 @@
1
+ import { createAction } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getMainPageTransactions = createAction({
5
+ name: 'get_main_page_transactions',
6
+ displayName: 'Get Main Page Transactions',
7
+ description: 'Get transactions for main page display',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Get the short list of latest Ethereum transactions shown on the Blockscout explorer home page. Read-only and takes no inputs. Use this for a quick at-a-glance feed of the most recent activity; for a fuller paginated transaction list use Get Transactions instead.', idempotent: true },
10
+ // category: 'Transactions',
11
+ props: {},
12
+ async run(context) {
13
+ const response = await httpClient.sendRequest({
14
+ method: HttpMethod.GET,
15
+ url: `https://eth.blockscout.com/api/v2/main-page/transactions`,
16
+ });
17
+ if (response.status !== 200) {
18
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
19
+ }
20
+ return response.body;
21
+ },
22
+ });
@@ -0,0 +1,28 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@agnocon/pieces-common';
3
+
4
+ export const getTransactionByHash = createAction({
5
+ name: 'get_transaction_by_hash',
6
+ displayName: 'Get Transaction by Hash',
7
+ description: 'Get transaction details by its hash',
8
+ audience: 'both',
9
+ aiMetadata: { description: 'Look up a single Ethereum transaction by its full hash and return its core details (status, value, gas, from/to, block). Read-only. Use this when you have a specific transaction hash; for the related transfers, logs, internal calls, or state changes of that same transaction use the dedicated per-transaction actions instead.', idempotent: true },
10
+ // category: 'Transactions',
11
+ props: {
12
+ transactionHash: Property.ShortText({
13
+ displayName: 'Transaction Hash',
14
+ description: 'Hash of the transaction to fetch details for',
15
+ required: true,
16
+ }),
17
+ },
18
+ async run(context) {
19
+ const response = await httpClient.sendRequest({
20
+ method: HttpMethod.GET,
21
+ url: `https://eth.blockscout.com/api/v2/transactions/${context.propsValue.transactionHash}`,
22
+ });
23
+ if (response.status !== 200) {
24
+ throw new Error(`Blockscout API request failed with status ${response.status}`);
25
+ }
26
+ return response.body;
27
+ },
28
+ });