@ckb-ccc/core 0.0.4-alpha.1 → 0.0.4-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +12 -7
  2. package/dist/address/address.advanced.d.ts +34 -0
  3. package/dist/address/address.advanced.d.ts.map +1 -1
  4. package/dist/address/address.advanced.js +41 -7
  5. package/dist/address/index.d.ts +36 -0
  6. package/dist/address/index.d.ts.map +1 -1
  7. package/dist/address/index.js +44 -5
  8. package/dist/bytes/advanced.d.ts +3 -0
  9. package/dist/bytes/advanced.d.ts.map +1 -1
  10. package/dist/bytes/index.d.ts +57 -0
  11. package/dist/bytes/index.d.ts.map +1 -1
  12. package/dist/bytes/index.js +57 -0
  13. package/dist/ckb/script.d.ts +98 -1
  14. package/dist/ckb/script.d.ts.map +1 -1
  15. package/dist/ckb/script.js +98 -1
  16. package/dist/ckb/transaction.d.ts +392 -1
  17. package/dist/ckb/transaction.d.ts.map +1 -1
  18. package/dist/ckb/transaction.js +403 -1
  19. package/dist/client/client.d.ts +10 -8
  20. package/dist/client/client.d.ts.map +1 -1
  21. package/dist/client/client.js +18 -0
  22. package/dist/client/clientPublicMainnet.advanced.d.ts +2 -2
  23. package/dist/client/clientPublicMainnet.advanced.d.ts.map +1 -1
  24. package/dist/client/clientPublicMainnet.d.ts +2 -2
  25. package/dist/client/clientPublicMainnet.d.ts.map +1 -1
  26. package/dist/client/clientPublicTestnet.advanced.d.ts +2 -2
  27. package/dist/client/clientPublicTestnet.advanced.d.ts.map +1 -1
  28. package/dist/client/clientPublicTestnet.d.ts +2 -2
  29. package/dist/client/clientPublicTestnet.d.ts.map +1 -1
  30. package/dist/client/clientTypes.d.ts +6 -0
  31. package/dist/client/clientTypes.d.ts.map +1 -1
  32. package/dist/client/jsonRpc/advanced.d.ts +2 -87
  33. package/dist/client/jsonRpc/advanced.d.ts.map +1 -1
  34. package/dist/client/jsonRpc/advanced.js +2 -65
  35. package/dist/client/jsonRpc/index.d.ts +60 -6
  36. package/dist/client/jsonRpc/index.d.ts.map +1 -1
  37. package/dist/client/jsonRpc/index.js +72 -7
  38. package/dist/client/jsonRpc/transformers.d.ts +28 -0
  39. package/dist/client/jsonRpc/transformers.d.ts.map +1 -0
  40. package/dist/client/jsonRpc/transformers.js +122 -0
  41. package/dist/client/jsonRpc/types.d.ts +41 -0
  42. package/dist/client/jsonRpc/types.d.ts.map +1 -0
  43. package/dist/client/jsonRpc/types.js +1 -0
  44. package/dist/fixedPoint/index.d.ts +43 -1
  45. package/dist/fixedPoint/index.d.ts.map +1 -1
  46. package/dist/fixedPoint/index.js +39 -1
  47. package/dist/hasher/index.d.ts +43 -2
  48. package/dist/hasher/index.d.ts.map +1 -1
  49. package/dist/hasher/index.js +42 -0
  50. package/dist/hex/index.d.ts +19 -0
  51. package/dist/hex/index.d.ts.map +1 -1
  52. package/dist/hex/index.js +12 -0
  53. package/dist/num/index.d.ts +99 -0
  54. package/dist/num/index.d.ts.map +1 -1
  55. package/dist/num/index.js +92 -0
  56. package/dist/signer/btc/signerBtc.d.ts +33 -2
  57. package/dist/signer/btc/signerBtc.d.ts.map +1 -1
  58. package/dist/signer/btc/signerBtc.js +25 -3
  59. package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts +36 -0
  60. package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
  61. package/dist/signer/btc/signerBtcPublicKeyReadonly.js +36 -0
  62. package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +35 -0
  63. package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
  64. package/dist/signer/ckb/signerCkbScriptReadonly.js +35 -0
  65. package/dist/signer/evm/signerEvm.d.ts +27 -2
  66. package/dist/signer/evm/signerEvm.d.ts.map +1 -1
  67. package/dist/signer/evm/signerEvm.js +24 -3
  68. package/dist/signer/evm/signerEvmAddressReadonly.d.ts +30 -0
  69. package/dist/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
  70. package/dist/signer/evm/signerEvmAddressReadonly.js +30 -0
  71. package/dist/signer/helpers.d.ts +19 -1
  72. package/dist/signer/helpers.d.ts.map +1 -1
  73. package/dist/signer/helpers.js +26 -9
  74. package/dist/signer/signer.d.ts +75 -4
  75. package/dist/signer/signer.d.ts.map +1 -1
  76. package/dist/signer/signer.js +53 -0
  77. package/package.json +3 -3
  78. package/src/address/address.advanced.ts +54 -18
  79. package/src/address/index.ts +51 -7
  80. package/src/bytes/advanced.ts +12 -9
  81. package/src/bytes/index.ts +60 -0
  82. package/src/ckb/script.ts +111 -2
  83. package/src/ckb/transaction.ts +455 -2
  84. package/src/client/client.ts +31 -8
  85. package/src/client/clientPublicMainnet.advanced.ts +5 -2
  86. package/src/client/clientPublicMainnet.ts +4 -2
  87. package/src/client/clientPublicTestnet.advanced.ts +5 -2
  88. package/src/client/clientPublicTestnet.ts +4 -2
  89. package/src/client/clientTypes.ts +13 -0
  90. package/src/client/jsonRpc/advanced.ts +2 -93
  91. package/src/client/jsonRpc/index.ts +99 -11
  92. package/src/client/jsonRpc/transformers.ts +159 -0
  93. package/src/client/jsonRpc/types.ts +48 -0
  94. package/src/fixedPoint/index.ts +52 -2
  95. package/src/hasher/index.ts +47 -1
  96. package/src/hex/index.ts +19 -0
  97. package/src/num/index.ts +101 -0
  98. package/src/signer/btc/signerBtc.ts +35 -3
  99. package/src/signer/btc/signerBtcPublicKeyReadonly.ts +36 -0
  100. package/src/signer/ckb/signerCkbScriptReadonly.ts +36 -0
  101. package/src/signer/evm/signerEvm.ts +30 -3
  102. package/src/signer/evm/signerEvmAddressReadonly.ts +31 -0
  103. package/src/signer/helpers.ts +28 -8
  104. package/src/signer/signer.ts +77 -4
