๐ฏGeth Proxy API Endpoints
Notes
Endpoints with ๐
ฟ๐๐
พ
are under the API Pro subscription. To upgrade your API plan, browse through the BscScan APIs page.
//imports
using BscScan.NetCore.Contracts;
//inject
private readonly IBscScanGethProxyService _bscScanGethProxyService;
๐ถeth_blockNumberโ
Returns the number of most recent block.โ
- Request
- Response
- ...
//Sample Request ๐
var blockNumber = await _bscScanGethProxyService.EthBlockNumberAsync();
//will return a new object EthBlockNumber with values: ๐
var blockNumber = new EthBlockNumber
{
JsonRpc="2.0",
Id=83,
Result= "0xf2d12e"
};
๐ For more information Check out eth_blockNumber
๐ถeth_getBlockByNumberโ
Returns information about a block by block number.โ
- Request
- Response
- ...
//Sample Request ๐
var blockByNumber = await _bscScanGethProxyService.EthGetBlockByNumberAsync("0xa11446");
//will return a new object BlockByNumber with values: ๐
var blockByNumber = new BlockByNumber
{
JsonPrc = "2.0",
Result = new BlockByNumberData
{
Transactions = new List<BlockByNumberDataTransaction>
{
new()
{
GasPrice = "0x59682f000",
Value = "0x0",
Hash = "0x37c0f5ac6d6780b3b49fb5842232d75fbbdb41a903fdf6236895bdd094ae9e4e",
Gas ="0x7a120",
To = "0x18b2a687610328590bc8f2e5fedde3b582a49cda",
BlockHash = "0xaa75425f0e34a85eeea562726e2f7017b500e79bc89b70ac693a0ff3406b0662",
BlockNumber = "0xa11446",
From = "0xf5b4c4e9e8fb4b0cc961197b6c512c66dcf55e01",
Input = "0x7b3205f5",
Nonce = "0x1a86",
R = "0x9828d2c1bfdb036cb502b6fd40ee604797d745a76d1751183ca279717d44cc1a",
S = "0x3f3db161fcc8132989def2ed61158121ce285ac8e077f1176afa830c559ee0c5",
TransactionIndex = "0x0",
Type = "0x0",
V = "0x93"
},
new()
{
GasPrice = "0x2540be400",
Value = "0x0",
Hash = "0x12aaa273d1b7430c8167f29a75083beae9586a88e424e01352b9da4fe0860dd3",
Gas ="0x32918",
To = "0x8f0528ce5ef7b51152a59745befdd91d97091d2f",
BlockHash = "0xaa75425f0e34a85eeea562726e2f7017b500e79bc89b70ac693a0ff3406b0662",
BlockNumber = "0xa11446",
From = "0xe2fc31f816a9b94326492132018c3aecc4a93ae1",
Input = "0xa9059cbb000000000000000000000000df74a017543a7f73e224c8ed99d658d14e85d0fe00000000000000000000000000000000000000000000001b1ae4d6e2ef500000",
Nonce = "0x21312a",
R = "0xf2ff6078eada7d3b5b0d9e8e0e5dcb5f1349daf5b9c7a942b3c510b16a8c4431",
S = "0x3ffd02c9b16fa582435e35eaa9389dac5daf1b71125ac66b2a8e9845a3a126d3",
TransactionIndex = "0x1",
Type = "0x0",
V = "0x94"
},
new() ...
},
Hash = "0xaa75425f0e34a85eeea562726e2f7017b500e79bc89b70ac693a0ff3406b0662",
Nonce = "0x0000000000000000",
BaseFeePerGas = "",
Difficulty = "0x2",
ExtraData = "",
GasLimit = "0x510ff40",
GasUsed = "0x2105ade",
LogsBloom = "0xfe3b8f174c5c1734f63bf577b4e55c2deb8ef36857eeb5fb651ead4d2c119182d93b08a6974df7d4dfe974391a3deff3bee70525435fe3f3e3f6056cb3f564cb51b27c3281e06ef013eafefa87bf0b353cd255d653dd3c2acd9e8e4edbf0ed60efe8f2f2e7fe5d61ceea02ff02652ff14a22be7cadb8b7de2e20fb34755f9d34bfc23fcd614d82296ccfd6a03d1a4397d027d44dbdc7f4db3d49b2794e5eef9643760bade0c83b6b4f4618af1ba7f9cb73bb9cedd2adcaa41ceb9eeaac0b659e5e4fe5ffffd872df7e497eb678befe39eee52b36558e0f711748b12f9e36f7c1be7f2f6b54fad0873daffa1df4aeee0bdf8d252fd9daa84e7966886fefdb8049",
Miner = "0xe2d3a739effcd3a99387d015e260eefac72ebea1",
MixHash = "0x0000000000000000000000000000000000000000000000000000000000000000",
Number = "0xa11446",
ParentHash = "0x03259dd6f872a48c2903abe81257f446502fd9d6b57e3668595aa066f3ef4e30",
ReceiptsRoot = "0x3ebdc990623c03e7a40f3dbc070735e0246f8c4106d1111864a21e945d29c9e1",
Sha3Uncles = "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
Size = "0x10668",
StateRoot = "0xd1eae90080a13a60e4133f057ee491458404cc2d4dbbbe93c89ad3831c0d794c",
Timestamp = "0x61306907",
TotalDifficulty = "0x14098bf",
TransactionsRoot = "0xfbffc6efe93b90cea18fe333c126014857fc74c3a8ef4f7fd61e1f7d612883c8",
Uncles = new List<string>{ "", "" }
}
};
๐ For more information Check out eth_getBlockByNumber
๐ถeth_getBlockTransactionCountByNumberโ
Returns the number of transactions in a block.โ
- Request
- Response
- ...
//Sample Request ๐
var blockTransactionCountByNumber =
await _bscScanGethProxyService.EthGetBlockTransactionCountByNumberAsync("0xa11446");
//will return a new object BlockTransactionCountByNumber with values: ๐
var blockTransactionCountByNumber = new BlockTransactionCountByNumber
{
JsonRpc="2.0",
Id=83,
Result= "0xfc"
};
๐ For more information Check out eth_getBlockTransactionCountByNumber
๐ถeth_getTransactionByHashโ
Returns information about a transaction requested by transaction hash.โ
- Request
- Response
- ...
//Sample Request ๐
var transactionByHash =
await _bscScanGethProxyService
.EthGetTransactionByHashAsync(txhash:"0x9983332a52df5ad1dabf8fa81b1642e9383f302a399c532fc47ecb6a7a967166");
//will return a new object TransactionByHash with values: ๐
var transactionByHash = new TransactionByHash
{
JsonRpc="2.0",
Id=1,
Result= new TransactionByHashData{
GasPrice = "0x12a05f200",
Value = "0x0",
Hash = "0x9983332a52df5ad1dabf8fa81b1642e9383f302a399c532fc47ecb6a7a967166",
Gas ="0x4e033",
To = "0x67d9b4921bc8b397d9b0c0ca7274ada50167e7d0",
BlockHash = "0x4beb0710a78f560687a455d2f0faf4595a306dd5ce46006005eec82c4081efe0",
BlockNumber = "0xa11595",
From = "0x25f1358276a9f93feaffeb5bf92e0a62554db3d3",
Input = "0xd3243f25000000000000000000000000000000000000000000000000000000000000153b000000000000000000000000000000000000000000000000000000000000091a",
Nonce = "0x2a8",
R = "0x26a2b15bae27427462a4ec5830f4b17f5dd51bfaa1e898a6e61207be61d204a7",
S = "0x5e9347d499cee66a021ddb1a38b15dcf106efbc54fa3c8d1929f8c28bcc41188",
TransactionIndex = "0x10e",
Type = "0x0",
V = "0x94"
}
};
๐ For more information Check out eth_getTransactionByHash
๐ถeth_getTransactionByBlockNumberAndIndexโ
Returns information about a transaction by block number and transaction index position.โ
- Request
- Response
- ...
//Sample Request ๐
var transactionByBlockNumberAndIndex =
await _bscScanGethProxyService
.EthGetTransactionByBlockNumberAndIndexAsync(tag:"0xa11446", index:"0x1");
//will return a new object TransactionByBlockNumberAndIndex with values: ๐
var transactionByBlockNumberAndIndex = new TransactionByBlockNumberAndIndex
{
JsonRpc="2.0",
Id=1,
Result= new TransactionByBlockNumberAndIndexData{
GasPrice = "0x2540be400",
Value = "0x0",
Hash = "0x12aaa273d1b7430c8167f29a75083beae9586a88e424e01352b9da4fe0860dd3",
Gas ="0x32918",
To = "0x8f0528ce5ef7b51152a59745befdd91d97091d2f",
BlockHash = "0xaa75425f0e34a85eeea562726e2f7017b500e79bc89b70ac693a0ff3406b0662",
BlockNumber = "0xa11446",
From = "0xe2fc31f816a9b94326492132018c3aecc4a93ae1",
Input = "0xa9059cbb000000000000000000000000df74a017543a7f73e224c8ed99d658d14e85d0fe00000000000000000000000000000000000000000000001b1ae4d6e2ef500000",
Nonce = "0x21312a",
R = "0xf2ff6078eada7d3b5b0d9e8e0e5dcb5f1349daf5b9c7a942b3c510b16a8c4431",
S = "0x3ffd02c9b16fa582435e35eaa9389dac5daf1b71125ac66b2a8e9845a3a126d3",
TransactionIndex = "0x1",
Type = "0x0",
V = "0x94"
}
};
๐ For more information Check out eth_getTransactionByBlockNumberAndIndex
๐ถeth_getTransactionCountโ
Returns the number of transactions performed by an address.โ
- Request
- Response
- ...
//Sample Request ๐
var transactionCount =
await _bscScanGethProxyService
.EthGetTransactionCountAsync(address:"0x4430b3230294D12c6AB2aAC5C2cd68E80B16b581");
//will return a new object TransactionCount with values: ๐
var transactionCount = new TransactionCount
{
JsonRpc="2.0",
Id=1,
Result= "0xad3ad"
};
๐ For more information Check out eth_getTransactionCount
๐ถeth_sendRawTransactionโ
Submits a pre-signed transaction for broadcast to the BNB Smart Chain network.โ
- Request
- Response
- ...
//Sample Request ๐
var sendRawTransaction =
await _bscScanGethProxyService
.EthSendRawTransactionAsync(hex:"0xf904808000831cfde080");
//will return a new object SendRawTransaction with values: ๐
var sendRawTransaction = new SendRawTransaction
{
JsonRpc="2.0",
Id=1,
Result= "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
};
๐ For more information Check out eth_sendRawTransaction
๐ถeth_getTransactionReceiptโ
Returns the receipt of a transaction that has been validated.โ
- Request
- Response
- ...
//Sample Request ๐
var transactionReceipt =
await _bscScanGethProxyService
.EthGetTransactionReceiptAsync("0x2122b2317d6cf409846f80e829c1e45ecb30306907ba0a00a02730c78890739f");
//will return a new object TransactionReceipt with values: ๐
var transactionReceipt = new TransactionReceipt
{
Result = new TransactionReceiptData
{
BlockHash = "0x552853a401a7faa54ff6f26059a1eee86323bd2140ccfaa16209679277264ddb",
BlockNumber = "0xa11605",
ContractAddress = null,
CumulativeGasUsed = "0x264dd36",
From = "0x8c0191f0e4ed98f1f72c96d06a4a207495c5e4a5",
GasUsed = "0x1b348",
Logs = new List<TransactionReceiptLog>
{
new()
{
Address = "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
Topics = new List<string>
{
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000008488cb2f54ecb9aa1cdc1bc83bc1d200bb2f216b"
},
Data = "0x00000000000000000000000000000000000000000000000006c637d7bfdd83fd",
BlockNumber ="0xa11605",
TransactionHash = "0x2122b2317d6cf409846f80e829c1e45ecb30306907ba0a00a02730c78890739f",
TransactionIndex = "0xe7",
BlockHash = "0x552853a401a7faa54ff6f26059a1eee86323bd2140ccfaa16209679277264ddb",
LogIndex = "0x340",
Removed = false
},
new()
{
Address = "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
Topics = new List<string>
{
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000009cf7bc57584b7998236eff51b98a168dcea9b0"
},
Data = "0x00000000000000000000000000000000000000000000000043be2e6d7ea727ea",
BlockNumber ="0xa11605",
TransactionHash = "0x2122b2317d6cf409846f80e829c1e45ecb30306907ba0a00a02730c78890739f",
TransactionIndex = "0xe7",
BlockHash = "0x552853a401a7faa54ff6f26059a1eee86323bd2140ccfaa16209679277264ddb",
LogIndex = "0x341",
Removed = false
},
new()
{
Address = "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
Topics = new List<string>
{
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000008c0191f0e4ed98f1f72c96d06a4a207495c5e4a5"
},
Data = "0x000000000000000000000000000000000000000000000000009913aad1eb6e16",
BlockNumber ="0xa11605",
TransactionHash = "0x2122b2317d6cf409846f80e829c1e45ecb30306907ba0a00a02730c78890739f",
TransactionIndex = "0xe7",
BlockHash = "0x552853a401a7faa54ff6f26059a1eee86323bd2140ccfaa16209679277264ddb",
LogIndex = "0x342",
Removed = false
},
new()
{
Address = "0x73feaa1ee314f8c655e354234017be2193c9e24e",
Topics = new List<string>
{
"0x90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15",
"0x0000000000000000000000008c0191f0e4ed98f1f72c96d06a4a207495c5e4a5",
"0x00000000000000000000000000000000000000000000000000000000000001a7"
},
Data = "0x0000000000000000000000000000000000000000000000000000000000000000",
BlockNumber ="0xa11605",
TransactionHash = "0x2122b2317d6cf409846f80e829c1e45ecb30306907ba0a00a02730c78890739f",
TransactionIndex = "0xe7",
BlockHash = "0x552853a401a7faa54ff6f26059a1eee86323bd2140ccfaa16209679277264ddb",
LogIndex = "0x343",
Removed = false
}
},
LogsBloom = "0x00000000100000000000000000000000000000000400000000004000000000000000000000000000000000000008000008000000000002000000000000000000008000000000000000000008000000000000000010000002000000000010000000000000020000000000000000002800000000000000020000000410000000000000000000000000000000000000000000000000000080002000000000000000000000000040000000000000000000000000000000000000000000000000000000000002000200000000000000000000000000000000000000000000000024000000000000000000000000000000000000000008400000000000000000000000",
Status = "0x1",
To = "0x73feaa1ee314f8c655e354234017be2193c9e24e",
TransactionHash = "0x2122b2317d6cf409846f80e829c1e45ecb30306907ba0a00a02730c78890739f",
TransactionIndex = "0xe7",
Type = "0x0"
}
};
๐ For more information Check out eth_getTransactionReceipt
๐ถeth_callโ
Executes a new message call immediately without creating a transaction on the block chain.โ
- Request
- Response
- ...
//Sample Request ๐
var call = await _bscScanGethProxyService
.EthCallAsync(to:"0xAEEF46DB4855E25702F8237E8f403FddcaF931C0",
data:"0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724");
//will return a new object EthCall with values: ๐
var call = new EthCall
{
JsonRpc="2.0",
Id=1,
Result= "0x00000000000000000000000000000000000000000000000000601d8888141c00"
};
๐ For more information Check out eth_call
๐ถeth_getCodeโ
Returns code at a given address.โ
- Request
- Response
- ...
//Sample Request ๐
var code = await _bscScanGethProxyService
.EthGetCodeAsync(address:"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82");
//will return a new object EthCode with values: ๐
var code = new EthCode
{
JsonRpc="2.0",
Id=1,
Result= "x608060405234801561001057600080fd5b50600436106101b95760003560e01c8063782d6fe1116100f9578063a9059cbb11610097578063dd62ed3e11610071578063dd62ed3e1461056c578063e7a324dc1461059a578063f1127ed8146105a2578063f2fde38b146105f4576101b9565b8063a9059cbb14610......."
};
๐ For more information Check out eth_getCode
๐ถeth_getStorageAtโ
Returns the value from a storage position at a given address.โ
- Request
- Response
- ...
//Sample Request ๐
var storageAt = await _bscScanGethProxyService
.EthGetStorageAtAsync(address:"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
position:"0x0");
//will return a new object EthStorageAt with values: ๐
var storageAt = new EthStorageAt
{
JsonRpc="2.0",
Id=1,
Result= "0x00000000000000000000000073feaa1ee314f8c655e354234017be2193c9e24e"
};
๐ For more information Check out eth_getStorageAt
๐ถeth_gasPriceโ
Returns the current price per gas in wei.โ
- Request
- Response
- ...
//Sample Request ๐
var gasPrice = await _bscScanGethProxyService
.EthGasPriceAsync();
//will return a new object EthGasPrice with values: ๐
var gasPrice = new EthGasPrice
{
JsonRpc="2.0",
Id=1,
Result= "0x12a05f200"
};
๐ For more information Check out eth_gasPrice
๐ถeth_estimateGasโ
Makes a call or transaction, which won't be added to the blockchain and returns the gas used.โ
- Request
- Response
- ...
//Sample Request ๐
var parameters = new EthEstimateGasRequest
{
Data = "0x4e71d92d",
To = "0xEeee7341f206302f2216e39D715B96D8C6901A1C",
Value = "0xff22",
GasPrice = "0x51da038cc",
Gas = "0x5f5e0ff"
};
var estimateGas = await _bscScanGethProxyService
.EthEstimateGasAsync(parameters);
//will return a new object EthEstimateGas with values: ๐
var estimateGas = new EthEstimateGas
{
JsonRpc="2.0",
Id=1,
Result= "0x5248"
};
๐ For more information Check out eth_estimateGas