forked from PortalNetwork/nifty-game
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CryptoHeroGame CryptoHeroToken
- Loading branch information
1 parent
21a2496
commit 07c2ba7
Showing
7 changed files
with
66 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var Promise = require('bluebird'); | ||
|
||
const cryptoHerosGameInterface = [] | ||
|
||
function CryptoHerosGame(web3, address) { | ||
this.web3 = web3; | ||
const cryptoHerosGameContract = web3.eth.contract(cryptoHerosGameInterface); | ||
this.cryptoHerosGamePromise = Promise.resolve(Promise.promisifyAll(cryptoHerosGameContract.at(address))); | ||
} | ||
|
||
CryptoHerosGame.prototype.name = function (callback) { | ||
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) { | ||
return cryptoHerosGame.nameAsync(); | ||
}); | ||
} | ||
|
||
CryptoHerosGame.prototype.symbol = function (callback) { | ||
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) { | ||
return cryptoHerosGame.symbolAsync(); | ||
}); | ||
} | ||
|
||
CryptoHerosGame.prototype.ownerOf = function (tokenId, callback) { | ||
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) { | ||
return cryptoHerosGame.ownerOfAsync(tokenId); | ||
}); | ||
} | ||
|
||
CryptoHerosGame.prototype.tokenURI = function (tokenId, callback) { | ||
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) { | ||
return cryptoHerosGame.tokenURIAsync(tokenId); | ||
}); | ||
} | ||
|
||
CryptoHerosGame.prototype.transferOwnership = function (address, callback) { | ||
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) { | ||
return cryptoHerosGame.transferOwnershipAsync(address); | ||
}); | ||
} | ||
|
||
CryptoHerosGame.prototype.getOwnedTokens = function (address, callback) { | ||
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) { | ||
return cryptoHerosGame.getOwnedTokensAsync(address); | ||
}); | ||
} | ||
|
||
module.exports = CryptoHerosGame; |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters