@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
package/dist/advanced.d.mts
CHANGED
|
@@ -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-Dwyn3WMm.mjs";
|
|
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 };
|
package/dist/advanced.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,G as r,H as i,K as a,O as o,Q as s,R as c,U as l,V as u,W as d,X as f,Y as p,Z as m,bt as h,et as g,
|
|
1
|
+
import{$ as e,A as t,B as n,G as r,H as i,K as a,O as o,Q as s,R as c,U as l,V as u,W as d,X as f,Y as p,Z as m,bt as h,et as g,gr as _,i as v,k as y,n as b,q as x,r as S,t as C,tt as w,vt as T,yt as E,z as D}from"./address.advanced-BHxWrbFc.mjs";import{t as O}from"./advancedBarrel.mjs";export{C as ADDRESS_BECH32_LIMIT,b as AddressFormat,_ as CKB_BLAKE2B_PERSONAL,p as DEFAULT_CONFIRMED_BLOCK_TIME,T as DEFAULT_MAX_FEE_RATE,E as DEFAULT_MIN_FEE_RATE,o as DEP_TYPES,y as DEP_TYPE_TO_NUM,c as HASH_TYPES,D as HASH_TYPE_TO_NUM,i as JsonRpcTransformers,x as MAINNET_SCRIPTS,f as MapLru,t as NUM_TO_DEP_TYPE,n as NUM_TO_HASH_TYPE,u as TESTNET_SCRIPTS,l as TransportFallback,a as TransportHttp,r as TransportWebSocket,S as addressFromPayload,v as addressPayloadFromString,O as cccA,h as clientSearchKeyRangeFrom,m as filterCell,s as filterData,e as filterNumByRange,g as filterScript,w as filterScriptByLenRange,d as transportFromUri};
|
|
@@ -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
|
-
*
|
|
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
|
|
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
|
|
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(
|
|
349
|
+
* const hex = numToHex(4660); // "0x1234"
|
|
350
|
+
* const oddLengthHex = numToHex(10); // "0xa"
|
|
305
351
|
* ```
|
|
306
352
|
*/
|
|
307
353
|
declare function numToHex(val: NumLike): Hex;
|
|
@@ -600,7 +646,13 @@ declare abstract class Entity {
|
|
|
600
646
|
* }
|
|
601
647
|
* ```
|
|
602
648
|
*/
|
|
603
|
-
declare function codec<Encodable, TypeLike extends Encodable, Decoded extends TypeLike>(codec:
|
|
649
|
+
declare function codec<Encodable, TypeLike extends Encodable, Decoded extends TypeLike>(codec: {
|
|
650
|
+
encode: (encodable: Encodable) => Bytes$1;
|
|
651
|
+
decode: (decodable: Bytes$1, config?: {
|
|
652
|
+
isExtraFieldIgnored?: boolean;
|
|
653
|
+
}) => Decoded;
|
|
654
|
+
byteLength?: number;
|
|
655
|
+
}): <Type extends TypeLike, ConstructorType extends Constructor<Type> & {
|
|
604
656
|
from(decoded: TypeLike): Type;
|
|
605
657
|
byteLength?: number;
|
|
606
658
|
encode(encodable: TypeLike): Bytes$1;
|
|
@@ -746,6 +798,8 @@ interface Hasher {
|
|
|
746
798
|
}
|
|
747
799
|
//#endregion
|
|
748
800
|
//#region src/hasher/hasherCkb.d.ts
|
|
801
|
+
declare const HASH_CKB_LENGTH = 32;
|
|
802
|
+
declare const HASH_CKB_SHORT_LENGTH = 20;
|
|
749
803
|
/**
|
|
750
804
|
* @public
|
|
751
805
|
*/
|
|
@@ -799,6 +853,7 @@ declare class HasherCkb implements Hasher {
|
|
|
799
853
|
* ```
|
|
800
854
|
*/
|
|
801
855
|
declare function hashCkb(...data: BytesLike[]): Hex;
|
|
856
|
+
declare function hashCkbShort(...data: BytesLike[]): Hex;
|
|
802
857
|
//#endregion
|
|
803
858
|
//#region src/hasher/hasherKeecak256.d.ts
|
|
804
859
|
/**
|
|
@@ -1402,6 +1457,81 @@ declare abstract class Signer {
|
|
|
1402
1457
|
*/
|
|
1403
1458
|
signOnlyTransaction(_: TransactionLike): Promise<Transaction>;
|
|
1404
1459
|
}
|
|
1460
|
+
/**
|
|
1461
|
+
* An abstract class representing a multisig signer.
|
|
1462
|
+
* @public
|
|
1463
|
+
*/
|
|
1464
|
+
declare abstract class SignerMultisig extends Signer {
|
|
1465
|
+
/**
|
|
1466
|
+
* Get the number of members in the multisig script.
|
|
1467
|
+
* @returns The number of members.
|
|
1468
|
+
*/
|
|
1469
|
+
abstract getMemberCount(): Promise<number>;
|
|
1470
|
+
/**
|
|
1471
|
+
* Get the threshold of the multisig script.
|
|
1472
|
+
* @returns The threshold.
|
|
1473
|
+
*/
|
|
1474
|
+
abstract getMemberThreshold(): Promise<number>;
|
|
1475
|
+
/**
|
|
1476
|
+
* Get the count of required member of the multisig script.
|
|
1477
|
+
* @returns The must match count.
|
|
1478
|
+
*/
|
|
1479
|
+
abstract getMemberRequiredCount(): Promise<number>;
|
|
1480
|
+
/**
|
|
1481
|
+
* Get the number of valid signatures for matching multisig inputs in the transaction.
|
|
1482
|
+
*
|
|
1483
|
+
* @remarks
|
|
1484
|
+
* Returns `undefined` when the transaction has no inputs locked by any multisig address
|
|
1485
|
+
* supported by this signer. This method only evaluates matching multisig inputs and does
|
|
1486
|
+
* not indicate whether the transaction itself is expected to be signed by this multisig.
|
|
1487
|
+
*
|
|
1488
|
+
* @param _ - The transaction.
|
|
1489
|
+
* @returns The matched multisig signature count, or `undefined` when the transaction is unrelated to any multisig address supported by this signer.
|
|
1490
|
+
*/
|
|
1491
|
+
abstract getSignaturesCount(_: TransactionLike): Promise<number | undefined>;
|
|
1492
|
+
/**
|
|
1493
|
+
* Check if related multisig inputs in the transaction need more signatures.
|
|
1494
|
+
*
|
|
1495
|
+
* @remarks
|
|
1496
|
+
* Returns `false` when the transaction has no inputs locked by any multisig address
|
|
1497
|
+
* supported by this signer.
|
|
1498
|
+
* A `false` result therefore means either the related multisig inputs are already fulfilled,
|
|
1499
|
+
* or the transaction is unrelated to all multisig addresses supported by this signer.
|
|
1500
|
+
*
|
|
1501
|
+
* @param txLike - The transaction to check.
|
|
1502
|
+
* @returns A promise that resolves to `true` when related multisig inputs still need signatures, and `false` otherwise.
|
|
1503
|
+
*/
|
|
1504
|
+
abstract needMoreSignatures(_: TransactionLike): Promise<boolean>;
|
|
1505
|
+
/**
|
|
1506
|
+
* Aggregate transactions.
|
|
1507
|
+
* @param _ - The transactions to aggregate.
|
|
1508
|
+
* @returns The aggregated transaction.
|
|
1509
|
+
*/
|
|
1510
|
+
abstract aggregateTransactions(_: TransactionLike[]): Promise<Transaction>;
|
|
1511
|
+
/**
|
|
1512
|
+
* Send a transaction.
|
|
1513
|
+
*
|
|
1514
|
+
* @remarks
|
|
1515
|
+
* This method rejects the transaction only when related multisig inputs still need signatures.
|
|
1516
|
+
* It does not verify that the transaction actually contains inputs locked by any multisig
|
|
1517
|
+
* address supported by this signer, so transactions unrelated to those multisig addresses
|
|
1518
|
+
* are not rejected by this check.
|
|
1519
|
+
*
|
|
1520
|
+
* @param tx - The transaction to send.
|
|
1521
|
+
* @returns The transaction hash.
|
|
1522
|
+
*/
|
|
1523
|
+
sendTransaction(tx: TransactionLike): Promise<Hex>;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Thrown when a multisig transaction is sent before enough signatures are collected.
|
|
1527
|
+
*
|
|
1528
|
+
* @public
|
|
1529
|
+
*/
|
|
1530
|
+
declare class SignerMultisigNotEnoughSignaturesError extends Error {
|
|
1531
|
+
readonly signaturesCount: number;
|
|
1532
|
+
readonly threshold: number;
|
|
1533
|
+
constructor(signaturesCount: number, threshold: number);
|
|
1534
|
+
}
|
|
1405
1535
|
/**
|
|
1406
1536
|
* A class representing information about a signer, including its type and the signer instance.
|
|
1407
1537
|
* @public
|
|
@@ -1593,6 +1723,45 @@ declare function btcPublicKeyFromP2pkhAddress(address: string): Hex;
|
|
|
1593
1723
|
*/
|
|
1594
1724
|
declare function verifyMessageBtcEcdsa(message: string | BytesLike, signature: string, publicKey: string): boolean;
|
|
1595
1725
|
//#endregion
|
|
1726
|
+
//#region src/signer/ckb/secp256k1Signing.d.ts
|
|
1727
|
+
declare const SECP256K1_SIGNATURE_LENGTH = 65;
|
|
1728
|
+
/**
|
|
1729
|
+
* Sign a message using Secp256k1.
|
|
1730
|
+
*
|
|
1731
|
+
* @param message - The message to sign.
|
|
1732
|
+
* @param privateKey - The private key.
|
|
1733
|
+
* @returns The signature.
|
|
1734
|
+
* @public
|
|
1735
|
+
*/
|
|
1736
|
+
declare function signMessageSecp256k1(message: BytesLike, privateKey: BytesLike): Hex;
|
|
1737
|
+
/**
|
|
1738
|
+
* Verify a message using Secp256k1.
|
|
1739
|
+
*
|
|
1740
|
+
* @param message - The message to verify.
|
|
1741
|
+
* @param signature - The signature.
|
|
1742
|
+
* @param publicKey - The public key.
|
|
1743
|
+
* @returns True if the signature is valid, false otherwise.
|
|
1744
|
+
* @public
|
|
1745
|
+
*/
|
|
1746
|
+
declare function verifyMessageSecp256k1(message: BytesLike, signature: BytesLike, publicKey: BytesLike): boolean;
|
|
1747
|
+
/**
|
|
1748
|
+
* Recover the public key from a Secp256k1 signature.
|
|
1749
|
+
*
|
|
1750
|
+
* @param message - The message.
|
|
1751
|
+
* @param signature - The signature.
|
|
1752
|
+
* @returns The recovered public key.
|
|
1753
|
+
* @public
|
|
1754
|
+
*/
|
|
1755
|
+
declare function recoverMessageSecp256k1(message: BytesLike, signature: BytesLike): Hex;
|
|
1756
|
+
/**
|
|
1757
|
+
* @public
|
|
1758
|
+
*/
|
|
1759
|
+
declare function messageHashCkbSecp256k1(message: string | BytesLike): Hex;
|
|
1760
|
+
/**
|
|
1761
|
+
* @public
|
|
1762
|
+
*/
|
|
1763
|
+
declare function verifyMessageCkbSecp256k1(message: string | BytesLike, signature: string, publicKey: string): boolean;
|
|
1764
|
+
//#endregion
|
|
1596
1765
|
//#region src/signer/ckb/signerCkbPublicKey.d.ts
|
|
1597
1766
|
/**
|
|
1598
1767
|
* @public
|
|
@@ -1693,15 +1862,255 @@ declare class SignerCkbScriptReadonly extends Signer {
|
|
|
1693
1862
|
getAddressObjs(): Promise<Address[]>;
|
|
1694
1863
|
}
|
|
1695
1864
|
//#endregion
|
|
1696
|
-
//#region src/signer/ckb/
|
|
1865
|
+
//#region src/signer/ckb/signerMultisigCkbReadonly.d.ts
|
|
1866
|
+
type MultisigCkbWitnessLike = ({
|
|
1867
|
+
publicKeyHashes: HexLike[];
|
|
1868
|
+
publicKeys?: undefined | null;
|
|
1869
|
+
} | {
|
|
1870
|
+
publicKeyHashes?: undefined | null;
|
|
1871
|
+
publicKeys: HexLike[];
|
|
1872
|
+
}) & {
|
|
1873
|
+
threshold: NumLike;
|
|
1874
|
+
mustMatch?: NumLike | null;
|
|
1875
|
+
signatures?: HexLike[] | null;
|
|
1876
|
+
};
|
|
1877
|
+
declare const MultisigCkbWitness_base: (abstract new () => {
|
|
1878
|
+
toBytes(): Bytes$1;
|
|
1879
|
+
clone(): MultisigCkbWitness;
|
|
1880
|
+
eq(other: MultisigCkbWitnessLike): boolean;
|
|
1881
|
+
hash(): Hex;
|
|
1882
|
+
toHex(): Hex;
|
|
1883
|
+
}) & {
|
|
1884
|
+
byteLength?: number;
|
|
1885
|
+
encode(_: MultisigCkbWitnessLike): Bytes$1;
|
|
1886
|
+
decode(_: BytesLike): MultisigCkbWitness;
|
|
1887
|
+
fromBytes(_bytes: BytesLike): MultisigCkbWitness;
|
|
1888
|
+
from(_: MultisigCkbWitnessLike): MultisigCkbWitness;
|
|
1889
|
+
};
|
|
1697
1890
|
/**
|
|
1891
|
+
* A class representing multisig information, holding information ingredients and containing utilities.
|
|
1698
1892
|
* @public
|
|
1699
1893
|
*/
|
|
1700
|
-
declare
|
|
1894
|
+
declare class MultisigCkbWitness extends MultisigCkbWitness_base {
|
|
1895
|
+
publicKeyHashes: Hex[];
|
|
1896
|
+
threshold: number;
|
|
1897
|
+
mustMatch: number;
|
|
1898
|
+
signatures: Hex[];
|
|
1899
|
+
/**
|
|
1900
|
+
* @param publicKeyHashes - The public key hashes.
|
|
1901
|
+
* @param threshold - The threshold.
|
|
1902
|
+
* @param mustMatch - The number of signatures that must match.
|
|
1903
|
+
* @param signatures - The signatures.
|
|
1904
|
+
*/
|
|
1905
|
+
constructor(publicKeyHashes: Hex[], threshold: number, mustMatch: number, signatures: Hex[]);
|
|
1906
|
+
/**
|
|
1907
|
+
* Create a MultisigCkbWitness from a MultisigCkbWitnessLike.
|
|
1908
|
+
*
|
|
1909
|
+
* @param witness - The witness like object.
|
|
1910
|
+
* @returns The MultisigCkbWitness.
|
|
1911
|
+
*/
|
|
1912
|
+
static from(witness: MultisigCkbWitnessLike): MultisigCkbWitness;
|
|
1913
|
+
/**
|
|
1914
|
+
* Get the threshold of flexible signatures.
|
|
1915
|
+
*/
|
|
1916
|
+
get flexibleThreshold(): number;
|
|
1917
|
+
/**
|
|
1918
|
+
* Get the script args of the multisig script.
|
|
1919
|
+
*
|
|
1920
|
+
* @param since - The since value.
|
|
1921
|
+
* @returns The script args.
|
|
1922
|
+
*/
|
|
1923
|
+
scriptArgs(since?: SinceLike | null): Bytes$1;
|
|
1924
|
+
/**
|
|
1925
|
+
* Check if the multisig info is equal to another.
|
|
1926
|
+
*
|
|
1927
|
+
* @param otherLike - The other multisig info.
|
|
1928
|
+
* @returns True if the multisig info is equal, false otherwise.
|
|
1929
|
+
*/
|
|
1930
|
+
eqInfo(otherLike: MultisigCkbWitnessLike): boolean;
|
|
1931
|
+
/**
|
|
1932
|
+
* Generate valid public key hashes and their signatures from the witness.
|
|
1933
|
+
* This method filters out invalid signatures, duplicate signatures, and signatures not in the multisig script.
|
|
1934
|
+
*
|
|
1935
|
+
* @param message - The message signed.
|
|
1936
|
+
* @returns A generator of public key hashes, signatures, and whether the signature is required.
|
|
1937
|
+
*/
|
|
1938
|
+
generatePublicKeyHashesFromSignatures(message: BytesLike): Generator<{
|
|
1939
|
+
pubkeyHash: Hex;
|
|
1940
|
+
signature: Hex;
|
|
1941
|
+
isRequired: boolean;
|
|
1942
|
+
}>;
|
|
1943
|
+
/**
|
|
1944
|
+
* Calculate the number of matched signatures in the witness.
|
|
1945
|
+
*
|
|
1946
|
+
* @param message - The message signed.
|
|
1947
|
+
* @returns The number of required and flexible signatures.
|
|
1948
|
+
*/
|
|
1949
|
+
calcMatchedSignaturesCount(message: BytesLike): {
|
|
1950
|
+
required: number;
|
|
1951
|
+
flexible: number;
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1701
1954
|
/**
|
|
1955
|
+
* A class extending Signer that provides access to a CKB multisig script.
|
|
1956
|
+
* This class does not support signing operations.
|
|
1702
1957
|
* @public
|
|
1703
1958
|
*/
|
|
1704
|
-
declare
|
|
1959
|
+
declare class SignerMultisigCkbReadonly extends SignerMultisig {
|
|
1960
|
+
static EmptySignature: `0x${string}`;
|
|
1961
|
+
get type(): SignerType;
|
|
1962
|
+
get signType(): SignerSignType;
|
|
1963
|
+
readonly multisigInfo: MultisigCkbWitness;
|
|
1964
|
+
readonly since?: Since;
|
|
1965
|
+
readonly scriptInfos: Promise<{
|
|
1966
|
+
script: Script;
|
|
1967
|
+
cellDeps: CellDepInfo[];
|
|
1968
|
+
}[]>;
|
|
1969
|
+
/**
|
|
1970
|
+
* Creates an instance of SignerMultisigCkbReadonly.
|
|
1971
|
+
*
|
|
1972
|
+
* @param client - The client instance.
|
|
1973
|
+
* @param multisigInfoLike - The multisig information.
|
|
1974
|
+
* @param options - The options.
|
|
1975
|
+
*/
|
|
1976
|
+
constructor(client: Client, multisigInfoLike: MultisigCkbWitnessLike, options?: {
|
|
1977
|
+
since?: SinceLike | null;
|
|
1978
|
+
scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
|
|
1979
|
+
} | null);
|
|
1980
|
+
/**
|
|
1981
|
+
* Get the number of members in the multisig script.
|
|
1982
|
+
*
|
|
1983
|
+
* @returns The number of members.
|
|
1984
|
+
*/
|
|
1985
|
+
getMemberCount(): Promise<number>;
|
|
1986
|
+
/**
|
|
1987
|
+
* Get the threshold of the multisig script.
|
|
1988
|
+
*
|
|
1989
|
+
* @returns The threshold.
|
|
1990
|
+
*/
|
|
1991
|
+
getMemberThreshold(): Promise<number>;
|
|
1992
|
+
/**
|
|
1993
|
+
* Get the count of required member of the multisig script.
|
|
1994
|
+
*
|
|
1995
|
+
* @returns The must match count.
|
|
1996
|
+
*/
|
|
1997
|
+
getMemberRequiredCount(): Promise<number>;
|
|
1998
|
+
connect(): Promise<void>;
|
|
1999
|
+
isConnected(): Promise<boolean>;
|
|
2000
|
+
getInternalAddress(): Promise<string>;
|
|
2001
|
+
getAddressObjs(): Promise<Address[]>;
|
|
2002
|
+
/**
|
|
2003
|
+
* Decode the witness args at a specific index.
|
|
2004
|
+
*
|
|
2005
|
+
* @param txLike - The transaction.
|
|
2006
|
+
* @param index - The index of the witness args.
|
|
2007
|
+
* @returns The decoded MultisigCkbWitness.
|
|
2008
|
+
*/
|
|
2009
|
+
decodeWitnessArgsAt(txLike: TransactionLike, index: number): MultisigCkbWitness | undefined;
|
|
2010
|
+
/**
|
|
2011
|
+
* Decode the witness args.
|
|
2012
|
+
*
|
|
2013
|
+
* @param witnessLike - The witness args like object.
|
|
2014
|
+
* @returns The decoded MultisigCkbWitness.
|
|
2015
|
+
*/
|
|
2016
|
+
decodeWitnessArgs(witnessLike?: WitnessArgsLike | null): MultisigCkbWitness | undefined;
|
|
2017
|
+
/**
|
|
2018
|
+
* Prepare the witness args at a specific index.
|
|
2019
|
+
*
|
|
2020
|
+
* @param txLike - The transaction.
|
|
2021
|
+
* @param index - The index of the witness args.
|
|
2022
|
+
* @param transformer - The transformer function.
|
|
2023
|
+
* @returns The prepared transaction.
|
|
2024
|
+
*/
|
|
2025
|
+
prepareWitnessArgsAt(txLike: TransactionLike, index: number, transformer?: ((witness: MultisigCkbWitness, witnessArgs: WitnessArgs) => MultisigCkbWitnessLike | undefined | null | void | Promise<MultisigCkbWitnessLike | undefined | null | void>) | null): Promise<Transaction>;
|
|
2026
|
+
/**
|
|
2027
|
+
* Prepare multisig witness, if the existence of multisig witness is detected, nothing happens
|
|
2028
|
+
*
|
|
2029
|
+
* @param txLike - The transaction to prepare.
|
|
2030
|
+
* @param scriptLike - The script to prepare.
|
|
2031
|
+
* @returns A promise that resolves to the prepared transaction
|
|
2032
|
+
*/
|
|
2033
|
+
prepareTransactionOneScript(txLike: TransactionLike, script: ScriptLike, cellDeps: CellDepInfoLike[]): Promise<Transaction>;
|
|
2034
|
+
/**
|
|
2035
|
+
* Prepare transaction for multisig witness and adding related cell deps
|
|
2036
|
+
*
|
|
2037
|
+
* @param txLike - The transaction to prepare.
|
|
2038
|
+
* @returns A promise that resolves to the prepared transaction
|
|
2039
|
+
*/
|
|
2040
|
+
prepareTransaction(txLike: TransactionLike): Promise<Transaction>;
|
|
2041
|
+
/**
|
|
2042
|
+
* Get the number of valid signatures for matching multisig inputs in the transaction.
|
|
2043
|
+
*
|
|
2044
|
+
* @remarks
|
|
2045
|
+
* Returns `undefined` when the transaction has no inputs locked by any multisig address
|
|
2046
|
+
* supported by this signer. This method only counts signatures for matching multisig inputs
|
|
2047
|
+
* and does not imply that the transaction should be signed by this multisig.
|
|
2048
|
+
*
|
|
2049
|
+
* @param txLike - The transaction.
|
|
2050
|
+
* @returns The matched multisig signature count, or `undefined` when the transaction is unrelated to any multisig address supported by this signer.
|
|
2051
|
+
*/
|
|
2052
|
+
getSignaturesCount(txLike: TransactionLike): Promise<number | undefined>;
|
|
2053
|
+
/**
|
|
2054
|
+
* Check if related multisig inputs in the transaction need more signatures.
|
|
2055
|
+
*
|
|
2056
|
+
* @remarks
|
|
2057
|
+
* Returns `false` when the transaction has no inputs locked by any multisig address
|
|
2058
|
+
* supported by this signer.
|
|
2059
|
+
* A `false` result therefore means either the related multisig inputs are already fulfilled,
|
|
2060
|
+
* or the transaction is unrelated to all multisig addresses supported by this signer.
|
|
2061
|
+
*
|
|
2062
|
+
* @param txLike - The transaction to check.
|
|
2063
|
+
* @returns A promise that resolves to `true` when related multisig inputs still need signatures, and `false` otherwise.
|
|
2064
|
+
*/
|
|
2065
|
+
needMoreSignatures(txLike: TransactionLike): Promise<boolean>;
|
|
2066
|
+
/**
|
|
2067
|
+
* Get the sign info for a script.
|
|
2068
|
+
*
|
|
2069
|
+
* @param txLike - The transaction.
|
|
2070
|
+
* @param script - The script.
|
|
2071
|
+
* @returns The sign info.
|
|
2072
|
+
*/
|
|
2073
|
+
getSignInfo(txLike: TransactionLike, script: ScriptLike): Promise<{
|
|
2074
|
+
message: Hex;
|
|
2075
|
+
position: number;
|
|
2076
|
+
} | undefined>;
|
|
2077
|
+
/**
|
|
2078
|
+
* Aggregate transactions.
|
|
2079
|
+
*
|
|
2080
|
+
* @param txs - The transactions to aggregate.
|
|
2081
|
+
* @returns The aggregated transaction.
|
|
2082
|
+
*/
|
|
2083
|
+
aggregateTransactions(txs: TransactionLike[]): Promise<Transaction>;
|
|
2084
|
+
}
|
|
2085
|
+
//#endregion
|
|
2086
|
+
//#region src/signer/ckb/signerMultisigCkbPrivateKey.d.ts
|
|
2087
|
+
/**
|
|
2088
|
+
* A class extending Signer that provides access to a CKB multisig script and supports signing operations.
|
|
2089
|
+
* @public
|
|
2090
|
+
*/
|
|
2091
|
+
declare class SignerMultisigCkbPrivateKey extends SignerMultisigCkbReadonly {
|
|
2092
|
+
private readonly privateKey;
|
|
2093
|
+
private readonly signer;
|
|
2094
|
+
/**
|
|
2095
|
+
* Creates an instance of SignerMultisigCkbPrivateKey.
|
|
2096
|
+
*
|
|
2097
|
+
* @param client - The client instance.
|
|
2098
|
+
* @param privateKey - The private key.
|
|
2099
|
+
* @param multisigInfo - The multisig information.
|
|
2100
|
+
* @param options - The options.
|
|
2101
|
+
*/
|
|
2102
|
+
constructor(client: Client, privateKey: HexLike, multisigInfo: MultisigCkbWitnessLike, options?: {
|
|
2103
|
+
since?: SinceLike | null;
|
|
2104
|
+
scriptInfos?: (KnownScript | ScriptInfoLike)[] | null;
|
|
2105
|
+
} | null);
|
|
2106
|
+
/**
|
|
2107
|
+
* Sign a transaction only (without preparing).
|
|
2108
|
+
*
|
|
2109
|
+
* @param txLike - The transaction to sign.
|
|
2110
|
+
* @returns The signed transaction.
|
|
2111
|
+
*/
|
|
2112
|
+
signOnlyTransaction(txLike: TransactionLike): Promise<Transaction>;
|
|
2113
|
+
}
|
|
1705
2114
|
//#endregion
|
|
1706
2115
|
//#region src/signer/ckb/verifyJoyId.d.ts
|
|
1707
2116
|
/**
|
|
@@ -2103,7 +2512,7 @@ declare function buildNostrEventFromMessage(message: string | BytesLike): NostrE
|
|
|
2103
2512
|
declare function nostrEventHash(event: NostrEvent): Bytes$1;
|
|
2104
2513
|
declare function verifyMessageNostrEvent(message: string | BytesLike, signature: string, address: string): boolean;
|
|
2105
2514
|
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 };
|
|
2515
|
+
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
2516
|
}
|
|
2108
2517
|
//#endregion
|
|
2109
2518
|
//#region src/client/clientTypes.advanced.d.ts
|
|
@@ -2759,6 +3168,8 @@ declare enum KnownScript {
|
|
|
2759
3168
|
NervosDao = "NervosDao",
|
|
2760
3169
|
Secp256k1Blake160 = "Secp256k1Blake160",
|
|
2761
3170
|
Secp256k1Multisig = "Secp256k1Multisig",
|
|
3171
|
+
Secp256k1MultisigV2Beta = "Secp256k1MultisigV2Beta",
|
|
3172
|
+
// Fix rare failing case (https://github.com/nervosnetwork/ckb-system-scripts/pull/98)
|
|
2762
3173
|
Secp256k1MultisigV2 = "Secp256k1MultisigV2",
|
|
2763
3174
|
// Enhanced since handling (https://github.com/nervosnetwork/ckb-system-scripts/pull/99)
|
|
2764
3175
|
AnyoneCanPay = "AnyoneCanPay",
|
|
@@ -4075,10 +4486,22 @@ declare class Transaction extends Transaction_base {
|
|
|
4075
4486
|
*
|
|
4076
4487
|
* @example
|
|
4077
4488
|
* ```typescript
|
|
4078
|
-
* const witnessArgs =
|
|
4489
|
+
* const witnessArgs = tx.getWitnessArgsAt(0);
|
|
4079
4490
|
* ```
|
|
4080
4491
|
*/
|
|
4081
4492
|
getWitnessArgsAt(index: number): WitnessArgs | undefined;
|
|
4493
|
+
/**
|
|
4494
|
+
* Get witness at index as WitnessArgs, throw if failed to decode
|
|
4495
|
+
*
|
|
4496
|
+
* @param index - The index of the witness.
|
|
4497
|
+
* @returns The witness parsed as WitnessArgs.
|
|
4498
|
+
*
|
|
4499
|
+
* @example
|
|
4500
|
+
* ```typescript
|
|
4501
|
+
* const witnessArgs = tx.getWitnessArgsAtUnsafe(0);
|
|
4502
|
+
* ```
|
|
4503
|
+
*/
|
|
4504
|
+
getWitnessArgsAtUnsafe(index: number): WitnessArgs | undefined;
|
|
4082
4505
|
/**
|
|
4083
4506
|
* Set witness at index by WitnessArgs
|
|
4084
4507
|
*
|
|
@@ -5477,5 +5900,5 @@ declare namespace advancedBarrel_d_exports {
|
|
|
5477
5900
|
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
5901
|
}
|
|
5479
5902
|
//#endregion
|
|
5480
|
-
export { CellDep as $,
|
|
5481
|
-
//# sourceMappingURL=advancedBarrel-
|
|
5903
|
+
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 };
|
|
5904
|
+
//# sourceMappingURL=advancedBarrel-Dwyn3WMm.d.mts.map
|