Skip to content

Commit 94a3d13

Browse files
Merge pull request #298 from amanusk/fix/estimate_fee_units
Seperate message fee estimates for all but estimateMessageFee transac…
2 parents 311a4ea + 158b262 commit 94a3d13

File tree

1 file changed

+64
-15
lines changed

1 file changed

+64
-15
lines changed

api/starknet_api_openrpc.json

Lines changed: 64 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@
650650
],
651651
"result": {
652652
"name": "result",
653-
"description": "the fee estimations",
653+
"description": "The fee estimations",
654654
"schema": {
655655
"title": "Estimation",
656656
"type": "array",
@@ -694,9 +694,9 @@
694694
],
695695
"result": {
696696
"name": "result",
697-
"description": "the fee estimation",
697+
"description": "The fee estimation",
698698
"schema": {
699-
"$ref": "#/components/schemas/FEE_ESTIMATE"
699+
"$ref": "#/components/schemas/MESSAGE_FEE_ESTIMATE"
700700
}
701701
},
702702
"errors": [
@@ -3481,13 +3481,30 @@
34813481
"enum": ["SKIP_VALIDATE"],
34823482
"description": "Flags that indicate how to simulate a given transaction. By default, the sequencer behavior is replicated locally"
34833483
},
3484-
"PRICE_UNIT": {
3485-
"title": "price unit",
3484+
"PRICE_UNIT_WEI": {
3485+
"title": "Price unit wei",
34863486
"type": "string",
3487-
"enum": ["WEI", "FRI"]
3487+
"enum": ["WEI"]
34883488
},
3489-
"FEE_ESTIMATE": {
3490-
"title": "Fee estimation",
3489+
"PRICE_UNIT_FRI": {
3490+
"title": "Price unit fri",
3491+
"type": "string",
3492+
"enum": ["FRI"]
3493+
},
3494+
"PRICE_UNIT": {
3495+
"title": "Price unit",
3496+
"description": "Units in which the fee is given",
3497+
"oneOf": [
3498+
{
3499+
"$ref": "#/components/schemas/PRICE_UNIT_WEI"
3500+
},
3501+
{
3502+
"$ref": "#/components/schemas/PRICE_UNIT_FRI"
3503+
}
3504+
]
3505+
},
3506+
"FEE_ESTIMATE_COMMON": {
3507+
"title": "Fee estimation common fields",
34913508
"type": "object",
34923509
"properties": {
34933510
"l1_gas_consumed": {
@@ -3524,11 +3541,6 @@
35243541
"title": "Overall fee",
35253542
"description": "The estimated fee for the transaction (in wei or fri, depending on the tx version), equals to l1_gas_consumed*l1_gas_price + l1_data_gas_consumed*l1_data_gas_price + l2_gas_consumed*l2_gas_price",
35263543
"$ref": "#/components/schemas/u128"
3527-
},
3528-
"unit": {
3529-
"title": "Fee unit",
3530-
"description": "units in which the fee is given",
3531-
"$ref": "#/components/schemas/PRICE_UNIT"
35323544
}
35333545
},
35343546
"required": [
@@ -3538,8 +3550,45 @@
35383550
"l2_gas_price",
35393551
"l1_data_gas_consumed",
35403552
"l1_data_gas_price",
3541-
"overall_fee",
3542-
"unit"
3553+
"overall_fee"
3554+
]
3555+
},
3556+
"FEE_ESTIMATE": {
3557+
"title": "Fee estimation",
3558+
"allOf": [
3559+
{
3560+
"$ref": "#/components/schemas/FEE_ESTIMATE_COMMON"
3561+
},
3562+
{
3563+
"type": "object",
3564+
"properties": {
3565+
"unit": {
3566+
"title": "Fee unit",
3567+
"description": "Units in which the fee is given, can only be FRI",
3568+
"$ref": "#/components/schemas/PRICE_UNIT_FRI"
3569+
}
3570+
},
3571+
"required": ["unit"]
3572+
}
3573+
]
3574+
},
3575+
"MESSAGE_FEE_ESTIMATE": {
3576+
"title": "Message fee estimation",
3577+
"allOf": [
3578+
{
3579+
"$ref": "#/components/schemas/FEE_ESTIMATE_COMMON"
3580+
},
3581+
{
3582+
"type": "object",
3583+
"properties": {
3584+
"unit": {
3585+
"title": "Fee unit",
3586+
"description": "Units in which the fee is given, can only be WEI",
3587+
"$ref": "#/components/schemas/PRICE_UNIT_WEI"
3588+
}
3589+
},
3590+
"required": ["unit"]
3591+
}
35433592
]
35443593
},
35453594
"FEE_PAYMENT": {

0 commit comments

Comments
 (0)