@ckb-ccc/core 1.14.0 → 1.16.0

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 (63) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +2 -0
  3. package/dist/address.advanced-8N_Hcv6p.mjs +2 -0
  4. package/dist/address.advanced-8N_Hcv6p.mjs.map +1 -0
  5. package/dist/advanced.d.mts +1 -1
  6. package/dist/advanced.mjs +1 -1
  7. package/{dist.commonjs/advancedBarrel-DRDT4GBS.d.ts → dist/advancedBarrel-4xTrm-An.d.mts} +581 -16
  8. package/dist/advancedBarrel-4xTrm-An.d.mts.map +1 -0
  9. package/dist/advancedBarrel.d.mts +1 -1
  10. package/dist/advancedBarrel.mjs +1 -1
  11. package/dist/barrel-D3tMRxi5.mjs +7 -0
  12. package/dist/barrel-D3tMRxi5.mjs.map +1 -0
  13. package/dist/barrel.d.mts +2 -2
  14. package/dist/barrel.mjs +1 -1
  15. package/dist/index.d.mts +2 -2
  16. package/dist/index.mjs +1 -1
  17. package/dist.commonjs/address.advanced-CUIioHfv.js +2 -0
  18. package/dist.commonjs/address.advanced-CUIioHfv.js.map +1 -0
  19. package/dist.commonjs/advanced.d.ts +1 -1
  20. package/dist.commonjs/advanced.js +1 -1
  21. package/{dist/advancedBarrel-BD7EAPVd.d.mts → dist.commonjs/advancedBarrel-XD_hMVay.d.ts} +582 -15
  22. package/dist.commonjs/advancedBarrel-XD_hMVay.d.ts.map +1 -0
  23. package/dist.commonjs/advancedBarrel.d.ts +1 -1
  24. package/dist.commonjs/advancedBarrel.js +1 -1
  25. package/dist.commonjs/barrel-D6tLiPED.js +21 -0
  26. package/dist.commonjs/barrel-D6tLiPED.js.map +1 -0
  27. package/dist.commonjs/barrel.d.ts +2 -2
  28. package/dist.commonjs/barrel.js +1 -1
  29. package/dist.commonjs/index.d.ts +2 -2
  30. package/dist.commonjs/index.js +1 -1
  31. package/package.json +2 -2
  32. package/src/ckb/transaction.ts +20 -1
  33. package/src/client/cache/cache.ts +1 -2
  34. package/src/client/cache/memory.ts +1 -2
  35. package/src/client/client.ts +1 -2
  36. package/src/client/clientPublicMainnet.advanced.ts +34 -0
  37. package/src/client/clientPublicTestnet.advanced.ts +34 -0
  38. package/src/client/clientTypes.ts +1 -6
  39. package/src/client/jsonRpc/transformers.ts +1 -2
  40. package/src/client/knownScript.ts +2 -0
  41. package/src/codec/entity.ts +13 -6
  42. package/src/hasher/hasherCkb.ts +7 -1
  43. package/src/hex/index.ts +82 -2
  44. package/src/num/index.ts +17 -4
  45. package/src/signer/ckb/index.ts +3 -1
  46. package/src/signer/ckb/secp256k1Signing.ts +94 -0
  47. package/src/signer/ckb/signerCkbPrivateKey.ts +6 -11
  48. package/src/signer/ckb/signerCkbPublicKey.ts +8 -3
  49. package/src/signer/ckb/signerMultisigCkbPrivateKey.ts +129 -0
  50. package/src/signer/ckb/signerMultisigCkbReadonly.ts +713 -0
  51. package/src/signer/signer/index.ts +100 -1
  52. package/src/utils/index.ts +3 -3
  53. package/dist/address.advanced-BmJKF_Lg.mjs +0 -2
  54. package/dist/address.advanced-BmJKF_Lg.mjs.map +0 -1
  55. package/dist/advancedBarrel-BD7EAPVd.d.mts.map +0 -1
  56. package/dist/barrel-C-sr5NLL.mjs +0 -7
  57. package/dist/barrel-C-sr5NLL.mjs.map +0 -1
  58. package/dist.commonjs/address.advanced-D9nKvIr3.js +0 -2
  59. package/dist.commonjs/address.advanced-D9nKvIr3.js.map +0 -1
  60. package/dist.commonjs/advancedBarrel-DRDT4GBS.d.ts.map +0 -1
  61. package/dist.commonjs/barrel-SuR9mcfv.js +0 -21
  62. package/dist.commonjs/barrel-SuR9mcfv.js.map +0 -1
  63. package/src/signer/ckb/verifyCkbSecp256k1.ts +0 -31
@@ -1,3 +1,4 @@
1
+ //#endregion
1
2
  //#region src/bytes/advanced.d.ts
2
3
  /**
3
4
  * Represents the possible encoding formats for converting bytes.
@@ -130,8 +131,7 @@ type Hex = `0x${string}`;
130
131
  */
131
132
  type HexLike = BytesLike;
132
133
  /**
133
- * Converts a HexLike value to a Hex string.
134
- * @public
134
+ * Returns the hexadecimal representation of the given value.
135
135
  *
136
136
  * @param hex - The value to convert, which can be a string, Uint8Array, ArrayBuffer, or number array.
137
137
  * @returns A Hex string representing the value.
@@ -143,6 +143,46 @@ type HexLike = BytesLike;
143
143
  * ```
144
144
  */
145
145
  declare function hexFrom(hex: HexLike): Hex;
146
+ /**
147
+ * Return the number of bytes occupied by `hexLike`.
148
+ *
149
+ * @param hexLike - Hex-like value
150
+ * @returns Byte length of `hexLike`.
151
+ *
152
+ * @example
153
+ * ```typescript
154
+ * bytesLen("0x48656c6c6f") // 5
155
+ * bytesLen(new Uint8Array([1, 2, 3])) // 3
156
+ * bytesLen(new ArrayBuffer(4)) // 4
157
+ * bytesLen([1, 2]) // 2
158
+ * ```
159
+ *
160
+ * @see bytesLenUnsafe - Fast version for already-normalized Hex strings
161
+ *
162
+ * @note Prefer direct `.length`/`.byteLength` access on Uint8Array/ArrayBuffer when you already have bytes.
163
+ * Use `bytesLen()` only when you need length without performing additional operations.
164
+ * @see bytesFrom - Convert values to Bytes (Uint8Array)
165
+ */
166
+ declare function bytesLen(hexLike: HexLike): number;
167
+ /**
168
+ * Fast byte length for Hex strings.
169
+ *
170
+ * This function efficiently calculates the byte length of Hex values:
171
+ * - Skips validation (caller must ensure input is valid Hex)
172
+ * - Handles odd-digit hex as if it were padded with a leading zero (e.g., "0x123" is treated as "0x0123").
173
+ *
174
+ * @param hex - A valid Hex string (with "0x" prefix).
175
+ * @returns Byte length of the hex string.
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * bytesLenUnsafe("0x48656c6c6f") // 5
180
+ * bytesLenUnsafe("0x123") // 2 (odd digits round up via padding)
181
+ * ```
182
+ *
183
+ * @see bytesLen - Validated version for untrusted input
184
+ */
185
+ declare function bytesLenUnsafe(hex: Hex): number;
146
186
  //#endregion
147
187
  //#region src/address/index.d.ts
148
188
  /**
@@ -292,15 +332,23 @@ declare function numMax(a: NumLike, ...numbers: NumLike[]): Num;
292
332
  */
293
333
  declare function numFrom(val: NumLike): Num;
294
334
  /**
295
- * Converts a NumLike value to a hexadecimal string.
335
+ * Converts a {@link NumLike} value into its hexadecimal string representation, prefixed with `0x`.
336
+ *
337
+ * @remarks
338
+ * This function returns the direct hexadecimal representation of the number, which may have an odd number of digits.
339
+ * For a full-byte representation (an even number of hex digits), consider using {@link numToBytes}, {@link numLeToBytes}, or {@link numBeToBytes} and then converting the resulting byte array to a hex string.
340
+ *
296
341
  * @public
297
342
  *
298
343
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
299
- * @returns A Hex string representing the numeric value.
344
+ * @returns A Hex string representing the number.
345
+ *
346
+ * @throws {Error} If the normalized numeric value is negative.
300
347
  *
301
348
  * @example
302
349
  * ```typescript
303
- * const hex = numToHex(12345); // Outputs "0x3039"
350
+ * const hex = numToHex(4660); // "0x1234"
351
+ * const oddLengthHex = numToHex(10); // "0xa"
304
352
  * ```
305
353
  */
306
354
  declare function numToHex(val: NumLike): Hex;
