Class Konduit

Expand description

A 'black-box' API for Konduit L1 & L2 operations.

Constructors§

§

new Konduit(
    network_id: NetworkId,
    script_deployment_address: ShelleyAddress,
    signing_key: SigningKey,
): Konduit

Restore an instance from a signing key. Everything else (connector, adaptor, ...) is initially NOT configured.

Note that this take ownership of the signing key /!, to prevent it from leaking elsewhere afterwards.

Properties§

§readonly adaptorInfo: AdaptorInfo

Configure an (unauthenticated) adaptor, without a defined tag yet. Suitable to get the adaptor info and other non-authenticated operations.

§connector: Connector

Get a reference to the connector.

§readonly networkId: NetworkId

Current network id for which the app is configured.

§readonly wallet: Wallet

A handle on the underlying wallet.

Accessors§

§

set adaptor(value: Adaptor): void

Configure an (unauthenticated) adaptor, without a defined tag yet. Suitable to get the adaptor info and other non-authenticated operations.

Methods§

§

addToChannel(amount: bigint): Promise<Hash32>

Add funds to an existing channel.

§

channels(): Promise<ChannelOutput[]>

Find channels that belongs to "us"

§

closeChannel(): Promise<Hash32>

Close the currently active channel, if any.

§

free(): void

§

getQuoteFor(invoice: Invoice): Promise<Quote>

Get a quote for a given Bolt11 invoice from the adapator.

§

openChannel(tag: Tag, amount: bigint): Promise<Hash32>

Open a channel with the given tag and initial deposit.

§

pay(invoice: Invoice, quote: Quote, lockeds: Lockeds): Promise<SyncStatus>

Pay an invoice using a previously established quote.

§

resetChannelTag(): void

Remove any existing channel tag

§

setChannelTag(tag: Tag): void

Recover a previously known tag, if any.

§

syncChannel(lockeds: Lockeds): Promise<SyncStatus>

Synchronize the channel with the adaptor.