batchAdd(method, args) {
    if (!me.record) {
      react({alert: "You can't do onchain tx if you are not registred"})
      return false
    }

    let mergeable = ['withdraw', 'deposit']

    if (mergeable.includes(method)) {
      let exists = me.batch.find((b) => b[0] == method && b[1][0] == args[0])

      if (exists) {
        // add to existing array
        exists[1][1].push(args[1])
      } else {
        // create new set, withdrawals go first
        me.batch[method == 'withdraw' ? 'unshift' : 'push']([
          method,
          [args[0], [args[1]]]
        ])
      }
    } else if (method == 'revealSecrets') {
      let exists = me.batch.find((b) => b[0] == method)
      // revealed secrets are not per-assets

      if (exists) {
        // add to existing array
        exists[1].push(args)
      } else {
        // create new set
        me.batch.push([method, [args]])
      }
    } else {
      me.batch.push([method, args])
    }

    return true
  }
//add a transaction to next batch
add a transaction to next batch
add a transaction to next batch
batchAdd(method, args) {
    if (!me.record) {
      react({alert: "You can't do onchain tx if you are not registred"})
      return false
    }
    let mergeable = ['withdraw', 'deposit']
    if (mergeable.includes(method)) {
      let exists = me.batch.find((b) => b[0] == method && b[1][0] == args[0])
      if (exists) {
        exists[1][1].push(args[1])
      } else {
        me.batch[method == 'withdraw' ? 'unshift' : 'push']([
          method,
          [args[0], [args[1]]]
        ])
      }
    } else if (method == 'revealSecrets') {
      let exists = me.batch.find((b) => b[0] == method)
      if (exists) {
        exists[1].push(args)
      } else {
        me.batch.push([method, [args]])
      }
    } else {
      me.batch.push([method, args])
    }
    return true
  }
batchAdd ( method , args ) { if ( ! me . record ) { react ( { alert : "You can't do onchain tx if you are not registred" } ) return false } let mergeable = [ 'withdraw' , 'deposit' ] if ( mergeable . includes ( method ) ) { let exists = me . batch . find ( ( b ) => b [ 0 ] == method && b [ 1 ] [ 0 ] == args [ 0 ] ) if ( exists ) { exists [ 1 ] [ 1 ] . push ( args [ 1 ] ) } else { me . batch [ method == 'withdraw' ? 'unshift' : 'push' ] ( [ method , [ args [ 0 ] , [ args [ 1 ] ] ] ] ) } } else if ( method == 'revealSecrets' ) { let exists = me . batch . find ( ( b ) => b [ 0 ] == method ) if ( exists ) { exists [ 1 ] . push ( args ) } else { me . batch . push ( [ method , [ args ] ] ) } } else { me . batch . push ( [ method , args ] ) } return true }
add a transaction to next batch
add a transaction to next batch
// add to existing array // create new set, withdrawals go first // revealed secrets are not per-assets // add to existing array // create new set