@@ -471,8 +519,8 @@ declare function reduceAsync<T>(values: T[], accumulator: (a: T, b: T) => Promis
471
519
  */
472
520
  declare function reduceAsync<T, V>(values: V[], accumulator: (a: T, b: V, i: number, values: V[]) => Promise<T | undefined | null | void> | T | undefined | null | void, init: T | Promise<T>): Promise<T>;
473
521
  declare function sleep(ms: NumLike): Promise<unknown>;
474
- type Constructor<T> = {
475
- new (...args: any[]): T;
522
+ type Constructor<T, Args extends any[] = any[]> = {
523
+ new (...args: Args): T;
476
524
  };
477
525
  /**
478
526
  * @public
@@ -577,6 +625,7 @@ declare abstract class Entity {
577
625
  * @throws Will throw an error if the entity is not serializable
578
626
  */
579
627
  from(_: SubTypeLike): SubType;
628
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
580
629
  };
581
630
  abstract toBytes(): Bytes$1;
582
631
  abstract hash(): Hex;
@@ -599,7 +648,13 @@ declare abstract class Entity {
599
648
  * }
600
649
  * ```
601
650
  */
602
- declare function codec<Encodable, TypeLike extends Encodable, Decoded extends TypeLike>(codec: Codec<Encodable, Decoded>): <Type extends TypeLike, ConstructorType extends Constructor<Type> & {
651
+ declare function codec<Encodable, TypeLike extends Encodable, Decoded extends TypeLike>(codec: {
652
+ encode: (encodable: Encodable) => Bytes$1;
653
+ decode: (decodable: Bytes$1, config?: {
654
+ isExtraFieldIgnored?: boolean;
655
+ }) => Decoded;
656
+ byteLength?: number;
657
+ }): <Type extends TypeLike, ConstructorType extends Constructor<Type> & {
603
658
  from(decoded: TypeLike): Type;
604
659
  byteLength?: number;
605
660
  encode(encodable: TypeLike): Bytes$1;
@@ -745,6 +800,8 @@ interface Hasher {
745
800
  }
746
801
  //#endregion
747
802
  //#region src/hasher/hasherCkb.d.ts
803
+ declare const HASH_CKB_LENGTH = 32;
804
+ declare const HASH_CKB_SHORT_LENGTH = 20;
748
805
  /**
749
806
  * @public
750
807
  */
@@ -798,6 +855,7 @@ declare class HasherCkb implements Hasher {
798
855
  * ```
799
856
  */
800
857
  declare function hashCkb(...data: BytesLike[]): Hex;
858
+ declare function hashCkbShort(...data: BytesLike[]): Hex;
801
859
  //#endregion
802
860
  //#region src/hasher/hasherKeecak256.d.ts
803
861
  /**
@@ -1401,6 +1459,81 @@ declare abstract class Signer {
1401
1459
  */
1402
1460
  signOnlyTransaction(_: TransactionLike): Promise<Transaction>;
1403
1461
  }
1462
+ /**
1463
+ * An abstract class representing a multisig signer.
1464
+ * @public
1465
+ */
1466
+ declare abstract class SignerMultisig extends Signer {
1467
+ /**
1468
+ * Get the number of members in the multisig script.
1469
+ * @returns The number of members.
1470
+ */
1471
+ abstract getMemberCount(): Promise<number>;
1472
+ /**
1473
+ * Get the threshold of the multisig script.
1474
+ * @returns The threshold.
1475
+ */
1476
+ abstract getMemberThreshold(): Promise<number>;
1477
+ /**
1478
+ * Get the count of required member of the multisig script.
1479
+ * @returns The must match count.
1480
+ */
1481
+ abstract getMemberRequiredCount(): Promise<number>;
1482
+ /**
1483
+ * Get the number of valid signatures for matching multisig inputs in the transaction.
1484
+ *
1485
+ * @remarks
1486
+ * Returns `undefined` when the transaction has no inputs locked by any multisig address
1487
+ * supported by this signer. This method only evaluates matching multisig inputs and does
1488
+ * not indicate whether the transaction itself is expected to be signed by this multisig.
1489
+ *
1490
+ * @param _ - The transaction.
1491
+ * @returns The matched multisig signature count, or `undefined` when the transaction is unrelated to any multisig address supported by this signer.
1492
+ */
1493
+ abstract getSignaturesCount(_: TransactionLike): Promise<number | undefined>;
1494
+ /**
1495
+ * Check if related multisig inputs in the transaction need more signatures.
1496
+ *
1497
+ * @remarks
1498
+ * Returns `false` when the transaction has no inputs locked by any multisig address
1499
+ * supported by this signer.
1500
+ * A `false` result therefore means either the related multisig inputs are already fulfilled,
1501
+ * or the transaction is unrelated to all multisig addresses supported by this signer.
1502
+ *
1503
+ * @param txLike - The transaction to check.
1504
+ * @returns A promise that resolves to `true` when related multisig inputs still need signatures, and `false` otherwise.
1505
+ */
1506
+ abstract needMoreSignatures(_: TransactionLike): Promise<boolean>;
1507
+ /**
1508
+ * Aggregate transactions.
1509
+ * @param _ - The transactions to aggregate.
1510
+ * @returns The aggregated transaction.
1511
+ */
1512
+ abstract aggregateTransactions(_: TransactionLike[]): Promise<Transaction>;
1513
+ /**
1514
+ * Send a transaction.
1515
+ *
1516
+ * @remarks
1517
+ * This method rejects the transaction only when related multisig inputs still need signatures.
1518
+ * It does not verify that the transaction actually contains inputs locked by any multisig
1519
+ * address supported by this signer, so transactions unrelated to those multisig addresses
1520
+ * are not rejected by this check.
1521
+ *
1522
+ * @param tx - The transaction to send.
1523
+ * @returns The transaction hash.
1524
+ */
1525
+ sendTransaction(tx: TransactionLike): Promise<Hex>;
1526
+ }
1527
+ /**
1528
+ * Thrown when a multisig transaction is sent before enough signatures are collected.
1529
+ *
1530
+ * @public
1531
+ */
1532
+ declare class SignerMultisigNotEnoughSignaturesError extends Error {
1533
+ readonly signaturesCount: number;
1534
+ readonly threshold: number;
1535
+ constructor(signaturesCount: number, threshold: number);
1536
+ }
1404
1537
  /**
1405
1538
  * A class representing information about a signer, including its type and the signer instance.
1406
1539
  * @public
@@ -1592,6 +1725,45 @@ declare function btcPublicKeyFromP2pkhAddress(address: string): Hex;
1592
1725
  */
1593
1726
  declare function verifyMessageBtcEcdsa(message: string | BytesLike, signature: string, publicKey: string): boolean;
1594
1727
  //#endregion
1728
+ //#region src/signer/ckb/secp256k1Signing.d.ts
1729
+ declare const SECP256K1_SIGNATURE_LENGTH = 65;
1730
+ /**
1731
+ * Sign a message using Secp256k1.
1732
+ *
1733
+ * @param message - The message to sign.
1734
+ * @param privateKey - The private key.
1735
+ * @returns The signature.
1736
+ * @public
1737
+ */
1738
+ declare function signMessageSecp256k1(message: BytesLike, privateKey: BytesLike): Hex;
1739
+ /**
1740
+ * Verify a message using Secp256k1.
1741
+ *
1742
+ * @param message - The message to verify.
1743
+ * @param signature - The signature.
1744
+ * @param publicKey - The public key.
1745
+ * @returns True if the signature is valid, false otherwise.
1746
+ * @public
1747
+ */
1748
+ declare function verifyMessageSecp256k1(message: BytesLike, signature: BytesLike, publicKey: BytesLike): boolean;
1749
+ /**
1750
+ * Recover the public key from a Secp256k1 signature.
1751
+ *
1752
+ * @param message - The message.
1753
+ * @param signature - The signature.
1754
+ * @returns The recovered public key.
1755
+ * @public
1756
+ */
1757
+ declare function recoverMessageSecp256k1(message: BytesLike, signature: BytesLike): Hex;
1758
+ /**
1759
+ * @public
1760
+ */
1761
+ declare function messageHashCkbSecp256k1(message: string | BytesLike): Hex;
1762
+ /**
1763
+ * @public
1764
+ */
1765
+ declare function verifyMessageCkbSecp256k1(message: string | BytesLike, signature: string, publicKey: string): boolean;
1766
+ //#endregion
1595
1767
  //#region src/signer/ckb/signerCkbPublicKey.d.ts
