UNPKG

@firefly-exchange/library-sui

Version:

Sui library housing helper methods, classes to interact with Bluefin protocol(s) deployed on Sui

553 lines (552 loc) 13.5 kB
import { BcsType, bcs } from "@mysten/sui/bcs"; import { Serialized } from "../../types"; export { bcs }; export declare const Deposit: BcsType<{ eds_id: string; asset: string; from: string; to: string; amount: string; nonce: string; tainted: boolean; }, { eds_id: any; asset: string; from: any; to: any; amount: string | number | bigint; nonce: string | number | bigint; tainted: boolean; }>; export declare const AssetSupported: BcsType<{ symbol: string; type: string; decimals: number; weight: string; price: string; collateral: boolean; min_deposit: string; max_deposit: string; }, { symbol: string; type: string; decimals: number; weight: string | number | bigint; price: string | number | bigint; collateral: boolean; min_deposit: string | number | bigint; max_deposit: string | number | bigint; }>; export declare const SignedNumber: BcsType<{ value: string; sign: boolean; }, { value: string | number | bigint; sign: boolean; }>; export declare const FundingRate: BcsType<{ timestamp: string; rate: { value: string; sign: boolean; }; }, { timestamp: string | number | bigint; rate: { value: string | number | bigint; sign: boolean; }; }>; export declare const PerpetualUpdate: BcsType<{ id: string; symbol: string; imr: string; mmr: string; stepSize: string; tickSize: string; minTradeQty: string; maxTradeQty: string; minTradePrice: string; maxTradePrice: string; maxNotionalAtOpen: string[]; mtbLong: string; mtbShort: string; makerFee: string; takerFee: string; maxFundingRate: string; insurancePoolRatio: string; insurancePool: string; feePool: string; tradingStatus: boolean; tradingStartTime: string; delist: boolean; delistingPrice: string; isolatedOnly: boolean; baseAssetSymbol: string; baseAssetName: string; baseAssetDecimals: string; maxLimitOrderQuantity: string; maxMarketOrderQuantity: string; defaultLeverage: string; oraclePrice: string; funding: { timestamp: string; rate: { value: string; sign: boolean; }; }; }, { id: any; symbol: string; imr: string | number | bigint; mmr: string | number | bigint; stepSize: string | number | bigint; tickSize: string | number | bigint; minTradeQty: string | number | bigint; maxTradeQty: string | number | bigint; minTradePrice: string | number | bigint; maxTradePrice: string | number | bigint; maxNotionalAtOpen: Iterable<string | number | bigint> & { length: number; }; mtbLong: string | number | bigint; mtbShort: string | number | bigint; makerFee: string | number | bigint; takerFee: string | number | bigint; maxFundingRate: string | number | bigint; insurancePoolRatio: string | number | bigint; insurancePool: any; feePool: any; tradingStatus: boolean; tradingStartTime: string | number | bigint; delist: boolean; delistingPrice: string | number | bigint; isolatedOnly: boolean; baseAssetSymbol: string; baseAssetName: string; baseAssetDecimals: string | number | bigint; maxLimitOrderQuantity: string | number | bigint; maxMarketOrderQuantity: string | number | bigint; defaultLeverage: string | number | bigint; oraclePrice: string | number | bigint; funding: { timestamp: string | number | bigint; rate: { value: string | number | bigint; sign: boolean; }; }; }>; export declare const Signature: BcsType<{ sig: number[]; pk: number[]; type: number; }, { sig: Iterable<number> & { length: number; }; pk: Iterable<number> & { length: number; }; type: number; }>; export declare const Withdrawal: BcsType<{ eds: string; assetSymbol: string; account: string; amount: string; salt: string; signedAt: string; }, { eds: any; assetSymbol: string; account: any; amount: string | number | bigint; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const AuthorizeUser: BcsType<{ ids: string; account: string; user: string; status: boolean; salt: string; signedAt: string; }, { ids: any; account: any; user: any; status: boolean; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const authorizeLiquidator: BcsType<{ type: string; ids: string; account: string; authorized: boolean; salt: string; signedAt: string; }, { type: string; ids: any; account: any; authorized: boolean; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const Order: BcsType<{ ids: string; account: string; market: string; price: string; quantity: string; leverage: string; side: string; positionType: string; expiration: string; salt: string; signedAt: string; }, { ids: any; account: any; market: string; price: string | number | bigint; quantity: string | number | bigint; leverage: string | number | bigint; side: string; positionType: string; expiration: string | number | bigint; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const TradeData: BcsType<{ makerSignature: number[]; takerSignature: number[]; quantity: string; timestamp: string; }, { makerSignature: Iterable<number> & { length: number; }; takerSignature: Iterable<number> & { length: number; }; quantity: string | number | bigint; timestamp: string | number | bigint; }>; export declare const Liquidate: BcsType<{ type: string; ids: string; liquidatee: string; liquidator: string; market: string; quantity: string; isolated: boolean; assumeAsCross: boolean; allOrNothing: boolean; leverage: string; expiry: string; salt: string; signedAt: string; }, { type: string; ids: any; liquidatee: any; liquidator: any; market: string; quantity: string | number | bigint; isolated: boolean; assumeAsCross: boolean; allOrNothing: boolean; leverage: string | number | bigint; expiry: string | number | bigint; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const Deleverage: BcsType<{ type: string; ids: string; maker: string; taker: string; makerIsolated: boolean; takerIsolated: boolean; market: string; quantity: string; expiry: string; salt: string; signedAt: string; }, { type: string; ids: any; maker: any; taker: any; makerIsolated: boolean; takerIsolated: boolean; market: string; quantity: string | number | bigint; expiry: string | number | bigint; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const AdjustMargin: BcsType<{ ids: string; account: string; market: string; add: boolean; amount: string; salt: string; signedAt: string; }, { ids: any; account: any; market: string; add: boolean; amount: string | number | bigint; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const AdjustLeverage: BcsType<{ ids: string; account: string; market: string; leverage: string; salt: string; signedAt: string; }, { ids: any; account: any; market: string; leverage: string | number | bigint; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const SyncOperator: BcsType<{ operatorType: string; previousOperator: string; newOperator: string; }, { operatorType: string; previousOperator: any; newOperator: any; }>; export declare const SetFundingRate: BcsType<{ type: string; ids: string; timestamp: string; marketFundingRates: number[][]; salt: string; signedAt: string; }, { type: string; ids: any; timestamp: string | number | bigint; marketFundingRates: Iterable<Iterable<number> & { length: number; }> & { length: number; }; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const MarketFundingRate: BcsType<{ market: string; value: string; sign: boolean; oraclePrice: string; }, { market: string; value: string | number | bigint; sign: boolean; oraclePrice: string | number | bigint; }>; export declare const ApplyFundingRate: BcsType<{ ids: string; timestamp: string; accounts: string[]; salt: string; signedAt: string; market: string; }, { ids: any; timestamp: string | number | bigint; accounts: Iterable<any> & { length: number; }; salt: string | number | bigint; signedAt: string | number | bigint; market: string; }>; export declare const PruneTable: BcsType<{ type: string; ids: string; hashes: number[][]; table_index: number; salt: string; signedAt: string; }, { type: string; ids: any; hashes: Iterable<Iterable<number> & { length: number; }> & { length: number; }; table_index: number; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const FeeTier: BcsType<{ type: string; ids: string; account: string; makerFee: string; takerFee: string; applied: boolean; salt: string; signedAt: string; }, { type: string; ids: any; account: any; makerFee: string | number | bigint; takerFee: string | number | bigint; applied: boolean; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const AccountType: BcsType<{ type: string; ids: string; account: string; isInstitution: boolean; salt: string; signedAt: string; }, { type: string; ids: any; account: any; isInstitution: boolean; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const GasFee: BcsType<{ type: string; ids: string; amount: string; salt: string; signedAt: string; }, { type: string; ids: any; amount: string | number | bigint; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const GasPool: BcsType<{ type: string; ids: string; pool: string; salt: string; signedAt: string; }, { type: string; ids: any; pool: any; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const ClosePosition: BcsType<{ ids: string; account: string; market: string; isolated: boolean; salt: string; signedAt: string; }, { ids: any; account: any; market: string; isolated: boolean; salt: string | number | bigint; signedAt: string | number | bigint; }>; export declare const BatchTrades: BcsType<{ makerOrders: number[][]; makerSignatures: number[][]; takerOrders: number[][]; takerSignatures: number[][]; fills: string[]; }, { makerOrders: Iterable<Iterable<number> & { length: number; }> & { length: number; }; makerSignatures: Iterable<Iterable<number> & { length: number; }> & { length: number; }; takerOrders: Iterable<Iterable<number> & { length: number; }> & { length: number; }; takerSignatures: Iterable<Iterable<number> & { length: number; }> & { length: number; }; fills: Iterable<string | number | bigint> & { length: number; }; }>; export declare const OverwriteUserPosition: BcsType<{ ids: string; account: string; perpetual: string; size: string; average_entry_price: string; leverage: string; margin: string; is_long: boolean; is_isolated: boolean; pending_funding_payment: string; last_funding_timestamp: string; last_funding_rate_value: string; last_funding_rate_sign: boolean; timestamp: string; }, { ids: any; account: any; perpetual: string; size: string | number | bigint; average_entry_price: string | number | bigint; leverage: string | number | bigint; margin: string | number | bigint; is_long: boolean; is_isolated: boolean; pending_funding_payment: string | number | bigint; last_funding_timestamp: string | number | bigint; last_funding_rate_value: string | number | bigint; last_funding_rate_sign: boolean; timestamp: string | number | bigint; }>; export declare const OverwriteUserAssets: BcsType<{ ids: string; account: string; amount: string; timestamp: string; }, { ids: any; account: any; amount: string | number | bigint; timestamp: string | number | bigint; }>; export declare class BCSUtils { static getSerializedDataBytes<T>(data: T, dataType: BcsType<T>): any; static getSerializedDataHex<T>(data: T, dataType: BcsType<T>): string; static deserializeData<T>(data: Serialized, dataType: BcsType<T>): T; }