Add a set of inputs and outputs to a tx.
    Return the new tx on success
    Raise on error
556733
def tx_extend(partial_tx_hex, new_inputs, new_outputs, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_tx_extend(partial_tx_hex, new_inputs, new_outputs, **blockchain_opts)
    else:
        raise ValueError('Unknown blockchain "{}"'.format(blockchain))
1295406
def add_input(cmd, immediate=False):
    ''''''
    if immediate:
        process_stdin(cmd)
    else:
        mpstate.input_queue.put(cmd)
1314788
def txn(self, overwrite=False, lock=True):
        """"""
        if lock:
            self._lock.acquire()
        try:
            new_state, existing_generation = self.state_and_generation
            new_state = copy.deepcopy(new_state)
            yield new_state
            if overwrite:
                existing_generation = None
            self.set_state(new_state, existing_generation=existing_generation)
        finally:
            if lock:
                self._lock.release()
295273
def from_dict(cls, tx):
        
        inputs = [Input.from_dict(input_) for input_ in tx['inputs']]
        outputs = [Output.from_dict(output) for output in tx['outputs']]
        return cls(tx['operation'], tx['asset'], inputs, outputs,
                   tx['metadata'], tx['version'], hash_id=tx['id'])
910505
def serialize_transaction(inputs, outputs, lock_time=0, version=1):
    

    # add in the inputs
    serialized_inputs = ''.join([serialize_input(input) for input in inputs])

    # add in the outputs
    serialized_outputs = ''.join([serialize_output(output) for output in outputs])

    return ''.join([
        # add in the version number
        hexlify(struct.pack('<I', version)),
        # add in the number of inputs
        hexlify(variable_length_int(len(inputs))),
        # add in the inputs
        serialized_inputs,
        # add in the number of outputs
        hexlify(variable_length_int(len(outputs))),
        # add in the outputs
        serialized_outputs,
        # add in the lock time
        hexlify(struct.pack('<I', lock_time)),
    ])
85634
def add_to_cache(self, cache_id, inputs, output):
        """"""
        self.inputs_changed[cache_id] = False
        self.cached_outputs[cache_id] = output
        self.order.append(cache_id)
        self.cached_inputs[cache_id] = inputs
        for a in inputs:
            if a is not None and not isinstance(a, Number) and not isinstance(a, str):
                ind_id = self.id(a)
                v = self.cached_input_ids.get(ind_id, [weakref.ref(a), []])
                v[1].append(cache_id)
                if len(v[1]) == 1:
                    a.add_observer(self, self.on_cache_changed)
                self.cached_input_ids[ind_id] = v
433564
def _add_output(self, out):
        
        self._outputs += [out]
        out.node = self
        out._set_as_output_of(self)
1058562
public TransactionInput addInput(Sha256Hash spendTxHash, long outputIndex, Script script) {
        return addInput(new TransactionInput(params, this, script.getProgram(), new TransactionOutPoint(params, outputIndex, spendTxHash)));
    }
1005685
function (tx) { 
    var outs = [];
    tx.outputs.forEach(function (o) {
      outs.push(new TransactionOutput(o.satoshis,o.script.toBuffer()));
    });
    return outs;
  }
235382
def createrawtransaction(self, inputs, outputs):
        """"""
        if not isinstance(outputs, dict):
            raise TypeError("outputs variable must be a dictionary")
        if not isinstance(inputs, list):
            raise TypeError("inputs variable must be a list")
        return self.req("createrawtransaction", [inputs, outputs])
598101
void addOutput() {
        if( output != null ) {
            outputs.addLast( output );
        }
        output = state.pool.get();
    }
1109927
def create_tx(self, txins=None, txouts=None, lock_time=0):
        
        txins = [] if txins is None else txins
        txouts = [] if txouts is None else txouts
        lock_time = deserialize.positive_integer(lock_time)
        txins = deserialize.txins(txins)
        txouts = deserialize.txouts(self.testnet, txouts)
        tx = control.create_tx(self.service, self.testnet, txins, txouts,
                               lock_time=lock_time)
        return serialize.tx(tx)
1225803
def add(setname=None, entry=None, family='ipv4', **kwargs):
    '''
    

    '''
    if not setname:
        return 'Error: Set needs to be specified'
    if not entry:
        return 'Error: Entry needs to be specified'

    setinfo = _find_set_info(setname)
    if not setinfo:
        return 'Error: Set {0} does not exist'.format(setname)

    settype = setinfo['Type']

    cmd = '{0}'.format(entry)

    if 'timeout' in kwargs:
        if 'timeout' not in setinfo['Header']:
            return 'Error: Set {0} not created with timeout support'.format(setname)

    if 'packets' in kwargs or 'bytes' in kwargs:
        if 'counters' not in setinfo['Header']:
            return 'Error: Set {0} not created with counters support'.format(setname)

    if 'comment' in kwargs:
        if 'comment' not in setinfo['Header']:
            return 'Error: Set {0} not created with comment support'.format(setname)
        if 'comment' not in entry:
            cmd = '{0} comment "{1}"'.format(cmd, kwargs['comment'])

    if set(['skbmark', 'skbprio', 'skbqueue']) & set(kwargs):
        if 'skbinfo' not in setinfo['Header']:
            return 'Error: Set {0} not created with skbinfo support'.format(setname)

    for item in _ADD_OPTIONS[settype]:
        if item in kwargs:
            cmd = '{0} {1} {2}'.format(cmd, item, kwargs[item])

    current_members = _find_set_members(setname)
    if cmd in current_members:
        return 'Warn: Entry {0} already exists in set {1}'.format(cmd, setname)

    # Using -exist to ensure entries are updated if the comment changes
    cmd = '{0} add -exist {1} {2}'.format(_ipset_cmd(), setname, cmd)
    out = __salt__['cmd.run'](cmd, python_shell=False)

    if not out:
        return 'Success'
    return 'Error: {0}'.format(out)
948257
def add_output(self, name, value):
        
        self.template.add_output(Output(name, Value=value))
768174
def add_result(self, code, message=None):
        
        self._results.append(Result(code, message))
1235436
def add_output_list_opt(self, opt, outputs):
        
        self.add_opt(opt)
        for out in outputs:
            self.add_opt(out)
            self._add_output(out)
389503
public TransactionOutput addOutput(TransactionOutput to) {
        unCache();
        to.setParent(this);
        outputs.add(to);
        adjustLength(outputs.size(), to.length);
        return to;
    }