폴리곤 개발자 문서 바로가기 함수 호출에 필요한 매개변수 또는 반환되는 데이터에 대해서는 REST API 개발자 문서를 참고해 주시길 바랍니다.
Polygon maticClient = new Polygon("YOU_TOKEN");
엔드 포인트를 지정해주지 않는경우 테스트넷으로 기본 설정되어 호출 됩니다 메인넷은 아래 예시와 같이 클라이언트 생성시 두번째 매개변수를 메인넷으로 지정해 주시길 바랍니다.
Polygon maticClient = new Polygon("YOU_TOKEN","https://mainnet-api.blocksdk.com");
GET /v3/matic/info
Map<String, Object> result = maticClient.GetBlockChainInfo().join();
GET /v3/matic/block/<block>
Map<String, Object> data = new HashMap<>();
data.put("block", "blockNumber 또는 blockHash")
Map<String, Object> result = maticClient.GetBlock(data).join();
GET /v3/matic/address
Map<String, Object> data = new HashMap<>();
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetAddresses(data).join();
GET /v3/matic/address/<address>/info
Map<String, Object> data = new HashMap<>();
data.put("address", "주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetAddressInfo(data).join();
POST /v3/matic/address
Map<String, Object> data = new HashMap<>();
data.put("name", "test")
Map<String, Object> result = maticClient.CreateAddress(data).join();
GET /v3/matic/address/<address>/balance
Map<String, Object> data = new HashMap<>();
data.put("address", "주소")
Map<String, Object> result = maticClient.GetAddressBalance(data).join();
POST /v3/matic/address/<from_address>/send
Map<String, Object> data = new HashMap<>();
data.put("from", "주소")
data.put("to", "주소")
data.put("amount", "보낼 양")
data.put("private_key", "보내는 주소 키")
Map<String, Object> result = maticClient.Send(data).join();
POST /v3/matic/transaction/send
Map<String, Object> data = new HashMap<>();
data.put("hex", "서명된 트랜잭션 hex")
Map<String, Object> result = maticClient.SendTransaction(data).join();
GET /v3/matic/transaction/<tx_hash>
Map<String, Object> data = new HashMap<>();
data.put("hash", "트랜잭션 해쉬")
Map<String, Object> result = maticClient.GetTransaction(data).join();
GET /v3/matic/token/<contract_address>/info
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "ERC20 토큰 컨트렉트 주소")
Map<String, Object> result = maticClient.GetTokenInfo(data).join();
GET /v3/matic/token/<contract_address>/<from_address>/balance
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "ERC20 토큰 컨트렉트 주소")
data.put("from_address", "잔액을 조회할 주소")
Map<String, Object> result = maticClient.GetTokenBalance(data).join();
POST /v3/matic/token/<contract_address>/<from_address>/transfer
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "ERC20 토큰 컨트렉트 주소")
data.put("from_address", "토큰을 전송할 주소")
data.put("to", "주소")
data.put("amount", "보낼 양")
data.put("private_key", "보내는 주소 키")
Map<String, Object> result = maticClient.SendToken(data).join();
GET /v3/matic/token/<from_address>/transactions
Map<String, Object> data = new HashMap<>();
data.put("from_address", "거래 내역을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetTokenTxs(data).join();
GET /v3/matic/token/<contract_address>/<from_address>/transactions
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "ERC20 토큰 컨트렉트 주소")
data.put("from_address", "거래 내역을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetTokenContractTxs(data).join();
GET /v3/matic/token/<from_address>/all-balance
Map<String, Object> data = new HashMap<>();
data.put("from_address", "토큰 목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetTokenAllBalance(data).join();
GET /v3/matic/single-nft/<contract_address>/nfts
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleNfts(data).join();
GET /v3/matic/single-nft/<owner_address>/owner-nfts
Map<String, Object> data = new HashMap<>();
data.put("owner_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleOwnerNfts(data).join();
GET /v3/matic/single-nft/<creator_address>/creator-nfts
Map<String, Object> data = new HashMap<>();
data.put("creator_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleCreatorNfts(data).join();
GET /v3/matic/single-nft/<from_address>/transactions
Map<String, Object> data = new HashMap<>();
data.put("from_address", "토큰 목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleTxs(data).join();
GET /v3/matic/single-nft/<contract_address>/<owner_address>/owner-nfts
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("owner_address", "토큰 목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleNftOwnerNfts(data).join();
GET /v3/matic/single-nft/<contract_address>/<creator_address>/creator-nfts
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("creator_address", "토큰 목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleNftCreatorNfts(data).join();
GET /v3/matic/single-nft/<contract_address>/<from_address>/from-transactions
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("from_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleNftTxs(data).join();
GET /v3/matic/single-nft/<contract_address>/<token_id>/nft-transactions
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("token_id", "NFT 토큰 ID")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleNftTokenTxs(data).join();
GET /v3/matic/single-nft/<contract_address>/<token_id>/info
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("token_id", "NFT 토큰 ID")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetSingleNftInfo(data).join();
GET /v3/matic/multi-nft/<contract_address>/nfts
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiNfts(data).join();
GET /v3/matic/multi-nft/<owner_address>/owner-nfts
Map<String, Object> data = new HashMap<>();
data.put("owner_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiOwnerNfts(data).join();
GET /v3/matic/multi-nft/<creator_address>/creator-nfts
Map<String, Object> data = new HashMap<>();
data.put("creator_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiCreatorNfts(data).join();
GET /v3/matic/multi-nft/<from_address>/transactions
Map<String, Object> data = new HashMap<>();
data.put("from_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiTxs(data).join();
GET /v3/matic/multi-nft/<contract_address>/<owner_address>/owner-nfts
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("owner_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiNftOwnerNfts(data).join();
GET /v3/matic/multi-nft/<contract_address>/<creator_address>/creator-nfts
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("creator_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiNftCreatorNfts(data).join();
GET /v3/matic/multi-nft/<contract_address>/<from_address>/from-transactions
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("from_address", "목록을 조회할 주소")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiNftTxs(data).join();
GET /v3/matic/multi-nft/<contract_address>/<token_id>/info
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("token_id", "NFT 토큰 ID")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiNftInfo(data).join();
GET /v3/matic/multi-nft/<contract_address>/<token_id>/nft-transactions
Map<String, Object> data = new HashMap<>();
data.put("contract_address", "NFT 컨트렉트 주소")
data.put("token_id", "NFT 토큰 ID")
data.put("offset", "0")
data.put("limit", "10")
Map<String, Object> result = maticClient.GetMultiNftTokenTxs(data).join();
POST /v3/matic/contract/<contract_address>/read
Map<String, Object> request = new HashMap<>();
request.put("contract_address", "컨트렉트 주소");
request.put("method", "실행할 함수 명");
request.put("return_type", "반환 데이터 타입");
request.put("parameter_type", Arrays.asList("인풋 파라미터 타입"));
request.put("parameter_data", Arrays.asList("인풋 파라미터 데이터"));
Map<String, Object> result = maticClient.ReadContract(data).join();
POST /v3/matic/contract/<contract_address>/write
Map<String, Object> request = new HashMap<>();
request.put("contract_address", "컨트렉트 주소");
request.put("from", "트랜잭션을 생성할 주소");
request.put("private_key", "from 의 프라이빗키");
request.put("method", "실행할 함수 명");
request.put("parameter_type", Arrays.asList("인풋 파라미터 타입"));
request.put("parameter_data", Arrays.asList("인풋 파라미터 데이터"));
Map<String, Object> result = maticClient.WriteContract(data).join();