mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-31 03:44:21 +01:00
Add FiatAPI methods to Liquid SDK (#331)
* Add FiatAPI methods to Liquid SDK * Add mirrored structs of fiat crate on Dart bindings * Re-generate bindings * Fix sdk-common imports * Avoid using hardcoded Breez Server URL, re-use sdk-common constant * Update Cargo.lock --------- Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
This commit is contained in:
@@ -51,6 +51,21 @@ export interface ConnectRequest {
|
||||
mnemonic: string
|
||||
}
|
||||
|
||||
export interface CurrencyInfo {
|
||||
name: string
|
||||
fractionSize: number
|
||||
spacing?: number
|
||||
symbol?: SymbolType
|
||||
uniqSymbol?: SymbolType
|
||||
localizedName: LocalizedName[]
|
||||
localeOverrides: LocaleOverrides[]
|
||||
}
|
||||
|
||||
export interface FiatCurrency {
|
||||
id: string
|
||||
info: CurrencyInfo
|
||||
}
|
||||
|
||||
export interface GetInfoResponse {
|
||||
balanceSat: number
|
||||
pendingSendSat: number
|
||||
@@ -131,6 +146,17 @@ export interface LnUrlWithdrawSuccessData {
|
||||
invoice: LnInvoice
|
||||
}
|
||||
|
||||
export interface LocaleOverrides {
|
||||
locale: string
|
||||
spacing?: number
|
||||
symbol: SymbolType
|
||||
}
|
||||
|
||||
export interface LocalizedName {
|
||||
locale: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface LogEntry {
|
||||
line: string
|
||||
level: string
|
||||
@@ -206,6 +232,11 @@ export interface PrepareSendResponse {
|
||||
feesSat: number
|
||||
}
|
||||
|
||||
export interface Rate {
|
||||
coin: string
|
||||
value: number
|
||||
}
|
||||
|
||||
export interface ReceiveOnchainRequest {
|
||||
prepareRes: PrepareReceiveOnchainResponse
|
||||
}
|
||||
@@ -258,6 +289,13 @@ export interface SendPaymentResponse {
|
||||
payment: Payment
|
||||
}
|
||||
|
||||
export interface SymbolType {
|
||||
grapheme?: string
|
||||
template?: string
|
||||
rtl?: boolean
|
||||
position?: number
|
||||
}
|
||||
|
||||
export interface UrlSuccessActionData {
|
||||
description: string
|
||||
url: string
|
||||
@@ -571,3 +609,13 @@ export const lnurlAuth = async (reqData: LnUrlAuthRequestData): Promise<LnUrlCal
|
||||
const response = await BreezLiquidSDK.lnurlAuth(reqData)
|
||||
return response
|
||||
}
|
||||
|
||||
export const fetchFiatRates = async (): Promise<Rate[]> => {
|
||||
const response = await BreezLiquidSDK.fetchFiatRates()
|
||||
return response
|
||||
}
|
||||
|
||||
export const listFiatCurrencies = async (): Promise<FiatCurrency[]> => {
|
||||
const response = await BreezLiquidSDK.listFiatCurrencies()
|
||||
return response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user