⚠️ This project is under heavy development. Expect bugs & breaking changes.
Query different blockchains with account management using a single and simple interface.
This repository was built as an extension to the ChainAbstractionLayer maintained by the core contributors of Liquality. It is necessary to include the Client and providers from the @liquality npm packages in order to use providers such as the BitcoinCollateralProvider.
| Package | Version |
|---|---|
| @atomicloans/bitcoin-collateral-provider | |
| @atomicloans/bitcoin-collateral-swap-provider | |
| @atomicloans/loan-bundle | |
| @atomicloans/loan-client | |
| @atomicloans/provider |
import { Client, Provider, providers, crypto } from '@liquality/bundle'
import { LoanClient, providers as lproviders } from '@atomicloans/bundle'
const bitcoinNetworks = providers.bitcoin.networks
const bitcoin = new Client()
const bitcoinLoanWithLedger = new LoanClient(bitcoin)
bitcoin.loan = bitcoinLoanWithLedger
bitcoin.addProvider(new providers.bitcoin.BitcoinBitcoreRpcProvider('https://liquality.io/bitcointestnetrpc/', 'bitcoin', 'local321'))
bitcoin.addProvider(new providers.bitcoin.BitcoinLedgerProvider({ network: bitcoinNetworks['bitcoin_testnet'], segwit: false }))
bitcoin.loan.addProvider(new lproviders.bitcoin.BitcoinCollateralProvider({ network: bitcoinNetworks[config.bitcoin.network] }, { script: 'p2sh', address: 'p2wpkh'}))
bitcoin.loan.collateral.lock(values, pubKeys, secretHashes, expirations)npm install
npm run bootstrap
npm run watchnpm run build