Skip to main content

GID registrar abi doc

ExecuteMsg


1. Register new token(controller only)

ExecuteMsg::Register

Json Parameters

nametypedata typedescription
token_inforequiredoehect/TokenInforegist token info
namerequiredstringtoken name
durationoptionalintegerexpires duration

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"set_record":{"node":[116,159,43,71,155,69,229,218,142,76,190,205,146,110,233,166,247,141,181,66,79,166,153,59,110,202,186,186,93,115,107,18],"owner":"GIO_OWNER_ADDRESS","resolver":"resolver_address","ttl":1}}" --from wallet $TXFLAG -y

2. Add new controller(admin only)

ExecuteMsg::AddController

Json Parameters

nametypedata typedescription
addressrequiredstringcontroller contract address

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"add_controller":{"address": "CONTROLLER_ADDRESS"}}" --from wallet $TXFLAG -y

3. Remove controller(admin only)

ExecuteMsg::RemoveController

Json Parameters

nametypedata typedescription
addressrequiredstringcontroller contract address

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"remove_controller":{"address": "CONTROLLER_ADDRESS"}}" --from wallet $TXFLAG -y

4.Set config(admin only)

ExecuteMsg::SetConfig

Json Parameters

nametypedata typedescription
grace_periodrequiredintegergrace period for expires check
registry_addressrequiredstringregistry contract address
ownerrequiredstringcontract owner address

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"remove_controller":{"address": "CONTROLLER_ADDRESS"}}" --from wallet $TXFLAG -y

5.Renew token duration by id(controller only)

ExecuteMsg::Renew

Json Parameters

nametypedata typedescription
idrequiredstringtoken id
durationrequiredintegerrenew token duration

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"renew":{"id": "TOKEN_ID", "duration": 100}}" --from wallet $TXFLAG -y

6. Transfer token to another account

ExecuteMsg::TransferNft

Json Parameters

nametypedata typedescription
recipientrequiredstringrecipient addresss
token_idrequiredstringtransfer token id

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"transfer_nft":{"token_id": "TOKEN_ID", "recipient": "RECIPIENT_ADDRESS"}}" --from wallet $TXFLAG -y

7. Send token to contract

ExecuteMsg::SendNft

Json Parameters

nametypedata typedescription
contractrequiredstringrecipient contract addresss
token_idrequiredstringtransfer token id
msgrequiredbinanryraw msg

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"send_nft":{"token_id": "TOKEN_ID", "contract": "RECIPIENT_CONTRACT_ADDRESS", "msg": "0x01"}}" --from wallet $TXFLAG -y

8. Approve(Allows operator to transfer / send the token from the owner's account)

ExecuteMsg::Approve

Json Parameters

nametypedata typedescription
spenderrequiredstringapprove spender
token_idrequiredstringtoken id
expiresoptionalobject/expirationapprove duration, at_height(integer)/at_time(integer)/never{}

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"approve":{"spender": "SPENDER_ADDRESS", "token_id": "APPROVE_TOKEN_ID","expires": {"never":{}}}}" --from wallet $TXFLAG -y

9. Revoke(remove approve spender)

ExecuteMsg::Approve

Json Parameters

nametypedata typedescription
spenderrequiredstringapprove spender
token_idrequiredstringtoken id

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"revoke":{"spender": "SPENDER_ADDRESS", "token_id": "APPROVE_TOKEN_ID","expires": {"never":{}}}}" --from wallet $TXFLAG -y

10. Approve all (Add operator from the owner's account)

ExecuteMsg::ApproveAll

Json Parameters

nametypedata typedescription
operatorrequiredstringapprove spender
expiresoptionalobject/expirationapprove duration, at_height(integer)/at_time(integer)/never{}

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"approve_all":{"operator": "SPENDER_ADDRESS","expires": "never"}}}" --from wallet $TXFLAG -y

11. Revoke all (remove operator from the owner's account)

ExecuteMsg::RevokeAll

Json Parameters

nametypedata typedescription
operatorrequiredstringapprove spender

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"approve_all":{"operator": "SPENDER_ADDRESS","expires": {"never":{}}}}" --from wallet $TXFLAG -y

12. Burn token

ExecuteMsg::Burn

Json Parameters

nametypedata typedescription
token_idrequiredstringburn token id

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"burn":{"token_id": "TOKEN_ID"}}" --from wallet $TXFLAG -y

13. Mint token(admin only)

ExecuteMsg::Mint

Json Parameters

nametypedata typedescription
mintrequiredobject/mintmint token infomation

Example call

 gotabitd tx wasm execute $REGISTRAR_CONTRACT $NODE "{"mint":{"token_id":"TOKEN_ID","owner":"OWNER_ADDRESS","token_uri":"Allows the owner to petrify anyone looking at him or her","extension":"token_extra_infomation"}}" --from wallet $TXFLAG -y

QueryMsg


1. Query config

QueryMsg::GetConfig

Json Parameters

None

Binary Reponse

namedata typedescription
grace_periodintegergrace period
registry_addressstringregistry contract address
ownerstringowner address
base_nodebytesbase node
base_namestringbase node name

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"get_config":{}}" --from wallet $TXFLAG -y

2. Query registry contract address

QueryMsg::GetRegistry

Json Parameters

None

Binary Reponse

nametypedata typedescription
registry_addressstringregistry contract address

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"get_registry":{}}" --from wallet $TXFLAG -y

3. Query grace period

QueryMsg::GetGracePeriod

Json Parameters

None

Binary Reponse

nametypedata typedescription
grace_periodintegergrace period

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"get_grace_period":{}}" --from wallet $TXFLAG -y

4. Query base node

QueryMsg::GetBaseNode

Json Parameters

None

Binary Reponse

nametypedata typedescription
base_nodebytesbase node

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"get_grace_period":{}}" --from wallet $TXFLAG -y

5. Query token id

QueryMsg::IsAvailable

Json Parameters

nametypedata typedescription
idrequiredstringtoken id

Binary Reponse

nametypedata typedescription
availableboolis available

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"is_available":{"available": true}}" --from wallet $TXFLAG -y

6. Query expires by given id

QueryMsg::GetExpires

Json Parameters

nametypedata typedescription
idrequiredstringtoken id

Binary Reponse

nametypedata typedescription
expiresintegerexpires duration

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"get_expires":{"id": "TOKEN_ID"}}" --from wallet $TXFLAG -y

7. Query owner of the given token

QueryMsg::OwnerOf

Json Parameters

nametypedata typedescription
token_idrequiredstringtoken id
include_expiredoptionalboolfilter expired

Binary Reponse

nametypedata typedescription
ownerstringtoken owner
approvalsarray/object approvalapprovals
approval object
nametypedata typedescription
spenderstringspender address
expiresobjectexpires enum. at_height{u64)/at_time(integer)/never{}

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"owner_of":{"token_id": "TOKEN_ID", "include_expired": true}}" --from wallet $TXFLAG -y

8. Query approval of the given token

QueryMsg::Approval

Json Parameters

nametypedata typedescription
token_idrequiredstringtoken id
spenderrequiredstringspender address
include_expiredoptionalboolfilter expired

Binary Reponse

nametypedata typedescription
approvalsobject approvalapprovals
approval object
nametypedata typedescription
spenderstringspender address
expiresobjectexpires enum. at_height{u64)/at_time(integer)/never{}

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"approval":{"token_id": "TOKEN_ID", "include_expired": true, "spender": "SPENDER_ADDRESS"}}" --from wallet $TXFLAG -y

9. Query approvals of the given token

QueryMsg::Approvals

Json Parameters

nametypedata typedescription
token_idrequiredstringtoken id
include_expiredoptionalboolfilter expired

Binary Reponse

nametypedata typedescription
approvalsarray/object approvalapprovals
approval object
nametypedata typedescription
spenderstringspender address
expiresobjectexpires enum. at_height{u64)/at_time(integer)/never{}

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"approvals":{"token_id": "TOKEN_ID", "include_expired": true, "spender": "SPENDER_ADDRESS"}}" --from wallet $TXFLAG -y

10. Query all operators for given owner

QueryMsg::AllOperators

Json Parameters

nametypedata typedescription
ownerrequiredstringowner address
include_expiredoptionalboolfilter expired
start_afteroptionalstringfilter key
limitoptionalintegerpagination limit

Binary Reponse

nametypedata typedescription
operatorsarray/object approvalapprovals
approval object
nametypedata typedescription
spenderstringspender address
expiresobjectexpires enum. at_height{u64)/at_time(integer)/never{}

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"all_operators":{"owner": "OWNER_ADDRESS", "include_expired": true, "start_after": None, "limit": 10}}" --from wallet $TXFLAG -y

11. Query numbers of token

QueryMsg::NumTokens

Json Parameters

None

Binary Reponse

nametypedata typedescription
countintegernumbers of token

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"num_tokens":{}}" --from wallet $TXFLAG -y

12. Query contract infomation

QueryMsg::ContractInfo

Json Parameters

None

Binary Reponse

nametypedata typedescription
namestringtoken name
symbolstringtoken symbol

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"contract_info":{}}" --from wallet $TXFLAG -y

13. Query nft infomation

QueryMsg::NftInfo

Json Parameters

nametypedata typedescription
token_idrequiredstringtoken id

Binary Reponse

nametypedata typedescription
token_uristringtoken uri
extensionstringextension raw msg

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"nft_info":{"token_id": "TOKEN_ID"}}" --from wallet $TXFLAG -y

14. Query all nft infomation

QueryMsg::AllNftInfo

Json Parameters

nametypedata typedescription
token_idrequiredstringtoken id
expiresoptionalobjectexpires enum. at_height{u64)/at_time(integer)/never{}

Binary Reponse

nametypedata typedescription
accessobjectaccess infomation
infoobjectnft info
access object
nametypedata typedescription
ownerstringtoken owner
approvalsarray/object approvalapprovals
info object
nametypedata typedescription
token_uristringtoken uri
extensionstringextension raw msg

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"nft_info":{"token_id": "TOKEN_ID"}}" --from wallet $TXFLAG -y

15. Query all tokens owned by the given address

QueryMsg::Tokens

Json Parameters

nametypedata typedescription
ownerrequiredstringtoken id
start_afteroptionalstringfilter key
limitoptionalintegerpagination limit

Binary Reponse

nametypedata typedescription
tokensarray/stringtokens id

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"tokens":{"owner": "OWNER_ADDRESS", "start_after": None, "limit": 20}}" --from wallet $TXFLAG -y

16. Query all tokens

QueryMsg::AllTokens

Json Parameters

nametypedata typedescription
start_afteroptionalstringfilter key
limitoptionalintegerpagination limit

Binary Reponse

nametypedata typedescription
tokensarray/stringtokens id

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"all_tokens":{"start_after": None, "limit": 20}}" --from wallet $TXFLAG -y

17. Query minter

QueryMsg::Minter

Json Parameters

None

Binary Reponse

nametypedata typedescription
minterstringminter address

Example call

 gotabitd tx wasm query $REGISTRAR_CONTRACT $NODE "{"Minter":{}" --from wallet $TXFLAG -y