-
Notifications
You must be signed in to change notification settings - Fork 27
/
eth_getBalance.yaml
76 lines (74 loc) · 2.39 KB
/
eth_getBalance.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
openapi: 3.1.0
info:
title: eth_getBalance - Ethereum
version: '1.0'
servers:
- url: 'https://{network}.g.alchemy.com/v2/'
variables:
network:
enum:
- eth-mainnet
- eth-sepolia
- eth-holesky
default: eth-mainnet
x-sandbox:
category:
type:
$ref: '../components/sandbox.yaml#/Category'
value: core
paths:
/{apiKey}:
$ref: '#/components/pathItems/path'
components:
pathItems:
path:
post:
summary: eth_getBalance - Ethereum
description: Returns the balance of the account of a given address.
tags: []
parameters:
- name: apiKey
in: path
schema:
type: string
default: docs-demo
description: |
<style>
.custom-style {
color: #048FF4;
}
</style>
For higher throughput, <span class="custom-style"><a href="https://alchemy.com/?a=docs-demo" target="_blank">create your own API key</a></span>
required: true
requestBody:
content:
application/json:
schema:
$ref: ../evm_body.yaml#/eth_getBalance
x-readme:
samples-languages:
- curl
- javascript
- python
code-samples:
- language: javascript
name: Alchemy SDK
code: |
// Setup: npm install alchemy-sdk
// Github: https://github.com/alchemyplatform/alchemy-sdk-js
import { Network, Alchemy } from "alchemy-sdk";
// Optional config object, but defaults to demo api-key and eth-mainnet.
const settings = {
apiKey: "demo", // Replace with your Alchemy API Key.
network: Network.ETH_MAINNET, // Replace with your network.
};
const alchemy = new Alchemy(settings);
alchemy.core.getBalance("vitalik.eth", "latest").then(console.log);
responses:
'200':
description: 'Returns hex value of the current ETH balance for the given address, measured in wei.'
content:
application/json:
schema:
$ref: ../evm_responses.yaml#/string_result_response
operationId: eth-getBalance