UNPKG

@firefly-exchange/library-sui

Version:

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

43 lines (42 loc) 1.99 kB
import { OnChainCalls } from "../v2/OnChainCalls"; import { SuiClient, SuiTransactionBlockResponse } from "../types"; import { Signer } from "@mysten/sui/cryptography"; export declare class Faucet { /** * Requests SUI token from faucet running on Sui Node * @param address address of the account that will get the SUI tokens * @param faucetURL (optional) url of sui faucet, by default reads from deployment config * @returns false if not successful else response from faucet */ static requestSUI(address: string, faucetURL?: string): Promise<false | Response>; /** * Requests SUI coins from faucet account * @param address Account to be funded * @param faucet Account having enough SUI tokens to fund the reciever * @param SuiClient client to execute transaction * @param amount amount to be funded (must be in normal decimals) default is 1 */ static requestSUIFromAccount(address: string, faucet: Signer, suiClient: SuiClient, amount?: number): Promise<SuiTransactionBlockResponse>; /** * Requests USDC tokens from faucet * @param address address of the USDC receiver * @param onChain onChainCalls class instance. The signer must own the treasury cap * @param amount The amount of USDC requested (must be in base form) * @returns {status, error} of transaction */ static requestUSDC(address: string, onChain: OnChainCalls, amount?: number | string): Promise<{ status: any; error: string; }>; /** * Requests margin in margin bank of the provided address * @param address address of the margin receiver * @param onChain onChainCalls class instance. The signer must own the treasury cap * @param amount The amount of margin requested (must be in base form) * @returns */ static requestMargin(address: string, onChain: OnChainCalls, amount?: number | string): Promise<{ status: any; error: string; }>; }