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:
deposit
daemon containerkaigara bundle exec rails c
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*)
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)
adapter.create_transaction!(tx)