@@ -1,9 +1,9 @@
1
- import { ScriptLike } from "../ckb";
1
+ import { Script } from "../ckb";
2
2
  import { KnownScript } from "./client";
3
3
  import { ClientJsonRpc } from "./jsonRpc";
4
4
  export declare class ClientPublicTestnet extends ClientJsonRpc {
5
5
  constructor(timeout?: number);
6
6
  getAddressPrefix(): Promise<string>;
7
- getKnownScript(script: KnownScript): Promise<Omit<ScriptLike, "args">>;
7
+ getKnownScript(script: KnownScript): Promise<Pick<Script, "codeHash" | "hashType">>;
8
8
  }
9
9
  //# sourceMappingURL=clientPublicTestnet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clientPublicTestnet.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicTestnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,qBAAa,mBAAoB,SAAQ,aAAa;gBACxC,OAAO,CAAC,EAAE,MAAM;IAItB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;CAG7E"}
1
+ {"version":3,"file":"clientPublicTestnet.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicTestnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,qBAAa,mBAAoB,SAAQ,aAAa;gBACxC,OAAO,CAAC,EAAE,MAAM;IAItB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,cAAc,CAClB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;CAGlD"}
@@ -1,2 +1,8 @@
1
+ import { Transaction } from "../ckb";
1
2
  export type OutputsValidator = "passthrough" | "well_known_scripts_only";
3
+ export type TransactionStatus = "pending" | "proposed" | "committed" | "unknown" | "rejected";
4
+ export type ClientTransactionResponse = {
5
+ transaction: Transaction;
6
+ status: TransactionStatus;
7
+ };
2
8
  //# sourceMappingURL=clientTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clientTypes.d.ts","sourceRoot":"","sources":["../../src/client/clientTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"clientTypes.d.ts","sourceRoot":"","sources":["../../src/client/clientTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,yBAAyB,CAAC;AAEzE,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,UAAU,GACV,WAAW,GACX,SAAS,GACT,UAAU,CAAC;AACf,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC"}
