@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,4 +1,3 @@
1
- //#endregion
2
1
  //#region src/bytes/advanced.d.ts
3
2
  /**
4
3
  * Represents the possible encoding formats for converting bytes.
@@ -131,8 +130,7 @@ type Hex = `0x${string}`;
131
130
  */
132
131
  type HexLike = BytesLike;
133
132
  /**
134
- * Converts a HexLike value to a Hex string.
135
- * @public
133
+ * Returns the hexadecimal representation of the given value.
136
134
  *
137
135
  * @param hex - The value to convert, which can be a string, Uint8Array, ArrayBuffer, or number array.
138
136
  * @returns A Hex string representing the value.
@@ -144,6 +142,46 @@ type HexLike = BytesLike;
144
142
  * ```
145
143
  */
146
144
  declare function hexFrom(hex: HexLike): Hex;
145
+ /**
146
+ * Return the number of bytes occupied by `hexLike`.
147
+ *
148
+ * @param hexLike - Hex-like value
149
+ * @returns Byte length of `hexLike`.
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * bytesLen("0x48656c6c6f") // 5
154
+ * bytesLen(new Uint8Array([1, 2, 3])) // 3
155
+ * bytesLen(new ArrayBuffer(4)) // 4
156
+ * bytesLen([1, 2]) // 2
157
+ * ```
158
+ *
159
+ * @see bytesLenUnsafe - Fast version for already-normalized Hex strings
160
+ *
161
+ * @note Prefer direct `.length`/`.byteLength` access on Uint8Array/ArrayBuffer when you already have bytes.
162
+ * Use `bytesLen()` only when you need length without performing additional operations.
163
+ * @see bytesFrom - Convert values to Bytes (Uint8Array)
164
+ */
165
+ declare function bytesLen(hexLike: HexLike): number;
166
+ /**
167
+ * Fast byte length for Hex strings.
168
+ *
169
+ * This function efficiently calculates the byte length of Hex values:
170
+ * - Skips validation (caller must ensure input is valid Hex)
171
+ * - Handles odd-digit hex as if it were padded with a leading zero (e.g., "0x123" is treated as "0x0123").
172
+ *
173
+ * @param hex - A valid Hex string (with "0x" prefix).
174
+ * @returns Byte length of the hex string.
175
+ *
176
+ * @example
177
+ * ```typescript
178
+ * bytesLenUnsafe("0x48656c6c6f") // 5
179
+ * bytesLenUnsafe("0x123") // 2 (odd digits round up via padding)
180
+ * ```
181
+ *
182
+ * @see bytesLen - Validated version for untrusted input
183
+ */
184
+ declare function bytesLenUnsafe(hex: Hex): number;
147
185
  //#endregion
148
186
  //#region src/address/index.d.ts
149
187
  /**
@@ -293,15 +331,23 @@ declare function numMax(a: NumLike, ...numbers: NumLike[]): Num;
293
331
  */
294
332
  declare function numFrom(val: NumLike): Num;
295
333
  /**
296
- * Converts a NumLike value to a hexadecimal string.
334
+ * Converts a {@link NumLike} value into its hexadecimal string representation, prefixed with `0x`.
335
+ *
336
+ * @remarks
337
+ * This function returns the direct hexadecimal representation of the number, which may have an odd number of digits.
338
+ * 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.
339
+ *
297
340
  * @public
298
341
  *
299
342
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
300
- * @returns A Hex string representing the numeric value.
343
+ * @returns A Hex string representing the number.
344
+ *
345
+ * @throws {Error} If the normalized numeric value is negative.
301
346
  *
302
347
  * @example
303
348
  * ```typescript
304
- * const hex = numToHex(12345); // Outputs "0x3039"
349
+ * const hex = numToHex(4660); // "0x1234"
350
+ * const oddLengthHex = numToHex(10); // "0xa"
305
351
  * ```
306
352
  */
307
353
  declare function numToHex(val: NumLike): Hex;
