Skip to main content

Map

Database (MongoDB)

land

FieldTypedescription
_idObjectIdPrimary Key
coordinatePointx=pointer.x/1000; y=pointer.y/1000, For example: {x:109,y:163}, save as:(0.109, 0.163)
xIntpointer x
yIntpointer y
land_typeIntland type
contractStringContract Address
ownerStringOwner Address
token_idinttoken id
uriStringtoken uri
mint_timeintMint Time
mint_blockNumberLongMint Block Number
mint_txStringMint txid
estate_token_idintestate token id
created_atintcreated time
updated_atintupdated time

estate

FieldTypedescription
_idObjectIdPrimary Key
contractStringcontract address
ownerStringowner address
token_idLongtoken id
uriStringtoken uri
minterStringminter address
mint_timeintMint Time
mint_blockNumberLongMint Block Number
mint_txStringMint txid
land_numberintland number
nameStringowner custom name
descriptionStringowner custom description
imageStringowner custom image uri
statusintstatus
created_atintcreated time
updated_atintupdated time

API

land/query

params:

ParamTypedescription
nearJsonpointer [103,222]
[x,y]
distanceIntcoordinate radius: Use with near (100 ≈ 1 pointer)
geo_boxJson[-125.0, 35.0, -100.0, 40.0]
[x1,y1,x2,y2]
x1,y1 left bottom pointer x2,y2 right top pointer
contract_addressStringContract Address
owner_addressStringOwner Address
typeintland_type
lasttimeinttimestamp, add this parameter to query data after the specified time

Result:

{
"error_code": 1,
"result": {
"data": {
"103,103": {
"x": 103,
"y": 103,
"type": 1,
"owner": "",
"estate_token_id": -1
},
"103,104": {
"x": 103,
"y": 104,
"type": 1,
"owner": "",
"estate_token_id": -1
}
},
"lasttime": 1638366584
}
}

estate/query

Params:

ParamTypedescription
contract_addressStringcontract address
owner_addressStringowner address
token_idIntestate token id

Result:

{
"error_code":1,
"result":{
"data":{
"0":{
"name":"estate 0",
"description":"Andverse is a decentralized multigalactic metaverse.",
"tokenURI":"https://andverse-api.newtonproject.dev.diynova.com/api/v1/estate/0",
"owner":"0x97549e368acafdcae786bb93d98379f1d1561a29",
"lands":{
"212,152":{
"x":212,
"y":152,
"type":3,
"owner":"0x9bb40de2248645be20679819b78b75900bd08846"
}
}
},
"1":{
"name":"estate 1",
"description":"Andverse is a decentralized multigalactic metaverse.",
"tokenURI":"https://andverse-api.newtonproject.dev.diynova.com/api/v1/estate/1",
"owner":"0x97549e368acafdcae786bb93d98379f1d1561a29",
"lands":{
"210,153":{
"x":210,
"y":153,
"type":3,
"owner":"0x9bb40de2248645be20679819b78b75900bd08846"
},
"211,152":{
"x":211,
"y":152,
"type":3,
"owner":"0x9bb40de2248645be20679819b78b75900bd08846"
},
"211,153":{
"x":211,
"y":153,
"type":3,
"owner":"0x9bb40de2248645be20679819b78b75900bd08846"
},
"212,153":{
"x":212,
"y":153,
"type":3,
"owner":"0x9bb40de2248645be20679819b78b75900bd08846"
}
}
},
"2":{
"name":"estate 2",
"description":"Andverse is a decentralized multigalactic metaverse.",
"tokenURI":"https://andverse-api.newtonproject.dev.diynova.com/api/v1/estate/2",
"owner":"0xb6a9ed97417ce2086c1ec0114a88ac3671f4a687",
"lands":{
"197,123":{
"x":197,
"y":123,
"type":3,
"owner":"0x9bb40de2248645be20679819b78b75900bd08846"
},
"198,123":{
"x":198,
"y":123,
"type":3,
"owner":"0x9bb40de2248645be20679819b78b75900bd08846"
}
}
}
},
"lasttime":1638366584
}
}

estate/metadata/update

Params

ParamTypedescription
contract_addressStringcontract address
token_idStringtoken id
nameStringname
descriptionStringdescription
imageStringimage url
signatureStringsignature

Signature Method



1. splicing the signature string

signString = "metadata:name={$name}&description={$description}&image={$image}"

2. NewMask sign

web3.eth.sign(web3.eth.coinbase, nonce, function(err, signature){
console.log(err);
console.log(signature);
});

// OR

web3.personal.sign(nonce, web3.eth.coinbase, function(err, signature){
console.log(err);
console.log(signature);
});

Result:

{
"error_code":1,
"result":{

}
}

Cache

  • The first time the data is fetched via land/query, will return the last updated timestamp [lasttime].
  • When requesting again, pass in [lasttime] to get only the latest changes