/** * A storable handler for Balances in general. Is used in the `Coin` * module to allow balance operations and can be used to implement * custom coins with `Supply` and `Balance`s. */ import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client'; import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr } from '../../../_framework/reified'; import { FieldsWithTypes } from '../../../_framework/util'; export declare function isSupply(type: string): boolean; export interface SupplyFields { value: ToField<'u64'>; } export type SupplyReified = Reified, SupplyFields>; export type SupplyJSONField = { value: string; }; export type SupplyJSON = { $typeName: typeof Supply.$typeName; $typeArgs: [PhantomToTypeStr]; } & SupplyJSONField; /** * A Supply of T. Used for minting and burning. * Wrapped into a `TreasuryCap` in the `Coin` module. */ export declare class Supply implements StructClass { __StructClass: true; static readonly $typeName: `0x2::balance::Supply`; static readonly $numTypeParams = 1; static readonly $isPhantom: readonly [true]; readonly $typeName: typeof Supply.$typeName; readonly $fullTypeName: `0x2::balance::Supply<${PhantomToTypeStr}>`; readonly $typeArgs: [PhantomToTypeStr]; readonly $isPhantom: typeof Supply.$isPhantom; readonly value: ToField<'u64'>; private constructor(); static reified>(T: T): SupplyReified>; static get r(): typeof Supply.reified; static phantom>(T: T): PhantomReified>>>; static get p(): typeof Supply.phantom; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields>(typeArg: T, fields: Record): Supply>; static fromFieldsWithTypes>(typeArg: T, item: FieldsWithTypes): Supply>; static fromBcs>(typeArg: T, data: Uint8Array): Supply>; toJSONField(): SupplyJSONField; toJSON(): SupplyJSON; static fromJSONField>(typeArg: T, field: any): Supply>; static fromJSON>(typeArg: T, json: Record): Supply>; static fromCoreObject>(typeArg: T, obj: SuiClientTypes.Object<{ content: true; }>): Supply>; static fetch>(client: ClientWithCoreApi, typeArg: T, id: string): Promise>>; } export declare function isBalance(type: string): boolean; export interface BalanceFields { value: ToField<'u64'>; } export type BalanceReified = Reified, BalanceFields>; export type BalanceJSONField = { value: string; }; export type BalanceJSON = { $typeName: typeof Balance.$typeName; $typeArgs: [PhantomToTypeStr]; } & BalanceJSONField; /** * Storable balance - an inner struct of a Coin type. * Can be used to store coins which don't need the key ability. */ export declare class Balance implements StructClass { __StructClass: true; static readonly $typeName: `0x2::balance::Balance`; static readonly $numTypeParams = 1; static readonly $isPhantom: readonly [true]; readonly $typeName: typeof Balance.$typeName; readonly $fullTypeName: `0x2::balance::Balance<${PhantomToTypeStr}>`; readonly $typeArgs: [PhantomToTypeStr]; readonly $isPhantom: typeof Balance.$isPhantom; readonly value: ToField<'u64'>; private constructor(); static reified>(T: T): BalanceReified>; static get r(): typeof Balance.reified; static phantom>(T: T): PhantomReified>>>; static get p(): typeof Balance.phantom; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields>(typeArg: T, fields: Record): Balance>; static fromFieldsWithTypes>(typeArg: T, item: FieldsWithTypes): Balance>; static fromBcs>(typeArg: T, data: Uint8Array): Balance>; toJSONField(): BalanceJSONField; toJSON(): BalanceJSON; static fromJSONField>(typeArg: T, field: any): Balance>; static fromJSON>(typeArg: T, json: Record): Balance>; static fromCoreObject>(typeArg: T, obj: SuiClientTypes.Object<{ content: true; }>): Balance>; static fetch>(client: ClientWithCoreApi, typeArg: T, id: string): Promise>>; }