Skip to content

Commit 0bb9fd9

Browse files
committed
add new polygon-zkevm methods
1 parent 68a8280 commit 0bb9fd9

File tree

5 files changed

+168
-0
lines changed

5 files changed

+168
-0
lines changed

evm_body.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -2250,6 +2250,36 @@ zkevm_getBroadcastURI:
22502250
$ref: ./components/schemas.yaml#/Method
22512251
default: zkevm_getBroadcastURI
22522252

2253+
zkevm_estimateFee:
2254+
allOf:
2255+
- $ref: '#/common_request_fields'
2256+
- type: object
2257+
properties:
2258+
method:
2259+
$ref: ./components/schemas.yaml#/Method
2260+
default: zkevm_estimateFee
2261+
params:
2262+
type: array
2263+
minItems: 1
2264+
maxItems: 1
2265+
items:
2266+
$ref: '#/transaction_object'
2267+
2268+
zkevm_estimateGasPrice:
2269+
allOf:
2270+
- $ref: '#/common_request_fields'
2271+
- type: object
2272+
properties:
2273+
method:
2274+
$ref: ./components/schemas.yaml#/Method
2275+
default: zkevm_estimateGasPrice
2276+
params:
2277+
type: array
2278+
minItems: 1
2279+
maxItems: 1
2280+
items:
2281+
$ref: '#/transaction_object'
2282+
22532283
# ===================== Account Abstraction Methods =====================
22542284

22552285
eth_sendUserOperation:

evm_examples.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2808,6 +2808,10 @@ eth_getTransactionReceipt_zkevm:
28082808
},
28092809
}
28102810

2811+
zkevm_estimateFee: {'jsonrpc': '2.0', 'id': 1, 'result': '0x1ff3e2c2fec0'}
2812+
2813+
zkevm_estimateGasPrice: {'jsonrpc': '2.0', 'id': 1, 'result': '0x64848414'}
2814+
28112815
# ========== Account Abstraction Method Examples ==========
28122816

28132817
eth_sendUserOperation: { 'jsonrpc': '2.0', 'id': 1, 'result': '0x1234...5678' }

evm_responses.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,30 @@ zkevm_getBroadcastURI:
14331433
example:
14341434
$ref: ./evm_examples.yaml#/zkevm_getBroadcastURI
14351435

1436+
zkevm_estimateFee:
1437+
allOf:
1438+
- $ref: '#/common_response_fields'
1439+
- type: object
1440+
description: Returns the estimated fee for the transaction.
1441+
properties:
1442+
result:
1443+
type: string
1444+
description: The estimated fee for the transaction.
1445+
example:
1446+
$ref: ./evm_examples.yaml#/zkevm_estimateFee
1447+
1448+
zkevm_estimateGasPrice:
1449+
allOf:
1450+
- $ref: '#/common_response_fields'
1451+
- type: object
1452+
description: Returns the estimated gas price.
1453+
properties:
1454+
result:
1455+
type: string
1456+
description: The estimated gas price.
1457+
example:
1458+
$ref: ./evm_examples.yaml#/zkevm_estimateGasPrice
1459+
14361460
# ============= Account Abstraction ===============
14371461

14381462
eth_sendUserOperation:

polygon-zkevm/zkevm_estimateFee.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
openapi: 3.1.0
2+
info:
3+
title: zkevm_estimateFee API - Polygon zkEVM
4+
description: Estimates the transaction fee based on the current gas price and transaction complexity.
5+
version: '1.0'
6+
servers:
7+
- url: 'https://{network}.g.alchemy.com/v2/'
8+
variables:
9+
network:
10+
enum:
11+
- polygonzkevm-mainnet
12+
- polygonzkevm-testnet
13+
- polygonzkevm-cardona
14+
default: polygonzkevm-cardona
15+
x-sandbox:
16+
category:
17+
type:
18+
$ref: '../components/sandbox.yaml#/Category'
19+
value: core
20+
paths:
21+
/{apiKey}:
22+
$ref: '#/components/pathItems/path'
23+
components:
24+
pathItems:
25+
path:
26+
post:
27+
operationId: zkevm-estimateFee-polygon-zkevm
28+
summary: zkevm_estimateFee API - Polygon zkEVM
29+
description: Estimates the transaction fee following the effective gas price rules.
30+
parameters:
31+
- name: apiKey
32+
in: path
33+
schema:
34+
type: string
35+
default: docs-demo
36+
description: |
37+
<style>
38+
.custom-style {
39+
color: #048FF4;
40+
}
41+
</style>
42+
For higher throughput, <span class="custom-style"><a href="https://alchemy.com/?a=docs-demo" target="_blank">create your own API key</a></span>
43+
required: true
44+
requestBody:
45+
content:
46+
application/json:
47+
schema:
48+
$ref: '../evm_body.yaml#/zkevm_estimateFee'
49+
responses:
50+
'200':
51+
description: Successfully estimated the transaction fee.
52+
content:
53+
application/json:
54+
schema:
55+
$ref: '../evm_responses.yaml#/zkevm_estimateFee'
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
openapi: 3.1.0
2+
info:
3+
title: zkevm_estimateGasPrice API - Polygon zkEVM
4+
description: Estimates the gas price needed to get a transaction processed within a target number of blocks.
5+
version: '1.0'
6+
servers:
7+
- url: 'https://{network}.g.alchemy.com/v2/'
8+
variables:
9+
network:
10+
enum:
11+
- polygonzkevm-mainnet
12+
- polygonzkevm-testnet
13+
- polygonzkevm-cardona
14+
default: polygonzkevm-cardona
15+
x-sandbox:
16+
category:
17+
type:
18+
$ref: '../components/sandbox.yaml#/Category'
19+
value: core
20+
paths:
21+
/{apiKey}:
22+
$ref: '#/components/pathItems/path'
23+
components:
24+
pathItems:
25+
path:
26+
post:
27+
operationId: zkevm-estimateGasPrice-polygon-zkevm
28+
summary: zkevm_estimateGasPrice API - Polygon zkEVM
29+
description: Estimates the transaction gas price following the effective gas price rules.
30+
parameters:
31+
- name: apiKey
32+
in: path
33+
schema:
34+
type: string
35+
default: docs-demo
36+
description: |
37+
<style>
38+
.custom-style {
39+
color: #048FF4;
40+
}
41+
</style>
42+
For higher throughput, <span class="custom-style"><a href="https://alchemy.com/?a=docs-demo" target="_blank">create your own API key</a></span>
43+
required: true
44+
requestBody:
45+
content:
46+
application/json:
47+
schema:
48+
$ref: '../evm_body.yaml#/zkevm_estimateGasPrice'
49+
responses:
50+
'200':
51+
description: Successfully estimated the gas price.
52+
content:
53+
application/json:
54+
schema:
55+
$ref: '../evm_responses.yaml#/zkevm_estimateGasPrice'

0 commit comments

Comments
 (0)