Withdraw to Ripple
170125
public TheRockWithdrawalResponse withdrawRipple(
      Currency currency, BigDecimal amount, String destinationAddress, Long destinationTag)
      throws TheRockException, IOException {
    final TheRockWithdrawal withdrawal =
        TheRockWithdrawal.createRippleWithdrawal(
            currency.getCurrencyCode(), amount, destinationAddress, destinationTag);
    return theRockAuthenticated.withdraw(
        apiKey, signatureCreator, exchange.getNonceFactory(), withdrawal);
  }
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;
}
986931
def get_withdrawal(self, withdrawal_id, **params):
        """"""
        return self.api_client.get_withdrawal(self.id, withdrawal_id, **params)
1102178
function Tab(tab, ctx) {
	if (tab) {
			var rippleContainer = document.createElement('span');
			u.addClass(rippleContainer,ctx._CssClasses.U_RIPPLE_CONTAINER);
			u.addClass(rippleContainer,ctx._CssClasses.U_JS_RIPPLE_EFFECT);
			var ripple = document.createElement('span');
			u.addClass(ripple,ctx._CssClasses.U_RIPPLE);
			rippleContainer.appendChild(ripple);
			tab.appendChild(rippleContainer);

      tab.ripple = new u.Ripple(tab)


		tab.addEventListener('click', function(e) {
			u.stopEvent(e);
			// e.preventDefault();
			var href = tab.href.split('#')[1];
			var panel = ctx.element.querySelector('#' + href);
			ctx.resetTabState_();
			ctx.resetPanelState_();
			u.addClass(tab,ctx._CssClasses.ACTIVE_CLASS);
			u.addClass(panel,ctx._CssClasses.ACTIVE_CLASS);
		});

	}
}
1160286
def withdraw(coin, params = {})
      raise ConfigurationError.new('No coin type specified') unless coin
      raise ConfigurationError.new('Invalid coin type specified') unless Coin.valid?(coin)
      request(:post, "/#{coin}_withdrawal", params)
    end
604370
protected function submitPayment()
    {
        $this->data_token = $this->controller->getPosted('stripeToken', '', true, 'string');

        if (!empty($this->data_token)) {

            $params = array(
                'token' => $this->data_token,
                'currency' => $this->data_order['currency'],
                'amount' => $this->data_order['total_formatted_number']
            );

            $gateway = $this->getGateway();
            $gateway->setApiKey($this->getSecretKey());
            $this->response = $gateway->purchase($params)->send();
            $this->processResponse();
        }
    }
655269
public static Transfer retrieve(String transfer) throws StripeException {
    return retrieve(transfer, (Map<String, Object>) null, (RequestOptions) null);
  }
206205
function (input, alphabetName) {
        var alphabet = alphabets[alphabetName || 'ripple'],
            base     = new sjcl.bn(alphabet.length),
            bi       = new sjcl.bn(0);

        var i;
        while (i != input.length && input[i] === alphabet[0]) {
          i += 1;
        }

        for (i = 0; i != input.length; i += 1) {
          var v = alphabet.indexOf(input[i]);

          if (v < 0) {
            return null;
          }

          bi = bi.mul(base).addM(v);
        }

        var bytes = sjcl.codec.bytes.fromBits(bi.toBits()).reverse();

        // Remove leading zeros
        while(bytes[bytes.length-1] === 0) {
          bytes.pop();
        }

        // Add the right number of leading zeros
        for (i = 0; input[i] === alphabet[0]; i++) {
          bytes.push(0);
        }

        bytes.reverse();

        return bytes;
      }
