Skip to content

Commit

Permalink
Merge pull request #5 from hemilabs/1.0.1
Browse files Browse the repository at this point in the history
Accept after_txid param
  • Loading branch information
gabmontes authored Oct 1, 2024
2 parents 9ef2654 + af33159 commit 0b2c408
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ on:
pull_request:
push:

# Limit to one workflow per branch and one per pull request at the same time
# and cancel if a new one appears.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
all-checks:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version-file: .nvmrc
- run: npm ci
- run: npm run format:check
- run: npm run lint
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esplora-client",
"version": "1.0.0",
"version": "1.1.0",
"description": "Tiny client library for Esplora-based Bitcoin APIs",
"keywords": [
"api",
Expand Down Expand Up @@ -122,6 +122,16 @@
"parserOptions": {
"sourceType": "module"
},
"rules": {
"camelcase": [
"warn",
{
"allow": [
"after_txid"
]
}
]
},
"root": true
},
"knip": {
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export const esploraClient = function (options = {}) {
bitcoin: {
addresses: {
getAddress: ({ address }) => fetchApi(`address/${address}`),
getAddressTxs: ({ address }) => fetchApi(`address/${address}/txs`),
getAddressTxs: ({ address, after_txid }) =>
fetchApi(
`address/${address}/txs`,
after_txid && { queryString: { after_txid } },
),
getAddressTxsUtxo: ({ address }) => fetchApi(`address/${address}/utxo`),
},
blocks: {
Expand Down
2 changes: 1 addition & 1 deletion types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
/**
* @typedef {object} AddressesMethods
* @property {(params:{address:string})=>Promise<Address>} getAddress
* @property {(params:{address:string})=>Promise<Tx[]>} getAddressTxs
* @property {(params:{address:string,after_txid?:string})=>Promise<Tx[]>} getAddressTxs
* @property {(params:{address:string})=>Promise<AddressTxsUtxo[]>} getAddressTxsUtxo
*/

Expand Down

0 comments on commit 0b2c408

Please sign in to comment.