UNPKG

@arcana/ca-sdk

Version:

Arcana Network's chain abstraction SDK for unified balance in Web3 apps

50 lines (49 loc) 2.64 kB
import Decimal from "decimal.js"; import Long from "long"; import { ChainList } from "../chains"; import { FeeStoreData, OraclePriceResponse, RFF, SponsoredApprovalDataArray, StepInfo } from "../typings"; export declare function fetchMyIntents(address: string, grpcURL: string, page?: number): Promise<RFF[]>; export declare function fetchProtocolFees(grpcURL: string): Promise<import("@arcana/ca-common").QueryGetProtocolFeesResponse>; export declare function fetchSolverData(grpcURL: string): Promise<import("@arcana/ca-common").QueryAllSolverDataResponse>; export declare const fetchPriceOracle: (grpcURL: string) => Promise<OraclePriceResponse>; export declare const getCoinbasePrices: () => Promise<{}>; export declare const fetchBalances: (vscDomain: string, evmAddress: `0x${string}`, chainList: ChainList, fuelAddress?: null | string) => Promise<{ rates: {}; assets: import("../typings").UserAssets; balanceInFiat: number; }>; export declare class FeeStore { readonly data: FeeStoreData; constructor(data: FeeStoreData); calculateCollectionFee({ decimals, sourceChainID, sourceTokenAddress, }: { decimals: number; sourceChainID: number; sourceTokenAddress: `0x${string}`; }): Decimal; calculateFulfilmentFee({ decimals, destinationChainID, destinationTokenAddress, }: { decimals: number; destinationChainID: number; destinationTokenAddress: `0x${string}`; }): Decimal; calculateProtocolFee(borrow: Decimal): Decimal; calculateSolverFee({ borrowAmount, decimals, destinationChainID, destinationTokenAddress, sourceChainID, sourceTokenAddress, }: { borrowAmount: Decimal; decimals: number; destinationChainID: number; destinationTokenAddress: `0x${string}`; sourceChainID: number; sourceTokenAddress: `0x${string}`; }): Decimal; } export declare const getFeeStore: (grpcURL: string) => Promise<FeeStore>; export declare const vscCreateFeeGrant: (vscDomain: string, address: string) => Promise<import("axios").AxiosResponse<any, any>>; export declare const vscPublishRFF: (vscDomain: string, id: Long) => Promise<{ id: Long; }>; export declare const vscCreateSponsoredApprovals: (vscDomain: string, input: SponsoredApprovalDataArray, msd?: (s: StepInfo, data?: { [k: string]: unknown; }) => void) => Promise<string>; export declare const vscCreateRFF: (vscDomain: string, id: Long, msd: (s: StepInfo, data?: { [k: string]: unknown; }) => void, totalCollections: number) => Promise<void>; export declare const checkIntentFilled: (intentID: Long, grpcURL: string) => Promise<string>;