931110
function removeRipple(e, el, ripple) {

        // Check if the ripple still exist
        if (!ripple) {
            return;
        }

        ripple.classList.remove('waves-rippling');

        var relativeX = ripple.getAttribute('data-x');
        var relativeY = ripple.getAttribute('data-y');
        var scale     = ripple.getAttribute('data-scale');
        var translate = ripple.getAttribute('data-translate');

        // Get delay beetween mousedown and mouse leave
        var diff = Date.now() - Number(ripple.getAttribute('data-hold'));
        var delay = 350 - diff;

        if (delay < 0) {
            delay = 0;
        }

        if (e.type === 'mousemove') {
            delay = 150;
        }

        // Fade out ripple after delay
        var duration = e.type === 'mousemove' ? 2500 : Effect.duration;

        setTimeout(function() {

            var style = {
                top: relativeY + 'px',
                left: relativeX + 'px',
                opacity: '0',

                // Duration
                '-webkit-transition-duration': duration + 'ms',
                '-moz-transition-duration': duration + 'ms',
                '-o-transition-duration': duration + 'ms',
                'transition-duration': duration + 'ms',
                '-webkit-transform': scale + ' ' + translate,
                '-moz-transform': scale + ' ' + translate,
                '-ms-transform': scale + ' ' + translate,
                '-o-transform': scale + ' ' + translate,
                'transform': scale + ' ' + translate
            };

            ripple.setAttribute('style', convertStyle(style));

            setTimeout(function() {
                try {
                    el.removeChild(ripple);
                } catch (e) {
                    return false;
                }
            }, duration);

        }, delay);
    }
1011037
function() {
    return new Promise(function(onResolve, onReject) {

      const getBalance = async function(){

        const getSTPBalanceResponse = await fundManager.getSTPrimeBalanceOf(utilityChainOwnerAddr);

        if(getSTPBalanceResponse.isSuccess() && (new BigNumber(getSTPBalanceResponse.data.balance)).greaterThan(0)){
          logger.info('* ST\' credited to utility chain owner');
          return onResolve(getSTPBalanceResponse);
        } else {
          logger.info('* Waiting for credit of ST\' to utility chain owner');
          setTimeout(getBalance, 60000);
        }
      };

      getBalance();
    });
  }
488265
public OvhWithdrawal withdrawal_withdrawalId_GET(String withdrawalId) throws IOException {
		String qPath = "/me/withdrawal/{withdrawalId}";
		StringBuilder sb = path(qPath, withdrawalId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhWithdrawal.class);
	}
969629
public static AccountInfo adaptAccountInfo(
      final RippleAccountBalances account, final String username) {

    // Adapt account balances to XChange balances
    final Map<String, List<Balance>> balances = new HashMap<>();
    for (final RippleBalance balance : account.getBalances()) {
      final String walletId;
      if (balance.getCurrency().equals("XRP")) {
        walletId = null;
      } else {
        walletId = balance.getCounterparty();
      }
      if (!balances.containsKey(walletId)) {
        balances.put(walletId, new LinkedList<Balance>());
      }
      balances
          .get(walletId)
          .add(new Balance(Currency.getInstance(balance.getCurrency()), balance.getValue()));
    }

    final List<Wallet> accountInfo = new ArrayList<>(balances.size());
    for (final Map.Entry<String, List<Balance>> wallet : balances.entrySet()) {
      accountInfo.add(new Wallet(wallet.getKey(), wallet.getValue()));
    }

    return new AccountInfo(username, BigDecimal.ZERO, accountInfo);
  }
