Transaction API는 트랜잭션 전송, 조회 기능을 제공합니다.
트랜잭션 조회
트랜잭션 해시(txhash)를 지정하여 트랜잭션 정보를 조회합니다. 블록체인에 전송되어 블록에 기록된 트랜잭션만 조회할 수 있습니다.
Request URL
Live URL | https://bc-api.qpyou.cn/core/v1/tx/{txhash} |
---|---|
Sandbox URL | https://sandbox-bc-api.qpyou.cn/core/v1/tx/{txhash} |
HTTP Method | GET |
Content-Type | application/json |
Path Parameters
필드명 | 설명 | 타입 | 필수 여부 |
---|---|---|---|
txhash | 트랜잭션 해시 | string | Y |
Header Parameters
필드명 | 설명 | 타입 | 필수 여부 |
---|---|---|---|
x-network | 블록체인 네트워크{ploygon, xpla} | string | Y |
Responses
필드명 | 설명 | 타입 |
---|---|---|
code | api 호출 결과 코드, 0:성공 | number |
message | 결과 메시지 | string |
data | API 응답 데이터 | json |
data.txhash | 트랜잭션 해시 | string |
data.blockNumber | 트랜잭션이 담긴 블록 넘버 | number |
data.status | 트랜잭션 상태이며, 블록체인 블록에 트랜잭션이 성공적으로 기록 완료되면 success |
string |
data.fee | 사용된 수수료 | json |
data.data | 트랜잭션 데이터 | json |
data.logs | 트랜잭션 로그 | json[] |
Request Sample
1 2 3 4 |
curl -X 'GET' \ 'https://sandbox-bc-api.qpyou.cn/core/v1/tx/0x5a0ca3a7eebbafa946da6ed0160930fc4f334887dbf11a9b38937ab8831fd125' \ -H 'accept: application/json' \ -H 'x-network: polygon' |
Response Sample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
// Polygon Transaction { "code": 0, "message": "success", "data": { "txhash": "0x5a0ca3a7eebbafa946da6ed0160930fc4f334887dbf11a9b38937ab8831fd125", "blockNumber": 33457511, "status": "success", "fee": { "gas": 151232, ... }, "data": { "from": "0x9428e6eF51FEb2201676deEc11B7E36F7c1F0765", .. }, "logs": [ { "transactionHash": "0x5a0ca3a7eebbafa946da6ed0160930fc4f334887dbf11a9b38937ab8831fd125", .... } ] } } // Xpla Transaction { "code": 0, "message": "success", "data": { "txhash": "E21E0CC37CD1BCACADFDEBD4C7AF2F68257EA4591D670F4AA0A725B21422C29F", "blockNumber": 4818400, "status": "success", "fee": { "gasUsed": 21000, ... }, "data": { "memo": "", ... }, "logs": [ { "msg_index": 0, ... } ] }} |
트랜잭션 전송
서명한 트랜잭션을 블록체인에 전송합니다.
Request URL
Live URL | https://bc-api.qpyou.cn/core/v1/tx |
---|---|
Sandbox URL | https://sandbox-bc-api.qpyou.cn/core/v1/tx |
HTTP Method | POST |
Content-Type | application/json |
Header Parameters
필드명 | 설명 | 타입 | 필수 여부 |
---|---|---|---|
x-network | 블록체인 네트워크{ploygon, xpla} | string | Y |
Request Body
필드명 | 설명 | 타입 | 필수 여부 |
---|---|---|---|
signedTx | 서명한 트랜잭션 | string | Y |
sync | 트랜잭션 동기/비동기 처리 여부
|
boolean | Y |
Responses
필드명 | 설명 | 타입 |
---|---|---|
code | api 호출 결과 코드, 0:성공 | number |
message | 결과 메시지 | string |
data | API 응답 데이터 | json |
data.txhash | 트랜잭션 해시 | string |
data.status | 트랜잭션 상태 | string |
Request Sample
1 2 3 4 5 6 7 8 9 |
curl -X 'POST' \ 'https://sandbox-bc-api.qpyou.cn/core/v1/tx' \ -H 'accept: application/json' \ -H 'x-network: polygon' \ -H 'Content-Type: application/json' \ -d '{ "signedTx": "0x02f8b58301388181b985016d14154585016d1415578289219494853bdc9c...", "sync": false }' |
Response Sample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// Polygon { "code": 0, "message": "success", "data": { "txhash": "0x53e8783e4da707daf58c96a8cea278e7b2a8a5f185af0913b518974556c79076", "status": "pending" } } // Xpla { "code": 0, "message": "success", "data": { "txhash": "84655BB965D709A4AAD4104C7FFBD8E42F52F0BB313493FFDCA02B01FE983A8F", "status": "pending" } } |