import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.contracts.getDeploymentTransaction({
address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
currency: "usd",
});
console.log(result);
}
run();{
"networkTokenDetails": {
"networkToken": {
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>",
"description": "<string>"
},
"currentPrice": {
"currencyCode": "usd",
"value": 123
},
"historicalPrice": {
"currencyCode": "usd",
"value": 123
}
},
"nativeTransaction": {
"blockNumber": "<string>",
"blockTimestamp": 123,
"blockHash": "<string>",
"chainId": "<string>",
"blockIndex": 123,
"txHash": "<string>",
"txStatus": "<string>",
"txType": 123,
"gasLimit": "<string>",
"gasUsed": "<string>",
"gasPrice": "<string>",
"nonce": "<string>",
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"value": "<string>",
"input": "<string>",
"baseFeePerGas": "<string>",
"method": {
"callType": "NATIVE_TRANSFER",
"methodHash": "<string>",
"methodName": "<string>"
},
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>"
},
"erc20Transfers": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"logIndex": 123,
"value": "<string>",
"erc20Token": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"ercType": "ERC-20",
"logoUri": "<string>",
"price": {
"currencyCode": "usd",
"value": 123
}
}
}
],
"erc721Transfers": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"logIndex": 123,
"erc721Token": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"ercType": "ERC-721",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"attributes": "<string>"
},
"ownerAddress": "<string>"
}
}
],
"erc1155Transfers": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"logIndex": 123,
"value": "<string>",
"erc1155Token": {
"address": "<string>",
"ercType": "ERC-1155",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"decimals": 123,
"properties": "<string>"
}
}
}
],
"internalTransactions": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"internalTxType": "UNKNOWN",
"value": "<string>",
"isReverted": true,
"gasUsed": "<string>",
"gasLimit": "<string>"
}
],
"teleporterMessageInfo": {
"teleporterMessageId": "<string>",
"direction": "SOURCE_TRANSACTION",
"sourceChainId": "<string>",
"destinationChainId": "<string>"
}
}If the address is a smart contract, returns the transaction in which it was deployed.
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.contracts.getDeploymentTransaction({
address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
currency: "usd",
});
console.log(result);
}
run();{
"networkTokenDetails": {
"networkToken": {
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>",
"description": "<string>"
},
"currentPrice": {
"currencyCode": "usd",
"value": 123
},
"historicalPrice": {
"currencyCode": "usd",
"value": 123
}
},
"nativeTransaction": {
"blockNumber": "<string>",
"blockTimestamp": 123,
"blockHash": "<string>",
"chainId": "<string>",
"blockIndex": 123,
"txHash": "<string>",
"txStatus": "<string>",
"txType": 123,
"gasLimit": "<string>",
"gasUsed": "<string>",
"gasPrice": "<string>",
"nonce": "<string>",
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"value": "<string>",
"input": "<string>",
"baseFeePerGas": "<string>",
"method": {
"callType": "NATIVE_TRANSFER",
"methodHash": "<string>",
"methodName": "<string>"
},
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>"
},
"erc20Transfers": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"logIndex": 123,
"value": "<string>",
"erc20Token": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"ercType": "ERC-20",
"logoUri": "<string>",
"price": {
"currencyCode": "usd",
"value": 123
}
}
}
],
"erc721Transfers": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"logIndex": 123,
"erc721Token": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"ercType": "ERC-721",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"attributes": "<string>"
},
"ownerAddress": "<string>"
}
}
],
"erc1155Transfers": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"logIndex": 123,
"value": "<string>",
"erc1155Token": {
"address": "<string>",
"ercType": "ERC-1155",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"decimals": 123,
"properties": "<string>"
}
}
}
],
"internalTransactions": [
{
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"internalTxType": "UNKNOWN",
"value": "<string>",
"isReverted": true,
"gasUsed": "<string>",
"gasLimit": "<string>"
}
],
"teleporterMessageInfo": {
"teleporterMessageId": "<string>",
"direction": "SOURCE_TRANSACTION",
"sourceChainId": "<string>",
"destinationChainId": "<string>"
}
}Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
A supported evm chain id or blockchain id. Use the /chains endpoint to get a list of supported chain ids.
Contract address on the relevant chain.
The currency that return values should use. Defaults to USD. ISO 4217 currency code.
usd, eur, aud, cad, chf, clp, cny, czk, dkk, gbp, hkd, huf, jpy, nzd Successful response
Show child attributes
Show child attributes
The list of ERC-20 transfers.
Show child attributes
The list of ERC-721 transfers.
Show child attributes
The list of ERC-1155 transfers.
Show child attributes
The list of internal transactions. Note that this list only includes CALL and CALLCODE internal transactions that had a non-zero value and CREATE/CREATE2/CREATE3 calls. Use a client provider to recieve a full debug trace of the transaction.
Show child attributes
Corresponding teleporter message info if available.
Show child attributes
Was this page helpful?