mirror of
https://github.com/hanzoai/etherplate.git
synced 2026-10-30 18:37:10 +00:00
* 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
17 lines
410 B
JavaScript
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)
|
|
})
|
|
})
|
|
}
|