@ckb-ccc/core 0.0.12-alpha.1 → 0.0.12
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 +3 -0
- package/README.md +5 -5
- package/dist/address/index.d.ts +4 -0
- package/dist/address/index.d.ts.map +1 -1
- package/dist/address/index.js +1 -0
- package/dist/advancedBarrel.d.ts +1 -0
- package/dist/advancedBarrel.d.ts.map +1 -1
- package/dist/advancedBarrel.js +1 -0
- package/dist/bytes/advanced.d.ts +1 -0
- package/dist/bytes/advanced.d.ts.map +1 -1
- package/dist/bytes/index.d.ts +9 -0
- package/dist/bytes/index.d.ts.map +1 -1
- package/dist/bytes/index.js +3 -0
- package/dist/ckb/index.d.ts +1 -0
- package/dist/ckb/index.d.ts.map +1 -1
- package/dist/ckb/index.js +1 -0
- package/dist/ckb/script.d.ts +15 -0
- package/dist/ckb/script.d.ts.map +1 -1
- package/dist/ckb/script.js +6 -0
- package/dist/ckb/transaction.d.ts +65 -11
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +41 -14
- package/dist/ckb/transactionLumos.d.ts +29 -0
- package/dist/ckb/transactionLumos.d.ts.map +1 -0
- package/dist/ckb/transactionLumos.js +1 -0
- package/dist/client/client.d.ts +13 -1
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +10 -1
- package/dist/client/clientPublicMainnet.d.ts +3 -0
- package/dist/client/clientPublicMainnet.d.ts.map +1 -1
- package/dist/client/clientPublicMainnet.js +3 -0
- package/dist/client/clientPublicTestnet.d.ts +3 -0
- package/dist/client/clientPublicTestnet.d.ts.map +1 -1
- package/dist/client/clientPublicTestnet.js +3 -0
- package/dist/client/clientTypes.d.ts +45 -0
- package/dist/client/clientTypes.d.ts.map +1 -1
- package/dist/client/clientTypes.js +9 -0
- package/dist/client/jsonRpc/index.d.ts +6 -6
- package/dist/client/jsonRpc/index.d.ts.map +1 -1
- package/dist/client/jsonRpc/index.js +3 -3
- package/dist/fixedPoint/index.d.ts +6 -0
- package/dist/fixedPoint/index.d.ts.map +1 -1
- package/dist/fixedPoint/index.js +5 -0
- package/dist/hasher/hasher.d.ts +3 -0
- package/dist/hasher/hasher.d.ts.map +1 -1
- package/dist/hasher/hasherCkb.d.ts +6 -1
- package/dist/hasher/hasherCkb.d.ts.map +1 -1
- package/dist/hasher/hasherCkb.js +6 -1
- package/dist/hasher/hasherKeecak256.d.ts +3 -0
- package/dist/hasher/hasherKeecak256.d.ts.map +1 -1
- package/dist/hasher/hasherKeecak256.js +3 -0
- package/dist/hex/index.d.ts +3 -0
- package/dist/hex/index.d.ts.map +1 -1
- package/dist/hex/index.js +1 -0
- package/dist/keystore/index.d.ts +6 -0
- package/dist/keystore/index.d.ts.map +1 -1
- package/dist/keystore/index.js +6 -0
- package/dist/num/index.d.ts +11 -0
- package/dist/num/index.d.ts.map +1 -1
- package/dist/num/index.js +9 -0
- package/dist/package.json +1 -1
- package/dist/signer/btc/signerBtc.d.ts +1 -0
- package/dist/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist/signer/btc/signerBtc.js +1 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
- package/dist/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
- package/dist/signer/btc/verify.d.ts +3 -0
- package/dist/signer/btc/verify.d.ts.map +1 -1
- package/dist/signer/btc/verify.js +3 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbPrivateKey.js +3 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts +3 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbPublicKey.js +3 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbScriptReadonly.js +1 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
- package/dist/signer/ckb/verifyCkbSecp256k1.js +6 -0
- package/dist/signer/ckb/verifyJoyId.d.ts +3 -0
- package/dist/signer/ckb/verifyJoyId.d.ts.map +1 -1
- package/dist/signer/ckb/verifyJoyId.js +3 -0
- package/dist/signer/dummy/alwaysError.d.ts +3 -0
- package/dist/signer/dummy/alwaysError.d.ts.map +1 -1
- package/dist/signer/dummy/alwaysError.js +3 -0
- package/dist/signer/dummy/dummy.d.ts +3 -0
- package/dist/signer/dummy/dummy.d.ts.map +1 -1
- package/dist/signer/dummy/dummy.js +3 -0
- package/dist/signer/dummy/openLink.d.ts +3 -0
- package/dist/signer/dummy/openLink.d.ts.map +1 -1
- package/dist/signer/dummy/openLink.js +3 -0
- package/dist/signer/evm/signerEvm.d.ts +1 -0
- package/dist/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist/signer/evm/signerEvm.js +1 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
- package/dist/signer/evm/signerEvmAddressReadonly.js +1 -0
- package/dist/signer/evm/verify.d.ts +3 -0
- package/dist/signer/evm/verify.d.ts.map +1 -1
- package/dist/signer/evm/verify.js +3 -0
- package/dist/signer/nostr/signerNostr.d.ts +6 -0
- package/dist/signer/nostr/signerNostr.d.ts.map +1 -1
- package/dist/signer/nostr/signerNostr.js +3 -0
- package/dist/signer/nostr/verify.d.ts +3 -0
- package/dist/signer/nostr/verify.d.ts.map +1 -1
- package/dist/signer/nostr/verify.js +3 -0
- package/dist/signer/signer/index.d.ts +26 -3
- package/dist/signer/signer/index.d.ts.map +1 -1
- package/dist/signer/signer/index.js +12 -3
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +13 -0
- package/dist.commonjs/address/index.d.ts +4 -0
- package/dist.commonjs/address/index.d.ts.map +1 -1
- package/dist.commonjs/address/index.js +1 -0
- package/dist.commonjs/advancedBarrel.d.ts +1 -0
- package/dist.commonjs/advancedBarrel.d.ts.map +1 -1
- package/dist.commonjs/advancedBarrel.js +1 -0
- package/dist.commonjs/bytes/advanced.d.ts +1 -0
- package/dist.commonjs/bytes/advanced.d.ts.map +1 -1
- package/dist.commonjs/bytes/index.d.ts +9 -0
- package/dist.commonjs/bytes/index.d.ts.map +1 -1
- package/dist.commonjs/bytes/index.js +3 -0
- package/dist.commonjs/ckb/index.d.ts +1 -0
- package/dist.commonjs/ckb/index.d.ts.map +1 -1
- package/dist.commonjs/ckb/index.js +1 -0
- package/dist.commonjs/ckb/script.d.ts +15 -0
- package/dist.commonjs/ckb/script.d.ts.map +1 -1
- package/dist.commonjs/ckb/script.js +6 -0
- package/dist.commonjs/ckb/transaction.d.ts +65 -11
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +41 -14
- package/dist.commonjs/ckb/transactionLumos.d.ts +29 -0
- package/dist.commonjs/ckb/transactionLumos.d.ts.map +1 -0
- package/dist.commonjs/ckb/transactionLumos.js +2 -0
- package/dist.commonjs/client/client.d.ts +13 -1
- package/dist.commonjs/client/client.d.ts.map +1 -1
- package/dist.commonjs/client/client.js +10 -1
- package/dist.commonjs/client/clientPublicMainnet.d.ts +3 -0
- package/dist.commonjs/client/clientPublicMainnet.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicMainnet.js +3 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts +3 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicTestnet.js +3 -0
- package/dist.commonjs/client/clientTypes.d.ts +45 -0
- package/dist.commonjs/client/clientTypes.d.ts.map +1 -1
- package/dist.commonjs/client/clientTypes.js +9 -0
- package/dist.commonjs/client/jsonRpc/index.d.ts +6 -6
- package/dist.commonjs/client/jsonRpc/index.d.ts.map +1 -1
- package/dist.commonjs/client/jsonRpc/index.js +3 -3
- package/dist.commonjs/fixedPoint/index.d.ts +6 -0
- package/dist.commonjs/fixedPoint/index.d.ts.map +1 -1
- package/dist.commonjs/fixedPoint/index.js +5 -0
- package/dist.commonjs/hasher/hasher.d.ts +3 -0
- package/dist.commonjs/hasher/hasher.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherCkb.d.ts +6 -1
- package/dist.commonjs/hasher/hasherCkb.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherCkb.js +6 -1
- package/dist.commonjs/hasher/hasherKeecak256.d.ts +3 -0
- package/dist.commonjs/hasher/hasherKeecak256.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherKeecak256.js +3 -0
- package/dist.commonjs/hex/index.d.ts +3 -0
- package/dist.commonjs/hex/index.d.ts.map +1 -1
- package/dist.commonjs/hex/index.js +1 -0
- package/dist.commonjs/keystore/index.d.ts +6 -0
- package/dist.commonjs/keystore/index.d.ts.map +1 -1
- package/dist.commonjs/keystore/index.js +6 -0
- package/dist.commonjs/num/index.d.ts +11 -0
- package/dist.commonjs/num/index.d.ts.map +1 -1
- package/dist.commonjs/num/index.js +9 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts +1 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/signerBtc.js +1 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
- package/dist.commonjs/signer/btc/verify.d.ts +3 -0
- package/dist.commonjs/signer/btc/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/verify.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +1 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.js +6 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +3 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/verifyJoyId.js +3 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts +3 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/alwaysError.js +3 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts +3 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/dummy.js +3 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts +3 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/openLink.js +3 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts +1 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvm.js +1 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +1 -0
- package/dist.commonjs/signer/evm/verify.d.ts +3 -0
- package/dist.commonjs/signer/evm/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/verify.js +3 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts +6 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts.map +1 -1
- package/dist.commonjs/signer/nostr/signerNostr.js +3 -0
- package/dist.commonjs/signer/nostr/verify.d.ts +3 -0
- package/dist.commonjs/signer/nostr/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/nostr/verify.js +3 -0
- package/dist.commonjs/signer/signer/index.d.ts +26 -3
- package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
- package/dist.commonjs/signer/signer/index.js +12 -3
- package/dist.commonjs/utils/index.d.ts +12 -0
- package/dist.commonjs/utils/index.d.ts.map +1 -1
- package/dist.commonjs/utils/index.js +13 -0
- package/package.json +8 -10
- package/src/address/index.ts +4 -1
- package/src/advancedBarrel.ts +1 -0
- package/src/bytes/advanced.ts +1 -0
- package/src/bytes/index.ts +9 -0
- package/src/ckb/index.ts +1 -0
- package/src/ckb/script.ts +15 -0
- package/src/ckb/transaction.ts +72 -16
- package/src/ckb/transactionLumos.ts +26 -0
- package/src/client/client.ts +13 -1
- package/src/client/clientPublicMainnet.ts +3 -0
- package/src/client/clientPublicTestnet.ts +3 -0
- package/src/client/clientTypes.ts +45 -0
- package/src/client/jsonRpc/index.ts +5 -6
- package/src/fixedPoint/index.ts +6 -0
- package/src/hasher/hasher.ts +3 -0
- package/src/hasher/hasherCkb.ts +6 -1
- package/src/hasher/hasherKeecak256.ts +3 -0
- package/src/hex/index.ts +3 -0
- package/src/keystore/index.ts +6 -0
- package/src/num/index.ts +11 -0
- package/src/signer/btc/signerBtc.ts +1 -0
- package/src/signer/btc/signerBtcPublicKeyReadonly.ts +1 -0
- package/src/signer/btc/verify.ts +3 -0
- package/src/signer/ckb/signerCkbPrivateKey.ts +3 -0
- package/src/signer/ckb/signerCkbPublicKey.ts +3 -0
- package/src/signer/ckb/signerCkbScriptReadonly.ts +1 -0
- package/src/signer/ckb/verifyCkbSecp256k1.ts +6 -0
- package/src/signer/ckb/verifyJoyId.ts +3 -0
- package/src/signer/dummy/alwaysError.ts +3 -0
- package/src/signer/dummy/dummy.ts +3 -0
- package/src/signer/dummy/openLink.ts +3 -0
- package/src/signer/evm/signerEvm.ts +1 -0
- package/src/signer/evm/signerEvmAddressReadonly.ts +1 -0
- package/src/signer/evm/verify.ts +3 -0
- package/src/signer/nostr/signerNostr.ts +6 -0
- package/src/signer/nostr/verify.ts +3 -0
- package/src/signer/signer/index.ts +26 -14
- package/src/utils/index.ts +22 -0
- package/typedoc.json +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyJoyId.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/verifyJoyId.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAWlB"}
|
|
1
|
+
{"version":3,"file":"verifyJoyId.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/verifyJoyId.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAWlB"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { verifySignature } from "@joyid/ckb";
|
|
2
2
|
import { hexFrom } from "../../hex/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export function verifyMessageJoyId(message, signature, identity) {
|
|
4
7
|
const challenge = typeof message === "string" ? message : hexFrom(message).slice(2);
|
|
5
8
|
const { publicKey, keyType } = JSON.parse(identity);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Client } from "../../client/index.js";
|
|
2
2
|
import { SignerType } from "../signer/index.js";
|
|
3
3
|
import { SignerDummy } from "./dummy.js";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
4
7
|
export declare class SignerAlwaysError extends SignerDummy {
|
|
5
8
|
private readonly message;
|
|
6
9
|
constructor(client: Client, type: SignerType, message: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alwaysError.d.ts","sourceRoot":"","sources":["../../../src/signer/dummy/alwaysError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,qBAAa,iBAAkB,SAAQ,WAAW;IAI9C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EACC,OAAO,EAAE,MAAM;IAK5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
1
|
+
{"version":3,"file":"alwaysError.d.ts","sourceRoot":"","sources":["../../../src/signer/dummy/alwaysError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAI9C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EACC,OAAO,EAAE,MAAM;IAK5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Address } from "../../address/index.js";
|
|
2
2
|
import { Client } from "../../client/index.js";
|
|
3
3
|
import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
4
7
|
export declare abstract class SignerDummy extends Signer {
|
|
5
8
|
readonly type: SignerType;
|
|
6
9
|
get signType(): SignerSignType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dummy.d.ts","sourceRoot":"","sources":["../../../src/signer/dummy/dummy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE,8BAAsB,WAAY,SAAQ,MAAM;aAO5B,IAAI,EAAE,UAAU;IANlC,IAAI,QAAQ,IAAI,cAAc,CAE7B;gBAGC,MAAM,EAAE,MAAM,EACE,IAAI,EAAE,UAAU;IAK5B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAG3C"}
|
|
1
|
+
{"version":3,"file":"dummy.d.ts","sourceRoot":"","sources":["../../../src/signer/dummy/dummy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE;;GAEG;AACH,8BAAsB,WAAY,SAAQ,MAAM;aAO5B,IAAI,EAAE,UAAU;IANlC,IAAI,QAAQ,IAAI,cAAc,CAE7B;gBAGC,MAAM,EAAE,MAAM,EACE,IAAI,EAAE,UAAU;IAK5B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAG3C"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Client } from "../../client/index.js";
|
|
2
2
|
import { SignerType } from "../signer/index.js";
|
|
3
3
|
import { SignerDummy } from "./dummy.js";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
4
7
|
export declare class SignerOpenLink extends SignerDummy {
|
|
5
8
|
private readonly link;
|
|
6
9
|
constructor(client: Client, type: SignerType, link: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openLink.d.ts","sourceRoot":"","sources":["../../../src/signer/dummy/openLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,qBAAa,cAAe,SAAQ,WAAW;IAI3C,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EACC,IAAI,EAAE,MAAM;IAKzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
1
|
+
{"version":3,"file":"openLink.d.ts","sourceRoot":"","sources":["../../../src/signer/dummy/openLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAI3C,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EACC,IAAI,EAAE,MAAM;IAKzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
@@ -7,6 +7,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* An abstract class extending Signer for Ethereum Virtual Machine (EVM) based signing operations.
|
|
9
9
|
* This class provides methods to get EVM account, internal address, and signing transactions.
|
|
10
|
+
* @public
|
|
10
11
|
*/
|
|
11
12
|
export declare abstract class SignerEvm extends Signer {
|
|
12
13
|
get type(): SignerType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerEvm.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/signerEvm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,MAAM,EACN,WAAW,EACX,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAmB,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"signerEvm.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/signerEvm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,MAAM,EACN,WAAW,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AW,CAAC;IA2BjB,+BAA+B,CACnC,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,GAC9C,OAAO,CAAC,WAAW,CAAC;IAkBjB,8BAA8B,CAClC,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,EAC/C,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAe/D"}
|
|
@@ -10,6 +10,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* An abstract class extending Signer for Ethereum Virtual Machine (EVM) based signing operations.
|
|
12
12
|
* This class provides methods to get EVM account, internal address, and signing transactions.
|
|
13
|
+
* @public
|
|
13
14
|
*/
|
|
14
15
|
export class SignerEvm extends Signer {
|
|
15
16
|
get type() {
|
|
@@ -4,6 +4,7 @@ import { SignerEvm } from "./signerEvm.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* A class extending SignerEvm that provides read-only access to an EVM address.
|
|
6
6
|
* This class does not support signing operations.
|
|
7
|
+
* @public
|
|
7
8
|
*/
|
|
8
9
|
export declare class SignerEvmAddressReadonly extends SignerEvm {
|
|
9
10
|
private readonly address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerEvmAddressReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/signerEvmAddressReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"signerEvmAddressReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/signerEvmAddressReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,SAAS;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAM;IAE9B;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAM5C;;;;;;;;;OASG;IAEG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC;CAGpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAE5D,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAQT"}
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/evm/verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAQT"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { verifyMessage } from "ethers";
|
|
2
2
|
import { bytesFrom } from "../../bytes/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export function verifyMessageEvmPersonal(message, signature, address) {
|
|
4
7
|
return (address.toLowerCase() ===
|
|
5
8
|
verifyMessage(typeof message === "string" ? message : bytesFrom(message), signature).toLowerCase());
|
|
@@ -3,6 +3,9 @@ import { BytesLike } from "../../bytes/index.js";
|
|
|
3
3
|
import { Transaction, TransactionLike } from "../../ckb/index.js";
|
|
4
4
|
import { Hex } from "../../hex/index.js";
|
|
5
5
|
import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
6
9
|
export interface NostrEvent {
|
|
7
10
|
id?: string;
|
|
8
11
|
pubkey?: string;
|
|
@@ -12,6 +15,9 @@ export interface NostrEvent {
|
|
|
12
15
|
tags: string[][];
|
|
13
16
|
content: string;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
15
21
|
export declare abstract class SignerNostr extends Signer {
|
|
16
22
|
static CKB_SIG_HASH_ALL_TAG: string;
|
|
17
23
|
static CKB_UNLOCK_EVENT_KIND: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerNostr.d.ts","sourceRoot":"","sources":["../../../src/signer/nostr/signerNostr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAA0B,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAG/E,OAAO,EAAE,GAAG,EAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGxE,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;I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E"}
|
|
@@ -7,6 +7,9 @@ import { hashCkb } from "../../hasher/index.js";
|
|
|
7
7
|
import { hexFrom } from "../../hex/index.js";
|
|
8
8
|
import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
9
9
|
import { buildNostrEventFromMessage } from "./verify.js";
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
10
13
|
export class SignerNostr extends Signer {
|
|
11
14
|
get type() {
|
|
12
15
|
return SignerType.Nostr;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BytesLike } from "../../bytes/index.js";
|
|
2
2
|
import { NostrEvent } from "./signerNostr.js";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export declare function buildNostrEventFromMessage(message: string | BytesLike): NostrEvent;
|
|
4
7
|
export declare function verifyMessageNostrEvent(message: string | BytesLike, signature: string, address: string): boolean;
|
|
5
8
|
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/nostr/verify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,UAAU,CA2BZ;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAoBT"}
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/nostr/verify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,UAAU,CA2BZ;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAoBT"}
|
|
@@ -3,6 +3,9 @@ import { sha256 } from "@noble/hashes/sha256";
|
|
|
3
3
|
import { bech32 } from "bech32";
|
|
4
4
|
import { bytesFrom } from "../../bytes/index.js";
|
|
5
5
|
import { hexFrom } from "../../hex/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
6
9
|
export function buildNostrEventFromMessage(message) {
|
|
7
10
|
if (typeof message === "string") {
|
|
8
11
|
try {
|
|
@@ -4,6 +4,9 @@ import { Transaction, TransactionLike } from "../../ckb/index.js";
|
|
|
4
4
|
import { Client } from "../../client/index.js";
|
|
5
5
|
import { Hex } from "../../hex/index.js";
|
|
6
6
|
import { Num } from "../../num/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
7
10
|
export declare enum SignerSignType {
|
|
8
11
|
Unknown = "Unknown",
|
|
9
12
|
BtcEcdsa = "BtcEcdsa",
|
|
@@ -14,6 +17,7 @@ export declare enum SignerSignType {
|
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* An enumeration of signer display types in wallet.
|
|
20
|
+
* @public
|
|
17
21
|
*/
|
|
18
22
|
export declare enum SignerType {
|
|
19
23
|
EVM = "EVM",
|
|
@@ -21,11 +25,27 @@ export declare enum SignerType {
|
|
|
21
25
|
CKB = "CKB",
|
|
22
26
|
Nostr = "Nostr"
|
|
23
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
24
31
|
export type NetworkPreference = {
|
|
25
32
|
addressPrefix: string;
|
|
26
33
|
signerType: SignerType;
|
|
34
|
+
/**
|
|
35
|
+
* Wallet signers should check if the wallet is using preferred networks.
|
|
36
|
+
* If not, try to switch to the first preferred network.
|
|
37
|
+
* If non preferred, let users choose what they want.
|
|
38
|
+
* BTC: // They made a mess...
|
|
39
|
+
* btc
|
|
40
|
+
* btcTestnet
|
|
41
|
+
* btcSignet // OKX
|
|
42
|
+
* fractalBtc // UniSat
|
|
43
|
+
*/
|
|
27
44
|
network: string;
|
|
28
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
29
49
|
export declare class Signature {
|
|
30
50
|
signature: string;
|
|
31
51
|
identity: string;
|
|
@@ -35,6 +55,7 @@ export declare class Signature {
|
|
|
35
55
|
/**
|
|
36
56
|
* An abstract class representing a generic signer.
|
|
37
57
|
* This class provides methods to connect, get addresses, and sign transactions.
|
|
58
|
+
* @public
|
|
38
59
|
*/
|
|
39
60
|
export declare abstract class Signer {
|
|
40
61
|
protected client_: Client;
|
|
@@ -115,7 +136,7 @@ export declare abstract class Signer {
|
|
|
115
136
|
/**
|
|
116
137
|
* Signs a message.
|
|
117
138
|
*
|
|
118
|
-
* @param
|
|
139
|
+
* @param message - The message to sign, as a string or BytesLike object.
|
|
119
140
|
* @returns A promise that resolves to the signature info.
|
|
120
141
|
* @throws Will throw an error if not implemented.
|
|
121
142
|
*/
|
|
@@ -131,8 +152,8 @@ export declare abstract class Signer {
|
|
|
131
152
|
/**
|
|
132
153
|
* Verify a signature.
|
|
133
154
|
*
|
|
134
|
-
* @param
|
|
135
|
-
* @param
|
|
155
|
+
* @param message - The original message.
|
|
156
|
+
* @param signature - The signature to verify.
|
|
136
157
|
* @returns A promise that resolves to the verification result.
|
|
137
158
|
* @throws Will throw an error if not implemented.
|
|
138
159
|
*/
|
|
@@ -170,6 +191,7 @@ export declare abstract class Signer {
|
|
|
170
191
|
}
|
|
171
192
|
/**
|
|
172
193
|
* A class representing information about a signer, including its type and the signer instance.
|
|
194
|
+
* @public
|
|
173
195
|
*/
|
|
174
196
|
export declare class SignerInfo {
|
|
175
197
|
name: string;
|
|
@@ -178,6 +200,7 @@ export declare class SignerInfo {
|
|
|
178
200
|
}
|
|
179
201
|
/**
|
|
180
202
|
* Represents a wallet with a name, icon, and an array of signer information.
|
|
203
|
+
* @public
|
|
181
204
|
*/
|
|
182
205
|
export type Wallet = {
|
|
183
206
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/signer/signer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAOzC,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,YAAY,iBAAiB;CAC9B;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/signer/signer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAOzC;;GAEG;AACH,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB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,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,MAAM;gBADd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM;CAExB;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -3,6 +3,9 @@ import { verifyMessageCkbSecp256k1 } from "../ckb/verifyCkbSecp256k1.js";
|
|
|
3
3
|
import { verifyMessageJoyId } from "../ckb/verifyJoyId.js";
|
|
4
4
|
import { verifyMessageEvmPersonal } from "../evm/verify.js";
|
|
5
5
|
import { verifyMessageNostrEvent } from "../nostr/verify.js";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
6
9
|
export var SignerSignType;
|
|
7
10
|
(function (SignerSignType) {
|
|
8
11
|
SignerSignType["Unknown"] = "Unknown";
|
|
@@ -14,6 +17,7 @@ export var SignerSignType;
|
|
|
14
17
|
})(SignerSignType || (SignerSignType = {}));
|
|
15
18
|
/**
|
|
16
19
|
* An enumeration of signer display types in wallet.
|
|
20
|
+
* @public
|
|
17
21
|
*/
|
|
18
22
|
export var SignerType;
|
|
19
23
|
(function (SignerType) {
|
|
@@ -22,6 +26,9 @@ export var SignerType;
|
|
|
22
26
|
SignerType["CKB"] = "CKB";
|
|
23
27
|
SignerType["Nostr"] = "Nostr";
|
|
24
28
|
})(SignerType || (SignerType = {}));
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
25
32
|
export class Signature {
|
|
26
33
|
constructor(signature, identity, signType) {
|
|
27
34
|
this.signature = signature;
|
|
@@ -32,6 +39,7 @@ export class Signature {
|
|
|
32
39
|
/**
|
|
33
40
|
* An abstract class representing a generic signer.
|
|
34
41
|
* This class provides methods to connect, get addresses, and sign transactions.
|
|
42
|
+
* @public
|
|
35
43
|
*/
|
|
36
44
|
export class Signer {
|
|
37
45
|
constructor(client_) {
|
|
@@ -127,7 +135,7 @@ export class Signer {
|
|
|
127
135
|
/**
|
|
128
136
|
* Signs a message.
|
|
129
137
|
*
|
|
130
|
-
* @param
|
|
138
|
+
* @param message - The message to sign, as a string or BytesLike object.
|
|
131
139
|
* @returns A promise that resolves to the signature info.
|
|
132
140
|
* @throws Will throw an error if not implemented.
|
|
133
141
|
*/
|
|
@@ -151,8 +159,8 @@ export class Signer {
|
|
|
151
159
|
/**
|
|
152
160
|
* Verify a signature.
|
|
153
161
|
*
|
|
154
|
-
* @param
|
|
155
|
-
* @param
|
|
162
|
+
* @param message - The original message.
|
|
163
|
+
* @param signature - The signature to verify.
|
|
156
164
|
* @returns A promise that resolves to the verification result.
|
|
157
165
|
* @throws Will throw an error if not implemented.
|
|
158
166
|
*/
|
|
@@ -212,6 +220,7 @@ export class Signer {
|
|
|
212
220
|
}
|
|
213
221
|
/**
|
|
214
222
|
* A class representing information about a signer, including its type and the signer instance.
|
|
223
|
+
* @public
|
|
215
224
|
*/
|
|
216
225
|
export class SignerInfo {
|
|
217
226
|
constructor(name, signer) {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
3
|
+
* @public
|
|
3
4
|
*
|
|
4
5
|
* @param transformer - The transformer.
|
|
5
6
|
* @param value - The value to be transformed.
|
|
@@ -8,6 +9,7 @@
|
|
|
8
9
|
export declare function apply<T, R>(transformer: (val: T) => R, value: undefined): undefined;
|
|
9
10
|
/**
|
|
10
11
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
12
|
+
* @public
|
|
11
13
|
*
|
|
12
14
|
* @param transformer - The transformer.
|
|
13
15
|
* @param value - The value to be transformed.
|
|
@@ -16,6 +18,7 @@ export declare function apply<T, R>(transformer: (val: T) => R, value: undefined
|
|
|
16
18
|
export declare function apply<T, R>(transformer: (val: T) => R, value: null): undefined;
|
|
17
19
|
/**
|
|
18
20
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
21
|
+
* @public
|
|
19
22
|
*
|
|
20
23
|
* @param transformer - The transformer.
|
|
21
24
|
* @param value - The value to be transformed.
|
|
@@ -24,6 +27,7 @@ export declare function apply<T, R>(transformer: (val: T) => R, value: null): un
|
|
|
24
27
|
export declare function apply<T, R>(transformer: (val: T) => R, value: T): R;
|
|
25
28
|
/**
|
|
26
29
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
30
|
+
* @public
|
|
27
31
|
*
|
|
28
32
|
* @param transformer - The transformer.
|
|
29
33
|
* @param value - The value to be transformed.
|
|
@@ -32,6 +36,7 @@ export declare function apply<T, R>(transformer: (val: T) => R, value: T): R;
|
|
|
32
36
|
export declare function apply<T, R>(transformer: (val: T) => R, value: T | undefined): R | undefined;
|
|
33
37
|
/**
|
|
34
38
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
39
|
+
* @public
|
|
35
40
|
*
|
|
36
41
|
* @param transformer - The transformer.
|
|
37
42
|
* @param value - The value to be transformed.
|
|
@@ -40,6 +45,7 @@ export declare function apply<T, R>(transformer: (val: T) => R, value: T | undef
|
|
|
40
45
|
export declare function apply<T, R>(transformer: (val: T) => R, value: T | null): R | undefined;
|
|
41
46
|
/**
|
|
42
47
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
48
|
+
* @public
|
|
43
49
|
*
|
|
44
50
|
* @param transformer - The transformer.
|
|
45
51
|
* @param value - The value to be transformed.
|
|
@@ -49,6 +55,7 @@ export declare function apply<T, R>(transformer: (val: T) => R, value: undefined
|
|
|
49
55
|
/**
|
|
50
56
|
/**
|
|
51
57
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
58
|
+
* @public
|
|
52
59
|
*
|
|
53
60
|
* @param transformer - The transformer.
|
|
54
61
|
* @param value - The value to be transformed.
|
|
@@ -57,6 +64,7 @@ export declare function apply<T, R>(transformer: (val: T) => R, value: undefined
|
|
|
57
64
|
export declare function apply<T, R>(transformer: (val: T) => R, value: T | undefined | null): R | undefined;
|
|
58
65
|
/**
|
|
59
66
|
* Similar to Array.reduce, but the accumulator can returns Promise.
|
|
67
|
+
* @public
|
|
60
68
|
*
|
|
61
69
|
* @param values - The array to be reduced.
|
|
62
70
|
* @param accumulator - A callback to be called for each value. If it returns null, the previous result will be kept.
|
|
@@ -65,6 +73,7 @@ export declare function apply<T, R>(transformer: (val: T) => R, value: T | undef
|
|
|
65
73
|
export declare function reduceAsync<T, V>(values: T[], accumulator: (a: T, b: T) => Promise<T | undefined | null | void> | T | undefined | null | void): Promise<T>;
|
|
66
74
|
/**
|
|
67
75
|
* Similar to Array.reduce, but the accumulator can returns Promise.
|
|
76
|
+
* @public
|
|
68
77
|
*
|
|
69
78
|
* @param values - The array to be reduced.
|
|
70
79
|
* @param accumulator - A callback to be called for each value. If it returns null, the previous result will be kept.
|
|
@@ -72,5 +81,8 @@ export declare function reduceAsync<T, V>(values: T[], accumulator: (a: T, b: T)
|
|
|
72
81
|
* @returns The accumulated result.
|
|
73
82
|
*/
|
|
74
83
|
export declare function reduceAsync<T, V>(values: V[], accumulator: (a: T, b: V, i: number, values: V[]) => Promise<T | undefined | null | void> | T | undefined | null | void, init: T | Promise<T>): Promise<T>;
|
|
84
|
+
/**
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
75
87
|
export declare function isWebview(userAgent: string): boolean;
|
|
76
88
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EACxB,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAC1B,KAAK,EAAE,SAAS,GACf,SAAS,CAAC;AACb;;;;;;;GAOG;AACH,wBA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GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GACtE,OAAO,CAAC,CAAC,CAAC,CAAC;AACd;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,CAAC,EAAE,CAAC,EACpC,MAAM,EAAE,CAAC,EAAE,EACX,WAAW,EAAE,CACX,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,CAAC,EAAE,KACR,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,EACvE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAAC;AAqCd;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A type safe way to apply a transformer on a value if it's not empty.
|
|
3
|
+
* @public
|
|
3
4
|
*
|
|
4
5
|
* @param transformer - The transformer.
|
|
5
6
|
* @param value - The value to be transformed.
|
|
@@ -11,6 +12,15 @@ export function apply(transformer, value) {
|
|
|
11
12
|
}
|
|
12
13
|
return transformer(value);
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Similar to Array.reduce, but the accumulator can returns Promise.
|
|
17
|
+
* @public
|
|
18
|
+
*
|
|
19
|
+
* @param values - The array to be reduced.
|
|
20
|
+
* @param accumulator - A callback to be called for each value. If it returns null, the previous result will be kept.
|
|
21
|
+
* @param init - The initial value.
|
|
22
|
+
* @returns The accumulated result.
|
|
23
|
+
*/
|
|
14
24
|
export async function reduceAsync(values, accumulator, init) {
|
|
15
25
|
if (init === undefined) {
|
|
16
26
|
if (values.length === 0) {
|
|
@@ -21,6 +31,9 @@ export async function reduceAsync(values, accumulator, init) {
|
|
|
21
31
|
}
|
|
22
32
|
return values.reduce((current, b, i, array) => current.then((v) => Promise.resolve(accumulator(v, b, i, array)).then((r) => r ?? v)), Promise.resolve(init));
|
|
23
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
24
37
|
export function isWebview(userAgent) {
|
|
25
38
|
return /webview|wv|ip((?!.*Safari)|(?=.*like Safari))/i.test(userAgent);
|
|
26
39
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Script, ScriptLike } from "../ckb/index.js";
|
|
2
2
|
import { Client, KnownScript } from "../client/index.js";
|
|
3
3
|
import { HexLike } from "../hex/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
4
7
|
export type AddressLike = {
|
|
5
8
|
script: ScriptLike;
|
|
6
9
|
prefix: string;
|
|
7
10
|
};
|
|
8
11
|
/**
|
|
9
12
|
* Represents a ckb address with associated script and prefix.
|
|
13
|
+
* @public
|
|
10
14
|
*/
|
|
11
15
|
export declare class Address {
|
|
12
16
|
script: Script;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/address/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQ1C,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/address/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQ1C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,qBAAa,OAAO;IAQT,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IARvB;;;;;OAKG;gBAEM,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;IAGvB;;;;;OAKG;IAEH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAQ1C;;;;;;;;OAQG;WAEU,UAAU,CACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,OAAO,CAAC,OAAO,CAAC;IAmBnB;;;;;;OAMG;IAEH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;WAIjD,eAAe,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,OAAO,CAAC;IAOnB;;;;OAIG;IAEH,QAAQ,IAAI,MAAM;CAcnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advancedBarrel.d.ts","sourceRoot":"","sources":["../src/advancedBarrel.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"advancedBarrel.d.ts","sourceRoot":"","sources":["../src/advancedBarrel.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./address/advanced.js"), exports);
|
|
18
|
+
__exportStar(require("./bytes/advanced.js"), exports);
|
|
18
19
|
__exportStar(require("./ckb/advanced.js"), exports);
|
|
19
20
|
__exportStar(require("./client/advanced.js"), exports);
|
|
20
21
|
__exportStar(require("./hasher/advanced.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../../src/bytes/advanced.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../../src/bytes/advanced.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,KAAK,GACL,OAAO,GACP,QAAQ,GACR,MAAM,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { BytesFromEncoding } from "./advanced.js";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export type Bytes = Uint8Array;
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
3
9
|
export type BytesLike = string | Uint8Array | ArrayBuffer | number[];
|
|
4
10
|
/**
|
|
5
11
|
* Concatenates multiple byte-like arrays into a single byte array.
|
|
12
|
+
* @public
|
|
6
13
|
*
|
|
7
14
|
* @param args - The byte-like arrays to concatenate.
|
|
8
15
|
* @returns A Uint8Array containing the concatenated bytes.
|
|
@@ -21,6 +28,7 @@ export type BytesLike = string | Uint8Array | ArrayBuffer | number[];
|
|
|
21
28
|
export declare function bytesConcat(...args: BytesLike[]): Bytes;
|
|
22
29
|
/**
|
|
23
30
|
* Converts a byte-like value to a string using the specified encoding.
|
|
31
|
+
* @public
|
|
24
32
|
*
|
|
25
33
|
* @param val - The byte-like value to convert.
|
|
26
34
|
* @param encoding - The encoding to use for the conversion, as defined by the BytesFromEncoding type.
|
|
@@ -38,6 +46,7 @@ export declare function bytesConcat(...args: BytesLike[]): Bytes;
|
|
|
38
46
|
export declare function bytesTo(val: BytesLike, encoding: BytesFromEncoding): string;
|
|
39
47
|
/**
|
|
40
48
|
* Converts various types of byte-like values to a Uint8Array.
|
|
49
|
+
* @public
|
|
41
50
|
*
|
|
42
51
|
* @param bytes - The byte-like value to convert. It can be a string, Uint8Array, ArrayBuffer, or number array.
|
|
43
52
|
* @param encoding - Optional encoding to use if the input is a string. Defaults to hexadecimal if not specified.
|