@bsv/sdk 1.3.12 → 1.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +15 -3
- package/dist/cjs/src/auth/Peer.js +83 -57
- package/dist/cjs/src/auth/Peer.js.map +1 -1
- package/dist/cjs/src/auth/SessionManager.js +14 -9
- package/dist/cjs/src/auth/SessionManager.js.map +1 -1
- package/dist/cjs/src/auth/certificates/Certificate.js +16 -10
- package/dist/cjs/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/cjs/src/auth/certificates/MasterCertificate.js +25 -23
- package/dist/cjs/src/auth/certificates/MasterCertificate.js.map +1 -1
- package/dist/cjs/src/auth/certificates/VerifiableCertificate.js +2 -2
- package/dist/cjs/src/auth/certificates/VerifiableCertificate.js.map +1 -1
- package/dist/cjs/src/auth/certificates/__tests/CompletedProtoWallet.js +62 -46
- package/dist/cjs/src/auth/certificates/__tests/CompletedProtoWallet.js.map +1 -1
- package/dist/cjs/src/auth/clients/AuthFetch.js +1 -0
- package/dist/cjs/src/auth/clients/AuthFetch.js.map +1 -1
- package/dist/cjs/src/auth/transports/SimplifiedFetchTransport.js +70 -43
- package/dist/cjs/src/auth/transports/SimplifiedFetchTransport.js.map +1 -1
- package/dist/cjs/src/auth/utils/createNonce.js +2 -1
- package/dist/cjs/src/auth/utils/createNonce.js.map +1 -1
- package/dist/cjs/src/auth/utils/getVerifiableCertificates.js.map +1 -1
- package/dist/cjs/src/auth/utils/validateCertificates.js +5 -2
- package/dist/cjs/src/auth/utils/validateCertificates.js.map +1 -1
- package/dist/cjs/src/auth/utils/verifyNonce.js +2 -1
- package/dist/cjs/src/auth/utils/verifyNonce.js.map +1 -1
- package/dist/cjs/src/compat/BSM.js +7 -17
- package/dist/cjs/src/compat/BSM.js.map +1 -1
- package/dist/cjs/src/compat/ECIES.js +172 -133
- package/dist/cjs/src/compat/ECIES.js.map +1 -1
- package/dist/cjs/src/compat/HD.js +63 -73
- package/dist/cjs/src/compat/HD.js.map +1 -1
- package/dist/cjs/src/compat/Mnemonic.js +102 -106
- package/dist/cjs/src/compat/Mnemonic.js.map +1 -1
- package/dist/cjs/src/compat/Utxo.js +2 -2
- package/dist/cjs/src/compat/Utxo.js.map +1 -1
- package/dist/cjs/src/compat/index.js +7 -17
- package/dist/cjs/src/compat/index.js.map +1 -1
- package/dist/cjs/src/messages/EncryptedMessage.js +3 -1
- package/dist/cjs/src/messages/EncryptedMessage.js.map +1 -1
- package/dist/cjs/src/messages/SignedMessage.js +1 -0
- package/dist/cjs/src/messages/SignedMessage.js.map +1 -1
- package/dist/cjs/src/messages/index.js +7 -17
- package/dist/cjs/src/messages/index.js.map +1 -1
- package/dist/cjs/src/overlay-tools/LookupResolver.js +54 -35
- package/dist/cjs/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/cjs/src/overlay-tools/OverlayAdminTokenTemplate.js +32 -20
- package/dist/cjs/src/overlay-tools/OverlayAdminTokenTemplate.js.map +1 -1
- package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js +40 -28
- package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js.map +1 -1
- package/dist/cjs/src/primitives/AESGCM.js +6 -5
- package/dist/cjs/src/primitives/AESGCM.js.map +1 -1
- package/dist/cjs/src/primitives/BasePoint.js +1 -1
- package/dist/cjs/src/primitives/BasePoint.js.map +1 -1
- package/dist/cjs/src/primitives/BigNumber.js +50 -62
- package/dist/cjs/src/primitives/BigNumber.js.map +1 -1
- package/dist/cjs/src/primitives/Curve.js +46 -22
- package/dist/cjs/src/primitives/Curve.js.map +1 -1
- package/dist/cjs/src/primitives/DRBG.js +2 -8
- package/dist/cjs/src/primitives/DRBG.js.map +1 -1
- package/dist/cjs/src/primitives/ECDSA.js +51 -35
- package/dist/cjs/src/primitives/ECDSA.js.map +1 -1
- package/dist/cjs/src/primitives/Hash.js +191 -216
- package/dist/cjs/src/primitives/Hash.js.map +1 -1
- package/dist/cjs/src/primitives/JacobianPoint.js +19 -5
- package/dist/cjs/src/primitives/JacobianPoint.js.map +1 -1
- package/dist/cjs/src/primitives/K256.js.map +1 -1
- package/dist/cjs/src/primitives/Mersenne.js.map +1 -1
- package/dist/cjs/src/primitives/MontgomoryMethod.js.map +1 -1
- package/dist/cjs/src/primitives/Point.js +117 -88
- package/dist/cjs/src/primitives/Point.js.map +1 -1
- package/dist/cjs/src/primitives/Polynomial.js +4 -2
- package/dist/cjs/src/primitives/Polynomial.js.map +1 -1
- package/dist/cjs/src/primitives/PrivateKey.js +32 -33
- package/dist/cjs/src/primitives/PrivateKey.js.map +1 -1
- package/dist/cjs/src/primitives/PublicKey.js.map +1 -1
- package/dist/cjs/src/primitives/Random.js +6 -5
- package/dist/cjs/src/primitives/Random.js.map +1 -1
- package/dist/cjs/src/primitives/ReductionContext.js +1 -1
- package/dist/cjs/src/primitives/ReductionContext.js.map +1 -1
- package/dist/cjs/src/primitives/Schnorr.js +21 -15
- package/dist/cjs/src/primitives/Schnorr.js.map +1 -1
- package/dist/cjs/src/primitives/Signature.js +8 -7
- package/dist/cjs/src/primitives/Signature.js.map +1 -1
- package/dist/cjs/src/primitives/SymmetricKey.js +13 -13
- package/dist/cjs/src/primitives/SymmetricKey.js.map +1 -1
- package/dist/cjs/src/primitives/TransactionSignature.js +31 -29
- package/dist/cjs/src/primitives/TransactionSignature.js.map +1 -1
- package/dist/cjs/src/primitives/index.js +7 -17
- package/dist/cjs/src/primitives/index.js.map +1 -1
- package/dist/cjs/src/primitives/utils.js +79 -68
- package/dist/cjs/src/primitives/utils.js.map +1 -1
- package/dist/cjs/src/script/OP.js +3 -3
- package/dist/cjs/src/script/OP.js.map +1 -1
- package/dist/cjs/src/script/Script.js +12 -10
- package/dist/cjs/src/script/Script.js.map +1 -1
- package/dist/cjs/src/script/Spend.js +47 -49
- package/dist/cjs/src/script/Spend.js.map +1 -1
- package/dist/cjs/src/script/templates/P2PKH.js +24 -12
- package/dist/cjs/src/script/templates/P2PKH.js.map +1 -1
- package/dist/cjs/src/script/templates/PushDrop.js +28 -23
- package/dist/cjs/src/script/templates/PushDrop.js.map +1 -1
- package/dist/cjs/src/script/templates/RPuzzle.js +10 -6
- package/dist/cjs/src/script/templates/RPuzzle.js.map +1 -1
- package/dist/cjs/src/totp/totp.js +2 -1
- package/dist/cjs/src/totp/totp.js.map +1 -1
- package/dist/cjs/src/transaction/Beef.js +177 -154
- package/dist/cjs/src/transaction/Beef.js.map +1 -1
- package/dist/cjs/src/transaction/BeefParty.js +24 -24
- package/dist/cjs/src/transaction/BeefParty.js.map +1 -1
- package/dist/cjs/src/transaction/BeefTx.js +26 -18
- package/dist/cjs/src/transaction/BeefTx.js.map +1 -1
- package/dist/cjs/src/transaction/Broadcaster.js +3 -2
- package/dist/cjs/src/transaction/Broadcaster.js.map +1 -1
- package/dist/cjs/src/transaction/MerklePath.js +64 -37
- package/dist/cjs/src/transaction/MerklePath.js.map +1 -1
- package/dist/cjs/src/transaction/Transaction.js +111 -137
- package/dist/cjs/src/transaction/Transaction.js.map +1 -1
- package/dist/cjs/src/transaction/broadcasters/ARC.js +25 -16
- package/dist/cjs/src/transaction/broadcasters/ARC.js.map +1 -1
- package/dist/cjs/src/transaction/broadcasters/DefaultBroadcaster.js +2 -1
- package/dist/cjs/src/transaction/broadcasters/DefaultBroadcaster.js.map +1 -1
- package/dist/cjs/src/transaction/broadcasters/WhatsOnChainBroadcaster.js.map +1 -1
- package/dist/cjs/src/transaction/chaintrackers/DefaultChainTracker.js +2 -1
- package/dist/cjs/src/transaction/chaintrackers/DefaultChainTracker.js.map +1 -1
- package/dist/cjs/src/transaction/chaintrackers/WhatsOnChain.js +3 -3
- package/dist/cjs/src/transaction/chaintrackers/WhatsOnChain.js.map +1 -1
- package/dist/cjs/src/transaction/fee-models/SatoshisPerKilobyte.js.map +1 -1
- package/dist/cjs/src/transaction/http/DefaultHttpClient.js +5 -3
- package/dist/cjs/src/transaction/http/DefaultHttpClient.js.map +1 -1
- package/dist/cjs/src/transaction/http/FetchHttpClient.js +5 -2
- package/dist/cjs/src/transaction/http/FetchHttpClient.js.map +1 -1
- package/dist/cjs/src/transaction/http/NodejsHttpClient.js +5 -3
- package/dist/cjs/src/transaction/http/NodejsHttpClient.js.map +1 -1
- package/dist/cjs/src/transaction/http/index.js.map +1 -1
- package/dist/cjs/src/transaction/index.js.map +1 -1
- package/dist/cjs/src/wallet/CachedKeyDeriver.js +91 -66
- package/dist/cjs/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/KeyDeriver.js +61 -52
- package/dist/cjs/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/ProtoWallet.js +79 -29
- package/dist/cjs/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/cjs/src/wallet/WalletClient.js +7 -2
- package/dist/cjs/src/wallet/WalletClient.js.map +1 -1
- package/dist/cjs/src/wallet/WalletError.js +2 -2
- package/dist/cjs/src/wallet/WalletError.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js +4 -3
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/HTTPWalletWire.js +2 -2
- package/dist/cjs/src/wallet/substrates/HTTPWalletWire.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js +1239 -1261
- package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js +102 -43
- package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/XDM.js +8 -3
- package/dist/cjs/src/wallet/substrates/XDM.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/window.CWI.js +28 -28
- package/dist/cjs/src/wallet/substrates/window.CWI.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/mod.js +15 -15
- package/dist/esm/src/auth/Peer.js +75 -54
- package/dist/esm/src/auth/Peer.js.map +1 -1
- package/dist/esm/src/auth/SessionManager.js +14 -9
- package/dist/esm/src/auth/SessionManager.js.map +1 -1
- package/dist/esm/src/auth/certificates/Certificate.js +15 -11
- package/dist/esm/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/esm/src/auth/certificates/MasterCertificate.js +25 -23
- package/dist/esm/src/auth/certificates/MasterCertificate.js.map +1 -1
- package/dist/esm/src/auth/certificates/VerifiableCertificate.js +2 -2
- package/dist/esm/src/auth/certificates/VerifiableCertificate.js.map +1 -1
- package/dist/esm/src/auth/certificates/__tests/CompletedProtoWallet.js +64 -47
- package/dist/esm/src/auth/certificates/__tests/CompletedProtoWallet.js.map +1 -1
- package/dist/esm/src/auth/clients/AuthFetch.js +1 -0
- package/dist/esm/src/auth/clients/AuthFetch.js.map +1 -1
- package/dist/esm/src/auth/transports/SimplifiedFetchTransport.js +69 -43
- package/dist/esm/src/auth/transports/SimplifiedFetchTransport.js.map +1 -1
- package/dist/esm/src/auth/utils/createNonce.js.map +1 -1
- package/dist/esm/src/auth/utils/getVerifiableCertificates.js +1 -1
- package/dist/esm/src/auth/utils/getVerifiableCertificates.js.map +1 -1
- package/dist/esm/src/auth/utils/validateCertificates.js +6 -3
- package/dist/esm/src/auth/utils/validateCertificates.js.map +1 -1
- package/dist/esm/src/auth/utils/verifyNonce.js.map +1 -1
- package/dist/esm/src/compat/BSM.js.map +1 -1
- package/dist/esm/src/compat/ECIES.js +165 -116
- package/dist/esm/src/compat/ECIES.js.map +1 -1
- package/dist/esm/src/compat/HD.js +56 -56
- package/dist/esm/src/compat/HD.js.map +1 -1
- package/dist/esm/src/compat/Mnemonic.js +95 -89
- package/dist/esm/src/compat/Mnemonic.js.map +1 -1
- package/dist/esm/src/compat/Utxo.js +1 -1
- package/dist/esm/src/compat/Utxo.js.map +1 -1
- package/dist/esm/src/messages/EncryptedMessage.js +3 -1
- package/dist/esm/src/messages/EncryptedMessage.js.map +1 -1
- package/dist/esm/src/messages/SignedMessage.js +1 -0
- package/dist/esm/src/messages/SignedMessage.js.map +1 -1
- package/dist/esm/src/overlay-tools/LookupResolver.js +53 -35
- package/dist/esm/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/esm/src/overlay-tools/OverlayAdminTokenTemplate.js +32 -20
- package/dist/esm/src/overlay-tools/OverlayAdminTokenTemplate.js.map +1 -1
- package/dist/esm/src/overlay-tools/SHIPBroadcaster.js +40 -28
- package/dist/esm/src/overlay-tools/SHIPBroadcaster.js.map +1 -1
- package/dist/esm/src/primitives/AESGCM.js +1 -0
- package/dist/esm/src/primitives/AESGCM.js.map +1 -1
- package/dist/esm/src/primitives/BasePoint.js +1 -1
- package/dist/esm/src/primitives/BasePoint.js.map +1 -1
- package/dist/esm/src/primitives/BigNumber.js +50 -62
- package/dist/esm/src/primitives/BigNumber.js.map +1 -1
- package/dist/esm/src/primitives/Curve.js +45 -22
- package/dist/esm/src/primitives/Curve.js.map +1 -1
- package/dist/esm/src/primitives/DRBG.js +2 -8
- package/dist/esm/src/primitives/DRBG.js.map +1 -1
- package/dist/esm/src/primitives/ECDSA.js +50 -35
- package/dist/esm/src/primitives/ECDSA.js.map +1 -1
- package/dist/esm/src/primitives/Hash.js +188 -213
- package/dist/esm/src/primitives/Hash.js.map +1 -1
- package/dist/esm/src/primitives/JacobianPoint.js +18 -5
- package/dist/esm/src/primitives/JacobianPoint.js.map +1 -1
- package/dist/esm/src/primitives/K256.js.map +1 -1
- package/dist/esm/src/primitives/Mersenne.js.map +1 -1
- package/dist/esm/src/primitives/MontgomoryMethod.js.map +1 -1
- package/dist/esm/src/primitives/Point.js +107 -88
- package/dist/esm/src/primitives/Point.js.map +1 -1
- package/dist/esm/src/primitives/Polynomial.js +4 -2
- package/dist/esm/src/primitives/Polynomial.js.map +1 -1
- package/dist/esm/src/primitives/PrivateKey.js +25 -16
- package/dist/esm/src/primitives/PrivateKey.js.map +1 -1
- package/dist/esm/src/primitives/PublicKey.js.map +1 -1
- package/dist/esm/src/primitives/Random.js +7 -6
- package/dist/esm/src/primitives/Random.js.map +1 -1
- package/dist/esm/src/primitives/ReductionContext.js +1 -1
- package/dist/esm/src/primitives/ReductionContext.js.map +1 -1
- package/dist/esm/src/primitives/Schnorr.js +21 -15
- package/dist/esm/src/primitives/Schnorr.js.map +1 -1
- package/dist/esm/src/primitives/Signature.js +8 -7
- package/dist/esm/src/primitives/Signature.js.map +1 -1
- package/dist/esm/src/primitives/SymmetricKey.js +13 -13
- package/dist/esm/src/primitives/SymmetricKey.js.map +1 -1
- package/dist/esm/src/primitives/TransactionSignature.js +22 -12
- package/dist/esm/src/primitives/TransactionSignature.js.map +1 -1
- package/dist/esm/src/primitives/utils.js +76 -66
- package/dist/esm/src/primitives/utils.js.map +1 -1
- package/dist/esm/src/script/OP.js +3 -3
- package/dist/esm/src/script/OP.js.map +1 -1
- package/dist/esm/src/script/Script.js +12 -10
- package/dist/esm/src/script/Script.js.map +1 -1
- package/dist/esm/src/script/Spend.js +39 -32
- package/dist/esm/src/script/Spend.js.map +1 -1
- package/dist/esm/src/script/templates/P2PKH.js +26 -11
- package/dist/esm/src/script/templates/P2PKH.js.map +1 -1
- package/dist/esm/src/script/templates/PushDrop.js +29 -22
- package/dist/esm/src/script/templates/PushDrop.js.map +1 -1
- package/dist/esm/src/script/templates/RPuzzle.js +11 -6
- package/dist/esm/src/script/templates/RPuzzle.js.map +1 -1
- package/dist/esm/src/totp/totp.js +2 -1
- package/dist/esm/src/totp/totp.js.map +1 -1
- package/dist/esm/src/transaction/Beef.js +176 -154
- package/dist/esm/src/transaction/Beef.js.map +1 -1
- package/dist/esm/src/transaction/BeefParty.js +24 -24
- package/dist/esm/src/transaction/BeefParty.js.map +1 -1
- package/dist/esm/src/transaction/BeefTx.js +26 -18
- package/dist/esm/src/transaction/BeefTx.js.map +1 -1
- package/dist/esm/src/transaction/Broadcaster.js.map +1 -1
- package/dist/esm/src/transaction/MerklePath.js +61 -36
- package/dist/esm/src/transaction/MerklePath.js.map +1 -1
- package/dist/esm/src/transaction/Transaction.js +105 -138
- package/dist/esm/src/transaction/Transaction.js.map +1 -1
- package/dist/esm/src/transaction/broadcasters/ARC.js +25 -16
- package/dist/esm/src/transaction/broadcasters/ARC.js.map +1 -1
- package/dist/esm/src/transaction/broadcasters/DefaultBroadcaster.js.map +1 -1
- package/dist/esm/src/transaction/broadcasters/WhatsOnChainBroadcaster.js.map +1 -1
- package/dist/esm/src/transaction/chaintrackers/WhatsOnChain.js +3 -3
- package/dist/esm/src/transaction/chaintrackers/WhatsOnChain.js.map +1 -1
- package/dist/esm/src/transaction/fee-models/SatoshisPerKilobyte.js.map +1 -1
- package/dist/esm/src/transaction/http/DefaultHttpClient.js +3 -2
- package/dist/esm/src/transaction/http/DefaultHttpClient.js.map +1 -1
- package/dist/esm/src/transaction/http/FetchHttpClient.js +4 -2
- package/dist/esm/src/transaction/http/FetchHttpClient.js.map +1 -1
- package/dist/esm/src/transaction/http/NodejsHttpClient.js +5 -3
- package/dist/esm/src/transaction/http/NodejsHttpClient.js.map +1 -1
- package/dist/esm/src/transaction/http/index.js.map +1 -1
- package/dist/esm/src/transaction/index.js.map +1 -1
- package/dist/esm/src/wallet/CachedKeyDeriver.js +91 -66
- package/dist/esm/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/KeyDeriver.js +60 -52
- package/dist/esm/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/ProtoWallet.js +75 -29
- package/dist/esm/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/esm/src/wallet/WalletClient.js +7 -2
- package/dist/esm/src/wallet/WalletClient.js.map +1 -1
- package/dist/esm/src/wallet/WalletError.js +2 -2
- package/dist/esm/src/wallet/WalletError.js.map +1 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js +4 -4
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletWire.js +2 -2
- package/dist/esm/src/wallet/substrates/HTTPWalletWire.js.map +1 -1
- package/dist/esm/src/wallet/substrates/WalletWireProcessor.js +1239 -1261
- package/dist/esm/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
- package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js +95 -43
- package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
- package/dist/esm/src/wallet/substrates/XDM.js +8 -3
- package/dist/esm/src/wallet/substrates/XDM.js.map +1 -1
- package/dist/esm/src/wallet/substrates/window.CWI.js +28 -28
- package/dist/esm/src/wallet/substrates/window.CWI.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/mod.d.ts +15 -15
- package/dist/types/src/auth/Peer.d.ts +10 -10
- package/dist/types/src/auth/Peer.d.ts.map +1 -1
- package/dist/types/src/auth/SessionManager.d.ts +4 -4
- package/dist/types/src/auth/SessionManager.d.ts.map +1 -1
- package/dist/types/src/auth/certificates/Certificate.d.ts +6 -6
- package/dist/types/src/auth/certificates/Certificate.d.ts.map +1 -1
- package/dist/types/src/auth/certificates/MasterCertificate.d.ts +5 -5
- package/dist/types/src/auth/certificates/MasterCertificate.d.ts.map +1 -1
- package/dist/types/src/auth/certificates/VerifiableCertificate.d.ts.map +1 -1
- package/dist/types/src/auth/certificates/__tests/CompletedProtoWallet.d.ts +23 -22
- package/dist/types/src/auth/certificates/__tests/CompletedProtoWallet.d.ts.map +1 -1
- package/dist/types/src/auth/clients/AuthFetch.d.ts.map +1 -1
- package/dist/types/src/auth/transports/SimplifiedFetchTransport.d.ts +1 -1
- package/dist/types/src/auth/transports/SimplifiedFetchTransport.d.ts.map +1 -1
- package/dist/types/src/auth/utils/createNonce.d.ts.map +1 -1
- package/dist/types/src/auth/utils/getVerifiableCertificates.d.ts +3 -3
- package/dist/types/src/auth/utils/getVerifiableCertificates.d.ts.map +1 -1
- package/dist/types/src/auth/utils/validateCertificates.d.ts +2 -2
- package/dist/types/src/auth/utils/validateCertificates.d.ts.map +1 -1
- package/dist/types/src/auth/utils/verifyNonce.d.ts +1 -1
- package/dist/types/src/auth/utils/verifyNonce.d.ts.map +1 -1
- package/dist/types/src/compat/BSM.d.ts +1 -1
- package/dist/types/src/compat/BSM.d.ts.map +1 -1
- package/dist/types/src/compat/ECIES.d.ts +36 -36
- package/dist/types/src/compat/ECIES.d.ts.map +1 -1
- package/dist/types/src/compat/HD.d.ts +51 -51
- package/dist/types/src/compat/HD.d.ts.map +1 -1
- package/dist/types/src/compat/Mnemonic.d.ts +79 -79
- package/dist/types/src/compat/Mnemonic.d.ts.map +1 -1
- package/dist/types/src/compat/Utxo.d.ts.map +1 -1
- package/dist/types/src/messages/EncryptedMessage.d.ts.map +1 -1
- package/dist/types/src/messages/SignedMessage.d.ts.map +1 -1
- package/dist/types/src/overlay-tools/LookupResolver.d.ts +9 -9
- package/dist/types/src/overlay-tools/LookupResolver.d.ts.map +1 -1
- package/dist/types/src/overlay-tools/OverlayAdminTokenTemplate.d.ts +17 -17
- package/dist/types/src/overlay-tools/OverlayAdminTokenTemplate.d.ts.map +1 -1
- package/dist/types/src/overlay-tools/SHIPBroadcaster.d.ts +14 -14
- package/dist/types/src/overlay-tools/SHIPBroadcaster.d.ts.map +1 -1
- package/dist/types/src/primitives/AESGCM.d.ts.map +1 -1
- package/dist/types/src/primitives/BasePoint.d.ts +8 -8
- package/dist/types/src/primitives/BasePoint.d.ts.map +1 -1
- package/dist/types/src/primitives/BigNumber.d.ts.map +1 -1
- package/dist/types/src/primitives/Curve.d.ts +14 -7
- package/dist/types/src/primitives/Curve.d.ts.map +1 -1
- package/dist/types/src/primitives/DRBG.d.ts.map +1 -1
- package/dist/types/src/primitives/ECDSA.d.ts +1 -1
- package/dist/types/src/primitives/ECDSA.d.ts.map +1 -1
- package/dist/types/src/primitives/Hash.d.ts +11 -11
- package/dist/types/src/primitives/Hash.d.ts.map +1 -1
- package/dist/types/src/primitives/JacobianPoint.d.ts.map +1 -1
- package/dist/types/src/primitives/Point.d.ts +14 -10
- package/dist/types/src/primitives/Point.d.ts.map +1 -1
- package/dist/types/src/primitives/Polynomial.d.ts.map +1 -1
- package/dist/types/src/primitives/PrivateKey.d.ts +2 -2
- package/dist/types/src/primitives/PrivateKey.d.ts.map +1 -1
- package/dist/types/src/primitives/PublicKey.d.ts.map +1 -1
- package/dist/types/src/primitives/Random.d.ts.map +1 -1
- package/dist/types/src/primitives/Schnorr.d.ts +14 -14
- package/dist/types/src/primitives/Schnorr.d.ts.map +1 -1
- package/dist/types/src/primitives/Signature.d.ts +1 -1
- package/dist/types/src/primitives/Signature.d.ts.map +1 -1
- package/dist/types/src/primitives/SymmetricKey.d.ts +13 -13
- package/dist/types/src/primitives/SymmetricKey.d.ts.map +1 -1
- package/dist/types/src/primitives/TransactionSignature.d.ts +4 -4
- package/dist/types/src/primitives/TransactionSignature.d.ts.map +1 -1
- package/dist/types/src/primitives/utils.d.ts +3 -6
- package/dist/types/src/primitives/utils.d.ts.map +1 -1
- package/dist/types/src/script/Script.d.ts +3 -3
- package/dist/types/src/script/Script.d.ts.map +1 -1
- package/dist/types/src/script/ScriptTemplate.d.ts +2 -2
- package/dist/types/src/script/ScriptTemplate.d.ts.map +1 -1
- package/dist/types/src/script/Spend.d.ts.map +1 -1
- package/dist/types/src/script/templates/P2PKH.d.ts.map +1 -1
- package/dist/types/src/script/templates/PushDrop.d.ts +1 -2
- package/dist/types/src/script/templates/PushDrop.d.ts.map +1 -1
- package/dist/types/src/script/templates/RPuzzle.d.ts.map +1 -1
- package/dist/types/src/totp/totp.d.ts.map +1 -1
- package/dist/types/src/transaction/Beef.d.ts +96 -96
- package/dist/types/src/transaction/Beef.d.ts.map +1 -1
- package/dist/types/src/transaction/BeefParty.d.ts +22 -22
- package/dist/types/src/transaction/BeefParty.d.ts.map +1 -1
- package/dist/types/src/transaction/BeefTx.d.ts +5 -5
- package/dist/types/src/transaction/BeefTx.d.ts.map +1 -1
- package/dist/types/src/transaction/Broadcaster.d.ts.map +1 -1
- package/dist/types/src/transaction/ChainTracker.d.ts +2 -2
- package/dist/types/src/transaction/FeeModel.d.ts.map +1 -1
- package/dist/types/src/transaction/MerklePath.d.ts.map +1 -1
- package/dist/types/src/transaction/Transaction.d.ts +4 -12
- package/dist/types/src/transaction/Transaction.d.ts.map +1 -1
- package/dist/types/src/transaction/TransactionOutput.d.ts.map +1 -1
- package/dist/types/src/transaction/broadcasters/ARC.d.ts +1 -1
- package/dist/types/src/transaction/broadcasters/ARC.d.ts.map +1 -1
- package/dist/types/src/transaction/broadcasters/DefaultBroadcaster.d.ts.map +1 -1
- package/dist/types/src/transaction/broadcasters/WhatsOnChainBroadcaster.d.ts.map +1 -1
- package/dist/types/src/transaction/chaintrackers/DefaultChainTracker.d.ts.map +1 -1
- package/dist/types/src/transaction/chaintrackers/WhatsOnChain.d.ts.map +1 -1
- package/dist/types/src/transaction/fee-models/SatoshisPerKilobyte.d.ts.map +1 -1
- package/dist/types/src/transaction/http/DefaultHttpClient.d.ts +1 -1
- package/dist/types/src/transaction/http/DefaultHttpClient.d.ts.map +1 -1
- package/dist/types/src/transaction/http/FetchHttpClient.d.ts +5 -5
- package/dist/types/src/transaction/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/types/src/transaction/http/HttpClient.d.ts +4 -4
- package/dist/types/src/transaction/http/HttpClient.d.ts.map +1 -1
- package/dist/types/src/transaction/http/NodejsHttpClient.d.ts +3 -3
- package/dist/types/src/transaction/http/NodejsHttpClient.d.ts.map +1 -1
- package/dist/types/src/transaction/http/index.d.ts.map +1 -1
- package/dist/types/src/transaction/index.d.ts.map +1 -1
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts +58 -58
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/KeyDeriver.d.ts +78 -78
- package/dist/types/src/wallet/KeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/ProtoWallet.d.ts +10 -10
- package/dist/types/src/wallet/ProtoWallet.d.ts.map +1 -1
- package/dist/types/src/wallet/Wallet.interfaces.d.ts +151 -152
- package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -1
- package/dist/types/src/wallet/WalletClient.d.ts +5 -5
- package/dist/types/src/wallet/WalletClient.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts +6 -6
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletWire.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/WalletWireProcessor.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/XDM.d.ts +1 -1
- package/dist/types/src/wallet/substrates/XDM.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/window.CWI.d.ts +6 -6
- package/dist/types/src/wallet/substrates/window.CWI.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/auth.md +92 -82
- package/docs/compat.md +24 -24
- package/docs/messages.md +7 -5
- package/docs/overlay-tools.md +21 -21
- package/docs/primitives.md +336 -315
- package/docs/script.md +35 -35
- package/docs/swagger/dist/swagger-initializer.js +7 -7
- package/docs/swagger/dist/swagger-ui-bundle.js +1 -1
- package/docs/swagger/dist/swagger-ui-es-bundle-core.js +2 -2
- package/docs/swagger/dist/swagger-ui-es-bundle.js +1 -1
- package/docs/swagger/dist/swagger-ui-standalone-preset.js +1 -1
- package/docs/swagger/dist/swagger-ui.js +2 -2
- package/docs/totp.md +5 -5
- package/docs/transaction.md +103 -105
- package/docs/wallet-substrates.md +17 -17
- package/docs/wallet.md +202 -204
- package/mod.ts +15 -15
- package/package.json +15 -3
- package/src/auth/Peer.ts +271 -121
- package/src/auth/SessionManager.ts +17 -10
- package/src/auth/__tests/Peer.test.ts +361 -179
- package/src/auth/__tests/SessionManager.test.ts +67 -19
- package/src/auth/__tests/build.test.ts +11 -0
- package/src/auth/certificates/Certificate.ts +27 -14
- package/src/auth/certificates/MasterCertificate.ts +106 -62
- package/src/auth/certificates/VerifiableCertificate.ts +30 -8
- package/src/auth/certificates/__tests/Certificate.test.ts +32 -17
- package/src/auth/certificates/__tests/CompletedProtoWallet.ts +171 -68
- package/src/auth/certificates/__tests/MasterCertificate.test.ts +63 -47
- package/src/auth/certificates/__tests/VerifiableCertificate.test.ts +42 -31
- package/src/auth/certificates/index.ts +1 -1
- package/src/auth/clients/AuthFetch.ts +1 -0
- package/src/auth/clients/index.ts +1 -1
- package/src/auth/transports/SimplifiedFetchTransport.ts +145 -72
- package/src/auth/transports/index.ts +1 -1
- package/src/auth/utils/__tests/cryptononce.test.ts +52 -23
- package/src/auth/utils/__tests/getVerifiableCertificates.test.ts +56 -30
- package/src/auth/utils/__tests/validateCertificates.test.ts +53 -31
- package/src/auth/utils/createNonce.ts +11 -3
- package/src/auth/utils/getVerifiableCertificates.ts +12 -7
- package/src/auth/utils/validateCertificates.ts +57 -39
- package/src/auth/utils/verifyNonce.ts +6 -2
- package/src/compat/BSM.ts +10 -2
- package/src/compat/ECIES.ts +265 -141
- package/src/compat/HD.ts +81 -63
- package/src/compat/Mnemonic.ts +104 -91
- package/src/compat/Utxo.ts +8 -5
- package/src/compat/__tests/BSM.test.ts +42 -16
- package/src/compat/__tests/ECIES.test.ts +117 -52
- package/src/compat/__tests/HD.test.ts +55 -42
- package/src/compat/__tests/Mnemonic.test.ts +11 -12
- package/src/compat/__tests/Mnemonic.vectors.ts +110 -55
- package/src/messages/EncryptedMessage.ts +6 -2
- package/src/messages/SignedMessage.ts +14 -8
- package/src/messages/__tests/EncryptedMessage.test.ts +23 -24
- package/src/messages/__tests/SignedMessage.test.ts +17 -11
- package/src/overlay-tools/LookupResolver.ts +108 -56
- package/src/overlay-tools/OverlayAdminTokenTemplate.ts +52 -23
- package/src/overlay-tools/SHIPBroadcaster.ts +135 -59
- package/src/overlay-tools/__tests/LookupResolver.test.ts +723 -323
- package/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.ts +50 -22
- package/src/overlay-tools/__tests/SHIPBroadcaster.test.ts +607 -290
- package/src/primitives/AESGCM.ts +2 -0
- package/src/primitives/BasePoint.ts +4 -4
- package/src/primitives/BigNumber.ts +99 -90
- package/src/primitives/Curve.ts +117 -46
- package/src/primitives/DRBG.ts +9 -11
- package/src/primitives/ECDSA.ts +109 -63
- package/src/primitives/Hash.ts +492 -321
- package/src/primitives/JacobianPoint.ts +67 -19
- package/src/primitives/Point.ts +254 -152
- package/src/primitives/Polynomial.ts +8 -3
- package/src/primitives/PrivateKey.ts +41 -17
- package/src/primitives/PublicKey.ts +13 -3
- package/src/primitives/Random.ts +14 -8
- package/src/primitives/ReductionContext.ts +1 -1
- package/src/primitives/Schnorr.ts +40 -18
- package/src/primitives/Signature.ts +26 -16
- package/src/primitives/SymmetricKey.ts +14 -14
- package/src/primitives/TransactionSignature.ts +41 -17
- package/src/primitives/__tests/AESGCM.test.ts +457 -151
- package/src/primitives/__tests/BRC42.private.vectors.ts +30 -15
- package/src/primitives/__tests/BRC42.public.vectors.ts +30 -15
- package/src/primitives/__tests/BigNumber.arithmatic.test.ts +344 -125
- package/src/primitives/__tests/BigNumber.binary.test.ts +148 -67
- package/src/primitives/__tests/BigNumber.constructor.test.ts +65 -25
- package/src/primitives/__tests/BigNumber.dhGroup.test.ts +15 -11
- package/src/primitives/__tests/BigNumber.fixtures.ts +16 -8
- package/src/primitives/__tests/BigNumber.serializers.test.ts +41 -15
- package/src/primitives/__tests/BigNumber.utils.test.ts +132 -42
- package/src/primitives/__tests/Curve.unit.test.ts +75 -53
- package/src/primitives/__tests/DRBG.test.ts +1 -1
- package/src/primitives/__tests/DRBG.vectors.ts +45 -75
- package/src/primitives/__tests/ECDH.test.ts +15 -8
- package/src/primitives/__tests/ECDSA.test.ts +12 -6
- package/src/primitives/__tests/HMAC.test.ts +24 -18
- package/src/primitives/__tests/Hash.test.ts +57 -46
- package/src/primitives/__tests/PBKDF2.vectors.ts +130 -117
- package/src/primitives/__tests/PrivateKey.split.test.ts +33 -11
- package/src/primitives/__tests/PrivateKey.test.ts +11 -10
- package/src/primitives/__tests/PublicKey.test.ts +64 -53
- package/src/primitives/__tests/Random.test.ts +1 -1
- package/src/primitives/__tests/Reader.test.ts +240 -219
- package/src/primitives/__tests/ReductionContext.test.ts +98 -61
- package/src/primitives/__tests/Schnorr.test.ts +249 -237
- package/src/primitives/__tests/SymmetricKey.test.ts +18 -15
- package/src/primitives/__tests/SymmetricKey.vectors.ts +16 -8
- package/src/primitives/__tests/Writer.test.ts +23 -13
- package/src/primitives/__tests/bug-31.test.ts +6 -10
- package/src/primitives/__tests/utils.test.ts +70 -19
- package/src/primitives/utils.ts +103 -79
- package/src/script/Script.ts +18 -12
- package/src/script/ScriptTemplate.ts +3 -5
- package/src/script/Spend.ts +306 -108
- package/src/script/__tests/Script.test.ts +73 -55
- package/src/script/__tests/Spend.test.ts +208 -83
- package/src/script/__tests/SpendComplex.test.ts +19 -13
- package/src/script/__tests/script.invalid.vectors.ts +428 -1796
- package/src/script/__tests/script.valid.vectors.ts +728 -2764
- package/src/script/templates/P2PKH.ts +34 -12
- package/src/script/templates/PushDrop.ts +65 -31
- package/src/script/templates/RPuzzle.ts +29 -8
- package/src/script/templates/__tests/PushDrop.test.ts +146 -41
- package/src/totp/__tests/totp.test.ts +45 -44
- package/src/totp/totp.ts +3 -2
- package/src/transaction/Beef.ts +269 -174
- package/src/transaction/BeefParty.ts +41 -31
- package/src/transaction/BeefTx.ts +36 -26
- package/src/transaction/Broadcaster.ts +10 -6
- package/src/transaction/ChainTracker.ts +2 -2
- package/src/transaction/FeeModel.ts +0 -1
- package/src/transaction/MerklePath.ts +124 -59
- package/src/transaction/Transaction.ts +188 -187
- package/src/transaction/TransactionOutput.ts +0 -1
- package/src/transaction/__tests/Beef.test.ts +390 -287
- package/src/transaction/__tests/MerklePath.test.ts +59 -26
- package/src/transaction/__tests/Transaction.benchmarks.test.ts +231 -201
- package/src/transaction/__tests/Transaction.test.ts +758 -482
- package/src/transaction/__tests/bigtx.vectors.ts +2 -1
- package/src/transaction/__tests/bump.invalid.vectors.ts +24 -6
- package/src/transaction/__tests/bump.valid.vectors.ts +6 -2
- package/src/transaction/__tests/tx.invalid.vectors.ts +881 -185
- package/src/transaction/__tests/tx.valid.vectors.ts +1210 -257
- package/src/transaction/broadcasters/ARC.ts +69 -38
- package/src/transaction/broadcasters/DefaultBroadcaster.ts +9 -3
- package/src/transaction/broadcasters/WhatsOnChainBroadcaster.ts +20 -7
- package/src/transaction/broadcasters/__tests/ARC.test.ts +127 -59
- package/src/transaction/broadcasters/__tests/WhatsOnChainBroadcaster.test.ts +27 -18
- package/src/transaction/chaintrackers/DefaultChainTracker.ts +1 -1
- package/src/transaction/chaintrackers/WhatsOnChain.ts +27 -11
- package/src/transaction/chaintrackers/__tests/WhatsOnChainChainTracker.test.ts +59 -23
- package/src/transaction/fee-models/SatoshisPerKilobyte.ts +9 -5
- package/src/transaction/http/DefaultHttpClient.ts +5 -4
- package/src/transaction/http/FetchHttpClient.ts +18 -9
- package/src/transaction/http/HttpClient.ts +27 -22
- package/src/transaction/http/NodejsHttpClient.ts +23 -9
- package/src/transaction/http/index.ts +5 -1
- package/src/transaction/index.ts +5 -1
- package/src/wallet/CachedKeyDeriver.ts +151 -82
- package/src/wallet/KeyDeriver.ts +186 -105
- package/src/wallet/ProtoWallet.ts +121 -52
- package/src/wallet/Wallet.interfaces.ts +167 -156
- package/src/wallet/WalletClient.ts +314 -59
- package/src/wallet/WalletError.ts +2 -2
- package/src/wallet/__tests/CachedKeyDeriver.test.ts +86 -27
- package/src/wallet/__tests/KeyDeriver.test.ts +136 -33
- package/src/wallet/__tests/ProtoWallet.test.ts +190 -102
- package/src/wallet/substrates/HTTPWalletJSON.ts +250 -67
- package/src/wallet/substrates/HTTPWalletWire.ts +7 -3
- package/src/wallet/substrates/WalletWireCalls.ts +2 -2
- package/src/wallet/substrates/WalletWireProcessor.ts +1412 -1277
- package/src/wallet/substrates/WalletWireTransceiver.ts +713 -138
- package/src/wallet/substrates/XDM.ts +425 -36
- package/src/wallet/substrates/__tests/WalletWire.integration.test.ts +488 -225
- package/src/wallet/substrates/__tests/XDM.test.ts +232 -234
- package/src/wallet/substrates/window.CWI.ts +520 -61
package/docs/transaction.md
CHANGED
|
@@ -34,7 +34,7 @@ export interface ArcConfig {
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
See also: [HttpClient](#interface-httpclient)
|
|
37
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
38
38
|
|
|
39
39
|
<details>
|
|
40
40
|
|
|
@@ -87,7 +87,7 @@ The HTTP client used to make requests to the ARC API.
|
|
|
87
87
|
```ts
|
|
88
88
|
httpClient?: HttpClient
|
|
89
89
|
```
|
|
90
|
-
See also: [HttpClient](#interface-httpclient)
|
|
90
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
91
91
|
|
|
92
92
|
</details>
|
|
93
93
|
|
|
@@ -139,7 +139,7 @@ export interface Broadcaster {
|
|
|
139
139
|
}
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Transaction](#class-transaction)
|
|
142
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Transaction](./transaction.md#class-transaction)
|
|
143
143
|
|
|
144
144
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
145
145
|
|
|
@@ -161,8 +161,8 @@ const chainTracker = {
|
|
|
161
161
|
// Implementation to check if the Merkle root is valid for the specified block height.
|
|
162
162
|
}
|
|
163
163
|
currentHeight: async () => {
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
// Implementation to get the current block height.
|
|
165
|
+
}
|
|
166
166
|
};
|
|
167
167
|
```
|
|
168
168
|
|
|
@@ -187,7 +187,7 @@ export default interface FeeModel {
|
|
|
187
187
|
}
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
See also: [Transaction](#class-transaction)
|
|
190
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
191
191
|
|
|
192
192
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
193
193
|
|
|
@@ -248,7 +248,7 @@ export interface HttpClient {
|
|
|
248
248
|
}
|
|
249
249
|
```
|
|
250
250
|
|
|
251
|
-
See also: [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse)
|
|
251
|
+
See also: [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse)
|
|
252
252
|
|
|
253
253
|
<details>
|
|
254
254
|
|
|
@@ -261,7 +261,7 @@ Makes a request to the server.
|
|
|
261
261
|
```ts
|
|
262
262
|
request: <T = any, D = any>(url: string, options: HttpClientRequestOptions<D>) => Promise<HttpClientResponse<T>>
|
|
263
263
|
```
|
|
264
|
-
See also: [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse)
|
|
264
|
+
See also: [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse)
|
|
265
265
|
|
|
266
266
|
</details>
|
|
267
267
|
|
|
@@ -315,7 +315,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
315
315
|
---
|
|
316
316
|
### Interface: HttpsNodejs
|
|
317
317
|
|
|
318
|
-
Node
|
|
318
|
+
Node Https module interface limited to options needed by ts-sdk
|
|
319
319
|
|
|
320
320
|
```ts
|
|
321
321
|
export interface HttpsNodejs {
|
|
@@ -323,7 +323,7 @@ export interface HttpsNodejs {
|
|
|
323
323
|
}
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
See also: [HttpClientRequestOptions](#interface-httpclientrequestoptions), [NodejsHttpClientRequest](#interface-nodejshttpclientrequest)
|
|
326
|
+
See also: [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [NodejsHttpClientRequest](./transaction.md#interface-nodejshttpclientrequest)
|
|
327
327
|
|
|
328
328
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
329
329
|
|
|
@@ -344,7 +344,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
344
344
|
---
|
|
345
345
|
### Interface: NodejsHttpClientRequest
|
|
346
346
|
|
|
347
|
-
Nodejs result of the Node
|
|
347
|
+
Nodejs result of the Node https.request call limited to options needed by ts-sdk
|
|
348
348
|
|
|
349
349
|
```ts
|
|
350
350
|
export interface NodejsHttpClientRequest {
|
|
@@ -394,7 +394,7 @@ export default interface TransactionInput {
|
|
|
394
394
|
}
|
|
395
395
|
```
|
|
396
396
|
|
|
397
|
-
See also: [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
|
|
397
|
+
See also: [Transaction](./transaction.md#class-transaction), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
|
|
398
398
|
|
|
399
399
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
400
400
|
|
|
@@ -424,7 +424,7 @@ export default interface TransactionOutput {
|
|
|
424
424
|
}
|
|
425
425
|
```
|
|
426
426
|
|
|
427
|
-
See also: [LockingScript](#class-lockingscript)
|
|
427
|
+
See also: [LockingScript](./script.md#class-lockingscript)
|
|
428
428
|
|
|
429
429
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
430
430
|
|
|
@@ -440,7 +440,7 @@ export interface WhatsOnChainConfig {
|
|
|
440
440
|
}
|
|
441
441
|
```
|
|
442
442
|
|
|
443
|
-
See also: [HttpClient](#interface-httpclient)
|
|
443
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
444
444
|
|
|
445
445
|
<details>
|
|
446
446
|
|
|
@@ -461,7 +461,7 @@ The HTTP client used to make requests to the API.
|
|
|
461
461
|
```ts
|
|
462
462
|
httpClient?: HttpClient
|
|
463
463
|
```
|
|
464
|
-
See also: [HttpClient](#interface-httpclient)
|
|
464
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
465
465
|
|
|
466
466
|
</details>
|
|
467
467
|
|
|
@@ -503,11 +503,11 @@ export default class ARC implements Broadcaster {
|
|
|
503
503
|
constructor(URL: string, apiKey?: string);
|
|
504
504
|
constructor(URL: string, config?: string | ArcConfig)
|
|
505
505
|
async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
|
|
506
|
-
async broadcastMany(txs: Transaction[]): Promise<
|
|
506
|
+
async broadcastMany(txs: Transaction[]): Promise<object[]>
|
|
507
507
|
}
|
|
508
508
|
```
|
|
509
509
|
|
|
510
|
-
See also: [ArcConfig](#interface-arcconfig), [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Broadcaster](#interface-broadcaster), [Transaction](#class-transaction)
|
|
510
|
+
See also: [ArcConfig](./transaction.md#interface-arcconfig), [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Broadcaster](./transaction.md#interface-broadcaster), [Transaction](./transaction.md#class-transaction)
|
|
511
511
|
|
|
512
512
|
<details>
|
|
513
513
|
|
|
@@ -520,7 +520,7 @@ Constructs an instance of the ARC broadcaster.
|
|
|
520
520
|
```ts
|
|
521
521
|
constructor(URL: string, config?: ArcConfig)
|
|
522
522
|
```
|
|
523
|
-
See also: [ArcConfig](#interface-arcconfig)
|
|
523
|
+
See also: [ArcConfig](./transaction.md#interface-arcconfig)
|
|
524
524
|
|
|
525
525
|
Argument Details
|
|
526
526
|
|
|
@@ -551,7 +551,7 @@ Broadcasts a transaction via ARC.
|
|
|
551
551
|
```ts
|
|
552
552
|
async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
|
|
553
553
|
```
|
|
554
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Transaction](#class-transaction)
|
|
554
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Transaction](./transaction.md#class-transaction)
|
|
555
555
|
|
|
556
556
|
Returns
|
|
557
557
|
|
|
@@ -568,9 +568,9 @@ Broadcasts multiple transactions via ARC.
|
|
|
568
568
|
Handles mixed responses where some transactions succeed and others fail.
|
|
569
569
|
|
|
570
570
|
```ts
|
|
571
|
-
async broadcastMany(txs: Transaction[]): Promise<
|
|
571
|
+
async broadcastMany(txs: Transaction[]): Promise<object[]>
|
|
572
572
|
```
|
|
573
|
-
See also: [Transaction](#class-transaction)
|
|
573
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
574
574
|
|
|
575
575
|
Returns
|
|
576
576
|
|
|
@@ -603,15 +603,15 @@ export class Beef {
|
|
|
603
603
|
mergeBump(bump: MerklePath): number
|
|
604
604
|
mergeRawTx(rawTx: number[], bumpIndex?: number): BeefTx
|
|
605
605
|
mergeTransaction(tx: Transaction): BeefTx
|
|
606
|
-
removeExistingTxid(txid: string)
|
|
606
|
+
removeExistingTxid(txid: string): void
|
|
607
607
|
mergeTxidOnly(txid: string): BeefTx
|
|
608
608
|
mergeBeefTx(btx: BeefTx): BeefTx
|
|
609
|
-
mergeBeef(beef: number[] | Beef)
|
|
609
|
+
mergeBeef(beef: number[] | Beef): void
|
|
610
610
|
isValid(allowTxidOnly?: boolean): boolean
|
|
611
611
|
async verify(chainTracker: ChainTracker, allowTxidOnly?: boolean): Promise<boolean>
|
|
612
|
-
toWriter(writer: Writer)
|
|
612
|
+
toWriter(writer: Writer): void
|
|
613
613
|
toBinary(): number[]
|
|
614
|
-
toBinaryAtomic(txid: string)
|
|
614
|
+
toBinaryAtomic(txid: string): number[]
|
|
615
615
|
toHex(): string
|
|
616
616
|
static fromReader(br: Reader): Beef
|
|
617
617
|
static fromBinary(bin: number[]): Beef
|
|
@@ -624,14 +624,14 @@ export class Beef {
|
|
|
624
624
|
txidOnly: string[];
|
|
625
625
|
}
|
|
626
626
|
clone(): Beef
|
|
627
|
-
trimKnownTxids(knownTxids: string[])
|
|
627
|
+
trimKnownTxids(knownTxids: string[]): void
|
|
628
628
|
getValidTxids(): string[]
|
|
629
629
|
toLogString(): string
|
|
630
|
-
addComputedLeaves()
|
|
630
|
+
addComputedLeaves(): void
|
|
631
631
|
}
|
|
632
632
|
```
|
|
633
633
|
|
|
634
|
-
See also: [BEEF_V2](#variable-beef_v2), [BeefTx](#class-beeftx), [ChainTracker](#interface-chaintracker), [MerklePath](#class-merklepath), [Reader](#class-reader), [Transaction](#class-transaction), [Writer](#class-writer), [toHex](#variable-tohex), [verify](#variable-verify)
|
|
634
|
+
See also: [BEEF_V2](./transaction.md#variable-beef_v2), [BeefTx](./transaction.md#class-beeftx), [ChainTracker](./transaction.md#interface-chaintracker), [MerklePath](./transaction.md#class-merklepath), [Reader](./primitives.md#class-reader), [Transaction](./transaction.md#class-transaction), [Writer](./primitives.md#class-writer), [toHex](./primitives.md#variable-tohex), [verify](./compat.md#variable-verify)
|
|
635
635
|
|
|
636
636
|
<details>
|
|
637
637
|
|
|
@@ -639,11 +639,11 @@ See also: [BEEF_V2](#variable-beef_v2), [BeefTx](#class-beeftx), [ChainTracker](
|
|
|
639
639
|
|
|
640
640
|
#### Method addComputedLeaves
|
|
641
641
|
|
|
642
|
-
In some circumstances it may be helpful for the BUMP
|
|
642
|
+
In some circumstances it may be helpful for the BUMP MerklePaths to include
|
|
643
643
|
leaves that can be computed from row zero.
|
|
644
644
|
|
|
645
645
|
```ts
|
|
646
|
-
addComputedLeaves()
|
|
646
|
+
addComputedLeaves(): void
|
|
647
647
|
```
|
|
648
648
|
|
|
649
649
|
#### Method clone
|
|
@@ -651,7 +651,7 @@ addComputedLeaves()
|
|
|
651
651
|
```ts
|
|
652
652
|
clone(): Beef
|
|
653
653
|
```
|
|
654
|
-
See also: [Beef](#class-beef)
|
|
654
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
655
655
|
|
|
656
656
|
Returns
|
|
657
657
|
|
|
@@ -666,7 +666,7 @@ To succeed, the Beef must contain all the required transaction and merkle path d
|
|
|
666
666
|
```ts
|
|
667
667
|
findAtomicTransaction(txid: string): Transaction | undefined
|
|
668
668
|
```
|
|
669
|
-
See also: [Transaction](#class-transaction)
|
|
669
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
670
670
|
|
|
671
671
|
Returns
|
|
672
672
|
|
|
@@ -682,7 +682,7 @@ Argument Details
|
|
|
682
682
|
```ts
|
|
683
683
|
findBump(txid: string): MerklePath | undefined
|
|
684
684
|
```
|
|
685
|
-
See also: [MerklePath](#class-merklepath)
|
|
685
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
686
686
|
|
|
687
687
|
Returns
|
|
688
688
|
|
|
@@ -698,7 +698,7 @@ The result is suitable for signing.
|
|
|
698
698
|
```ts
|
|
699
699
|
findTransactionForSigning(txid: string): Transaction | undefined
|
|
700
700
|
```
|
|
701
|
-
See also: [Transaction](#class-transaction)
|
|
701
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
702
702
|
|
|
703
703
|
Returns
|
|
704
704
|
|
|
@@ -714,7 +714,7 @@ Argument Details
|
|
|
714
714
|
```ts
|
|
715
715
|
findTxid(txid: string): BeefTx | undefined
|
|
716
716
|
```
|
|
717
|
-
See also: [BeefTx](#class-beeftx)
|
|
717
|
+
See also: [BeefTx](./transaction.md#class-beeftx)
|
|
718
718
|
|
|
719
719
|
Returns
|
|
720
720
|
|
|
@@ -732,7 +732,7 @@ Constructs an instance of the Beef class based on the provided binary array
|
|
|
732
732
|
```ts
|
|
733
733
|
static fromBinary(bin: number[]): Beef
|
|
734
734
|
```
|
|
735
|
-
See also: [Beef](#class-beef)
|
|
735
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
736
736
|
|
|
737
737
|
Returns
|
|
738
738
|
|
|
@@ -750,7 +750,7 @@ Constructs an instance of the Beef class based on the provided string
|
|
|
750
750
|
```ts
|
|
751
751
|
static fromString(s: string, enc: "hex" | "utf8" | "base64" = "hex"): Beef
|
|
752
752
|
```
|
|
753
|
-
See also: [Beef](#class-beef)
|
|
753
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
754
754
|
|
|
755
755
|
Returns
|
|
756
756
|
|
|
@@ -805,7 +805,7 @@ original.
|
|
|
805
805
|
```ts
|
|
806
806
|
makeTxidOnly(txid: string): BeefTx | undefined
|
|
807
807
|
```
|
|
808
|
-
See also: [BeefTx](#class-beeftx)
|
|
808
|
+
See also: [BeefTx](./transaction.md#class-beeftx)
|
|
809
809
|
|
|
810
810
|
Returns
|
|
811
811
|
|
|
@@ -818,7 +818,7 @@ Merge a MerklePath that is assumed to be fully valid.
|
|
|
818
818
|
```ts
|
|
819
819
|
mergeBump(bump: MerklePath): number
|
|
820
820
|
```
|
|
821
|
-
See also: [MerklePath](#class-merklepath)
|
|
821
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
822
822
|
|
|
823
823
|
Returns
|
|
824
824
|
|
|
@@ -835,7 +835,7 @@ Replaces existing transaction with same txid.
|
|
|
835
835
|
```ts
|
|
836
836
|
mergeRawTx(rawTx: number[], bumpIndex?: number): BeefTx
|
|
837
837
|
```
|
|
838
|
-
See also: [BeefTx](#class-beeftx)
|
|
838
|
+
See also: [BeefTx](./transaction.md#class-beeftx)
|
|
839
839
|
|
|
840
840
|
Returns
|
|
841
841
|
|
|
@@ -857,7 +857,7 @@ Attempts to match an existing bump to the new transaction.
|
|
|
857
857
|
```ts
|
|
858
858
|
mergeTransaction(tx: Transaction): BeefTx
|
|
859
859
|
```
|
|
860
|
-
See also: [BeefTx](#class-beeftx), [Transaction](#class-transaction)
|
|
860
|
+
See also: [BeefTx](./transaction.md#class-beeftx), [Transaction](./transaction.md#class-transaction)
|
|
861
861
|
|
|
862
862
|
Returns
|
|
863
863
|
|
|
@@ -868,7 +868,7 @@ txid of tx
|
|
|
868
868
|
Removes an existing transaction from the BEEF, given its TXID
|
|
869
869
|
|
|
870
870
|
```ts
|
|
871
|
-
removeExistingTxid(txid: string)
|
|
871
|
+
removeExistingTxid(txid: string): void
|
|
872
872
|
```
|
|
873
873
|
|
|
874
874
|
Argument Details
|
|
@@ -920,7 +920,7 @@ Serialize this Beef as AtomicBEEF.
|
|
|
920
920
|
after sorting, if txid is not last txid, creates a clone and removes newer txs
|
|
921
921
|
|
|
922
922
|
```ts
|
|
923
|
-
toBinaryAtomic(txid: string)
|
|
923
|
+
toBinaryAtomic(txid: string): number[]
|
|
924
924
|
```
|
|
925
925
|
|
|
926
926
|
Returns
|
|
@@ -954,16 +954,16 @@ Summary of `Beef` contents as multi-line string.
|
|
|
954
954
|
Serializes this data to `writer`
|
|
955
955
|
|
|
956
956
|
```ts
|
|
957
|
-
toWriter(writer: Writer)
|
|
957
|
+
toWriter(writer: Writer): void
|
|
958
958
|
```
|
|
959
|
-
See also: [Writer](#class-writer)
|
|
959
|
+
See also: [Writer](./primitives.md#class-writer)
|
|
960
960
|
|
|
961
961
|
#### Method trimKnownTxids
|
|
962
962
|
|
|
963
963
|
Ensure that all the txids in `knownTxids` are txidOnly
|
|
964
964
|
|
|
965
965
|
```ts
|
|
966
|
-
trimKnownTxids(knownTxids: string[])
|
|
966
|
+
trimKnownTxids(knownTxids: string[]): void
|
|
967
967
|
```
|
|
968
968
|
|
|
969
969
|
#### Method verify
|
|
@@ -981,7 +981,7 @@ Validity requirements:
|
|
|
981
981
|
```ts
|
|
982
982
|
async verify(chainTracker: ChainTracker, allowTxidOnly?: boolean): Promise<boolean>
|
|
983
983
|
```
|
|
984
|
-
See also: [ChainTracker](#interface-chaintracker)
|
|
984
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker)
|
|
985
985
|
|
|
986
986
|
Argument Details
|
|
987
987
|
|
|
@@ -1020,16 +1020,16 @@ The size and redundancy of these Beefs becomes a problem when chained transactio
|
|
|
1020
1020
|
export class BeefParty extends Beef {
|
|
1021
1021
|
knownTo: Record<string, Record<string, boolean>> = {};
|
|
1022
1022
|
constructor(parties?: string[])
|
|
1023
|
-
isParty(party: string)
|
|
1024
|
-
addParty(party: string)
|
|
1023
|
+
isParty(party: string): boolean
|
|
1024
|
+
addParty(party: string): void
|
|
1025
1025
|
getKnownTxidsForParty(party: string): string[]
|
|
1026
1026
|
getTrimmedBeefForParty(party: string): Beef
|
|
1027
|
-
addKnownTxidsForParty(party: string, knownTxids: string[])
|
|
1028
|
-
mergeBeefFromParty(party: string, beef: number[] | Beef)
|
|
1027
|
+
addKnownTxidsForParty(party: string, knownTxids: string[]): void
|
|
1028
|
+
mergeBeefFromParty(party: string, beef: number[] | Beef): void
|
|
1029
1029
|
}
|
|
1030
1030
|
```
|
|
1031
1031
|
|
|
1032
|
-
See also: [Beef](#class-beef)
|
|
1032
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
1033
1033
|
|
|
1034
1034
|
<details>
|
|
1035
1035
|
|
|
@@ -1060,7 +1060,7 @@ knownTo: Record<string, Record<string, boolean>> = {}
|
|
|
1060
1060
|
Make note of additional txids "known" to `party`.
|
|
1061
1061
|
|
|
1062
1062
|
```ts
|
|
1063
|
-
addKnownTxidsForParty(party: string, knownTxids: string[])
|
|
1063
|
+
addKnownTxidsForParty(party: string, knownTxids: string[]): void
|
|
1064
1064
|
```
|
|
1065
1065
|
|
|
1066
1066
|
Argument Details
|
|
@@ -1073,7 +1073,7 @@ Argument Details
|
|
|
1073
1073
|
Adds a new unique party identifier to this `BeefParty`.
|
|
1074
1074
|
|
|
1075
1075
|
```ts
|
|
1076
|
-
addParty(party: string)
|
|
1076
|
+
addParty(party: string): void
|
|
1077
1077
|
```
|
|
1078
1078
|
|
|
1079
1079
|
#### Method getKnownTxidsForParty
|
|
@@ -1091,7 +1091,7 @@ Array of txids "known" to `party`.
|
|
|
1091
1091
|
```ts
|
|
1092
1092
|
getTrimmedBeefForParty(party: string): Beef
|
|
1093
1093
|
```
|
|
1094
|
-
See also: [Beef](#class-beef)
|
|
1094
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
1095
1095
|
|
|
1096
1096
|
Returns
|
|
1097
1097
|
|
|
@@ -1100,7 +1100,7 @@ trimmed beef of unknown transactions and proofs for `party`
|
|
|
1100
1100
|
#### Method isParty
|
|
1101
1101
|
|
|
1102
1102
|
```ts
|
|
1103
|
-
isParty(party: string)
|
|
1103
|
+
isParty(party: string): boolean
|
|
1104
1104
|
```
|
|
1105
1105
|
|
|
1106
1106
|
Returns
|
|
@@ -1116,9 +1116,9 @@ corresponding to transactions for which `party`
|
|
|
1116
1116
|
has raw transaction and validity proof data.
|
|
1117
1117
|
|
|
1118
1118
|
```ts
|
|
1119
|
-
mergeBeefFromParty(party: string, beef: number[] | Beef)
|
|
1119
|
+
mergeBeefFromParty(party: string, beef: number[] | Beef): void
|
|
1120
1120
|
```
|
|
1121
|
-
See also: [Beef](#class-beef)
|
|
1121
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
1122
1122
|
|
|
1123
1123
|
</details>
|
|
1124
1124
|
|
|
@@ -1147,9 +1147,9 @@ export default class BeefTx {
|
|
|
1147
1147
|
set bumpIndex(v: number | undefined)
|
|
1148
1148
|
get hasProof(): boolean
|
|
1149
1149
|
get isTxidOnly(): boolean
|
|
1150
|
-
get txid()
|
|
1151
|
-
get tx()
|
|
1152
|
-
get rawTx()
|
|
1150
|
+
get txid(): string
|
|
1151
|
+
get tx(): Transaction | undefined
|
|
1152
|
+
get rawTx(): number[] | undefined
|
|
1153
1153
|
constructor(tx: Transaction | number[] | string, bumpIndex?: number)
|
|
1154
1154
|
static fromTx(tx: Transaction, bumpIndex?: number): BeefTx
|
|
1155
1155
|
static fromRawTx(rawTx: number[], bumpIndex?: number): BeefTx
|
|
@@ -1159,7 +1159,7 @@ export default class BeefTx {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
```
|
|
1161
1161
|
|
|
1162
|
-
See also: [Reader](#class-reader), [Transaction](#class-transaction), [Writer](#class-writer)
|
|
1162
|
+
See also: [Reader](./primitives.md#class-reader), [Transaction](./transaction.md#class-transaction), [Writer](./primitives.md#class-writer)
|
|
1163
1163
|
|
|
1164
1164
|
<details>
|
|
1165
1165
|
|
|
@@ -1170,7 +1170,7 @@ See also: [Reader](#class-reader), [Transaction](#class-transaction), [Writer](#
|
|
|
1170
1170
|
```ts
|
|
1171
1171
|
constructor(tx: Transaction | number[] | string, bumpIndex?: number)
|
|
1172
1172
|
```
|
|
1173
|
-
See also: [Transaction](#class-transaction)
|
|
1173
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1174
1174
|
|
|
1175
1175
|
Argument Details
|
|
1176
1176
|
|
|
@@ -1196,7 +1196,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1196
1196
|
---
|
|
1197
1197
|
### Class: FetchHttpClient
|
|
1198
1198
|
|
|
1199
|
-
Adapter for Node
|
|
1199
|
+
Adapter for Node Https module to be used as HttpClient
|
|
1200
1200
|
|
|
1201
1201
|
```ts
|
|
1202
1202
|
export class FetchHttpClient implements HttpClient {
|
|
@@ -1205,7 +1205,7 @@ export class FetchHttpClient implements HttpClient {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
```
|
|
1207
1207
|
|
|
1208
|
-
See also: [Fetch](#type-fetch), [HttpClient](#interface-httpclient), [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse)
|
|
1208
|
+
See also: [Fetch](./transaction.md#type-fetch), [HttpClient](./transaction.md#interface-httpclient), [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse)
|
|
1209
1209
|
|
|
1210
1210
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1211
1211
|
|
|
@@ -1249,11 +1249,11 @@ export default class MerklePath {
|
|
|
1249
1249
|
findOrComputeLeaf(height: number, offset: number): MerklePathLeaf | undefined
|
|
1250
1250
|
async verify(txid: string, chainTracker: ChainTracker): Promise<boolean>
|
|
1251
1251
|
combine(other: MerklePath): void
|
|
1252
|
-
trim()
|
|
1252
|
+
trim(): void
|
|
1253
1253
|
}
|
|
1254
1254
|
```
|
|
1255
1255
|
|
|
1256
|
-
See also: [ChainTracker](#interface-chaintracker), [MerklePathLeaf](#interface-merklepathleaf), [Reader](#class-reader), [toHex](#variable-tohex), [verify](#variable-verify)
|
|
1256
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker), [MerklePathLeaf](./transaction.md#interface-merklepathleaf), [Reader](./primitives.md#class-reader), [toHex](./primitives.md#variable-tohex), [verify](./compat.md#variable-verify)
|
|
1257
1257
|
|
|
1258
1258
|
<details>
|
|
1259
1259
|
|
|
@@ -1266,7 +1266,7 @@ Combines this MerklePath with another to create a compound proof.
|
|
|
1266
1266
|
```ts
|
|
1267
1267
|
combine(other: MerklePath): void
|
|
1268
1268
|
```
|
|
1269
|
-
See also: [MerklePath](#class-merklepath)
|
|
1269
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1270
1270
|
|
|
1271
1271
|
Argument Details
|
|
1272
1272
|
|
|
@@ -1307,7 +1307,7 @@ Does not add computed leaves to path.
|
|
|
1307
1307
|
```ts
|
|
1308
1308
|
findOrComputeLeaf(height: number, offset: number): MerklePathLeaf | undefined
|
|
1309
1309
|
```
|
|
1310
|
-
See also: [MerklePathLeaf](#interface-merklepathleaf)
|
|
1310
|
+
See also: [MerklePathLeaf](./transaction.md#interface-merklepathleaf)
|
|
1311
1311
|
|
|
1312
1312
|
#### Method fromBinary
|
|
1313
1313
|
|
|
@@ -1316,7 +1316,7 @@ Creates a MerklePath instance from a binary array.
|
|
|
1316
1316
|
```ts
|
|
1317
1317
|
static fromBinary(bump: number[]): MerklePath
|
|
1318
1318
|
```
|
|
1319
|
-
See also: [MerklePath](#class-merklepath)
|
|
1319
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1320
1320
|
|
|
1321
1321
|
Returns
|
|
1322
1322
|
|
|
@@ -1332,7 +1332,7 @@ Argument Details
|
|
|
1332
1332
|
```ts
|
|
1333
1333
|
static fromCoinbaseTxidAndHeight(txid: string, height: number): MerklePath
|
|
1334
1334
|
```
|
|
1335
|
-
See also: [MerklePath](#class-merklepath)
|
|
1335
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1336
1336
|
|
|
1337
1337
|
Returns
|
|
1338
1338
|
|
|
@@ -1352,7 +1352,7 @@ Creates a MerklePath instance from a hexadecimal string.
|
|
|
1352
1352
|
```ts
|
|
1353
1353
|
static fromHex(hex: string): MerklePath
|
|
1354
1354
|
```
|
|
1355
|
-
See also: [MerklePath](#class-merklepath)
|
|
1355
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1356
1356
|
|
|
1357
1357
|
Returns
|
|
1358
1358
|
|
|
@@ -1394,7 +1394,7 @@ Assumes that at least all required nodes are present.
|
|
|
1394
1394
|
Leaves all levels sorted by increasing offset.
|
|
1395
1395
|
|
|
1396
1396
|
```ts
|
|
1397
|
-
trim()
|
|
1397
|
+
trim(): void
|
|
1398
1398
|
```
|
|
1399
1399
|
|
|
1400
1400
|
#### Method verify
|
|
@@ -1404,7 +1404,7 @@ Verifies if the given transaction ID is part of the Merkle tree at the specified
|
|
|
1404
1404
|
```ts
|
|
1405
1405
|
async verify(txid: string, chainTracker: ChainTracker): Promise<boolean>
|
|
1406
1406
|
```
|
|
1407
|
-
See also: [ChainTracker](#interface-chaintracker)
|
|
1407
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker)
|
|
1408
1408
|
|
|
1409
1409
|
Returns
|
|
1410
1410
|
|
|
@@ -1424,7 +1424,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1424
1424
|
---
|
|
1425
1425
|
### Class: NodejsHttpClient
|
|
1426
1426
|
|
|
1427
|
-
Adapter for Node
|
|
1427
|
+
Adapter for Node Https module to be used as HttpClient
|
|
1428
1428
|
|
|
1429
1429
|
```ts
|
|
1430
1430
|
export class NodejsHttpClient implements HttpClient {
|
|
@@ -1433,7 +1433,7 @@ export class NodejsHttpClient implements HttpClient {
|
|
|
1433
1433
|
}
|
|
1434
1434
|
```
|
|
1435
1435
|
|
|
1436
|
-
See also: [HttpClient](#interface-httpclient), [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse), [HttpsNodejs](#interface-httpsnodejs)
|
|
1436
|
+
See also: [HttpClient](./transaction.md#interface-httpclient), [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse), [HttpsNodejs](./transaction.md#interface-httpsnodejs)
|
|
1437
1437
|
|
|
1438
1438
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1439
1439
|
|
|
@@ -1450,7 +1450,7 @@ export default class SatoshisPerKilobyte implements FeeModel {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
```
|
|
1452
1452
|
|
|
1453
|
-
See also: [FeeModel](#interface-feemodel), [Transaction](#class-transaction)
|
|
1453
|
+
See also: [FeeModel](./transaction.md#interface-feemodel), [Transaction](./transaction.md#class-transaction)
|
|
1454
1454
|
|
|
1455
1455
|
<details>
|
|
1456
1456
|
|
|
@@ -1476,7 +1476,7 @@ Computes the fee for a given transaction.
|
|
|
1476
1476
|
```ts
|
|
1477
1477
|
async computeFee(tx: Transaction): Promise<number>
|
|
1478
1478
|
```
|
|
1479
|
-
See also: [Transaction](#class-transaction)
|
|
1479
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1480
1480
|
|
|
1481
1481
|
Returns
|
|
1482
1482
|
|
|
@@ -1563,7 +1563,7 @@ export default class Transaction {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
```
|
|
1565
1565
|
|
|
1566
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Broadcaster](#interface-broadcaster), [ChainTracker](#interface-chaintracker), [FeeModel](#interface-feemodel), [MerklePath](#class-merklepath), [Reader](#class-reader), [SatoshisPerKilobyte](#class-satoshisperkilobyte), [TransactionInput](#interface-transactioninput), [TransactionOutput](#interface-transactionoutput), [defaultBroadcaster](#function-defaultbroadcaster), [defaultChainTracker](#function-defaultchaintracker), [sign](#variable-sign), [toHex](#variable-tohex), [verify](#variable-verify)
|
|
1566
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Broadcaster](./transaction.md#interface-broadcaster), [ChainTracker](./transaction.md#interface-chaintracker), [FeeModel](./transaction.md#interface-feemodel), [MerklePath](./transaction.md#class-merklepath), [Reader](./primitives.md#class-reader), [SatoshisPerKilobyte](./transaction.md#class-satoshisperkilobyte), [TransactionInput](./transaction.md#interface-transactioninput), [TransactionOutput](./transaction.md#interface-transactionoutput), [defaultBroadcaster](./transaction.md#function-defaultbroadcaster), [defaultChainTracker](./transaction.md#function-defaultchaintracker), [sign](./compat.md#variable-sign), [toHex](./primitives.md#variable-tohex), [verify](./compat.md#variable-verify)
|
|
1567
1567
|
|
|
1568
1568
|
<details>
|
|
1569
1569
|
|
|
@@ -1576,7 +1576,7 @@ Adds a new input to the transaction.
|
|
|
1576
1576
|
```ts
|
|
1577
1577
|
addInput(input: TransactionInput): void
|
|
1578
1578
|
```
|
|
1579
|
-
See also: [TransactionInput](#interface-transactioninput)
|
|
1579
|
+
See also: [TransactionInput](./transaction.md#interface-transactioninput)
|
|
1580
1580
|
|
|
1581
1581
|
Argument Details
|
|
1582
1582
|
|
|
@@ -1594,7 +1594,7 @@ Adds a new output to the transaction.
|
|
|
1594
1594
|
```ts
|
|
1595
1595
|
addOutput(output: TransactionOutput): void
|
|
1596
1596
|
```
|
|
1597
|
-
See also: [TransactionOutput](#interface-transactionoutput)
|
|
1597
|
+
See also: [TransactionOutput](./transaction.md#interface-transactionoutput)
|
|
1598
1598
|
|
|
1599
1599
|
Argument Details
|
|
1600
1600
|
|
|
@@ -1623,7 +1623,7 @@ Broadcasts a transaction.
|
|
|
1623
1623
|
```ts
|
|
1624
1624
|
async broadcast(broadcaster: Broadcaster = defaultBroadcaster()): Promise<BroadcastResponse | BroadcastFailure>
|
|
1625
1625
|
```
|
|
1626
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Broadcaster](#interface-broadcaster), [defaultBroadcaster](#function-defaultbroadcaster)
|
|
1626
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Broadcaster](./transaction.md#interface-broadcaster), [defaultBroadcaster](./transaction.md#function-defaultbroadcaster)
|
|
1627
1627
|
|
|
1628
1628
|
Returns
|
|
1629
1629
|
|
|
@@ -1643,7 +1643,7 @@ If fee is a number, the transaction uses that value as fee.
|
|
|
1643
1643
|
```ts
|
|
1644
1644
|
async fee(modelOrFee: FeeModel | number = new SatoshisPerKilobyte(10), changeDistribution: "equal" | "random" = "equal"): Promise<void>
|
|
1645
1645
|
```
|
|
1646
|
-
See also: [FeeModel](#interface-feemodel), [SatoshisPerKilobyte](#class-satoshisperkilobyte)
|
|
1646
|
+
See also: [FeeModel](./transaction.md#interface-feemodel), [SatoshisPerKilobyte](./transaction.md#class-satoshisperkilobyte)
|
|
1647
1647
|
|
|
1648
1648
|
Argument Details
|
|
1649
1649
|
|
|
@@ -1656,14 +1656,12 @@ amongst the change outputs
|
|
|
1656
1656
|
#### Method fromAtomicBEEF
|
|
1657
1657
|
|
|
1658
1658
|
Creates a new transaction from an Atomic BEEF (BRC-95) structure.
|
|
1659
|
-
Extracts the subject transaction and
|
|
1660
|
-
are part of the dependency graph of the subject transaction.
|
|
1661
|
-
Throws errors if the Atomic BEEF data does not strictly adhere to the BRC-95 specification.
|
|
1659
|
+
Extracts the subject transaction and supporting merkle path and source transactions contained in the BEEF data
|
|
1662
1660
|
|
|
1663
1661
|
```ts
|
|
1664
1662
|
static fromAtomicBEEF(beef: number[]): Transaction
|
|
1665
1663
|
```
|
|
1666
|
-
See also: [Transaction](#class-transaction)
|
|
1664
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1667
1665
|
|
|
1668
1666
|
Returns
|
|
1669
1667
|
|
|
@@ -1676,15 +1674,15 @@ Argument Details
|
|
|
1676
1674
|
|
|
1677
1675
|
#### Method fromBEEF
|
|
1678
1676
|
|
|
1679
|
-
Creates a new transaction, linked to its inputs and their associated merkle paths, from a BEEF
|
|
1677
|
+
Creates a new transaction, linked to its inputs and their associated merkle paths, from a BEEF V1, V2 or Atomic.
|
|
1680
1678
|
Optionally, you can provide a specific TXID to retrieve a particular transaction from the BEEF data.
|
|
1681
1679
|
If the TXID is provided but not found in the BEEF data, an error will be thrown.
|
|
1682
|
-
If no TXID is provided, the last transaction in the BEEF data is returned.
|
|
1680
|
+
If no TXID is provided, the last transaction in the BEEF data is returned, or the atomic txid.
|
|
1683
1681
|
|
|
1684
1682
|
```ts
|
|
1685
1683
|
static fromBEEF(beef: number[], txid?: string): Transaction
|
|
1686
1684
|
```
|
|
1687
|
-
See also: [Transaction](#class-transaction)
|
|
1685
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1688
1686
|
|
|
1689
1687
|
Returns
|
|
1690
1688
|
|
|
@@ -1704,7 +1702,7 @@ Creates a Transaction instance from a binary array.
|
|
|
1704
1702
|
```ts
|
|
1705
1703
|
static fromBinary(bin: number[]): Transaction
|
|
1706
1704
|
```
|
|
1707
|
-
See also: [Transaction](#class-transaction)
|
|
1705
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1708
1706
|
|
|
1709
1707
|
Returns
|
|
1710
1708
|
|
|
@@ -1722,7 +1720,7 @@ Creates a new transaction, linked to its inputs and their associated merkle path
|
|
|
1722
1720
|
```ts
|
|
1723
1721
|
static fromEF(ef: number[]): Transaction
|
|
1724
1722
|
```
|
|
1725
|
-
See also: [Transaction](#class-transaction)
|
|
1723
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1726
1724
|
|
|
1727
1725
|
Returns
|
|
1728
1726
|
|
|
@@ -1740,7 +1738,7 @@ Creates a Transaction instance from a hexadecimal string.
|
|
|
1740
1738
|
```ts
|
|
1741
1739
|
static fromHex(hex: string): Transaction
|
|
1742
1740
|
```
|
|
1743
|
-
See also: [Transaction](#class-transaction)
|
|
1741
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1744
1742
|
|
|
1745
1743
|
Returns
|
|
1746
1744
|
|
|
@@ -1761,7 +1759,7 @@ If no TXID is provided, the last transaction in the BEEF data is returned.
|
|
|
1761
1759
|
```ts
|
|
1762
1760
|
static fromHexBEEF(hex: string, txid?: string): Transaction
|
|
1763
1761
|
```
|
|
1764
|
-
See also: [Transaction](#class-transaction)
|
|
1762
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1765
1763
|
|
|
1766
1764
|
Returns
|
|
1767
1765
|
|
|
@@ -1781,7 +1779,7 @@ Creates a Transaction instance from a hexadecimal string encoded EF.
|
|
|
1781
1779
|
```ts
|
|
1782
1780
|
static fromHexEF(hex: string): Transaction
|
|
1783
1781
|
```
|
|
1784
|
-
See also: [Transaction](#class-transaction)
|
|
1782
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1785
1783
|
|
|
1786
1784
|
Returns
|
|
1787
1785
|
|
|
@@ -2048,7 +2046,7 @@ Verifies the legitimacy of the Bitcoin transaction according to the rules of SPV
|
|
|
2048
2046
|
```ts
|
|
2049
2047
|
async verify(chainTracker: ChainTracker | "scripts only" = defaultChainTracker(), feeModel?: FeeModel): Promise<boolean>
|
|
2050
2048
|
```
|
|
2051
|
-
See also: [ChainTracker](#interface-chaintracker), [FeeModel](#interface-feemodel), [defaultChainTracker](#function-defaultchaintracker)
|
|
2049
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker), [FeeModel](./transaction.md#interface-feemodel), [defaultChainTracker](./transaction.md#function-defaultchaintracker)
|
|
2052
2050
|
|
|
2053
2051
|
Returns
|
|
2054
2052
|
|
|
@@ -2084,7 +2082,7 @@ export default class WhatsOnChain implements ChainTracker {
|
|
|
2084
2082
|
}
|
|
2085
2083
|
```
|
|
2086
2084
|
|
|
2087
|
-
See also: [ChainTracker](#interface-chaintracker), [WhatsOnChainConfig](#interface-whatsonchainconfig)
|
|
2085
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker), [WhatsOnChainConfig](./transaction.md#interface-whatsonchainconfig)
|
|
2088
2086
|
|
|
2089
2087
|
<details>
|
|
2090
2088
|
|
|
@@ -2097,7 +2095,7 @@ Constructs an instance of the WhatsOnChain ChainTracker.
|
|
|
2097
2095
|
```ts
|
|
2098
2096
|
constructor(network: "main" | "test" | "stn" = "main", config: WhatsOnChainConfig = {})
|
|
2099
2097
|
```
|
|
2100
|
-
See also: [WhatsOnChainConfig](#interface-whatsonchainconfig)
|
|
2098
|
+
See also: [WhatsOnChainConfig](./transaction.md#interface-whatsonchainconfig)
|
|
2101
2099
|
|
|
2102
2100
|
Argument Details
|
|
2103
2101
|
|
|
@@ -2131,7 +2129,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2131
2129
|
export function defaultBroadcaster(isTestnet: boolean = false, config: ArcConfig = {}): Broadcaster
|
|
2132
2130
|
```
|
|
2133
2131
|
|
|
2134
|
-
See also: [ArcConfig](#interface-arcconfig), [Broadcaster](#interface-broadcaster)
|
|
2132
|
+
See also: [ArcConfig](./transaction.md#interface-arcconfig), [Broadcaster](./transaction.md#interface-broadcaster)
|
|
2135
2133
|
|
|
2136
2134
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2137
2135
|
|
|
@@ -2142,7 +2140,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2142
2140
|
export function defaultChainTracker(): ChainTracker
|
|
2143
2141
|
```
|
|
2144
2142
|
|
|
2145
|
-
See also: [ChainTracker](#interface-chaintracker)
|
|
2143
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker)
|
|
2146
2144
|
|
|
2147
2145
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2148
2146
|
|
|
@@ -2151,13 +2149,13 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2151
2149
|
|
|
2152
2150
|
Returns a default HttpClient implementation based on the environment that it is run on.
|
|
2153
2151
|
This method will attempt to use `window.fetch` if available (in browser environments).
|
|
2154
|
-
If running in a Node
|
|
2152
|
+
If running in a Node environment, it falls back to using the Node `https` module
|
|
2155
2153
|
|
|
2156
2154
|
```ts
|
|
2157
2155
|
export function defaultHttpClient(): HttpClient
|
|
2158
2156
|
```
|
|
2159
2157
|
|
|
2160
|
-
See also: [HttpClient](#interface-httpclient)
|
|
2158
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
2161
2159
|
|
|
2162
2160
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2163
2161
|
|
|
@@ -2170,7 +2168,7 @@ Convenience type guard for response from `Broadcaster.broadcast`
|
|
|
2170
2168
|
export function isBroadcastFailure(r: BroadcastResponse | BroadcastFailure): r is BroadcastFailure
|
|
2171
2169
|
```
|
|
2172
2170
|
|
|
2173
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse)
|
|
2171
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse)
|
|
2174
2172
|
|
|
2175
2173
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2176
2174
|
|
|
@@ -2183,7 +2181,7 @@ Convenience type guard for response from `Broadcaster.broadcast`
|
|
|
2183
2181
|
export function isBroadcastResponse(r: BroadcastResponse | BroadcastFailure): r is BroadcastResponse
|
|
2184
2182
|
```
|
|
2185
2183
|
|
|
2186
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse)
|
|
2184
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse)
|
|
2187
2185
|
|
|
2188
2186
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2189
2187
|
|
|
@@ -2209,7 +2207,7 @@ Makes a request to the server.
|
|
|
2209
2207
|
export type Fetch = (url: string, options: FetchOptions) => Promise<Response>
|
|
2210
2208
|
```
|
|
2211
2209
|
|
|
2212
|
-
See also: [FetchOptions](#interface-fetchoptions)
|
|
2210
|
+
See also: [FetchOptions](./transaction.md#interface-fetchoptions)
|
|
2213
2211
|
|
|
2214
2212
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2215
2213
|
|