Skip to main content

getCode

Returns code at a given address.

Parameters

DATA, 20 Bytes

address

QUANTITY | TAG

integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.

params: [
' 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
'0x2' // 2
]

Returns

DATA

the code from the given address.

Requests

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://testnode.jumbochain.org");
var content = new StringContent("{\n\t\"jsonrpc\":\"2.0\",\n\t\"method\":\"jumbo_getCode\",\n\t\"params\":[\n\t\t\"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", \n\t\t\"0x2\"\n\t],\n\t\"id\":1\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());