Account management APIs

POST /v2/account

Summary

새로운 계정을 생성합니다.

Description

새로운 키를 가진 계정을 생성합니다. 해당 account는 accountKeyLegacy를 가집니다.

Request Headers

Name

Description

Required

Data Type

x-krn

KRN ID

Yes

string

Request

curl -i -X POST -H 'Content-Type: application/json' -H 'X-Krn: krn:1001:wallet:GC1:account:rp1' -u {your_accessKeyId}:{your_secretAccessKey} --max-time 10 --globoff 'https://wallet-api.beta.klaytn.io/v2/account'

Responses

200 - OK

Name

Type

code

number

result

object

{
"code": 0,
"result": {
"address": "0xf0bD4a5A0D24D07cD6Cb85fad844F0020ddD7c9c",
"chain_id": 1001,
"created_at": 1592458189,
"key_id": "krn:1001:wallet:GC1:account:rp1:0xd164da94c2d93c94c97c1db31bae6371a88c37ddd4e78fbed815926e3cc83294",
"krn": "krn:1001:wallet:GC1:account:rp1",
"public_key": "0x04958fa8709c5fa5723083d06629344164d01d70d91af990b6af5cf3250ff5368f1f31400e367f25850515a9d5e3314d43ca5b29f5c21dee524b80b033273b0fcc",
"updated_at": 1592458189
}
}

GET /v2/account

Summary

주어진 주소를 가진 계정 정보를 가져옵니다.

Description

주어진 주소를 가진 계정 정보를 가져옵니다. 주어진 계정이 해당 account pool 내에 없는 경우 조회되지 않습니다.

Request Headers

Name

Description

Required

Data Type

x-krn

KRN ID

Yes

string

Body Parameters

Name

Description

Required

Data Type

address

Account address

Yes

string

Request

curl -i -X GET -H 'Content-Type: application/json' -H 'X-Krn: krn:1001:wallet:GC1:account:rp1' -u {your_accessKeyId}:{your_secretAccessKey} -d '{ "address": "0x45fF7478e1ffFB807e5c940C3cc68734b0c52b6c" }' --max-time 10 --globoff 'https://wallet-api.beta.klaytn.io/v2/account'

Responses

200 - OK

Name

Type

code

number

result

object

{
"code": 0,
"result": {
"address": "0x45fF7478e1ffFB807e5c940C3cc68734b0c52b6c",
"chain_id": 1001,
"created_at": 1592458610,
"key_id": "krn:1001:wallet:GC1:account:rp1:0x5f316523bec26b7effcdda9b892fe5136da905aefb0ecca77e2d0822aa294514",
"krn": "krn:1001:wallet:GC1:account:rp1",
"public_key": "0x04f751fc5e35e73faa7b0465513d14aa7e5fd8eb460c098e3755c852bee5a2ddded4a087c79bdb84b122848aa257368b3305795e7300c344a6e9e1bb1c0ba5588a",
"updated_at": 1592458610
}
}

PUT /v2/account/multisig

Summary

주어진 계정을 multisig 계정으로 업데이트합니다.

Description

weighted_keys에 주어진 키를 이용하여 multisig 계정으로 업데이트합니다. 업데이트를 위해선 해당 계정에 적당한 양의 KLAY가 필요합니다.

Request Headers

Name

Description

Required

Data Type

x-krn

KRN ID

Yes

string

Body Parameters

Name

Description

Required

Data Type

address

Account address

Yes

string

threshold

Threshold

Yes

number

weighted_keys

Collection of weighted keys

Yes

array

weight

Weight

Yes

number

public_key

Public key

Yes

string

Request

curl -i -X PUT -H 'Content-Type: application/json' -H 'X-Krn: krn:1001:wallet:GC1:account:rp1' -u {your_accessKeyId}:{your_secretAccessKey} -d '{ "address": "0xae21f5dd359486f5ed94172f14b1b89522b60c33", "threshold": 6, "weighted_keys": [ { "weight": 3, "public_key": "0x0410e4ee08e94afab1479359eae52e502bcf6e7fbbafdd22c81d55fcf497ec027c085f6605730563e1baf0349c1039912bd51a336f0899f291369b00300f6c2afb" }, { "weight": 3, "public_key": "0x049a1dad2f2b3a339a58fa63ac04e3d6c9cc3479ccb67cf4035052f409153e959935b9c450a503b9077ca78f75720e114d904f57c2cf09b189bef35e092ddeef18" }, { "weight": 3, "public_key": "0x04493c47a0144a656910eba22cab6c17fa9929003106449d497454bf70db79c1a31d0f5f0d071810b9e98b1f13719384127ca4bc44e29fec150acdcb915e2dd83f" } ] }' --max-time 10 --globoff 'https://wallet-api.beta.klaytn.io/v2/account/multisig'

