@firefly-exchange/library-sui
Version:
Sui library housing helper methods, classes to interact with Bluefin protocol(s) deployed on Sui
69 lines (68 loc) • 3.69 kB
TypeScript
import { IPerpetualConfig } from "../interfaces";
import { IBluefinV3OptionalParams } from "../interfaces/IOnChainCalls";
import { OnChainCalls } from "./on-chain-calls";
import { OnChainCallResponse, SuiAddress } from "../../types";
import { Address, NumStr } from "../../types";
import { OPERATORS, PERPETUAl_CONFIG_FIELDS } from "../enums";
import { MarketName, PerpetualConfigValue } from "../types";
export declare class AdminCalls extends OnChainCalls {
/**
* Create and executes support asset transaction. Allows admin to add a new supportable asset on
* the protocol
* @param supportedCoin supported coin address. should be of format 0xax....bs::coin::COIN
* @param supportedCoinSymbol Name of the supported coin
* @param coinDecimals The number of decimals in supported coin
* @param weight The discounted price percentage to be used for asset
* @param price The initial/starting price of the asset
* @param collateral True if the asset can be used to collateralize a position
* @param minDeposit The minimum amount of acceptable deposit
* @param maxDeposit The maximum amount of acceptable deposit
* @param options Optional tx execution params
* @returns OnChainCallResponse
*/
supportAsset(supportedCoin: Address, supportedCoinSymbol: string, supportedCoinDecimals: NumStr, weight: NumStr, price: NumStr, collateral: boolean, minDeposit: NumStr, maxDeposit: NumStr, options?: IBluefinV3OptionalParams): Promise<OnChainCallResponse>;
/**
* Create and executes data store creation transaction
* @param sequencer address of the sequencer that will own the data store
* @param options Optional tx execution params
* @returns OnChainCallResponse
*/
createInternalDataStore(sequencer?: string, options?: IBluefinV3OptionalParams): Promise<OnChainCallResponse>;
/**
* Allows the holder of the Treasury cap to mint test usdc coins (Will only work on Dev/Test net)
* @param args optional {amountE6: defaults to 10K, should be in 6 decimal places, to: defaults to the signer}
* @param options Optional tx execution params
* @returns OnChainCallResponse
*/
mintUSDC(args?: {
amountE6?: NumStr;
to?: string;
}, options?: IBluefinV3OptionalParams): Promise<OnChainCallResponse>;
/**
* Create and executes perpetual creation transaction
* @param perpetualConfig perpetual configs
* @param options Optional tx execution params
* @returns OnChainCallResponse and IPerpetualConfig
*/
createPerpetual(perpetualConfig: IPerpetualConfig, options?: IBluefinV3OptionalParams): Promise<{
txResponse: OnChainCallResponse;
perpetualConfig: IPerpetualConfig;
}>;
/**
* Create and executes transaction to update perpetual config
* @param perpetual the symbol of the perpetual/market to be updated
* @param field the name of the field/config being updated
* @param value the new value
* @param options Optional tx execution params
* @returns OnChainCallResponse
*/
updatePerpetual(perpetual: MarketName, field: PERPETUAl_CONFIG_FIELDS, value: PerpetualConfigValue, options?: IBluefinV3OptionalParams): Promise<OnChainCallResponse>;
/**
* Create and executes transaction to set an operator on EDS
* @param type The type of the operator be updated
* @param newOperator The address of the new operator to be set
* @param options Optional tx execution params
* @returns OnChainCallResponse
*/
setOperatorEDS(type: OPERATORS, newOperator: SuiAddress, options?: IBluefinV3OptionalParams): Promise<OnChainCallResponse>;
}