moki_updateDeligateIdentity
warning
Changing the deligate identity will have the following impact:
- Future messages will be encrypted using the new deligate public key.
- Notification Service settings will be wiped to prevent undecryptable information.
This method is commonly called around account creation, before the notification service is set.
Sets the deligate identity for a given wallet. The deligate identity is used for adding a deligate wallet for message encryption / decryption without exposing the main wallet.
Parameters
Signed Deligate Data
: hex [Required] - Signed data for the deligate identity (`nonce`+`deligatePublicKey`)
Returns
success
: boolean - Returns true if succeededExample
Request
- curl
- javascript
curl https://mainnet.moki.network \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "moki_updateDeligateIdentity", "params": ["0xe34a390133bd2d3ef..."], "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_updateDeligateIdentity",
params: ["0xe34a390133bd2d3ef..."],
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": true
}