@@ -472,8 +518,8 @@ declare function reduceAsync<T>(values: T[], accumulator: (a: T, b: T) => Promis
472
518
  */
473
519
  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>;
474
520
  declare function sleep(ms: NumLike): Promise<unknown>;
475
- type Constructor<T> = {
476
- new (...args: any[]): T;
521
+ type Constructor<T, Args extends any[] = any[]> = {
522
+ new (...args: Args): T;
477
523
  };
478
524
  /**
479
525
  * @public
@@ -578,6 +624,7 @@ declare abstract class Entity {
578
624
  * @throws Will throw an error if the entity is not serializable
579
625
  */
580
626
  from(_: SubTypeLike): SubType;
627
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
581
628
  };
582
629
  abstract toBytes(): Bytes$1;
583
630
  abstract hash(): Hex;
@@ -600,7 +647,13 @@ declare abstract class Entity {
600
647
  * }
601
648
  * ```
602
649
  */
603
- declare function codec<Encodable, TypeLike extends Encodable, Decoded extends TypeLike>(codec: Codec<Encodable, Decoded>): <Type extends TypeLike, ConstructorType extends Constructor<Type> & {
650
+ declare function codec<Encodable, TypeLike extends Encodable, Decoded extends TypeLike>(codec: {
651
+ encode: (encodable: Encodable) => Bytes$1;
652
+ decode: (decodable: Bytes$1, config?: {
653
+ isExtraFieldIgnored?: boolean;
654
+ }) => Decoded;
655
+ byteLength?: number;
656
+ }): <Type extends TypeLike, ConstructorType extends Constructor<Type> & {
604
657
  from(decoded: TypeLike): Type;
605
658
  byteLength?: number;
606
659
  encode(encodable: TypeLike): Bytes$1;
@@ -746,6 +799,8 @@ interface Hasher {
746
799
  }
747
800
  //#endregion
748
801
  //#region src/hasher/hasherCkb.d.ts
802
+ declare const HASH_CKB_LENGTH = 32;
803
+ declare const HASH_CKB_SHORT_LENGTH = 20;
749
804
  /**
750
805
  * @public
751
806
  */
@@ -799,6 +854,7 @@ declare class HasherCkb implements Hasher {
799
854
  * ```
800
855
  */
801
856
  declare function hashCkb(...data: BytesLike[]): Hex;
857
+ declare function hashCkbShort(...data: BytesLike[]): Hex;
802
858
  //#endregion
803
859
  //#region src/hasher/hasherKeecak256.d.ts
804
860
  /**
@@ -1402,6 +1458,81 @@ declare abstract class Signer {
1402
1458
  */
1403
1459
  signOnlyTransaction(_: TransactionLike): Promise<Transaction>;
1404
1460
  }
1461
+ /**
1462
+ * An abstract class representing a multisig signer.
1463
+ * @public
1464
+ */
1465
+ declare abstract class SignerMultisig extends Signer {
1466
+ /**
1467
+ * Get the number of members in the multisig script.
1468
+ * @returns The number of members.
1469
+ */
1470
+ abstract getMemberCount(): Promise<number>;
1471
+ /**
1472
+ * Get the threshold of the multisig script.
1473
+ * @returns The threshold.
1474
+ */
1475
+ abstract getMemberThreshold(): Promise<number>;
1476
+ /**
1477
+ * Get the count of required member of the multisig script.
1478
+ * @returns The must match count.
1479
+ */
1480
+ abstract getMemberRequiredCount(): Promise<number>;
1481
+ /**
1482
+ * Get the number of valid signatures for matching multisig inputs in the transaction.
1483
+ *
1484
+ * @remarks
1485
+ * Returns `undefined` when the transaction has no inputs locked by any multisig address
1486
+ * supported by this signer. This method only evaluates matching multisig inputs and does
1487
+ * not indicate whether the transaction itself is expected to be signed by this multisig.
1488
+ *
1489
+ * @param _ - The transaction.
1490
+ * @returns The matched multisig signature count, or `undefined` when the transaction is unrelated to any multisig address supported by this signer.
1491
+ */
1492
+ abstract getSignaturesCount(_: TransactionLike): Promise<number | undefined>;
1493
+ /**
1494
+ * Check if related multisig inputs in the transaction need more signatures.
1495
+ *
1496
+ * @remarks
1497
+ * Returns `false` when the transaction has no inputs locked by any multisig address
1498
+ * supported by this signer.
1499
+ * A `false` result therefore means either the related multisig inputs are already fulfilled,
1500
+ * or the transaction is unrelated to all multisig addresses supported by this signer.
1501
+ *
1502
+ * @param txLike - The transaction to check.
1503
+ * @returns A promise that resolves to `true` when related multisig inputs still need signatures, and `false` otherwise.
1504
+ */
1505
+ abstract needMoreSignatures(_: TransactionLike): Promise<boolean>;
1506
+ /**
1507
+ * Aggregate transactions.
1508
+ * @param _ - The transactions to aggregate.
1509
+ * @returns The aggregated transaction.
1510
+ */
1511
+ abstract aggregateTransactions(_: TransactionLike[]): Promise<Transaction>;
1512
+ /**
1513
+ * Send a transaction.
1514
+ *
1515
+ * @remarks
1516
+ * This method rejects the transaction only when related multisig inputs still need signatures.
1517
+ * It does not verify that the transaction actually contains inputs locked by any multisig
1518
+ * address supported by this signer, so transactions unrelated to those multisig addresses
1519
+ * are not rejected by this check.
1520
+ *
1521
+ * @param tx - The transaction to send.
1522
+ * @returns The transaction hash.
1523
+ */
1524
+ sendTransaction(tx: TransactionLike): Promise<Hex>;
1525
+ }
1526
+ /**
1527
+ * Thrown when a multisig transaction is sent before enough signatures are collected.
1528
+ *
1529
+ * @public
1530
+ */
1531
+ declare class SignerMultisigNotEnoughSignaturesError extends Error {
1532
+ readonly signaturesCount: number;
1533
+ readonly threshold: number;
1534
+ constructor(signaturesCount: number, threshold: number);
1535
+ }
1405
1536
  /**
1406
1537
  * A class representing information about a signer, including its type and the signer instance.
1407
1538
  * @public
@@ -1593,6 +1724,45 @@ declare function btcPublicKeyFromP2pkhAddress(address: string): Hex;
1593
1724
  */
