deb
This commit is contained in:
parent
bc7d586c8a
commit
887b11c700
2 changed files with 5 additions and 3 deletions
|
|
@ -39,6 +39,7 @@ export class LiquidityProvider {
|
||||||
lastSeenBeacon = 0
|
lastSeenBeacon = 0
|
||||||
latestReceivedBalance = 0
|
latestReceivedBalance = 0
|
||||||
incrementProviderBalance: (balance: number) => Promise<void>
|
incrementProviderBalance: (balance: number) => Promise<void>
|
||||||
|
rand = Math.random()
|
||||||
// make the sub process accept client
|
// make the sub process accept client
|
||||||
constructor(getSettings: () => LiquiditySettings, utils: Utils, invoicePaidCb: InvoicePaidCb, incrementProviderBalance: (balance: number) => Promise<any>) {
|
constructor(getSettings: () => LiquiditySettings, utils: Utils, invoicePaidCb: InvoicePaidCb, incrementProviderBalance: (balance: number) => Promise<any>) {
|
||||||
this.utils = utils
|
this.utils = utils
|
||||||
|
|
@ -327,7 +328,7 @@ export class LiquidityProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
setNostrInfo = ({ clientId, myPub }: { myPub: string, clientId: string }) => {
|
setNostrInfo = ({ clientId, myPub }: { myPub: string, clientId: string }) => {
|
||||||
this.log("setting nostr info")
|
this.log("setting nostr info", this.rand)
|
||||||
this.clientId = clientId
|
this.clientId = clientId
|
||||||
this.myPub = myPub
|
this.myPub = myPub
|
||||||
this.setSetIfConfigured()
|
this.setSetIfConfigured()
|
||||||
|
|
@ -336,7 +337,7 @@ export class LiquidityProvider {
|
||||||
|
|
||||||
|
|
||||||
attachNostrSend(f: NostrSend) {
|
attachNostrSend(f: NostrSend) {
|
||||||
this.log("attaching nostrSend action")
|
this.log("attaching nostrSend action", this.rand)
|
||||||
this.nostrSend = f
|
this.nostrSend = f
|
||||||
this.setSetIfConfigured()
|
this.setSetIfConfigured()
|
||||||
}
|
}
|
||||||
|
|
@ -344,7 +345,7 @@ export class LiquidityProvider {
|
||||||
setSetIfConfigured = () => {
|
setSetIfConfigured = () => {
|
||||||
if (this.nostrSend && !!this.pubDestination && !!this.clientId && !!this.myPub) {
|
if (this.nostrSend && !!this.pubDestination && !!this.clientId && !!this.myPub) {
|
||||||
this.configured = true
|
this.configured = true
|
||||||
this.log("configured to send to ", this.pubDestination)
|
this.log("configured to send to ", this.pubDestination, this.rand)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fees: { networkFeeBps: number, networkFeeFixed: number, serviceFeeBps: number }
|
// fees: { networkFeeBps: number, networkFeeFixed: number, serviceFeeBps: number }
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ export const initBootstrappedInstance = async (T: TestBase) => {
|
||||||
await new Promise<void>(res => {
|
await new Promise<void>(res => {
|
||||||
const interval = setInterval(async () => {
|
const interval = setInterval(async () => {
|
||||||
const canHandle = await bootstrapped.liquidityProvider.CanProviderHandle({ action: 'receive', amount: 2000 })
|
const canHandle = await bootstrapped.liquidityProvider.CanProviderHandle({ action: 'receive', amount: 2000 })
|
||||||
|
console.log("can handle", canHandle)
|
||||||
if (canHandle) {
|
if (canHandle) {
|
||||||
clearInterval(interval)
|
clearInterval(interval)
|
||||||
res()
|
res()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue