이더리움 개발자 문서 바로가기 함수 호출에 필요한 매개변수 또는 반환되는 데이터에 대해서는 REST API 개발자 문서를 참고해 주시길 바랍니다.
<?php
use BlockSDK;
$blockSDK = new BlockSDK("YOU_TOKEN");
$ethereumClient = $blockSDK->createEthereum();
//or
$ethereumClient = BlockSDK::createEthereum("YOU_TOKEN");
엔드 포인트를 지정해주지 않는경우 테스트넷으로 기본 설정되어 호출 됩니다 메인넷은 아래 예시와 같이 클라이언트 생성시 두번째 매개변수를 메인넷으로 지정해 주시길 바랍니다.
<?php
use BlockSDK;
$blockSDK = new BlockSDK("YOU_TOKEN","https://mainnet-api.blocksdk.com");
$ethereumClient = $blockSDK->createEthereum();
//or
$ethereumClient = BlockSDK::createEthereum("YOU_TOKEN","https://mainnet-api.blocksdk.com");
모든 URL,Query,Body 매개변수는 모든 함수는 첫번쨰 인수를 Array 형 으로
key = 매개변수명
value = 매개변수값
형태로 호출하실수 있습니다.
<?php
$nfts = $ethereumClient->GetSingleNfts([
"contract_address" => "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b",
"includeMetadata" => true,
"offset" => 0,
"limit" => 10
]);
GET /v3/eth/info
$result = $ethereumClient->GetBlockChainInfo();
GET /v3/eth/block/<block>
$result = $ethereumClient->GetBlock([
'block' => "blockNumber 또는 blockHash"
]);
GET /v3/eth/address
$result = $ethereumClient->GetAddresses([
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/address/<address>/info
$result = $ethereumClient->GetAddressInfo([
'address' => "주소",
'offset' => 0,
'limit' => 10
]);
POST /v3/eth/address
$result = $ethereumClient->CreateAddress([
'name' => "test"
]);
GET /v3/eth/address/<address>/balance
$result = $ethereumClient->GetAddressBalance([
'address' => "주소"
]);
POST /v3/eth/address/<from_address>/send
$result = $ethereumClient->Send([
'from_address' => "주소",
'to' => "주소",
'amount' => "보낼 양",
'private_key' => "보내는 주소 키"
]);
POST /v3/eth/transaction/send
$result = $ethereumClient->SendTransaction([
'hex' => "서명된 트랜잭션 hex"
]);
GET /v3/eth/transaction/<tx_hash>
$result = $ethereumClient->GetTransaction([
'tx_hash' => "트랜잭션 해쉬"
]);
GET /v3/eth/token/<contract_address>/info
$result = $ethereumClient->GetTokenInfo([
'contract_address' => "ERC20 토큰 컨트렉트 주소"
]);
GET /v3/eth/token/<contract_address>/<from_address>/balance
$result = $ethereumClient->GetTokenBalance([
'contract_address' => "ERC20 토큰 컨트렉트 주소",
'from_address' => "잔액을 조회할 주소"
]);
POST /v3/eth/token/<contract_address>/<from_address>/transfer
$result = $ethereumClient->SendToken([
'contract_address' => "ERC20 토큰 컨트렉트 주소",
'from_address' => "토큰을 전송할 주소",
'to' => "주소",
'amount' => "보낼 양",
'private_key' => "보내는 주소 키"
]);
GET /v3/eth/token/<from_address>/transactions
$result = $ethereumClient->GetTokenTxs([
'from_address' => "거래 내역을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/token/<contract_address>/<from_address>/transactions
$result = $ethereumClient->GetTokenContractTxs([
'contract_address' => "ERC20 토큰 컨트렉트 주소",
'from_address' => "거래 내역을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/token/<from_address>/all-balance
$result = $ethereumClient->GetTokenAllBalance([
'from_address' => "토큰 목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/nfts
$result = $ethereumClient->GetSingleNfts([
'contract_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<owner_address>/owner-nfts
$result = $ethereumClient->GetSingleOwnerNfts([
'owner_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<creator_address>/creator-nfts
$result = $ethereumClient->GetSingleCreatorNfts([
'creator_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<from_address>/transactions
$result = $ethereumClient->GetSingleTxs([
'from_address' => "토큰 목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/<owner_address>/owner-nfts
$result = $ethereumClient->GetSingleNftOwnerNfts([
'contract_address' => "목록을 조회할 주소",
'owner_address' => "월렛 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/<creator_address>/creator-nfts
$result = $ethereumClient->GetSingleNftCreatorNfts([
'contract_address' => "NFT 컨트렉트 주소",
'creator_address' => "토큰 목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/<from_address>/from-transactions
$result = $ethereumClient->GetSingleNftTxs([
'contract_address' => "NFT 컨트렉트 주소",
'from_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/<token_id>/nft-transactions
$result = $ethereumClient->GetSingleNftTokenTxs([
'contract_address' => "NFT 컨트렉트 주소",
'token_id' => "NFT 토큰 ID",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/<token_id>/info
$result = $ethereumClient->GetSingleNftInfo([
'contract_address' => "NFT 컨트렉트 주소",
'token_id' => "NFT 토큰 ID",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<contract_address>/nfts
$result = $ethereumClient->GetMultiNfts([
'contract_address' =>"NFT 컨트렉트 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<owner_address>/owner-nfts
$result = $ethereumClient->GetMultiOwnerNfts([
'owner_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<creator_address>/creator-nfts
$result = $ethereumClient->GetMultiCreatorNfts([
'creator_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<from_address>/transactions
$result = $ethereumClient->GetMultiTxs([
'from_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<contract_address>/<owner_address>/owner-nfts
$result = $ethereumClient->GetMultiNftOwnerNfts([
'contract_address' => "NFT 컨트렉트 주소",
'owner_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<contract_address>/<creator_address>/creator-nfts
$result = $ethereumClient->GetMultiNftCreatorNfts([
'contract_address' => "NFT 컨트렉트 주소",
'creator_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<contract_address>/<from_address>/from-transactions
$result = $ethereumClient->GetMultiNftTxs([
'contract_address' => "NFT 컨트렉트 주소",
'from_address' => "목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<contract_address>/<token_id>/info
$result = $ethereumClient->GetMultiNftInfo([
'contract_address' => "NFT 컨트렉트 주소",
'token_id' => "NFT 토큰 ID",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<contract_address>/<token_id>/nft-transactions
$result = $ethereumClient->GetMultiNftTokenTxs([
'contract_address' => "NFT 컨트렉트 주소",
'token_id' => "NFT 토큰 ID",
'offset' => 0,
'limit' => 10
]);
POST /v3/eth/contract/<contract_address>/read
$result = $ethereumClient->ReadContract([
'contract_address' => "컨트렉트 주소",
'method' => "ownerOf",
'return_type' => "address",
'parameter_type' => ["uint256"],
'parameter_data' => [1]
]);
POST /v3/eth/contract/<contract_address>/write
$result = $ethereumClient->WriteContract([
'contract_address' => "컨트렉트 주소",
'from' => "트랜잭션을 생성할 주소",
'private_key' => "from 의 프라이빗키",
'method' => "transfer",
'parameter_type' => ["uint256"],
'parameter_data' => [1]
]);
GET /v3/eth/single-nft/<contract_address>/auction-nfts
$result = $ethereumClient->GetSingleNftAuctionNfts([
'contract_address' => "NFT 컨트렉트 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/<seller_address>/sale-nfts
$result = $ethereumClient->GetSingleNftSellerNfts([
'contract_address' => "NFT 컨트렉트 주소",
'seller_address' => "토큰 목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/single-nft/<contract_address>/<token_id>/nft-bids
$result = $ethereumClient->GetSingleNftTokenBids([
'contract_address' => "NFT 컨트렉트 주소",
'token_id' => "NFT 토큰 ID",
'offset' => 0,
'limit' => 10
]);
GET /v3/eth/multi-nft/<contract_address>/<seller_address>/seller-nfts
$result = $ethereumClient->GetMultiNftSellerNfts([
'contract_address' => "NFT 컨트렉트 주소",
'seller_address' => "토큰 목록을 조회할 주소",
'offset' => 0,
'limit' => 10
]);