Transfer funds between the UK Exchange and Australian Exchange wallets.

        :param Wallet from_: Source wallet
        :param Wallet to: Destination wallet
        :param float amount: Amount to transfer
776140
def transfer_funds(self, from_, to, amount):
        
        return self.make_api_request(
            'Account',
            'transferFunds',
            utils.get_kwargs(locals()),
            model=models.TransferResponse,
        )
1009236
@Trivial
    private void transferOrReleasePermit() {
        maxConcurrencyConstraint.release();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "expedites/maxConcurrency available",
                     expeditesAvailable, maxConcurrencyConstraint.availablePermits());

        // The permit might be needed to run tasks on the global executor,
        if (!queue.isEmpty() && withheldConcurrency.get() > 0 && maxConcurrencyConstraint.tryAcquire()) {
            decrementWithheldConcurrency();
            if (acquireExpedite() > 0)
                expediteGlobal(new GlobalPoolTask());
            else
                enqueueGlobal(new GlobalPoolTask());
        }
    }
983545
def transfer_to_main(self, amount, currency, subaccount=None):
        
        data = {'amount': amount,
                'currency': currency,}
        if subaccount is not None:
            data['subAccount'] = subaccount
        return self._post("transfer-to-main/", data=data, return_json=True,
                          version=2)
1049986
def base_convert_money(amount, currency_from, currency_to):
    
    source = get_rate_source()

    # Get rate for currency_from.
    if source.base_currency != currency_from:
        rate_from = get_rate(currency_from)
    else:
        # If currency from is the same as base currency its rate is 1.
        rate_from = Decimal(1)

    # Get rate for currency_to.
    rate_to = get_rate(currency_to)

    if isinstance(amount, float):
        amount = Decimal(amount).quantize(Decimal('.000001'))

    # After finishing the operation, quantize down final amount to two points.
    return ((amount / rate_from) * rate_to).quantize(Decimal("1.00"))
917900
def send_to_address(recipient_address, amount, private_key,
        blockchain_client=BlockchainInfoClient(), fee=STANDARD_FEE,
        change_address=None):
    
    # build and sign the tx
    signed_tx = make_send_to_address_tx(recipient_address, amount,
        private_key, blockchain_client, fee=fee,
        change_address=change_address)
    # dispatch the signed transction to the network
    response = broadcast_transaction(signed_tx, blockchain_client)
    # return the response
    return response
453732
def convert_to_btc(self, amount, currency):
        
        if isinstance(amount, Decimal):
            use_decimal = True
        else:
            use_decimal = self._force_decimal

        url = 'https://api.coindesk.com/v1/bpi/currentprice/{}.json'.format(currency)
        response = requests.get(url)
        if response.status_code == 200:
            data = response.json()
            price = data.get('bpi').get(currency, {}).get('rate_float', None)
            if price:
                if use_decimal:
                    price = Decimal(price)
                try:
                    converted_btc = amount/price
                    return converted_btc
                except TypeError:
                    raise DecimalFloatMismatchError("convert_to_btc requires amount parameter is of type Decimal when force_decimal=True")
        raise RatesNotAvailableError("BitCoin Rates Source Not Ready For Given date")
571265
function createOutTransfer (dappId, transactionId, recipientId, amount, secret, secondSecret, timeOffset) {
	var now = new Date().getTime();
	var time = timeOffset ? now - timeOffset : now;
	var keys = crypto.getKeys(secret);

	var transaction = {
		type: 7,
		amount: amount,
		fee: constants.fees.send,
		recipientId: recipientId,
		senderPublicKey: keys.publicKey,
		timestamp: slots.getTime(time),
		asset: {
			outTransfer: {
				dappId: dappId,
				transactionId: transactionId,
			},
		},
	};

	crypto.sign(transaction, keys);

	if (secondSecret) {
		var secondKeys = crypto.getKeys(secondSecret);
		crypto.secondSign(transaction, secondKeys);
	}

	return transaction;
}
1185567
function createInTransfer (dappId, amount, secret, secondSecret, timeOffset) {
	var now = new Date().getTime();
	var time = timeOffset ? now - timeOffset : now;
	var keys = crypto.getKeys(secret);

	var transaction = {
		type: 6,
		amount: amount,
		fee: constants.fees.send,
		recipientId: null,
		senderPublicKey: keys.publicKey,
		timestamp: slots.getTime(time),
		asset: {
			inTransfer: {
				dappId: dappId
			}
		}
	};

	crypto.sign(transaction, keys);

	if (secondSecret) {
		var secondKeys = crypto.getKeys(secondSecret);
		crypto.secondSign(transaction, secondKeys);
	}

	transaction.id = crypto.getId(transaction);
	return transaction;
}
92262
private static void transferImpl(BitReader reader, BitWriter writer, long count) {
		while (count >= 64) {
			//TODO could benefit from reading into a larger buffer here - eg bytes?
			long bits = reader.readLong(64);
			writer.write(bits, 64);
			count -= 64;
		}
		if (count != 0L) {
			long bits = reader.readLong((int) count);
			writer.write(bits, (int) count);
		}
	}
