From 7275cc3105cbce180cf44fe09d33b98ad67c360e Mon Sep 17 00:00:00 2001 From: nils-mathieu Date: Mon, 6 Nov 2023 17:26:26 +0100 Subject: [PATCH] update to the latest version of the spec --- crates/starknet-types-rpc/Cargo.toml | 2 +- .../src/v0_5_0/starknet_api_openrpc.json | 360 ++++++++++++++++-- .../src/v0_5_0/starknet_api_openrpc.rs | 102 +++-- .../src/v0_5_0/starknet_api_openrpc.toml | 17 +- .../v0_5_0/starknet_trace_api_openrpc.json | 6 +- .../src/v0_5_0/starknet_trace_api_openrpc.rs | 6 +- .../v0_5_0/starknet_trace_api_openrpc.toml | 4 +- .../src/v0_5_0/starknet_write_api.json | 7 +- 8 files changed, 434 insertions(+), 70 deletions(-) diff --git a/crates/starknet-types-rpc/Cargo.toml b/crates/starknet-types-rpc/Cargo.toml index 3ec2808..38ae114 100644 --- a/crates/starknet-types-rpc/Cargo.toml +++ b/crates/starknet-types-rpc/Cargo.toml @@ -16,7 +16,7 @@ default = ["std"] std = ["serde/std", "starknet-types-core/std"] [dependencies] -starknet-types-core = { path = "../starknet-types-core", default-features = false } +starknet-types-core = { path = "../starknet-types-core", default-features = false, features = ["serde"] } serde = { version = "1", default-features = false, features = ["derive"] } [dev-dependencies] diff --git a/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.json b/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.json index bd39abe..da88bf0 100644 --- a/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.json +++ b/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.json @@ -1,7 +1,7 @@ { "openrpc": "1.0.0-rc1", "info": { - "version": "0.5.0", + "version": "0.6.0", "title": "StarkNet Node API", "license": {} }, @@ -1643,6 +1643,10 @@ { "title": "Declare transaction V2", "$ref": "#/components/schemas/DECLARE_TXN_V2" + }, + { + "title": "Declare transaction V3", + "$ref": "#/components/schemas/DECLARE_TXN_V3" } ] }, @@ -1676,7 +1680,8 @@ "description": "Version of the transaction scheme", "type": "string", "enum": [ - "0x0" + "0x0", + "0x100000000000000000000000000000000" ] }, "signature": { @@ -1730,7 +1735,8 @@ "description": "Version of the transaction scheme", "type": "string", "enum": [ - "0x1" + "0x0", + "0x100000000000000000000000000000001" ] }, "signature": { @@ -1794,7 +1800,8 @@ "description": "Version of the transaction scheme", "type": "string", "enum": [ - "0x2" + "0x2", + "0x100000000000000000000000000000002" ] }, "signature": { @@ -1824,6 +1831,72 @@ } ] }, + "DECLARE_TXN_V3": { + "title": "Declare Transaction V3", + "description": "Declare Contract Transaction V3", + "allOf": [ + { + "type": "object", + "title": "Declare txn v3", + "properties": { + "type": { + "title": "Declare", + "type": "string", + "enum": [ + "DECLARE" + ] + }, + "sender_address": { + "title": "Sender address", + "description": "The address of the account contract sending the declaration transaction", + "$ref": "#/components/schemas/ADDRESS" + }, + "compiled_class_hash": { + "title": "Compiled class hash", + "description": "The hash of the Cairo assembly resulting from the Sierra compilation", + "$ref": "#/components/schemas/FELT" + }, + "version": { + "title": "Version", + "description": "Version of the transaction scheme", + "type": "string", + "enum": [ + "0x3", + "0x100000000000000000000000000000003" + ] + }, + "signature": { + "title": "Signature", + "$ref": "#/components/schemas/SIGNATURE" + }, + "nonce": { + "title": "Nonce", + "$ref": "#/components/schemas/FELT" + }, + "class_hash": { + "title": "Class hash", + "description": "The hash of the declared class", + "$ref": "#/components/schemas/FELT" + }, + "l1_gas": { + "title": "L1 Gas", + "description": "The max amount and max price per unit of L1 gas used in this tx", + "$ref": "#/components/schemas/RESOURCE_LIMITS" + } + }, + "required": [ + "type", + "sender_address", + "compiled_class_hash", + "version", + "signature", + "nonce", + "class_hash", + "l1_gas" + ] + } + ] + }, "BROADCASTED_TXN": { "oneOf": [ { @@ -1839,16 +1912,7 @@ }, "BROADCASTED_INVOKE_TXN": { "title": "Broadcasted invoke transaction", - "oneOf": [ - { - "title": "Broadcasted invoke transaction V0", - "$ref": "#/components/schemas/INVOKE_TXN_V0" - }, - { - "title": "Broadcasted invoke transaction V1", - "$ref": "#/components/schemas/INVOKE_TXN_V1" - } - ] + "$ref": "#/components/schemas/INVOKE_TXN" }, "BROADCASTED_DEPLOY_ACCOUNT_TXN": { "title": "Broadcasted deploy account transaction", @@ -1864,6 +1928,10 @@ { "title": "Broadcasted declare transaction V2", "$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN_V2" + }, + { + "title": "Broadcasted declare transaction V3", + "$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN_V3" } ] }, @@ -1894,7 +1962,11 @@ "version": { "title": "Version", "description": "Version of the transaction scheme", - "$ref": "#/components/schemas/NUM_AS_HEX" + "type": "string", + "enum": [ + "0x1", + "0x100000000000000000000000000000001" + ] }, "signature": { "title": "Signature", @@ -1955,7 +2027,11 @@ "version": { "title": "Version", "description": "Version of the transaction scheme", - "$ref": "#/components/schemas/NUM_AS_HEX" + "type": "string", + "enum": [ + "0x2", + "0x100000000000000000000000000000002" + ] }, "signature": { "title": "Signature", @@ -1984,6 +2060,72 @@ } ] }, + "BROADCASTED_DECLARE_TXN_V3": { + "title": "Broadcasted declare Transaction V3", + "description": "Broadcasted declare Contract Transaction V3", + "allOf": [ + { + "type": "object", + "title": "Declare txn v3", + "properties": { + "type": { + "title": "Declare", + "type": "string", + "enum": [ + "DECLARE" + ] + }, + "sender_address": { + "title": "Sender address", + "description": "The address of the account contract sending the declaration transaction", + "$ref": "#/components/schemas/ADDRESS" + }, + "compiled_class_hash": { + "title": "Compiled class hash", + "description": "The hash of the Cairo assembly resulting from the Sierra compilation", + "$ref": "#/components/schemas/FELT" + }, + "version": { + "title": "Version", + "description": "Version of the transaction scheme", + "type": "string", + "enum": [ + "0x3", + "0x100000000000000000000000000000003" + ] + }, + "signature": { + "title": "Signature", + "$ref": "#/components/schemas/SIGNATURE" + }, + "nonce": { + "title": "Nonce", + "$ref": "#/components/schemas/FELT" + }, + "contract_class": { + "title": "Contract class", + "description": "The class to be declared", + "$ref": "#/components/schemas/CONTRACT_CLASS" + }, + "l1_gas": { + "title": "L1 Gas", + "description": "The max amount and max price per unit of L1 gas used in this tx", + "$ref": "#/components/schemas/RESOURCE_LIMITS" + } + }, + "required": [ + "type", + "sender_address", + "compiled_class_hash", + "version", + "signature", + "nonce", + "contract_class", + "l1_gas" + ] + } + ] + }, "DEPLOY_ACCOUNT_TXN": { "title": "Deploy account transaction", "description": "deploys a new account contract", @@ -1991,6 +2133,10 @@ { "title": "Deploy account V1", "$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_V1" + }, + { + "title": "Deploy account V3", + "$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_V3" } ] }, @@ -2014,7 +2160,11 @@ "version": { "title": "Version", "description": "Version of the transaction scheme", - "$ref": "#/components/schemas/NUM_AS_HEX" + "type": "string", + "enum": [ + "0x1", + "0x100000000000000000000000000000001" + ] }, "signature": { "title": "Signature", @@ -2054,6 +2204,70 @@ "class_hash" ] }, + "DEPLOY_ACCOUNT_TXN_V3": { + "title": "Deploy account transaction", + "description": "Deploys an account contract, charges fee from the pre-funded account addresses", + "type": "object", + "properties": { + "type": { + "title": "Deploy account", + "type": "string", + "enum": [ + "DEPLOY_ACCOUNT" + ] + }, + "version": { + "title": "Version", + "description": "Version of the transaction scheme", + "type": "string", + "enum": [ + "0x3", + "0x100000000000000000000000000000003" + ] + }, + "signature": { + "title": "Signature", + "$ref": "#/components/schemas/SIGNATURE" + }, + "nonce": { + "title": "Nonce", + "$ref": "#/components/schemas/FELT" + }, + "contract_address_salt": { + "title": "Contract address salt", + "description": "The salt for the address of the deployed contract", + "$ref": "#/components/schemas/FELT" + }, + "constructor_calldata": { + "type": "array", + "description": "The parameters passed to the constructor", + "title": "Constructor calldata", + "items": { + "$ref": "#/components/schemas/FELT" + } + }, + "class_hash": { + "title": "Class hash", + "description": "The hash of the deployed contract's class", + "$ref": "#/components/schemas/FELT" + }, + "l1_gas": { + "title": "L1 Gas", + "description": "The max amount and max price per unit of L1 gas used in this tx", + "$ref": "#/components/schemas/RESOURCE_LIMITS" + } + }, + "required": [ + "version", + "signature", + "nonce", + "type", + "contract_address_salt", + "constructor_calldata", + "class_hash", + "l1_gas" + ] + }, "DEPLOY_TXN": { "title": "Deploy Contract Transaction", "description": "The structure of a deploy transaction. Note that this transaction type is deprecated and will no longer be supported in future versions", @@ -2125,7 +2339,8 @@ "description": "Version of the transaction scheme", "type": "string", "enum": [ - "0x0" + "0x0", + "0x100000000000000000000000000000000" ] }, "signature": { @@ -2193,7 +2408,11 @@ "version": { "title": "Version", "description": "Version of the transaction scheme", - "$ref": "#/components/schemas/NUM_AS_HEX" + "type": "string", + "enum": [ + "0x1", + "0x100000000000000000000000000000001" + ] }, "signature": { "title": "Signature", @@ -2216,6 +2435,67 @@ } ] }, + "INVOKE_TXN_V3": { + "title": "Invoke transaction V3", + "description": "initiates a transaction from a given account", + "allOf": [ + { + "type": "object", + "properties": { + "type": { + "title": "Type", + "type": "string", + "enum": [ + "INVOKE" + ] + }, + "sender_address": { + "title": "sender address", + "$ref": "#/components/schemas/ADDRESS" + }, + "calldata": { + "type": "array", + "title": "calldata", + "description": "The data expected by the account's `execute` function (in most usecases, this includes the called contract address and a function selector)", + "items": { + "$ref": "#/components/schemas/FELT" + } + }, + "version": { + "title": "Version", + "description": "Version of the transaction scheme", + "type": "string", + "enum": [ + "0x3", + "0x100000000000000000000000000000003" + ] + }, + "signature": { + "title": "Signature", + "$ref": "#/components/schemas/SIGNATURE" + }, + "nonce": { + "title": "Nonce", + "$ref": "#/components/schemas/FELT" + }, + "l1_gas": { + "title": "L1 Gas", + "description": "The max amount and max price per unit of L1 gas used in this tx", + "$ref": "#/components/schemas/RESOURCE_LIMITS" + } + }, + "required": [ + "type", + "sender_address", + "calldata", + "version", + "signature", + "nonce", + "l1_gas" + ] + } + ] + }, "INVOKE_TXN": { "title": "Invoke transaction", "description": "Initiate a transaction from an account", @@ -2227,6 +2507,10 @@ { "title": "Invoke transaction V1", "$ref": "#/components/schemas/INVOKE_TXN_V1" + }, + { + "title": "Invoke transaction V3", + "$ref": "#/components/schemas/INVOKE_TXN_V3" } ] }, @@ -2280,7 +2564,7 @@ }, "actual_fee": { "title": "Actual fee", - "$ref": "#/components/schemas/FELT", + "$ref": "#/components/schemas/FEE_PAYMENT", "description": "The fee that was charged by the sequencer" }, "execution_status": { @@ -2653,13 +2937,9 @@ }, "actual_fee": { "title": "Actual fee", - "$ref": "#/components/schemas/FELT", + "$ref": "#/components/schemas/FEE_PAYMENT", "description": "The fee that was charged by the sequencer" }, - "type": { - "title": "Transaction type", - "$ref": "#/components/schemas/TXN_TYPE" - }, "messages_sent": { "type": "array", "title": "Messages sent", @@ -2702,7 +2982,6 @@ "required": [ "transaction_hash", "actual_fee", - "type", "messages_sent", "events", "finality_status", @@ -3229,6 +3508,30 @@ "overall_fee" ] }, + "FEE_PAYMENT": { + "title": "Fee Payment", + "description": "fee payment info as it appears in receipts", + "type": "object", + "properties": { + "amount": { + "title": "Amunt", + "description": "amount paid", + "$ref": "#/components/schemas/FELT" + }, + "unit": { + "title": "fee unit", + "type": "string", + "enum": [ + "WEI", + "STRK" + ] + } + }, + "required": [ + "amount", + "unit" + ] + }, "DA_MODE": { "title": "DA mode", "type": "string", @@ -3272,7 +3575,8 @@ } }, "required": [ - "price_in_wei" + "price_in_wei", + "price_in_strk" ] }, "EXECUTION_RESOURCES": { @@ -3397,4 +3701,4 @@ } } } -} +} \ No newline at end of file diff --git a/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.rs b/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.rs index 2b4c97f..f840fa6 100644 --- a/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.rs +++ b/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.rs @@ -8,10 +8,10 @@ // https://github.com/nils-mathieu/openrpc-gen // -use crate::custom_serde::NumAsHex; -use crate::{ +use super::{ BlockId, BroadcastedDeclareTxn, BroadcastedDeployAccountTxn, BroadcastedInvokeTxn, Felt, }; +use crate::custom_serde::NumAsHex; use alloc::string::String; use alloc::vec::Vec; use serde::ser::SerializeMap; @@ -135,7 +135,7 @@ pub type ChainId = u64; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CommonReceiptProperties { /// The fee that was charged by the sequencer - pub actual_fee: Felt, + pub actual_fee: FeePayment, pub block_hash: BlockHash, pub block_number: BlockNumber, /// The events emitted as part of this transaction @@ -211,6 +211,8 @@ pub enum DeclareTxn { V1(DeclareTxnV1), #[serde(rename = "0x2")] V2(DeclareTxnV2), + #[serde(rename = "0x3")] + V3(DeclareTxnV3), } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -256,6 +258,20 @@ pub struct DeclareTxnV2 { pub signature: Signature, } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DeclareTxnV3 { + /// The hash of the declared class + pub class_hash: Felt, + /// The hash of the Cairo assembly resulting from the Sierra compilation + pub compiled_class_hash: Felt, + /// The max amount and max price per unit of L1 gas used in this tx + pub l1_gas: ResourceLimits, + pub nonce: Felt, + /// The address of the account contract sending the declaration transaction + pub sender_address: Address, + pub signature: Signature, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DeployedContractItem { /// The address of the contract @@ -269,7 +285,9 @@ pub struct DeployedContractItem { #[serde(tag = "version")] pub enum DeployAccountTxn { #[serde(rename = "0x1")] - DeployAccountV1(DeployAccountTxnV1), + V1(DeployAccountTxnV1), + #[serde(rename = "0x3")] + V3(DeployAccountTxnV3), } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -295,6 +313,21 @@ pub struct DeployAccountTxnV1 { pub signature: Signature, } +/// Deploys an account contract, charges fee from the pre-funded account addresses +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DeployAccountTxnV3 { + /// The hash of the deployed contract's class + pub class_hash: Felt, + /// The parameters passed to the constructor + pub constructor_calldata: Vec, + /// The salt for the address of the deployed contract + pub contract_address_salt: Felt, + /// The max amount and max price per unit of L1 gas used in this tx + pub l1_gas: ResourceLimits, + pub nonce: Felt, + pub signature: Signature, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DeployTxn { /// The hash of the deployed contract's class @@ -432,6 +465,22 @@ pub struct FeeEstimate { pub overall_fee: u64, } +/// fee payment info as it appears in receipts +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct FeePayment { + /// amount paid + pub amount: Felt, + pub unit: FeeUnit, +} + +#[derive(Serialize, Deserialize, Copy, PartialEq, Eq, Hash, Clone, Debug)] +pub enum FeeUnit { + #[serde(rename = "STRK")] + Strk, + #[serde(rename = "WEI")] + Wei, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct FunctionAbiEntry { pub inputs: Vec, @@ -474,6 +523,8 @@ pub enum InvokeTxn { V0(InvokeTxnV0), #[serde(rename = "0x1")] V1(InvokeTxnV1), + #[serde(rename = "0x3")] + V3(InvokeTxnV3), } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -505,6 +556,17 @@ pub struct InvokeTxnV1 { pub signature: Signature, } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InvokeTxnV3 { + /// The data expected by the account's `execute` function (in most usecases, this includes the called contract address and a function selector) + pub calldata: Vec, + /// The max amount and max price per unit of L1 gas used in this tx + pub l1_gas: ResourceLimits, + pub nonce: Felt, + pub sender_address: Address, + pub signature: Signature, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct L1HandlerTxn { /// The L1->L2 message nonce field of the SN Core L1 contract at the time the transaction was sent @@ -584,7 +646,7 @@ pub struct PendingBlockWithTxHashes { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PendingCommonReceiptProperties { /// The fee that was charged by the sequencer - pub actual_fee: Felt, + pub actual_fee: FeePayment, /// The events emitted as part of this transaction pub events: Vec, /// The resources consumed by the transaction @@ -598,8 +660,6 @@ pub struct PendingCommonReceiptProperties { pub revert_reason: Option, /// The hash identifying the transaction pub transaction_hash: TxnHash, - #[serde(rename = "type")] - pub ty: TxnType, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -653,12 +713,21 @@ pub enum PendingTxnReceipt { DeployAccount(PendingDeployAccountTxnReceipt), } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ResourceLimits { + /// the max amount of the resource that can be used in the tx + #[serde(with = "NumAsHex")] + pub max_amount: u64, + /// the max price per unit of this resource for this tx + #[serde(with = "NumAsHex")] + pub max_price_per_unit: u64, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ResourcePrice { /// the price of one unit of the given resource, denominated in strk - #[serde(default)] #[serde(with = "NumAsHex")] - pub price_in_strk: Option, + pub price_in_strk: u64, /// the price of one unit of the given resource, denominated in wei #[serde(with = "NumAsHex")] pub price_in_wei: u64, @@ -835,21 +904,6 @@ pub enum TxnStatus { Rejected, } -/// The type of the transaction -#[derive(Serialize, Deserialize, Copy, PartialEq, Eq, Hash, Clone, Debug)] -pub enum TxnType { - #[serde(rename = "DECLARE")] - Declare, - #[serde(rename = "DEPLOY")] - Deploy, - #[serde(rename = "DEPLOY_ACCOUNT")] - DeployAccount, - #[serde(rename = "INVOKE")] - Invoke, - #[serde(rename = "L1_HANDLER")] - L1Handler, -} - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TypedParameter { /// The parameter's name diff --git a/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.toml b/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.toml index 8f434ae..f78a455 100644 --- a/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.toml +++ b/crates/starknet-types-rpc/src/v0_5_0/starknet_api_openrpc.toml @@ -72,16 +72,21 @@ preserve = [ "#/components/schemas/TXN" = "type" "#/components/schemas/TXN_RECEIPT" = "type" "#/components/schemas/PENDING_TXN_RECEIPT" = "type" -"#/components/schemas/BROADCASTED_TXN" = "type" "#/components/schemas/DEPLOY_ACCOUNT_TXN" = "version" -"#/components/schemas/BROADCASTED_DECLARE_TXN" = "version" -"#/components/schemas/BROADCASTED_INVOKE_TXN" = "version" +"#/components/schemas/BROADCASTED_TXN" = "type" -[fixes.make-keyword] -"#/components/schemas/INVOKE_TXN_V1/_anon/version" = "0x1" -"#/components/schemas/DEPLOY_ACCOUNT_TXN_V1/version" = "0x1" +[fixes.set-tags] "#/components/schemas/BROADCASTED_DECLARE_TXN_V1/_anon/version" = "0x1" "#/components/schemas/BROADCASTED_DECLARE_TXN_V2/_anon/version" = "0x2" +"#/components/schemas/INVOKE_TXN_V0/version" = "0x0" +"#/components/schemas/INVOKE_TXN_V1/_anon/version" = "0x1" +"#/components/schemas/INVOKE_TXN_V3/_anon/version" = "0x3" +"#/components/schemas/DECLARE_TXN_V0/_anon/version" = "0x0" +"#/components/schemas/DECLARE_TXN_V1/_anon/version" = "0x1" +"#/components/schemas/DECLARE_TXN_V2/_anon/version" = "0x2" +"#/components/schemas/DECLARE_TXN_V3/_anon/version" = "0x3" +"#/components/schemas/DEPLOY_ACCOUNT_TXN_V1/version" = "0x1" +"#/components/schemas/DEPLOY_ACCOUNT_TXN_V3/version" = "0x3" [primitives] integer = "u64" \ No newline at end of file diff --git a/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.json b/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.json index 62d313f..9b45605 100644 --- a/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.json +++ b/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.json @@ -398,7 +398,7 @@ "order": { "title": "order", "description": "the order of the event within the transaction", - "type": "number" + "type": "integer" } } }, @@ -418,7 +418,7 @@ "order": { "title": "order", "description": "the order of the message within the transaction", - "type": "number" + "type": "integer" } } }, @@ -480,7 +480,7 @@ }, "BLOCK_NOT_FOUND": { "code": 24, - "message": "Invalid block hash" + "message": "Block not found" }, "CONTRACT_ERROR": { "code": 40, diff --git a/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.rs b/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.rs index 1f68759..413edf0 100644 --- a/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.rs +++ b/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.rs @@ -11,6 +11,8 @@ use super::{ BlockId, BroadcastedTxn, Event, FeeEstimate, Felt, FunctionCall, MsgToL1, StateDiff, TxnHash, }; +use alloc::string::String; +use alloc::vec::Vec; use serde::ser::SerializeMap; use serde::{Deserialize, Serialize}; @@ -59,7 +61,7 @@ pub type NestedCall = FunctionInvocation; pub struct OrderedEvent { /// the order of the event within the transaction #[serde(default)] - pub order: Option, + pub order: Option, #[serde(flatten)] pub event: Event, } @@ -69,7 +71,7 @@ pub struct OrderedEvent { pub struct OrderedMessage { /// the order of the message within the transaction #[serde(default)] - pub order: Option, + pub order: Option, #[serde(flatten)] pub msg_to_l_1: MsgToL1, } diff --git a/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.toml b/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.toml index 578fe9c..07a0164 100644 --- a/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.toml +++ b/crates/starknet-types-rpc/src/v0_5_0/starknet_trace_api_openrpc.toml @@ -3,7 +3,9 @@ run-rustfmt = true [generation] additional-imports = [ - "super::{Felt, FunctionCall, Event, MsgToL1, BlockId, FeeEstimate, BroadcastedTxn, StateDiff, TxnHash}" + "super::{Felt, FunctionCall, Event, MsgToL1, BlockId, FeeEstimate, BroadcastedTxn, StateDiff, TxnHash}", + "alloc::vec::Vec", + "alloc::string::String", ] method-name-prefix = "starknet_" param-types = true diff --git a/crates/starknet-types-rpc/src/v0_5_0/starknet_write_api.json b/crates/starknet-types-rpc/src/v0_5_0/starknet_write_api.json index 57efc44..545725c 100644 --- a/crates/starknet-types-rpc/src/v0_5_0/starknet_write_api.json +++ b/crates/starknet-types-rpc/src/v0_5_0/starknet_write_api.json @@ -223,16 +223,13 @@ "$ref": "./starknet_api_openrpc.json#/components/schemas/TXN_HASH" }, "BROADCASTED_INVOKE_TXN": { - "$ref": "./starknet_api_openrpc.json#/components/schemas/BROADCASTED_INVOKE_TXN" + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_INVOKE_TXN" }, "DECLARE_TXN": { "$ref": "./starknet_api_openrpc.json#/components/schemas/DECLARE_TXN" }, - "BROADCASTED_DECLARE_TXN": { - "$ref": "./starknet_api_openrpc.json#/components/schemas/BROADCASTED_DECLARE_TXN" - }, "BROADCASTED_DEPLOY_ACCOUNT_TXN": { - "$ref": "./starknet_api_openrpc.json#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN" + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN" }, "FUNCTION_CALL": { "$ref": "./starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL"