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