303702
private void transfer(Socket sourceSocket, Source source, Sink sink) {
    try {
      Buffer buffer = new Buffer();
      for (long byteCount; (byteCount = source.read(buffer, 8192L)) != -1; ) {
        sink.write(buffer, byteCount);
        sink.flush();
      }
    } catch (IOException e) {
      System.out.println("transfer failed from " + sourceSocket + ": " + e);
    } finally {
      closeQuietly(sink);
      closeQuietly(source);
      closeQuietly(sourceSocket);
      openSockets.remove(sourceSocket);
    }
  }
681403
function transferNumber(value, num) {
    var str = value.toString(2);
    var ary = [];
    var end = str.length;
    var start;

    for (var i = 1; i < num + 1; i++) {
      start = -7 * i;
      ary.push(str.slice(start, end));
      end = start;
    }

    ary.forEach(function(val, idx, target) {
      val = parseInt(val, 2);
      val > 0 || (val = 0);
      target[idx] = val;
    });
    return ary;
  }
895681
def convert(from_currency, to_currency, from_currency_price=1):
	
	get_cache()
	from_currency, to_currency = validate_currency(from_currency, to_currency)
	update_cache(from_currency, to_currency)
	return ccache[from_currency][to_currency]['value'] * from_currency_price
607577
def send_margin_order(self, acc_id, amount, symbol, _type, price=0):
        

        params = {
            'account-id': acc_id,
            'amount': amount,
            'symbol': symbol,
            'type': _type,
            'source': 'margin-api'
        }
        if price:
            params['price'] = price

        path = '/v1/order/orders/place'

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(api_key_post(params, path))

            return handle

        return _wrapper
177636
def send_amount
      s = success!
      return s.last.amount if s.offers.blank?

      source_asset = s.offers.first.asset_bought
      source_offers = s.offers.take_while{|o| o.asset_bought == source_asset}

      source_offers.map(&:amount_bought).sum
    end
941171
public function exchange($from, $to, $amount = 1) {
        return $this->getExchange()->setHeader([
            'apikey' => $this->get('apikey')
        ])->parameters([
            'fromCurrency' => $from,
            'toCurrency' => $to,
            'amount' => $amount
        ])->json();
    }
181007
function pickMultipleCoinsAndContinue(){
		conn.query(
			"SELECT unit, message_index, output_index, amount, address, blinding \n\
			FROM outputs \n\
			CROSS JOIN units USING(unit) \n\
			WHERE address IN(?) AND asset"+(asset ? "="+conn.escape(asset) : " IS NULL")+" AND is_spent=0 \n\
				AND sequence='good' "+confirmation_condition+"  \n\
			ORDER BY amount DESC LIMIT ?",
			[arrSpendableAddresses, constants.MAX_INPUTS_PER_PAYMENT_MESSAGE-2],
			function(rows){
				async.eachSeries(
					rows,
					function(row, cb){
						var input = row;
						objectHash.cleanNulls(input);
						required_amount += is_base*TRANSFER_INPUT_SIZE;
						addInput(input);
						// if we allow equality, we might get 0 amount for change which is invalid
						var bFound = is_base ? (total_amount > required_amount) : (total_amount >= required_amount);
						bFound ? cb('found') : cb();
					},
					function(err){
						if (err === 'found')
							onDone(arrInputsWithProofs, total_amount);
						else if (asset)
							issueAsset();
						else
							addHeadersCommissionInputs();
					}
				);
			}
		);
	}
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