hm-aftermath-ts-sdk
Version:
Aftermath TypeScript SDK
62 lines • 2.84 kB
TypeScript
import { AnyObjectType, Balance, CoinDecimal, CoinMetadaWithInfo, CoinPriceInfo, CoinsToBalance, CoinsToDecimals, CoinSymbol, CoinSymbolToCoinTypes, CoinType, KeyType, SuiNetwork } from "../../types";
import { Caller } from "../../general/utils/caller";
import { AftermathApi } from "../../general/providers";
import { CoinMetadata } from "@mysten/sui/client";
export declare class Coin extends Caller {
readonly coinType?: string | undefined;
readonly network?: SuiNetwork | undefined;
private readonly Provider?;
static readonly constants: {
suiCoinType: string;
suiCoinDecimals: number;
coinObjectType: string;
};
readonly coinTypePackageName: string;
readonly coinTypeSymbol: string;
readonly innerCoinType: string;
metadata: CoinMetadaWithInfo | undefined;
priceInfo: CoinPriceInfo | undefined;
constructor(coinType?: string | undefined, network?: SuiNetwork | undefined, Provider?: AftermathApi | undefined);
getCoinsToDecimals(inputs: {
coins: CoinType[];
}): Promise<CoinsToDecimals>;
getCoinMetadata(coin?: CoinType): Promise<CoinMetadaWithInfo>;
getCoinMetadatas(inputs: {
coins: CoinType[];
}): Promise<CoinMetadaWithInfo[]>;
setCoinMetadata(metadata: CoinMetadaWithInfo): void;
getPrice(coin?: CoinType): Promise<CoinPriceInfo>;
setPriceInfo(priceInfo: CoinPriceInfo): void;
getVerifiedCoins(): Promise<string[]>;
static getCoinTypePackageName: (coin: CoinType) => string;
static getCoinTypeSymbol: (coin: CoinType) => string;
static getInnerCoinType: (coin: CoinType) => string;
static coinTypeFromKeyType: (keyType: KeyType) => string;
static isSuiCoin: (coin: CoinType) => boolean;
static isCoinObjectType: (objectType: AnyObjectType) => boolean;
static coinsAndAmountsOverZero: (coinAmounts: Record<CoinType, number>) => {
coins: string[];
amounts: number[];
};
static coinsAndBalancesOverZero: (coinsToBalance: CoinsToBalance) => {
coins: string[];
balances: bigint[];
};
static filterCoinsByType: (inputs: {
filter: string;
coinTypes: CoinType[];
}) => CoinType[];
static filterCoinsByMetadata: (inputs: {
filter: string;
coinMetadatas: Record<CoinType, CoinMetadata>;
}) => CoinType[];
static normalizeBalance: (balance: number, decimals: CoinDecimal) => Balance;
static balanceWithDecimals: (amount: bigint | number, decimals: number) => number;
static balanceWithDecimalsUsd: (amount: bigint | number, decimals: number, price: number) => number;
static coinSymbolForCoinType: (inputs: {
coinType: CoinType;
coinSymbolToCoinTypes: CoinSymbolToCoinTypes;
}) => CoinSymbol | undefined;
private useProvider;
}
//# sourceMappingURL=coin.d.ts.map