Responses

200 - OK

Name

Type

code

number

result

object

{
"code": 0,
"result": {
"address": "0xae21f5dd359486f5ed94172f14b1b89522b60c33",
"krn": "krn:1001:wallet:GC1:account:rp1",
"multi_sig_keys": [
{
"public_key": "0x0410e4ee08e94afab1479359eae52e502bcf6e7fbbafdd22c81d55fcf497ec027c085f6605730563e1baf0349c1039912bd51a336f0899f291369b00300f6c2afb",
"weight": 3
},
{
"public_key": "0x049a1dad2f2b3a339a58fa63ac04e3d6c9cc3479ccb67cf4035052f409153e959935b9c450a503b9077ca78f75720e114d904f57c2cf09b189bef35e092ddeef18",
"weight": 3
},
{
"public_key": "0x04493c47a0144a656910eba22cab6c17fa9929003106449d497454bf70db79c1a31d0f5f0d071810b9e98b1f13719384127ca4bc44e29fec150acdcb915e2dd83f",
"weight": 3
}
],
"threshold": 6,
"transaction_hash": "0x247f9b520cfdf465ff15946180dfbcf608fe4a8b7a265c8d1f95cf9d5c81fd95",
"updated_at": 1592458623
}
}

POST /v2/account/disable

Summary

해당 계정을 비활성화 합니다.

Description

해당 계정을 비활성화하며 이 경우 서명에 해당 계정을 사용할 수 없습니다.

Request Headers

Name

Description

Required

Data Type

x-krn

KRN ID

Yes

string

Body Parameters

Name

Description

Required

Data Type

address

Account address

Yes

string

Request

curl -i -X POST -H 'Content-Type: application/json' -H 'X-Krn: krn:1001:wallet:GC1:account:rp1' -u {your_accessKeyId}:{your_secretAccessKey} -d '{ "address": "0x41D24580cB9629923decDFDe12E4622D3634683c" }' --max-time 10 --globoff 'https://wallet-api.beta.klaytn.io/v2/account/disable'

Responses

200 - OK

Name

Type

code

number

result

object

{
"code": 0,
"result": {
"address": "0x41D24580cB9629923decDFDe12E4622D3634683c",
"krn": "krn:1001:wallet:GC1:account:rp1",
"updated_at": 1592458633
}
}

POST /v2/account/enable

Summary

해당 계정을 활성화 합니다.

Description

비활성화된 계정을 다시 활성화 시킵니다.

Request Headers

Name

Description

Required

Data Type

x-krn

KRN ID

Yes

string

Body Parameters

Name

Description

Required

Data Type

address

Account address

Yes

string

Request

curl -i -X POST -H 'Content-Type: application/json' -H 'X-Krn: krn:1001:wallet:GC1:account:rp1' -u {your_accessKeyId}:{your_secretAccessKey} -d '{ "address": "0xC5f8d122AF2DBbA6BBa0494ecB5C58a7EE213896" }' --max-time 10 --globoff 'https://wallet-api.beta.klaytn.io/v2/account/enable'

Responses

200 - OK

Name

Type

code

number

result

object

{
"code": 0,
"result": {
"address": "0xC5f8d122AF2DBbA6BBa0494ecB5C58a7EE213896",
"krn": "krn:1001:wallet:GC1:account:rp1",
"updated_at": 1592458643
}
}

DELETE /v2/account

Summary

해당 계정을 삭제합니다.

Description

해당 계정을 삭제하며 이 경우 POST /v2/account/enable 을 통해 활성화 시도하더라도 다시 활성화되지 않습니다.

Request Headers

Name

Description

Required

Data Type

x-krn

KRN ID

Yes

string

Body Parameters

Name

Description

Required

Data Type

address

Account address

Yes

string

Request

curl -i -X DELETE -H 'Content-Type: application/json' -H 'X-Krn: krn:1001:wallet:GC1:account:rp1' -u {your_accessKeyId}:{your_secretAccessKey} -d '{ "address": "0x06d4f5D31548F61a92a51Adbe2AD6C49fdf839bc" }' --max-time 10 --globoff 'https://wallet-api.beta.klaytn.io/v2/account'

Responses

200 - OK

Name

Type

code

number

result

object

{
"code": 0,
"result": {
"status": "deleted"
}
}