diff --git a/lib/bitcoind.js b/lib/bitcoind.js index 6c6279fe..39df3ae0 100644 --- a/lib/bitcoind.js +++ b/lib/bitcoind.js @@ -672,55 +672,55 @@ Wallet.prototype.createAddress = function(name) { }; Wallet.prototype.getAccountAddress = function(options) { - return bitcoindjs.getAccountAddress(options || {}); + return bitcoindjs.walletGetAccountAddress(options || {}); }; Wallet.prototype.setAccount = function(options) { - return bitcoindjs.setAccount(options || {}); + return bitcoindjs.walletSetAccount(options || {}); }; Wallet.prototype.getAccount = function(options) { - return bitcoindjs.getAccount(options || {}); + return bitcoindjs.walletGetAccount(options || {}); }; -Wallet.prototype.sendToAddress = function(options) { - return bitcoindjs.sendToAddress(options || {}); +Wallet.prototype.sendTo = function(options) { + return bitcoindjs.walletSendTo(options || {}); }; Wallet.prototype.signMessage = function(options) { - return bitcoindjs.signMessage(options || {}); + return bitcoindjs.walletSignMessage(options || {}); }; Wallet.prototype.verifyMessage = function(options) { - return bitcoindjs.verifyMessage(options || {}); + return bitcoindjs.walletVerifyMessage(options || {}); }; Wallet.prototype.getBalance = function(options) { - return bitcoindjs.getBalance(options || {}); + return bitcoindjs.walletGetBalance(options || {}); }; Wallet.prototype.getUnconfirmedBalance = function(options) { - return bitcoindjs.getUnconfirmedBalance(options || {}); + return bitcoindjs.walletGetUnconfirmedBalance(options || {}); }; Wallet.prototype.sendFrom = function(options) { - return bitcoindjs.sendFrom(options || {}); + return bitcoindjs.walletSendFrom(options || {}); }; Wallet.prototype.listTransactions = function(options) { - return bitcoindjs.listTransactions(options || {}); + return bitcoindjs.walletListTransactions(options || {}); }; Wallet.prototype.listAccounts = function(options) { - return bitcoindjs.listAccounts(options || {}); + return bitcoindjs.walletListAccounts(options || {}); }; Wallet.prototype.getTransaction = function(options) { - return bitcoindjs.getTransaction(options || {}); + return bitcoindjs.walletGetTransaction(options || {}); }; Wallet.prototype.backupWallet = function(options) { - return bitcoindjs.backupWallet(options || {}); + return bitcoindjs.walletBackup(options || {}); }; Wallet.prototype.walletPassphrase = function(options) { @@ -736,11 +736,11 @@ Wallet.prototype.walletLock = function(options) { }; Wallet.prototype.encryptWallet = function(options) { - return bitcoindjs.encryptWallet(options || {}); + return bitcoindjs.walletEncrypt(options || {}); }; Wallet.prototype.setTxFee = function(options) { - return bitcoindjs.setTxFee(options || {}); + return bitcoindjs.walletSetTxFee(options || {}); }; Wallet = new Wallet; diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 489fbdb2..cb2aacbb 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -137,24 +137,24 @@ NAN_METHOD(VerifyBlock); NAN_METHOD(VerifyTransaction); NAN_METHOD(WalletNewAddress); -NAN_METHOD(GetAccountAddress); -NAN_METHOD(SetAccount); -NAN_METHOD(GetAccount); +NAN_METHOD(WalletGetAccountAddress); +NAN_METHOD(WalletSetAccount); +NAN_METHOD(WalletGetAccount); NAN_METHOD(WalletSendTo); -NAN_METHOD(SignMessage); -NAN_METHOD(VerifyMessage); -NAN_METHOD(GetBalance); -NAN_METHOD(GetUnconfirmedBalance); -NAN_METHOD(SendFrom); -NAN_METHOD(ListTransactions); -NAN_METHOD(ListAccounts); -NAN_METHOD(GetTransaction); -NAN_METHOD(BackupWallet); +NAN_METHOD(WalletSignMessage); +NAN_METHOD(WalletVerifyMessage); +NAN_METHOD(WalletGetBalance); +NAN_METHOD(WalletGetUnconfirmedBalance); +NAN_METHOD(WalletSendFrom); +NAN_METHOD(WalletListTransactions); +NAN_METHOD(WalletListAccounts); +NAN_METHOD(WalletGetTransaction); +NAN_METHOD(WalletBackup); NAN_METHOD(WalletPassphrase); NAN_METHOD(WalletPassphraseChange); NAN_METHOD(WalletLock); -NAN_METHOD(EncryptWallet); -NAN_METHOD(SetTxFee); +NAN_METHOD(WalletEncrypt); +NAN_METHOD(WalletSetTxFee); static void async_start_node_work(uv_work_t *req); @@ -1268,12 +1268,12 @@ NAN_METHOD(WalletNewAddress) { NanReturnValue(NanNew(CBitcoinAddress(keyID).ToString())); } -NAN_METHOD(GetAccountAddress) { +NAN_METHOD(WalletGetAccountAddress) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1284,12 +1284,12 @@ NAN_METHOD(GetAccountAddress) { NanReturnValue(Undefined()); } -NAN_METHOD(SetAccount) { +NAN_METHOD(WalletSetAccount) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1300,12 +1300,12 @@ NAN_METHOD(SetAccount) { NanReturnValue(Undefined()); } -NAN_METHOD(GetAccount) { +NAN_METHOD(WalletGetAccount) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1427,12 +1427,12 @@ async_wallet_sendto_after(uv_work_t *req) { delete req; } -NAN_METHOD(SignMessage) { +NAN_METHOD(WalletSignMessage) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1443,12 +1443,12 @@ NAN_METHOD(SignMessage) { NanReturnValue(Undefined()); } -NAN_METHOD(VerifyMessage) { +NAN_METHOD(WalletVerifyMessage) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1459,12 +1459,12 @@ NAN_METHOD(VerifyMessage) { NanReturnValue(Undefined()); } -NAN_METHOD(GetBalance) { +NAN_METHOD(WalletGetBalance) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1475,12 +1475,12 @@ NAN_METHOD(GetBalance) { NanReturnValue(Undefined()); } -NAN_METHOD(GetUnconfirmedBalance) { +NAN_METHOD(WalletGetUnconfirmedBalance) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1491,12 +1491,12 @@ NAN_METHOD(GetUnconfirmedBalance) { NanReturnValue(Undefined()); } -NAN_METHOD(SendFrom) { +NAN_METHOD(WalletSendFrom) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { return NanThrowError( - "Usage: bitcoindjs.sendFrom(options)"); + "Usage: bitcoindjs.walletSendFrom(options)"); } Local options = Local::Cast(args[0]); @@ -1618,12 +1618,12 @@ async_wallet_sendfrom_after(uv_work_t *req) { delete req; } -NAN_METHOD(ListTransactions) { +NAN_METHOD(WalletListTransactions) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1634,12 +1634,12 @@ NAN_METHOD(ListTransactions) { NanReturnValue(Undefined()); } -NAN_METHOD(ListAccounts) { +NAN_METHOD(WalletListAccounts) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { return NanThrowError( - "Usage: bitcoindjs.listAccounts(options)"); + "Usage: bitcoindjs.walletListAccounts(options)"); } Local options = Local::Cast(args[0]); @@ -1730,12 +1730,12 @@ NAN_METHOD(ListAccounts) { NanReturnValue(obj); } -NAN_METHOD(GetTransaction) { +NAN_METHOD(WalletGetTransaction) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1746,12 +1746,12 @@ NAN_METHOD(GetTransaction) { NanReturnValue(Undefined()); } -NAN_METHOD(BackupWallet) { +NAN_METHOD(WalletBackup) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1810,12 +1810,12 @@ NAN_METHOD(WalletLock) { NanReturnValue(Undefined()); } -NAN_METHOD(EncryptWallet) { +NAN_METHOD(WalletEncrypt) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -1826,12 +1826,12 @@ NAN_METHOD(EncryptWallet) { NanReturnValue(Undefined()); } -NAN_METHOD(SetTxFee) { +NAN_METHOD(WalletSetTxFee) { NanScope(); if (args.Length() < 1 || !args[0]->IsObject()) { 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 @@ -2077,24 +2077,24 @@ init(Handle target) { NODE_SET_METHOD(target, "verifyTransaction", VerifyTransaction); NODE_SET_METHOD(target, "walletNewAddress", WalletNewAddress); - NODE_SET_METHOD(target, "getAccountAddress", GetAccountAddress); - NODE_SET_METHOD(target, "setAccount", SetAccount); - NODE_SET_METHOD(target, "getAccount", GetAccount); + NODE_SET_METHOD(target, "walletGetAccountAddress", WalletGetAccountAddress); + NODE_SET_METHOD(target, "walletSetAccount", WalletSetAccount); + NODE_SET_METHOD(target, "walletGetAccount", WalletGetAccount); NODE_SET_METHOD(target, "walletSendTo", WalletSendTo); - NODE_SET_METHOD(target, "signMessage", SignMessage); - NODE_SET_METHOD(target, "verifyMessage", VerifyMessage); - NODE_SET_METHOD(target, "getBalance", GetBalance); - NODE_SET_METHOD(target, "getUnconfirmedBalance", GetUnconfirmedBalance); - NODE_SET_METHOD(target, "sendFrom", SendFrom); - NODE_SET_METHOD(target, "listTransactions", ListTransactions); - NODE_SET_METHOD(target, "listAccounts", ListAccounts); - NODE_SET_METHOD(target, "getTransaction", GetTransaction); - NODE_SET_METHOD(target, "backupWallet", BackupWallet); + NODE_SET_METHOD(target, "walletSignMessage", WalletSignMessage); + NODE_SET_METHOD(target, "walletVerifyMessage", WalletVerifyMessage); + NODE_SET_METHOD(target, "walletGetBalance", WalletGetBalance); + NODE_SET_METHOD(target, "walletGetUnconfirmedBalance", WalletGetUnconfirmedBalance); + NODE_SET_METHOD(target, "walletSendFrom", WalletSendFrom); + NODE_SET_METHOD(target, "walletListTransactions", WalletListTransactions); + NODE_SET_METHOD(target, "walletListAccounts", WalletListAccounts); + NODE_SET_METHOD(target, "walletGetTransaction", WalletGetTransaction); + NODE_SET_METHOD(target, "walletBackup", WalletBackup); NODE_SET_METHOD(target, "walletPassphrase", WalletPassphrase); NODE_SET_METHOD(target, "walletPassphraseChange", WalletPassphraseChange); NODE_SET_METHOD(target, "walletLock", WalletLock); - NODE_SET_METHOD(target, "encryptWallet", EncryptWallet); - NODE_SET_METHOD(target, "setTxFee", SetTxFee); + NODE_SET_METHOD(target, "walletEncrypt", WalletEncrypt); + NODE_SET_METHOD(target, "walletSetTxFee", WalletSetTxFee); } NODE_MODULE(bitcoindjs, init)