259328
@Override
  public final void withdrawal(final Map<String, Object> pAddParam,
    final IMakingWarehouseEntry pEntity,
      final WarehouseSite pWhSiteFrom) throws Exception {
    if (!pEntity.getIdDatabaseBirth()
      .equals(getSrvOrm().getIdDatabase())) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "can_not_make_ws_entry_for_foreign_src");
    }
    String langDef = (String) pAddParam.get("langDef");
    DateFormat dateFormat = DateFormat.getDateTimeInstance(
      DateFormat.MEDIUM, DateFormat.SHORT, new Locale(langDef));
    ColumnsValues cvs = null;
    if (this.fastLoc) {
      cvs = new ColumnsValues();
      cvs.getFormula().add("itsVersion");
      cvs.getFormula().add("theRest");
      cvs.put("itsVersion", "ITSVERSION+1");
    }
    if (pWhSiteFrom != null) {
      WarehouseRest wr = getSrvOrm().retrieveEntityWithConditions(pAddParam,
        WarehouseRest.class, "where THEREST>0 and INVITEM="
          + pEntity.getInvItem().getItsId() + " and UNITOFMEASURE="
            + pEntity.getUnitOfMeasure().getItsId() + " and WAREHOUSESITE="
              + pWhSiteFrom.getItsId());
      if (wr == null
        || wr.getTheRest().compareTo(pEntity.getItsQuantity()) < 0) {
        throw new ExceptionWithCode(PurchaseInvoice.THERE_IS_NO_GOODS,
          "There is no goods in stock, Item ID/UOM ID/ WS ID/ quantity"
            + pEntity.getInvItem().getItsId() + "/" + pEntity.getUnitOfMeasure()
              .getItsId() + "/" + pEntity.getItsQuantity());
      }
      if (this.fastLoc) {
        cvs.put("theRest", "THEREST-" + pEntity.getItsQuantity());
        this.srvDb.executeUpdate("WAREHOUSEREST", cvs, "WAREHOUSESITE="
      + wr.getWarehouseSite().getItsId() + " and INVITEM=" + wr.getInvItem()
    .getItsId() + " and UNITOFMEASURE=" + wr.getUnitOfMeasure().getItsId());
      } else {
        wr.setTheRest(wr.getTheRest().subtract(pEntity.getItsQuantity()));
        getSrvOrm().updateEntity(pAddParam, wr);
      }
      WarehouseEntry wm = new WarehouseEntry();
      wm.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
      wm.setSourceId(pEntity.getItsId());
      wm.setSourceType(pEntity.constTypeCode());
      wm.setWarehouseSiteFrom(wr.getWarehouseSite());
      wm.setUnitOfMeasure(wr.getUnitOfMeasure());
      wm.setInvItem(wr.getInvItem());
      wm.setItsQuantity(pEntity.getItsQuantity());
      wm.setSourceOwnerId(pEntity.getOwnerId());
      wm.setSourceOwnerType(pEntity.getOwnerType());
      wm.setDescription(makeDescription(pEntity, langDef, dateFormat));
      getSrvOrm().insertEntity(pAddParam, wm);
      wm.setIsNew(false);
    } else {
      List<WarehouseRest> wrl = getSrvOrm().retrieveListWithConditions(
        pAddParam, WarehouseRest.class, "where THEREST>0 and INVITEM="
          + pEntity.getInvItem().getItsId() + " and UNITOFMEASURE="
            + pEntity.getUnitOfMeasure().getItsId());
      BigDecimal theRest = BigDecimal.ZERO;
      for (WarehouseRest wr : wrl) {
        theRest = theRest.add(wr.getTheRest());
        if (theRest.compareTo(pEntity.getItsQuantity()) >= 0) {
          break;
        }
      }
      if (theRest.compareTo(pEntity.getItsQuantity()) < 0) {
        throw new ExceptionWithCode(PurchaseInvoice.THERE_IS_NO_GOODS,
          "there_is_no_goods_in_stock");
      }
      BigDecimal quantityToLeaveRest = pEntity.getItsQuantity();
      for (WarehouseRest wr : wrl) {
        if (quantityToLeaveRest.doubleValue() == 0) {
          break;
        }
        BigDecimal quantityToLeave;
        if (wr.getTheRest().compareTo(quantityToLeaveRest) <= 0) {
          quantityToLeave = wr.getTheRest();
        } else {
          quantityToLeave = quantityToLeaveRest;
        }
        if (this.fastLoc) {
          cvs.put("theRest", "THEREST-" + quantityToLeave);
          this.srvDb.executeUpdate("WAREHOUSEREST", cvs, "WAREHOUSESITE="
        + wr.getWarehouseSite().getItsId() + " and INVITEM=" + wr.getInvItem()
      .getItsId() + " and UNITOFMEASURE=" + wr.getUnitOfMeasure().getItsId());
        } else {
          wr.setTheRest(wr.getTheRest().subtract(quantityToLeave));
          getSrvOrm().updateEntity(pAddParam, wr);
        }
        WarehouseEntry wm = new WarehouseEntry();
        wm.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
        wm.setSourceId(pEntity.getItsId());
        wm.setSourceType(pEntity.constTypeCode());
        wm.setWarehouseSiteFrom(wr.getWarehouseSite());
        wm.setUnitOfMeasure(wr.getUnitOfMeasure());
        wm.setInvItem(wr.getInvItem());
        wm.setItsQuantity(quantityToLeave);
        wm.setSourceOwnerId(pEntity.getOwnerId());
        wm.setSourceOwnerType(pEntity.getOwnerType());
        wm.setDescription(makeDescription(pEntity, langDef, dateFormat));
        getSrvOrm().insertEntity(pAddParam, wm);
        wm.setIsNew(false);
        quantityToLeaveRest = quantityToLeaveRest.subtract(quantityToLeave);
      }
    }
  }
