@zebec-network/exchange-card-sdk
Version:
An sdk for purchasing silver card in zebec
56 lines (55 loc) • 1.71 kB
TypeScript
import { BaseTransaction, Client, SubmittableTransaction, Transaction, TxResponse } from "xrpl";
import { APIConfig } from "../helpers/apiHelpers";
import { Quote } from "../types";
export interface XRPLWallet {
address: string;
signTransaction: (transaction: SubmittableTransaction | BaseTransaction) => Promise<string>;
}
export declare class XRPLService {
readonly wallet: XRPLWallet;
private apiService;
readonly client: Client;
constructor(wallet: XRPLWallet, apiConfig: APIConfig, options?: {
sandbox?: boolean;
});
/**
* Fetches a quote for Bitcoin transfer.
*
* @returns {Promise<Quote>} A promise that resolves to a Quote object.
*/
fetchQuote(symbol?: string): Promise<Quote>;
/**
* Fetches the Bitcoin vault address.
*
* @returns {Promise<{ address: string }>} A promise that resolves to the vault address.
*/
fetchVault(symbol?: string): Promise<{
address: string;
tag?: string;
}>;
transferXRP(params: {
walletAddress?: string;
amount: string;
}): Promise<TxResponse<Transaction>>;
transferTokens(params: {
walletAddress?: string;
amount: string;
token: {
currency: string;
issuer: string;
};
}): Promise<TxResponse<Transaction>>;
createTrustLine(params: {
walletAddress?: string;
amount: string;
token: {
currency: string;
issuer: string;
};
}): Promise<TxResponse<Transaction>>;
getTokenBalances(walletAddress?: string): Promise<{
value: string;
currency: string;
issuer?: string | undefined;
}[]>;
}