moki_getService
Returns information for a service.
Parameters
address
: address - Address of service
Returns
service
: object - Service Objectid
: address - Address of servicepublicKey
: hex - Public Key of servicedeligate_id
: address - Address of deligate identitydeligate_public_key
: hex - Public Key of deligate identitymetadata
: object - Metadata for serviceurl
: string - URL of serviceicon
: string - URL of icon for service (png, jpg, webp)offering
: object - Offering detailsretention_days
: number - Days of message retentioncost
: object - Optional cost data, null means the service is free
Example
Request
- curl
- javascript
curl https://mainnet.moki.network \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "moki_getService", "params": [], "id": 1}'
import fetch from "node-fetch"
fetch("https://mainnet.moki.network", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
method: "moki_getService",
params: [],
id: 1,
}),
})
.then((response) => response.json())
.then((data) => {
console.log(data)
})
.catch((error) => {
console.error(error)
})
Reponse
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"id": "0x22a4dc6353e087A5c37c7168bCF149e9342eB922",
"public_key": "0x92e4dc6353e087A5c37c7168bCF149e9342eB922",
"deligate_id": "0x92e4dc6353e087A5c37c7168bCF149e9342eB922",
"deligate_public_key": "0x92e4dc6353e087A5c37c7168bCF149e9342eB922",
"metadata": {
"url": "https://example-service.com",
"icon": "https://example-service.com/images/icon.png"
},
"offering": {
"retention_days": 365,
"cost": null
}
}
}