1594
1725
  declare function verifyMessageBtcEcdsa(message: string | BytesLike, signature: string, publicKey: string): boolean;
1595
1726
  //#endregion
1727
+ //#region src/signer/ckb/secp256k1Signing.d.ts
1728
+ declare const SECP256K1_SIGNATURE_LENGTH = 65;
1729
+ /**
1730
+ * Sign a message using Secp256k1.
1731
+ *
1732
+ * @param message - The message to sign.
1733
+ * @param privateKey - The private key.
1734
+ * @returns The signature.
1735
+ * @public
1736
+ */
1737
+ declare function signMessageSecp256k1(message: BytesLike, privateKey: BytesLike): Hex;
1738
+ /**
1739
+ * Verify a message using Secp256k1.
1740
+ *
1741
+ * @param message - The message to verify.
1742
+ * @param signature - The signature.
1743
+ * @param publicKey - The public key.
1744
+ * @returns True if the signature is valid, false otherwise.
1745
+ * @public
1746
+ */
1747
+ declare function verifyMessageSecp256k1(message: BytesLike, signature: BytesLike, publicKey: BytesLike): boolean;
1748
+ /**
1749
+ * Recover the public key from a Secp256k1 signature.
1750
+ *
1751
+ * @param message - The message.
1752
+ * @param signature - The signature.
1753
+ * @returns The recovered public key.
1754
+ * @public
1755
+ */
1756
+ declare function recoverMessageSecp256k1(message: BytesLike, signature: BytesLike): Hex;
1757
+ /**
1758
+ * @public
1759
+ */
1760
+ declare function messageHashCkbSecp256k1(message: string | BytesLike): Hex;
1761
+ /**
1762
+ * @public
1763
+ */
1764
+ declare function verifyMessageCkbSecp256k1(message: string | BytesLike, signature: string, publicKey: string): boolean;
1765
+ //#endregion
1596
1766
  //#region src/signer/ckb/signerCkbPublicKey.d.ts
1597
1767
  /**
1598
1768
  * @public
@@ -1693,15 +1863,269 @@ declare class SignerCkbScriptReadonly extends Signer {
1693
1863
  getAddressObjs(): Promise<Address[]>;
1694
1864
  }
1695
1865
  //#endregion
1696
- //#region src/signer/ckb/verifyCkbSecp256k1.d.ts
1866
+ //#region src/signer/ckb/signerMultisigCkbReadonly.d.ts
1867
+ type MultisigCkbWitnessLike = ({
1868
+ publicKeyHashes: HexLike[];
1869
+ publicKeys?: undefined | null;
1870
+ } | {
1871
+ publicKeyHashes?: undefined | null;
1872
+ publicKeys: HexLike[];
1873
+ }) & {
1874
+ threshold: NumLike;
1875
+ mustMatch?: NumLike | null;
1876
+ signatures?: HexLike[] | null;
1877
+ };
1878
+ declare const MultisigCkbWitness_base: (abstract new () => {
1879
+ toBytes(): Bytes$1;
1880
+ clone(): MultisigCkbWitness;
1881
+ eq(other: MultisigCkbWitnessLike): boolean;
1882
+ hash(): Hex;
1883
+ toHex(): Hex;
1884
+ }) & {
1885
+ byteLength?: number;
1886
+ encode(_: MultisigCkbWitnessLike): Bytes$1;
1887
+ decode(_: BytesLike): MultisigCkbWitness;
1888
+ fromBytes(_bytes: BytesLike): MultisigCkbWitness;
1889
+ from(_: MultisigCkbWitnessLike): MultisigCkbWitness;
1890
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
1891
+ toBytes(): Bytes$1;
1892
+ clone(): SubType;
1893
+ eq(other: SubTypeLike): boolean;
1894
+ hash(): Hex;
1895
+ toHex(): Hex;
1896
+ }) & {
1897
+ byteLength?: number;
1898
+ encode(_: SubTypeLike): Bytes$1;
1899
+ decode(_: BytesLike): SubType;
1900
+ fromBytes(_bytes: BytesLike): SubType;
1901
+ from(_: SubTypeLike): SubType;
1902
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
1903
+ };
1904
+ };
1697
1905
  /**
1906
+ * A class representing multisig information, holding information ingredients and containing utilities.
1698
1907
  * @public
1699
1908
  */
