cache transaction and receipt data in sqlite

This commit is contained in:
2026-05-16 21:09:22 +08:00
parent 49ada2febd
commit 6b7a773845
6 changed files with 676 additions and 3 deletions
@@ -0,0 +1,467 @@
{
"version": "7",
"dialect": "sqlite",
"id": "3271a353-c528-4d23-a2ff-9be22f763b9d",
"prevIds": [
"2845d968-33cd-48b6-8944-03e0e46a4a90"
],
"ddl": [
{
"name": "token_metadata",
"entityType": "tables"
},
{
"name": "transaction_receipts",
"entityType": "tables"
},
{
"name": "transactions",
"entityType": "tables"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "name",
"entityType": "columns",
"table": "token_metadata"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "symbol",
"entityType": "columns",
"table": "token_metadata"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "decimals",
"entityType": "columns",
"table": "token_metadata"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "logo",
"entityType": "columns",
"table": "token_metadata"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "contractAddress",
"entityType": "columns",
"table": "token_metadata"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "chainId",
"entityType": "columns",
"table": "token_metadata"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "transactionHash",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "chainId",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "blockHash",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "blockNumber",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "from",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "to",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "cumulativeGasUsed",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "gasUsed",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "status",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "effectiveGasPrice",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "contractAddress",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "type",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "transactionIndex",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "logsBloom",
"entityType": "columns",
"table": "transaction_receipts"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "hash",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "chainId",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "from",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "to",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "value",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "blockNumber",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "blockHash",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "gas",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "gasPrice",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "maxFeePerGas",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "maxPriorityFeePerGas",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "input",
"entityType": "columns",
"table": "transactions"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "nonce",
"entityType": "columns",
"table": "transactions"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "transactionIndex",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "type",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "v",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "r",
"entityType": "columns",
"table": "transactions"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "s",
"entityType": "columns",
"table": "transactions"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "yParity",
"entityType": "columns",
"table": "transactions"
},
{
"columns": [
{
"value": "chainId",
"isExpression": false
},
{
"value": "contractAddress",
"isExpression": false
}
],
"isUnique": true,
"where": null,
"origin": "manual",
"name": "contract_unique",
"entityType": "indexes",
"table": "token_metadata"
},
{
"columns": [
{
"value": "chainId",
"isExpression": false
},
{
"value": "transactionHash",
"isExpression": false
}
],
"isUnique": true,
"where": null,
"origin": "manual",
"name": "receipt_unique",
"entityType": "indexes",
"table": "transaction_receipts"
},
{
"columns": [
{
"value": "chainId",
"isExpression": false
},
{
"value": "hash",
"isExpression": false
}
],
"isUnique": true,
"where": null,
"origin": "manual",
"name": "tx_unique",
"entityType": "indexes",
"table": "transactions"
}
],
"renames": []
}