TokenError
Variant 28 v393sp_runtime::TokenError
About This Type
Error related to token operations (balances, assets).
Covers common balance issues like insufficient funds, frozen accounts, and overflow. A variant of DispatchError.
Variants (10)
| Index | Name | Fields | Docs |
|---|---|---|---|
| 0 | FundsUnavailable | none | |
| 1 | OnlyProvider | none | |
| 2 | BelowMinimum | none | |
| 3 | CannotCreate | none | |
| 4 | UnknownAsset | none | |
| 5 | Frozen | none | |
| 6 | Unsupported | none | |
| 7 | CannotCreateHold | none | |
| 8 | NotExpendable | none | |
| 9 | Blocked | none |
SCALE Encoding
- Rule
- 1-byte variant index followed by variant-specific field data. 10 possible variants.
- Size
- variable (1+ bytes)
Examples
FundsUnavailable
0x0000 Variant index 0 = FundsUnavailableOnlyProvider
0x0101 Variant index 1 = OnlyProviderBelowMinimum
0x0202 Variant index 2 = BelowMinimumCode Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode TokenError — variant "FundsUnavailable"
const value = registry.createType("TokenError", "FundsUnavailable");
console.log("Hex:", value.toHex());Referenced By (1)
Type Information
- Type ID
- 28
- Kind
- Variant
- Path
- sp_runtime::TokenError
- Runtime
- v393