当前位置: 首页 > 软件库 > Web3 > 区块链 >

chainabstractionlayer

Blockchain abstraction layer
授权协议 MIT License
开发语言
所属分类 Web3、 区块链
软件类型 开源软件
地区 不详
投 递 者 岳卓君
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Chain Abstraction Layer

Test Status

⚠️ This project is under heavy development. Expect bugs & breaking changes.

�� Introductory Blog Post: The Missing Tool to Cross-Chain Development

Query different blockchains with account management using a single and simple interface.

Packages

Package Version
@liquality/bitcoin-js-wallet-provider
@liquality/bitcoin-ledger-provider
@liquality/bitcoin-networks
@liquality/bitcoin-rpc-provider
@liquality/bitcoin-wallet-node-provider
@liquality/bitcoin-swap-provider
@liquality/bitcoin-esplora-api-provider
@liquality/bitcoin-esplora-swap-find-provider
@liquality/bitcoin-utils
@liquality/client
@liquality/crypto
@liquality/debug
@liquality/errors
@liquality/ethereum-erc20-provider
@liquality/ethereum-erc20-swap-provider
@liquality/ethereum-ledger-provider
@liquality/ethereum-wallet-api-provider
@liquality/ethereum-networks
@liquality/ethereum-rpc-provider
@liquality/ethereum-js-wallet-provider
@liquality/ethereum-swap-provider
@liquality/ethereum-scraper-swap-find-provider
@liquality/ethereum-utils
@liquality/jsonrpc-provider
@liquality/ledger-provider
@liquality/provider
@liquality/schema
@liquality/utils
@liquality/wallet-provider

Usage

import { Client } from '@liquality/client'
import { BitcoinRpcProvider } from '@liquality/bitcoin-rpc-provider'
import { EthereumRpcProvider } from '@liquality/ethereum-rpc-provider'

import { BitcoinLedgerProvider } from '@liquality/bitcoin-ledger-provider'
import { EthereumLedgerProvider } from '@liquality/ethereum-ledger-provider'

import { BitcoinNetworks } from '@liquality/bitcoin-networks'
import { EthereumNetworks } from '@liquality/ethereum-networks'

const bitcoin = new Client()
const ethereum = new Client()

bitcoin.addProvider(new BitcoinRpcProvider(
  'https://liquality.io/bitcointestnetrpc/', 'bitcoin', 'local321'
))
ethereum.addProvider(new EthereumRpcProvider(
  'https://rinkeby.infura.io/v3/xxx'
))

bitcoin.addProvider(new BitcoinLedgerProvider(
  { network: BitcoinNetworks.bitcoin_testnet }
))
ethereum.addProvider(new EthereumLedgerProvider(
  { network: EthereumNetworks.rinkeby }
))

// Fetch addresses from Ledger wallet using a single-unified API
const [ bitcoinAddress ] = await bitcoin.wallet.getAddresses(0, 1)
const [ ethereumAddress ] = await ethereum.wallet.getAddresses(0, 1)

// Sign a message
const signedMessageBitcoin = await bitcoin.wallet.signMessage(
  'The Times 3 January 2009 Chancellor on brink of second bailout for banks', bitcoinAddress
)
const signedMessageEthereum = await ethereum.wallet.signMessage(
  'The Times 3 January 2009 Chancellor on brink of second bailout for banks', ethereumAddress
)

// Send a transaction
await bitcoin.chain.sendTransaction(<to>, 1000)
await ethereum.chain.sendTransaction(<to>, 1000)

Development

npm install
npm run bootstrap
npm run watch

Production

npm run build

Publish

npm run new:version # prepare
npm run publish:all # publish

License

MIT