0.2.15 • Published 2 years ago

@thorswap-lib/xchain-doge v0.2.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@thorswap-lib/xchain-client

Modules

Installation

yarn add @thorswap-lib/xchain-client

Following peer dependencies have to be installed into your project. These are not included in @thorswap-lib/xchain-doge.

yarn add @thorswap-lib/xchain-client axios bitcoinjs-lib coininfo wif coinselect

Service Providers

This package uses the following service providers:

FunctionServiceNotes
BalancesSochainhttps://sochain.com/api#get-balance
Transaction historySochainhttps://sochain.com/api#get-display-data-address, https://sochain.com/api#get-tx
Transaction details by hashSochainhttps://sochain.com/api#get-tx
Transaction feesBlockCypherhttps://api.blockcypher.com/v1/doge/main
Transaction broadcastBlockCypherhttps://api.blockcypher.com/v1/doge/main/txs/push
ExplorerBlockchairhttps://blockchair.com/dogecoin

Sochain API rate limits: https://sochain.com/api#rate-limits (300 requests/minute)

BlockCypher API rate limits: https://api.blockcypher.com/v1/doge/main (5 requests/second)

Usage

Initialize client and use class methods:

import { Client, Network } from '../src/client'

// Create a new client interface
const dogeClient = new Client({ network: Network.Testnet })

// Set phrase
dogeClient.setPhrase('phrase here')

// Get address
const address = dogeClient.getAddress()

// Get balance
const balance = await dogeClient.getBalance()

// Transfer with feeRate
const txid = await dogeClient.transfer({ asset: AssetDoge, recipient: 'recipient address here', amount: baseAmount(100, DOGE_DECIMAL), feeRate: 1 })

// Transfer with default feeRate (default is `fast`)
const txid = await dogeClient.transfer({ asset: AssetDoge, recipient: 'recipient address here', amount: baseAmount(100, DOGE_DECIMAL) })

// Get fee estimations
const { fast, fastest, average } = await dogeClient.getFees()

// Get feeRate estimations
const { fast, fastest, average } = await dogeClient.getFeeRates()

// Search transactions
const transactions = await dogeClient.getTransactions({ address: 'address here', limit: 4 })

// Get a transaction with a given txId/hash
const txData = await dogeClient.getTransactionData('b660ee07167cfa32681e2623f3a29dc64a089cabd9a3a07dd17f9028ac956eb8')
0.2.15

2 years ago

0.2.14

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.1.8

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.7

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.0.1

2 years ago