interbtc-api

@interlay/interbtc-api / Exports / Ratio

Interface: Ratio

Name

Ratio

Hierarchy

Table of contents

Properties

Accessors

Methods

Properties

#private

Private #private: any

Inherited from

Permill.#private

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:12


createdAtHash

Optional createdAtHash: IU8a

Inherited from

Permill.createdAtHash

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:16


encodedLength

Readonly encodedLength: number

Inherited from

Permill.encodedLength

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:14


initialU8aLength

Optional initialU8aLength: number

Inherited from

Permill.initialU8aLength

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:17


isStorageFallback

Optional isStorageFallback: boolean

Inherited from

Permill.isStorageFallback

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:18


isUnsigned

Readonly isUnsigned: boolean

Inherited from

Permill.isUnsigned

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:15


registry

Readonly registry: Registry

Inherited from

Permill.registry

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:13

Accessors

hash

get hash(): IU8a

Returns

IU8a

Description

returns a hash of the contents

Inherited from

Permill.hash

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:23


isEmpty

get isEmpty(): boolean

Returns

boolean

Description

Checks if the value is a zero value (align elsewhere)

Inherited from

Permill.isEmpty

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:27

Methods

abs

abs(): BN

Returns

BN

Description

absolute value

Inherited from

Permill.abs

Defined in

node_modules/@types/bn.js/index.d.ts:228


add

