getBalance
Returns the lamport balance of the account of provided Pubkey.
https://api.1inch.com/web3/501
Supported on: Solana
Parameters
Pubkey (required)
Pubkey
* string Pubkey of account to query, as base-58 encoded string
Configuration
Configuration
object commitment
string (Enum)The commitment describes how finalized a block is at that point in time
processed
confirmed
finalized
minContextSlot
integer The minimum slot that the request can be evaluated at
additionalProperties
none Request
Request
object jsonrpc
* string (Enum)JSON-RPC version
2.0
method
* string The method to call
params
array Method parameters
items
any oneOf[0]
string Pubkey of account to query, as base-58 encoded string
oneOf[1]
object commitment
string (Enum)The commitment describes how finalized a block is at that point in time
processed
confirmed
finalized
minContextSlot
integer The minimum slot that the request can be evaluated at
additionalProperties
none id
* number Request ID
JavaScript
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const response = await fetch('https://api.1inch.com/web3/501', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'getBalance',
params: [
'string',
{
commitment: 'processed',
minContextSlot: 0,
},
],
id: 1,
}),
});
const data = await response.json();
console.log(data);
Response
Balance Response
Balance Response
object context
* object slot
* integer The slot this response corresponds to
apiVersion
string The current solana versions running on the node
additionalProperties
none value
* integer The lamport balance of the account
additionalProperties
none JSON
Copy
1
2
3
4
5
6
7
{
"context": {
"slot": 1
},
"value": 0
}