From 37c5ed1b5e4608cf8b80b3e06c726aadfa4f0db6 Mon Sep 17 00:00:00 2001 From: ArielElp Date: Mon, 29 May 2023 18:01:45 +0300 Subject: [PATCH 1/3] add starknet_estimateMessageFee endpoint --- api/starknet_api_openrpc.json | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index cc4d8b8..b098303 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -536,6 +536,56 @@ } ] }, + { + "name": "starknet_estimateMessageFee", + "summary": "estimate the L2 fee of a message sent on L1", + "description": "estimates the resources required by the l1_handler transaction induced by the message", + "params": [ + { + "name": "message", + "description": "the message's parameters", + "schema": { + "$ref": "#/components/schemas/FUNCTION_CALL" + }, + "required": true + }, + { + "name": "sender_address", + "description": "the L1 address of the sender", + "schema": { + "$ref": "#/components/schemas/ETH_ADDRESS" + }, + "required": true + }, + { + "name": "block_id", + "description": "The hash of the requested block, or number (height) of the requested block, or a block tag, for the block referencing the state or call the transaction on.", + "required": true, + "schema": { + "title": "Block id", + "$ref": "#/components/schemas/BLOCK_ID" + } + } + ], + "result": { + "name": "result", + "description": "the fee estimation", + "schema": { + "$ref": "#/components/schemas/FEE_ESTIMATE" + } + }, + "errors": [ + { + "$ref": "#/components/errors/CONTRACT_NOT_FOUND" + }, + { + "$ref": "#/components/errors/CONTRACT_ERROR" + }, + { + "$ref": "#/components/errors/BLOCK_NOT_FOUND" + } + ] + }, { "name": "starknet_blockNumber", "summary": "Get the most recent accepted block number", From bd5ea0055c8eab7caf6a1fa5e75d1da7063291ef Mon Sep 17 00:00:00 2001 From: ArielElp Date: Wed, 21 Jun 2023 10:27:06 +0300 Subject: [PATCH 2/3] create msg_from_l1 type --- api/starknet_api_openrpc.json | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index b098303..859181f 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -545,7 +545,7 @@ "name": "message", "description": "the message's parameters", "schema": { - "$ref": "#/components/schemas/FUNCTION_CALL" + "$ref": "#/components/schemas/MSG_FROM_L1" }, "required": true }, @@ -2357,6 +2357,34 @@ "payload" ] }, + "MSG_FROM_L1": { + "title": "Message from L1", + "type": "object", + "properties": { + "from_address": { + "description": "The address of the L1 contract sending the message", + "$ref": "#/components/schemas/ETH_ADDRESS" + }, + "to_address": { + "title": "To address", + "description": "The target L2 address the message is sent to", + "$ref": "#/components/schemas/ADDRESS" + }, + "payload": { + "description": "The payload of the message", + "title": "Payload", + "type": "array", + "items": { + "$ref": "#/components/schemas/FELT" + } + } + }, + "required": [ + "from_address", + "to_address", + "payload" + ] + }, "TXN_STATUS": { "title": "Transaction status", "type": "string", From 0d1eb908d82e9da2bc8f1c912ed870e633fb7e4d Mon Sep 17 00:00:00 2001 From: ArielElp Date: Thu, 6 Jul 2023 08:30:32 +0300 Subject: [PATCH 3/3] remove redundant field --- api/starknet_api_openrpc.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index 859181f..af92bf7 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -549,14 +549,6 @@ }, "required": true }, - { - "name": "sender_address", - "description": "the L1 address of the sender", - "schema": { - "$ref": "#/components/schemas/ETH_ADDRESS" - }, - "required": true - }, { "name": "block_id", "description": "The hash of the requested block, or number (height) of the requested block, or a block tag, for the block referencing the state or call the transaction on.",