@ckb-ccc/core 1.13.0 → 1.15.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.
- package/CHANGELOG.md +41 -0
- package/dist/address.advanced-BHxWrbFc.mjs +2 -0
- package/dist/address.advanced-BHxWrbFc.mjs.map +1 -0
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.mjs +1 -1
- package/{dist.commonjs/advancedBarrel-DRDT4GBS.d.ts → dist/advancedBarrel-Dwyn3WMm.d.mts} +437 -14
- package/dist/advancedBarrel-Dwyn3WMm.d.mts.map +1 -0
- package/dist/advancedBarrel.d.mts +1 -1
- package/dist/advancedBarrel.mjs +1 -1
- package/dist/barrel-DO-IW8Ui.mjs +7 -0
- package/dist/barrel-DO-IW8Ui.mjs.map +1 -0
- package/dist/barrel.d.mts +2 -2
- package/dist/barrel.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist.commonjs/address.advanced-UCU9Hn8t.js +2 -0
- package/dist.commonjs/address.advanced-UCU9Hn8t.js.map +1 -0
- package/dist.commonjs/advanced.d.ts +1 -1
- package/dist.commonjs/advanced.js +1 -1
- package/{dist/advancedBarrel-BD7EAPVd.d.mts → dist.commonjs/advancedBarrel-D97MfkUZ.d.ts} +438 -13
- package/dist.commonjs/advancedBarrel-D97MfkUZ.d.ts.map +1 -0
- package/dist.commonjs/advancedBarrel.d.ts +1 -1
- package/dist.commonjs/advancedBarrel.js +1 -1
- package/dist.commonjs/barrel-D5PRJCB6.js +21 -0
- package/dist.commonjs/barrel-D5PRJCB6.js.map +1 -0
- package/dist.commonjs/barrel.d.ts +2 -2
- package/dist.commonjs/barrel.js +1 -1
- package/dist.commonjs/index.d.ts +2 -2
- package/dist.commonjs/index.js +1 -1
- package/package.json +23 -12
- package/src/address/address.advanced.ts +3 -3
- package/src/ckb/transaction.ts +20 -1
- package/src/client/clientPublicMainnet.advanced.ts +17 -0
- package/src/client/clientPublicTestnet.advanced.ts +17 -0
- package/src/client/knownScript.ts +1 -0
- package/src/codec/entity.ts +12 -8
- package/src/hasher/hasherCkb.ts +7 -1
- package/src/hex/index.ts +82 -2
- package/src/molecule/codec.ts +15 -15
- package/src/num/index.ts +17 -4
- package/src/signer/ckb/index.ts +3 -1
- package/src/signer/ckb/secp256k1Signing.ts +94 -0
- package/src/signer/ckb/signerCkbPrivateKey.ts +6 -11
- package/src/signer/ckb/signerCkbPublicKey.ts +8 -3
- package/src/signer/ckb/signerMultisigCkbPrivateKey.ts +129 -0
- package/src/signer/ckb/signerMultisigCkbReadonly.ts +713 -0
- package/src/signer/signer/index.ts +100 -1
- package/tsdown.config.mts +12 -3
- package/dist/address.advanced-CWGrVD-M.mjs +0 -2
- package/dist/address.advanced-CWGrVD-M.mjs.map +0 -1
- package/dist/advancedBarrel-BD7EAPVd.d.mts.map +0 -1
- package/dist/barrel-DchA_RPN.mjs +0 -7
- package/dist/barrel-DchA_RPN.mjs.map +0 -1
- package/dist.commonjs/address.advanced-COp7SNhZ.js +0 -2
- package/dist.commonjs/address.advanced-COp7SNhZ.js.map +0 -1
- package/dist.commonjs/advancedBarrel-DRDT4GBS.d.ts.map +0 -1
- package/dist.commonjs/barrel-CXC2Uy5L.js +0 -7
- package/dist.commonjs/barrel-CXC2Uy5L.js.map +0 -1
- package/src/signer/ckb/verifyCkbSecp256k1.ts +0 -31
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as DEP_TYPES, C as DEFAULT_CONFIRMED_BLOCK_TIME, Cn as ClientCollectableSearchKeyLike,
|
|
1
|
+
import { A as DEP_TYPES, C as DEFAULT_CONFIRMED_BLOCK_TIME, Cn as ClientCollectableSearchKeyLike, D as filterNumByRange, E as filterData, En as clientSearchKeyRangeFrom, F as NUM_TO_HASH_TYPE, Fr as TransportHttp, I as ADDRESS_BECH32_LIMIT, Ir as JsonRpcPayload, L as AddressFormat, Lr as Transport, M as NUM_TO_DEP_TYPE, Mr as TransportFallback, N as HASH_TYPES, Nr as transportFromUri, O as filterScript, P as HASH_TYPE_TO_NUM, Pr as TransportWebSocket, R as addressFromPayload, S as CellRecord, Sn as ClientCollectableSearchKeyFilterLike, T as filterCell, Tn as DEFAULT_MIN_FEE_RATE, _ as JsonRpcOutPoint, a as JsonRpcBlockHeader, b as TESTNET_SCRIPTS, c as JsonRpcCellInput, d as JsonRpcHashType, f as JsonRpcIndexerFindTransactionsGroupedResponse, fa as BytesFromEncoding, g as JsonRpcIndexerSearchKeyTransaction, h as JsonRpcIndexerSearchKeyFilter, i as JsonRpcBlock, j as DEP_TYPE_TO_NUM, k as filterScriptByLenRange, l as JsonRpcCellOutput, m as JsonRpcIndexerSearchKey, n as CKB_BLAKE2B_PERSONAL, o as JsonRpcBlockUncle, p as JsonRpcIndexerFindTransactionsResponse, r as JsonRpcTransformers, s as JsonRpcCellDep, t as advancedBarrel_d_exports, u as JsonRpcDepType, v as JsonRpcScript, w as MapLru, wn as DEFAULT_MAX_FEE_RATE, x as MAINNET_SCRIPTS, y as JsonRpcTransaction, z as addressPayloadFromString } from "./advancedBarrel-D97MfkUZ.js";
|
|
2
2
|
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, advancedBarrel_d_exports as cccA, clientSearchKeyRangeFrom, filterCell, filterData, filterNumByRange, filterScript, filterScriptByLenRange, transportFromUri };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./address.advanced-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./address.advanced-UCU9Hn8t.js"),t=require("./advancedBarrel.js");exports.ADDRESS_BECH32_LIMIT=e.t,exports.AddressFormat=e.n,exports.CKB_BLAKE2B_PERSONAL=e.gr,exports.DEFAULT_CONFIRMED_BLOCK_TIME=e.Y,exports.DEFAULT_MAX_FEE_RATE=e.vt,exports.DEFAULT_MIN_FEE_RATE=e.yt,exports.DEP_TYPES=e.O,exports.DEP_TYPE_TO_NUM=e.k,exports.HASH_TYPES=e.R,exports.HASH_TYPE_TO_NUM=e.z,exports.JsonRpcTransformers=e.H,exports.MAINNET_SCRIPTS=e.q,exports.MapLru=e.X,exports.NUM_TO_DEP_TYPE=e.A,exports.NUM_TO_HASH_TYPE=e.B,exports.TESTNET_SCRIPTS=e.V,exports.TransportFallback=e.U,exports.TransportHttp=e.K,exports.TransportWebSocket=e.G,exports.addressFromPayload=e.r,exports.addressPayloadFromString=e.i,Object.defineProperty(exports,"cccA",{enumerable:!0,get:function(){return t.t}}),exports.clientSearchKeyRangeFrom=e.bt,exports.filterCell=e.Z,exports.filterData=e.Q,exports.filterNumByRange=e.$,exports.filterScript=e.et,exports.filterScriptByLenRange=e.tt,exports.transportFromUri=e.W;
|
|
@@ -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
|
-
*
|
|
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
|
|
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
|
|
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(
|
|
350
|
+
* const hex = numToHex(4660); // "0x1234"
|
|
351
|
+
* const oddLengthHex = numToHex(10); // "0xa"
|
|
304
352
|
* ```
|
|
305
353
|
*/
|
|
306
354
|
declare function numToHex(val: NumLike): Hex;
|
|
@@ -599,7 +647,13 @@ declare abstract class Entity {
|
|
|
599
647
|
* }
|
|
600
648
|
* ```
|
|
601
649
|
*/
|
|
602
|
-
declare function codec<Encodable, TypeLike extends Encodable, Decoded extends TypeLike>(codec:
|
|
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> & {
|
|
603
657
|
from(decoded: TypeLike): Type;
|
|
604
658
|
byteLength?: number;
|
|
605
659
|
encode(encodable: TypeLike): Bytes$1;
|
|
@@ -745,6 +799,8 @@ interface Hasher {
|
|
|
745
799
|
}
|
|
746
800
|
//#endregion
|
|
747
801
|
//#region src/hasher/hasherCkb.d.ts
|
|
802
|
+
declare const HASH_CKB_LENGTH = 32;
|
|
803
|
+
declare const HASH_CKB_SHORT_LENGTH = 20;
|
|
748
804
|
/**
|
|
749
805
|
* @public
|
|
750
806
|
*/
|
|
@@ -798,6 +854,7 @@ declare class HasherCkb implements Hasher {
|
|
|
798
854
|
* ```
|
|
799
855
|
*/
|
|
800
856
|
declare function hashCkb(...data: BytesLike[]): Hex;
|
|
857
|
+
declare function hashCkbShort(...data: BytesLike[]): Hex;
|
|
801
858
|
//#endregion
|
|
802
859
|
//#region src/hasher/hasherKeecak256.d.ts
|
|
803
860
|
/**
|
|
@@ -1401,6 +1458,81 @@ declare abstract class Signer {
|
|
|
1401
1458
|
*/
|
|
1402
1459
|
signOnlyTransaction(_: TransactionLike): Promise<Transaction>;
|
|
1403
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
|
+
}
|
|
1404
1536
|
/**
|
|
1405
1537
|
* A class representing information about a signer, including its type and the signer instance.
|
|
1406
1538
|
* @public
|
|
@@ -1592,6 +1724,45 @@ declare function btcPublicKeyFromP2pkhAddress(address: string): Hex;
|
|
|
1592
1724
|
*/
|
|
1593
1725
|
declare function verifyMessageBtcEcdsa(message: string | BytesLike, signature: string, publicKey: string): boolean;
|
|
1594
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
|
|
1595
1766
|
//#region src/signer/ckb/signerCkbPublicKey.d.ts
|
|
1596
1767
|
/**
|
|
1597
1768
|
* @public
|
|
@@ -1692,15 +1863,255 @@ declare class SignerCkbScriptReadonly extends Signer {
|
|
|
1692
1863
|
getAddressObjs(): Promise<Address[]>;
|
|
1693
1864
|
}
|
|
1694
1865
|
//#endregion
|
|
1695
|
-
//#region src/signer/ckb/
|
|
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
|
+
};
|
|
1696
1891
|
/**
|
|
1892
|
+
* A class representing multisig information, holding information ingredients and containing utilities.
|
|
1697
1893
|
* @public
|
|
1698
1894
|
*/
|
|
1699
|
-
declare
|
|
1895
|
+
declare class MultisigCkbWitness extends MultisigCkbWitness_base {
|
|
1896
|
+
publicKeyHashes: Hex[];
|
|
1897
|
+
threshold: number;
|
|
1898
|
+
mustMatch: number;
|
|
1899
|
+
signatures: Hex[];
|
|
1900
|
+
/**
|
|
1901
|
+
* @param publicKeyHashes - The public key hashes.
|
|
1902
|
+
* @param threshold - The threshold.
|
|
1903
|
+
* @param mustMatch - The number of signatures that must match.
|
|
1904
|
+
* @param signatures - The signatures.
|
|
1905
|
+
*/
|
|
1906
|
+
constructor(publicKeyHashes: Hex[], threshold: number, mustMatch: number, signatures: Hex[]);
|
|
1907
|
+
/**
|
|
1908
|
+
* Create a MultisigCkbWitness from a MultisigCkbWitnessLike.
|
|
1909
|
+
*
|
|
1910
|
+
* @param witness - The witness like object.
|
|
1911
|
+
* @returns The MultisigCkbWitness.
|
|
1912
|
+
*/
|
|
1913
|
+
static from(witness: MultisigCkbWitnessLike): MultisigCkbWitness;
|
|
1914
|
+
/**
|
|
1915
|
+
* Get the threshold of flexible signatures.
|
|
1916
|
+
*/
|
|
1917
|
+
get flexibleThreshold(): number;
|
|
1918
|
+
/**
|
|
1919
|
+
* Get the script args of the multisig script.
|
|
1920
|
+
*
|
|
1921
|
+
* @param since - The since value.
|
|
1922
|
+
* @returns The script args.
|
|
1923
|
+
*/
|
|
1924
|
+
scriptArgs(since?: SinceLike | null): Bytes$1;
|
|
1925
|
+
/**
|
|
1926
|
+
* Check if the multisig info is equal to another.
|
|
1927
|
+
*
|
|
1928
|
+
* @param otherLike - The other multisig info.
|
|
1929
|
+
* @returns True if the multisig info is equal, false otherwise.
|
|
1930
|
+
*/
|
|
1931
|
+
eqInfo(otherLike: MultisigCkbWitnessLike): boolean;
|
|
1932
|
+
/**
|
|
1933
|
+
* Generate valid public key hashes and their signatures from the witness.
|
|
1934
|
+
* This method filters out invalid signatures, duplicate signatures, and signatures not in the multisig script.
|
|
1935
|
+
*
|
|
1936
|
+
* @param message - The message signed.
|
|
1937
|
+
* @returns A generator of public key hashes, signatures, and whether the signature is required.
|
|
1938
|
+
*/
|
|
1939
|
+
generatePublicKeyHashesFromSignatures(message: BytesLike): Generator<{
|
|
1940
|
+
pubkeyHash: Hex;
|
|
1941
|
+
signature: Hex;
|
|
1942
|
+
isRequired: boolean;
|
|
1943
|
+
}>;
|
|
1944
|
+
/**
|
|
1945
|
+
* Calculate the number of matched signatures in the witness.
|
|
1946
|
+
*
|
|
1947
|
+
* @param message - The message signed.
|
|
1948
|
+
* @returns The number of required and flexible signatures.
|
|
1949
|
+
*/
|
|
1950
|
+
calcMatchedSignaturesCount(message: BytesLike): {
|
|
1951
|
+
required: number;
|
|
1952
|
+
flexible: number;
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1700
1955
|
/**
|
|
1956
|
+
* A class extending Signer that provides access to a CKB multisig script.
|
|
1957
|
+
* This class does not support signing operations.
|
|
1701
1958
|
* @public
|
|
1702
1959
|
*/
|
|
1703
|
-
declare
|
|
1960
|
+
declare class SignerMultisigCkbReadonly extends SignerMultisig {
|
|
1961
|
+
static EmptySignature: `0x${string}`;
|
|
1962
|
+
get type(): SignerType;
|
|
1963
|
+
get signType(): SignerSignType;
|
|
1964
|
+
readonly multisigInfo: MultisigCkbWitness;
|
|
1965
|
+
readonly since?: Since;
|
|
1966
|
+
readonly scriptInfos: Promise<{
|
|
1967
|
+
script: Script;
|
|
1968
|
+
cellDeps: CellDepInfo[];
|
|
1969
|
+
}[]>;
|
|
1970
|
+
/**
|
|
1971
|
+
* Creates an instance of SignerMultisigCkbReadonly.
|
|
1972
|
+
*
|
|
1973
|
+
* @param client - The client instance.
|
|
1974
|
+
* @param multisigInfoLike - The multisig information.
|
|
1975
|
+
* @param options - The options.
|
|
1976
|
+
*/
|
|
1977
|
+
constructor(client: Client, multisigInfoLike: MultisigCkbWitnessLike, options?: {
|
|
1978
|
+
since?: SinceLike | null;
|
|
1979
|
+
scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
|
|
1980
|
+
} | null);
|
|
1981
|
+
/**
|
|
1982
|
+
* Get the number of members in the multisig script.
|
|
1983
|
+
*
|
|
1984
|
+
* @returns The number of members.
|
|
1985
|
+
*/
|
|
1986
|
+
getMemberCount(): Promise<number>;
|
|
1987
|
+
/**
|
|
1988
|
+
* Get the threshold of the multisig script.
|
|
1989
|
+
*
|
|
1990
|
+
* @returns The threshold.
|
|
1991
|
+
*/
|
|
1992
|
+
getMemberThreshold(): Promise<number>;
|
|
1993
|
+
/**
|
|
1994
|
+
* Get the count of required member of the multisig script.
|
|
1995
|
+
*
|
|
1996
|
+
* @returns The must match count.
|
|
1997
|
+
*/
|
|
1998
|
+
getMemberRequiredCount(): Promise<number>;
|
|
1999
|
+
connect(): Promise<void>;
|
|
2000
|
+
isConnected(): Promise<boolean>;
|
|
2001
|
+
getInternalAddress(): Promise<string>;
|
|
2002
|
+
getAddressObjs(): Promise<Address[]>;
|
|
2003
|
+
/**
|
|
2004
|
+
* Decode the witness args at a specific index.
|
|
2005
|
+
*
|
|
2006
|
+
* @param txLike - The transaction.
|
|
2007
|
+
* @param index - The index of the witness args.
|
|
2008
|
+
* @returns The decoded MultisigCkbWitness.
|
|
2009
|
+
*/
|
|
2010
|
+
decodeWitnessArgsAt(txLike: TransactionLike, index: number): MultisigCkbWitness | undefined;
|
|
2011
|
+
/**
|
|
2012
|
+
* Decode the witness args.
|
|
2013
|
+
*
|
|
2014
|
+
* @param witnessLike - The witness args like object.
|
|
2015
|
+
* @returns The decoded MultisigCkbWitness.
|
|
2016
|
+
*/
|
|
2017
|
+
decodeWitnessArgs(witnessLike?: WitnessArgsLike | null): MultisigCkbWitness | undefined;
|
|
2018
|
+
/**
|
|
2019
|
+
* Prepare the witness args at a specific index.
|
|
2020
|
+
*
|
|
2021
|
+
* @param txLike - The transaction.
|
|
2022
|
+
* @param index - The index of the witness args.
|
|
2023
|
+
* @param transformer - The transformer function.
|
|
2024
|
+
* @returns The prepared transaction.
|
|
2025
|
+
*/
|
|
2026
|
+
prepareWitnessArgsAt(txLike: TransactionLike, index: number, transformer?: ((witness: MultisigCkbWitness, witnessArgs: WitnessArgs) => MultisigCkbWitnessLike | undefined | null | void | Promise<MultisigCkbWitnessLike | undefined | null | void>) | null): Promise<Transaction>;
|
|
2027
|
+
/**
|
|
2028
|
+
* Prepare multisig witness, if the existence of multisig witness is detected, nothing happens
|
|
2029
|
+
*
|
|
2030
|
+
* @param txLike - The transaction to prepare.
|
|
2031
|
+
* @param scriptLike - The script to prepare.
|
|
2032
|
+
* @returns A promise that resolves to the prepared transaction
|
|
2033
|
+
*/
|
|
2034
|
+
prepareTransactionOneScript(txLike: TransactionLike, script: ScriptLike, cellDeps: CellDepInfoLike[]): Promise<Transaction>;
|
|
2035
|
+
/**
|
|
2036
|
+
* Prepare transaction for multisig witness and adding related cell deps
|
|
2037
|
+
*
|
|
2038
|
+
* @param txLike - The transaction to prepare.
|
|
2039
|
+
* @returns A promise that resolves to the prepared transaction
|
|
2040
|
+
*/
|
|
2041
|
+
prepareTransaction(txLike: TransactionLike): Promise<Transaction>;
|
|
2042
|
+
/**
|
|
2043
|
+
* Get the number of valid signatures for matching multisig inputs in the transaction.
|
|
2044
|
+
*
|
|
2045
|
+
* @remarks
|
|
2046
|
+
* Returns `undefined` when the transaction has no inputs locked by any multisig address
|
|
2047
|
+
* supported by this signer. This method only counts signatures for matching multisig inputs
|
|
2048
|
+
* and does not imply that the transaction should be signed by this multisig.
|
|
2049
|
+
*
|
|
2050
|
+
* @param txLike - The transaction.
|
|
2051
|
+
* @returns The matched multisig signature count, or `undefined` when the transaction is unrelated to any multisig address supported by this signer.
|
|
2052
|
+
*/
|
|
2053
|
+
getSignaturesCount(txLike: TransactionLike): Promise<number | undefined>;
|
|
2054
|
+
/**
|
|
2055
|
+
* Check if related multisig inputs in the transaction need more signatures.
|
|
2056
|
+
*
|
|
2057
|
+
* @remarks
|
|
2058
|
+
* Returns `false` when the transaction has no inputs locked by any multisig address
|
|
2059
|
+
* supported by this signer.
|
|
2060
|
+
* A `false` result therefore means either the related multisig inputs are already fulfilled,
|
|
2061
|
+
* or the transaction is unrelated to all multisig addresses supported by this signer.
|
|
2062
|
+
*
|
|
2063
|
+
* @param txLike - The transaction to check.
|
|
2064
|
+
* @returns A promise that resolves to `true` when related multisig inputs still need signatures, and `false` otherwise.
|
|
2065
|
+
*/
|
|
2066
|
+
needMoreSignatures(txLike: TransactionLike): Promise<boolean>;
|
|
2067
|
+
/**
|
|
2068
|
+
* Get the sign info for a script.
|
|
2069
|
+
*
|
|
2070
|
+
* @param txLike - The transaction.
|
|
2071
|
+
* @param script - The script.
|
|
2072
|
+
* @returns The sign info.
|
|
2073
|
+
*/
|
|
2074
|
+
getSignInfo(txLike: TransactionLike, script: ScriptLike): Promise<{
|
|
2075
|
+
message: Hex;
|
|
2076
|
+
position: number;
|
|
2077
|
+
} | undefined>;
|
|
2078
|
+
/**
|
|
2079
|
+
* Aggregate transactions.
|
|
2080
|
+
*
|
|
2081
|
+
* @param txs - The transactions to aggregate.
|
|
2082
|
+
* @returns The aggregated transaction.
|
|
2083
|
+
*/
|
|
2084
|
+
aggregateTransactions(txs: TransactionLike[]): Promise<Transaction>;
|
|
2085
|
+
}
|
|
2086
|
+
//#endregion
|
|
2087
|
+
//#region src/signer/ckb/signerMultisigCkbPrivateKey.d.ts
|
|
2088
|
+
/**
|
|
2089
|
+
* A class extending Signer that provides access to a CKB multisig script and supports signing operations.
|
|
2090
|
+
* @public
|
|
2091
|
+
*/
|
|
2092
|
+
declare class SignerMultisigCkbPrivateKey extends SignerMultisigCkbReadonly {
|
|
2093
|
+
private readonly privateKey;
|
|
2094
|
+
private readonly signer;
|
|
2095
|
+
/**
|
|
2096
|
+
* Creates an instance of SignerMultisigCkbPrivateKey.
|
|
2097
|
+
*
|
|
2098
|
+
* @param client - The client instance.
|
|
2099
|
+
* @param privateKey - The private key.
|
|
2100
|
+
* @param multisigInfo - The multisig information.
|
|
2101
|
+
* @param options - The options.
|
|
2102
|
+
*/
|
|
2103
|
+
constructor(client: Client, privateKey: HexLike, multisigInfo: MultisigCkbWitnessLike, options?: {
|
|
2104
|
+
since?: SinceLike | null;
|
|
2105
|
+
scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
|
|
2106
|
+
} | null);
|
|
2107
|
+
/**
|
|
2108
|
+
* Sign a transaction only (without preparing).
|
|
2109
|
+
*
|
|
2110
|
+
* @param txLike - The transaction to sign.
|
|
2111
|
+
* @returns The signed transaction.
|
|
2112
|
+
*/
|
|
2113
|
+
signOnlyTransaction(txLike: TransactionLike): Promise<Transaction>;
|
|
2114
|
+
}
|
|
1704
2115
|
//#endregion
|
|
1705
2116
|
//#region src/signer/ckb/verifyJoyId.d.ts
|
|
1706
2117
|
/**
|
|
@@ -2102,7 +2513,7 @@ declare function buildNostrEventFromMessage(message: string | BytesLike): NostrE
|
|
|
2102
2513
|
declare function nostrEventHash(event: NostrEvent): Bytes$1;
|
|
2103
2514
|
declare function verifyMessageNostrEvent(message: string | BytesLike, signature: string, address: string): boolean;
|
|
2104
2515
|
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 };
|
|
2516
|
+
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
2517
|
}
|
|
2107
2518
|
//#endregion
|
|
2108
2519
|
//#region src/client/clientTypes.advanced.d.ts
|
|
@@ -2758,6 +3169,8 @@ declare enum KnownScript {
|
|
|
2758
3169
|
NervosDao = "NervosDao",
|
|
2759
3170
|
Secp256k1Blake160 = "Secp256k1Blake160",
|
|
2760
3171
|
Secp256k1Multisig = "Secp256k1Multisig",
|
|
3172
|
+
Secp256k1MultisigV2Beta = "Secp256k1MultisigV2Beta",
|
|
3173
|
+
// Fix rare failing case (https://github.com/nervosnetwork/ckb-system-scripts/pull/98)
|
|
2761
3174
|
Secp256k1MultisigV2 = "Secp256k1MultisigV2",
|
|
2762
3175
|
// Enhanced since handling (https://github.com/nervosnetwork/ckb-system-scripts/pull/99)
|
|
2763
3176
|
AnyoneCanPay = "AnyoneCanPay",
|
|
@@ -4074,10 +4487,22 @@ declare class Transaction extends Transaction_base {
|
|
|
4074
4487
|
*
|
|
4075
4488
|
* @example
|
|
4076
4489
|
* ```typescript
|
|
4077
|
-
* const witnessArgs =
|
|
4490
|
+
* const witnessArgs = tx.getWitnessArgsAt(0);
|
|
4078
4491
|
* ```
|
|
4079
4492
|
*/
|
|
4080
4493
|
getWitnessArgsAt(index: number): WitnessArgs | undefined;
|
|
4494
|
+
/**
|
|
4495
|
+
* Get witness at index as WitnessArgs, throw if failed to decode
|
|
4496
|
+
*
|
|
4497
|
+
* @param index - The index of the witness.
|
|
4498
|
+
* @returns The witness parsed as WitnessArgs.
|
|
4499
|
+
*
|
|
4500
|
+
* @example
|
|
4501
|
+
* ```typescript
|
|
4502
|
+
* const witnessArgs = tx.getWitnessArgsAtUnsafe(0);
|
|
4503
|
+
* ```
|
|
4504
|
+
*/
|
|
4505
|
+
getWitnessArgsAtUnsafe(index: number): WitnessArgs | undefined;
|
|
4081
4506
|
/**
|
|
4082
4507
|
* Set witness at index by WitnessArgs
|
|
4083
4508
|
*
|
|
@@ -5476,5 +5901,5 @@ declare namespace advancedBarrel_d_exports {
|
|
|
5476
5901
|
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
5902
|
}
|
|
5478
5903
|
//#endregion
|
|
5479
|
-
export { CellDep as $,
|
|
5480
|
-
//# sourceMappingURL=advancedBarrel-
|
|
5904
|
+
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 };
|
|
5905
|
+
//# sourceMappingURL=advancedBarrel-D97MfkUZ.d.ts.map
|