satsterminal-sdk
Version:
A TypeScript SDK for interacting with the SatsTerminal ecosystem.
160 lines (159 loc) • 3.49 kB
TypeScript
export interface SatsTerminalConfig {
apiKey: string;
baseUrl?: string;
}
export interface RequiredConfig {
apiKey: string;
}
export interface UTXO {
txid: string;
vout: number;
value: number;
status: {
confirmed: boolean;
};
}
export interface RuneOrder {
market: string;
id: string;
price: number;
fromTokenAmount?: string;
slippage?: number;
formattedAmount: number;
}
export interface OrderMetrics {
averagePrice: number;
totalQuantity: number;
totalValue: number;
}
export interface OrderSummary {
marketplace: string;
selectedOrders: RuneOrder[];
totalFormattedAmount: string;
totalPrice: number;
metrics: OrderMetrics;
}
export interface SignedPSBT {
swapId?: string;
psbtHex?: string;
psbtBase64?: string;
}
export interface SearchParams {
rune_name: string;
sell?: boolean;
}
export interface SearchResponse {
runes: [];
}
export interface PopularCollectionsParams {
}
export interface PopularCollectionsResponse {
collections: [];
}
export interface QuoteParams {
btcAmount: string;
runeName: string;
address: string;
themeID?: string;
sell?: boolean;
marketplaces?: string[];
rbfProtection?: boolean;
fill?: boolean;
}
export interface QuoteResponse {
bestMarketplace: string;
selectedOrders: RuneOrder[];
totalFormattedAmount: string;
totalPrice: string;
metrics: Record<string, any>;
marketplaces: Record<string, any>;
error?: string;
}
export interface GetPSBTParams {
orders: RuneOrder[];
address: string;
publicKey: string;
paymentAddress: string;
paymentPublicKey: string;
utxos?: UTXO[];
feeRate?: number;
runeName: string;
slippage?: number;
themeID?: string;
sell?: boolean;
rbfProtection?: boolean;
}
export interface PSBTResponse {
swapId: string;
marketplace: string;
psbtBase64: string;
psbtHex: string;
inputs: number[];
rbfProtected: {
base64: string;
hex: string;
inputs: number[];
};
error?: string;
}
export interface ConfirmPSBTParams {
orders: RuneOrder[];
address: string;
publicKey: string;
paymentAddress: string;
paymentPublicKey: string;
signedPsbtBase64: string;
swapId: string;
themeID?: string;
sell?: boolean;
runeName?: string;
marketplaces?: string[];
rbfProtection?: boolean;
signedRbfPsbtBase64?: string;
}
export interface ConfirmPSBTResponse {
marketplace: string;
txid: string;
rbfProtection: {
fundsPreparationTxId: string;
fulfillmentId: string;
};
isRbfTxid: boolean;
error?: string;
}
export interface SignInParams {
ord_address: string;
btc_address: string;
ord_public_key: string;
btc_public_key: string;
provider: string;
}
export interface SignInResponse {
id: number;
btc_address: string;
btc_public_key: string;
ord_address: string;
ord_public_key: string;
provider: string;
referral_code: string | null;
invitation_code: string | null;
total_points: number;
bind: {
binded: boolean;
};
}
export interface BindParams {
btcAddress: string;
nftAddress: string;
sign: string;
}
export interface BindResponse {
code: number;
msg: string;
}
export interface PointsParams {
ord_address: string;
}
export interface PointsResponse {
total_points: number;
}