-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk): migrate utxo-api API calls to v2 (#28)
* refactor: migrate `/utxo/unspents` API calls to v2 * refactor: migrate `/utxo/transaction` API calls to v2 * refactor: add types for Transaction also, moved types to relevant files * refactor: migrate `/utxo/inscriptions` API calls to v2 * fix: bug fixes and improvements * fix: update import * refactor: remove txhex from fetch unspents * refactor: update utxo api v2 URL * refactor: update relay tx fns to use new API * refactor: pass interface as generic and remove explicit return type * refactor: move interface to relevant file and delete unused * refactor: rename snake-cased props to camelCase * refactor: move interface to relevant file also, replace string w/ specific type * fix: update incorrect import path * fix: pass correct argument to RPC and update incorrect check * fix: update true negative condition where index:0 was marked as invalid * refactor: add default object for options in wallet.signPsbt fn * chore: add npm command to watch and build * chore: remove unnecessary config from vscode settings
- Loading branch information
1 parent
a0ee76e
commit 5f61122
Showing
17 changed files
with
344 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Transaction as BTCTransaction } from 'bitcoinjs-lib' | ||
|
||
import { Network } from "../config/types"; | ||
import { Rarity } from "../inscription/types"; | ||
import { Transaction, UTXO } from "../transactions/types"; | ||
|
||
export interface FetchUnspentUTXOsOptions { | ||
address: string | ||
network?: Network | ||
type?: "all" | "spendable" | ||
rarity?: Rarity[] | ||
} | ||
|
||
export interface FetchUnspentUTXOsResponse { | ||
totalUTXOs: number | ||
spendableUTXOs: UTXO[] | ||
unspendableUTXOs: UTXO[] | ||
} | ||
|
||
export interface FetchTxOptions { | ||
txId: string | ||
network?: Network | ||
ordinals?: boolean | ||
hex?: boolean | ||
witness?: boolean | ||
} | ||
|
||
export interface FetchTxResponse { | ||
tx: Transaction | ||
rawTx?: BTCTransaction | ||
} | ||
|
||
export interface FetchInscriptionsOptions { | ||
outpoint: string | ||
network?: Network | ||
} | ||
|
||
export interface RelayTxOptions { | ||
hex: string | ||
maxFeeRate?: number | ||
network?: Network | ||
} |
Oops, something went wrong.