add(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

addition

Inherited from

Permill.add

Defined in

node_modules/@types/bn.js/index.d.ts:238


addn

addn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

addition

Inherited from

Permill.addn

Defined in

node_modules/@types/bn.js/index.d.ts:248


and

and(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

and

Inherited from

Permill.and

Defined in

node_modules/@types/bn.js/index.d.ts:379


andln

andln(b): BN

Parameters

Name Type
b number

Returns

BN

Description

and (NOTE: andln is going to be replaced with andn in future)

Inherited from

Permill.andln

Defined in

node_modules/@types/bn.js/index.d.ts:399


bincn

bincn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

add 1 << b to the number

Inherited from

Permill.bincn

Defined in

node_modules/@types/bn.js/index.d.ts:483


bitLength

bitLength(): number

Returns

number

Description

Returns the number of bits in the value

Inherited from

Permill.bitLength

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:31


byteLength

byteLength(): number

Returns

number

Description

return number of bytes occupied

Inherited from

Permill.byteLength

Defined in

node_modules/@types/bn.js/index.d.ts:118


clone

clone(): BN

Returns

BN

Description

clone number

Inherited from

Permill.clone

Defined in

node_modules/@types/bn.js/index.d.ts:63


cmp

cmp(b): -1 | 0 | 1

Parameters

Name Type
b BN

Returns

-1 | 0 | 1

Description

compare numbers and return -1 (a < b), 0 (a == b), or 1 (a > b) depending on the comparison result

Inherited from

Permill.cmp

Defined in

node_modules/@types/bn.js/index.d.ts:143


cmpn

cmpn(b): -1 | 0 | 1

Parameters

Name Type
b number

Returns

-1 | 0 | 1

Description

compare numbers and return -1 (a < b), 0 (a == b), or 1 (a > b) depending on the comparison result

Inherited from

Permill.cmpn

Defined in

node_modules/@types/bn.js/index.d.ts:153


div

div(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

divide

Inherited from

Permill.div

Defined in

node_modules/@types/bn.js/index.d.ts:313


divRound

divRound(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

rounded division

Inherited from

Permill.divRound

Defined in

node_modules/@types/bn.js/index.d.ts:354


divmod

divmod(b, mode?, positive?): Object

Parameters

Name Type
b BN
mode? "div" | "mod"
positive? boolean

Returns

Object

Name Type
div BN
mod BN

Description

division with remainder

Inherited from

Permill.divmod

Defined in

node_modules/@types/bn.js/index.d.ts:328


divn

divn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

divide

Inherited from

Permill.divn

Defined in

node_modules/@types/bn.js/index.d.ts:318


egcd

egcd(b): Object

Parameters

Name Type
b BN

Returns

Object

Name Type
a BN
b BN
gcd BN

Description

Extended GCD results ({ a: ..., b: ..., gcd: ... })

Inherited from

Permill.egcd

Defined in

node_modules/@types/bn.js/index.d.ts:503


eq

eq(other?): boolean

Parameters

Name Type
other? unknown

Returns

boolean

Description

Compares the value of the input to see if there is a match

Inherited from

Permill.eq

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:35


eqn

eqn(b): boolean

Parameters

Name Type
b number

Returns

boolean

Description

a equals b

Inherited from

Permill.eqn

Defined in

node_modules/@types/bn.js/index.d.ts:203


fromTwos

fromTwos(width): BN

Parameters

Name Type
width number

Returns

BN

Description

convert from two’s complement representation, where width is the bit width

Inherited from

Permill.fromTwos

Defined in

node_modules/@types/bn.js/index.d.ts:213


gcd

gcd(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

GCD

Inherited from

Permill.gcd

Defined in

node_modules/@types/bn.js/index.d.ts:498


gt

gt(b): boolean

Parameters

Name Type
b BN

Returns

boolean

Description

a greater than b

Inherited from

Permill.gt

Defined in

node_modules/@types/bn.js/index.d.ts:178


gte

gte(b): boolean

Parameters

Name Type
b BN

Returns

boolean

Description

a greater than or equals b

Inherited from

Permill.gte

Defined in

node_modules/@types/bn.js/index.d.ts:188


gten

gten(b): boolean

Parameters

Name Type
b number

Returns

boolean

Description

a greater than or equals b

Inherited from

Permill.gten

Defined in

node_modules/@types/bn.js/index.d.ts:193


gtn

gtn(b): boolean

Parameters

Name Type
b number

Returns

boolean

Description

a greater than b

Inherited from

Permill.gtn

Defined in

node_modules/@types/bn.js/index.d.ts:183


iabs

iabs(): BN

Returns

BN

Description

absolute value

Inherited from

Permill.iabs

Defined in

node_modules/@types/bn.js/index.d.ts:233


iadd

iadd(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

addition

Inherited from

Permill.iadd

Defined in

node_modules/@types/bn.js/index.d.ts:243


iaddn

iaddn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

addition

Inherited from

Permill.iaddn

Defined in

node_modules/@types/bn.js/index.d.ts:253


iand

iand(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

and

Inherited from

Permill.iand

Defined in

node_modules/@types/bn.js/index.d.ts:384


idivn

idivn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

divide

Inherited from

Permill.idivn

Defined in

node_modules/@types/bn.js/index.d.ts:323


imaskn

imaskn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

clear bits with indexes higher or equal to b

Inherited from

Permill.imaskn

Defined in

node_modules/@types/bn.js/index.d.ts:479


imul

imul(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

multiply

Inherited from

Permill.imul

Defined in

node_modules/@types/bn.js/index.d.ts:283


imuln

imuln(b): BN

Parameters

Name Type
b number

Returns

BN

Description

multiply

Inherited from

Permill.imuln

Defined in

node_modules/@types/bn.js/index.d.ts:293


ineg

ineg(): BN

Returns

BN

Description

negate sign

Inherited from

Permill.ineg

Defined in

node_modules/@types/bn.js/index.d.ts:223


inotn

inotn(w): BN

Parameters

Name Type
w number

Returns

BN

Description

not (for the width specified by w)

Inherited from

Permill.inotn

Defined in

node_modules/@types/bn.js/index.d.ts:493


inspect

inspect(): Inspect

Returns

Inspect

Description

Returns a breakdown of the hex encoding for this Codec

Inherited from

Permill.inspect

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:39


invm

invm(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

inverse a modulo b

Inherited from

Permill.invm

Defined in

node_modules/@types/bn.js/index.d.ts:508


ior

ior(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

or

Inherited from

Permill.ior

Defined in

node_modules/@types/bn.js/index.d.ts:364


isEven

isEven(): boolean

Returns

boolean

Description

check if value is even

Inherited from

Permill.isEven

Defined in

node_modules/@types/bn.js/index.d.ts:128


isMax

isMax(): boolean

Returns

boolean

Description

True if this value is the max of the type

Inherited from

Permill.isMax

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:43


isNeg

isNeg(): boolean

Returns

boolean

Description

true if the number is negative

Inherited from

Permill.isNeg

Defined in

node_modules/@types/bn.js/index.d.ts:123


isOdd

isOdd(): boolean

Returns

boolean

Description

check if value is odd

Inherited from

Permill.isOdd

Defined in

node_modules/@types/bn.js/index.d.ts:133


isZero

isZero(): boolean

Returns

boolean

Description

check if value is zero

Inherited from

Permill.isZero

Defined in

node_modules/@types/bn.js/index.d.ts:138


ishln

ishln(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift left

Inherited from

Permill.ishln

Defined in

node_modules/@types/bn.js/index.d.ts:434


ishrn

ishrn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086)

Inherited from

Permill.ishrn

Defined in

node_modules/@types/bn.js/index.d.ts:454


isqr

isqr(): BN

Returns

BN

Description

square

Inherited from

Permill.isqr

Defined in

node_modules/@types/bn.js/index.d.ts:303


isub

isub(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

subtraction

Inherited from

Permill.isub

Defined in

node_modules/@types/bn.js/index.d.ts:263


isubn

isubn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

subtraction

Inherited from

Permill.isubn

Defined in

node_modules/@types/bn.js/index.d.ts:273


iuand

iuand(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

and

Inherited from

Permill.iuand

Defined in

node_modules/@types/bn.js/index.d.ts:394


iuor

iuor(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

or

Inherited from

Permill.iuor

Defined in

node_modules/@types/bn.js/index.d.ts:374


iushln

iushln(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift left

Inherited from

Permill.iushln

Defined in

node_modules/@types/bn.js/index.d.ts:444


iushrn

iushrn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift right

Inherited from

Permill.iushrn

Defined in

node_modules/@types/bn.js/index.d.ts:464


iuxor

iuxor(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

xor

Inherited from

Permill.iuxor

Defined in

node_modules/@types/bn.js/index.d.ts:419


ixor

ixor(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

xor

Inherited from

Permill.ixor

Defined in

node_modules/@types/bn.js/index.d.ts:409


lt

lt(b): boolean

Parameters

Name Type
b BN

Returns

boolean

Description

a less than b

Inherited from

Permill.lt

Defined in

node_modules/@types/bn.js/index.d.ts:158


lte

lte(b): boolean

Parameters

Name Type
b BN

Returns

boolean

Description

a less than or equals b

Inherited from

Permill.lte

Defined in

node_modules/@types/bn.js/index.d.ts:168


lten

lten(b): boolean

Parameters

Name Type
b number

Returns

boolean

Description

a less than or equals b

Inherited from

Permill.lten

Defined in

node_modules/@types/bn.js/index.d.ts:173


ltn

ltn(b): boolean

Parameters

Name Type
b number

Returns

boolean

Description

a less than b

Inherited from

Permill.ltn

Defined in

node_modules/@types/bn.js/index.d.ts:163


maskn

maskn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

clear bits with indexes higher or equal to b

Inherited from

Permill.maskn

Defined in

node_modules/@types/bn.js/index.d.ts:474


mod

mod(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

reduct

Inherited from

Permill.mod

Defined in

node_modules/@types/bn.js/index.d.ts:333


modn

modn(b): number

Parameters

Name Type
b number

Returns

number

Deprecated

Description

reduct

Inherited from

Permill.modn

Defined in

node_modules/@types/bn.js/index.d.ts:344


modrn

modrn(b): number

Parameters

Name Type
b number

Returns

number

Description

reduct

Inherited from

Permill.modrn

Defined in

node_modules/@types/bn.js/index.d.ts:349


mul

mul(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

multiply

Inherited from

Permill.mul

Defined in

node_modules/@types/bn.js/index.d.ts:278


muln

muln(b): BN

Parameters

Name Type
b number

Returns

BN

Description

multiply

Inherited from

Permill.muln

Defined in

node_modules/@types/bn.js/index.d.ts:288


neg

neg(): BN

Returns

BN

Description

negate sign

Inherited from

Permill.neg

Defined in

node_modules/@types/bn.js/index.d.ts:218


notn

notn(w): BN

Parameters

Name Type
w number

Returns

BN

Description

not (for the width specified by w)

Inherited from

Permill.notn

Defined in

node_modules/@types/bn.js/index.d.ts:488


or

or(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

or

Inherited from

Permill.or

Defined in

node_modules/@types/bn.js/index.d.ts:359


pow

pow(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

raise a to the power of b

Inherited from

Permill.pow

Defined in

node_modules/@types/bn.js/index.d.ts:308


setn

setn(b, value): BN

Parameters

Name Type
b number
value boolean | 0 | 1

Returns

BN

Description

set specified bit to value

Inherited from

Permill.setn

Defined in

node_modules/@types/bn.js/index.d.ts:424


shln

shln(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift left

Inherited from

Permill.shln

Defined in

node_modules/@types/bn.js/index.d.ts:429


shrn

shrn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift right

Inherited from

Permill.shrn

Defined in

node_modules/@types/bn.js/index.d.ts:449


sqr

sqr(): BN

Returns

BN

Description

square

Inherited from

Permill.sqr

Defined in

node_modules/@types/bn.js/index.d.ts:298


sub

sub(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

subtraction

Inherited from

Permill.sub

Defined in

node_modules/@types/bn.js/index.d.ts:258


subn

subn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

subtraction

Inherited from

Permill.subn

Defined in

node_modules/@types/bn.js/index.d.ts:268


testn

testn(b): boolean

Parameters

Name Type
b number

Returns

boolean

Description

test if specified bit is set

Inherited from

Permill.testn

Defined in

node_modules/@types/bn.js/index.d.ts:469


toArray

toArray(endian?, length?): number[]

Parameters

Name Type
endian? Endianness
length? number

Returns

number[]

Description

convert to byte Array, and optionally zero pad to length, throwing if already exceeding

Inherited from

Permill.toArray

Defined in

node_modules/@types/bn.js/index.d.ts:83


toArrayLike

toArrayLike(ArrayType, endian?, length?): Buffer

Parameters

Name Type
ArrayType BufferConstructor
endian? Endianness
length? number

Returns

Buffer

Description

convert to an instance of type, which must behave like an Array

Inherited from

Permill.toArrayLike

Defined in

node_modules/@types/bn.js/index.d.ts:88

toArrayLike(ArrayType, endian?, length?): any[]

Parameters

Name Type
ArrayType any[]
endian? Endianness
length? number

Returns

any[]

Inherited from

Permill.toArrayLike

Defined in

node_modules/@types/bn.js/index.d.ts:94


toBigInt

toBigInt(): bigint

Returns

bigint

Description

Returns a BigInt representation of the number

Inherited from

Permill.toBigInt

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:47


toBn

toBn(): BN

Returns

BN

Description

Returns the BN representation of the number. (Compatibility)

Inherited from

Permill.toBn

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:51


toBuffer

toBuffer(endian?, length?): Buffer

Parameters

Name Type
endian? Endianness
length? number

Returns

Buffer

Description

convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length)

Inherited from

Permill.toBuffer

Defined in

node_modules/@types/bn.js/index.d.ts:103


toHex

toHex(isLe?): `0x${string}`

Parameters

Name Type
isLe? boolean

Returns

`0x${string}`

Description

Returns a hex string representation of the value

Inherited from

Permill.toHex

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:55


toHuman

toHuman(_isExpanded?): string

Parameters

Name Type
_isExpanded? boolean

Returns

string

Description

Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information

Inherited from

Permill.toHuman

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:59


toJSON

toJSON(onlyHex?): any

Parameters

Name Type
onlyHex? boolean

Returns

any

Description

Converts the Object to JSON, typically used for RPC transfers

Inherited from

Permill.toJSON

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:63


toNumber

toNumber(): number

Returns

number

Description

convert to Javascript Number (limited to 53 bits)

Inherited from

Permill.toNumber

Defined in

node_modules/@types/bn.js/index.d.ts:73


toPrimitive

toPrimitive(): string | number

Returns

string | number

Description

Returns the value in a primitive form, either number when <= 52 bits, or string otherwise

Inherited from

Permill.toPrimitive

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:67


toRawType

toRawType(): string

Returns

string

Description

Returns the base runtime type name for this instance

Inherited from

Permill.toRawType

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:71


toRed

toRed(reductionContext): RedBN

Parameters

Name Type
reductionContext ReductionContext

Returns

RedBN

Description

Convert number to red

Inherited from

Permill.toRed

Defined in

node_modules/@types/bn.js/index.d.ts:513


toString

toString(base?): string

Parameters

Name Type Description
base? number The base to use for the conversion

Returns

string

Description

Returns the string representation of the value

Inherited from

Permill.toString

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:76


toTwos

toTwos(width): BN

Parameters

Name Type
width number

Returns

BN

Description

convert to two’s complement representation, where width is bit width

Inherited from

Permill.toTwos

Defined in

node_modules/@types/bn.js/index.d.ts:208


toU8a

toU8a(_isBare?): Uint8Array

Parameters

Name Type
_isBare? boolean

Returns

Uint8Array

Description

Encodes the value as a Uint8Array as per the SCALE specifications

Inherited from

Permill.toU8a

Defined in

node_modules/@polkadot/types-codec/abstract/Int.d.ts:80


uand

uand(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

and

Inherited from

Permill.uand

Defined in

node_modules/@types/bn.js/index.d.ts:389


ucmp

ucmp(b): -1 | 0 | 1

Parameters

Name Type
b BN

Returns

-1 | 0 | 1

Description

compare numbers and return -1 (a < b), 0 (a == b), or 1 (a > b) depending on the comparison result

Inherited from

Permill.ucmp

Defined in

node_modules/@types/bn.js/index.d.ts:148


umod

umod(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

reduct

Inherited from

Permill.umod

Defined in

node_modules/@types/bn.js/index.d.ts:338


uor

uor(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

or

Inherited from

Permill.uor

Defined in

node_modules/@types/bn.js/index.d.ts:369


ushln

ushln(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift left

Inherited from

Permill.ushln

Defined in

node_modules/@types/bn.js/index.d.ts:439


ushrn

ushrn(b): BN

Parameters

Name Type
b number

Returns

BN

Description

shift right

Inherited from

Permill.ushrn

Defined in

node_modules/@types/bn.js/index.d.ts:459


uxor

uxor(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

xor

Inherited from

Permill.uxor

Defined in

node_modules/@types/bn.js/index.d.ts:414


xor

xor(b): BN

Parameters

Name Type
b BN

Returns

BN

Description

xor

Inherited from

Permill.xor

Defined in

node_modules/@types/bn.js/index.d.ts:404


zeroBits

zeroBits(): number

Returns

number

Description

return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits)

Inherited from

Permill.zeroBits

Defined in

node_modules/@types/bn.js/index.d.ts:113