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