prefix all wallet methods.

This commit is contained in:
Christopher Jeffrey 2014-09-29 12:26:46 -07:00
parent 759748018d
commit 84e6ef72a8
2 changed files with 72 additions and 72 deletions

View File

@ -672,55 +672,55 @@ Wallet.prototype.createAddress = function(name) {
}; };
Wallet.prototype.getAccountAddress = function(options) { Wallet.prototype.getAccountAddress = function(options) {
return bitcoindjs.getAccountAddress(options || {}); return bitcoindjs.walletGetAccountAddress(options || {});
}; };
Wallet.prototype.setAccount = function(options) { Wallet.prototype.setAccount = function(options) {
return bitcoindjs.setAccount(options || {}); return bitcoindjs.walletSetAccount(options || {});
}; };
Wallet.prototype.getAccount = function(options) { Wallet.prototype.getAccount = function(options) {
return bitcoindjs.getAccount(options || {}); return bitcoindjs.walletGetAccount(options || {});
}; };
Wallet.prototype.sendToAddress = function(options) { Wallet.prototype.sendTo = function(options) {
return bitcoindjs.sendToAddress(options || {}); return bitcoindjs.walletSendTo(options || {});
}; };
Wallet.prototype.signMessage = function(options) { Wallet.prototype.signMessage = function(options) {
return bitcoindjs.signMessage(options || {}); return bitcoindjs.walletSignMessage(options || {});
}; };
Wallet.prototype.verifyMessage = function(options) { Wallet.prototype.verifyMessage = function(options) {
return bitcoindjs.verifyMessage(options || {}); return bitcoindjs.walletVerifyMessage(options || {});
}; };
Wallet.prototype.getBalance = function(options) { Wallet.prototype.getBalance = function(options) {
return bitcoindjs.getBalance(options || {}); return bitcoindjs.walletGetBalance(options || {});
}; };
Wallet.prototype.getUnconfirmedBalance = function(options) { Wallet.prototype.getUnconfirmedBalance = function(options) {
return bitcoindjs.getUnconfirmedBalance(options || {}); return bitcoindjs.walletGetUnconfirmedBalance(options || {});
}; };
Wallet.prototype.sendFrom = function(options) { Wallet.prototype.sendFrom = function(options) {
return bitcoindjs.sendFrom(options || {}); return bitcoindjs.walletSendFrom(options || {});
}; };
Wallet.prototype.listTransactions = function(options) { Wallet.prototype.listTransactions = function(options) {
return bitcoindjs.listTransactions(options || {}); return bitcoindjs.walletListTransactions(options || {});
}; };
Wallet.prototype.listAccounts = function(options) { Wallet.prototype.listAccounts = function(options) {
return bitcoindjs.listAccounts(options || {}); return bitcoindjs.walletListAccounts(options || {});
}; };
Wallet.prototype.getTransaction = function(options) { Wallet.prototype.getTransaction = function(options) {
return bitcoindjs.getTransaction(options || {}); return bitcoindjs.walletGetTransaction(options || {});
}; };
Wallet.prototype.backupWallet = function(options) { Wallet.prototype.backupWallet = function(options) {
return bitcoindjs.backupWallet(options || {}); return bitcoindjs.walletBackup(options || {});
}; };
Wallet.prototype.walletPassphrase = function(options) { Wallet.prototype.walletPassphrase = function(options) {
@ -736,11 +736,11 @@ Wallet.prototype.walletLock = function(options) {
}; };
Wallet.prototype.encryptWallet = function(options) { Wallet.prototype.encryptWallet = function(options) {
return bitcoindjs.encryptWallet(options || {}); return bitcoindjs.walletEncrypt(options || {});
}; };
Wallet.prototype.setTxFee = function(options) { Wallet.prototype.setTxFee = function(options) {
return bitcoindjs.setTxFee(options || {}); return bitcoindjs.walletSetTxFee(options || {});
}; };
Wallet = new Wallet; Wallet = new Wallet;

View File

@ -137,24 +137,24 @@ NAN_METHOD(VerifyBlock);
NAN_METHOD(VerifyTransaction); NAN_METHOD(VerifyTransaction);
NAN_METHOD(WalletNewAddress); NAN_METHOD(WalletNewAddress);
NAN_METHOD(GetAccountAddress); NAN_METHOD(WalletGetAccountAddress);
NAN_METHOD(SetAccount); NAN_METHOD(WalletSetAccount);
NAN_METHOD(GetAccount); NAN_METHOD(WalletGetAccount);
NAN_METHOD(WalletSendTo); NAN_METHOD(WalletSendTo);
NAN_METHOD(SignMessage); NAN_METHOD(WalletSignMessage);
NAN_METHOD(VerifyMessage); NAN_METHOD(WalletVerifyMessage);
NAN_METHOD(GetBalance); NAN_METHOD(WalletGetBalance);
NAN_METHOD(GetUnconfirmedBalance); NAN_METHOD(WalletGetUnconfirmedBalance);
NAN_METHOD(SendFrom); NAN_METHOD(WalletSendFrom);
NAN_METHOD(ListTransactions); NAN_METHOD(WalletListTransactions);
NAN_METHOD(ListAccounts); NAN_METHOD(WalletListAccounts);
NAN_METHOD(GetTransaction); NAN_METHOD(WalletGetTransaction);
NAN_METHOD(BackupWallet); NAN_METHOD(WalletBackup);
NAN_METHOD(WalletPassphrase); NAN_METHOD(WalletPassphrase);
NAN_METHOD(WalletPassphraseChange); NAN_METHOD(WalletPassphraseChange);
NAN_METHOD(WalletLock); NAN_METHOD(WalletLock);
NAN_METHOD(EncryptWallet); NAN_METHOD(WalletEncrypt);
NAN_METHOD(SetTxFee); NAN_METHOD(WalletSetTxFee);
static void static void
async_start_node_work(uv_work_t *req); async_start_node_work(uv_work_t *req);
@ -1268,12 +1268,12 @@ NAN_METHOD(WalletNewAddress) {
NanReturnValue(NanNew<String>(CBitcoinAddress(keyID).ToString())); NanReturnValue(NanNew<String>(CBitcoinAddress(keyID).ToString()));
} }
NAN_METHOD(GetAccountAddress) { NAN_METHOD(WalletGetAccountAddress) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.getAccountAddress(options)"); "Usage: bitcoindjs.walletGetAccountAddress(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1284,12 +1284,12 @@ NAN_METHOD(GetAccountAddress) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(SetAccount) { NAN_METHOD(WalletSetAccount) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.setAccount(options)"); "Usage: bitcoindjs.walletSetAccount(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1300,12 +1300,12 @@ NAN_METHOD(SetAccount) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(GetAccount) { NAN_METHOD(WalletGetAccount) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.getAccount(options)"); "Usage: bitcoindjs.walletGetAccount(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1427,12 +1427,12 @@ async_wallet_sendto_after(uv_work_t *req) {
delete req; delete req;
} }
NAN_METHOD(SignMessage) { NAN_METHOD(WalletSignMessage) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.signMessage(options)"); "Usage: bitcoindjs.walletSignMessage(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1443,12 +1443,12 @@ NAN_METHOD(SignMessage) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(VerifyMessage) { NAN_METHOD(WalletVerifyMessage) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.verifyMessage(options)"); "Usage: bitcoindjs.walletVerifyMessage(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1459,12 +1459,12 @@ NAN_METHOD(VerifyMessage) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(GetBalance) { NAN_METHOD(WalletGetBalance) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.getBalance(options)"); "Usage: bitcoindjs.walletGetBalance(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1475,12 +1475,12 @@ NAN_METHOD(GetBalance) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(GetUnconfirmedBalance) { NAN_METHOD(WalletGetUnconfirmedBalance) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.getUnconfirmedBalance(options)"); "Usage: bitcoindjs.walletGetUnconfirmedBalance(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1491,12 +1491,12 @@ NAN_METHOD(GetUnconfirmedBalance) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(SendFrom) { NAN_METHOD(WalletSendFrom) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.sendFrom(options)"); "Usage: bitcoindjs.walletSendFrom(options)");
} }
Local<Object> options = Local<Object>::Cast(args[0]); Local<Object> options = Local<Object>::Cast(args[0]);
@ -1618,12 +1618,12 @@ async_wallet_sendfrom_after(uv_work_t *req) {
delete req; delete req;
} }
NAN_METHOD(ListTransactions) { NAN_METHOD(WalletListTransactions) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.listTransactions(options)"); "Usage: bitcoindjs.walletListTransactions(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1634,12 +1634,12 @@ NAN_METHOD(ListTransactions) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(ListAccounts) { NAN_METHOD(WalletListAccounts) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.listAccounts(options)"); "Usage: bitcoindjs.walletListAccounts(options)");
} }
Local<Object> options = Local<Object>::Cast(args[0]); Local<Object> options = Local<Object>::Cast(args[0]);
@ -1730,12 +1730,12 @@ NAN_METHOD(ListAccounts) {
NanReturnValue(obj); NanReturnValue(obj);
} }
NAN_METHOD(GetTransaction) { NAN_METHOD(WalletGetTransaction) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.getTransaction(options)"); "Usage: bitcoindjs.walletGetTransaction(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1746,12 +1746,12 @@ NAN_METHOD(GetTransaction) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(BackupWallet) { NAN_METHOD(WalletBackup) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.backupWallet(options)"); "Usage: bitcoindjs.walletBackup(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1810,12 +1810,12 @@ NAN_METHOD(WalletLock) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(EncryptWallet) { NAN_METHOD(WalletEncrypt) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.encryptWallet(options)"); "Usage: bitcoindjs.walletEncrypt(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -1826,12 +1826,12 @@ NAN_METHOD(EncryptWallet) {
NanReturnValue(Undefined()); NanReturnValue(Undefined());
} }
NAN_METHOD(SetTxFee) { NAN_METHOD(WalletSetTxFee) {
NanScope(); NanScope();
if (args.Length() < 1 || !args[0]->IsObject()) { if (args.Length() < 1 || !args[0]->IsObject()) {
return NanThrowError( return NanThrowError(
"Usage: bitcoindjs.setTxFee(options)"); "Usage: bitcoindjs.walletSetTxFee(options)");
} }
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
@ -2077,24 +2077,24 @@ init(Handle<Object> target) {
NODE_SET_METHOD(target, "verifyTransaction", VerifyTransaction); NODE_SET_METHOD(target, "verifyTransaction", VerifyTransaction);
NODE_SET_METHOD(target, "walletNewAddress", WalletNewAddress); NODE_SET_METHOD(target, "walletNewAddress", WalletNewAddress);
NODE_SET_METHOD(target, "getAccountAddress", GetAccountAddress); NODE_SET_METHOD(target, "walletGetAccountAddress", WalletGetAccountAddress);
NODE_SET_METHOD(target, "setAccount", SetAccount); NODE_SET_METHOD(target, "walletSetAccount", WalletSetAccount);
NODE_SET_METHOD(target, "getAccount", GetAccount); NODE_SET_METHOD(target, "walletGetAccount", WalletGetAccount);
NODE_SET_METHOD(target, "walletSendTo", WalletSendTo); NODE_SET_METHOD(target, "walletSendTo", WalletSendTo);
NODE_SET_METHOD(target, "signMessage", SignMessage); NODE_SET_METHOD(target, "walletSignMessage", WalletSignMessage);
NODE_SET_METHOD(target, "verifyMessage", VerifyMessage); NODE_SET_METHOD(target, "walletVerifyMessage", WalletVerifyMessage);
NODE_SET_METHOD(target, "getBalance", GetBalance); NODE_SET_METHOD(target, "walletGetBalance", WalletGetBalance);
NODE_SET_METHOD(target, "getUnconfirmedBalance", GetUnconfirmedBalance); NODE_SET_METHOD(target, "walletGetUnconfirmedBalance", WalletGetUnconfirmedBalance);
NODE_SET_METHOD(target, "sendFrom", SendFrom); NODE_SET_METHOD(target, "walletSendFrom", WalletSendFrom);
NODE_SET_METHOD(target, "listTransactions", ListTransactions); NODE_SET_METHOD(target, "walletListTransactions", WalletListTransactions);
NODE_SET_METHOD(target, "listAccounts", ListAccounts); NODE_SET_METHOD(target, "walletListAccounts", WalletListAccounts);
NODE_SET_METHOD(target, "getTransaction", GetTransaction); NODE_SET_METHOD(target, "walletGetTransaction", WalletGetTransaction);
NODE_SET_METHOD(target, "backupWallet", BackupWallet); NODE_SET_METHOD(target, "walletBackup", WalletBackup);
NODE_SET_METHOD(target, "walletPassphrase", WalletPassphrase); NODE_SET_METHOD(target, "walletPassphrase", WalletPassphrase);
NODE_SET_METHOD(target, "walletPassphraseChange", WalletPassphraseChange); NODE_SET_METHOD(target, "walletPassphraseChange", WalletPassphraseChange);
NODE_SET_METHOD(target, "walletLock", WalletLock); NODE_SET_METHOD(target, "walletLock", WalletLock);
NODE_SET_METHOD(target, "encryptWallet", EncryptWallet); NODE_SET_METHOD(target, "walletEncrypt", WalletEncrypt);
NODE_SET_METHOD(target, "setTxFee", SetTxFee); NODE_SET_METHOD(target, "walletSetTxFee", WalletSetTxFee);
} }
NODE_MODULE(bitcoindjs, init) NODE_MODULE(bitcoindjs, init)