From a3e095b51b7e0aec455a60147ebee1b422508d30 Mon Sep 17 00:00:00 2001 From: Elad Gildnur <6321801+shleikes@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:26:08 +0300 Subject: [PATCH] feat: PRT - Add the TON spec (#1710) * Add the TON spec * add verification * CR Fix: Update stateful to 1 --------- Co-authored-by: Yarom Swisa Co-authored-by: Yaroms <103432884+Yaroms@users.noreply.github.com> --- cookbook/specs/ton.json | 538 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 538 insertions(+) create mode 100644 cookbook/specs/ton.json diff --git a/cookbook/specs/ton.json b/cookbook/specs/ton.json new file mode 100644 index 0000000000..33800d77f8 --- /dev/null +++ b/cookbook/specs/ton.json @@ -0,0 +1,538 @@ +{ + "proposal": { + "title": "Add Specs: Ton", + "description": "Adding new specification support for relaying Ton data on Lava", + "specs": [ + { + "index": "TON", + "name": "ton mainnet", + "enabled": true, + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 2, + "blocks_in_finalization_proof": 3, + "average_block_time": 4500, + "allowed_block_lag_for_qos_sync": 3, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "GET", + "add_on": "" + }, + "apis": [ + { + "name": "/api/v3/masterchainInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/blocks", + "block_parsing": { + "parser_arg": [ + "0", + "seqno" + ], + "parser_func": "PARSE_CANONICAL" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0, + "parsers": [ + { + "parse_path": ".params.seqno", + "parse_type": "BLOCK_LATEST" + } + ] + }, + { + "name": "/api/v3/masterchainBlockShardState", + "block_parsing": { + "parser_arg": [ + "0", + "seqno" + ], + "parser_func": "PARSE_CANONICAL" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0, + "parsers": [ + { + "parse_path": ".params.seqno", + "parse_type": "BLOCK_LATEST" + } + ] + }, + { + "name": "/api/v3/addressBook", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/masterchainBlockShards", + "block_parsing": { + "parser_arg": [ + "0", + "seqno" + ], + "parser_func": "PARSE_CANONICAL" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0, + "parsers": [ + { + "parse_path": ".params.seqno", + "parse_type": "BLOCK_LATEST" + } + ] + }, + { + "name": "/api/v3/transactions", + "block_parsing": { + "parser_arg": [ + "0", + "seqno" + ], + "parser_func": "PARSE_CANONICAL" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0, + "parsers": [ + { + "parse_path": ".params.seqno", + "parse_type": "BLOCK_LATEST" + } + ] + }, + { + "name": "/api/v3/transactionsByMasterchainBlock", + "block_parsing": { + "parser_arg": [ + "0", + "seqno" + ], + "parser_func": "PARSE_CANONICAL" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0, + "parsers": [ + { + "parse_path": ".params.seqno", + "parse_type": "BLOCK_LATEST" + } + ] + }, + { + "name": "/api/v3/transactionsByMessage", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/adjacentTransactions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/messages", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/nft/collections", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/nft/items", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/nft/transfers", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/jetton/masters", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/jetton/wallets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/jetton/transfers", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/jetton/burns", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/account", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/wallet", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [ + { + "function_template": "/api/v3/masterchainInfo", + "function_tag": "GET_BLOCKNUM", + "result_parsing": { + "parser_arg": [ + "0", + "last", + "seqno" + ], + "parser_func": "PARSE_CANONICAL" + }, + "api_name": "/api/v3/masterchainInfo" + }, + { + "function_template": "/api/v3/blocks?workchain=-1&shard=8000000000000000&seqno=%d", + "function_tag": "GET_BLOCK_BY_NUM", + "result_parsing": { + "parser_arg": [ + "0", + "blocks", + "0", + "seqno" + ], + "parser_func": "PARSE_CANONICAL" + }, + "api_name": "/api/v3/blocks" + } + ], + "verifications": [ + { + "name": "chain-id", + "parse_directive": { + "function_template": "/api/v3/masterchainInfo", + "function_tag": "VERIFICATION", + "result_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_CANONICAL" + }, + "api_name": "/api/v3/masterchainInfo" + }, + "values": [ + { + "expected_value": "*" + } + ] + } + ], + "extensions": [] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "POST", + "add_on": "" + }, + "apis": [ + { + "name": "/api/v3/message", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 1 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/runGetMethod", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/api/v3/estimateFee", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [], + "extensions": [] + } + ] + } + ] + }, + "deposit": "10000000ulava" +} \ No newline at end of file