Setting default min swap amount

cln-peer-swap
ShahanaFarooqui 10 months ago
parent f68c119f7a
commit 9c4929d31b

@ -81,7 +81,7 @@ export const initCLNState: CLNState = {
offers: [],
offersBookmarks: [],
totalSwapPeers: 0,
peerswapPolicy: {},
peerswapPolicy: { min_swap_amount_msat: 100000000 },
swapPeers: [],
swapOuts: [],
swapIns: [],

@ -28,7 +28,7 @@ export class PSSwapInModalComponent implements OnInit, OnDestroy {
public faExclamationTriangle = faExclamationTriangle;
public selNode: SelNodeChild | null = {};
public psPolicy: PeerswapPolicy = {};
public psPolicy: PeerswapPolicy = { min_swap_amount_msat: 100000000 };
public sPeer: SwapPeerChannelsFlattened | null = null;
public swapAmount: number | null;
public swapAmountHint = '';

@ -28,7 +28,7 @@ export class PSSwapOutModalComponent implements OnInit, OnDestroy {
public faExclamationTriangle = faExclamationTriangle;
public selNode: SelNodeChild | null = {};
public psPolicy: PeerswapPolicy = {};
public psPolicy: PeerswapPolicy = { min_swap_amount_msat: 100000000 };
public sPeer: SwapPeerChannelsFlattened | null = null;
public swapAmount: number | null;
public swapAmountHint = '';

@ -31,7 +31,7 @@ export class PeerswapServiceSettingsComponent implements OnInit, OnDestroy {
public selNode: ConfigSettingsNode | any;
public enablePeerswap = false;
public allowSwapRequests = false;
public psPolicy: PeerswapPolicy | null = null;
public psPolicy: PeerswapPolicy = { min_swap_amount_msat: 100000000 };
public peerswapPeersLists = PeerswapPeersLists;
public errorMessage = '';
public dataForAllowedList = { icon: 'check', class: 'green', title: 'whitelisted peers', dataSource: 'allowlisted_peers', list: PeerswapPeersLists.ALLOWED, ngModelVar: '', addRemoveError: '' };
@ -94,8 +94,8 @@ export class PeerswapServiceSettingsComponent implements OnInit, OnDestroy {
}
this.dataService.addPeerToPeerswap(ngModelVar, list).pipe(takeUntil(this.unSubs[2])).
subscribe({
next: (res) => {
this.psPolicy = res;
next: (res: PeerswapPolicy) => {
this.psPolicy = res || { min_swap_amount_msat: 100000000 };
if (list !== PeerswapPeersLists.ALLOWED) {
this.dataForSuspiciousList.ngModelVar = '';
} else {
@ -126,8 +126,8 @@ export class PeerswapServiceSettingsComponent implements OnInit, OnDestroy {
}
this.dataService.removePeerFromPeerswap(peerNodeId, list).pipe(takeUntil(this.unSubs[3])).
subscribe({
next: (res) => {
this.psPolicy = res;
next: (res: PeerswapPolicy) => {
this.psPolicy = res || { min_swap_amount_msat: 100000000 };
}, error: (err) => {
if (list !== PeerswapPeersLists.ALLOWED) {
this.dataForSuspiciousList.addRemoveError = 'ERROR: ' + err;

@ -1,8 +1,8 @@
export interface PeerswapPolicy {
min_swap_amount_msat: number;
accept_all_peers?: boolean;
allow_new_swaps?: boolean;
allowlisted_peers?: string[];
min_swap_amount_msat?: number;
reserve_onchain_msat?: number;
suspicious_peers?: string[];
}

Loading…
Cancel
Save