@bsv/sdk 1.6.9 → 1.6.10
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/README.md +9 -4
- package/dist/cjs/package.json +4 -2
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/concepts/beef.md +84 -0
- package/docs/concepts/chain-tracking.md +122 -0
- package/docs/concepts/decentralized-identity.md +184 -0
- package/docs/concepts/fees.md +217 -0
- package/docs/concepts/identity-certificates.md +255 -0
- package/docs/concepts/index.md +62 -0
- package/docs/concepts/key-management.md +176 -0
- package/docs/concepts/script-templates.md +163 -0
- package/docs/concepts/sdk-philosophy.md +72 -0
- package/docs/concepts/signatures.md +179 -0
- package/docs/concepts/spv-verification.md +106 -0
- package/docs/concepts/transaction-encoding.md +148 -0
- package/docs/concepts/transaction-structure.md +63 -0
- package/docs/concepts/trust-model.md +123 -0
- package/docs/concepts/verification.md +219 -0
- package/docs/concepts/wallet-integration.md +95 -0
- package/docs/guides/direct-transaction-creation.md +137 -0
- package/docs/guides/http-client-configuration.md +414 -0
- package/docs/guides/index.md +30 -0
- package/docs/guides/transaction-signing-methods.md +268 -0
- package/docs/index.md +74 -0
- package/docs/reference/arc-config.md +698 -0
- package/docs/reference/brc-100.md +33 -0
- package/docs/reference/configuration.md +829 -0
- package/docs/reference/debugging.md +700 -0
- package/docs/reference/errors.md +547 -0
- package/docs/reference/index.md +98 -0
- package/docs/reference/network-config.md +914 -0
- package/docs/reference/op-codes.md +306 -0
- package/docs/reference/transaction-signatures.md +94 -0
- package/docs/requirements.txt +3 -0
- package/docs/tutorials/advanced-transaction.md +575 -0
- package/docs/tutorials/aes-encryption.md +947 -0
- package/docs/tutorials/authfetch-tutorial.md +957 -0
- package/docs/tutorials/ecdh-key-exchange.md +547 -0
- package/docs/tutorials/elliptic-curve-fundamentals.md +603 -0
- package/docs/tutorials/error-handling.md +1215 -0
- package/docs/tutorials/first-transaction-low-level.md +204 -0
- package/docs/tutorials/first-transaction.md +278 -0
- package/docs/tutorials/hashes-and-hmacs.md +814 -0
- package/docs/tutorials/identity-management.md +702 -0
- package/docs/tutorials/index.md +182 -0
- package/docs/tutorials/key-management.md +536 -0
- package/docs/tutorials/protowallet-development.md +716 -0
- package/docs/tutorials/script-construction.md +690 -0
- package/docs/tutorials/spv-merkle-proofs.md +682 -0
- package/docs/tutorials/testnet-transactions-low-level.md +352 -0
- package/docs/tutorials/transaction-broadcasting.md +535 -0
- package/docs/tutorials/transaction-types.md +419 -0
- package/docs/tutorials/type-42.md +582 -0
- package/docs/tutorials/uhrp-storage.md +579 -0
- package/package.json +4 -2
- package/dist/cjs/src/auth/__tests/Peer.test.js +0 -446
- package/dist/cjs/src/auth/__tests/Peer.test.js.map +0 -1
- package/dist/cjs/src/auth/__tests/SessionManager.test.js +0 -69
- package/dist/cjs/src/auth/__tests/SessionManager.test.js.map +0 -1
- package/dist/cjs/src/auth/certificates/__tests/Certificate.test.js +0 -182
- package/dist/cjs/src/auth/certificates/__tests/Certificate.test.js.map +0 -1
- package/dist/cjs/src/auth/certificates/__tests/MasterCertificate.test.js +0 -184
- package/dist/cjs/src/auth/certificates/__tests/MasterCertificate.test.js.map +0 -1
- package/dist/cjs/src/auth/certificates/__tests/VerifiableCertificate.test.js +0 -75
- package/dist/cjs/src/auth/certificates/__tests/VerifiableCertificate.test.js.map +0 -1
- package/dist/cjs/src/auth/utils/__tests/cryptononce.test.js +0 -101
- package/dist/cjs/src/auth/utils/__tests/cryptononce.test.js.map +0 -1
- package/dist/cjs/src/auth/utils/__tests/getVerifiableCertificates.test.js +0 -106
- package/dist/cjs/src/auth/utils/__tests/getVerifiableCertificates.test.js.map +0 -1
- package/dist/cjs/src/auth/utils/__tests/validateCertificates.test.js +0 -111
- package/dist/cjs/src/auth/utils/__tests/validateCertificates.test.js.map +0 -1
- package/dist/cjs/src/auth/utils/certificateHelpers.js +0 -51
- package/dist/cjs/src/auth/utils/certificateHelpers.js.map +0 -1
- package/dist/cjs/src/compat/__tests/BSM.test.js +0 -69
- package/dist/cjs/src/compat/__tests/BSM.test.js.map +0 -1
- package/dist/cjs/src/compat/__tests/ECIES.test.js +0 -115
- package/dist/cjs/src/compat/__tests/ECIES.test.js.map +0 -1
- package/dist/cjs/src/compat/__tests/HD.test.js +0 -336
- package/dist/cjs/src/compat/__tests/HD.test.js.map +0 -1
- package/dist/cjs/src/compat/__tests/Mnemonic.test.js +0 -150
- package/dist/cjs/src/compat/__tests/Mnemonic.test.js.map +0 -1
- package/dist/cjs/src/compat/__tests/Mnemonic.vectors.js +0 -175
- package/dist/cjs/src/compat/__tests/Mnemonic.vectors.js.map +0 -1
- package/dist/cjs/src/messages/__tests/EncryptedMessage.test.js +0 -57
- package/dist/cjs/src/messages/__tests/EncryptedMessage.test.js.map +0 -1
- package/dist/cjs/src/messages/__tests/SignedMessage.test.js +0 -52
- package/dist/cjs/src/messages/__tests/SignedMessage.test.js.map +0 -1
- package/dist/cjs/src/overlay-tools/__tests/LookupResolver.test.js +0 -1471
- package/dist/cjs/src/overlay-tools/__tests/LookupResolver.test.js.map +0 -1
- package/dist/cjs/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.js +0 -78
- package/dist/cjs/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.js.map +0 -1
- package/dist/cjs/src/overlay-tools/__tests/SHIPBroadcaster.test.js +0 -933
- package/dist/cjs/src/overlay-tools/__tests/SHIPBroadcaster.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/AESGCM.test.js +0 -248
- package/dist/cjs/src/primitives/__tests/AESGCM.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BRC42.private.vectors.js +0 -36
- package/dist/cjs/src/primitives/__tests/BRC42.private.vectors.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BRC42.public.vectors.js +0 -36
- package/dist/cjs/src/primitives/__tests/BRC42.public.vectors.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BigNumber.arithmatic.test.js +0 -501
- package/dist/cjs/src/primitives/__tests/BigNumber.arithmatic.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BigNumber.binary.test.js +0 -185
- package/dist/cjs/src/primitives/__tests/BigNumber.binary.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BigNumber.constructor.test.js +0 -149
- package/dist/cjs/src/primitives/__tests/BigNumber.constructor.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BigNumber.dhGroup.test.js +0 -23
- package/dist/cjs/src/primitives/__tests/BigNumber.dhGroup.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BigNumber.fixtures.js +0 -268
- package/dist/cjs/src/primitives/__tests/BigNumber.fixtures.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BigNumber.serializers.test.js +0 -147
- package/dist/cjs/src/primitives/__tests/BigNumber.serializers.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/BigNumber.utils.test.js +0 -322
- package/dist/cjs/src/primitives/__tests/BigNumber.utils.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/Curve.unit.test.js +0 -145
- package/dist/cjs/src/primitives/__tests/Curve.unit.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/DRBG.test.js +0 -22
- package/dist/cjs/src/primitives/__tests/DRBG.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/DRBG.vectors.js +0 -170
- package/dist/cjs/src/primitives/__tests/DRBG.vectors.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/ECDH.test.js +0 -34
- package/dist/cjs/src/primitives/__tests/ECDH.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/ECDSA.test.js +0 -89
- package/dist/cjs/src/primitives/__tests/ECDSA.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/HMAC.test.js +0 -60
- package/dist/cjs/src/primitives/__tests/HMAC.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/Hash.test.js +0 -159
- package/dist/cjs/src/primitives/__tests/Hash.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/PBKDF2.vectors.js +0 -122
- package/dist/cjs/src/primitives/__tests/PBKDF2.vectors.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/PrivateKey.split.test.js +0 -105
- package/dist/cjs/src/primitives/__tests/PrivateKey.split.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/PrivateKey.test.js +0 -90
- package/dist/cjs/src/primitives/__tests/PrivateKey.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/PublicKey.test.js +0 -83
- package/dist/cjs/src/primitives/__tests/PublicKey.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/Random.test.js +0 -19
- package/dist/cjs/src/primitives/__tests/Random.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/Reader.test.js +0 -282
- package/dist/cjs/src/primitives/__tests/Reader.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/ReductionContext.test.js +0 -224
- package/dist/cjs/src/primitives/__tests/ReductionContext.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/Schnorr.test.js +0 -213
- package/dist/cjs/src/primitives/__tests/Schnorr.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/SymmetricKey.test.js +0 -51
- package/dist/cjs/src/primitives/__tests/SymmetricKey.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/SymmetricKey.vectors.js +0 -43
- package/dist/cjs/src/primitives/__tests/SymmetricKey.vectors.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/Writer.test.js +0 -176
- package/dist/cjs/src/primitives/__tests/Writer.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/bug-31.test.js +0 -32
- package/dist/cjs/src/primitives/__tests/bug-31.test.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/sighash.vectors.js +0 -3506
- package/dist/cjs/src/primitives/__tests/sighash.vectors.js.map +0 -1
- package/dist/cjs/src/primitives/__tests/utils.test.js +0 -110
- package/dist/cjs/src/primitives/__tests/utils.test.js.map +0 -1
- package/dist/cjs/src/script/__tests/Script.test.js +0 -347
- package/dist/cjs/src/script/__tests/Script.test.js.map +0 -1
- package/dist/cjs/src/script/__tests/Spend.test.js +0 -282
- package/dist/cjs/src/script/__tests/Spend.test.js.map +0 -1
- package/dist/cjs/src/script/__tests/SpendComplex.test.js +0 -52
- package/dist/cjs/src/script/__tests/SpendComplex.test.js.map +0 -1
- package/dist/cjs/src/script/__tests/script.invalid.vectors.js +0 -2370
- package/dist/cjs/src/script/__tests/script.invalid.vectors.js.map +0 -1
- package/dist/cjs/src/script/__tests/script.valid.vectors.js +0 -1181
- package/dist/cjs/src/script/__tests/script.valid.vectors.js.map +0 -1
- package/dist/cjs/src/script/__tests/spend.valid.vectors.js +0 -2298
- package/dist/cjs/src/script/__tests/spend.valid.vectors.js.map +0 -1
- package/dist/cjs/src/script/templates/__tests/PushDrop.test.js +0 -161
- package/dist/cjs/src/script/templates/__tests/PushDrop.test.js.map +0 -1
- package/dist/cjs/src/totp/__tests/totp.test.js +0 -67
- package/dist/cjs/src/totp/__tests/totp.test.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/Beef.test.js +0 -393
- package/dist/cjs/src/transaction/__tests/Beef.test.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/MerklePath.test.js +0 -209
- package/dist/cjs/src/transaction/__tests/MerklePath.test.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/Transaction.benchmarks.test.js +0 -219
- package/dist/cjs/src/transaction/__tests/Transaction.benchmarks.test.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/Transaction.test.js +0 -1073
- package/dist/cjs/src/transaction/__tests/Transaction.test.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/bigtx.vectors.js +0 -7
- package/dist/cjs/src/transaction/__tests/bigtx.vectors.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/bump.invalid.vectors.js +0 -11
- package/dist/cjs/src/transaction/__tests/bump.invalid.vectors.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/bump.valid.vectors.js +0 -7
- package/dist/cjs/src/transaction/__tests/bump.valid.vectors.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/tx.invalid.vectors.js +0 -230
- package/dist/cjs/src/transaction/__tests/tx.invalid.vectors.js.map +0 -1
- package/dist/cjs/src/transaction/__tests/tx.valid.vectors.js +0 -296
- package/dist/cjs/src/transaction/__tests/tx.valid.vectors.js.map +0 -1
- package/dist/cjs/src/transaction/broadcasters/__tests/ARC.test.js +0 -246
- package/dist/cjs/src/transaction/broadcasters/__tests/ARC.test.js.map +0 -1
- package/dist/cjs/src/transaction/broadcasters/__tests/WhatsOnChainBroadcaster.test.js +0 -148
- package/dist/cjs/src/transaction/broadcasters/__tests/WhatsOnChainBroadcaster.test.js.map +0 -1
- package/dist/cjs/src/transaction/chaintrackers/__tests/WhatsOnChainChainTracker.test.js +0 -155
- package/dist/cjs/src/transaction/chaintrackers/__tests/WhatsOnChainChainTracker.test.js.map +0 -1
- package/dist/cjs/src/wallet/ScriptTemplateSABPPP.js +0 -39
- package/dist/cjs/src/wallet/ScriptTemplateSABPPP.js.map +0 -1
- package/dist/cjs/src/wallet/WalletSigner.js +0 -260
- package/dist/cjs/src/wallet/WalletSigner.js.map +0 -1
- package/dist/cjs/src/wallet/__tests/CachedKeyDeriver.test.js +0 -269
- package/dist/cjs/src/wallet/__tests/CachedKeyDeriver.test.js.map +0 -1
- package/dist/cjs/src/wallet/__tests/KeyDeriver.test.js +0 -114
- package/dist/cjs/src/wallet/__tests/KeyDeriver.test.js.map +0 -1
- package/dist/cjs/src/wallet/__tests/ProtoWallet.test.js +0 -475
- package/dist/cjs/src/wallet/__tests/ProtoWallet.test.js.map +0 -1
- package/dist/cjs/src/wallet/createActionSdk.js +0 -230
- package/dist/cjs/src/wallet/createActionSdk.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/CachedKeyDeriver.js +0 -174
- package/dist/cjs/src/wallet/sdk/CachedKeyDeriver.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/CertOps.js +0 -181
- package/dist/cjs/src/wallet/sdk/CertOps.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/Certificate.js +0 -162
- package/dist/cjs/src/wallet/sdk/Certificate.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/KeyDeriver.js +0 -176
- package/dist/cjs/src/wallet/sdk/KeyDeriver.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/ProtoWallet.js +0 -75
- package/dist/cjs/src/wallet/sdk/ProtoWallet.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/StorageSyncReader.js +0 -3
- package/dist/cjs/src/wallet/sdk/StorageSyncReader.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/WERR_errors.js +0 -107
- package/dist/cjs/src/wallet/sdk/WERR_errors.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/Wallet.interfaces.js +0 -3
- package/dist/cjs/src/wallet/sdk/Wallet.interfaces.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/WalletCrypto.js +0 -171
- package/dist/cjs/src/wallet/sdk/WalletCrypto.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/WalletError.js +0 -103
- package/dist/cjs/src/wallet/sdk/WalletError.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/WalletServices.interfaces.js +0 -3
- package/dist/cjs/src/wallet/sdk/WalletServices.interfaces.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/WalletSigner.interfaces.js +0 -3
- package/dist/cjs/src/wallet/sdk/WalletSigner.interfaces.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/WalletStorage.interfaces.js +0 -3
- package/dist/cjs/src/wallet/sdk/WalletStorage.interfaces.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/index.js +0 -31
- package/dist/cjs/src/wallet/sdk/index.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/types.js +0 -11
- package/dist/cjs/src/wallet/sdk/types.js.map +0 -1
- package/dist/cjs/src/wallet/sdk/validationHelpers.js +0 -601
- package/dist/cjs/src/wallet/sdk/validationHelpers.js.map +0 -1
- package/dist/cjs/src/wallet/substrates/__tests/WalletWire.integration.test.js +0 -1962
- package/dist/cjs/src/wallet/substrates/__tests/WalletWire.integration.test.js.map +0 -1
- package/dist/cjs/src/wallet/substrates/__tests/XDM.test.js +0 -579
- package/dist/cjs/src/wallet/substrates/__tests/XDM.test.js.map +0 -1
- package/dist/cjs/src/wallet/utilityHelpers.js +0 -305
- package/dist/cjs/src/wallet/utilityHelpers.js.map +0 -1
- package/dist/cjs/src/wallet/validationHelpers.js +0 -601
- package/dist/cjs/src/wallet/validationHelpers.js.map +0 -1
- package/dist/esm/src/auth/__tests/Peer.test.js +0 -448
- package/dist/esm/src/auth/__tests/Peer.test.js.map +0 -1
- package/dist/esm/src/auth/__tests/SessionManager.test.js +0 -69
- package/dist/esm/src/auth/__tests/SessionManager.test.js.map +0 -1
- package/dist/esm/src/auth/certificates/__tests/Certificate.test.js +0 -182
- package/dist/esm/src/auth/certificates/__tests/Certificate.test.js.map +0 -1
- package/dist/esm/src/auth/certificates/__tests/MasterCertificate.test.js +0 -184
- package/dist/esm/src/auth/certificates/__tests/MasterCertificate.test.js.map +0 -1
- package/dist/esm/src/auth/certificates/__tests/VerifiableCertificate.test.js +0 -75
- package/dist/esm/src/auth/certificates/__tests/VerifiableCertificate.test.js.map +0 -1
- package/dist/esm/src/auth/utils/__tests/cryptononce.test.js +0 -101
- package/dist/esm/src/auth/utils/__tests/cryptononce.test.js.map +0 -1
- package/dist/esm/src/auth/utils/__tests/getVerifiableCertificates.test.js +0 -106
- package/dist/esm/src/auth/utils/__tests/getVerifiableCertificates.test.js.map +0 -1
- package/dist/esm/src/auth/utils/__tests/validateCertificates.test.js +0 -111
- package/dist/esm/src/auth/utils/__tests/validateCertificates.test.js.map +0 -1
- package/dist/esm/src/auth/utils/certificateHelpers.js +0 -47
- package/dist/esm/src/auth/utils/certificateHelpers.js.map +0 -1
- package/dist/esm/src/compat/__tests/BSM.test.js +0 -69
- package/dist/esm/src/compat/__tests/BSM.test.js.map +0 -1
- package/dist/esm/src/compat/__tests/ECIES.test.js +0 -115
- package/dist/esm/src/compat/__tests/ECIES.test.js.map +0 -1
- package/dist/esm/src/compat/__tests/HD.test.js +0 -336
- package/dist/esm/src/compat/__tests/HD.test.js.map +0 -1
- package/dist/esm/src/compat/__tests/Mnemonic.test.js +0 -150
- package/dist/esm/src/compat/__tests/Mnemonic.test.js.map +0 -1
- package/dist/esm/src/compat/__tests/Mnemonic.vectors.js +0 -175
- package/dist/esm/src/compat/__tests/Mnemonic.vectors.js.map +0 -1
- package/dist/esm/src/messages/__tests/EncryptedMessage.test.js +0 -57
- package/dist/esm/src/messages/__tests/EncryptedMessage.test.js.map +0 -1
- package/dist/esm/src/messages/__tests/SignedMessage.test.js +0 -52
- package/dist/esm/src/messages/__tests/SignedMessage.test.js.map +0 -1
- package/dist/esm/src/overlay-tools/__tests/LookupResolver.test.js +0 -1471
- package/dist/esm/src/overlay-tools/__tests/LookupResolver.test.js.map +0 -1
- package/dist/esm/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.js +0 -78
- package/dist/esm/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.js.map +0 -1
- package/dist/esm/src/overlay-tools/__tests/SHIPBroadcaster.test.js +0 -933
- package/dist/esm/src/overlay-tools/__tests/SHIPBroadcaster.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/AESGCM.test.js +0 -248
- package/dist/esm/src/primitives/__tests/AESGCM.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BRC42.private.vectors.js +0 -36
- package/dist/esm/src/primitives/__tests/BRC42.private.vectors.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BRC42.public.vectors.js +0 -36
- package/dist/esm/src/primitives/__tests/BRC42.public.vectors.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BigNumber.arithmatic.test.js +0 -501
- package/dist/esm/src/primitives/__tests/BigNumber.arithmatic.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BigNumber.binary.test.js +0 -185
- package/dist/esm/src/primitives/__tests/BigNumber.binary.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BigNumber.constructor.test.js +0 -149
- package/dist/esm/src/primitives/__tests/BigNumber.constructor.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BigNumber.dhGroup.test.js +0 -23
- package/dist/esm/src/primitives/__tests/BigNumber.dhGroup.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BigNumber.fixtures.js +0 -268
- package/dist/esm/src/primitives/__tests/BigNumber.fixtures.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BigNumber.serializers.test.js +0 -147
- package/dist/esm/src/primitives/__tests/BigNumber.serializers.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/BigNumber.utils.test.js +0 -322
- package/dist/esm/src/primitives/__tests/BigNumber.utils.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/Curve.unit.test.js +0 -145
- package/dist/esm/src/primitives/__tests/Curve.unit.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/DRBG.test.js +0 -22
- package/dist/esm/src/primitives/__tests/DRBG.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/DRBG.vectors.js +0 -170
- package/dist/esm/src/primitives/__tests/DRBG.vectors.js.map +0 -1
- package/dist/esm/src/primitives/__tests/ECDH.test.js +0 -34
- package/dist/esm/src/primitives/__tests/ECDH.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/ECDSA.test.js +0 -89
- package/dist/esm/src/primitives/__tests/ECDSA.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/HMAC.test.js +0 -60
- package/dist/esm/src/primitives/__tests/HMAC.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/Hash.test.js +0 -159
- package/dist/esm/src/primitives/__tests/Hash.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/PBKDF2.vectors.js +0 -122
- package/dist/esm/src/primitives/__tests/PBKDF2.vectors.js.map +0 -1
- package/dist/esm/src/primitives/__tests/PrivateKey.split.test.js +0 -105
- package/dist/esm/src/primitives/__tests/PrivateKey.split.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/PrivateKey.test.js +0 -90
- package/dist/esm/src/primitives/__tests/PrivateKey.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/PublicKey.test.js +0 -83
- package/dist/esm/src/primitives/__tests/PublicKey.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/Random.test.js +0 -19
- package/dist/esm/src/primitives/__tests/Random.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/Reader.test.js +0 -282
- package/dist/esm/src/primitives/__tests/Reader.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/ReductionContext.test.js +0 -223
- package/dist/esm/src/primitives/__tests/ReductionContext.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/Schnorr.test.js +0 -213
- package/dist/esm/src/primitives/__tests/Schnorr.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/SymmetricKey.test.js +0 -51
- package/dist/esm/src/primitives/__tests/SymmetricKey.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/SymmetricKey.vectors.js +0 -43
- package/dist/esm/src/primitives/__tests/SymmetricKey.vectors.js.map +0 -1
- package/dist/esm/src/primitives/__tests/Writer.test.js +0 -176
- package/dist/esm/src/primitives/__tests/Writer.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/bug-31.test.js +0 -32
- package/dist/esm/src/primitives/__tests/bug-31.test.js.map +0 -1
- package/dist/esm/src/primitives/__tests/sighash.vectors.js +0 -3506
- package/dist/esm/src/primitives/__tests/sighash.vectors.js.map +0 -1
- package/dist/esm/src/primitives/__tests/utils.test.js +0 -110
- package/dist/esm/src/primitives/__tests/utils.test.js.map +0 -1
- package/dist/esm/src/script/__tests/Script.test.js +0 -347
- package/dist/esm/src/script/__tests/Script.test.js.map +0 -1
- package/dist/esm/src/script/__tests/Spend.test.js +0 -282
- package/dist/esm/src/script/__tests/Spend.test.js.map +0 -1
- package/dist/esm/src/script/__tests/SpendComplex.test.js +0 -51
- package/dist/esm/src/script/__tests/SpendComplex.test.js.map +0 -1
- package/dist/esm/src/script/__tests/script.invalid.vectors.js +0 -2370
- package/dist/esm/src/script/__tests/script.invalid.vectors.js.map +0 -1
- package/dist/esm/src/script/__tests/script.valid.vectors.js +0 -1181
- package/dist/esm/src/script/__tests/script.valid.vectors.js.map +0 -1
- package/dist/esm/src/script/__tests/spend.valid.vectors.js +0 -2298
- package/dist/esm/src/script/__tests/spend.valid.vectors.js.map +0 -1
- package/dist/esm/src/script/templates/__tests/PushDrop.test.js +0 -161
- package/dist/esm/src/script/templates/__tests/PushDrop.test.js.map +0 -1
- package/dist/esm/src/totp/__tests/totp.test.js +0 -67
- package/dist/esm/src/totp/__tests/totp.test.js.map +0 -1
- package/dist/esm/src/transaction/__tests/Beef.test.js +0 -393
- package/dist/esm/src/transaction/__tests/Beef.test.js.map +0 -1
- package/dist/esm/src/transaction/__tests/MerklePath.test.js +0 -209
- package/dist/esm/src/transaction/__tests/MerklePath.test.js.map +0 -1
- package/dist/esm/src/transaction/__tests/Transaction.benchmarks.test.js +0 -219
- package/dist/esm/src/transaction/__tests/Transaction.benchmarks.test.js.map +0 -1
- package/dist/esm/src/transaction/__tests/Transaction.test.js +0 -1072
- package/dist/esm/src/transaction/__tests/Transaction.test.js.map +0 -1
- package/dist/esm/src/transaction/__tests/bigtx.vectors.js +0 -7
- package/dist/esm/src/transaction/__tests/bigtx.vectors.js.map +0 -1
- package/dist/esm/src/transaction/__tests/bump.invalid.vectors.js +0 -11
- package/dist/esm/src/transaction/__tests/bump.invalid.vectors.js.map +0 -1
- package/dist/esm/src/transaction/__tests/bump.valid.vectors.js +0 -7
- package/dist/esm/src/transaction/__tests/bump.valid.vectors.js.map +0 -1
- package/dist/esm/src/transaction/__tests/tx.invalid.vectors.js +0 -230
- package/dist/esm/src/transaction/__tests/tx.invalid.vectors.js.map +0 -1
- package/dist/esm/src/transaction/__tests/tx.valid.vectors.js +0 -296
- package/dist/esm/src/transaction/__tests/tx.valid.vectors.js.map +0 -1
- package/dist/esm/src/transaction/broadcasters/__tests/ARC.test.js +0 -246
- package/dist/esm/src/transaction/broadcasters/__tests/ARC.test.js.map +0 -1
- package/dist/esm/src/transaction/broadcasters/__tests/WhatsOnChainBroadcaster.test.js +0 -148
- package/dist/esm/src/transaction/broadcasters/__tests/WhatsOnChainBroadcaster.test.js.map +0 -1
- package/dist/esm/src/transaction/chaintrackers/__tests/WhatsOnChainChainTracker.test.js +0 -155
- package/dist/esm/src/transaction/chaintrackers/__tests/WhatsOnChainChainTracker.test.js.map +0 -1
- package/dist/esm/src/wallet/ScriptTemplateSABPPP.js +0 -37
- package/dist/esm/src/wallet/ScriptTemplateSABPPP.js.map +0 -1
- package/dist/esm/src/wallet/WalletSigner.js +0 -263
- package/dist/esm/src/wallet/WalletSigner.js.map +0 -1
- package/dist/esm/src/wallet/__tests/CachedKeyDeriver.test.js +0 -269
- package/dist/esm/src/wallet/__tests/CachedKeyDeriver.test.js.map +0 -1
- package/dist/esm/src/wallet/__tests/KeyDeriver.test.js +0 -113
- package/dist/esm/src/wallet/__tests/KeyDeriver.test.js.map +0 -1
- package/dist/esm/src/wallet/__tests/ProtoWallet.test.js +0 -475
- package/dist/esm/src/wallet/__tests/ProtoWallet.test.js.map +0 -1
- package/dist/esm/src/wallet/createActionSdk.js +0 -223
- package/dist/esm/src/wallet/createActionSdk.js.map +0 -1
- package/dist/esm/src/wallet/sdk/CachedKeyDeriver.js +0 -174
- package/dist/esm/src/wallet/sdk/CachedKeyDeriver.js.map +0 -1
- package/dist/esm/src/wallet/sdk/CertOps.js +0 -181
- package/dist/esm/src/wallet/sdk/CertOps.js.map +0 -1
- package/dist/esm/src/wallet/sdk/Certificate.js +0 -186
- package/dist/esm/src/wallet/sdk/Certificate.js.map +0 -1
- package/dist/esm/src/wallet/sdk/KeyDeriver.js +0 -174
- package/dist/esm/src/wallet/sdk/KeyDeriver.js.map +0 -1
- package/dist/esm/src/wallet/sdk/ProtoWallet.js +0 -71
- package/dist/esm/src/wallet/sdk/ProtoWallet.js.map +0 -1
- package/dist/esm/src/wallet/sdk/StorageSyncReader.js +0 -2
- package/dist/esm/src/wallet/sdk/StorageSyncReader.js.map +0 -1
- package/dist/esm/src/wallet/sdk/WERR_errors.js +0 -99
- package/dist/esm/src/wallet/sdk/WERR_errors.js.map +0 -1
- package/dist/esm/src/wallet/sdk/Wallet.interfaces.js +0 -2
- package/dist/esm/src/wallet/sdk/Wallet.interfaces.js.map +0 -1
- package/dist/esm/src/wallet/sdk/WalletCrypto.js +0 -168
- package/dist/esm/src/wallet/sdk/WalletCrypto.js.map +0 -1
- package/dist/esm/src/wallet/sdk/WalletError.js +0 -100
- package/dist/esm/src/wallet/sdk/WalletError.js.map +0 -1
- package/dist/esm/src/wallet/sdk/WalletServices.interfaces.js +0 -2
- package/dist/esm/src/wallet/sdk/WalletServices.interfaces.js.map +0 -1
- package/dist/esm/src/wallet/sdk/WalletSigner.interfaces.js +0 -2
- package/dist/esm/src/wallet/sdk/WalletSigner.interfaces.js.map +0 -1
- package/dist/esm/src/wallet/sdk/WalletStorage.interfaces.js +0 -2
- package/dist/esm/src/wallet/sdk/WalletStorage.interfaces.js.map +0 -1
- package/dist/esm/src/wallet/sdk/index.js +0 -15
- package/dist/esm/src/wallet/sdk/index.js.map +0 -1
- package/dist/esm/src/wallet/sdk/types.js +0 -8
- package/dist/esm/src/wallet/sdk/types.js.map +0 -1
- package/dist/esm/src/wallet/sdk/validationHelpers.js +0 -566
- package/dist/esm/src/wallet/sdk/validationHelpers.js.map +0 -1
- package/dist/esm/src/wallet/substrates/__tests/WalletWire.integration.test.js +0 -1962
- package/dist/esm/src/wallet/substrates/__tests/WalletWire.integration.test.js.map +0 -1
- package/dist/esm/src/wallet/substrates/__tests/XDM.test.js +0 -579
- package/dist/esm/src/wallet/substrates/__tests/XDM.test.js.map +0 -1
- package/dist/esm/src/wallet/utilityHelpers.js +0 -275
- package/dist/esm/src/wallet/utilityHelpers.js.map +0 -1
- package/dist/esm/src/wallet/validationHelpers.js +0 -566
- package/dist/esm/src/wallet/validationHelpers.js.map +0 -1
- package/dist/types/src/auth/__tests/Peer.test.d.ts +0 -2
- package/dist/types/src/auth/__tests/Peer.test.d.ts.map +0 -1
- package/dist/types/src/auth/__tests/SessionManager.test.d.ts +0 -2
- package/dist/types/src/auth/__tests/SessionManager.test.d.ts.map +0 -1
- package/dist/types/src/auth/certificates/__tests/Certificate.test.d.ts +0 -2
- package/dist/types/src/auth/certificates/__tests/Certificate.test.d.ts.map +0 -1
- package/dist/types/src/auth/certificates/__tests/MasterCertificate.test.d.ts +0 -2
- package/dist/types/src/auth/certificates/__tests/MasterCertificate.test.d.ts.map +0 -1
- package/dist/types/src/auth/certificates/__tests/VerifiableCertificate.test.d.ts +0 -2
- package/dist/types/src/auth/certificates/__tests/VerifiableCertificate.test.d.ts.map +0 -1
- package/dist/types/src/auth/utils/__tests/cryptononce.test.d.ts +0 -2
- package/dist/types/src/auth/utils/__tests/cryptononce.test.d.ts.map +0 -1
- package/dist/types/src/auth/utils/__tests/getVerifiableCertificates.test.d.ts +0 -2
- package/dist/types/src/auth/utils/__tests/getVerifiableCertificates.test.d.ts.map +0 -1
- package/dist/types/src/auth/utils/__tests/validateCertificates.test.d.ts +0 -2
- package/dist/types/src/auth/utils/__tests/validateCertificates.test.d.ts.map +0 -1
- package/dist/types/src/auth/utils/certificateHelpers.d.ts +0 -26
- package/dist/types/src/auth/utils/certificateHelpers.d.ts.map +0 -1
- package/dist/types/src/compat/__tests/BSM.test.d.ts +0 -2
- package/dist/types/src/compat/__tests/BSM.test.d.ts.map +0 -1
- package/dist/types/src/compat/__tests/ECIES.test.d.ts +0 -2
- package/dist/types/src/compat/__tests/ECIES.test.d.ts.map +0 -1
- package/dist/types/src/compat/__tests/HD.test.d.ts +0 -2
- package/dist/types/src/compat/__tests/HD.test.d.ts.map +0 -1
- package/dist/types/src/compat/__tests/Mnemonic.test.d.ts +0 -2
- package/dist/types/src/compat/__tests/Mnemonic.test.d.ts.map +0 -1
- package/dist/types/src/compat/__tests/Mnemonic.vectors.d.ts +0 -11
- package/dist/types/src/compat/__tests/Mnemonic.vectors.d.ts.map +0 -1
- package/dist/types/src/messages/__tests/EncryptedMessage.test.d.ts +0 -2
- package/dist/types/src/messages/__tests/EncryptedMessage.test.d.ts.map +0 -1
- package/dist/types/src/messages/__tests/SignedMessage.test.d.ts +0 -2
- package/dist/types/src/messages/__tests/SignedMessage.test.d.ts.map +0 -1
- package/dist/types/src/overlay-tools/__tests/LookupResolver.test.d.ts +0 -2
- package/dist/types/src/overlay-tools/__tests/LookupResolver.test.d.ts.map +0 -1
- package/dist/types/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.d.ts +0 -2
- package/dist/types/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.d.ts.map +0 -1
- package/dist/types/src/overlay-tools/__tests/SHIPBroadcaster.test.d.ts +0 -2
- package/dist/types/src/overlay-tools/__tests/SHIPBroadcaster.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/AESGCM.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/AESGCM.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BRC42.private.vectors.d.ts +0 -8
- package/dist/types/src/primitives/__tests/BRC42.private.vectors.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BRC42.public.vectors.d.ts +0 -8
- package/dist/types/src/primitives/__tests/BRC42.public.vectors.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BigNumber.arithmatic.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/BigNumber.arithmatic.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BigNumber.binary.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/BigNumber.binary.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BigNumber.constructor.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/BigNumber.constructor.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BigNumber.dhGroup.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/BigNumber.dhGroup.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BigNumber.fixtures.d.ts +0 -15
- package/dist/types/src/primitives/__tests/BigNumber.fixtures.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BigNumber.serializers.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/BigNumber.serializers.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/BigNumber.utils.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/BigNumber.utils.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/Curve.unit.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/Curve.unit.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/DRBG.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/DRBG.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/DRBG.vectors.d.ts +0 -10
- package/dist/types/src/primitives/__tests/DRBG.vectors.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/ECDH.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/ECDH.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/ECDSA.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/ECDSA.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/HMAC.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/HMAC.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/Hash.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/Hash.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/PBKDF2.vectors.d.ts +0 -68
- package/dist/types/src/primitives/__tests/PBKDF2.vectors.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/PrivateKey.split.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/PrivateKey.split.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/PrivateKey.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/PrivateKey.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/PublicKey.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/PublicKey.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/Random.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/Random.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/Reader.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/Reader.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/ReductionContext.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/ReductionContext.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/Schnorr.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/Schnorr.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/SymmetricKey.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/SymmetricKey.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/SymmetricKey.vectors.d.ts +0 -20
- package/dist/types/src/primitives/__tests/SymmetricKey.vectors.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/Writer.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/Writer.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/bug-31.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/bug-31.test.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/sighash.vectors.d.ts +0 -3
- package/dist/types/src/primitives/__tests/sighash.vectors.d.ts.map +0 -1
- package/dist/types/src/primitives/__tests/utils.test.d.ts +0 -2
- package/dist/types/src/primitives/__tests/utils.test.d.ts.map +0 -1
- package/dist/types/src/script/__tests/Script.test.d.ts +0 -2
- package/dist/types/src/script/__tests/Script.test.d.ts.map +0 -1
- package/dist/types/src/script/__tests/Spend.test.d.ts +0 -2
- package/dist/types/src/script/__tests/Spend.test.d.ts.map +0 -1
- package/dist/types/src/script/__tests/SpendComplex.test.d.ts +0 -2
- package/dist/types/src/script/__tests/SpendComplex.test.d.ts.map +0 -1
- package/dist/types/src/script/__tests/script.invalid.vectors.d.ts +0 -3
- package/dist/types/src/script/__tests/script.invalid.vectors.d.ts.map +0 -1
- package/dist/types/src/script/__tests/script.valid.vectors.d.ts +0 -3
- package/dist/types/src/script/__tests/script.valid.vectors.d.ts.map +0 -1
- package/dist/types/src/script/__tests/spend.valid.vectors.d.ts +0 -3
- package/dist/types/src/script/__tests/spend.valid.vectors.d.ts.map +0 -1
- package/dist/types/src/script/templates/__tests/PushDrop.test.d.ts +0 -2
- package/dist/types/src/script/templates/__tests/PushDrop.test.d.ts.map +0 -1
- package/dist/types/src/totp/__tests/totp.test.d.ts +0 -2
- package/dist/types/src/totp/__tests/totp.test.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/Beef.test.d.ts +0 -2
- package/dist/types/src/transaction/__tests/Beef.test.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/MerklePath.test.d.ts +0 -2
- package/dist/types/src/transaction/__tests/MerklePath.test.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/Transaction.benchmarks.test.d.ts +0 -2
- package/dist/types/src/transaction/__tests/Transaction.benchmarks.test.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/Transaction.test.d.ts +0 -2
- package/dist/types/src/transaction/__tests/Transaction.test.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/bigtx.vectors.d.ts +0 -6
- package/dist/types/src/transaction/__tests/bigtx.vectors.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/bump.invalid.vectors.d.ts +0 -6
- package/dist/types/src/transaction/__tests/bump.invalid.vectors.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/bump.valid.vectors.d.ts +0 -5
- package/dist/types/src/transaction/__tests/bump.valid.vectors.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/tx.invalid.vectors.d.ts +0 -3
- package/dist/types/src/transaction/__tests/tx.invalid.vectors.d.ts.map +0 -1
- package/dist/types/src/transaction/__tests/tx.valid.vectors.d.ts +0 -3
- package/dist/types/src/transaction/__tests/tx.valid.vectors.d.ts.map +0 -1
- package/dist/types/src/transaction/broadcasters/__tests/ARC.test.d.ts +0 -2
- package/dist/types/src/transaction/broadcasters/__tests/ARC.test.d.ts.map +0 -1
- package/dist/types/src/transaction/broadcasters/__tests/WhatsOnChainBroadcaster.test.d.ts +0 -2
- package/dist/types/src/transaction/broadcasters/__tests/WhatsOnChainBroadcaster.test.d.ts.map +0 -1
- package/dist/types/src/transaction/chaintrackers/__tests/WhatsOnChainChainTracker.test.d.ts +0 -2
- package/dist/types/src/transaction/chaintrackers/__tests/WhatsOnChainChainTracker.test.d.ts.map +0 -1
- package/dist/types/src/wallet/ScriptTemplateSABPPP.d.ts +0 -25
- package/dist/types/src/wallet/ScriptTemplateSABPPP.d.ts.map +0 -1
- package/dist/types/src/wallet/WalletSigner.d.ts +0 -110
- package/dist/types/src/wallet/WalletSigner.d.ts.map +0 -1
- package/dist/types/src/wallet/__tests/CachedKeyDeriver.test.d.ts +0 -2
- package/dist/types/src/wallet/__tests/CachedKeyDeriver.test.d.ts.map +0 -1
- package/dist/types/src/wallet/__tests/KeyDeriver.test.d.ts +0 -2
- package/dist/types/src/wallet/__tests/KeyDeriver.test.d.ts.map +0 -1
- package/dist/types/src/wallet/__tests/ProtoWallet.test.d.ts +0 -2
- package/dist/types/src/wallet/__tests/ProtoWallet.test.d.ts.map +0 -1
- package/dist/types/src/wallet/createActionSdk.d.ts +0 -8
- package/dist/types/src/wallet/createActionSdk.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/CachedKeyDeriver.d.ts +0 -94
- package/dist/types/src/wallet/sdk/CachedKeyDeriver.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/CertOps.d.ts +0 -63
- package/dist/types/src/wallet/sdk/CertOps.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/Certificate.d.ts +0 -77
- package/dist/types/src/wallet/sdk/Certificate.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/KeyDeriver.d.ts +0 -128
- package/dist/types/src/wallet/sdk/KeyDeriver.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/ProtoWallet.d.ts +0 -30
- package/dist/types/src/wallet/sdk/ProtoWallet.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/StorageSyncReader.d.ts +0 -102
- package/dist/types/src/wallet/sdk/StorageSyncReader.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/WERR_errors.d.ts +0 -84
- package/dist/types/src/wallet/sdk/WERR_errors.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/Wallet.interfaces.d.ts +0 -1036
- package/dist/types/src/wallet/sdk/Wallet.interfaces.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/WalletCrypto.d.ts +0 -31
- package/dist/types/src/wallet/sdk/WalletCrypto.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/WalletError.d.ts +0 -46
- package/dist/types/src/wallet/sdk/WalletError.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/WalletServices.interfaces.d.ts +0 -293
- package/dist/types/src/wallet/sdk/WalletServices.interfaces.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/WalletSigner.interfaces.d.ts +0 -48
- package/dist/types/src/wallet/sdk/WalletSigner.interfaces.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/WalletStorage.interfaces.d.ts +0 -296
- package/dist/types/src/wallet/sdk/WalletStorage.interfaces.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/index.d.ts +0 -15
- package/dist/types/src/wallet/sdk/index.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/types.d.ts +0 -56
- package/dist/types/src/wallet/sdk/types.d.ts.map +0 -1
- package/dist/types/src/wallet/sdk/validationHelpers.d.ts +0 -301
- package/dist/types/src/wallet/sdk/validationHelpers.d.ts.map +0 -1
- package/dist/types/src/wallet/substrates/__tests/WalletWire.integration.test.d.ts +0 -2
- package/dist/types/src/wallet/substrates/__tests/WalletWire.integration.test.d.ts.map +0 -1
- package/dist/types/src/wallet/substrates/__tests/XDM.test.d.ts +0 -5
- package/dist/types/src/wallet/substrates/__tests/XDM.test.d.ts.map +0 -1
- package/dist/types/src/wallet/utilityHelpers.d.ts +0 -142
- package/dist/types/src/wallet/utilityHelpers.d.ts.map +0 -1
- package/dist/types/src/wallet/validationHelpers.d.ts +0 -301
- package/dist/types/src/wallet/validationHelpers.d.ts.map +0 -1
- package/docs/README.md +0 -21
- /package/docs/{auth.md → reference/auth.md} +0 -0
- /package/docs/{compat.md → reference/compat.md} +0 -0
- /package/docs/{identity.md → reference/identity.md} +0 -0
- /package/docs/{kvstore.md → reference/kvstore.md} +0 -0
- /package/docs/{messages.md → reference/messages.md} +0 -0
- /package/docs/{overlay-tools.md → reference/overlay-tools.md} +0 -0
- /package/docs/{primitives.md → reference/primitives.md} +0 -0
- /package/docs/{registry.md → reference/registry.md} +0 -0
- /package/docs/{script.md → reference/script.md} +0 -0
- /package/docs/{storage.md → reference/storage.md} +0 -0
- /package/docs/{totp.md → reference/totp.md} +0 -0
- /package/docs/{transaction.md → reference/transaction.md} +0 -0
- /package/docs/{wallet.md → reference/wallet.md} +0 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
# Configuring HTTP Clients
|
|
2
|
+
|
|
3
|
+
This guide covers how to configure HTTP clients for use with the BSV TypeScript SDK, focusing on Axios and alternatives.
|
|
4
|
+
|
|
5
|
+
## Using Axios with the SDK
|
|
6
|
+
|
|
7
|
+
The BSV TypeScript SDK allows you to provide your own HTTP client implementation for network requests. This is particularly useful when you need custom configuration for transaction broadcasting, network queries, or when working in specific environments.
|
|
8
|
+
|
|
9
|
+
### Basic Axios Setup
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import axios from 'axios'
|
|
13
|
+
import { BSV } from '@bsv/sdk'
|
|
14
|
+
|
|
15
|
+
// Create a configured Axios instance
|
|
16
|
+
const customAxios = axios.create({
|
|
17
|
+
timeout: 10000, // 10 seconds
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
'Accept': 'application/json'
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
// Use the custom client when broadcasting transactions
|
|
25
|
+
const broadcastTransaction = async (tx) => {
|
|
26
|
+
try {
|
|
27
|
+
// Convert the transaction to hex format
|
|
28
|
+
const txHex = tx.toHex()
|
|
29
|
+
|
|
30
|
+
// Use your custom axios instance for the request
|
|
31
|
+
const response = await customAxios.post('https://api.example.com/v1/tx/broadcast', {
|
|
32
|
+
rawTx: txHex
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
return response.data
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error('Error broadcasting transaction:', error)
|
|
38
|
+
throw error
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Using Axios with ARC Broadcaster
|
|
44
|
+
|
|
45
|
+
The ARC (Alternative Revenue Channel) broadcaster can be configured with a custom HTTP client:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import axios from 'axios'
|
|
49
|
+
import { ARC } from '@bsv/sdk'
|
|
50
|
+
|
|
51
|
+
// Configure Axios
|
|
52
|
+
const customAxios = axios.create({
|
|
53
|
+
timeout: 15000,
|
|
54
|
+
headers: {
|
|
55
|
+
'Authorization': 'Bearer YOUR_API_KEY',
|
|
56
|
+
'Content-Type': 'application/json'
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
// Create an ARC instance with custom HTTP client
|
|
61
|
+
const arc = new ARC({
|
|
62
|
+
apiUrl: 'https://api.taal.com/arc',
|
|
63
|
+
httpClient: customAxios
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
// Use the configured ARC instance to broadcast a transaction
|
|
67
|
+
const broadcastWithARC = async (tx) => {
|
|
68
|
+
try {
|
|
69
|
+
// ARC expects hex format
|
|
70
|
+
const txid = await arc.broadcast(tx.toHex())
|
|
71
|
+
return txid
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error('ARC broadcast error:', error)
|
|
74
|
+
throw error
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Advanced HTTP Client Configuration
|
|
80
|
+
|
|
81
|
+
### Handling Timeouts and Retries
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import axios from 'axios'
|
|
85
|
+
import axiosRetry from 'axios-retry'
|
|
86
|
+
|
|
87
|
+
// Create a custom Axios instance
|
|
88
|
+
const client = axios.create({
|
|
89
|
+
timeout: 30000 // 30 seconds
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
// Configure automatic retries
|
|
93
|
+
axiosRetry(client, {
|
|
94
|
+
retries: 3,
|
|
95
|
+
retryDelay: axiosRetry.exponentialDelay,
|
|
96
|
+
retryCondition: (error) => {
|
|
97
|
+
// Retry on network errors or 5xx responses
|
|
98
|
+
return axiosRetry.isNetworkOrIdempotentRequestError(error) ||
|
|
99
|
+
(error.response && error.response.status >= 500)
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// Add request interceptor for logging
|
|
104
|
+
client.interceptors.request.use(request => {
|
|
105
|
+
console.log('Starting request:', request.url)
|
|
106
|
+
return request
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
// Add response interceptor for error handling
|
|
110
|
+
client.interceptors.response.use(
|
|
111
|
+
response => response,
|
|
112
|
+
error => {
|
|
113
|
+
if (error.response) {
|
|
114
|
+
console.error('Server responded with error:', error.response.status, error.response.data)
|
|
115
|
+
} else if (error.request) {
|
|
116
|
+
console.error('No response received:', error.request)
|
|
117
|
+
} else {
|
|
118
|
+
console.error('Error setting up request:', error.message)
|
|
119
|
+
}
|
|
120
|
+
return Promise.reject(error)
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Environment-specific Configuration
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import axios from 'axios'
|
|
129
|
+
|
|
130
|
+
const getConfiguredClient = (environment = 'production') => {
|
|
131
|
+
const baseURLs = {
|
|
132
|
+
production: 'https://api.taal.com',
|
|
133
|
+
staging: 'https://api-staging.taal.com',
|
|
134
|
+
development: 'http://localhost:3000'
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const timeouts = {
|
|
138
|
+
production: 10000,
|
|
139
|
+
staging: 15000,
|
|
140
|
+
development: 30000
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return axios.create({
|
|
144
|
+
baseURL: baseURLs[environment],
|
|
145
|
+
timeout: timeouts[environment],
|
|
146
|
+
headers: {
|
|
147
|
+
'Content-Type': 'application/json'
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const productionClient = getConfiguredClient('production')
|
|
153
|
+
const developmentClient = getConfiguredClient('development')
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## SDK Built-in HTTP Clients
|
|
157
|
+
|
|
158
|
+
The BSV TypeScript SDK comes with built-in HTTP client implementations that you can use directly. The SDK automatically selects the appropriate client based on your environment through the `defaultHttpClient()` function.
|
|
159
|
+
|
|
160
|
+
### Using NodejsHttpClient
|
|
161
|
+
|
|
162
|
+
The SDK includes a Node.js-specific HTTP client implementation that uses the Node.js `https` module:
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
import { NodejsHttpClient } from '@bsv/sdk'
|
|
166
|
+
import https from 'https'
|
|
167
|
+
|
|
168
|
+
// Create a NodejsHttpClient instance
|
|
169
|
+
const nodeClient = new NodejsHttpClient(https)
|
|
170
|
+
|
|
171
|
+
// Use with ARC
|
|
172
|
+
const arc = new ARC('https://api.taal.com/arc', {
|
|
173
|
+
apiKey: 'your-api-key',
|
|
174
|
+
httpClient: nodeClient
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
// Example of broadcasting a transaction
|
|
178
|
+
const broadcastTx = async (tx) => {
|
|
179
|
+
try {
|
|
180
|
+
const txid = await arc.broadcast(tx)
|
|
181
|
+
console.log('Transaction broadcast successful. TXID:', txid)
|
|
182
|
+
return txid
|
|
183
|
+
} catch (error) {
|
|
184
|
+
console.error('Error broadcasting transaction:', error)
|
|
185
|
+
throw error
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Using Built-in FetchHttpClient
|
|
191
|
+
|
|
192
|
+
In browser environments, the SDK provides a `FetchHttpClient` implementation that uses the Fetch API:
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
import { FetchHttpClient, ARC } from '@bsv/sdk'
|
|
196
|
+
|
|
197
|
+
// Create a FetchHttpClient instance with custom fetch options
|
|
198
|
+
const fetchClient = new FetchHttpClient(window.fetch.bind(window))
|
|
199
|
+
|
|
200
|
+
// Use with ARC
|
|
201
|
+
const arc = new ARC('https://api.taal.com/arc', {
|
|
202
|
+
apiKey: 'your-api-key',
|
|
203
|
+
httpClient: fetchClient
|
|
204
|
+
})
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Using defaultHttpClient
|
|
208
|
+
|
|
209
|
+
The SDK provides a `defaultHttpClient()` function that automatically selects the appropriate HTTP client based on the environment:
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
import { defaultHttpClient, ARC } from '@bsv/sdk'
|
|
213
|
+
|
|
214
|
+
// Get the default HTTP client for the current environment
|
|
215
|
+
const client = defaultHttpClient()
|
|
216
|
+
|
|
217
|
+
// Use with ARC
|
|
218
|
+
const arc = new ARC('https://api.taal.com/arc', {
|
|
219
|
+
apiKey: 'your-api-key',
|
|
220
|
+
httpClient: client
|
|
221
|
+
})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Alternative HTTP Clients
|
|
225
|
+
|
|
226
|
+
While the SDK provides built-in HTTP clients and Axios is commonly used, you can implement your own HTTP clients with the BSV TypeScript SDK:
|
|
227
|
+
|
|
228
|
+
### Using Fetch API
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
import { ARC } from '@bsv/sdk'
|
|
232
|
+
|
|
233
|
+
// Create a fetch-based HTTP client
|
|
234
|
+
const fetchClient = {
|
|
235
|
+
post: async (url, data, options = {}) => {
|
|
236
|
+
const response = await fetch(url, {
|
|
237
|
+
method: 'POST',
|
|
238
|
+
headers: {
|
|
239
|
+
'Content-Type': 'application/json',
|
|
240
|
+
...options.headers
|
|
241
|
+
},
|
|
242
|
+
body: JSON.stringify(data)
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
if (!response.ok) {
|
|
246
|
+
const errorText = await response.text()
|
|
247
|
+
throw new Error(`HTTP error ${response.status}: ${errorText}`)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return await response.json()
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
get: async (url, options = {}) => {
|
|
254
|
+
const response = await fetch(url, {
|
|
255
|
+
method: 'GET',
|
|
256
|
+
headers: {
|
|
257
|
+
'Accept': 'application/json',
|
|
258
|
+
...options.headers
|
|
259
|
+
}
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
if (!response.ok) {
|
|
263
|
+
const errorText = await response.text()
|
|
264
|
+
throw new Error(`HTTP error ${response.status}: ${errorText}`)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return await response.json()
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Use with ARC
|
|
272
|
+
const arc = new ARC({
|
|
273
|
+
apiUrl: 'https://api.taal.com/arc',
|
|
274
|
+
httpClient: fetchClient
|
|
275
|
+
})
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Testing and Mocking HTTP Clients
|
|
279
|
+
|
|
280
|
+
When testing your application, you may want to mock HTTP responses:
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
import { ARC } from '@bsv/sdk'
|
|
284
|
+
|
|
285
|
+
// Create a mock HTTP client for testing
|
|
286
|
+
const mockHttpClient = {
|
|
287
|
+
post: jest.fn().mockResolvedValue({ data: { txid: '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' } }),
|
|
288
|
+
get: jest.fn().mockResolvedValue({ data: { status: 'confirmed' } })
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Create an ARC instance with the mock client
|
|
292
|
+
const arc = new ARC({
|
|
293
|
+
apiUrl: 'https://api.example.com/arc',
|
|
294
|
+
httpClient: mockHttpClient
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
// Test transaction broadcasting
|
|
298
|
+
const testBroadcast = async () => {
|
|
299
|
+
const mockTxHex = '0100000001...'
|
|
300
|
+
const result = await arc.broadcast(mockTxHex)
|
|
301
|
+
|
|
302
|
+
// Verify the mock was called correctly
|
|
303
|
+
expect(mockHttpClient.post).toHaveBeenCalledWith(
|
|
304
|
+
'https://api.example.com/arc/tx',
|
|
305
|
+
{ rawTx: mockTxHex },
|
|
306
|
+
expect.any(Object)
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
return result
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Implementing a Custom HTTP Client
|
|
314
|
+
|
|
315
|
+
You can create your own HTTP client implementation by implementing the `HttpClient` interface from the SDK. This gives you complete control over how HTTP requests are handled:
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
import { HttpClient, HttpClientResponse, HttpClientRequestOptions, ARC } from '@bsv/sdk'
|
|
319
|
+
|
|
320
|
+
// Implement the HttpClient interface
|
|
321
|
+
class CustomHttpClient implements HttpClient {
|
|
322
|
+
constructor(private readonly options: { timeout?: number } = {}) {}
|
|
323
|
+
|
|
324
|
+
async request<T = any>(
|
|
325
|
+
url: string,
|
|
326
|
+
options: HttpClientRequestOptions
|
|
327
|
+
): Promise<HttpClientResponse<T>> {
|
|
328
|
+
console.log(`Making ${options.method} request to ${url}`)
|
|
329
|
+
|
|
330
|
+
try {
|
|
331
|
+
// Set up timeout
|
|
332
|
+
const timeout = this.options.timeout || 10000
|
|
333
|
+
const controller = new AbortController()
|
|
334
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout)
|
|
335
|
+
|
|
336
|
+
// Prepare fetch options
|
|
337
|
+
const fetchOptions: RequestInit = {
|
|
338
|
+
method: options.method || 'GET',
|
|
339
|
+
headers: options.headers,
|
|
340
|
+
signal: controller.signal,
|
|
341
|
+
body: options.data ? JSON.stringify(options.data) : undefined
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Make the request
|
|
345
|
+
const response = await fetch(url, fetchOptions)
|
|
346
|
+
clearTimeout(timeoutId)
|
|
347
|
+
|
|
348
|
+
// Parse response
|
|
349
|
+
let data: any
|
|
350
|
+
const contentType = response.headers.get('content-type')
|
|
351
|
+
if (contentType && contentType.includes('application/json')) {
|
|
352
|
+
data = await response.json()
|
|
353
|
+
} else {
|
|
354
|
+
data = await response.text()
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Return formatted response
|
|
358
|
+
return {
|
|
359
|
+
status: response.status,
|
|
360
|
+
statusText: response.statusText,
|
|
361
|
+
ok: response.ok,
|
|
362
|
+
data
|
|
363
|
+
}
|
|
364
|
+
} catch (error) {
|
|
365
|
+
console.error('Request failed:', error)
|
|
366
|
+
return {
|
|
367
|
+
status: 500,
|
|
368
|
+
statusText: error.message || 'Request failed',
|
|
369
|
+
ok: false,
|
|
370
|
+
data: { error: error.message }
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// Use the custom client with ARC
|
|
377
|
+
const customClient = new CustomHttpClient({ timeout: 15000 })
|
|
378
|
+
const arc = new ARC('https://api.taal.com/arc', {
|
|
379
|
+
apiKey: 'your-api-key',
|
|
380
|
+
httpClient: customClient
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
// Example broadcasting a transaction with the custom client
|
|
384
|
+
const broadcastTx = async (tx) => {
|
|
385
|
+
try {
|
|
386
|
+
// Make sure to use toHex() for proper serialization
|
|
387
|
+
const txHex = tx.toHex()
|
|
388
|
+
const result = await arc.broadcast(tx)
|
|
389
|
+
|
|
390
|
+
// Transaction ID needs specific handling
|
|
391
|
+
console.log('Transaction broadcast successful. TXID:', result.txid)
|
|
392
|
+
return result
|
|
393
|
+
} catch (error) {
|
|
394
|
+
console.error('Error broadcasting transaction:', error)
|
|
395
|
+
throw error
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## Best Practices
|
|
401
|
+
|
|
402
|
+
1. **Always set timeouts** - Network requests can hang indefinitely without proper timeouts
|
|
403
|
+
2. **Implement retries** - Especially for transaction broadcasting, retries can improve reliability
|
|
404
|
+
3. **Add proper error handling** - Parse and handle HTTP errors appropriately
|
|
405
|
+
4. **Configure request logging** - Log requests and responses for debugging purposes
|
|
406
|
+
5. **Use environment variables** - Store API keys and endpoints in environment variables
|
|
407
|
+
6. **Consider rate limiting** - Implement backoff strategies for rate-limited APIs
|
|
408
|
+
7. **Use the built-in clients** - The SDK's `defaultHttpClient()` handles environment detection automatically
|
|
409
|
+
|
|
410
|
+
## Related Resources
|
|
411
|
+
|
|
412
|
+
- [Axios Documentation](https://axios-http.com/docs/intro)
|
|
413
|
+
- [ARC API Reference](../reference/arc.md)
|
|
414
|
+
- [Transaction Broadcasting Guide](./transaction-monitoring.md)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# How-To Guides
|
|
2
|
+
|
|
3
|
+
Practical, problem-oriented guides to help you accomplish specific tasks with the BSV TypeScript SDK.
|
|
4
|
+
|
|
5
|
+
## Transaction Management
|
|
6
|
+
|
|
7
|
+
### [Transaction Signing Methods](./transaction-signing-methods.md)
|
|
8
|
+
- `WalletClient` approach for secure key management
|
|
9
|
+
- Low-level API approach for direct control
|
|
10
|
+
- Comparison of different signing methods
|
|
11
|
+
- Best practices for transaction signing
|
|
12
|
+
|
|
13
|
+
### [Creating Transactions with Direct Interfaces](./direct-transaction-creation.md)
|
|
14
|
+
- Lower-level transaction construction using direct SDK interfaces
|
|
15
|
+
- Custom transaction types not supported by `WalletClient`
|
|
16
|
+
- Precise control over UTXO selection
|
|
17
|
+
- Educational examples for understanding transaction structure
|
|
18
|
+
|
|
19
|
+
## Network Integration
|
|
20
|
+
|
|
21
|
+
### [Configuring HTTP Clients](./http-client-configuration.md)
|
|
22
|
+
- Axios integration and setup
|
|
23
|
+
- Custom request timeout configuration
|
|
24
|
+
- Error handling and retries
|
|
25
|
+
- Alternative HTTP client options
|
|
26
|
+
- Browser and Node.js environment considerations
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
*More guides are planned for future releases. Check back regularly for updates on transaction batching, security best practices, wallet integration, and more advanced topics.*
|