336171
public function createWithdrawal(Withdrawal $withdrawal, array $params = [])
    {
        $this->getClient()->createAccountWithdrawal($this, $withdrawal, $params);
    }
476803
public function withdraw($amount, $type = 'withdraw', $meta = [], $shouldAccept = true)
    {
        $accepted = $shouldAccept ? $this->canWithdraw($amount) : true;

        if ($accepted) {
            $this->wallet->balance -= $amount;
            $this->wallet->save();
        } elseif (! $this->wallet->exists) {
            $this->wallet->save();
        }

        $this->wallet->transactions()
            ->create([
                'amount' => $amount,
                'hash' => uniqid('lwch_'),
                'type' => $type,
                'accepted' => $accepted,
                'meta' => $meta
            ]);
    }
504996
def ripple_carry_add(A, B, cin=0):
    """"""
    if len(A) != len(B):
        raise ValueError("expected A and B to be equal length")
    ss, cs = list(), list()
    for i, a in enumerate(A):
        c = (cin if i == 0 else cs[i-1])
        ss.append(a ^ B[i] ^ c)
        cs.append(a & B[i] | a & c | B[i] & c)
    return farray(ss), farray(cs)
1325591
function (e, $ripple) {

      // 鼠标右键不产生涟漪
      if (e.button === 2) {
        return;
      }

      // 点击位置坐标
      var tmp;
      if ('touches' in e && e.touches.length) {
        tmp = e.touches[0];
      } else {
        tmp = e;
      }

      var touchStartX = tmp.pageX;
      var touchStartY = tmp.pageY;

      // 涟漪位置
      var offset = $ripple.offset();
      var center = {
        x: touchStartX - offset.left,
        y: touchStartY - offset.top,
      };

      var height = $ripple.innerHeight();
      var width = $ripple.innerWidth();
      var diameter = Math.max(
        Math.pow((Math.pow(height, 2) + Math.pow(width, 2)), 0.5), 48
      );

      // 涟漪扩散动画
      var translate =
        'translate3d(' + (-center.x + width / 2) + 'px, ' + (-center.y + height / 2) + 'px, 0) ' +
        'scale(1)';

      // 涟漪的 DOM 结构
      $('<div class="mdui-ripple-wave" style="' +
        'width: ' + diameter + 'px; ' +
        'height: ' + diameter + 'px; ' +
        'margin-top:-' + diameter / 2 + 'px; ' +
        'margin-left:-' + diameter / 2 + 'px; ' +
        'left:' + center.x + 'px; ' +
        'top:' + center.y + 'px;">' +
        '</div>')

        // 缓存动画效果
        .data('translate', translate)

        .prependTo($ripple)
        .reflow()
        .transform(translate);
    }