1596
1768
  /**
1597
1769
  * @public
@@ -1692,15 +1864,269 @@ declare class SignerCkbScriptReadonly extends Signer {
1692
1864
  getAddressObjs(): Promise<Address[]>;
1693
1865
  }
1694
1866
  //#endregion
1695
- //#region src/signer/ckb/verifyCkbSecp256k1.d.ts
1867
+ //#region src/signer/ckb/signerMultisigCkbReadonly.d.ts
1868
+ type MultisigCkbWitnessLike = ({
1869
+ publicKeyHashes: HexLike[];
1870
+ publicKeys?: undefined | null;
1871
+ } | {
1872
+ publicKeyHashes?: undefined | null;
1873
+ publicKeys: HexLike[];
1874
+ }) & {
1875
+ threshold: NumLike;
1876
+ mustMatch?: NumLike | null;
1877
+ signatures?: HexLike[] | null;
1878
+ };
1879
+ declare const MultisigCkbWitness_base: (abstract new () => {
1880
+ toBytes(): Bytes$1;
1881
+ clone(): MultisigCkbWitness;
1882
+ eq(other: MultisigCkbWitnessLike): boolean;
1883
+ hash(): Hex;
1884
+ toHex(): Hex;
1885
+ }) & {
1886
+ byteLength?: number;
1887
+ encode(_: MultisigCkbWitnessLike): Bytes$1;
1888
+ decode(_: BytesLike): MultisigCkbWitness;
1889
+ fromBytes(_bytes: BytesLike): MultisigCkbWitness;
1890
+ from(_: MultisigCkbWitnessLike): MultisigCkbWitness;
1891
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
1892
+ toBytes(): Bytes$1;
1893
+ clone(): SubType;
1894
+ eq(other: SubTypeLike): boolean;
1895
+ hash(): Hex;
1896
+ toHex(): Hex;
1897
+ }) & {
1898
+ byteLength?: number;
1899
+ encode(_: SubTypeLike): Bytes$1;
1900
+ decode(_: BytesLike): SubType;
1901
+ fromBytes(_bytes: BytesLike): SubType;
1902
+ from(_: SubTypeLike): SubType;
1903
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
1904
+ };
1905
+ };
1696
1906
  /**
1907
+ * A class representing multisig information, holding information ingredients and containing utilities.
1697
1908
  * @public
1698
1909
  */
1699
- declare function messageHashCkbSecp256k1(message: string | BytesLike): Hex;
1910
+ declare class MultisigCkbWitness extends MultisigCkbWitness_base {
1911
+ publicKeyHashes: Hex[];
1912
+ threshold: number;
1913
+ mustMatch: number;
1914
+ signatures: Hex[];
1915
+ /**
1916
+ * @param publicKeyHashes - The public key hashes.
1917
+ * @param threshold - The threshold.
1918
+ * @param mustMatch - The number of signatures that must match.
1919
+ * @param signatures - The signatures.
1920
+ */
1921
+ constructor(publicKeyHashes: Hex[], threshold: number, mustMatch: number, signatures: Hex[]);
1922
+ /**
1923
+ * Create a MultisigCkbWitness from a MultisigCkbWitnessLike.
1924
+ *
1925
+ * @param witness - The witness like object.
1926
+ * @returns The MultisigCkbWitness.
1927
+ */
1928
+ static from(witness: MultisigCkbWitnessLike): MultisigCkbWitness;
1929
+ /**
1930
+ * Get the threshold of flexible signatures.
1931
+ */
1932
+ get flexibleThreshold(): number;
1933
+ /**
1934
+ * Get the script args of the multisig script.
1935
+ *
1936
+ * @param since - The since value.
1937
+ * @returns The script args.
1938
+ */
1939
+ scriptArgs(since?: SinceLike | null): Bytes$1;
1940
+ /**
1941
+ * Check if the multisig info is equal to another.
1942
+ *
1943
+ * @param otherLike - The other multisig info.
1944
+ * @returns True if the multisig info is equal, false otherwise.
1945
+ */
1946
+ eqInfo(otherLike: MultisigCkbWitnessLike): boolean;
1947
+ /**
1948
+ * Generate valid public key hashes and their signatures from the witness.
1949
+ * This method filters out invalid signatures, duplicate signatures, and signatures not in the multisig script.
1950
+ *
1951
+ * @param message - The message signed.
1952
+ * @returns A generator of public key hashes, signatures, and whether the signature is required.
1953
+ */
1954
+ generatePublicKeyHashesFromSignatures(message: BytesLike): Generator<{
1955
+ pubkeyHash: Hex;
1956
+ signature: Hex;
1957
+ isRequired: boolean;
1958
+ }>;
1959
+ /**
1960
+ * Calculate the number of matched signatures in the witness.
1961
+ *
1962
+ * @param message - The message signed.
1963
+ * @returns The number of required and flexible signatures.
1964
+ */
1965
+ calcMatchedSignaturesCount(message: BytesLike): {
1966
+ required: number;
1967
+ flexible: number;
1968
+ };
1969
+ }
1700
1970
  /**
1971
+ * A class extending Signer that provides access to a CKB multisig script.
1972
+ * This class does not support signing operations.
1701
1973
  * @public
1702
1974
  */
1703
- declare function verifyMessageCkbSecp256k1(message: string | BytesLike, signature: string, publicKey: string): boolean;
1975
+ declare class SignerMultisigCkbReadonly extends SignerMultisig {
1976
+ static EmptySignature: `0x${string}`;
1977
+ get type(): SignerType;
1978
+ get signType(): SignerSignType;
1979
+ readonly multisigInfo: MultisigCkbWitness;
1980
+ readonly since?: Since;
1981
+ readonly scriptInfos: Promise<{
1982
+ script: Script;
1983
+ cellDeps: CellDepInfo[];
1984
+ }[]>;
1985
+ /**
1986
+ * Creates an instance of SignerMultisigCkbReadonly.
1987
+ *
1988
+ * @param client - The client instance.
1989
+ * @param multisigInfoLike - The multisig information.
1990
+ * @param options - The options.
1991
+ */
1992
+ constructor(client: Client, multisigInfoLike: MultisigCkbWitnessLike, options?: {
1993
+ since?: SinceLike | null;
1994
+ scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
1995
+ } | null);
1996
+ /**
1997
+ * Get the number of members in the multisig script.
1998
+ *
1999
+ * @returns The number of members.
2000
+ */
2001
+ getMemberCount(): Promise<number>;
2002
+ /**
2003
+ * Get the threshold of the multisig script.
2004
+ *
2005
+ * @returns The threshold.
2006
+ */
2007
+ getMemberThreshold(): Promise<number>;
2008
+ /**
2009
+ * Get the count of required member of the multisig script.
2010
+ *
2011
+ * @returns The must match count.
2012
+ */
2013
+ getMemberRequiredCount(): Promise<number>;
2014
+ connect(): Promise<void>;
2015
+ isConnected(): Promise<boolean>;
2016
+ getInternalAddress(): Promise<string>;
2017
+ getAddressObjs(): Promise<Address[]>;
2018
+ /**
2019
+ * Decode the witness args at a specific index.
2020
+ *
2021
+ * @param txLike - The transaction.
2022
+ * @param index - The index of the witness args.
2023
+ * @returns The decoded MultisigCkbWitness.
2024
+ */
2025
+ decodeWitnessArgsAt(txLike: TransactionLike, index: number): MultisigCkbWitness | undefined;
2026
+ /**
2027
+ * Decode the witness args.
2028
+ *
2029
+ * @param witnessLike - The witness args like object.
2030
+ * @returns The decoded MultisigCkbWitness.
2031
+ */
2032
+ decodeWitnessArgs(witnessLike?: WitnessArgsLike | null): MultisigCkbWitness | undefined;
2033
+ /**
2034
+ * Prepare the witness args at a specific index.
2035
+ *
2036
+ * @param txLike - The transaction.
2037
+ * @param index - The index of the witness args.
2038
+ * @param transformer - The transformer function.
2039
+ * @returns The prepared transaction.
2040
+ */
2041
+ prepareWitnessArgsAt(txLike: TransactionLike, index: number, transformer?: ((witness: MultisigCkbWitness, witnessArgs: WitnessArgs) => MultisigCkbWitnessLike | undefined | null | void | Promise<MultisigCkbWitnessLike | undefined | null | void>) | null): Promise<Transaction>;
2042
+ /**
2043
+ * Prepare multisig witness, if the existence of multisig witness is detected, nothing happens
2044
+ *
2045
+ * @param txLike - The transaction to prepare.
2046
+ * @param scriptLike - The script to prepare.
2047
+ * @returns A promise that resolves to the prepared transaction
2048
+ */
2049
+ prepareTransactionOneScript(txLike: TransactionLike, script: ScriptLike, cellDeps: CellDepInfoLike[]): Promise<Transaction>;
2050
+ /**
2051
+ * Prepare transaction for multisig witness and adding related cell deps
2052
+ *
2053
+ * @param txLike - The transaction to prepare.
2054
+ * @returns A promise that resolves to the prepared transaction
2055
+ */
2056
+ prepareTransaction(txLike: TransactionLike): Promise<Transaction>;
2057
+ /**
2058
+ * Get the number of valid signatures for matching multisig inputs in the transaction.
2059
+ *
2060
+ * @remarks
2061
+ * Returns `undefined` when the transaction has no inputs locked by any multisig address
2062
+ * supported by this signer. This method only counts signatures for matching multisig inputs
2063
+ * and does not imply that the transaction should be signed by this multisig.
2064
+ *
2065
+ * @param txLike - The transaction.
2066
+ * @returns The matched multisig signature count, or `undefined` when the transaction is unrelated to any multisig address supported by this signer.
2067
+ */
2068
+ getSignaturesCount(txLike: TransactionLike): Promise<number | undefined>;
2069
+ /**
2070
+ * Check if related multisig inputs in the transaction need more signatures.
2071
+ *
2072
+ * @remarks
2073
+ * Returns `false` when the transaction has no inputs locked by any multisig address
2074
+ * supported by this signer.
2075
+ * A `false` result therefore means either the related multisig inputs are already fulfilled,
2076
+ * or the transaction is unrelated to all multisig addresses supported by this signer.
2077
+ *
2078
+ * @param txLike - The transaction to check.
2079
+ * @returns A promise that resolves to `true` when related multisig inputs still need signatures, and `false` otherwise.
2080
+ */
2081
+ needMoreSignatures(txLike: TransactionLike): Promise<boolean>;
2082
+ /**
2083
+ * Get the sign info for a script.
2084
+ *
2085
+ * @param txLike - The transaction.
2086
+ * @param script - The script.
2087
+ * @returns The sign info.
2088
+ */
2089
+ getSignInfo(txLike: TransactionLike, script: ScriptLike): Promise<{
2090
+ message: Hex;
2091
+ position: number;
2092
+ } | undefined>;
2093
+ /**
2094
+ * Aggregate transactions.
2095
+ *
2096
+ * @param txs - The transactions to aggregate.
2097
+ * @returns The aggregated transaction.
2098
+ */
2099
+ aggregateTransactions(txs: TransactionLike[]): Promise<Transaction>;
2100
+ }
2101
+ //#endregion
2102
+ //#region src/signer/ckb/signerMultisigCkbPrivateKey.d.ts
2103
+ /**
2104
+ * A class extending Signer that provides access to a CKB multisig script and supports signing operations.
2105
+ * @public
2106
+ */
2107
+ declare class SignerMultisigCkbPrivateKey extends SignerMultisigCkbReadonly {
2108
+ private readonly privateKey;
2109
+ private readonly signer;
2110
+ /**
2111
+ * Creates an instance of SignerMultisigCkbPrivateKey.
2112
+ *
2113
+ * @param client - The client instance.
2114
+ * @param privateKey - The private key.
2115
+ * @param multisigInfo - The multisig information.
2116
+ * @param options - The options.
2117
+ */
2118
+ constructor(client: Client, privateKey: HexLike, multisigInfo: MultisigCkbWitnessLike, options?: {
2119
+ since?: SinceLike | null;
2120
+ scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
2121
+ } | null);
2122
+ /**
2123
+ * Sign a transaction only (without preparing).
2124
+ *
2125
+ * @param txLike - The transaction to sign.
2126
+ * @returns The signed transaction.
2127
+ */
2128
+ signOnlyTransaction(txLike: TransactionLike): Promise<Transaction>;
2129
+ }
1704
2130
  //#endregion
