Send Money (Will send whatever cryptocurrency the server is configured for). /*
moneyObj:
address: Address for the selected cryptocurrency.
amount: Amount in satoshis
feeLevel: 'NORMAL' or 'ECONOMIC'. Defaults to 'ECONOMIC'
memo: Optional note.
512829
function sendMoney(config, moneyObj) {
  const defaultObj = {
    feeLevel: "ECONOMIC",
  };

  // Add default values to the moneyObj if they are not already assigned.
  Object.assign(moneyObj, defaultObj);

  const options = {
    method: "POST",
    uri: `${config.obServer}:${config.obPort}/wallet/spend`,
    json: true, // Automatically stringifies the body to JSON
    body: moneyObj,
    headers: {
      Authorization: config.apiCredentials,
    },
    // resolveWithFullResponse: true
  };

  return rp(options);
}
1218558
def create(self,rate, amount, order_type, pair):
        '''  
        '''
        nonce = nounce()
        payload = { 'rate': rate,
                    'amount': amount,
                    'order_type': order_type,
                    'pair': pair
                    }
        url= 'https://coincheck.com/api/exchange/orders'
        body = 'rate={rate}&amount={amount}&order_type={order_type}&pair={pair}'.format(**payload)
        message = nonce + url + body
        signature = hmac.new(self.secret_key.encode('utf-8'), message.encode('utf-8'), hashlib.sha256).hexdigest()
        headers = {
           'ACCESS-KEY'      : self.access_key,
           'ACCESS-NONCE'    : nonce,
           'ACCESS-SIGNATURE': signature
        }
        r = requests.post(url,headers=headers,data=body)
        return json.loads(r.text)
445223
def place_order(self, amount, price, side, ord_type, symbol='btcusd', exchange='bitfinex'):
        
        payload = {

            "request": "/v1/order/new",
            "nonce": self._nonce,
            "symbol": symbol,
            "amount": amount,
            "price": price,
            "exchange": exchange,
            "side": side,
            "type": ord_type

        }

        signed_payload = self._sign_payload(payload)
        r = requests.post(self.URL + "/order/new", headers=signed_payload, verify=True)
        json_resp = r.json()

        try:
            json_resp['order_id']
        except:
            return json_resp['message']

        return json_resp
1041586
def select_inputs(self, address: str, amount: int) -> dict:
        ''''''

        utxos = []
        utxo_sum = Decimal(0)
        for tx in sorted(self.listunspent(address=address), key=itemgetter('confirmations')):

            if tx["address"] not in (self.pa_parameters.P2TH_addr,
                                     self.pa_parameters.test_P2TH_addr):

                utxos.append(
                        MutableTxIn(txid=tx['txid'],
                                    txout=tx['vout'],
                                    sequence=Sequence.max(),
                                    script_sig=ScriptSig.empty())
                         )

                utxo_sum += Decimal(tx["amount"])
                if utxo_sum >= amount:
                    return {'utxos': utxos, 'total': utxo_sum}

        if utxo_sum < amount:
            raise InsufficientFunds("Insufficient funds.")

        raise Exception("undefined behavior :.(")
334938
def send_transaction(
            self,
            to: Address,
            startgas: int,
            value: int = 0,
            data: bytes = b'',
    ) -> bytes:
        
        if to == to_canonical_address(constants.NULL_ADDRESS):
            warnings.warn('For contract creation the empty string must be used.')

        with self._nonce_lock:
            nonce = self._available_nonce
            gas_price = self.gas_price()

            transaction = {
                'data': data,
                'gas': startgas,
                'nonce': nonce,
                'value': value,
                'gasPrice': gas_price,
            }
            node_gas_price = self.web3.eth.gasPrice
            log.debug(
                'Calculated gas price for transaction',
                node=pex(self.address),
                calculated_gas_price=gas_price,
                node_gas_price=node_gas_price,
            )

            # add the to address if not deploying a contract
            if to != b'':
                transaction['to'] = to_checksum_address(to)

            signed_txn = self.web3.eth.account.signTransaction(transaction, self.privkey)

            log_details = {
                'node': pex(self.address),
                'nonce': transaction['nonce'],
                'gasLimit': transaction['gas'],
                'gasPrice': transaction['gasPrice'],
            }
            log.debug('send_raw_transaction called', **log_details)

            tx_hash = self.web3.eth.sendRawTransaction(signed_txn.rawTransaction)
            self._available_nonce += 1

            log.debug('send_raw_transaction returned', tx_hash=encode_hex(tx_hash), **log_details)
            return tx_hash
230707
function(_config) {
        var self = this;

        if(!_config) {
            throw new Error("You must give bitcoinaddress config object");
        }
        this.config = _config;
        $ = this.config.jQuery || jQuery;
        this.scan();
        this.initUX();
    }
432937
def ripple_withdrawal(self, amount, address, currency):
        
        data = {'amount': amount, 'address': address, 'currency': currency}
        response = self._post("ripple_withdrawal/", data=data,
                              return_json=True)
        return self._expect_true(response)
527908
def script_hex_to_address( script_hex, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_script_hex_to_address(script_hex, **blockchain_opts)
    else:
        raise ValueError("Unknown blockchain '{}'".format(blockchain))
142952
def withdraw(currency_code, address, amount, option = {})
            option["currency"] = currency_code
            option["address"] = address
            option["amount"] = amount
            json = post_ssl(@zaif_trade_url, "withdraw", option)
            return json
        end
1188137
def xrp_withdrawal(self, amount, address, destination_tag=None):
        
        data = {'amount': amount, 'address': address}
        if destination_tag:
            data['destination_tag'] = destination_tag

        return self._post("xrp_withdrawal/", data=data, return_json=True,
                          version=2)["id"]
766268
function(qrContainer) {

        var elem = qrContainer.parents(".bitcoin-address-container");
        var url;
        //var addr = elem.attr("data-bc-address");

        if(this.config.qrRawAddress) {
            url = elem.attr("data-bc-address");
        } else {
            url = this.buildBitcoinURI(elem.attr("data-bc-address"),
            elem.attr("data-bc-amount"),
            elem.attr("data-bc-label"));
        }

        var options = $.extend({}, this.config.qr, {
            text: url
        });
        var qrCode = new qrcode.QRCode(qrContainer.get(0), options);
    }
499441
def get_privkey_address(privkey_info, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_get_privkey_address(privkey_info, **blockchain_opts)
    else:
        raise ValueError('Unknown blockchain "{}"'.format(blockchain))
199387
def from_unit_to_satoshi(self, value, unit='satoshi'):
        
        if not unit or unit == 'satoshi':
            return value
        if unit == 'bitcoin' or unit == 'btc':
            return value * 1e8

        # assume fiat currency that we can convert
        convert = get_current_price(self.crypto, unit)
        return int(value / convert * 1e8)
477672
def Address(self):
        
        if self._address is None:
            self._address = Crypto.ToAddress(self.ScriptHash)
        return self._address
417299
def put(url, payload, options={}, &block)
      http_options = options.merge(@basic_options)
      if block_given?
        RestClient.put(url, payload, http_options, &block)
      else
        RestClient.put(url, payload, http_options)
      end

    end
415446
def to_satoshis(input_quantity, input_type):
    '''  '''
    assert input_type in UNIT_CHOICES, input_type

    # convert to satoshis
    if input_type in ('btc', 'mbtc', 'bit'):
        satoshis = float(input_quantity) * float(UNIT_MAPPINGS[input_type]['satoshis_per'])
    elif input_type == 'satoshi':
        satoshis = input_quantity
    else:
        raise Exception('Invalid Unit Choice: %s' % input_type)

    return int(satoshis)
1251751
public static String convertToBitcoinURI(Address address, Coin amount,
                                             String label, String message) {
        return convertToBitcoinURI(address.getParameters(), address.toString(), amount, label, message);
    }