Files
Charles Bergeron d50b5a7d08 * adding price for each token to contract & DApp frontend
* added 'Ownable' concept for contract (the address who deploys the contract is the owner
* clean up the getToken() info by collapsing the data from 2 calls into 1, which means only 1 call to the contract instead of 2 for each piece of data (would be huge if there were say 12 pieces of data, 1 `view` call instead of 12 to the contract
2018-05-29 12:09:21 -07:00

17 lines
410 B
JavaScript

import nfToken from '@/contracts/nfTokenFactory'
export default function (tokenId, web3) {
var contract = nfToken(web3)
return new Promise((resolve, reject) => {
contract.then((instance) => {
instance.getToken(tokenId).then((response) => {
resolve([
parseInt(response[0].toString()),
response[1].toString()
])
}).catch((error) => reject)
})
})
}