1700
- declare function messageHashCkbSecp256k1(message: string | BytesLike): Hex;
1909
+ declare class MultisigCkbWitness extends MultisigCkbWitness_base {
1910
+ publicKeyHashes: Hex[];
1911
+ threshold: number;
1912
+ mustMatch: number;
1913
+ signatures: Hex[];
1914
+ /**
1915
+ * @param publicKeyHashes - The public key hashes.
1916
+ * @param threshold - The threshold.
1917
+ * @param mustMatch - The number of signatures that must match.
1918
+ * @param signatures - The signatures.
1919
+ */
1920
+ constructor(publicKeyHashes: Hex[], threshold: number, mustMatch: number, signatures: Hex[]);
1921
+ /**
1922
+ * Create a MultisigCkbWitness from a MultisigCkbWitnessLike.
1923
+ *
1924
+ * @param witness - The witness like object.
1925
+ * @returns The MultisigCkbWitness.
1926
+ */
1927
+ static from(witness: MultisigCkbWitnessLike): MultisigCkbWitness;
1928
+ /**
1929
+ * Get the threshold of flexible signatures.
1930
+ */
1931
+ get flexibleThreshold(): number;
1932
+ /**
1933
+ * Get the script args of the multisig script.
1934
+ *
1935
+ * @param since - The since value.
1936
+ * @returns The script args.
1937
+ */
1938
+ scriptArgs(since?: SinceLike | null): Bytes$1;
1939
+ /**
1940
+ * Check if the multisig info is equal to another.
1941
+ *
1942
+ * @param otherLike - The other multisig info.
1943
+ * @returns True if the multisig info is equal, false otherwise.
1944
+ */
1945
+ eqInfo(otherLike: MultisigCkbWitnessLike): boolean;
1946
+ /**
1947
+ * Generate valid public key hashes and their signatures from the witness.
1948
+ * This method filters out invalid signatures, duplicate signatures, and signatures not in the multisig script.
1949
+ *
1950
+ * @param message - The message signed.
1951
+ * @returns A generator of public key hashes, signatures, and whether the signature is required.
1952
+ */
1953
+ generatePublicKeyHashesFromSignatures(message: BytesLike): Generator<{
1954
+ pubkeyHash: Hex;
1955
+ signature: Hex;
1956
+ isRequired: boolean;
1957
+ }>;
1958
+ /**
1959
+ * Calculate the number of matched signatures in the witness.
1960
+ *
1961
+ * @param message - The message signed.
1962
+ * @returns The number of required and flexible signatures.
1963
+ */
1964
+ calcMatchedSignaturesCount(message: BytesLike): {
1965
+ required: number;
1966
+ flexible: number;
1967
+ };
1968
+ }
1701
1969
  /**
1970
+ * A class extending Signer that provides access to a CKB multisig script.
1971
+ * This class does not support signing operations.
1702
1972
  * @public
1703
1973
  */
