mojodating / mojo-cloud-functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mojo-cloud-functions

Cloud Functions

rate

Used when user A rates user B Updates user B rating, when user B enters mojo house sends to him welcome JOtokens

Usage:

functions.httpsCallable("rate").call(["uid": user.uid, "rate":number]) { (result, error) in
  if let error = error as NSError? {
    // ...
  }
}

getBalance

Returns Jo tokens balance in ether

Usage:

functions.httpsCallable("getBalance").call() { (result, error) in
  if let error = error as NSError? {
    // ...
  }
}

sendJoTokens

Sends Jo tokens from user wallet to another ethereum address

Usage:

functions.httpsCallable("sendJoTokens").call(["to": user.uid, "value":100000]) { (result, error) in
  if let error = error as NSError? {
    // ...
  }
}

Tokens

JOToken

JOToken is used for buying drinks in marketplace. JOToken rinkeby address:

0xfEc08bb2439bf6Bb207480F78B9db5C0b6aa50cE

ERC721 marketplace token

0xe47cf472013d612f73f67a92c056bb5dcfd1a8f5

JOToken ABI

"abi": [ { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "_who", "type": "address" } ], "name": "balanceOf", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": true, "name": "spender", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "constant": true, "inputs": [ { "name": "_owner", "type": "address" }, { "name": "_spender", "type": "address" } ], "name": "allowance", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "approve", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ],

About


Languages

Language:TypeScript 100.0%