import { AwsKmsSigner } from "ethers-aws-kms-signer"; import { address, ADJUST_MARGIN, DAPIKlineResponse, MarketSymbol, SigningMethod } from "@firefly-exchange/library"; import { adjustLeverageRequest, CancelOrderResponse, ExchangeInfo, GenerateReferralCodeRequest, GenerateReferralCodeResponse, GetAccountDataResponse, GetAffiliatePayoutsResponse, GetAffiliateRefereeCountResponse, GetAffiliateRefereeDetailsRequest, GetAffiliateRefereeDetailsResponse, GetCampaignDetailsResponse, GetCampaignRewardsResponse, GetCandleStickRequest, GetCountDownsResponse, GetFundingHistoryRequest, GetFundingRateResponse, GetMakerRewardDetailsRequest, GetMakerRewardDetailsResponse, GetMakerRewardsSummaryResponse, GetMarketRecentTradesRequest, GetMarketRecentTradesResponse, GetOrderbookRequest, GetOrderBookResponse, GetOrderByTypeRequest, GetOrderRequest, GetOrderResponse, GetPositionRequest, GetPositionResponse, GetReferrerInfoResponse, GetTotalHistoricalTradingRewardsResponse, GetTradeAndEarnRewardsDetailRequest, GetTradeAndEarnRewardsDetailResponse, GetTradeAndEarnRewardsOverviewResponse, GetTransactionHistoryRequest, GetTransferHistoryRequest, GetUserFundingHistoryResponse, GetUserRewardsHistoryRequest, GetUserRewardsHistoryResponse, GetUserRewardsSummaryResponse, GetUserTradesHistoryRequest, GetUserTradesHistoryResponse, GetUserTradesRequest, GetUserTradesResponse, GetUserTransactionHistoryResponse, GetUserTransferHistoryResponse, GetUserWhiteListStatusForMarkeMakerResponse, LinkReferredUserRequest, LinkReferredUserResponse, MarketData, MarketMeta, MasterInfo, OpenReferralDetails, OpenReferralOverview, OpenReferralPayoutList, OpenReferralRefereeDetails, OrderCancellationRequest, OrderCancelSignatureRequest, OrderSignatureRequest, OrderSignatureResponse, PlaceOrderRequest, PlaceOrderResponse, PostOrderRequest, PostTimerAttributes, PostTimerResponse, StatusResponse, TickerData, verifyDepositResponse } from "./interfaces/routes"; import { ExtendedNetwork } from "./constants"; import { ResponseSchema } from "./exchange/contractErrorHandling.service"; import { Sockets } from "./exchange/sockets"; import { WebSockets } from "./exchange/WebSocket"; export declare class FireflyClient { protected readonly network: ExtendedNetwork; private web3; private wallet; private orderSigners; private apiService; sockets: Sockets; webSockets: WebSockets | undefined; kmsSigner: AwsKmsSigner | undefined; marketSymbols: string[]; private walletAddress; private signer; private web3Provider; private signingMethod; private contractAddresses; private isTermAccepted; private networkName; private maxBlockGasLimit; private maxSaltLimit; private MarginTokenPrecision; private _usdcToken; private _perpetual; private _marginBank; private _isolatedTrader; /** * initializes the class instance * @param _isTermAccepted boolean indicating if exchange terms and conditions are accepted * @param _network containing network rpc url and chain id * @param _account accepts either privateKey or AWS-KMS-SIGNER object if user intend to sign using kms */ constructor(_isTermAccepted: boolean, _network: ExtendedNetwork, _account?: string | AwsKmsSigner); initializeWithKMS: (awsKmsSigner: AwsKmsSigner) => Promise; /** * initializes web3 with the given provider and creates a signer to sign transactions like placing order * @param _web3Provider provider HttpProvider | IpcProvider | WebsocketProvider | AbstractProvider | string * @param _signingMethod method to sign transactions with, by default its MetaMaskLatest */ initializeWithProvider: (_web3Provider: any, _signingMethod?: SigningMethod) => Promise; /** * initializes web3 and wallet with the given account private key * @param _acctPvtKey private key for the account to be used for placing orders */ initializeWithPrivateKey: (_acctPvtKey: string) => void; /*** * Set UUID to api headers for colocation partners */ setUUID: (uuid: string) => void; /** * initializes contract addresses & onboards user */ init: (userOnboarding?: boolean, apiToken?: string) => Promise; setSubAccount: (publicAddress: address, market: string, status: boolean) => Promise; /** * Allows caller to add a market, internally creates order signer for the provided market * @param symbol Symbol of MARKET in form of DOT-PERP, BTC-PERP etc. * @param isolatedTraderContract (Optional) address of isolatedTrader contract address for market * @returns boolean true if market is added else false */ addMarket: (symbol: MarketSymbol, isolatedTraderContract?: address) => boolean; /** * Removes the provided symbol market order signer and also unsubsribes socket from it * @param market symbol of the market to be removed * @returns boolean true if market is removed false other wise */ removeMarket: (market: MarketSymbol) => boolean; /** * Returns the USDC balance of user in USDC contract * @param contract (optional) address of USDC contract * @returns Number representing balance of user in USDC contract */ getUSDCBalance: (contract?: address) => Promise; /** * Returns the usdc Balance(Free Collateral) of the account in Margin Bank contract * @param contract (optional) address of Margin Bank contract * @returns Number representing balance of user in Margin Bank contract */ getMarginBankBalance: (contract?: address) => Promise; /** * Faucet function, mints 10K USDC to wallet - Only works on Testnet * Assumes that the user wallet has native gas Tokens on Testnet * @param contract (optional) address of USDC contract * @returns Boolean true if user is funded, false otherwise */ mintTestUSDC: (contract?: address) => Promise; /** * Returns Native token balance in user's account * @returns Number representing native token balance in account */ getChainNativeBalance: () => Promise; /** * Transfers usdc to margin bank to be used for placing orders and opening * positions on Firefly Exchange * @param amount the number of usdc to be transferred * @param usdcContract (optional) address of usdc contract * @param mbContract (address) address of Margin Bank contract * @returns ResponseSchema */ depositToMarginBank: (amount: number, usdcContract?: address, mbContract?: address) => Promise; /** * Approves margin to deposit form USDC contract * @param amount the number of usdc to approve * @param usdcContract (optional) address of usdc contract * @param mbContract (address) address of Margin Bank contract * @returns ResponseSchema */ approvalFromUSDC: (amount: number, usdcContract?: address, mbContract?: address) => Promise; /** * Transfers usdc from MarginBank, back to usdc contract * @param amount (optional) if not provided, transfers all available usdc tokens * from Margin Bank to usdc contract * @param mbContract (address) address of Margin Bank contract * @returns boolean true if funds are withdrawn, false otherwise */ withdrawFromMarginBank: (amount?: number, mbContract?: address) => Promise; /** * @notice Withdraw the number of margin tokens equal to the value of the account at the time * perpetual was delisted. A position can only be closed once. * @param symbol market on which to close position * @param perpContract (optional) address of perpetual contract * @returns boolean true if position is closed, false otherwise */ closePosition: (symbol: string, perpContract?: address) => Promise; /** * Gets balance of position open * @param symbol market symbol get information about * @param perpContract (address) address of Perpetual address comes in metaInfo * @returns balance of positions of given symbol */ getAccountPositionBalance: (symbol: MarketSymbol, perpContract?: address) => Promise; /** * Creates order signature and returns it. The signed order can be placed on exchange * @param params OrderSignatureRequest params needed to be signed * @returns OrderSignatureResponse with the payload signed on-chain along with order signature */ createSignedOrder: (params: OrderSignatureRequest) => Promise; /** * Places a signed order on firefly exchange * @param params PlaceOrderRequest containing the signed order created using createSignedOrder * @returns PlaceOrderResponse containing status and data. If status is not 201, order placement failed. */ placeSignedOrder: (params: PlaceOrderRequest) => Promise<{ data: PlaceOrderResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Given an order payload, signs it on chain and submits to exchange for placement * @param params PostOrderRequest * @returns PlaceOrderResponse */ postOrder: (params: PostOrderRequest) => Promise<{ data: PlaceOrderResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Verifies if the order * @param params OrderSignatureResponse * @returns boolean indicating if order signature is valid */ verifyOrderSignature: (params: OrderSignatureResponse) => boolean; /** * Creates signature for cancelling orders * @param params OrderCancelSignatureRequest containing market symbol and order hashes to be cancelled * @returns generated signature string */ createOrderCancellationSignature: (params: OrderCancelSignatureRequest) => Promise; /** * Posts to exchange for cancellation of provided orders with signature * @param params OrderCancellationRequest containing order hashes to be cancelled and cancellation signature * @returns response from exchange server */ placeCancelOrder: (params: OrderCancellationRequest) => Promise<{ data: CancelOrderResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Creates signature and posts order for cancellation on exchange of provided orders * @param params OrderCancelSignatureRequest containing order hashes to be cancelled * @returns response from exchange server */ postCancelOrder: (params: OrderCancelSignatureRequest) => Promise<{ data: CancelOrderResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Cancels all open orders for a given market * @param symbol DOT-PERP, market symbol * @returns cancellation response */ cancelAllOpenOrders: (symbol: MarketSymbol, parentAddress?: string) => Promise<{ data: CancelOrderResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Updates user's leverage to given leverage * @param adjustLeverageRequest * @returns ResponseSchema */ adjustLeverage: (params: adjustLeverageRequest) => Promise; /** * Gets Users default leverage. * @param symbol market symbol get information about * @returns user default leverage */ getUserDefaultLeverage: (symbol: MarketSymbol, parentAddress?: string) => Promise; /** * Add or remove margin from the open position * @param symbol market symbol of the open position * @param operationType operation you want to perform `Add` | `Remove` margin * @param amount (number) amount user wants to add or remove from the position * @param perpetualAddress (address) address of Perpetual contract * @returns ResponseSchema */ adjustMargin: (symbol: MarketSymbol, operationType: ADJUST_MARGIN, amount: number, perpetualAddress?: string) => Promise; /** * Generate and receive readOnlyToken, this can only be accessed at the time of generation * @returns readOnlyToken string */ generateReadOnlyToken: () => Promise<{ data: string | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets Orders placed by the user. Returns the first 50 orders by default. * @param params of type OrderRequest, * @returns OrderResponse array */ getUserOrders: (params: GetOrderRequest) => Promise<{ data: GetOrderResponse[] | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets Orders by type and statuses. Returns the first 50 orders by default. * @param params of type OrderByTypeRequest, * @returns OrderResponse array */ getUserOrdersByType: (params: GetOrderByTypeRequest) => Promise<{ data: GetOrderResponse[] | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user open position. If the market is not specified then will return first 50 open positions for 50 markets. * @param params GetPositionRequest * @returns GetPositionResponse */ getUserPosition: (params: GetPositionRequest) => Promise<{ data: GetPositionResponse[] | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets state of orderbook for provided market. At max top 50 bids/asks are retrievable * @param params GetOrdebookRequest * @returns GetOrderbookResponse */ getOrderbook: (params: GetOrderbookRequest) => Promise<{ data: GetOrderBookResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user trades * @param params PlaceOrderResponse * @returns GetUserTradesResponse */ getUserTrades: (params: GetUserTradesRequest) => Promise<{ data: GetUserTradesResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user trades * @param params PlaceOrderResponse * @returns GetUserTradesHistoryResponse */ getUserTradesHistory: (params: GetUserTradesHistoryRequest) => Promise<{ data: GetUserTradesHistoryResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user Account Data * @returns GetAccountDataResponse */ getUserAccountData: (parentAddress?: string) => Promise<{ data: GetAccountDataResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets verification status of user account * @param amount deposit amount * @returns verification status of user */ verifyDeposit: (amount: number) => Promise<{ data: verifyDepositResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user transaction history * @param params GetTransactionHistoryRequest * @returns GetUserTransactionHistoryResponse */ getUserTransactionHistory: (params: GetTransactionHistoryRequest) => Promise<{ data: GetUserTransactionHistoryResponse[] | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user funding history * @param params GetFundingHistoryRequest * @returns GetUserTransactionHistoryResponse */ getUserFundingHistory: (params: GetFundingHistoryRequest) => Promise<{ data: GetUserFundingHistoryResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user transfer history * @param params GetTransferHistoryRequest * @returns GetUserTransferHistoryResponse */ getUserTransferHistory: (params: GetTransferHistoryRequest) => Promise<{ data: GetUserTransferHistoryResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets market funding rate * @param symbol market symbol to fetch funding rate of * @returns GetFundingRateResponse */ getMarketFundingRate: (symbol: MarketSymbol) => Promise<{ data: GetFundingRateResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets market recent trades * @param params GetMarketRecentTradesRequest * @returns GetMarketRecentTradesResponse */ getMarketRecentTrades: (params: GetMarketRecentTradesRequest) => Promise<{ data: GetMarketRecentTradesResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets market candle stick data * @param params GetMarketRecentTradesRequest * @returns DAPIKlineResponse */ getMarketCandleStickData: (params: GetCandleStickRequest) => Promise<{ data: DAPIKlineResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets publically available market info about market(s) * @param symbol (optional) market symbol get information about, by default fetches info on all available markets * @returns ExchangeInfo or ExchangeInfo[] in case no market was provided as input */ getExchangeInfo: (symbol?: MarketSymbol) => Promise<{ data: ExchangeInfo | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets MarketData data for market(s) * @param symbol (optional) market symbol get information about, by default fetches info on all available markets * @returns MarketData or MarketData[] in case no market was provided as input */ getMarketData: (symbol?: MarketSymbol) => Promise<{ data: MarketData | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets Meta data of the market(s) * @param symbol (optional) market symbol get information about, by default fetches info on all available markets * @returns MarketMeta or MarketMeta[] in case no market was provided as input */ getMarketMetaInfo: (symbol?: MarketSymbol) => Promise<{ data: MarketMeta | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets Master Info of the market(s) * @param symbol (optional) market symbol get information about, by default fetches info on all available markets * @returns MasterInfo */ getMasterInfo: (symbol?: MarketSymbol) => Promise<{ data: MasterInfo | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets the list of market symbols available on exchange * @returns array of strings representing MARKET SYMBOLS */ getMarketSymbols: () => Promise<{ data: string[] | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets contract addresses of market * @param symbol (optional) market symbol get information about, by default fetches info on all available markets * @returns deployed contract addresses */ getContractAddresses: (symbol?: MarketSymbol) => Promise<{ data: Record | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets status of the exchange * @returns StatusResponse */ getExchangeStatus: () => Promise<{ data: StatusResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets ticker data of any market * @param symbol market symbol to get information about, if not provided fetches data of all markets * @returns TickerData */ getTickerData: (symbol?: MarketSymbol) => Promise<{ data: TickerData | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Returns the public address of account connected with the client * @returns string | address */ getPublicAddress: () => string; /** * Creates message to be signed, creates signature and authorize it from dapi * @returns auth token */ userOnBoarding: (token?: string) => Promise; /** * Reset timer for cancel on disconnect for open orders * @param params PostTimerAttributes containing the countdowns of all markets * @returns PostTimerResponse containing accepted and failed countdowns. If status is not 201, request wasn't successful. */ resetCancelOnDisconnectTimer: (params: PostTimerAttributes) => Promise<{ data: PostTimerResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user Cancel on Disconnect timer * @returns GetCountDownsResponse */ getCancelOnDisconnectTimer: (symbol?: string, parentAddress?: string) => Promise<{ data: GetCountDownsResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Generates referral code * @param params GenerateReferralCodeRequest * @returns GenerateReferralCodeResponse */ generateReferralCode: (params: GenerateReferralCodeRequest) => Promise<{ data: GenerateReferralCodeResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Links referred user * @param params LinkReferredUserRequest * @returns LinkReferredUserResponse */ affiliateLinkReferredUser: (params: LinkReferredUserRequest) => Promise<{ data: LinkReferredUserResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets referrer Info * @param parentAddress * @returns GetReferrerInfoResponse */ getReferrerInfo: (parentAddress?: string) => Promise<{ data: GetReferrerInfoResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets campaign details * @returns Array of GetCampaignDetailsResponse */ getCampaignDetails: () => Promise<{ data: GetCampaignDetailsResponse[] | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets campaign reward details * @param campaignId * @param parentAddress * @returns GetCampaignRewardsResponse */ getCampaignRewards: (campaignId: number, parentAddress?: string) => Promise<{ data: GetCampaignRewardsResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * get open referral referee details * @param payload * @returns OpenReferralRefereeDetails */ getOpenReferralRefereeDetails: (payload: { cursor: string; pageSize: number; parentAddress?: string; }) => Promise<{ data: { data: OpenReferralRefereeDetails; nextCursor: string; isMoreDataAvailable: boolean; parentAddress?: string | undefined; } | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * get open referral payouts * @param payload * @returns OpenReferralDetails */ getOpenReferralDetails: (payload: { campaignId: number; parentAddress?: string; }) => Promise<{ data: OpenReferralDetails | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * get open referral payouts * @param payload * @returns OpenReferralPayoutList */ getOpenReferralPayouts: (payload: { cursor: string; pageSize: number; parentAddress?: string; }) => Promise<{ data: { data: OpenReferralPayoutList; nextCursor: string; isMoreDataAvailable: boolean; } | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * generate open referral code * @param campaignId * @param parentAddress * @returns OpenReferralOverview */ generateOpenReferralReferralCode: (payload: { campaignId: string; }) => Promise<{ data: { referralAddress: string; referralCode: string; message: string; } | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * get open referral overview * @returns OpenReferralOverview */ getOpenReferralOverview: (parentAddress?: string) => Promise<{ data: OpenReferralOverview | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Link open referral * @param referralCode * @returns boolean */ openReferralLinkReferredUser: (payload: { referralCode: string; }) => Promise<{ data: unknown; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets affiliate payout details * @param campaignId * @param parentAddress * @returns Array of GetAffiliatePayoutsResponse */ getAffiliatePayouts: (campaignId: number, parentAddress?: string) => Promise<{ data: GetAffiliatePayoutsResponse[] | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets affiliate referree details * @param GetAffiliateRefereeDetailsRequest * @returns GetAffiliateRefereeDetailsResponse */ getAffiliateRefereeDetails: (params: GetAffiliateRefereeDetailsRequest) => Promise<{ data: GetAffiliateRefereeDetailsResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets affiliate referree count * @param campaignId * @param parentAddress * @returns GetAffiliateRefereeCountResponse */ getAffiliateRefereeCount: (campaignId: number, parentAddress?: string) => Promise<{ data: GetAffiliateRefereeCountResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user rewards history * @param optional params GetUserRewardsHistoryRequest * @returns GetUserRewardsHistoryResponse */ getUserRewardsHistory: (params?: GetUserRewardsHistoryRequest) => Promise<{ data: GetUserRewardsHistoryResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets user rewards summary * @returns GetUserRewardsSummaryResponse */ getUserRewardsSummary: (parentAddress?: string) => Promise<{ data: GetUserRewardsSummaryResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets rewards overview * @param campaignId * @param parentAddress * @returns GetTradeAndEarnRewardsOverviewResponse */ getTradeAndEarnRewardsOverview: (campaignId: number, parentAddress?: string) => Promise<{ data: GetTradeAndEarnRewardsOverviewResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets rewards details * @param GetTradeAndEarnRewardsDetailRequest * @returns GetTradeAndEarnRewardsDetailResponse */ getTradeAndEarnRewardsDetail: (params: GetTradeAndEarnRewardsDetailRequest) => Promise<{ data: GetTradeAndEarnRewardsDetailResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets total historical trading reward details * @returns GetTotalHistoricalTradingRewardsResponse */ getTotalHistoricalTradingRewards: (parentAddress?: string) => Promise<{ data: GetTotalHistoricalTradingRewardsResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets maker rewards summary * @returns GetMakerRewardsSummaryResponse */ getMakerRewardsSummary: (parentAddress?: string) => Promise<{ data: GetMakerRewardsSummaryResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets maker reward details * @param GetMakerRewardDetailsRequest * @returns GetMakerRewardDetailsResponse */ getMakerRewardDetails: (params: GetMakerRewardDetailsRequest) => Promise<{ data: GetMakerRewardDetailsResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Gets market maker whitelist status * @returns GetUserWhiteListStatusForMarkeMaker */ getUserWhiteListStatusForMarketMaker: () => Promise<{ data: GetUserWhiteListStatusForMarkeMakerResponse | undefined; ok: boolean; status: number; response: { data: any; message: any; errorCode: any; }; }>; /** * Checks if Firefly client was initialized with Private Key or Web3Provider and returns respective signer * @returns Wallet if initialized with private key else signer object */ private getWallet; /** * Checks if Firefly client was initialized with Private Key or Web3Provider and returns respective signing method * @returns Signing Method */ private getSigningMethod; /** * Private function to get the contract address of given contract name mapped with respective factory * @param contractName name of the contract eg: `Perpetual`, `USDC` etc * @param contract address of contract * @param market name of the specific market to get address for * @returns Contract | MarginBank | IsolatedTrader or throws error */ private getContract; /** * Gets the contract address of provided name * @param contractName name of the contract eg: `Perpetual`, `USDC` etc * @param contract address of contract * @param market name of the specific market to get address for * @returns contract address of given name */ private getContractAddressByName; /** * Private function to create order payload that is to be signed on-chain * @param params OrderSignatureRequest * @returns Order */ private createOrderToSign; /** * Posts signed Auth Hash to dAPI and gets token in return if signature is valid * @returns GetAuthHashResponse which contains auth hash to be signed */ private authorizeSignedHash; /** * Posts signed Auth Hash to dAPI and gets token in return if signature is valid * @returns GetAuthHashResponse which contains auth hash to be signed */ private updateLeverage; }