withdraw

Call v210 → current #0

Withdraws balance from an EVM account to the Substrate balance.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: developerswallets

The Big Picture

Bridge funds from EVM (H160) to native Substrate for staking and native pallets.

Use Cases

  • Bridge from EVM to native
  • Exit EVM DeFi to native balance

From Chain Metadata

Withdraw balance from EVM into currency/balances pallet.

Input Parameters

#NameTypeDescription
0
address
H160 address: 20-byte address (Ethereum-style)
1
value
u64 BalanceOf<T>value: Balance in chain native currency (RAO for TAO; ÷10⁹) (RAO -> TAO (/ 10^9))

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • EVM address has sufficient balance
  • Caller controls EVM address

Effects

Postconditions

  • EVM balance decreased
  • Substrate balance increased

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build withdraw call (typed, named args)
const address = "0x0000000000000000000000000000000000000000";
const value = 0n;

const tx = api.tx.EVM.withdraw({
  address,
  value,
});

Runtime Info

Pallet Index
22
Call Index
0
First Version
v210
Current Version
v411