1704
- declare function verifyMessageCkbSecp256k1(message: string | BytesLike, signature: string, publicKey: string): boolean;
1974
+ declare class SignerMultisigCkbReadonly extends SignerMultisig {
1975
+ static EmptySignature: `0x${string}`;
1976
+ get type(): SignerType;
1977
+ get signType(): SignerSignType;
1978
+ readonly multisigInfo: MultisigCkbWitness;
1979
+ readonly since?: Since;
1980
+ readonly scriptInfos: Promise<{
1981
+ script: Script;
1982
+ cellDeps: CellDepInfo[];
1983
+ }[]>;
1984
+ /**
1985
+ * Creates an instance of SignerMultisigCkbReadonly.
1986
+ *
1987
+ * @param client - The client instance.
1988
+ * @param multisigInfoLike - The multisig information.
1989
+ * @param options - The options.
1990
+ */
1991
+ constructor(client: Client, multisigInfoLike: MultisigCkbWitnessLike, options?: {
1992
+ since?: SinceLike | null;
1993
+ scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
1994
+ } | null);
1995
+ /**
1996
+ * Get the number of members in the multisig script.
1997
+ *
1998
+ * @returns The number of members.
1999
+ */
2000
+ getMemberCount(): Promise<number>;
2001
+ /**
2002
+ * Get the threshold of the multisig script.
2003
+ *
2004
+ * @returns The threshold.
2005
+ */
2006
+ getMemberThreshold(): Promise<number>;
2007
+ /**
2008
+ * Get the count of required member of the multisig script.
2009
+ *
2010
+ * @returns The must match count.
2011
+ */
2012
+ getMemberRequiredCount(): Promise<number>;
2013
+ connect(): Promise<void>;
2014
+ isConnected(): Promise<boolean>;
2015
+ getInternalAddress(): Promise<string>;
2016
+ getAddressObjs(): Promise<Address[]>;
2017
+ /**
2018
+ * Decode the witness args at a specific index.
2019
+ *
2020
+ * @param txLike - The transaction.
2021
+ * @param index - The index of the witness args.
2022
+ * @returns The decoded MultisigCkbWitness.
2023
+ */
2024
+ decodeWitnessArgsAt(txLike: TransactionLike, index: number): MultisigCkbWitness | undefined;
2025
+ /**
2026
+ * Decode the witness args.
2027
+ *
2028
+ * @param witnessLike - The witness args like object.
2029
+ * @returns The decoded MultisigCkbWitness.
2030
+ */
2031
+ decodeWitnessArgs(witnessLike?: WitnessArgsLike | null): MultisigCkbWitness | undefined;
2032
+ /**
2033
+ * Prepare the witness args at a specific index.
2034
+ *
2035
+ * @param txLike - The transaction.
2036
+ * @param index - The index of the witness args.
2037
+ * @param transformer - The transformer function.
2038
+ * @returns The prepared transaction.
2039
+ */
2040
+ prepareWitnessArgsAt(txLike: TransactionLike, index: number, transformer?: ((witness: MultisigCkbWitness, witnessArgs: WitnessArgs) => MultisigCkbWitnessLike | undefined | null | void | Promise<MultisigCkbWitnessLike | undefined | null | void>) | null): Promise<Transaction>;
2041
+ /**
2042
+ * Prepare multisig witness, if the existence of multisig witness is detected, nothing happens
2043
+ *
2044
+ * @param txLike - The transaction to prepare.
2045
+ * @param scriptLike - The script to prepare.
2046
+ * @returns A promise that resolves to the prepared transaction
2047
+ */
2048
+ prepareTransactionOneScript(txLike: TransactionLike, script: ScriptLike, cellDeps: CellDepInfoLike[]): Promise<Transaction>;
2049
+ /**
2050
+ * Prepare transaction for multisig witness and adding related cell deps
2051
+ *
2052
+ * @param txLike - The transaction to prepare.
2053
+ * @returns A promise that resolves to the prepared transaction
2054
+ */
2055
+ prepareTransaction(txLike: TransactionLike): Promise<Transaction>;
2056
+ /**
2057
+ * Get the number of valid signatures for matching multisig inputs in the transaction.
2058
+ *
2059
+ * @remarks
2060
+ * Returns `undefined` when the transaction has no inputs locked by any multisig address
2061
+ * supported by this signer. This method only counts signatures for matching multisig inputs
2062
+ * and does not imply that the transaction should be signed by this multisig.
2063
+ *
2064
+ * @param txLike - The transaction.
2065
+ * @returns The matched multisig signature count, or `undefined` when the transaction is unrelated to any multisig address supported by this signer.
2066
+ */
2067
+ getSignaturesCount(txLike: TransactionLike): Promise<number | undefined>;
2068
+ /**
2069
+ * Check if related multisig inputs in the transaction need more signatures.
2070
+ *
2071
+ * @remarks
2072
+ * Returns `false` when the transaction has no inputs locked by any multisig address
2073
+ * supported by this signer.
2074
+ * A `false` result therefore means either the related multisig inputs are already fulfilled,
2075
+ * or the transaction is unrelated to all multisig addresses supported by this signer.
2076
+ *
2077
+ * @param txLike - The transaction to check.
2078
+ * @returns A promise that resolves to `true` when related multisig inputs still need signatures, and `false` otherwise.
2079
+ */
2080
+ needMoreSignatures(txLike: TransactionLike): Promise<boolean>;
2081
+ /**
2082
+ * Get the sign info for a script.
2083
+ *
2084
+ * @param txLike - The transaction.
2085
+ * @param script - The script.
2086
+ * @returns The sign info.
2087
+ */
2088
+ getSignInfo(txLike: TransactionLike, script: ScriptLike): Promise<{
2089
+ message: Hex;
2090
+ position: number;
2091
+ } | undefined>;
2092
+ /**
2093
+ * Aggregate transactions.
2094
+ *
2095
+ * @param txs - The transactions to aggregate.
2096
+ * @returns The aggregated transaction.
2097
+ */
2098
+ aggregateTransactions(txs: TransactionLike[]): Promise<Transaction>;
2099
+ }
2100
+ //#endregion
2101
+ //#region src/signer/ckb/signerMultisigCkbPrivateKey.d.ts
2102
+ /**
2103
+ * A class extending Signer that provides access to a CKB multisig script and supports signing operations.
2104
+ * @public
2105
+ */
2106
+ declare class SignerMultisigCkbPrivateKey extends SignerMultisigCkbReadonly {
2107
+ private readonly privateKey;
2108
+ private readonly signer;
2109
+ /**
2110
+ * Creates an instance of SignerMultisigCkbPrivateKey.
2111
+ *
2112
+ * @param client - The client instance.
2113
+ * @param privateKey - The private key.
2114
+ * @param multisigInfo - The multisig information.
2115
+ * @param options - The options.
2116
+ */
2117
+ constructor(client: Client, privateKey: HexLike, multisigInfo: MultisigCkbWitnessLike, options?: {
2118
+ since?: SinceLike | null;
2119
+ scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
2120
+ } | null);
2121
+ /**
2122
+ * Sign a transaction only (without preparing).
2123
+ *
2124
+ * @param txLike - The transaction to sign.
2125
+ * @returns The signed transaction.
2126
+ */
2127
+ signOnlyTransaction(txLike: TransactionLike): Promise<Transaction>;
2128
+ }
1705
2129
  //#endregion
