UNPKG

@arcana/ca-sdk

Version:

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

51 lines (50 loc) 2.79 kB
import Decimal from "decimal.js"; import Long from "long"; import { ChainList } from "../chains"; import { FeeStoreData, OraclePriceResponse, RFF, SponsoredApprovalDataArray, StepInfo } from "../typings"; declare function fetchMyIntents(address: string, grpcURL: string, page?: number): Promise<RFF[]>; declare function fetchProtocolFees(grpcURL: string): Promise<import("@arcana/ca-common").QueryGetProtocolFeesResponse>; declare function fetchSolverData(grpcURL: string): Promise<import("@arcana/ca-common").QueryAllSolverDataResponse>; declare const fetchPriceOracle: (grpcURL: string) => Promise<OraclePriceResponse>; declare const getCoinbasePrices: () => Promise<{}>; 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; } declare const getFeeStore: (grpcURL: string) => Promise<FeeStore>; declare const vscCreateFeeGrant: (vscDomain: string, address: string) => Promise<import("axios").AxiosResponse<any, any>>; declare const vscPublishRFF: (vscDomain: string, id: Long) => Promise<{ id: Long; }>; declare const vscCreateSponsoredApprovals: (vscDomain: string, input: SponsoredApprovalDataArray, msd?: (s: StepInfo, data?: { [k: string]: unknown; }) => void) => Promise<string>; declare const vscCreateRFF: (vscDomain: string, id: Long, msd: (s: StepInfo, data?: { [k: string]: unknown; }) => void, expectedCollectionIndexes: number[]) => Promise<void>; declare const checkIntentFilled: (intentID: Long, grpcURL: string) => Promise<string>; export { checkIntentFilled, fetchBalances, fetchMyIntents, fetchPriceOracle, fetchProtocolFees, fetchSolverData, getCoinbasePrices, getFeeStore, vscCreateFeeGrant, vscCreateRFF, vscCreateSponsoredApprovals, vscPublishRFF, };