@@ -1,88 +1,3 @@
1
- import { CellDepLike, CellInputLike, CellOutputLike, DepTypeLike, OutPointLike, ScriptLike, TransactionLike } from "../../ckb";
2
- import type { Client } from "../client";
3
- export type JsonRpcPayload = {
4
- id: number;
5
- jsonrpc: "2.0";
6
- method: string;
7
- params: unknown[] | Record<string, unknown>;
8
- };
9
- export type JsonRpcMethod = {
10
- method: keyof Client;
11
- rpcMethod: string;
12
- inTransformers: (((_: any) => unknown) | undefined)[];
13
- outTransformer?: (_: any) => unknown;
14
- };
15
- export declare class JsonRpcTransformers {
16
- static toDepType(depType: DepTypeLike): "code" | "dep_group";
17
- static toScript(script: ScriptLike): {
18
- code_hash: import("../..").BytesLike;
19
- hash_type: import("../../ckb").HashTypeLike;
20
- args: import("../..").BytesLike;
21
- };
22
- static toOutPoint(outPoint: OutPointLike): {
23
- index: `0x${string}`;
24
- tx_hash: import("../..").BytesLike;
25
- };
26
- static toCellInput(cellInput: CellInputLike): {
27
- previous_output: {
28
- index: `0x${string}`;
29
- tx_hash: import("../..").BytesLike;
30
- };
31
- since: `0x${string}`;
32
- };
33
- static toCellOutput(cellOutput: CellOutputLike): {
34
- capacity: `0x${string}`;
35
- lock: {
36
- code_hash: import("../..").BytesLike;
37
- hash_type: import("../../ckb").HashTypeLike;
38
- args: import("../..").BytesLike;
39
- };
40
- type: {
41
- code_hash: import("../..").BytesLike;
42
- hash_type: import("../../ckb").HashTypeLike;
43
- args: import("../..").BytesLike;
44
- } | undefined;
45
- };
46
- static toCellDep(cellDep: CellDepLike): {
47
- out_point: {
48
- index: `0x${string}`;
49
- tx_hash: import("../..").BytesLike;
50
- };
51
- dep_type: string;
52
- };
53
- static toTransaction(tx: TransactionLike): {
54
- version: `0x${string}`;
55
- cell_deps: {
56
- out_point: {
57
- index: `0x${string}`;
58
- tx_hash: import("../..").BytesLike;
59
- };
60
- dep_type: string;
61
- }[];
62
- header_deps: import("../..").BytesLike[];
63
- inputs: {
64
- previous_output: {
65
- index: `0x${string}`;
66
- tx_hash: import("../..").BytesLike;
67
- };
68
- since: `0x${string}`;
69
- }[];
70
- outputs: {
71
- capacity: `0x${string}`;
72
- lock: {
73
- code_hash: import("../..").BytesLike;
74
- hash_type: import("../../ckb").HashTypeLike;
75
- args: import("../..").BytesLike;
76
- };
77
- type: {
78
- code_hash: import("../..").BytesLike;
79
- hash_type: import("../../ckb").HashTypeLike;
80
- args: import("../..").BytesLike;
81
- } | undefined;
82
- }[];
83
- outputs_data: import("../..").BytesLike[];
84
- witnesses: import("../..").BytesLike[];
85
- };
86
- }
87
- export declare const CkbRpcMethods: JsonRpcMethod[];
1
+ export * from "./transformers";
2
+ export * from "./types";
88
3
  //# sourceMappingURL=advanced.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,cA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/B,cAAc,SAAS,CAAC"}
