logo

Manual Wallet Transaction Guide

Sometimes you may want to transfer funds from a platform wallet manually(e.g. to move funds after an erroneous transaction)

To do that, you'd need to do the following:

  1. Connect to a deposit daemon container
  2. Run kaigara bundle exec rails c
  3. Select the currency to be used
  cur = Currency.find(key)

where key is the currency ID to be used(e.g. usdt), you can check all existing ID's by running Currency.pluck(:id) 4. Prepare transaction parameters:

  tx = Peatio::Transaction.new(to_address: destination, amount: value.to_f * 0.94, currency_id: cur.id)

where destination is the destination address(e.g. rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh); value is the amount of funds to be transferred(e.g. 0.01); 5. Find the Wallet ID to be used(e.g. hot Wallet of BTC)

# List all available Wallets for a given currency
cur.wallets.pluck(:kind, :id)
wallet = Wallet.find(*desired_id*)
  1. Create the WalletService:
  adapter = WalletService.new(wallet).adapter
  cur = Currency.find(tx.currency_id)
  adapter.configure(wallet: wallet.to_wallet_api_settings, currency: cur.to_blockchain_api_settings)
  1. Create and broadcast the transaction:
  adapter.create_transaction!(tx)