@ckb-ccc/spore 1.5.16 → 1.5.18

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.
@@ -1,4 +1,4 @@
1
- import { ccc, mol } from "@ckb-ccc/core";
1
+ import { ccc } from "@ckb-ccc/core";
2
2
  import {
3
3
  Action,
4
4
  ActionVec,
@@ -11,7 +11,7 @@ export function assembleCreateSporeAction(
11
11
  sporeOutput: ccc.CellOutputLike,
12
12
  sporeData: ccc.BytesLike,
13
13
  scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,
14
- ): mol.EncodableType<typeof Action> {
14
+ ): ccc.EncodableType<typeof Action> {
15
15
  if (!sporeOutput.type) {
16
16
  throw new Error("Spore cell must have a type script");
17
17
  }
@@ -39,7 +39,7 @@ export function assembleTransferSporeAction(
39
39
  sporeInput: ccc.CellOutputLike,
40
40
  sporeOutput: ccc.CellOutputLike,
41
41
  scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,
42
- ): mol.EncodableType<typeof Action> {
42
+ ): ccc.EncodableType<typeof Action> {
43
43
  if (!sporeInput.type || !sporeOutput.type) {
44
44
  throw new Error("Spore cell must have a type script");
45
45
  }
@@ -70,7 +70,7 @@ export function assembleTransferSporeAction(
70
70
  export function assembleMeltSporeAction(
71
71
  sporeInput: ccc.CellOutputLike,
72
72
  scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,
73
- ): mol.EncodableType<typeof Action> {
73
+ ): ccc.EncodableType<typeof Action> {
74
74
  if (!sporeInput.type) {
75
75
  throw new Error("Spore cell must have a type script");
76
76
  }
@@ -97,7 +97,7 @@ export function assembleCreateClusterAction(
97
97
  clusterOutput: ccc.CellOutputLike,
98
98
  clusterData: ccc.BytesLike,
99
99
  scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,
100
- ): mol.EncodableType<typeof Action> {
100
+ ): ccc.EncodableType<typeof Action> {
101
101
  if (!clusterOutput.type) {
102
102
  throw new Error("Cluster cell must have a type script");
103
103
  }
@@ -125,7 +125,7 @@ export function assembleTransferClusterAction(
125
125
  clusterInput: ccc.CellOutputLike,
126
126
  clusterOutput: ccc.CellOutputLike,
127
127
  scriptInfoHash: ccc.HexLike = DEFAULT_COBUILD_INFO_HASH,
128
- ): mol.EncodableType<typeof Action> {
128
+ ): ccc.EncodableType<typeof Action> {
129
129
  if (!clusterInput.type || !clusterOutput.type) {
130
130
  throw new Error("Cluster cell must have a type script");
131
131
  }
@@ -155,7 +155,7 @@ export function assembleTransferClusterAction(
155
155
  export async function prepareSporeTransaction(
156
156
  signer: ccc.Signer,
157
157
  txLike: ccc.TransactionLike,
158
- actions: mol.EncodableType<typeof ActionVec>,
158
+ actions: ccc.EncodableType<typeof ActionVec>,
159
159
  ): Promise<ccc.Transaction> {
160
160
  let tx = ccc.Transaction.from(txLike);
161
161
 
@@ -171,7 +171,7 @@ export async function prepareSporeTransaction(
171
171
 
172
172
  export function unpackCommonCobuildProof(
173
173
  data: ccc.HexLike,
174
- ): mol.EncodableType<typeof WitnessLayout> | undefined {
174
+ ): ccc.EncodableType<typeof WitnessLayout> | undefined {
175
175
  try {
176
176
  return WitnessLayout.decode(ccc.bytesFrom(data));
177
177
  } catch {
@@ -181,7 +181,7 @@ export function unpackCommonCobuildProof(
181
181
 
182
182
  export function extractCobuildActionsFromTx(
183
183
  tx: ccc.Transaction,
184
- ): mol.EncodableType<typeof ActionVec> {
184
+ ): ccc.EncodableType<typeof ActionVec> {
185
185
  if (tx.witnesses.length === 0) {
186
186
  return [];
187
187
  }
@@ -202,7 +202,7 @@ export function extractCobuildActionsFromTx(
202
202
 
203
203
  export function injectCobuild(
204
204
  tx: ccc.Transaction,
205
- actions: mol.EncodableType<typeof ActionVec>,
205
+ actions: ccc.EncodableType<typeof ActionVec>,
206
206
  ): void {
207
207
  tx.setWitnessAt(
208
208
  Math.max(tx.witnesses.length, tx.inputs.length),
@@ -5,7 +5,7 @@ export interface ClusterDataV1View {
5
5
  description: string;
6
6
  }
7
7
 
8
- export const ClusterDataV1: mol.Codec<ClusterDataV1View> = mol.table({
8
+ export const ClusterDataV1: ccc.Codec<ClusterDataV1View> = mol.table({
9
9
  name: mol.String,
10
10
  description: mol.String,
11
11
  });
@@ -16,7 +16,7 @@ export interface ClusterDataV2View {
16
16
  mutantId?: ccc.HexLike;
17
17
  }
18
18
 
19
- export const ClusterDataV2: mol.Codec<ClusterDataV2View> = mol.table({
19
+ export const ClusterDataV2: ccc.Codec<ClusterDataV2View> = mol.table({
20
20
  name: mol.String,
21
21
  description: mol.String,
22
22
  mutantId: mol.BytesOpt,
@@ -6,7 +6,7 @@ export interface SporeDataView {
6
6
  clusterId?: ccc.HexLike;
7
7
  }
8
8
 
9
- export const SporeData: mol.Codec<SporeDataView> = mol.table({
9
+ export const SporeData: ccc.Codec<SporeDataView> = mol.table({
10
10
  contentType: mol.String,
11
11
  content: mol.Bytes,
12
12
  clusterId: mol.BytesOpt,
@@ -1,4 +1,4 @@
1
- import { ccc, mol } from "@ckb-ccc/core";
1
+ import { ccc } from "@ckb-ccc/core";
2
2
  import { assembleTransferClusterAction } from "../advanced.js";
3
3
  import { assertCluster } from "../cluster/index.js";
4
4
  import { Action, SporeDataView } from "../codec/index.js";
@@ -9,7 +9,7 @@ export async function prepareCluster(
9
9
  data: SporeDataView,
10
10
  clusterMode?: "lockProxy" | "clusterCell" | "skip",
11
11
  scriptInfoHash?: ccc.HexLike,
12
- ): Promise<mol.EncodableType<typeof Action> | undefined> {
12
+ ): Promise<ccc.EncodableType<typeof Action> | undefined> {
13
13
  // skip if the spore is not belong to a cluster
14
14
  if (!data.clusterId || clusterMode === "skip") {
15
15
  return;