@@ -1,65 +1,2 @@
1
- import { depTypeFrom, } from "../../ckb";
2
- import { hexFrom } from "../../hex";
3
- import { numToHex } from "../../num";
4
- import { apply } from "../../utils";
5
- export class JsonRpcTransformers {
6
- static toDepType(depType) {
7
- switch (depTypeFrom(depType)) {
8
- case "code":
9
- return "code";
10
- case "depGroup":
11
- return "dep_group";
12
- }
13
- }
14
- static toScript(script) {
15
- return {
16
- code_hash: script.codeHash,
17
- hash_type: script.hashType,
18
- args: script.args,
19
- };
20
- }
21
- static toOutPoint(outPoint) {
22
- return {
23
- index: numToHex(outPoint.index),
24
- tx_hash: outPoint.txHash,
25
- };
26
- }
27
- static toCellInput(cellInput) {
28
- return {
29
- previous_output: JsonRpcTransformers.toOutPoint(cellInput.previousOutput),
30
- since: numToHex(cellInput.since),
31
- };
32
- }
33
- static toCellOutput(cellOutput) {
34
- return {
35
- capacity: numToHex(cellOutput.capacity),
36
- lock: JsonRpcTransformers.toScript(cellOutput.lock),
37
- type: apply(JsonRpcTransformers.toScript, cellOutput.type),
38
- };
39
- }
40
- static toCellDep(cellDep) {
41
- return {
42
- out_point: JsonRpcTransformers.toOutPoint(cellDep.outPoint),
43
- dep_type: JsonRpcTransformers.toDepType(cellDep.depType),
44
- };
45
- }
46
- static toTransaction(tx) {
47
- return {
48
- version: numToHex(tx.version),
49
- cell_deps: tx.cellDeps.map((c) => JsonRpcTransformers.toCellDep(c)),
50
- header_deps: tx.headerDeps,
51
- inputs: tx.inputs.map((i) => JsonRpcTransformers.toCellInput(i)),
52
- outputs: tx.outputs.map((o) => JsonRpcTransformers.toCellOutput(o)),
53
- outputs_data: tx.outputsData,
54
- witnesses: tx.witnesses,
55
- };
56
- }
57
- }
58
- export const CkbRpcMethods = [
59
- {
60
- method: "sendTransaction",
61
- rpcMethod: "send_transaction",
62
- inTransformers: [JsonRpcTransformers.toTransaction],
63
- outTransformer: hexFrom,
64
- },
65
- ];
1
+ export * from "./transformers";
2
+ export * from "./types";
@@ -1,14 +1,68 @@
1
- import type { Client } from "../client";
2
- import { JsonRpcMethod, JsonRpcPayload } from "./advanced";
3
- export interface ClientJsonRpc extends Pick<Client, "sendTransaction"> {
4
- }
5
- export declare abstract class ClientJsonRpc implements Pick<Client, "sendTransaction"> {
1
+ import { TransactionLike } from "../../ckb";
2
+ import { Hex, HexLike } from "../../hex";
3
+ import { Client } from "../client";
4
+ import { ClientTransactionResponse, OutputsValidator } from "../clientTypes";
5
+ import { JsonRpcPayload } from "./advanced";
6
+ /**
7
+ * An abstract class implementing JSON-RPC client functionality for a specific URL and timeout.
8
+ * Provides methods for sending transactions and building JSON-RPC payloads.
9
+ */
10
+ export declare abstract class ClientJsonRpc extends Client {
6
11
  private readonly url;
7
12
  private readonly timeout;
13
+ /**
14
+ * Creates an instance of ClientJsonRpc.
15
+ *
16
+ * @param url - The URL of the JSON-RPC server.
17
+ * @param timeout - The timeout for requests in milliseconds, default is 30000.
18
+ */
8
19
  constructor(url: string, timeout?: number);
20
+ /**
21
+ * Returns the URL of the JSON-RPC server.
22
+ *
23
+ * @returns The URL of the JSON-RPC server.
24
+ */
9
25
  getUrl(): string;
10
- buildSender({ rpcMethod, inTransformers, outTransformer }: JsonRpcMethod): (...req: unknown[]) => Promise<unknown>;
26
+ /**
27
+ * Send a transaction to node.
28
+ *
29
+ * @param transaction - The transaction to send.
30
+ * @param validator - "passthrough": Disable validation. "well_known_scripts_only": Only accept well known scripts in the transaction.
31
+ * @returns Transaction hash.
32
+ */
33
+ sendTransaction: (transaction: TransactionLike, validator?: OutputsValidator | undefined) => Promise<Hex>;
34
+ /**
35
+ * Get a transaction from node.
36
+ *
37
+ * @param txHash - The hash of the transaction.
38
+ * @returns The transaction with status.
39
+ */
40
+ getTransaction: (txHash: HexLike) => Promise<ClientTransactionResponse>;
41
+ /**
42
+ * Builds a sender function for a JSON-RPC method.
43
+ *
44
+ * @param rpcMethod - The JSON-RPC method.
45
+ * @param inTransformers - An array of input transformers.
46
+ * @param outTransformer - An output transformer function.
47
+ * @returns A function that sends a JSON-RPC request with the given method and transformed parameters.
48
+ */
49
+ buildSender(rpcMethod: string, inTransformers: (((_: any) => unknown) | undefined)[], outTransformer?: (_: any) => unknown): (...req: unknown[]) => Promise<unknown>;
50
+ /**
51
+ * Sends a JSON-RPC request to the server.
52
+ *
53
+ * @param payload - The JSON-RPC payload to send.
54
+ * @returns The result of the JSON-RPC request.
55
+ *
56
+ * @throws Will throw an error if the response ID does not match the request ID, or if the response contains an error.
57
+ */
11
58
  send(payload: JsonRpcPayload): Promise<unknown>;
59
+ /**
60
+ * Builds a JSON-RPC payload for the given method and parameters.
61
+ *
62
+ * @param method - The JSON-RPC method name.
63
+ * @param req - The parameters for the JSON-RPC method.
64
+ * @returns The JSON-RPC payload.
65
+ */
12
66
  static buildPayload(method: string, req: unknown[]): JsonRpcPayload;
13
67
  }
14
68
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAiB,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC;CAAG;AAYzE,8BAAsB,aAAc,YAAW,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAE1E,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,GAAG,EAAE,MAAM,EACX,OAAO,SAAQ;IAUlC,MAAM;IAIN,WAAW,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,aAAa,YAChD,OAAO,EAAE;IAU3B,IAAI,CAAC,OAAO,EAAE,cAAc;IA4BlC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE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cross-fetch";
2
- import { CkbRpcMethods } from "./advanced";
2
+ import { hexFrom } from "../../hex";
3
+ import { Client } from "../client";
4
+ import { JsonRpcTransformers } from "./advanced";
5
+ /**
6
+ * Applies a transformation function to a value if the transformer is provided.
7
+ *
8
+ * @param value - The value to be transformed.
9
+ * @param transformer - An optional transformation function.
10
+ * @returns The transformed value if a transformer is provided, otherwise the original value.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const result = await transform(5, (x) => x * 2); // Outputs 10
15
+ * const resultWithoutTransformer = await transform(5); // Outputs 5
16
+ * ```
17
+ */
3
18
  async function transform(value, transformer) {
4
19
  if (transformer) {
5
20
  return transformer(value);
6
21
  }
7
22
  return value;
8
23
  }
9
- export class ClientJsonRpc {
24
+ /**
25
+ * An abstract class implementing JSON-RPC client functionality for a specific URL and timeout.
26
+ * Provides methods for sending transactions and building JSON-RPC payloads.
27
+ */
28
+ export class ClientJsonRpc extends Client {
29
+ /**
30
+ * Creates an instance of ClientJsonRpc.
31
+ *
32
+ * @param url - The URL of the JSON-RPC server.
33
+ * @param timeout - The timeout for requests in milliseconds, default is 30000.
34
+ */
10
35
  constructor(url, timeout = 30000) {
36
+ super();
11
37
  this.url = url;
12
38
  this.timeout = timeout;
13
- CkbRpcMethods.map((method) => Object.defineProperty(this, method.method, {
14
- value: this.buildSender(method),
15
- enumerable: true,
16
- }));
39
+ /**
40
+ * Send a transaction to node.
41
+ *
42
+ * @param transaction - The transaction to send.
43
+ * @param validator - "passthrough": Disable validation. "well_known_scripts_only": Only accept well known scripts in the transaction.
44
+ * @returns Transaction hash.
45
+ */
46
+ this.sendTransaction = this.buildSender("send_transaction", [JsonRpcTransformers.toTransaction], hexFrom);
47
+ /**
48
+ * Get a transaction from node.
49
+ *
50
+ * @param txHash - The hash of the transaction.
51
+ * @returns The transaction with status.
52
+ */
53
+ this.getTransaction = this.buildSender("get_transaction", [hexFrom], JsonRpcTransformers.fromTransactionResponse);
17
54
  }
55
+ /**
56
+ * Returns the URL of the JSON-RPC server.
57
+ *
58
+ * @returns The URL of the JSON-RPC server.
59
+ */
18
60
  getUrl() {
19
61
  return this.url;
20
62
  }
21
- buildSender({ rpcMethod, inTransformers, outTransformer }) {
63
+ /**
64
+ * Builds a sender function for a JSON-RPC method.
65
+ *
66
+ * @param rpcMethod - The JSON-RPC method.
67
+ * @param inTransformers - An array of input transformers.
68
+ * @param outTransformer - An output transformer function.
69
+ * @returns A function that sends a JSON-RPC request with the given method and transformed parameters.
70
+ */
71
+ buildSender(rpcMethod, inTransformers, outTransformer) {
22
72
  return async (...req) => {
23
73
  const payload = ClientJsonRpc.buildPayload(rpcMethod, await Promise.all(req.map((v, i) => transform(v, inTransformers[i]))));
24
74
  return transform(await this.send(payload), outTransformer);
25
75
  };
26
76
  }
77
+ /**
78
+ * Sends a JSON-RPC request to the server.
79
+ *
80
+ * @param payload - The JSON-RPC payload to send.
81
+ * @returns The result of the JSON-RPC request.
82
+ *
83
+ * @throws Will throw an error if the response ID does not match the request ID, or if the response contains an error.
84
+ */
27
85
  async send(payload) {
28
86
  const aborter = new AbortController();
29
87
  const abortTimer = setTimeout(() => aborter.abort(), this.timeout);
@@ -45,6 +103,13 @@ export class ClientJsonRpc {
45
103
  }
46
104
  return res.result;
47
105
  }
106
+ /**
107
+ * Builds a JSON-RPC payload for the given method and parameters.
108
+ *
109
+ * @param method - The JSON-RPC method name.
110
+ * @param req - The parameters for the JSON-RPC method.
111
+ * @returns The JSON-RPC payload.
112
+ */
48
113
  static buildPayload(method, req) {
49
114
  return {
50
115
  id: Math.round(Math.random() * 10000),
@@ -0,0 +1,28 @@
1
+ import { CellDep, CellDepLike, CellInput, CellInputLike, CellOutput, CellOutputLike, DepType, DepTypeLike, HashType, HashTypeLike, OutPoint, OutPointLike, Script, ScriptLike, Transaction, TransactionLike } from "../../ckb";
2
+ import { ClientTransactionResponse, TransactionStatus } from "../clientTypes";
3
+ import { JsonRpcCellDep, JsonRpcCellInput, JsonRpcCellOutput, JsonRpcDepType, JsonRpcHashType, JsonRpcOutPoint, JsonRpcScript, JsonRpcTransaction } from "./types";
4
+ export declare class JsonRpcTransformers {
5
+ static toHashType(hashType: HashTypeLike): JsonRpcHashType;
6
+ static fromHashType(hashType: JsonRpcHashType): HashType;
7
+ static toDepType(depType: DepTypeLike): JsonRpcDepType;
8
+ static fromDepType(depType: JsonRpcDepType): DepType;
9
+ static toScript(scriptLike: ScriptLike): JsonRpcScript;
10
+ static fromScript(script: JsonRpcScript): Script;
11
+ static toOutPoint(outPointLike: OutPointLike): JsonRpcOutPoint;
12
+ static fromOutPoint(outPoint: JsonRpcOutPoint): OutPoint;
13
+ static toCellInput(cellInput: CellInputLike): JsonRpcCellInput;
14
+ static fromCellInput(cellInput: JsonRpcCellInput): CellInput;
15
+ static toCellOutput(cellOutput: CellOutputLike): JsonRpcCellOutput;
16
+ static fromCellOutput(cellOutput: JsonRpcCellOutput): CellOutput;
17
+ static toCellDep(cellDep: CellDepLike): JsonRpcCellDep;
18
+ static fromCellDep(cellDep: JsonRpcCellDep): CellDep;
19
+ static toTransaction(txLike: TransactionLike): JsonRpcTransaction;
20
+ static fromTransaction(tx: JsonRpcTransaction): Transaction;
21
+ static fromTransactionResponse({ tx_status: { status }, transaction, }: {
22
+ tx_status: {
23
+ status: TransactionStatus;
24
+ };
25
+ transaction: JsonRpcTransaction;
26
+ }): ClientTransactionResponse;
27
+ }
28
+ //# sourceMappingURL=transformers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/transformers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,OAAO,EACP,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,eAAe,EAGhB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,yBAAyB,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C,EAC7B,SAAS,EAAE,EAAE,MAAM,EAAE,EACrB,WAAW,GACZ,EAAE;QACD,SAAS,EAAE;YAAE,MAAM,EAAE,iBAAiB,CAAA;SAAE,CAAC;QACzC,WAAW,EAAE,kBAAkB,CAAC;KACjC,GAAG,yBAAyB;CAM9B"}
@@ -0,0 +1,122 @@
1
+ import { CellDep, CellInput, CellOutput, OutPoint, Script, Transaction, depTypeFrom, hashTypeFrom, } from "../../ckb";
2
+ import { numToHex } from "../../num";
3
+ import { apply } from "../../utils";
4
+ export class JsonRpcTransformers {
5
+ static toHashType(hashType) {
6
+ return hashTypeFrom(hashType);
7
+ }
8
+ static fromHashType(hashType) {
9
+ return hashType;
10
+ }
11
+ static toDepType(depType) {
12
+ switch (depTypeFrom(depType)) {
13
+ case "code":
14
+ return "code";
15
+ case "depGroup":
16
+ return "dep_group";
17
+ }
18
+ }
19
+ static fromDepType(depType) {
20
+ switch (depType) {
21
+ case "code":
22
+ return "code";
23
+ case "dep_group":
24
+ return "depGroup";
25
+ }
26
+ }
27
+ static toScript(scriptLike) {
28
+ const script = Script.from(scriptLike);
29
+ return {
30
+ code_hash: script.codeHash,
31
+ hash_type: JsonRpcTransformers.toHashType(script.hashType),
32
+ args: script.args,
33
+ };
34
+ }
35
+ static fromScript(script) {
36
+ return Script.from({
37
+ codeHash: script.code_hash,
38
+ hashType: JsonRpcTransformers.fromHashType(script.hash_type),
39
+ args: script.args,
40
+ });
41
+ }
42
+ static toOutPoint(outPointLike) {
43
+ const outPoint = OutPoint.from(outPointLike);
44
+ return {
45
+ index: numToHex(outPoint.index),
46
+ tx_hash: outPoint.txHash,
47
+ };
48
+ }
49
+ static fromOutPoint(outPoint) {
50
+ return OutPoint.from({
51
+ index: outPoint.index,
52
+ txHash: outPoint.tx_hash,
53
+ });
54
+ }
55
+ static toCellInput(cellInput) {
56
+ return {
57
+ previous_output: JsonRpcTransformers.toOutPoint(cellInput.previousOutput),
58
+ since: numToHex(cellInput.since),
59
+ };
60
+ }
61
+ static fromCellInput(cellInput) {
62
+ return CellInput.from({
63
+ previousOutput: this.fromOutPoint(cellInput.previous_output),
64
+ since: cellInput.since,
65
+ });
66
+ }
67
+ static toCellOutput(cellOutput) {
68
+ return {
69
+ capacity: numToHex(cellOutput.capacity),
70
+ lock: JsonRpcTransformers.toScript(cellOutput.lock),
71
+ type: apply(JsonRpcTransformers.toScript, cellOutput.type),
72
+ };
73
+ }
74
+ static fromCellOutput(cellOutput) {
75
+ return CellOutput.from({
76
+ capacity: cellOutput.capacity,
77
+ lock: JsonRpcTransformers.fromScript(cellOutput.lock),
78
+ type: apply(JsonRpcTransformers.fromScript, cellOutput.type),
79
+ });
80
+ }
81
+ static toCellDep(cellDep) {
82
+ return {
83
+ out_point: JsonRpcTransformers.toOutPoint(cellDep.outPoint),
84
+ dep_type: JsonRpcTransformers.toDepType(cellDep.depType),
85
+ };
86
+ }
87
+ static fromCellDep(cellDep) {
88
+ return CellDep.from({
89
+ outPoint: JsonRpcTransformers.fromOutPoint(cellDep.out_point),
90
+ depType: JsonRpcTransformers.fromDepType(cellDep.dep_type),
91
+ });
92
+ }
93
+ static toTransaction(txLike) {
94
+ const tx = Transaction.from(txLike);
95
+ return {
96
+ version: numToHex(tx.version),
97
+ cell_deps: tx.cellDeps.map((c) => JsonRpcTransformers.toCellDep(c)),
98
+ header_deps: tx.headerDeps,
99
+ inputs: tx.inputs.map((i) => JsonRpcTransformers.toCellInput(i)),
100
+ outputs: tx.outputs.map((o) => JsonRpcTransformers.toCellOutput(o)),
101
+ outputs_data: tx.outputsData,
102
+ witnesses: tx.witnesses,
103
+ };
104
+ }
105
+ static fromTransaction(tx) {
106
+ return Transaction.from({
107
+ version: tx.version,
108
+ cellDeps: tx.cell_deps.map((c) => JsonRpcTransformers.fromCellDep(c)),
109
+ headerDeps: tx.header_deps,
110
+ inputs: tx.inputs.map((i) => JsonRpcTransformers.fromCellInput(i)),
111
+ outputs: tx.outputs.map((o) => JsonRpcTransformers.fromCellOutput(o)),
112
+ outputsData: tx.outputs_data,
113
+ witnesses: tx.witnesses,
114
+ });
115
+ }
116
+ static fromTransactionResponse({ tx_status: { status }, transaction, }) {
117
+ return {
118
+ transaction: JsonRpcTransformers.fromTransaction(transaction),
119
+ status,
120
+ };
121
+ }
122
+ }
@@ -0,0 +1,41 @@
1
+ import { Hex } from "../../hex";
2
+ export type JsonRpcPayload = {
3
+ id: number;
4
+ jsonrpc: "2.0";
5
+ method: string;
6
+ params: unknown[] | Record<string, unknown>;
7
+ };
8
+ export type JsonRpcHashType = "type" | "data" | "data1" | "data2";
9
+ export type JsonRpcDepType = "dep_group" | "code";
10
+ export type JsonRpcScript = {
11
+ code_hash: Hex;
12
+ hash_type: JsonRpcHashType;
13
+ args: Hex;
14
+ };
15
+ export type JsonRpcOutPoint = {
16
+ index: Hex;
17
+ tx_hash: Hex;
18
+ };
19
+ export type JsonRpcCellInput = {
20
+ previous_output: JsonRpcOutPoint;
21
+ since: Hex;
22
+ };
23
+ export type JsonRpcCellOutput = {
24
+ capacity: Hex;
25
+ lock: JsonRpcScript;
26
+ type?: JsonRpcScript;
27
+ };
28
+ export type JsonRpcCellDep = {
29
+ out_point: JsonRpcOutPoint;
30
+ dep_type: JsonRpcDepType;
31
+ };
32
+ export type JsonRpcTransaction = {
33
+ version: Hex;
34
+ cell_deps: JsonRpcCellDep[];
35
+ header_deps: Hex[];
36
+ inputs: JsonRpcCellInput[];
37
+ outputs: JsonRpcCellOutput[];
38
+ outputs_data: Hex[];
39
+ witnesses: Hex[];
40
+ };
41
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAA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
+ /**
6
+ * Represents a value that can be converted to a fixed point value.
7
+ * It can be a bigint, string, or number.
8
+ */
2
9
  export type FixedPointLike = bigint | string | number;
3
- export declare function fixedPointToString(val: FixedPoint, decimals?: number): string;
10
+ /**
11
+ * Converts a FixedPointLike value to its string representation with fixed-point decimals.
12
+ *
13
+ * @param val - The value to convert, which can be a bigint, string, or number.
14
+ * @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
15
+ * @returns A string representing the fixed-point value.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const str = fixedPointToString(123456789n, 8); // Outputs "1.23456789"
20
+ * const strFromString = fixedPointToString("123456789", 8); // Outputs "1.23456789"
21
+ * const strFromNumber = fixedPointToString(123456789, 8); // Outputs "1.23456789"
22
+ * ```
23
+ */
24
+ export declare function fixedPointToString(val: FixedPointLike, decimals?: number): string;
25
+ /**
26
+ * Converts a FixedPointLike value to a FixedPoint (bigint) with fixed-point decimals.
27
+ *
28
+ * @param val - The value to convert, which can be a bigint, string, or number.
29
+ * @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
30
+ * @returns A FixedPoint (bigint) representing the value with fixed-point decimals.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const fixedPoint = fixedPointFrom(1.23456789, 8); // Outputs 123456789n
35
+ * const fixedPointFromString = fixedPointFrom("1.23456789", 8); // Outputs 123456789n
36
+ * const fixedPointFromNumber = fixedPointFrom(1.23456789, 8); // Outputs 123456789n
37
+ * ```
38
+ */
4
39
  export declare function fixedPointFrom(val: FixedPointLike, decimals?: number): FixedPoint;
40
+ /**
41
+ * Represents the fixed point value of zero as a bigint.
42
+ */
5
43
  export declare const Zero = 0n;
44
+ /**
45
+ * Represents the fixed point value of one as a FixedPoint (bigint).
46
+ * Equivalent to 1 in fixed-point representation with default decimals (8).
47
+ */
6
48
  export declare const One: bigint;
7
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,SAAI,GAAG,MAAM,CASxE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,UAAU,CAY5E;AAED,eAAO,MAAM,IAAI,KAAK,CAAC;AACvB,eAAO,MAAM,GAAG,QAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;GAGG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,MAAM,CAS5E;AAED;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,UAAU,CAY5E;AAED;;GAEG;AAEH,eAAO,MAAM,IAAI,KAAK,CAAC;AAEvB;;;GAGG;AAEH,eAAO,MAAM,GAAG,QAAsB,CAAC"}