@smartledger/bsv 5.5.3 → 6.0.1

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/README.md +38 -38
  3. package/bin/cli.js +35 -5
  4. package/bsv-covenant.min.js +6 -6
  5. package/bsv-gdaf.min.js +2 -2
  6. package/bsv-ltp.min.js +2 -2
  7. package/bsv-shamir.min.js +1 -1
  8. package/bsv-smartcontract.min.js +6 -6
  9. package/bsv-statuslist.min.js +5 -5
  10. package/bsv-vcjwt.min.js +1 -1
  11. package/bsv.bundle.js +2 -2
  12. package/bsv.d.ts +289 -10
  13. package/bsv.min.js +2 -2
  14. package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
  15. package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
  16. package/docs/getting-started/INSTALLATION.md +23 -23
  17. package/docs/getting-started/QUICK_START.md +7 -7
  18. package/docs/migration/FROM_BSV_1_5_6.md +5 -5
  19. package/index.js +4 -0
  20. package/lib/crypto/ecdsa.js +13 -0
  21. package/lib/crypto/shamir.js +16 -4
  22. package/lib/gdaf/did-resolver.js +3 -1
  23. package/lib/gdaf/smartledger-anchor.js +154 -12
  24. package/lib/ltp/anchor.js +16 -3
  25. package/lib/ltp/obligation.js +56 -8
  26. package/lib/ltp/proof.js +4 -2
  27. package/lib/ltp/right.js +86 -11
  28. package/lib/ordinals/README.md +170 -0
  29. package/lib/ordinals/bsv20.js +185 -0
  30. package/lib/ordinals/index.js +49 -0
  31. package/lib/ordinals/inscription.js +159 -0
  32. package/lib/ordinals/ordlock.js +560 -0
  33. package/lib/smart_contract/builder.js +27 -3
  34. package/lib/smart_contract/covenant.js +37 -10
  35. package/lib/smart_contract/covenant_builder.js +7 -5
  36. package/lib/smart_contract/index.js +28 -15
  37. package/lib/smart_contract/preimage.js +7 -7
  38. package/lib/smart_contract/pushtx.js +47 -7
  39. package/lib/smart_contract/token.js +69 -1
  40. package/lib/spv/headerchain.js +77 -0
  41. package/lib/spv/index.js +16 -0
  42. package/lib/spv/merkleproof.js +108 -0
  43. package/lib/statuslist/index.js +65 -24
  44. package/lib/vcjwt/index.js +6 -0
  45. package/package.json +1 -1
  46. package/test/credentials-test.js +22 -19
  47. package/test/crypto/shamir.js +9 -1
  48. package/test/crypto/shamir_rngcap.js +29 -0
  49. package/test/gdaf/anchor_spv.js +163 -0
  50. package/test/ltp/verify_failclosed.js +134 -0
  51. package/test/ordinals/bsv20.js +126 -0
  52. package/test/ordinals/inscription.js +71 -0
  53. package/test/ordinals/ordlock.js +552 -0
  54. package/test/smart_contract/extract_field.js +61 -0
  55. package/test/smart_contract/nonenforcing_guard.js +44 -0
  56. package/test/smart_contract/ordinal_transfer.js +83 -0
  57. package/test/smart_contract/sighash_marketplace.js +110 -0
  58. package/test/spv/headerchain.js +86 -0
  59. package/test/spv/merkleproof.js +133 -0
  60. package/test/statuslist/failclosed.js +78 -0