1706
2130
  //#region src/signer/ckb/verifyJoyId.d.ts
1707
2131
  /**
@@ -2103,7 +2527,7 @@ declare function buildNostrEventFromMessage(message: string | BytesLike): NostrE
2103
2527
  declare function nostrEventHash(event: NostrEvent): Bytes$1;
2104
2528
  declare function verifyMessageNostrEvent(message: string | BytesLike, signature: string, address: string): boolean;
2105
2529
  declare namespace barrel_d_exports {
2106
- 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 };
2530
+ 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 };
2107
2531
  }
2108
2532
  //#endregion
2109
2533
  //#region src/client/clientTypes.advanced.d.ts
@@ -2496,6 +2920,20 @@ declare const Epoch_base: (abstract new () => {
2496
2920
  decode(_: BytesLike): Epoch;
2497
2921
  fromBytes(_bytes: BytesLike): Epoch;
2498
2922
  from(_: EpochLike): Epoch;
2923
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
2924
+ toBytes(): Bytes$1;
2925
+ clone(): SubType;
2926
+ eq(other: SubTypeLike): boolean;
2927
+ hash(): Hex;
2928
+ toHex(): Hex;
2929
+ }) & {
2930
+ byteLength?: number;
2931
+ encode(_: SubTypeLike): Bytes$1;
2932
+ decode(_: BytesLike): SubType;
2933
+ fromBytes(_bytes: BytesLike): SubType;
2934
+ from(_: SubTypeLike): SubType;
2935
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
2936
+ };
2499
2937
  };
2500
2938
  /**
2501
2939
  * Epoch
@@ -2759,10 +3197,13 @@ declare enum KnownScript {
2759
3197
  NervosDao = "NervosDao",
2760
3198
  Secp256k1Blake160 = "Secp256k1Blake160",
2761
3199
  Secp256k1Multisig = "Secp256k1Multisig",
3200
+ Secp256k1MultisigV2Beta = "Secp256k1MultisigV2Beta",
3201
+ // Fix rare failing case (https://github.com/nervosnetwork/ckb-system-scripts/pull/98)
2762
3202
  Secp256k1MultisigV2 = "Secp256k1MultisigV2",
2763
3203
  // Enhanced since handling (https://github.com/nervosnetwork/ckb-system-scripts/pull/99)
2764
3204
  AnyoneCanPay = "AnyoneCanPay",
2765
3205
  TypeId = "TypeId",
3206
+ SUdt = "SUdt",
2766
3207
  XUdt = "XUdt",
2767
3208
  JoyId = "JoyId",
2768
3209
  COTA = "COTA",
@@ -2855,6 +3296,20 @@ declare const Script_base: (abstract new () => {
2855
3296
  decode(_: BytesLike): Script;
2856
3297
  fromBytes(_bytes: BytesLike): Script;
2857
3298
  from(_: ScriptLike): Script;
3299
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3300
+ toBytes(): Bytes$1;
3301
+ clone(): SubType;
3302
+ eq(other: SubTypeLike): boolean;
3303
+ hash(): Hex;
3304
+ toHex(): Hex;
3305
+ }) & {
3306
+ byteLength?: number;
3307
+ encode(_: SubTypeLike): Bytes$1;
3308
+ decode(_: BytesLike): SubType;
3309
+ fromBytes(_bytes: BytesLike): SubType;
3310
+ from(_: SubTypeLike): SubType;
3311
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3312
+ };
2858
3313
  };
2859
3314
  /**
2860
3315
  * @public
@@ -3035,6 +3490,20 @@ declare const OutPoint_base: (abstract new () => {
3035
3490
  decode(_: BytesLike): OutPoint;
3036
3491
  fromBytes(_bytes: BytesLike): OutPoint;
3037
3492
  from(_: OutPointLike): OutPoint;
3493
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3494
+ toBytes(): Bytes$1;
3495
+ clone(): SubType;
3496
+ eq(other: SubTypeLike): boolean;
3497
+ hash(): Hex;
3498
+ toHex(): Hex;
3499
+ }) & {
3500
+ byteLength?: number;
3501
+ encode(_: SubTypeLike): Bytes$1;
3502
+ decode(_: BytesLike): SubType;
3503
+ fromBytes(_bytes: BytesLike): SubType;
3504
+ from(_: SubTypeLike): SubType;
3505
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3506
+ };
3038
3507
  };
3039
3508
  /**
3040
3509
  * @public
@@ -3105,6 +3574,20 @@ declare const CellOutput_base: (abstract new () => {
3105
3574
  decode(_: BytesLike): CellOutput;
3106
3575
  fromBytes(_bytes: BytesLike): CellOutput;
3107
3576
  from(_: CellOutputLike): CellOutput;
3577
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3578
+ toBytes(): Bytes$1;
3579
+ clone(): SubType;
3580
+ eq(other: SubTypeLike): boolean;
3581
+ hash(): Hex;
3582
+ toHex(): Hex;
3583
+ }) & {
3584
+ byteLength?: number;
3585
+ encode(_: SubTypeLike): Bytes$1;
3586
+ decode(_: BytesLike): SubType;
3587
+ fromBytes(_bytes: BytesLike): SubType;
3588
+ from(_: SubTypeLike): SubType;
3589
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3590
+ };
3108
3591
  };
3109
3592
  /**
3110
3593
  * @public
@@ -3389,6 +3872,20 @@ declare const Since_base: (abstract new () => {
3389
3872
  decode(_: BytesLike): Since;
3390
3873
  fromBytes(_bytes: BytesLike): Since;
3391
3874
  from(_: SinceLike): Since;
3875
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3876
+ toBytes(): Bytes$1;
3877
+ clone(): SubType;
3878
+ eq(other: SubTypeLike): boolean;
3879
+ hash(): Hex;
3880
+ toHex(): Hex;
3881
+ }) & {
3882
+ byteLength?: number;
3883
+ encode(_: SubTypeLike): Bytes$1;
3884
+ decode(_: BytesLike): SubType;
3885
+ fromBytes(_bytes: BytesLike): SubType;
3886
+ from(_: SubTypeLike): SubType;
3887
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3888
+ };
3392
3889
  };
3393
3890
  /**
3394
3891
  * @public
@@ -3476,6 +3973,20 @@ declare const CellInput_base: (abstract new () => {
3476
3973
  decode(_: BytesLike): CellInput;
3477
3974
  fromBytes(_bytes: BytesLike): CellInput;
3478
3975
  from(_: CellInputLike): CellInput;
3976
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
3977
+ toBytes(): Bytes$1;
3978
+ clone(): SubType;
3979
+ eq(other: SubTypeLike): boolean;
3980
+ hash(): Hex;
3981
+ toHex(): Hex;
3982
+ }) & {
3983
+ byteLength?: number;
3984
+ encode(_: SubTypeLike): Bytes$1;
3985
+ decode(_: BytesLike): SubType;
3986
+ fromBytes(_bytes: BytesLike): SubType;
3987
+ from(_: SubTypeLike): SubType;
3988
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
3989
+ };
3479
3990
  };
3480
3991
  /**
3481
3992
  * @public
@@ -3561,6 +4072,20 @@ declare const CellDep_base: (abstract new () => {
3561
4072
  decode(_: BytesLike): CellDep;
3562
4073
  fromBytes(_bytes: BytesLike): CellDep;
3563
4074
  from(_: CellDepLike): CellDep;
4075
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
4076
+ toBytes(): Bytes$1;
4077
+ clone(): SubType;
4078
+ eq(other: SubTypeLike): boolean;
4079
+ hash(): Hex;
4080
+ toHex(): Hex;
4081
+ }) & {
4082
+ byteLength?: number;
4083
+ encode(_: SubTypeLike): Bytes$1;
4084
+ decode(_: BytesLike): SubType;
4085
+ fromBytes(_bytes: BytesLike): SubType;
4086
+ from(_: SubTypeLike): SubType;
4087
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
4088
+ };
3564
4089
  };
3565
4090
  /**
3566
4091
  * @public
@@ -3623,6 +4148,20 @@ declare const WitnessArgs_base: (abstract new () => {
3623
4148
  decode(_: BytesLike): WitnessArgs;
3624
4149
  fromBytes(_bytes: BytesLike): WitnessArgs;
3625
4150
  from(_: WitnessArgsLike): WitnessArgs;
4151
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
4152
+ toBytes(): Bytes$1;
4153
+ clone(): SubType;
4154
+ eq(other: SubTypeLike): boolean;
4155
+ hash(): Hex;
4156
+ toHex(): Hex;
4157
+ }) & {
4158
+ byteLength?: number;
4159
+ encode(_: SubTypeLike): Bytes$1;
4160
+ decode(_: BytesLike): SubType;
4161
+ fromBytes(_bytes: BytesLike): SubType;
4162
+ from(_: SubTypeLike): SubType;
4163
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
4164
+ };
3626
4165
  };
3627
4166
  /**
3628
4167
  * @public
@@ -3701,6 +4240,20 @@ declare const Transaction_base: (abstract new () => {
3701
4240
  decode(_: BytesLike): Transaction;
3702
4241
  fromBytes(_bytes: BytesLike): Transaction;
3703
4242
  from(_: TransactionLike): Transaction;
4243
+ Base<SubTypeLike, SubType = SubTypeLike>(): (abstract new () => {
4244
+ toBytes(): Bytes$1;
4245
+ clone(): SubType;
4246
+ eq(other: SubTypeLike): boolean;
4247
+ hash(): Hex;
4248
+ toHex(): Hex;
4249
+ }) & {
4250
+ byteLength?: number;
4251
+ encode(_: SubTypeLike): Bytes$1;
4252
+ decode(_: BytesLike): SubType;
4253
+ fromBytes(_bytes: BytesLike): SubType;
4254
+ from(_: SubTypeLike): SubType;
4255
+ Base<SubTypeLike, SubType = SubTypeLike>(): /*elided*/any;
4256
+ };
3704
4257
  };
