이더리움 개발자 문서 바로가기 함수 호출에 필요한 매개변수 또는 반환되는 데이터에 대해서는 REST API 개발자 문서를 참고해 주시길 바랍니다.
package main
import (
"fmt"
blocksdk "github.com/Block-Chen/blocksdk-go"
)
func main() {
ethClient := blocksdk.NewEthereum("YOU_TOKEN", "https://testnet-api.blocksdk.com/")
}
package main
import (
"fmt"
blocksdk "github.com/Block-Chen/blocksdk-go"
)
func main() {
ethClient := blocksdk.NewEthereum("YOU_TOKEN", "https://mainnet-api.blocksdk.com/")
}
GET /v3/eth/info
result, err := ethClient.GetBlockChainInfo()
GET /v3/eth/block/<block>
result, err := ethClient.GetBlock(map[string]interface{}{
"block" : "blockNumber 또는 blockHash",
});
GET /v3/eth/address
result, err := ethClient.GetAddresses(map[string]interface{}{
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/address/<address>/info
result, err := ethClient.GetAddressInfo(map[string]interface{}{
"address" : "주소",
"offset" : "0",
"limit" : "10",
});
POST /v3/eth/address
result, err := ethClient.CreateAddress(map[string]interface{}{
"name" : "test",
});
GET /v3/eth/address/<address>/balance
result, err := ethClient.GetAddressBalance(map[string]interface{}{
"address" : "주소",
});
POST /v3/eth/address/<from_address>/send
result, err := ethClient.Send(map[string]interface{}{
"from" : "주소",
"to" : "주소",
"amount" : "보낼 양",
"private_key" : "보내는 주소 키",
});
POST /v3/eth/transaction/send
result, err := ethClient.SendTransaction(map[string]interface{}{
"hex" : "서명된 트랜잭션 hex",
});
GET /v3/eth/transaction/<tx_hash>
result, err := ethClient.GetTransaction(map[string]interface{}{
"hash" : "트랜잭션 해쉬",
});
GET /v3/eth/token/<contract_address>/info
result, err := ethClient.GetTokenInfo(map[string]interface{}{
"contract_address" : "ERC20 토큰 컨트렉트 주소",
});
GET /v3/eth/token/<contract_address>/<from_address>/balance
result, err := ethClient.GetTokenBalance(map[string]interface{}{
"contract_address" : "ERC20 토큰 컨트렉트 주소",
"from_address" : "잔액을 조회할 주소",
});
POST /v3/eth/token/<contract_address>/<from_address>/transfer
result, err := ethClient.SendToken(map[string]interface{}{
"contract_address" : "ERC20 토큰 컨트렉트 주소",
"from_address" : "토큰을 전송할 주소",
"to" : "주소",
"amount" : "보낼 양",
"private_key" : "보내는 주소 키",
});
GET /v3/eth/token/<from_address>/transactions
result, err := ethClient.GetTokenTxs(map[string]interface{}{
"from_address" : "거래 내역을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/token/<contract_address>/<from_address>/transactions
result, err := ethClient.GetTokenContractTxs(map[string]interface{}{
"contract_address" : "ERC20 토큰 컨트렉트 주소",
"from_address" : "거래 내역을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/token/<from_address>/all-balance
result, err := ethClient.GetTokenAllBalance(map[string]interface{}{
"from_address" : "토큰 목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<contract_address>/nfts
result, err := ethClient.GetSingleNfts(map[string]interface{}{
"contract_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<owner_address>/owner-nfts
result, err := ethClient.GetSingleOwnerNfts(map[string]interface{}{
"owner_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<creator_address>/creator-nfts
result, err := ethClient.GetSingleCreatorNfts(map[string]interface{}{
"creator_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<from_address>/transactions
result, err := ethClient.GetSingleTxs(map[string]interface{}{
"from_address" : "토큰 목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<contract_address>/<owner_address>/owner-nfts
result, err := ethClient.GetSingleNftOwnerNfts(map[string]interface{}{
"contract_address" : "컨트렉트 주소",
"owner_address" : "월렛 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<contract_address>/<creator_address>/creator-nfts
result, err := ethClient.GetSingleNftCreatorNfts(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"creator_address" : "토큰 목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<contract_address>/<from_address>/from-transactions
result, err := ethClient.GetSingleNftTxs(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"from_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<contract_address>/<token_id>/nft-transactions
result, err := ethClient.GetSingleNftTokenTxs(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"token_id" : "NFT 토큰 ID",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/single-nft/<contract_address>/<token_id>/info
result, err := ethClient.GetSingleNftInfo(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"token_id" : "NFT 토큰 ID",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<contract_address>/nfts
result, err := ethClient.GetMultiNfts(map[string]interface{}{
"contract_address" :"NFT 컨트렉트 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<owner_address>/owner-nfts
result, err := ethClient.GetMultiOwnerNfts(map[string]interface{}{
"owner_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<creator_address>/creator-nfts
result, err := ethClient.GetMultiCreatorNfts(map[string]interface{}{
"creator_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<from_address>/transactions
result, err := ethClient.GetMultiTxs(map[string]interface{}{
"from_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<contract_address>/<owner_address>/owner-nfts
result, err := ethClient.GetMultiNftOwnerNfts(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"owner_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<contract_address>/<creator_address>/creator-nfts
result, err := ethClient.GetMultiNftCreatorNfts(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"creator_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<contract_address>/<from_address>/from-transactions
result, err := ethClient.GetMultiNftTxs(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"from_address" : "목록을 조회할 주소",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<contract_address>/<token_id>/info
result, err := ethClient.GetMultiNftInfo(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"token_id" : "NFT 토큰 ID",
"offset" : "0",
"limit" : "10",
});
GET /v3/eth/multi-nft/<contract_address>/<token_id>/nft-transactions
result, err := ethClient.GetMultiNftTokenTxs(map[string]interface{}{
"contract_address" : "NFT 컨트렉트 주소",
"token_id" : "NFT 토큰 ID",
"offset" : "0",
"limit" : "10",
});
POST /v3/eth/contract/<contract_address>/read
result, err := ethClient.ReadContract(map[string]interface{}{
"contract_address" : "컨트렉트 주소",
"method" : "실행할 함수 명",
"return_type" : "반환 데이터 타입",
"parameter_type" : []interface{}{"인풋 파라미터 타입"},
"parameter_data" : []interface{}{"인풋 파라미터 데이터"},
});
POST /v3/eth/contract/<contract_address>/write
result, err := ethClient.WriteContract(map[string]interface{}{
"contract_address" : "컨트렉트 주소",
"from" : "트랜잭션을 생성할 주소",
"private_key" : "from 의 프라이빗키",
"method" : "실행할 함수 명",
"parameter_type" : []interface{}{"인풋 파라미터 타입"},
"parameter_data" : []interface{}{"인풋 파라미터 데이터"},
});