package/bsv.d.ts CHANGED
@@ -14,9 +14,24 @@ declare module '@smartledger/bsv' {
14
14
  export namespace crypto {
15
15
  class BN { }
16
16
 
17
- namespace ECDSA {
18
- function sign(message: Buffer, key: PrivateKey): Signature;
19
- function verify(hashbuf: Buffer, sig: Signature, pubkey: PublicKey, endian?: 'little'): boolean;
17
+ class ECDSA {
18
+ hashbuf?: Buffer;
19
+ sig?: Signature;
20
+ pubkey?: PublicKey;
21
+ /** Result of the last verify() call. */
22
+ verified?: boolean;
23
+ /**
24
+ * @returns the ECDSA INSTANCE (always truthy) — the pass/fail result is on
25
+ * `.verified`. Treating this return value as a boolean silently accepts
26
+ * forged signatures; read `.verified` or use `verifyBool()`.
27
+ */
28
+ verify(): this;
29
+ /** Boolean verification — true only when the signature is valid (the safe form). */
30
+ verifyBool(): boolean;
31
+ /** Static: sign a hash. */
32
+ static sign(message: Buffer, key: PrivateKey): Signature;
33
+ /** Static: returns a real boolean (safe). */
34
+ static verify(hashbuf: Buffer, sig: Signature, pubkey: PublicKey, endian?: 'little'): boolean;
20
35
  }
21
36
 
22
37
  namespace Hash {
@@ -646,6 +661,54 @@ declare module '@smartledger/bsv' {
646
661
  function parseAnchorPayload(opReturnData: string): AnchorParseResult;
647
662
  }
648
663
 
664
+ // -------- SPV (trustless Merkle inclusion proofs) -------------------
665
+
666
+ export namespace SPV {
667
+ /** A Merkle branch proof. All hashes are DISPLAY-order hex; a node of '*' means "duplicate the working hash". */
668
+ interface MerkleProof { txid: string; index: number; nodes: string[]; merkleRoot: string; }
669
+ interface InclusionParams {
670
+ txid: string;
671
+ index: number;
672
+ nodes: string[];
673
+ /** a bsv.BlockHeader, an 80-byte Buffer, or 80-byte hex. */
674
+ header: any;
675
+ /** default true — require the header to meet its proof-of-work target. */
676
+ requirePow?: boolean;
677
+ }
678
+ interface InclusionResult {
679
+ valid: boolean;
680
+ rootMatches: boolean;
681
+ powValid: boolean;
682
+ merkleRoot: string;
683
+ blockHash: string;
684
+ }
685
+ /** Recompute the Merkle root from a branch proof (display-order hex). */
686
+ function merkleRootFromBranch(txid: string, index: number, nodes: string[]): string;
687
+ /** Verify a branch proof against an expected root. */
688
+ function verifyMerkleProof(proof: MerkleProof): boolean;
689
+ /** Verify a tx is included in a block: branch -> root, root == header.merkleRoot, PoW. */
690
+ function verifyTxInclusion(params: InclusionParams): InclusionResult;
691
+
692
+ interface HeaderChainResult {
693
+ valid: boolean;
694
+ reason?: string;
695
+ count: number;
696
+ anchorHash?: string;
697
+ tipHash?: string;
698
+ work?: number;
699
+ }
700
+ /**
701
+ * Verify consecutive headers (oldest->newest): each links to the previous and
702
+ * meets its PoW target; optionally the tip/anchor must equal opts.trustedHash.
703
+ * Validates linkage + per-header PoW, NOT the difficulty-retarget schedule —
704
+ * supply a trusted checkpoint hash for adversarial settings.
705
+ */
706
+ function verifyHeaderChain(
707
+ headers: Array<any>,
708
+ opts?: { requirePow?: boolean; trustedHash?: string }
709
+ ): HeaderChainResult;
710
+ }
711
+
649
712
  // -------- GDAF (Global Digital Attestation Framework) ---------------
650
713
 
651
714
  export class GDAF {
@@ -760,8 +823,14 @@ declare module '@smartledger/bsv' {
760
823
  // to evolving internal shapes.
761
824
 
762
825
  export namespace SmartContract {
826
+ /**
827
+ * @deprecated NON-ENFORCING — builds a constant hash-lock that reduces to
828
+ * plain P2PK and binds nothing about the spend. Use `policy()` (declarative
829
+ * OP_PUSH_TX), `PushTx`, `Token`, or `valueCovenant`. `createFromP2PKH` throws
830
+ * unless the instance is constructed with `{ allowNonEnforcing: true }`.
831
+ */
763
832
  class Covenant {
764
- constructor(privateKey: PrivateKey, options?: object);
833
+ constructor(privateKey: PrivateKey, options?: { allowNonEnforcing?: boolean; [key: string]: any });
765
834
  [key: string]: any;
766
835
  }
767
836
  class Preimage {
@@ -772,8 +841,13 @@ declare module '@smartledger/bsv' {
772
841
  constructor(sighashType: number);
773
842
  [key: string]: any;
774
843
  }
844
+ /**
845
+ * @deprecated NON-ENFORCING — same constant hash-lock flaw as Covenant (reduces
846
+ * to P2PK). Use `policy()` / `PushTx` / `Token`. `buildLockingScript` and
847
+ * `createCovenant` throw unless constructed with `{ allowNonEnforcing: true }`.
848
+ */
775
849
  class Builder {
776
- constructor(privateKey: PrivateKey, options?: object);
850
+ constructor(privateKey: PrivateKey, options?: { allowNonEnforcing?: boolean; [key: string]: any });
777
851
  [key: string]: any;
778
852
  }
779
853
  class UTXOGenerator {
@@ -836,6 +910,10 @@ declare module '@smartledger/bsv' {
836
910
  function ownershipToken(fee: number, ownerHash: Buffer): Script;
837
911
  /** OP_PUSH_TX value/output covenant: coins can only go where the covenant says. */
838
912
  function valueCovenant(expectedHashOutputs: Buffer): Script;
913
+ /** Ordinal covenant locking script (value-preserving; safe for 1-sat ordinals). */
914
+ function ordinalLock(owner: Buffer, auth?: Authorizer): Script;
915
+ /** Transfer a 1-sat (or N-sat) ordinal without burning it (see Token.transferOrdinal). */
916
+ function transferOrdinal(signer: any, newOwnerHash: Buffer, spend: Transaction, ordinalSats: number, lockingScript: Script, opts?: OrdinalOpts): Script;
839
917
 
840
918
  namespace CovenantHelpers {
841
919
  const SIGHASH: number;
@@ -850,26 +928,73 @@ declare module '@smartledger/bsv' {
850
928
  function scriptNum(n: number): Buffer;
851
929
  }
852
930
 
931
+ interface GrindOpts { maxTries?: number; start?: number; field?: 'nLockTime' | 'sequence'; sighashType?: number; }
932
+ interface GrindResult { preimage: Buffer; tries: number; field?: string; nonce?: number; }
933
+
853
934
  namespace PushTx {
854
935
  const Gx: Buffer;
855
936
  const PUBKEY: Buffer;
856
- function pushTxCore(script: Script): Script;
937
+ /** SIGHASH_ALL|FORKID (0x41) — the default. */
938
+ const SIGHASH_ALL_FORKID: number;
939
+ /** SIGHASH_SINGLE|FORKID (0x43). */
940
+ const SIGHASH_SINGLE_FORKID: number;
941
+ /** SIGHASH_SINGLE|ANYONECANPAY|FORKID (0xc3) — marketplace / partially-signed. */
942
+ const SIGHASH_SINGLE_ANYONECANPAY_FORKID: number;
943
+ /** SIGHASH_ALL|ANYONECANPAY|FORKID (0xc1) — commit ALL outputs, open inputs (OrdLock). */
944
+ const SIGHASH_ALL_ANYONECANPAY_FORKID: number;
945
+ /**
946
+ * Append the in-script signature generator + OP_CHECKSIG. `opts.sighashType`
947
+ * sets the flag baked into the synthetic signature (default 0x41); the spender
948
+ * must push the matching BIP-143 preimage (grind with the same sighashType).
949
+ */
950
+ function pushTxCore(script: Script, opts?: { sighashType?: number }): Script;
857
951
  function authenticator(): Script;
952
+ /** Assert the spend is SIGHASH_ALL|FORKID. */
953
+ function assertSighashAll(script: Script): Script;
954
+ /** Assert the spend uses a specific SIGHASH flag (pairs with pushTxCore/grind opts). */
955
+ function assertSighashType(script: Script, sighashType: number): Script;
858
956
  function extractHashOutputs(script: Script): Script;
859
957
  function hashOutputs(outputs: Transaction.Output[]): Buffer;
860
958
  function valueCovenant(expectedHashOutputs: Buffer): Script;
861
959
  function sFromPreimage(preimage: Buffer): Buffer | null;
862
- function grind(spend: Transaction, inputIndex: number, lockingScript: Script, satoshis: number, maxTries?: number): { preimage: Buffer; tries: number };
960
+ /** Grind a malleable field until the in-script signature is canonical. Legacy: a bare number is maxTries. */
961
+ function grind(spend: Transaction, inputIndex: number, lockingScript: Script, satoshis: number, opts?: GrindOpts | number): GrindResult;
863
962
  }
864
963
 
865
964
  namespace PELS {
866
965
  function pelsCovenant(fee: number): Script;
867
966
  }
868
967
 
968
+ /** Pluggable authorization scheme for Token covenants. */
969
+ interface Authorizer {
970
+ commit(owner: any): Buffer;
971
+ emit(script: Script): Script;
972
+ unlockArgs(spend: Transaction, inputIndex: number, lockingScript: Script, satoshis: number, signer: any): any[];
973
+ }
974
+ namespace Authorizers {
975
+ /** Single-key (default): owner id = HASH160(pubkey). */
976
+ function singleKey(): Authorizer;
977
+ /** m-of-n multisig authorizer. */
978
+ function multisig(m: number, keys: PublicKey[]): Authorizer;
979
+ /** Arbitrary predicate authorizer over a fixed 20-byte commitment. */
980
+ function predicate(commit: Buffer, emit: (script: Script) => Script): Authorizer;
981
+ }
982
+ interface TransferOpts { auth?: Authorizer; inputIndex?: number; grind?: GrindOpts; allowLowValue?: boolean; }
983
+ interface MultiLayout { before?: Buffer; after?: Buffer; tokenValue: Buffer; }
984
+ interface OrdinalOpts { auth?: Authorizer; inputIndex?: number; tokenIndex?: number; grind?: GrindOpts; }
869
985
  namespace Token {
870
- function ownershipToken(fee: number, ownerHash: Buffer): Script;
871
- function ownerId(secret: Buffer): Buffer;
872
- function unlockTransfer(ownerSecret: Buffer, newOwnerHash: Buffer, preimage: Buffer): Script;
986
+ /** Single-output perpetual NFT (value = input - fee). NOT for 1-sat ordinals — use ordinalLock/transferOrdinal. */
987
+ function ownershipToken(fee: number, owner: Buffer, auth?: Authorizer): Script;
988
+ /** Multi-output token: the recreated output carries its own value and may sit among other outputs. */
989
+ function ownershipTokenMulti(owner: Buffer, auth?: Authorizer): Script;
990
+ /** Value-preserving ordinal covenant (safe for 1-sat ordinals). */
991
+ function ordinalLock(owner: Buffer, auth?: Authorizer): Script;
992
+ /** Owner id from a key (HASH160 of the pubkey) for the single-key authorizer. */
993
+ function ownerId(key: PrivateKey | PublicKey): Buffer;
994
+ function unlockTransfer(signer: any, newOwnerHash: Buffer, spend: Transaction, satoshis: number, lockingScript: Script, opts?: TransferOpts): Script;
995
+ function unlockTransferMulti(signer: any, newOwnerHash: Buffer, spend: Transaction, satoshis: number, lockingScript: Script, layout: MultiLayout, opts?: TransferOpts): Script;
996
+ /** Transfer a 1-sat (or N-sat) ordinal without burning it; recreates the token output at exactly `ordinalSats`. */
997
+ function transferOrdinal(signer: any, newOwnerHash: Buffer, spend: Transaction, ordinalSats: number, lockingScript: Script, opts?: OrdinalOpts): Script;
873
998
  }
874
999
 
875
1000
  interface LockSpec { lock: Script; meta: { [k: string]: any }; [k: string]: any; }
@@ -916,6 +1041,160 @@ declare module '@smartledger/bsv' {
916
1041
  }
917
1042
  }
918
1043
 
1044
+ // -------- Ordinals (1Sat Ordinals inscriptions + marketplace) -------
1045
+
1046
+ export namespace Ordinals {
1047
+ interface InscriptionParams {
1048
+ contentType?: string | Buffer;
1049
+ content?: string | Buffer;
1050
+ lock?: Script | Buffer | string;
1051
+ address?: Address | string;
1052
+ satoshis?: number;
1053
+ }
1054
+ interface ParsedInscription {
1055
+ contentType: string;
1056
+ content: Buffer;
1057
+ contentText: string;
1058
+ lock: Script;
1059
+ }
1060
+ /** Build a 1Sat Ordinals inscription locking script (base lock + inert envelope). */
1061
+ function buildInscription(params: InscriptionParams): Script;
1062
+ /** Parse an inscription out of a locking script; null if none present. */
1063
+ function parseInscription(script: Script | Buffer | string): ParsedInscription | null;
1064
+ /** True if the script carries an inscription envelope. */
1065
+ function isInscription(script: Script | Buffer | string): boolean;
1066
+ /** Build the 1-sat Transaction.Output carrying an inscription. */
1067
+ function createInscriptionOutput(params: InscriptionParams): Transaction.Output;
1068
+ /** Build one 1-sat inscription output per item. */
1069
+ function batchInscriptionOutputs(items: InscriptionParams[]): Transaction.Output[];
1070
+
1071
+ // ---- Marketplace: OrdLock "pay the seller or cancel" covenant ----
1072
+ /** SIGHASH_ALL|ANYONECANPAY|FORKID (0xc1) — the flag OrdLock commits/grinds under. */
1073
+ const ORDLOCK_SIGHASH: number;
1074
+ /** A payment spec: a full Output, an {address,satoshis} pair, or serialized-output bytes. */
1075
+ type PaymentSpec = Transaction.Output | Buffer | { address?: Address | PublicKey | PrivateKey | string; payTo?: Address | PublicKey | PrivateKey | string; satoshis?: number; price?: number };
1076
+ interface OrdLockParams {
1077
+ seller: Address | PublicKey | PrivateKey | string | Buffer;
1078
+ price?: number;
1079
+ payTo?: Address | PublicKey | PrivateKey | string | Transaction.Output;
1080
+ /** Extra payments appended after the `price` output (royalties, marketplace fee). */
1081
+ royalties?: PaymentSpec[];
1082
+ /** Pin an explicit ordered list of payment outputs (overrides price/payTo/royalties). */
1083
+ payOutputs?: PaymentSpec[];
1084
+ payOutput?: Transaction.Output | Buffer;
1085
+ inscription?: { contentType?: string | Buffer; content?: string | Buffer };
1086
+ satoshis?: number;
1087
+ }
1088
+ interface ParsedPayment { satoshis: number; script: Script; address: string | null; }
1089
+ interface ParsedOrdLock {
1090
+ seller: { pubKeyHash: Buffer; address: string };
1091
+ payOutputs: ParsedPayment[];
1092
+ payBlob: Buffer;
1093
+ totalPrice: number;
1094
+ inscription: null | { contentType: string; content: Buffer; contentText: string };
1095
+ }
1096
+ interface PurchaseParams {
1097
+ spend: Transaction;
1098
+ lockingScript: Script;
1099
+ satoshis?: number;
1100
+ inputIndex?: number;
1101
+ payoutIndex?: number;
1102
+ /** Number of pinned payment outputs (auto-derived from the listing when omitted). */
1103
+ payoutCount?: number;
1104
+ /** Assert the pinned block matches the listing before signing (default true). */
1105
+ validate?: boolean;
1106
+ /** A pre-computed parseOrdLock(lockingScript) result, to avoid re-parsing. */
1107
+ parsed?: ParsedOrdLock;
1108
+ payOutput?: Transaction.Output | Buffer;
1109
+ grind?: SmartContract.GrindOpts;
1110
+ }
1111
+ interface ParseOpts {
1112
+ /** Network for returned address strings ('livenet' | 'testnet'); default livenet. */
1113
+ network?: string;
1114
+ }
1115
+ interface CancelParams {
1116
+ privateKey: PrivateKey;
1117
+ spend: Transaction;
1118
+ lockingScript: Script;
1119
+ satoshis?: number;
1120
+ inputIndex?: number;
1121
+ sighashType?: number;
1122
+ }
1123
+ interface Outpoint { txid?: string; prevTxId?: string; outputIndex?: number; vout?: number; }
1124
+ interface FundingCoin extends Outpoint { script: Script | Buffer | string; satoshis: number; privateKey: PrivateKey; }
1125
+ interface OrdinalCoin extends Outpoint { script: Script | Buffer | string; satoshis?: number; privateKey: PrivateKey; }
1126
+ interface BuildListingTxParams extends OrdLockParams {
1127
+ ordinal: OrdinalCoin;
1128
+ funding?: FundingCoin[];
1129
+ fee?: number;
1130
+ changeAddress?: Address | PublicKey | PrivateKey | string;
1131
+ }
1132
+ interface ListingTxResult { tx: Transaction; listingScript: Script; listingOutpoint: { txid: string; outputIndex: number }; }
1133
+ interface BuildPurchaseTxParams {
1134
+ listing: Outpoint & { script: Script | Buffer | string; satoshis?: number };
1135
+ ordinalDestination: Address | PublicKey | PrivateKey | string;
1136
+ funding: FundingCoin[];
1137
+ payOutputs?: PaymentSpec[];
1138
+ fee?: number;
1139
+ changeAddress?: Address | PublicKey | PrivateKey | string;
1140
+ grind?: SmartContract.GrindOpts;
1141
+ }
1142
+ /** Build an OrdLock listing (locking) script pinning the required payment output(s). */
1143
+ function buildOrdLock(params: OrdLockParams): Script;
1144
+ /** Parse an OrdLock listing into its economic terms; null if not an OrdLock. */
1145
+ function parseOrdLock(script: Script | Buffer | string, opts?: ParseOpts): ParsedOrdLock | null;
1146
+ /** True if the script is a recognizable OrdLock listing. */
1147
+ function isOrdLock(script: Script | Buffer | string, opts?: ParseOpts): boolean;
1148
+ /** Build the 1-sat Transaction.Output that lists an ordinal for sale. */
1149
+ function listInscriptionOutput(params: OrdLockParams): Transaction.Output;
1150
+ /** Build a P2PKH payment Output from an address/pubkey/key (or pass an Output through). */
1151
+ function payOutputFor(payTo: Address | PublicKey | PrivateKey | string | Transaction.Output, price: number): Transaction.Output;
1152
+ /** Build (and assign) the unlocking script that PURCHASES a listed ordinal. */
1153
+ function purchaseOrdLock(params: PurchaseParams): Script;
1154
+ /** Build (and assign) the unlocking script that CANCELS a listing. */
1155
+ function cancelOrdLock(params: CancelParams): Script;
1156
+ /** Assemble a complete, signed listing tx: move a P2PKH ordinal into an OrdLock output. */
1157
+ function buildListingTx(params: BuildListingTxParams): ListingTxResult;
1158
+ /** Assemble a complete, signed purchase tx from a listing UTXO and buyer P2PKH coins. */
1159
+ function buildPurchaseTx(params: BuildPurchaseTxParams): Transaction;
1160
+
1161
+ // ---- BSV-20 / BSV-21 fungible-token inscriptions ----
1162
+ namespace BSV20 {
1163
+ type IntLike = string | number;
1164
+ interface Owner { address?: Address | string; lock?: Script | Buffer | string; contentType?: string; satoshis?: number; }
1165
+ /** A parsed BSV-20 payload. Amounts are integer strings (may exceed 2^53). */
1166
+ interface Payload {
1167
+ p: 'bsv-20';
1168
+ op: 'deploy' | 'mint' | 'transfer' | 'deploy+mint' | string;
1169
+ tick?: string;
1170
+ id?: string;
1171
+ amt?: string;
1172
+ max?: string;
1173
+ lim?: string;
1174
+ dec?: string;
1175
+ sym?: string;
1176
+ icon?: string;
1177
+ }
1178
+ const CONTENT_TYPE: string;
1179
+ /** Deploy a v1 (ticker) token. */
1180
+ function buildDeploy(params: Owner & { tick: string; max: IntLike; lim?: IntLike; dec?: IntLike }): Script;
1181
+ /** Mint an amount of a v1 (ticker) token. */
1182
+ function buildMint(params: Owner & { tick: string; amt: IntLike }): Script;
1183
+ /** Transfer an amount of a token — provide `tick` (v1) or `id` (v2 / BSV-21). */
1184
+ function buildTransfer(params: Owner & { amt: IntLike; tick?: string; id?: string }): Script;
1185
+ /** Deploy + mint a BSV-21 (id-based) supply in one operation. */
1186
+ function buildDeployMint(params: Owner & { amt: IntLike; dec?: IntLike; sym?: string; icon?: string }): Script;
1187
+ function createDeployOutput(params: Owner & { tick: string; max: IntLike; lim?: IntLike; dec?: IntLike }): Transaction.Output;
1188
+ function createMintOutput(params: Owner & { tick: string; amt: IntLike }): Transaction.Output;
1189
+ function createTransferOutput(params: Owner & { amt: IntLike; tick?: string; id?: string }): Transaction.Output;
1190
+ function createDeployMintOutput(params: Owner & { amt: IntLike; dec?: IntLike; sym?: string; icon?: string }): Transaction.Output;
1191
+ /** Parse a BSV-20 payload from a script, JSON string, or object; null if none. */
1192
+ function parseBsv20(input: Script | Buffer | string | object): Payload | null;
1193
+ /** True if the input carries a valid BSV-20 inscription. */
1194
+ function isBsv20(input: Script | Buffer | string | object): boolean;
1195
+ }
1196
+ }
1197
+
919
1198
  // -------- BrowserUTXOManager ----------------------------------------
920
1199
 
921
1200
  export class BrowserUTXOManager {