PositiveCoin.ts
PositiveCoin overview
Table of contents
arbitrary
arbitrary
FastCheck arbitrary for generating random PositiveCoin values.
Signature
export declare const arbitrary: FastCheck.Arbitrary<bigint>Added in v2.0.0
constants
MAX_POSITIVE_COIN_VALUE
Maximum value for a positive coin amount (maxWord64).
Signature
export declare const MAX_POSITIVE_COIN_VALUE: 18446744073709551615nAdded in v2.0.0
MIN_POSITIVE_COIN_VALUE
Minimum value for a positive coin amount.
Signature
export declare const MIN_POSITIVE_COIN_VALUE: 1nAdded in v2.0.0
model
PositiveCoin (type alias)
Type alias for PositiveCoin representing positive amounts of native assets. Used in multiasset maps where zero amounts are not allowed.
Signature
export type PositiveCoin = typeof PositiveCoinSchema.TypeAdded in v2.0.0
ordering
compare
Compare two positive coin amounts.
Signature
export declare const compare: (a: PositiveCoin, b: PositiveCoin) => -1 | 0 | 1Added in v2.0.0
predicates
is
Check if a value is a valid PositiveCoin.
Signature
export declare const is: (u: unknown, overrideOptions?: ParseOptions | number) => u is bigintAdded in v2.0.0
schemas
PositiveCoinSchema
Schema for validating positive coin amounts. positive_coin = 1 .. maxWord64
Signature
export declare const PositiveCoinSchema: Schema.refine<bigint, typeof Schema.BigInt>Added in v2.0.0
transformation
add
Add two positive coin amounts safely.
Signature
export declare const add: (a: PositiveCoin, b: PositiveCoin) => PositiveCoinAdded in v2.0.0
subtract
Subtract two positive coin amounts safely. Note: Result must still be positive.
Signature
export declare const subtract: (a: PositiveCoin, b: PositiveCoin) => PositiveCoinAdded in v2.0.0