Skip to content

Commit

Permalink
UTXO client package (#941)
Browse files Browse the repository at this point in the history
* xchain-utxo package

* UTXO client removed from xchain-client package

* BTC client extends from xchain-utxo

* BCH client extends from xchain-utxo

* DASH client extends from xchain-utxo

* DOGE client extends from xchain-utxo

* LTC client extends from xchain-utxo

* UxoOnlineDataProvider from xchain-utxo package

* UTXO-providers cyclic dependency removed

* Imports updated

* Protocol refactor

* Tests

* Bug fix

* Dependencies updated

* yarn.lock

* Client dependency updated

* Changelog date
  • Loading branch information
0xp3gasus authored Dec 12, 2023
1 parent 1e5905a commit fc04961
Show file tree
Hide file tree
Showing 94 changed files with 567 additions and 312 deletions.
6 changes: 6 additions & 0 deletions packages/xchain-arbitrum/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.1.2 (2023-12-11)

## Update

- Client and EVM client packages update

# v0.1.1 (2023-11-16)

## Update
Expand Down
14 changes: 7 additions & 7 deletions packages/xchain-arbitrum/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xchainjs/xchain-arbitrum",
"version": "0.1.1",
"version": "0.1.2",
"description": "Arbitrum EVM client for XChainJS",
"keywords": [
"XChain",
Expand Down Expand Up @@ -35,20 +35,20 @@
"access": "public"
},
"devDependencies": {
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-evm": "^0.4.1",
"@xchainjs/xchain-evm": "^0.4.2",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-evm-providers": "^0.1.3",
"@xchainjs/xchain-evm-providers": "^0.1.4",
"axios": "^1.3.6",
"ethers": "^5.7.2"
},
"peerDependencies": {
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-evm": "^0.4.1",
"@xchainjs/xchain-evm": "^0.4.2",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-evm-providers": "^0.1.3",
"@xchainjs/xchain-evm-providers": "^0.1.4",
"axios": "^1.3.6",
"ethers": "^5.7.2"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/xchain-avax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.4.2 (2023-12-11)

## Update

- Client and EVM client packages update

# v0.4.1 (2023-11-16)

## Update
Expand Down
14 changes: 7 additions & 7 deletions packages/xchain-avax/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xchainjs/xchain-avax",
"version": "0.4.1",
"version": "0.4.2",
"description": "Avax EVM client for XChainJS",
"keywords": [
"XChain",
Expand Down Expand Up @@ -35,20 +35,20 @@
"access": "public"
},
"devDependencies": {
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-evm": "^0.4.1",
"@xchainjs/xchain-evm": "^0.4.2",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-evm-providers": "^0.1.3",
"@xchainjs/xchain-evm-providers": "^0.1.4",
"axios": "^1.3.6",
"ethers": "^5.7.2"
},
"peerDependencies": {
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-evm": "^0.4.1",
"@xchainjs/xchain-evm": "^0.4.2",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-evm-providers": "^0.1.3",
"@xchainjs/xchain-evm-providers": "^0.1.4",
"axios": "^1.3.6",
"ethers": "^5.7.2"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/xchain-binance/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v5.7.7 (2023-12-11)

## Update

- Client dependency updated

# v5.7.6 (2023-12-01)

## Update
Expand Down
6 changes: 3 additions & 3 deletions packages/xchain-binance/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xchainjs/xchain-binance",
"version": "5.7.6",
"version": "5.7.7",
"description": "Custom Binance client and utilities used by XChainJS clients",
"keywords": [
"BNB",
Expand Down Expand Up @@ -35,7 +35,7 @@
"devDependencies": {
"@binance-chain/javascript-sdk": "^4.2.0",
"@types/big.js": "^6.1.6",
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-util": "^0.13.1"
},
Expand All @@ -44,7 +44,7 @@
},
"peerDependencies": {
"@binance-chain/javascript-sdk": "^4.2.0",
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-util": "^0.13.1"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/xchain-bitcoin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.23.8 (2023-12-11)

## Update

- UTXO client package dependency

# v0.23.7 (2023-12-06)

## Add
Expand Down
3 changes: 2 additions & 1 deletion packages/xchain-bitcoin/__tests__/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Network, UtxoClientParams } from '@xchainjs/xchain-client'
import { Network } from '@xchainjs/xchain-client'
import { baseAmount } from '@xchainjs/xchain-util'
import { UtxoClientParams } from '@xchainjs/xchain-utxo'

import mockBitgoApi from '../__mocks__/bitgo'
import mockHaskoinApi from '../__mocks__/haskoin'
Expand Down
14 changes: 8 additions & 6 deletions packages/xchain-bitcoin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xchainjs/xchain-bitcoin",
"version": "0.23.7",
"version": "0.23.8",
"description": "Custom Bitcoin client and utilities used by XChainJS clients",
"keywords": [
"XChain",
Expand Down Expand Up @@ -35,21 +35,23 @@
"devDependencies": {
"@ledgerhq/hw-transport-node-hid": "^6.28.0",
"@types/wif": "^2.0.2",
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-utxo-providers": "^0.2.8",
"@xchainjs/xchain-utxo": "^0.1.0",
"@xchainjs/xchain-utxo-providers": "^0.2.9",
"axios": "^1.3.6",
"axios-mock-adapter": "^1.20.0",
"bitcoinjs-lib": "5.2.0",
"coinselect": "^3.1.12",
"wif": "^2.0.6"
},
"peerDependencies": {
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-utxo-providers": "^0.2.8",
"@xchainjs/xchain-utxo": "^0.1.0",
"@xchainjs/xchain-utxo-providers": "^0.2.9",
"axios": "^1.3.6",
"bitcoinjs-lib": "5.2.0",
"coinselect": "^3.1.12",
Expand All @@ -61,4 +63,4 @@
"dependencies": {
"@ledgerhq/hw-app-btc": "^10.1.0"
}
}
}
12 changes: 2 additions & 10 deletions packages/xchain-bitcoin/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import {
AssetInfo,
FeeRate,
Network,
PreparedTx,
TxParams,
UTXO,
UTXOClient,
UtxoClientParams,
} from '@xchainjs/xchain-client'
import { AssetInfo, FeeRate, Network, TxParams } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { Client as UTXOClient, PreparedTx, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo'
import * as Bitcoin from 'bitcoinjs-lib'
import accumulative from 'coinselect/accumulative'

Expand Down
3 changes: 2 additions & 1 deletion packages/xchain-bitcoin/src/clientLedger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import AppBtc from '@ledgerhq/hw-app-btc'
import { Transaction } from '@ledgerhq/hw-app-btc/lib/types'
import { FeeOption, FeeRate, TxHash, TxParams, UTXO, UtxoClientParams } from '@xchainjs/xchain-client'
import { FeeOption, FeeRate, TxHash, TxParams } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo'
import * as Bitcoin from 'bitcoinjs-lib'

import { Client } from './client'
Expand Down
3 changes: 2 additions & 1 deletion packages/xchain-bitcoin/src/const.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExplorerProvider, Network, UtxoOnlineDataProviders } from '@xchainjs/xchain-client'
import { ExplorerProvider, Network } from '@xchainjs/xchain-client'
import { Asset } from '@xchainjs/xchain-util'
import {
BitgoProvider,
Expand All @@ -8,6 +8,7 @@ import {
HaskoinProvider,
SochainNetwork,
SochainProvider,
UtxoOnlineDataProviders,
} from '@xchainjs/xchain-utxo-providers'

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/xchain-bitcoin/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Network, UTXO } from '@xchainjs/xchain-client'
import { Network } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { UTXO } from '@xchainjs/xchain-utxo'
import * as Bitcoin from 'bitcoinjs-lib'

export const TX_EMPTY_SIZE = 4 + 1 + 1 + 4 //10
Expand Down
6 changes: 6 additions & 0 deletions packages/xchain-bitcoincash/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.17.6 (2023-12-11)

## Update

- UTXO client package dependency

# v0.17.5 (2023-11-21)

## Update
Expand Down
12 changes: 7 additions & 5 deletions packages/xchain-bitcoincash/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xchainjs/xchain-bitcoincash",
"version": "0.17.5",
"version": "0.17.6",
"description": "Custom bitcoincash client and utilities used by XChainJS clients",
"keywords": [
"XChain",
Expand Down Expand Up @@ -40,21 +40,23 @@
"@psf/bitcoincashjs-lib": "^4.0.3",
"@types/bchaddrjs": "0.4.0",
"@types/uniqid": "^5.3.1",
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-utxo-providers": "^0.2.8",
"@xchainjs/xchain-utxo": "^0.1.0",
"@xchainjs/xchain-utxo-providers": "^0.2.9",
"axios": "^1.3.6",
"axios-mock-adapter": "^1.20.0",
"bchaddrjs": "^0.5.2",
"coinselect": "3.1.12"
},
"peerDependencies": {
"@psf/bitcoincashjs-lib": "^4.0.3",
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-utxo-providers": "^0.2.8",
"@xchainjs/xchain-utxo": "^0.1.0",
"@xchainjs/xchain-utxo-providers": "^0.2.9",
"axios": "^1.3.6",
"bchaddrjs": "^0.5.2",
"coinselect": "3.1.12"
Expand Down
14 changes: 2 additions & 12 deletions packages/xchain-bitcoincash/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import * as bitcash from '@psf/bitcoincashjs-lib'
import {
AssetInfo,
FeeOption,
FeeRate,
Network,
TxHash,
TxParams,
UTXO,
UTXOClient,
UtxoClientParams,
checkFeeBounds,
} from '@xchainjs/xchain-client'
import { AssetInfo, FeeOption, FeeRate, Network, TxHash, TxParams, checkFeeBounds } from '@xchainjs/xchain-client'
import { getSeed } from '@xchainjs/xchain-crypto'
import { Address } from '@xchainjs/xchain-util'
import { Client as UTXOClient, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo'
import accumulative from 'coinselect/accumulative'

import {
Expand Down
9 changes: 7 additions & 2 deletions packages/xchain-bitcoincash/src/const.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { ExplorerProvider, Network, UtxoOnlineDataProviders } from '@xchainjs/xchain-client'
import { ExplorerProvider, Network } from '@xchainjs/xchain-client'
import { Asset } from '@xchainjs/xchain-util'
import { BitgoProvider, HaskoinNetwork, HaskoinProvider } from '@xchainjs/xchain-utxo-providers'
import {
BitgoProvider,
HaskoinNetwork,
HaskoinProvider,
UtxoOnlineDataProviders,
} from '@xchainjs/xchain-utxo-providers'

export const LOWER_FEE_BOUND = 1
export const UPPER_FEE_BOUND = 500
Expand Down
3 changes: 2 additions & 1 deletion packages/xchain-bitcoincash/src/types/client-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Balance, FeeOption, Fees, Network, PreparedTx, TxHash, UTXO as BaseUTXO } from '@xchainjs/xchain-client'
import { Balance, FeeOption, Fees, Network, PreparedTx, TxHash } from '@xchainjs/xchain-client'
import { Address } from '@xchainjs/xchain-util'
import { UTXO as BaseUTXO } from '@xchainjs/xchain-utxo'

export type FeeRate = number
export type FeeRates = Record<FeeOption, FeeRate>
Expand Down
6 changes: 6 additions & 0 deletions packages/xchain-bsc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.4.3 (2023-12-11)

## Update

- Client and EVM client packages update

# v0.4.2 (2023-11-21)

## Update
Expand Down
14 changes: 7 additions & 7 deletions packages/xchain-bsc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xchainjs/xchain-bsc",
"version": "0.4.2",
"version": "0.4.3",
"description": "Binance Smart Chain EVM client for XChainJS",
"keywords": [
"XChain",
Expand Down Expand Up @@ -35,20 +35,20 @@
"access": "public"
},
"devDependencies": {
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-evm": "^0.4.1",
"@xchainjs/xchain-evm": "^0.4.2",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-evm-providers": "^0.1.3",
"@xchainjs/xchain-evm-providers": "^0.1.4",
"axios": "^1.3.6",
"ethers": "^5.7.2"
},
"peerDependencies": {
"@xchainjs/xchain-client": "^0.15.5",
"@xchainjs/xchain-client": "^0.15.6",
"@xchainjs/xchain-crypto": "^0.3.0",
"@xchainjs/xchain-evm": "^0.4.1",
"@xchainjs/xchain-evm": "^0.4.2",
"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-evm-providers": "^0.1.3",
"@xchainjs/xchain-evm-providers": "^0.1.4",
"axios": "^1.3.6",
"ethers": "^5.7.2"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/xchain-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.15.6 (2023-12-11)

## Update

- UTXO client removed

# v0.15.5 (2023-12-06)

## Add
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xchainjs/xchain-client",
"version": "0.15.5",
"version": "0.15.6",
"license": "MIT",
"main": "lib/index.js",
"module": "lib/index.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/xchain-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from './BaseXChainClient'
export * from './UTXOClient'
export * from './types'
export * from './feeRates'
export * from './fees'
export * from './explorer-provider'
export * from './provider-types'
export * from './protocols'
Loading

0 comments on commit fc04961

Please sign in to comment.