SDK default values
Look up what @bsv/sdk, @bsv/simple and @bsv/wallet-toolbox do when you leave a setting out. This page was written against @bsv/sdk 4.0.1, @bsv/simple 0.7.2 and @bsv/wallet-toolbox 2.15.1, so check the values against your installed versions.
Default fee rate
The fee() method of a transaction takes a fee model, or a number to pay a fixed fee in satoshis (1 satoshi is 0.00000001 BSV). The table shows what @bsv/sdk uses when you pass neither.
| Setting | Default | Notes |
|---|---|---|
Fee model of tx.fee() | LivePolicy | Reads the rate from the policy of the ARCThe service that receives your transaction and passes it to miners at GorillaPool, https://arc.gorillapool.io/v1/policy. @bsv/sdk 1.8.0 and later. In 1.7.7 and earlier the default was new SatoshisPerKilobyte(1), 1 satoshi per kilobyte |
| Rate cache | 5 minutes | Pass new LivePolicy(cacheValidityMs) to fee() to change it |
| Rate when the request fails | 100 satoshis per kilobyte | Used only when the request fails and no earlier rate is cached. The SDK logs a warning |
new SatoshisPerKilobyte(value) | none | The constructor throws without a value |
Input sequence number
An input added to a transaction without a sequence gets 0xffffffff (4294967295), the final value. Set sequence on the input when your script depends on it.
Network and storage
@bsv/simple and the wallet-toolbox choose a network and a storage server for you.
With @bsv/simple, the defaults describe a Mainnet wallet. For testnet, pass the network and a storage URL for testnet in the code you run, as the examples in this documentation do. The SDK overview shows both for a ServerWallet.
| Package | Setting | Default |
|---|---|---|
@bsv/simple | network | main |
@bsv/simple | storageUrl of ServerWallet | https://storage.babbage.systems |
@bsv/simple | messageBoxHost | https://messagebox.babbage.systems |
@bsv/simple | tokenBasket, tokenProtocolID, tokenKeyID | tokens, [0, "token"], "1" |
@bsv/wallet-toolbox | storageUrl of Setup on main | https://storage.babbage.systems |
@bsv/wallet-toolbox | storageUrl of Setup on any other chain | https://staging-storage.babbage.systems |
Broadcasting
The wallet-toolbox Services class sends a transaction to its broadcasters in order and stops at the first one that accepts it. The order depends on the chain:
| Chain | Broadcasters, in order | ARC URL |
|---|---|---|
main | GorillaPool ARC, Taal ARC, Bitails, WhatsOnChain | https://arc.taal.com and https://arc.gorillapool.io |
test | Taal ARC, Bitails, WhatsOnChain | https://arc-test.taal.com |
ttn | BSV Broadcaster only | none |
On main and test, BSV Broadcaster is not set, and it goes first when you pass its URL.
| Setting | Default |
|---|---|
| Broadcast mode | UntilSuccess |
| Time limit for each broadcaster | 5000 ms, plus 50 ms for each KiB of data sent, up to 30000 ms |
| Update of the BitcoinSV (BSV) price | every 15 minutes |
| Update of fiat exchange rates | every 24 hours |
Related articles
To learn more about fees, networks and broadcasting on the BSV blockchain, review these articles: