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
/** | |
* isAvaliableForMS(address) Checks if address can be obtained and transformed to a MultiSig account. | |
* | |
* @param {string} address - Address to check | |
* | |
* @return {promise} - A promise of the NetworkRequests service that returns true if the account is not another account's cosignatory nor already has cosignaroties. | |
*/ | |
isAvaliableForMS(address){ | |
var deferred = this._q.defer(); | |
var promise = deferred.promise; |
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
/* | |
* REQUIRES: | |
* - https://gist.github.com/acastellana/320c2e0fa722d9526e98f021d2e5a3b2 | |
*/ | |
/** | |
* getLastMessagesWithString(address,str,start) Obtains the last Message that contains string after position start | |
* | |
* @param {string} address - NEM Address to explore | |
* @param {string} str - String to find on addresses txs |
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
/** | |
* getTransactionMessagesWithString(address, str, start) Obtains every transaction message that contains a certain string (starting from position start) | |
* | |
* @param {string} address - NEM Address to explore | |
* @param {string} str - String to find on addresses txs | |
* @param {integer} start - Starting position in the transaction message to search | |
* | |
* @return {promise} - A promise of the NetworkRequests service that returns an Array with the filtered messages | |
*/ | |
getTransactionMessagesWithString(address, str, start){ |
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
/* | |
* REQUIRES: | |
* - https://gist.github.com/acastellana/995326e3a41b5f690db50a17153af312 | |
* - https://gist.github.com/acastellana/607a47838e842417d80622568543eb74 | |
*/ | |
/** | |
* ownsMosaic(address,namespace, mosaic) Checks if address owns any mosaics from namespace:mosaic | |
* | |
* @param {string} address - NEM Address to check for the mosaic |
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
/* | |
* REQUIRES: | |
* - https://gist.github.com/acastellana/995326e3a41b5f690db50a17153af312 | |
* - https://gist.github.com/acastellana/607a47838e842417d80622568543eb74 | |
*/ | |
/** | |
* sendMosaic(recipient, namespaceId, mosaics, amount, common, options) Sends a minimal transaction containing a mosaic and optionally a message and some xem | |
* | |
* @param {object} recipient - Transaction receiver's account |
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
/** | |
* processTxData(transferData) Processes transferData | |
* | |
* @param {object} tx - The transaction data | |
* | |
* @return {promise} - An announce transaction promise of the NetworkRequests service | |
*/ | |
processTxData(transferData) { | |
// return if no value or address length < to min address length | |
if (!transferData || !transferData.recipient || transferData.recipient.length < 40) { |
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
/* | |
* REQUIRES: | |
* - https://gist.github.com/acastellana/995326e3a41b5f690db50a17153af312 | |
* - https://gist.github.com/acastellana/607a47838e842417d80622568543eb74 | |
*/ | |
/** | |
* sendMessage(recipientAccount, message, common) Sends a minimal transaction containing a message to poin | |
* | |
* @param {object} receiver - Transaction receiver's account |
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
/** | |
* send(entity) Sends a transaction to the network based on an entity | |
* | |
* @param {object} entity - The prepared transaction object | |
* @param {object} common - A password/privateKey object | |
* | |
* @return {promise} - An announce transaction promise of the NetworkRequests service | |
*/ | |
send(entity, common){ | |
// Construct transaction byte array, sign and broadcast it to the network |
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
/** | |
* createBrainWallet(seed) creates a new brain wallet using the seed as name and passphrase and returns it's main account | |
*/ | |
createBrainWallet(seed) { | |
var deferred = this._q.defer(); | |
var promise = deferred.promise; | |
// Seed can't be empty | |
if (!seed) { | |
this._Alert.missingtransferData(); // TODO: Add proper alert |
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
/** | |
* _checkAccess() Ensure that the user is authentic by checking his password and setting the private key to this.common | |
*/ | |
checkAccess(){ | |
// Decrypt/generate private key and check it. Returned private key is contained into this.common | |
if (!CryptoHelpers.passwordToPrivatekeyClear(this.common, this._Wallet.currentAccount, this._Wallet.algo, true)) { | |
this._Alert.invalidPassword(); | |
// Enable send button | |
this.buttonDisabled = false; | |
return false; |
NewerOlder