SimSwapResult

Composite 722 v393

pallet_subtensor_swap_runtime_api::SimSwapResult

About This Type

Structured type: SimSwapResult.

A struct-like type where each field is encoded in declaration order.

Encoding: Fields encoded consecutively in declaration order, no field names or separators.

Fields (6)

#NameType
0tao_amountu64
1alpha_amountu64
2tao_feeu64
3alpha_feeu64
4tao_slippageu64
5alpha_slippageu64

SCALE Encoding

Rule
6 fields encoded consecutively in declaration order. No field names or delimiters.
Size
sum of field sizes

Examples

Struct with 6 fields = tao_amount: u64, alpha_amount: u64, tao_fee: u64, alpha_fee: u64, tao_slippage: u64, alpha_slippage: u64
0x<field0><field1><field2><field3><field4><field5>
field 0 tao_amount: u64
field 1 alpha_amount: u64
field 2 tao_fee: u64
field 3 alpha_fee: u64
field 4 tao_slippage: u64
field 5 alpha_slippage: u64

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode SimSwapResult
const value = registry.createType("SimSwapResult", {
  tao_amount: 1_000_000_000n,
  alpha_amount: 1_000_000_000n,
  tao_fee: 1_000_000_000n,
  alpha_fee: 1_000_000_000n,
  tao_slippage: 1_000_000_000n,
  alpha_slippage: 1_000_000_000n
});
console.log("Hex:", value.toHex());

Type Information

Type ID
722
Kind
Composite
Path
pallet_subtensor_swap_runtime_api::SimSwapResult
Runtime
v393