1705
2131
  //#region src/signer/ckb/verifyJoyId.d.ts
1706
2132
  /**
@@ -2102,7 +2528,7 @@ declare function buildNostrEventFromMessage(message: string | BytesLike): NostrE
2102
2528
  declare function nostrEventHash(event: NostrEvent): Bytes$1;
2103
2529
  declare function verifyMessageNostrEvent(message: string | BytesLike, signature: string, address: string): boolean;
2104
2530
  declare namespace barrel_d_exports {
2105
- export { Address, AddressLike, Bytes$1 as Bytes, BytesLike, Cell, CellAny, CellAnyLike, CellDep, CellDepInfo, CellDepInfoLike, CellDepLike, CellDepVec, CellInput, CellInputLike, CellInputVec, CellLike, CellOutput, CellOutputLike, CellOutputVec, Client, ClientBlock, ClientBlockHeader, ClientBlockHeaderLike, ClientBlockLike, ClientBlockUncle, ClientBlockUncleLike, ClientCache, ClientCacheMemory, ClientFindCellsResponse, ClientFindTransactionsGroupedResponse, ClientFindTransactionsResponse, ClientIndexerSearchKey, ClientIndexerSearchKeyFilter, ClientIndexerSearchKeyFilterLike, ClientIndexerSearchKeyLike, ClientIndexerSearchKeyTransaction, ClientIndexerSearchKeyTransactionLike, ClientJsonRpc, ClientJsonRpcConfig, ClientPublicMainnet, ClientPublicTestnet, ClientTransactionResponse, ClientTransactionResponseLike, Codec, CodecBool, CodecByte, CodecByte16, CodecByte32, CodecByte4, CodecByte8, CodecBytes, CodecLike, CodecRaw, CodecUint128, CodecUint128BE, CodecUint128LE, CodecUint16, CodecUint16BE, CodecUint16LE, CodecUint256, CodecUint256BE, CodecUint256LE, CodecUint32, CodecUint32BE, CodecUint32LE, CodecUint512, CodecUint512BE, CodecUint512LE, CodecUint64, CodecUint64BE, CodecUint64LE, CodecUint8, Constructor, DecodedType, DepType, DepTypeCodec, DepTypeLike, EncodableType, Entity, Epoch, EpochLike, ErrorClientBase, ErrorClientBaseLike, ErrorClientDuplicatedTransaction, ErrorClientMaxFeeRateExceeded, ErrorClientRBFRejected, ErrorClientResolveUnknown, ErrorClientVerification, ErrorClientWaitTransactionTimeout, ErrorTransactionInsufficientCapacity, ErrorTransactionInsufficientCoin, FixedPoint, FixedPointLike, HashType, HashTypeCodec, HashTypeLike, Hasher, HasherCkb, HasherKeecak256, Hex, HexLike, InputToSign, InputToSignLike, KnownScript, LumosTransactionSkeletonType, NetworkPreference, NostrEvent, Num, NumLike, One, OutPoint, OutPointLike, OutputsValidator, RawTransaction, RequestorJsonRpc, RequestorJsonRpcConfig, Script, ScriptInfo, ScriptInfoLike, ScriptLike, ScriptOpt, ScriptVec, SignPsbtOptions, SignPsbtOptionsLike, Signature, Signer, SignerAlwaysError, SignerBtc, SignerBtcPublicKeyReadonly, SignerCkbPrivateKey, SignerCkbPublicKey, SignerCkbScriptReadonly, SignerDoge, SignerDogeAddressReadonly, SignerDogePrivateKey, SignerDummy, SignerEvm, SignerEvmAddressReadonly, SignerInfo, SignerNostr, SignerNostrPrivateKey, SignerNostrPublicKeyReadonly, SignerOpenLink, SignerSignType, SignerType, Since, SinceLike, Transaction, TransactionLike, TransactionStatus, Wallet, WitnessArgs, WitnessArgsLike, Zero, apply, btcEcdsaPublicKeyHash, btcP2pkhAddressFromPublicKey, btcPublicKeyFromP2pkhAddress, btcVarLengthBytesFrom, buildNostrEventFromMessage, bytesConcat, bytesConcatTo, bytesEq, bytesFrom, bytesTo, calcDaoClaimEpoch, calcDaoProfit, codec, codecPadding, codecUint, codecUintNumber, depTypeFrom, depTypeFromBytes, depTypeToBytes, epochFrom, epochFromHex, epochToHex, fixedPointFrom, fixedPointToString, gcd, hashCkb, hashTypeFrom, hashTypeFromBytes, hashTypeId, hashTypeToBytes, hexFrom, isDaoOutputLimitExceeded, isWebview, keystoreDecrypt, keystoreEncrypt, messageHashBtcEcdsa, messageHashCkbSecp256k1, messageHashDogeEcdsa, barrel_d_exports$1 as mol, nostrEventHash, numBeFromBytes, numBeToBytes, numFrom, numFromBytes, numLeFromBytes, numLeToBytes, numMax, numMin, numToBytes, numToHex, reduceAsync, sleep, stringify, udtBalanceFrom, verifyMessageBtcEcdsa, verifyMessageCkbSecp256k1, verifyMessageDogeEcdsa, verifyMessageEvmPersonal, verifyMessageJoyId, verifyMessageNostrEvent };
2531
+ export { Address, AddressLike, Bytes$1 as Bytes, BytesLike, Cell, CellAny, CellAnyLike, CellDep, CellDepInfo, CellDepInfoLike, CellDepLike, CellDepVec, CellInput, CellInputLike, CellInputVec, CellLike, CellOutput, CellOutputLike, CellOutputVec, Client, ClientBlock, ClientBlockHeader, ClientBlockHeaderLike, ClientBlockLike, ClientBlockUncle, ClientBlockUncleLike, ClientCache, ClientCacheMemory, ClientFindCellsResponse, ClientFindTransactionsGroupedResponse, ClientFindTransactionsResponse, ClientIndexerSearchKey, ClientIndexerSearchKeyFilter, ClientIndexerSearchKeyFilterLike, ClientIndexerSearchKeyLike, ClientIndexerSearchKeyTransaction, ClientIndexerSearchKeyTransactionLike, ClientJsonRpc, ClientJsonRpcConfig, ClientPublicMainnet, ClientPublicTestnet, ClientTransactionResponse, ClientTransactionResponseLike, Codec, CodecBool, CodecByte, CodecByte16, CodecByte32, CodecByte4, CodecByte8, CodecBytes, CodecLike, CodecRaw, CodecUint128, CodecUint128BE, CodecUint128LE, CodecUint16, CodecUint16BE, CodecUint16LE, CodecUint256, CodecUint256BE, CodecUint256LE, CodecUint32, CodecUint32BE, CodecUint32LE, CodecUint512, CodecUint512BE, CodecUint512LE, CodecUint64, CodecUint64BE, CodecUint64LE, CodecUint8, Constructor, DecodedType, DepType, DepTypeCodec, DepTypeLike, EncodableType, Entity, Epoch, EpochLike, ErrorClientBase, ErrorClientBaseLike, ErrorClientDuplicatedTransaction, ErrorClientMaxFeeRateExceeded, ErrorClientRBFRejected, ErrorClientResolveUnknown, ErrorClientVerification, ErrorClientWaitTransactionTimeout, ErrorTransactionInsufficientCapacity, ErrorTransactionInsufficientCoin, FixedPoint, FixedPointLike, HASH_CKB_LENGTH, HASH_CKB_SHORT_LENGTH, HashType, HashTypeCodec, HashTypeLike, Hasher, HasherCkb, HasherKeecak256, Hex, HexLike, InputToSign, InputToSignLike, KnownScript, LumosTransactionSkeletonType, MultisigCkbWitness, MultisigCkbWitnessLike, NetworkPreference, NostrEvent, Num, NumLike, One, OutPoint, OutPointLike, OutputsValidator, RawTransaction, RequestorJsonRpc, RequestorJsonRpcConfig, SECP256K1_SIGNATURE_LENGTH, Script, ScriptInfo, ScriptInfoLike, ScriptLike, ScriptOpt, ScriptVec, SignPsbtOptions, SignPsbtOptionsLike, Signature, Signer, SignerAlwaysError, SignerBtc, SignerBtcPublicKeyReadonly, SignerCkbPrivateKey, SignerCkbPublicKey, SignerCkbScriptReadonly, SignerDoge, SignerDogeAddressReadonly, SignerDogePrivateKey, SignerDummy, SignerEvm, SignerEvmAddressReadonly, SignerInfo, SignerMultisig, SignerMultisigCkbPrivateKey, SignerMultisigCkbReadonly, SignerMultisigNotEnoughSignaturesError, SignerNostr, SignerNostrPrivateKey, SignerNostrPublicKeyReadonly, SignerOpenLink, SignerSignType, SignerType, Since, SinceLike, Transaction, TransactionLike, TransactionStatus, Wallet, WitnessArgs, WitnessArgsLike, Zero, apply, btcEcdsaPublicKeyHash, btcP2pkhAddressFromPublicKey, btcPublicKeyFromP2pkhAddress, btcVarLengthBytesFrom, buildNostrEventFromMessage, bytesConcat, bytesConcatTo, bytesEq, bytesFrom, bytesLen, bytesLenUnsafe, bytesTo, calcDaoClaimEpoch, calcDaoProfit, codec, codecPadding, codecUint, codecUintNumber, depTypeFrom, depTypeFromBytes, depTypeToBytes, epochFrom, epochFromHex, epochToHex, fixedPointFrom, fixedPointToString, gcd, hashCkb, hashCkbShort, hashTypeFrom, hashTypeFromBytes, hashTypeId, hashTypeToBytes, hexFrom, isDaoOutputLimitExceeded, isWebview, keystoreDecrypt, keystoreEncrypt, messageHashBtcEcdsa, messageHashCkbSecp256k1, messageHashDogeEcdsa, barrel_d_exports$1 as mol, nostrEventHash, numBeFromBytes, numBeToBytes, numFrom, numFromBytes, numLeFromBytes, numLeToBytes, numMax, numMin, numToBytes, numToHex, recoverMessageSecp256k1, reduceAsync, signMessageSecp256k1, sleep, stringify, udtBalanceFrom, verifyMessageBtcEcdsa, verifyMessageCkbSecp256k1, verifyMessageDogeEcdsa, verifyMessageEvmPersonal, verifyMessageJoyId, verifyMessageNostrEvent, verifyMessageSecp256k1 };
2106
2532
  }
2107
2533
  //#endregion
2108
2534
  //#region src/client/clientTypes.advanced.d.ts
@@ -2495,6 +2921,20 @@ declare const Epoch_base: (abstract new () => {
2495
2921
  decode(_: BytesLike): Epoch;
2496
2922
  fromBytes(_bytes: BytesLike): Epoch;
2497
2923
  from(_: EpochLike): Epoch;
2924
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
2925
+ toBytes(): Bytes$1;
2926
+ clone(): SubType;
2927
+ eq(other: SubTypeLike): boolean;
2928
+ hash(): Hex;
2929
+ toHex(): Hex;
2930
+ }) & {
2931
+ byteLength?: number;
2932
+ encode(_: SubTypeLike): Bytes$1;
2933
+ decode(_: BytesLike): SubType;
2934
+ fromBytes(_bytes: BytesLike): SubType;
2935
+ from(_: SubTypeLike): SubType;
2936
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
2937
+ };
2498
2938
  };
2499
2939
  /**
2500
2940
  * Epoch
@@ -2758,10 +3198,13 @@ declare enum KnownScript {
2758
3198
  NervosDao = "NervosDao",
2759
3199
  Secp256k1Blake160 = "Secp256k1Blake160",
2760
3200
  Secp256k1Multisig = "Secp256k1Multisig",
3201
+ Secp256k1MultisigV2Beta = "Secp256k1MultisigV2Beta",
3202
+ // Fix rare failing case (https://github.com/nervosnetwork/ckb-system-scripts/pull/98)
2761
3203
  Secp256k1MultisigV2 = "Secp256k1MultisigV2",
2762
3204
  // Enhanced since handling (https://github.com/nervosnetwork/ckb-system-scripts/pull/99)
2763
3205
  AnyoneCanPay = "AnyoneCanPay",
2764
3206
  TypeId = "TypeId",
3207
+ SUdt = "SUdt",
2765
3208
  XUdt = "XUdt",
2766
3209
  JoyId = "JoyId",
2767
3210
  COTA = "COTA",
@@ -2854,6 +3297,20 @@ declare const Script_base: (abstract new () => {
2854
3297
  decode(_: BytesLike): Script;
2855
3298
  fromBytes(_bytes: BytesLike): Script;
2856
3299
  from(_: ScriptLike): Script;
3300
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3301
+ toBytes(): Bytes$1;
3302
+ clone(): SubType;
3303
+ eq(other: SubTypeLike): boolean;
3304
+ hash(): Hex;
3305
+ toHex(): Hex;
3306
+ }) & {
3307
+ byteLength?: number;
3308
+ encode(_: SubTypeLike): Bytes$1;
3309
+ decode(_: BytesLike): SubType;
3310
+ fromBytes(_bytes: BytesLike): SubType;
3311
+ from(_: SubTypeLike): SubType;
3312
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3313
+ };
2857
3314
  };
2858
3315
  /**
2859
3316
  * @public
@@ -3034,6 +3491,20 @@ declare const OutPoint_base: (abstract new () => {
3034
3491
  decode(_: BytesLike): OutPoint;
3035
3492
  fromBytes(_bytes: BytesLike): OutPoint;
3036
3493
  from(_: OutPointLike): OutPoint;
3494
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3495
+ toBytes(): Bytes$1;
3496
+ clone(): SubType;
3497
+ eq(other: SubTypeLike): boolean;
3498
+ hash(): Hex;
3499
+ toHex(): Hex;
3500
+ }) & {
3501
+ byteLength?: number;
3502
+ encode(_: SubTypeLike): Bytes$1;
3503
+ decode(_: BytesLike): SubType;
3504
+ fromBytes(_bytes: BytesLike): SubType;
3505
+ from(_: SubTypeLike): SubType;
3506
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3507
+ };
3037
3508
  };
3038
3509
  /**
3039
3510
  * @public
@@ -3104,6 +3575,20 @@ declare const CellOutput_base: (abstract new () => {
3104
3575
  decode(_: BytesLike): CellOutput;
3105
3576
  fromBytes(_bytes: BytesLike): CellOutput;
3106
3577
  from(_: CellOutputLike): CellOutput;
3578
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3579
+ toBytes(): Bytes$1;
3580
+ clone(): SubType;
3581
+ eq(other: SubTypeLike): boolean;
3582
+ hash(): Hex;
3583
+ toHex(): Hex;
3584
+ }) & {
3585
+ byteLength?: number;
3586
+ encode(_: SubTypeLike): Bytes$1;
3587
+ decode(_: BytesLike): SubType;
3588
+ fromBytes(_bytes: BytesLike): SubType;
3589
+ from(_: SubTypeLike): SubType;
3590
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3591
+ };
3107
3592
  };
3108
3593
  /**
3109
3594
  * @public
@@ -3388,6 +3873,20 @@ declare const Since_base: (abstract new () => {
3388
3873
  decode(_: BytesLike): Since;
3389
3874
  fromBytes(_bytes: BytesLike): Since;
3390
3875
  from(_: SinceLike): Since;
3876
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3877
+ toBytes(): Bytes$1;
3878
+ clone(): SubType;
3879
+ eq(other: SubTypeLike): boolean;
3880
+ hash(): Hex;
3881
+ toHex(): Hex;
3882
+ }) & {
3883
+ byteLength?: number;
3884
+ encode(_: SubTypeLike): Bytes$1;
3885
+ decode(_: BytesLike): SubType;
3886
+ fromBytes(_bytes: BytesLike): SubType;
3887
+ from(_: SubTypeLike): SubType;
3888
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3889
+ };
3391
3890
  };
3392
3891
  /**
3393
3892
  * @public
@@ -3475,6 +3974,20 @@ declare const CellInput_base: (abstract new () => {
3475
3974
  decode(_: BytesLike): CellInput;
3476
3975
  fromBytes(_bytes: BytesLike): CellInput;
3477
3976
  from(_: CellInputLike): CellInput;
3977
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3978
+ toBytes(): Bytes$1;
3979
+ clone(): SubType;
3980
+ eq(other: SubTypeLike): boolean;
3981
+ hash(): Hex;
3982
+ toHex(): Hex;
3983
+ }) & {
3984
+ byteLength?: number;
3985
+ encode(_: SubTypeLike): Bytes$1;
3986
+ decode(_: BytesLike): SubType;
3987
+ fromBytes(_bytes: BytesLike): SubType;
3988
+ from(_: SubTypeLike): SubType;
3989
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3990
+ };
3478
3991
  };
3479
3992
  /**
3480
3993
  * @public
@@ -3560,6 +4073,20 @@ declare const CellDep_base: (abstract new () => {
3560
4073
  decode(_: BytesLike): CellDep;
3561
4074
  fromBytes(_bytes: BytesLike): CellDep;
3562
4075
  from(_: CellDepLike): CellDep;
4076
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
4077
+ toBytes(): Bytes$1;
4078
+ clone(): SubType;
4079
+ eq(other: SubTypeLike): boolean;
4080
+ hash(): Hex;
4081
+ toHex(): Hex;
4082
+ }) & {
4083
+ byteLength?: number;
4084
+ encode(_: SubTypeLike): Bytes$1;
4085
+ decode(_: BytesLike): SubType;
4086
+ fromBytes(_bytes: BytesLike): SubType;
4087
+ from(_: SubTypeLike): SubType;
4088
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
4089
+ };
3563
4090
  };
3564
4091
  /**
3565
4092
  * @public
@@ -3622,6 +4149,20 @@ declare const WitnessArgs_base: (abstract new () => {
3622
4149
  decode(_: BytesLike): WitnessArgs;
3623
4150
  fromBytes(_bytes: BytesLike): WitnessArgs;
3624
4151
  from(_: WitnessArgsLike): WitnessArgs;
4152
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
4153
+ toBytes(): Bytes$1;
4154
+ clone(): SubType;
4155
+ eq(other: SubTypeLike): boolean;
4156
+ hash(): Hex;
4157
+ toHex(): Hex;
4158
+ }) & {
4159
+ byteLength?: number;
4160
+ encode(_: SubTypeLike): Bytes$1;
4161
+ decode(_: BytesLike): SubType;
4162
+ fromBytes(_bytes: BytesLike): SubType;
4163
+ from(_: SubTypeLike): SubType;
4164
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
4165
+ };
3625
4166
  };
3626
4167
  /**
3627
4168
  * @public
@@ -3700,6 +4241,20 @@ declare const Transaction_base: (abstract new () => {
3700
4241
  decode(_: BytesLike): Transaction;
3701
4242
  fromBytes(_bytes: BytesLike): Transaction;
3702
4243
  from(_: TransactionLike): Transaction;
4244
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
4245
+ toBytes(): Bytes$1;
4246
+ clone(): SubType;
4247
+ eq(other: SubTypeLike): boolean;
4248
+ hash(): Hex;
4249
+ toHex(): Hex;
4250
+ }) & {
4251
+ byteLength?: number;
4252
+ encode(_: SubTypeLike): Bytes$1;
4253
+ decode(_: BytesLike): SubType;
4254
+ fromBytes(_bytes: BytesLike): SubType;
4255
+ from(_: SubTypeLike): SubType;
4256
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
4257
+ };
3703
4258
  };
3704
4259
  /**
3705
4260
  * @public
@@ -4074,10 +4629,22 @@ declare class Transaction extends Transaction_base {
4074
4629
  *
4075
4630
  * @example
4076
4631
  * ```typescript
4077
- * const witnessArgs = await tx.getWitnessArgsAt(0);
4632
+ * const witnessArgs = tx.getWitnessArgsAt(0);
4078
4633
  * ```
4079
4634
  */