3705
4258
  /**
3706
4259
  * @public
@@ -4075,10 +4628,22 @@ declare class Transaction extends Transaction_base {
4075
4628
  *
4076
4629
  * @example
4077
4630
  * ```typescript
4078
- * const witnessArgs = await tx.getWitnessArgsAt(0);
4631
+ * const witnessArgs = tx.getWitnessArgsAt(0);
4079
4632
  * ```
4080
4633
  */
4081
4634
  getWitnessArgsAt(index: number): WitnessArgs | undefined;
4635
+ /**
4636
+ * Get witness at index as WitnessArgs, throw if failed to decode
4637
+ *
4638
+ * @param index - The index of the witness.
4639
+ * @returns The witness parsed as WitnessArgs.
4640
+ *
4641
+ * @example
4642
+ * ```typescript
4643
+ * const witnessArgs = tx.getWitnessArgsAtUnsafe(0);
4644
+ * ```
4645
+ */
4646
+ getWitnessArgsAtUnsafe(index: number): WitnessArgs | undefined;
4082
4647
  /**
4083
4648
  * Set witness at index by WitnessArgs
4084
4649
  *
@@ -5477,5 +6042,5 @@ declare namespace advancedBarrel_d_exports {
5477
6042
  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 };
5478
6043
  }
5479
6044
  //#endregion
5480
- 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 };
5481
- //# sourceMappingURL=advancedBarrel-DRDT4GBS.d.ts.map
6045
+ 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 };
6046
+ //# sourceMappingURL=advancedBarrel-4xTrm-An.d.mts.map