|
|
@ -21,11 +21,6 @@ var BlockchainExplorer = require('./blockchainexplorer'); |
|
|
|
|
|
|
|
var Model = require('./model'); |
|
|
|
var Wallet = Model.Wallet; |
|
|
|
var Copayer = Model.Copayer; |
|
|
|
var Address = Model.Address; |
|
|
|
var TxProposal = Model.TxProposal; |
|
|
|
var Notification = Model.Notification; |
|
|
|
var Preferences = Model.Preferences; |
|
|
|
|
|
|
|
var initialized = false; |
|
|
|
var lock, storage, blockchainExplorer, blockchainExplorerOpts; |
|
|
@ -329,7 +324,7 @@ WalletService.prototype._notify = function(type, data, opts, cb) { |
|
|
|
|
|
|
|
$.checkState(walletId); |
|
|
|
|
|
|
|
var n = Notification.create({ |
|
|
|
var notification = Model.Notification.create({ |
|
|
|
type: type, |
|
|
|
data: data, |
|
|
|
ticker: this.notifyTicker++, |
|
|
@ -342,6 +337,7 @@ WalletService.prototype._notify = function(type, data, opts, cb) { |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* Joins a wallet in creation. |
|
|
|
* @param {Object} opts |
|
|
@ -380,7 +376,7 @@ WalletService.prototype.joinWallet = function(opts, cb) { |
|
|
|
if (wallet.copayers.length == wallet.n) |
|
|
|
return cb(new ClientError('WFULL', 'Wallet full')); |
|
|
|
|
|
|
|
var copayer = Copayer.create({ |
|
|
|
var copayer = Model.Copayer.create({ |
|
|
|
name: opts.name, |
|
|
|
copayerIndex: wallet.copayers.length, |
|
|
|
xPubKey: opts.xPubKey, |
|
|
@ -425,7 +421,7 @@ WalletService.prototype.savePreferences = function(opts, cb) { |
|
|
|
opts = opts || {}; |
|
|
|
|
|
|
|
self._runLocked(cb, function(cb) { |
|
|
|
var preferences = Preferences.create({ |
|
|
|
var preferences = Model.Preferences.create({ |
|
|
|
walletId: self.walletId, |
|
|
|
copayerId: self.copayerId, |
|
|
|
email: opts.email, |
|
|
@ -746,7 +742,7 @@ WalletService.prototype.createTx = function(opts, cb) { |
|
|
|
|
|
|
|
var changeAddress = wallet.createAddress(true); |
|
|
|
|
|
|
|
var txp = TxProposal.create({ |
|
|
|
var txp = Model.TxProposal.create({ |
|
|
|
walletId: self.walletId, |
|
|
|
creatorId: self.copayerId, |
|
|
|
toAddress: opts.toAddress, |
|
|
|