​서버월렛API

ServerWallet API는 HTTP 프로토콜을 지원합니다. /wallet 경로를 사용합니다.

API 주소

Test Server : https://test-api.protx.io/wallet

createAddress

주소를 생성합니다. Server Wallet에 새로운 개인키를 생성한 후 Address, secretKey, mnemonic을 반환한다.

Parameters

NameTypeDescription

addInfo

String

주소 정보. 이것은 getAddressInfo API를 사용하여 검색할 수 있습니다. 최대 길이 : 200

Return Value

NameTypeDescription

address

String

주소

secretKey

String

Server Wallet에 SignData를 요청할 때 인증을 위해 사용합니다. 값을 다시 보거나 API를호출하여 다시 가져올수 없으므로 잘 보관해야 합니다.

mnemonic

String

필요한 경우 주소 복구시에 사용

ImportAddress가 호출되면 새 secretKey가 생성됩니다.

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "bulk tomorrow beauty tag fragile rough quit antique shock river powder ghost",
            "secretKey": "49d274d8fcbd00b862dbfb01a759d233"
        }
    }
}

getAddressInfo

주소 정보를 반환합니다.

Parameters

NameTypeDescription

address

String

주소

Return Value

NameTypeDescription

address

String

주소

addInfo

String

주소 생성 시 저장되는 주소 정보.

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "My Test Address"
        }
    }
}

exportAddress

주어진 주소의 니모닉을 반환합니다. hashKey가 정확하지 않으면 오류를 반환합니다.

Parameters

NameTypeDescription

address

String

주소

languageType

String

니모닉 언어(현재 "en"만 사용 가능)

tempKey

String

tempKey for "exportAddress"

hashKey

String

hash(tempKey | secretKey)

Return Value

NameTypeDescription

mnemonic

String

필요한 경우 주소 복구시에 사용

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "mnemonic": "bulk tomorrow beauty tag fragile rough quit antique shock river powder ghost"
        }
    }
}

importAddress

니모닉을 사용하여 주소를 가져옵니다. Private Key를 Server Wallet에 저장한다. Address, secretKey, mnemonic이 반환된다.

Parameters

NameTypeDescription

languageType

String

니모닉 언어(현재 "en"만 사용 가능)

mnemonic

String

니모닉 문자열

addInfo

String

주소 정보. 이것은 getAddressInfo API를 사용하여 검색할 수 있습니다. 최대 길이 : 200

Return Value

NameTypeDescription

address

String

주소

secretKey

String

Server Wallet에 SignData를 요청할 때 인증을 위해 사용합니다. 값을 다시 보거나 API를호출하여 다시 가져올수 없으므로 잘 보관해야 합니다.

mnemonic

String

니모닉을 사용하여 주소를 복원할 수 있습니다.

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "bulk tomorrow beauty tag fragile rough quit antique shock river powder ghost",
            "secretKey": "49d274d8fcbd00b862dbfb01a759d233"
        }
    }
}

importAddressWithPrivateKey

개인 키를 사용하여 주소를 가져옵니다. Private Key를 Server Wallet에 저장한다. 그리고 Address, secretKey를 반환한다. importAddress 와 달리 니모닉은 반환되지 않습니다..

Parameters

NameTypeDescription

privateKey

String

개인 키

addInfo

String

주소 정보. 이것은 getAddressInfo API를 사용하여 검색할 수 있습니다. 최대 길이 : 200

Return Value

NameTypeDescription

address

String

주소 (0x....)

secretKey

String

Server Wallet에 SignData를 요청할 때 인증을 위해 사용합니다. 값을 다시 보거나 API를호출하여 다시 가져올수 없으므로 잘 보관해야 합니다

mnemonic

String

empty.

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "",
            "secretKey": "49d274d8fcbd00b862dbfb01a759d233"
        }
    }
}

getAddressTokenList

주소가 보유한 토큰 목록을 반환합니다.

Parameters

NameTypeDescription

address

String

주소

Return Value

NameTypeDescription

address

String

주소

contractAddress

String

토큰의 컨트랙주소

symbol

String

토큰의 심볼.

tokenType

String

토큰의 유형 "ERC20", "ERC721", "ERC1155"

tokenId

BigInteger

ERC1155의 tokenId, ERC20, ERC721 토큰의 경우 공백입니다.

balance

BigDecimal

토큰 잔액. ERC1155 토큰의 경우 tokenId의 잔액입니다.

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": { 
            [ 
                { 
                    "address": "0x39fdfdsfsdsdfsdf9sd0sfds9fsd0fsdgsd",
                    "contractAddress": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
                    "symbol": "TOK1",
                    "tokenType": "ERC20",
                    "tokenId": "",
                    "balance": "10.292"
                },
                { 
                    "address": "0x39fdfdsfsdsdfsdf9sd0sfds9fsd0fsdgsd",
                    "contractAddress": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
                    "symbol": "TOK2",
                    "tokenType": "ERC1155",
                    "tokenId": "2",
                    "balance": "10"
                }
            ]
        }
    }
}

signData

트랜잭션을 수행하기 위해 address의 개인 키로 서명된 데이터를 반환합니다.

Parameters

NameTypeDescription

address

String

주소

data

String

서명할 데이터. 이것은 아마도 해시 값일 것입니다.

tempKey

String

tempKey for "signData"

hashKey

String

hash(tempKey | secretKey)

Return Value

NameTypeDescription

signedData

String

서명된 데이터

Example

{
    "jsonrpc": "2.0",
    "id": "00456", 
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "signedData": "3043021f6741c7c4ec...ac6d7f7ba8350608"
        }
    }
}

Last updated