4080
4635
  getWitnessArgsAt(index: number): WitnessArgs | undefined;
4636
+ /**
4637
+ * Get witness at index as WitnessArgs, throw if failed to decode
4638
+ *
4639
+ * @param index - The index of the witness.
4640
+ * @returns The witness parsed as WitnessArgs.
4641
+ *
4642
+ * @example
4643
+ * ```typescript
4644
+ * const witnessArgs = tx.getWitnessArgsAtUnsafe(0);
4645
+ * ```
4646
+ */
4647
+ getWitnessArgsAtUnsafe(index: number): WitnessArgs | undefined;
4081
4648
  /**
4082
4649
  * Set witness at index by WitnessArgs
4083
4650
  *
@@ -5476,5 +6043,5 @@ declare namespace advancedBarrel_d_exports {
5476
6043
  export { ADDRESS_BECH32_LIMIT, AddressFormat, BytesFromEncoding, CKB_BLAKE2B_PERSONAL, CellRecord, ClientCollectableSearchKeyFilterLike, ClientCollectableSearchKeyLike, DEFAULT_CONFIRMED_BLOCK_TIME, DEFAULT_MAX_FEE_RATE, DEFAULT_MIN_FEE_RATE, DEP_TYPES, DEP_TYPE_TO_NUM, HASH_TYPES, HASH_TYPE_TO_NUM, JsonRpcBlock, JsonRpcBlockHeader, JsonRpcBlockUncle, JsonRpcCellDep, JsonRpcCellInput, JsonRpcCellOutput, JsonRpcDepType, JsonRpcHashType, JsonRpcIndexerFindTransactionsGroupedResponse, JsonRpcIndexerFindTransactionsResponse, JsonRpcIndexerSearchKey, JsonRpcIndexerSearchKeyFilter, JsonRpcIndexerSearchKeyTransaction, JsonRpcOutPoint, JsonRpcPayload, JsonRpcScript, JsonRpcTransaction, JsonRpcTransformers, MAINNET_SCRIPTS, MapLru, NUM_TO_DEP_TYPE, NUM_TO_HASH_TYPE, TESTNET_SCRIPTS, Transport, TransportFallback, TransportHttp, TransportWebSocket, addressFromPayload, addressPayloadFromString, clientSearchKeyRangeFrom, filterCell, filterData, filterNumByRange, filterScript, filterScriptByLenRange, transportFromUri };
5477
6044
  }
5478
6045
  //#endregion
5479
- export { CellDep as $, btcP2pkhAddressFromPublicKey as $n, CodecUint256BE as $r, ClientFindCellsResponse as $t, DEP_TYPES as A, numLeToBytes as Ai, verifyMessageNostrEvent as An, hashCkb as Ar, HashTypeCodec as At, ClientPublicTestnet as B, AddressLike as Bi, SignerDummy as Bn, CodecByte16 as Br, Epoch as Bt, DEFAULT_CONFIRMED_BLOCK_TIME as C, Num as Ci, ClientCollectableSearchKeyLike as Cn, transportFromUri as Cr, depTypeFrom as Ct, filterNumByRange as D, numFrom as Di, barrel_d_exports as Dn, Transport as Dr, udtBalanceFrom as Dt, filterData as E, numBeToBytes as Ei, clientSearchKeyRangeFrom as En, JsonRpcPayload as Er, isDaoOutputLimitExceeded as Et, NUM_TO_HASH_TYPE as F, Codec as Fi, verifyMessageEvmPersonal as Fn, Zero as Fr, ScriptVec as Ft, ClientCacheMemory as G, BytesLike as Gi, SignerDoge as Gn, CodecRaw as Gr, CellDepInfo as Gt, ClientJsonRpc as H, HexLike as Hi, verifyMessageDogeEcdsa as Hn, CodecByte4 as Hr, epochFrom as Ht, ADDRESS_BECH32_LIMIT as I, CodecLike as Ii, SignerEvmAddressReadonly as In, fixedPointFrom as Ir, hashTypeFrom as It, ErrorTransactionInsufficientCoin as J, bytesEq as Ji, verifyMessageCkbSecp256k1 as Jn, CodecUint128LE as Jr, ClientBlockHeader as Jt, ClientCache as K, bytesConcat as Ki, verifyMessageJoyId as Kn, CodecUint128 as Kr, CellDepInfoLike as Kt, AddressFormat as L, DecodedType as Li, SignerEvm as Ln, fixedPointToString as Lr, hashTypeFromBytes as Lt, NUM_TO_DEP_TYPE as M, numMin as Mi, SignerNostrPublicKeyReadonly as Mn, FixedPoint as Mr, Script as Mt, HASH_TYPES as N, numToBytes as Ni, NostrEvent as Nn, FixedPointLike as Nr, ScriptLike as Nt, filterScript as O, numFromBytes as Oi, buildNostrEventFromMessage as On, HasherKeecak256 as Or, LumosTransactionSkeletonType as Ot, HASH_TYPE_TO_NUM as P, numToHex as Pi, SignerNostr as Pn, One as Pr, ScriptOpt as Pt, CellAnyLike as Q, btcEcdsaPublicKeyHash as Qn, CodecUint256 as Qr, ClientBlockUncleLike as Qt, addressFromPayload as R, EncodableType as Ri, SignerOpenLink as Rn, CodecBool as Rr, hashTypeToBytes as Rt, CellRecord as S, stringify as Si, ClientCollectableSearchKeyFilterLike as Sn, TransportFallback as Sr, calcDaoProfit as St, filterCell as T, numBeFromBytes as Ti, DEFAULT_MIN_FEE_RATE as Tn, TransportHttp as Tr, depTypeToBytes as Tt, ClientJsonRpcConfig as U, hexFrom as Ui, SignerDogePrivateKey as Un, CodecByte8 as Ur, epochFromHex as Ut, ClientPublicMainnet as V, Hex as Vi, messageHashDogeEcdsa as Vn, CodecByte32 as Vr, EpochLike as Vt, Client as W, Bytes$1 as Wi, SignerDogeAddressReadonly as Wn, CodecBytes as Wr, epochToHex as Wt, Cell as X, bytesTo as Xi, SignerCkbPrivateKey as Xn, CodecUint16BE as Xr, ClientBlockLike as Xt, hashTypeId as Y, bytesFrom as Yi, SignerCkbScriptReadonly as Yn, CodecUint16 as Yr, ClientBlockHeaderLike as Yt, CellAny as Z, BytesFromEncoding as Zi, SignerCkbPublicKey as Zn, CodecUint16LE as Zr, ClientBlockUncle as Zt, JsonRpcOutPoint as _, apply as _i, ErrorClientWaitTransactionTimeout as _n, barrel_d_exports$1 as _r, Transaction as _t, JsonRpcBlockHeader as a, CodecUint512BE as ai, ClientIndexerSearchKeyLike as an, SignerBtc as ar, CellLike as at, TESTNET_SCRIPTS as b, reduceAsync as bi, ScriptInfoLike as bn, RequestorJsonRpc as br, WitnessArgsLike as bt, JsonRpcCellInput as c, CodecUint64BE as ci, ClientTransactionResponse as cn, Signer as cr, CellOutputVec as ct, JsonRpcHashType as d, codecPadding as di, ErrorClientBaseLike as dn, SignerType as dr, DepTypeLike as dt, CodecUint256LE as ei, ClientFindTransactionsGroupedResponse as en, btcPublicKeyFromP2pkhAddress as er, CellDepLike as et, JsonRpcIndexerFindTransactionsGroupedResponse as f, codecUint as fi, ErrorClientDuplicatedTransaction as fn, Wallet as fr, OutPoint as ft, JsonRpcIndexerSearchKeyTransaction as g, Constructor as gi, ErrorClientVerification as gn, SignPsbtOptionsLike as gr, SinceLike as gt, JsonRpcIndexerSearchKeyFilter as h, codec as hi, ErrorClientResolveUnknown as hn, SignPsbtOptions as hr, Since as ht, JsonRpcBlock as i, CodecUint512 as ii, ClientIndexerSearchKeyFilterLike as in, SignerBtcPublicKeyReadonly as ir, CellInputVec as it, DEP_TYPE_TO_NUM as j, numMax as ji, SignerNostrPrivateKey as jn, Hasher as jr, HashTypeLike as jt, filterScriptByLenRange as k, numLeFromBytes as ki, nostrEventHash as kn, HasherCkb as kr, HashType as kt, JsonRpcCellOutput as l, CodecUint64LE as li, ClientTransactionResponseLike as ln, SignerInfo as lr, DepType as lt, JsonRpcIndexerSearchKey as m, Entity as mi, ErrorClientRBFRejected as mn, InputToSignLike as mr, RawTransaction as mt, CKB_BLAKE2B_PERSONAL as n, CodecUint32BE as ni, ClientIndexerSearchKey as nn, messageHashBtcEcdsa as nr, CellInput as nt, JsonRpcBlockUncle as o, CodecUint512LE as oi, ClientIndexerSearchKeyTransaction as on, NetworkPreference as or, CellOutput as ot, JsonRpcIndexerFindTransactionsResponse as p, codecUintNumber as pi, ErrorClientMaxFeeRateExceeded as pn, InputToSign as pr, OutPointLike as pt, ErrorTransactionInsufficientCapacity as q, bytesConcatTo as qi, messageHashCkbSecp256k1 as qn, CodecUint128BE as qr, ClientBlock as qt, JsonRpcTransformers as r, CodecUint32LE as ri, ClientIndexerSearchKeyFilter as rn, verifyMessageBtcEcdsa as rr, CellInputLike as rt, JsonRpcCellDep as s, CodecUint64 as si, ClientIndexerSearchKeyTransactionLike as sn, Signature as sr, CellOutputLike as st, advancedBarrel_d_exports as t, CodecUint32 as ti, ClientFindTransactionsResponse as tn, btcVarLengthBytesFrom as tr, CellDepVec as tt, JsonRpcDepType as u, CodecUint8 as ui, ErrorClientBase as un, SignerSignType as ur, DepTypeCodec as ut, JsonRpcScript as v, gcd as vi, OutputsValidator as vn, keystoreDecrypt as vr, TransactionLike as vt, MapLru as w, NumLike as wi, DEFAULT_MAX_FEE_RATE as wn, TransportWebSocket as wr, depTypeFromBytes as wt, MAINNET_SCRIPTS as x, sleep as xi, TransactionStatus as xn, RequestorJsonRpcConfig as xr, calcDaoClaimEpoch as xt, JsonRpcTransaction as y, isWebview as yi, ScriptInfo as yn, keystoreEncrypt as yr, WitnessArgs as yt, addressPayloadFromString as z, Address as zi, SignerAlwaysError as zn, CodecByte as zr, KnownScript as zt };
5480
- //# sourceMappingURL=advancedBarrel-BD7EAPVd.d.mts.map
6046
+ export { CellDep as $, AddressLike as $i, SignerCkbPublicKey as $n, CodecByte16 as $r, ClientFindCellsResponse as $t, DEP_TYPES as A, apply as Ai, verifyMessageNostrEvent as An, RequestorJsonRpc as Ar, HashTypeCodec as At, ClientPublicTestnet as B, numFrom as Bi, SignerDummy as Bn, HASH_CKB_SHORT_LENGTH as Br, Epoch as Bt, DEFAULT_CONFIRMED_BLOCK_TIME as C, CodecUint8 as Ci, ClientCollectableSearchKeyLike as Cn, InputToSign as Cr, depTypeFrom as Ct, filterNumByRange as D, Entity as Di, barrel_d_exports as Dn, barrel_d_exports$1 as Dr, udtBalanceFrom as Dt, filterData as E, codecUintNumber as Ei, clientSearchKeyRangeFrom as En, SignPsbtOptionsLike as Er, isDaoOutputLimitExceeded as Et, NUM_TO_HASH_TYPE as F, stringify as Fi, verifyMessageEvmPersonal as Fn, TransportHttp as Fr, ScriptVec as Ft, ClientCacheMemory as G, numMin as Gi, SignerDoge as Gn, FixedPoint as Gr, CellDepInfo as Gt, ClientJsonRpc as H, numLeFromBytes as Hi, verifyMessageDogeEcdsa as Hn, hashCkb as Hr, epochFrom as Ht, ADDRESS_BECH32_LIMIT as I, Num as Ii, SignerEvmAddressReadonly as In, JsonRpcPayload as Ir, hashTypeFrom as It, ErrorTransactionInsufficientCoin as J, Codec as Ji, MultisigCkbWitness as Jn, Zero as Jr, ClientBlockHeader as Jt, ClientCache as K, numToBytes as Ki, verifyMessageJoyId as Kn, FixedPointLike as Kr, CellDepInfoLike as Kt, AddressFormat as L, NumLike as Li, SignerEvm as Ln, Transport as Lr, hashTypeFromBytes as Lt, NUM_TO_DEP_TYPE as M, isWebview as Mi, SignerNostrPublicKeyReadonly as Mn, TransportFallback as Mr, Script as Mt, HASH_TYPES as N, reduceAsync as Ni, NostrEvent as Nn, transportFromUri as Nr, ScriptLike as Nt, filterScript as O, codec as Oi, buildNostrEventFromMessage as On, keystoreDecrypt as Or, LumosTransactionSkeletonType as Ot, HASH_TYPE_TO_NUM as P, sleep as Pi, SignerNostr as Pn, TransportWebSocket as Pr, ScriptOpt as Pt, CellAnyLike as Q, Address as Qi, SignerCkbPrivateKey as Qn, CodecByte as Qr, ClientBlockUncleLike as Qt, addressFromPayload as R, numBeFromBytes as Ri, SignerOpenLink as Rn, HasherKeecak256 as Rr, hashTypeToBytes as Rt, CellRecord as S, CodecUint64LE as Si, ClientCollectableSearchKeyFilterLike as Sn, Wallet as Sr, calcDaoProfit as St, filterCell as T, codecUint as Ti, DEFAULT_MIN_FEE_RATE as Tn, SignPsbtOptions as Tr, depTypeToBytes as Tt, ClientJsonRpcConfig as U, numLeToBytes as Ui, SignerDogePrivateKey as Un, hashCkbShort as Ur, epochFromHex as Ut, ClientPublicMainnet as V, numFromBytes as Vi, messageHashDogeEcdsa as Vn, HasherCkb as Vr, EpochLike as Vt, Client as W, numMax as Wi, SignerDogeAddressReadonly as Wn, Hasher as Wr, epochToHex as Wt, Cell as X, DecodedType as Xi, SignerMultisigCkbReadonly as Xn, fixedPointToString as Xr, ClientBlockLike as Xt, hashTypeId as Y, CodecLike as Yi, MultisigCkbWitnessLike as Yn, fixedPointFrom as Yr, ClientBlockHeaderLike as Yt, CellAny as Z, EncodableType as Zi, SignerCkbScriptReadonly as Zn, CodecBool as Zr, ClientBlockUncle as Zt, JsonRpcOutPoint as _, CodecUint512 as _i, ErrorClientWaitTransactionTimeout as _n, SignerInfo as _r, Transaction as _t, JsonRpcBlockHeader as a, Bytes$1 as aa, CodecUint128 as ai, ClientIndexerSearchKeyLike as an, verifyMessageSecp256k1 as ar, CellLike as at, TESTNET_SCRIPTS as b, CodecUint64 as bi, ScriptInfoLike as bn, SignerSignType as br, WitnessArgsLike as bt, JsonRpcCellInput as c, bytesConcatTo as ca, CodecUint16 as ci, ClientTransactionResponse as cn, btcPublicKeyFromP2pkhAddress as cr, CellOutputVec as ct, JsonRpcHashType as d, bytesTo as da, CodecUint256 as di, ErrorClientBaseLike as dn, verifyMessageBtcEcdsa as dr, DepTypeLike as dt, Hex as ea, CodecByte32 as ei, ClientFindTransactionsGroupedResponse as en, SECP256K1_SIGNATURE_LENGTH as er, CellDepLike as et, JsonRpcIndexerFindTransactionsGroupedResponse as f, BytesFromEncoding as fa, CodecUint256BE as fi, ErrorClientDuplicatedTransaction as fn, SignerBtcPublicKeyReadonly as fr, OutPoint as ft, JsonRpcIndexerSearchKeyTransaction as g, CodecUint32LE as gi, ErrorClientVerification as gn, Signer as gr, SinceLike as gt, JsonRpcIndexerSearchKeyFilter as h, CodecUint32BE as hi, ErrorClientResolveUnknown as hn, Signature as hr, Since as ht, JsonRpcBlock as i, hexFrom as ia, CodecRaw as ii, ClientIndexerSearchKeyFilterLike as in, verifyMessageCkbSecp256k1 as ir, CellInputVec as it, DEP_TYPE_TO_NUM as j, gcd as ji, SignerNostrPrivateKey as jn, RequestorJsonRpcConfig as jr, HashTypeLike as jt, filterScriptByLenRange as k, Constructor as ki, nostrEventHash as kn, keystoreEncrypt as kr, HashType as kt, JsonRpcCellOutput as l, bytesEq as la, CodecUint16BE as li, ClientTransactionResponseLike as ln, btcVarLengthBytesFrom as lr, DepType as lt, JsonRpcIndexerSearchKey as m, CodecUint32 as mi, ErrorClientRBFRejected as mn, NetworkPreference as mr, RawTransaction as mt, CKB_BLAKE2B_PERSONAL as n, bytesLen as na, CodecByte8 as ni, ClientIndexerSearchKey as nn, recoverMessageSecp256k1 as nr, CellInput as nt, JsonRpcBlockUncle as o, BytesLike as oa, CodecUint128BE as oi, ClientIndexerSearchKeyTransaction as on, btcEcdsaPublicKeyHash as or, CellOutput as ot, JsonRpcIndexerFindTransactionsResponse as p, CodecUint256LE as pi, ErrorClientMaxFeeRateExceeded as pn, SignerBtc as pr, OutPointLike as pt, ErrorTransactionInsufficientCapacity as q, numToHex as qi, SignerMultisigCkbPrivateKey as qn, One as qr, ClientBlock as qt, JsonRpcTransformers as r, bytesLenUnsafe as ra, CodecBytes as ri, ClientIndexerSearchKeyFilter as rn, signMessageSecp256k1 as rr, CellInputLike as rt, JsonRpcCellDep as s, bytesConcat as sa, CodecUint128LE as si, ClientIndexerSearchKeyTransactionLike as sn, btcP2pkhAddressFromPublicKey as sr, CellOutputLike as st, advancedBarrel_d_exports as t, HexLike as ta, CodecByte4 as ti, ClientFindTransactionsResponse as tn, messageHashCkbSecp256k1 as tr, CellDepVec as tt, JsonRpcDepType as u, bytesFrom as ua, CodecUint16LE as ui, ErrorClientBase as un, messageHashBtcEcdsa as ur, DepTypeCodec as ut, JsonRpcScript as v, CodecUint512BE as vi, OutputsValidator as vn, SignerMultisig as vr, TransactionLike as vt, MapLru as w, codecPadding as wi, DEFAULT_MAX_FEE_RATE as wn, InputToSignLike as wr, depTypeFromBytes as wt, MAINNET_SCRIPTS as x, CodecUint64BE as xi, TransactionStatus as xn, SignerType as xr, calcDaoClaimEpoch as xt, JsonRpcTransaction as y, CodecUint512LE as yi, ScriptInfo as yn, SignerMultisigNotEnoughSignaturesError as yr, WitnessArgs as yt, addressPayloadFromString as z, numBeToBytes as zi, SignerAlwaysError as zn, HASH_CKB_LENGTH as zr, KnownScript as zt };
6047
+ //# sourceMappingURL=advancedBarrel-XD_hMVay.d.ts.map