-
Notifications
You must be signed in to change notification settings - Fork 4
IOME Widget and API documentation
Ganesh Prasad Kumble edited this page May 30, 2023
·
10 revisions
npm install iome-widgetimport { Login } from "iome-widget"
function App() {
return (
<Login
onSuccess={(result) => {
console.log("UserID : ", result.userid)
console.log("Auth Token : ", result.authToken)
console.log("IOMe Object : ", result.iome);
// iome.utils.mDecode
// iome.utils.mEncode
// iome.wallet.isUnLocked
}
}
/>
);
}QA: https://qaapi.moinet.io/iome/v0
Production: https://api.moinet.io/iome/v0 [Will be live from 24th April, 2023]
GET: /user/<userID>/digitalme?dimension=personal&attributes=email, phone
Response:
{
"code": 200,
"requestID": "cecce8c0-dde8-11ed-a037-234d4dbf73f6",
"clientMessage": "DigitalMe details fetched successfully",
"data": {
"userID": "0xA007d9E66a4fD262946a81D3C4a1b1eD242DA8c1",
"dimension": "personal",
"attributes": ["email","phone"]
"result": {
"givenAttributes": {
"email/phone": {
"scope": "private",
"verified": "true/false",
"value": "<encrypted_digest>"
}
}
}
}
}GET: /user/<userID>/digitalme?dimension=personal&attributes=kyc
Response:
{
"code": 200,
"requestID": "cecce8c0-dde8-11ed-a037-234d4dbf73f6",
"clientMessage": "DigitalMe details fetched successfully",
"data": {
"userID": "0xA007d9E66a4fD262946a81D3C4a1b1eD242DA8c1",
"dimension": "personal",
"attributes": ["email","phone"]
"result": {
"givenAttributes": {
"kyc": {
"scope": "private",
"verified": "true/false",
"value": "<encrypted_digest>"
}
}
}
}
}GET: /user/<userID>/digitalme?social=social&attributes=twitter,telegram,discord
Response:
{
"code": 200,
"requestID": "cecce8c0-dde8-11ed-a037-234d4dbf73f6",
"clientMessage": "DigitalMe details fetched successfully",
"data": {
"userID": "0xA007d9E66a4fD262946a81D3C4a1b1eD242DA8c1",
"dimension": "personal",
"attributes": ["email","phone"]
"result": {
"givenAttributes": {
"twitter/telegram/discord": {
"scope": "private",
"verified": "true/false",
"value": "<encrypted_digest>"
}
}
}
}
}GET: /user/<userID>/interactions?offset=0&limit=100
Response:
{
"code": 200,
"requestID": "40282b50-ddef-11ed-b217-0b8c143724af",
"clientMessage": "User interactions fetched successfully",
"data": [
{
"id": "0xe6201b978f85857ebb24da9d6cb710b3992f9adef179e08b81a066cfbbad4339",
"namespace": "IOME",
"attr": "-",
"action": "Joined",
"actionBy": "Self",
"instant": "1681673071"
},
{
"id": "0x61df768bf0ec2fe9b7baa2eab6766bdbeb68bf9c50897be2556ef950ec0eb539",
"namespace": "Digital Me",
"attr": "KYC",
"action": "Verified",
"actionBy": "SUMSUB",
"instant": "1681821873"
}
]
}Filter user interactions array with { namespace: { $includes: "Avatar" }, action: "Created" }
Filter user interactions array with { action: "Joined" }
Filter user interactions array with { namespace: "MOI Net", attr: "Validator", "action": "Created", instant: { $lt: 1650470399 } }
- above query will respond with array. If
array.length > 0, we can say that the user has hosted node(s) in the month ofMay 2022. This is a one-time reward. So regardless of how many nodes are hosted in the month of may, maximum points eligible by the user is always capped to 10 points only.