@@ -1200,16 +1200,16 @@ Remote.prototype.requestTx = function(hash, callback) {
1200
1200
/**
1201
1201
* Account request abstraction
1202
1202
*
1203
+ * @this Remote
1203
1204
* @api private
1204
1205
*/
1205
1206
1206
- Remote . accountRequest = function ( type , account , accountIndex , ledger , peer , callback ) {
1207
+ Remote . accountRequest = function ( type , account , ledger , peer , callback ) {
1207
1208
if ( typeof account === 'object' ) {
1208
1209
var options = account ;
1209
- callback = accountIndex ;
1210
+ callback = ledger ;
1210
1211
ledger = options . ledger ;
1211
- accountIndex = options . account_index || options . accountIndex ;
1212
- account = options . accountID || options . account ;
1212
+ account = options . account || options . accountID ;
1213
1213
peer = options . peer ;
1214
1214
}
1215
1215
@@ -1222,18 +1222,10 @@ Remote.accountRequest = function(type, account, accountIndex, ledger, peer, call
1222
1222
var request = new Request ( this , type ) ;
1223
1223
var account = UInt160 . json_rewrite ( account ) ;
1224
1224
1225
- request . message . ident = account ; //DEPRECATED;
1226
1225
request . message . account = account ;
1226
+ request . ledgerSelect ( ledger ) ;
1227
1227
1228
- if ( typeof accountIndex === 'number' ) {
1229
- request . message . index = accountIndex ;
1230
- }
1231
-
1232
- if ( ! / ^ ( u n d e f i n e d | f u n c t i o n ) $ / . test ( typeof ledger ) ) {
1233
- request . ledgerChoose ( ledger ) ;
1234
- }
1235
-
1236
- if ( ! / ^ ( u n d e f i n e d | f u n c t i o n ) $ / . test ( typeof peer ) ) {
1228
+ if ( UInt160 . is_valid ( peer ) ) {
1237
1229
request . message . peer = UInt160 . json_rewrite ( peer ) ;
1238
1230
}
1239
1231
@@ -1246,6 +1238,7 @@ Remote.accountRequest = function(type, account, accountIndex, ledger, peer, call
1246
1238
* Request account_info
1247
1239
*
1248
1240
* @param {String } ripple address
1241
+ * @param [String|Number] ledger identifier
1249
1242
* @param [Function] callback
1250
1243
* @return {Request }
1251
1244
*/
@@ -1259,6 +1252,7 @@ Remote.prototype.requestAccountInfo = function(account, callback) {
1259
1252
* Request account_currencies
1260
1253
*
1261
1254
* @param {String } ripple address
1255
+ * @param [String|Number] ledger identifier
1262
1256
* @param [Function] callback
1263
1257
* @return {Request }
1264
1258
*/
@@ -1272,14 +1266,13 @@ Remote.prototype.requestAccountCurrencies = function(account, callback) {
1272
1266
* Request account_lines
1273
1267
*
1274
1268
* @param {String } ripple address
1275
- * @param {Number] sub-account index
1276
- * @param [String|Number] ledger
1269
+ * @param [String|Number] ledger identifier
1277
1270
* @param [String] peer
1278
1271
* @param [Function] callback
1279
1272
* @return {Request }
1280
1273
*/
1281
1274
1282
- Remote . prototype . requestAccountLines = function ( account , accountIndex , ledger , peer , callback ) {
1275
+ Remote . prototype . requestAccountLines = function ( account , peer , callback ) {
1283
1276
// XXX Does this require the server to be trusted?
1284
1277
//utils.assert(this.trusted);
1285
1278
var args = Array . prototype . concat . apply ( [ 'account_lines' ] , arguments ) ;
@@ -1290,19 +1283,16 @@ Remote.prototype.requestAccountLines = function(account, accountIndex, ledger, p
1290
1283
* Request account_offers
1291
1284
*
1292
1285
* @param {String } ripple address
1293
- * @param {Number] sub-account index
1294
- * @param [String|Number] ledger
1295
- * @param [String] peer
1286
+ * @param [String|Number] ledger identifier
1296
1287
* @param [Function] callback
1297
1288
* @return {Request }
1298
1289
*/
1299
1290
1300
- Remote . prototype . requestAccountOffers = function ( account , accountIndex , ledger , callback ) {
1291
+ Remote . prototype . requestAccountOffers = function ( account , callback ) {
1301
1292
var args = Array . prototype . concat . apply ( [ 'account_offers' ] , arguments ) ;
1302
1293
return Remote . accountRequest . apply ( this , args ) ;
1303
1294
} ;
1304
1295
1305
-
1306
1296
/**
1307
1297
* Request account_tx
1308
1298
*
@@ -1318,9 +1308,6 @@ Remote.prototype.requestAccountOffers = function(account, accountIndex, ledger,
1318
1308
* @param [Number] offset, defaults to 0
1319
1309
* @param [Number] limit
1320
1310
*
1321
- * @param [Function] filter
1322
- * @param [Function] map
1323
- * @param [Function] reduce
1324
1311
* @param [Function] callback
1325
1312
* @return {Request }
1326
1313
*/
@@ -1606,6 +1593,7 @@ Remote.prototype.requestLedgerAccept = function(callback) {
1606
1593
/**
1607
1594
* Account root request abstraction
1608
1595
*
1596
+ * @this Remote
1609
1597
* @api private
1610
1598
*/
1611
1599
0 commit comments