@ckb-ccc/spore 1.5.18 → 1.6.1
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 +19 -0
- package/dist/advanced.d.mts +3 -0
- package/dist/advanced.mjs +1 -0
- package/dist/advancedBarrel.d.mts +30 -0
- package/dist/advancedBarrel.d.mts.map +1 -0
- package/dist/advancedBarrel.mjs +1 -0
- package/dist/barrel-C4fV1nUf.mjs +2 -0
- package/dist/barrel-C4fV1nUf.mjs.map +1 -0
- package/dist/barrel-Cqgd-hM0.d.mts +324 -0
- package/dist/barrel-Cqgd-hM0.d.mts.map +1 -0
- package/dist/barrel.d.mts +3 -0
- package/dist/barrel.mjs +1 -0
- package/dist/cluster-KsFIhwZx.mjs +2 -0
- package/dist/cluster-KsFIhwZx.mjs.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +1 -0
- package/dist/rolldown-runtime-DK3Fl9T5.mjs +1 -0
- package/dist/types-DRzFzVRX.d.mts +1048 -0
- package/dist/types-DRzFzVRX.d.mts.map +1 -0
- package/dist.commonjs/advanced.d.ts +3 -3
- package/dist.commonjs/advanced.js +1 -41
- package/dist.commonjs/advancedBarrel.d.ts +29 -4
- package/dist.commonjs/advancedBarrel.d.ts.map +1 -1
- package/dist.commonjs/advancedBarrel.js +1 -20
- package/dist.commonjs/barrel-Dj4BYAYE.d.ts +324 -0
- package/dist.commonjs/barrel-Dj4BYAYE.d.ts.map +1 -0
- package/dist.commonjs/barrel-Dj_LwfvL.js +2 -0
- package/dist.commonjs/barrel-Dj_LwfvL.js.map +1 -0
- package/dist.commonjs/barrel.d.ts +3 -5
- package/dist.commonjs/barrel.js +1 -43
- package/dist.commonjs/cluster-CGo0DCM9.js +2 -0
- package/dist.commonjs/cluster-CGo0DCM9.js.map +1 -0
- package/dist.commonjs/index.d.ts +3 -3
- package/dist.commonjs/index.js +1 -41
- package/dist.commonjs/types-C1N7Mdzo.d.ts +1050 -0
- package/dist.commonjs/types-C1N7Mdzo.d.ts.map +1 -0
- package/package.json +30 -33
- package/tsdown.config.mts +43 -0
- package/dist/advanced.d.ts +0 -3
- package/dist/advanced.d.ts.map +0 -1
- package/dist/advanced.js +0 -2
- package/dist/advancedBarrel.d.ts +0 -5
- package/dist/advancedBarrel.d.ts.map +0 -1
- package/dist/advancedBarrel.js +0 -4
- package/dist/barrel.d.ts +0 -5
- package/dist/barrel.d.ts.map +0 -1
- package/dist/barrel.js +0 -4
- package/dist/cluster/index.d.ts +0 -95
- package/dist/cluster/index.d.ts.map +0 -1
- package/dist/cluster/index.js +0 -165
- package/dist/cobuild/index.d.ts +0 -12
- package/dist/cobuild/index.d.ts.map +0 -1
- package/dist/cobuild/index.js +0 -167
- package/dist/codec/cluster.d.ts +0 -34
- package/dist/codec/cluster.d.ts.map +0 -1
- package/dist/codec/cluster.js +0 -62
- package/dist/codec/cobuild/buildingPacket.d.ts +0 -268
- package/dist/codec/cobuild/buildingPacket.d.ts.map +0 -1
- package/dist/codec/cobuild/buildingPacket.js +0 -33
- package/dist/codec/cobuild/index.d.ts +0 -4
- package/dist/codec/cobuild/index.d.ts.map +0 -1
- package/dist/codec/cobuild/index.js +0 -3
- package/dist/codec/cobuild/sporeAction.d.ts +0 -589
- package/dist/codec/cobuild/sporeAction.d.ts.map +0 -1
- package/dist/codec/cobuild/sporeAction.js +0 -90
- package/dist/codec/cobuild/witnessLayout.d.ts +0 -126
- package/dist/codec/cobuild/witnessLayout.d.ts.map +0 -1
- package/dist/codec/cobuild/witnessLayout.js +0 -26
- package/dist/codec/index.d.ts +0 -4
- package/dist/codec/index.d.ts.map +0 -1
- package/dist/codec/index.js +0 -3
- package/dist/codec/spore.d.ts +0 -10
- package/dist/codec/spore.d.ts.map +0 -1
- package/dist/codec/spore.js +0 -16
- package/dist/dob/api/decode.d.ts +0 -8
- package/dist/dob/api/decode.d.ts.map +0 -1
- package/dist/dob/api/decode.js +0 -63
- package/dist/dob/api/encode.d.ts +0 -5
- package/dist/dob/api/encode.d.ts.map +0 -1
- package/dist/dob/api/encode.js +0 -81
- package/dist/dob/api/index.d.ts +0 -3
- package/dist/dob/api/index.d.ts.map +0 -1
- package/dist/dob/api/index.js +0 -2
- package/dist/dob/config/index.d.ts +0 -2
- package/dist/dob/config/index.d.ts.map +0 -1
- package/dist/dob/config/index.js +0 -1
- package/dist/dob/config/predefined.d.ts +0 -8
- package/dist/dob/config/predefined.d.ts.map +0 -1
- package/dist/dob/config/predefined.js +0 -59
- package/dist/dob/helper/check.d.ts +0 -5
- package/dist/dob/helper/check.d.ts.map +0 -1
- package/dist/dob/helper/check.js +0 -75
- package/dist/dob/helper/error.d.ts +0 -2
- package/dist/dob/helper/error.d.ts.map +0 -1
- package/dist/dob/helper/error.js +0 -40
- package/dist/dob/helper/index.d.ts +0 -4
- package/dist/dob/helper/index.d.ts.map +0 -1
- package/dist/dob/helper/index.js +0 -3
- package/dist/dob/helper/object.d.ts +0 -59
- package/dist/dob/helper/object.d.ts.map +0 -1
- package/dist/dob/helper/object.js +0 -1
- package/dist/dob/index.d.ts +0 -4
- package/dist/dob/index.d.ts.map +0 -1
- package/dist/dob/index.js +0 -3
- package/dist/helper/index.d.ts +0 -7
- package/dist/helper/index.d.ts.map +0 -1
- package/dist/helper/index.js +0 -18
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/predefined/advanced.d.ts +0 -3
- package/dist/predefined/advanced.d.ts.map +0 -1
- package/dist/predefined/advanced.js +0 -2
- package/dist/predefined/index.d.ts +0 -3
- package/dist/predefined/index.d.ts.map +0 -1
- package/dist/predefined/index.js +0 -2
- package/dist/predefined/mainnet.advanced.d.ts +0 -4
- package/dist/predefined/mainnet.advanced.d.ts.map +0 -1
- package/dist/predefined/mainnet.advanced.js +0 -61
- package/dist/predefined/testnet.advanced.d.ts +0 -4
- package/dist/predefined/testnet.advanced.d.ts.map +0 -1
- package/dist/predefined/testnet.advanced.js +0 -88
- package/dist/predefined/types.d.ts +0 -17
- package/dist/predefined/types.d.ts.map +0 -1
- package/dist/predefined/types.js +0 -18
- package/dist/predefined/utils.d.ts +0 -7
- package/dist/predefined/utils.d.ts.map +0 -1
- package/dist/predefined/utils.js +0 -26
- package/dist/spore/advanced.d.ts +0 -4
- package/dist/spore/advanced.d.ts.map +0 -1
- package/dist/spore/advanced.js +0 -54
- package/dist/spore/index.d.ts +0 -129
- package/dist/spore/index.d.ts.map +0 -1
- package/dist/spore/index.js +0 -218
- package/dist.commonjs/advanced.d.ts.map +0 -1
- package/dist.commonjs/barrel.d.ts.map +0 -1
- package/dist.commonjs/cluster/index.d.ts +0 -95
- package/dist.commonjs/cluster/index.d.ts.map +0 -1
- package/dist.commonjs/cluster/index.js +0 -173
- package/dist.commonjs/cobuild/index.d.ts +0 -12
- package/dist.commonjs/cobuild/index.d.ts.map +0 -1
- package/dist.commonjs/cobuild/index.js +0 -178
- package/dist.commonjs/codec/cluster.d.ts +0 -34
- package/dist.commonjs/codec/cluster.d.ts.map +0 -1
- package/dist.commonjs/codec/cluster.js +0 -71
- package/dist.commonjs/codec/cobuild/buildingPacket.d.ts +0 -268
- package/dist.commonjs/codec/cobuild/buildingPacket.d.ts.map +0 -1
- package/dist.commonjs/codec/cobuild/buildingPacket.js +0 -36
- package/dist.commonjs/codec/cobuild/index.d.ts +0 -4
- package/dist.commonjs/codec/cobuild/index.d.ts.map +0 -1
- package/dist.commonjs/codec/cobuild/index.js +0 -19
- package/dist.commonjs/codec/cobuild/sporeAction.d.ts +0 -589
- package/dist.commonjs/codec/cobuild/sporeAction.d.ts.map +0 -1
- package/dist.commonjs/codec/cobuild/sporeAction.js +0 -93
- package/dist.commonjs/codec/cobuild/witnessLayout.d.ts +0 -126
- package/dist.commonjs/codec/cobuild/witnessLayout.d.ts.map +0 -1
- package/dist.commonjs/codec/cobuild/witnessLayout.js +0 -29
- package/dist.commonjs/codec/index.d.ts +0 -4
- package/dist.commonjs/codec/index.d.ts.map +0 -1
- package/dist.commonjs/codec/index.js +0 -19
- package/dist.commonjs/codec/spore.d.ts +0 -10
- package/dist.commonjs/codec/spore.d.ts.map +0 -1
- package/dist.commonjs/codec/spore.js +0 -21
- package/dist.commonjs/dob/api/decode.d.ts +0 -8
- package/dist.commonjs/dob/api/decode.d.ts.map +0 -1
- package/dist.commonjs/dob/api/decode.js +0 -70
- package/dist.commonjs/dob/api/encode.d.ts +0 -5
- package/dist.commonjs/dob/api/encode.d.ts.map +0 -1
- package/dist.commonjs/dob/api/encode.js +0 -86
- package/dist.commonjs/dob/api/index.d.ts +0 -3
- package/dist.commonjs/dob/api/index.d.ts.map +0 -1
- package/dist.commonjs/dob/api/index.js +0 -18
- package/dist.commonjs/dob/config/index.d.ts +0 -2
- package/dist.commonjs/dob/config/index.d.ts.map +0 -1
- package/dist.commonjs/dob/config/index.js +0 -17
- package/dist.commonjs/dob/config/predefined.d.ts +0 -8
- package/dist.commonjs/dob/config/predefined.d.ts.map +0 -1
- package/dist.commonjs/dob/config/predefined.js +0 -63
- package/dist.commonjs/dob/helper/check.d.ts +0 -5
- package/dist.commonjs/dob/helper/check.d.ts.map +0 -1
- package/dist.commonjs/dob/helper/check.js +0 -80
- package/dist.commonjs/dob/helper/error.d.ts +0 -2
- package/dist.commonjs/dob/helper/error.d.ts.map +0 -1
- package/dist.commonjs/dob/helper/error.js +0 -43
- package/dist.commonjs/dob/helper/index.d.ts +0 -4
- package/dist.commonjs/dob/helper/index.d.ts.map +0 -1
- package/dist.commonjs/dob/helper/index.js +0 -19
- package/dist.commonjs/dob/helper/object.d.ts +0 -59
- package/dist.commonjs/dob/helper/object.d.ts.map +0 -1
- package/dist.commonjs/dob/helper/object.js +0 -2
- package/dist.commonjs/dob/index.d.ts +0 -4
- package/dist.commonjs/dob/index.d.ts.map +0 -1
- package/dist.commonjs/dob/index.js +0 -19
- package/dist.commonjs/helper/index.d.ts +0 -7
- package/dist.commonjs/helper/index.d.ts.map +0 -1
- package/dist.commonjs/helper/index.js +0 -21
- package/dist.commonjs/index.d.ts.map +0 -1
- package/dist.commonjs/predefined/advanced.d.ts +0 -3
- package/dist.commonjs/predefined/advanced.d.ts.map +0 -1
- package/dist.commonjs/predefined/advanced.js +0 -18
- package/dist.commonjs/predefined/index.d.ts +0 -3
- package/dist.commonjs/predefined/index.d.ts.map +0 -1
- package/dist.commonjs/predefined/index.js +0 -18
- package/dist.commonjs/predefined/mainnet.advanced.d.ts +0 -4
- package/dist.commonjs/predefined/mainnet.advanced.d.ts.map +0 -1
- package/dist.commonjs/predefined/mainnet.advanced.js +0 -64
- package/dist.commonjs/predefined/testnet.advanced.d.ts +0 -4
- package/dist.commonjs/predefined/testnet.advanced.d.ts.map +0 -1
- package/dist.commonjs/predefined/testnet.advanced.js +0 -91
- package/dist.commonjs/predefined/types.d.ts +0 -17
- package/dist.commonjs/predefined/types.d.ts.map +0 -1
- package/dist.commonjs/predefined/types.js +0 -22
- package/dist.commonjs/predefined/utils.d.ts +0 -7
- package/dist.commonjs/predefined/utils.d.ts.map +0 -1
- package/dist.commonjs/predefined/utils.js +0 -32
- package/dist.commonjs/spore/advanced.d.ts +0 -4
- package/dist.commonjs/spore/advanced.d.ts.map +0 -1
- package/dist.commonjs/spore/advanced.js +0 -57
- package/dist.commonjs/spore/index.d.ts +0 -129
- package/dist.commonjs/spore/index.d.ts.map +0 -1
- package/dist.commonjs/spore/index.js +0 -227
package/dist/spore/index.js
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { ccc } from "@ckb-ccc/core";
|
|
2
|
-
import { assembleCreateSporeAction, assembleMeltSporeAction, assembleTransferSporeAction, prepareSporeTransaction, } from "../advanced.js";
|
|
3
|
-
import { packRawSporeData, unpackToRawSporeData, } from "../codec/index.js";
|
|
4
|
-
import { findSingletonCellByArgs } from "../helper/index.js";
|
|
5
|
-
import { SporeScriptInfo, getSporeScriptInfo, getSporeScriptInfos, } from "../predefined/index.js";
|
|
6
|
-
import { prepareCluster } from "./advanced.js";
|
|
7
|
-
export async function findSpore(client, id, scripts) {
|
|
8
|
-
const found = await findSingletonCellByArgs(client, id, scripts ?? Object.values(getSporeScriptInfos(client)));
|
|
9
|
-
if (!found) {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
cell: found.cell,
|
|
14
|
-
spore: found.cell,
|
|
15
|
-
sporeData: unpackToRawSporeData(found.cell.outputData),
|
|
16
|
-
scriptInfo: found.scriptInfo,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export async function assertSpore(client, args, scripts) {
|
|
20
|
-
const res = await findSpore(client, args, scripts);
|
|
21
|
-
if (!res) {
|
|
22
|
-
throw new Error(`Spore ${ccc.hexFrom(args)} not found`);
|
|
23
|
-
}
|
|
24
|
-
return res;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Create one Spore cell with the specified Spore data.
|
|
28
|
-
*
|
|
29
|
-
* @param params.signer who takes the responsibility to balance and sign the transaction
|
|
30
|
-
* @param params.data specific format of data required by Spore protocol
|
|
31
|
-
* @param params.to owner of new spore cell, signer if no provided
|
|
32
|
-
* @param params.clusterMode how to process cluster cell **(if clusterId is not provided in SporeData, this parameter will be ignored)**
|
|
33
|
-
* - undefined: error if the spore has a cluster but the clusterMode is not set
|
|
34
|
-
* - lockProxy: put a cell that uses the same lock from Cluster cell in both Inputs and Outputs
|
|
35
|
-
* - clusterCell: directly put Cluster cell in Inputs and Outputs
|
|
36
|
-
* - skip: don't handle the cluster logic
|
|
37
|
-
* @param params.tx the transaction skeleton, if not provided, a new one will be created
|
|
38
|
-
* @param params.scriptInfo the script info of Spore cell, if not provided, the default script info will be used
|
|
39
|
-
* @param params.scriptInfoHash the script info hash used in cobuild
|
|
40
|
-
* @returns
|
|
41
|
-
* - **tx**: a new transaction that contains created Spore cells
|
|
42
|
-
* - **id**: the sporeId of created Spore cell
|
|
43
|
-
*/
|
|
44
|
-
export async function createSpore(params) {
|
|
45
|
-
const { signer, data, to, clusterMode, scriptInfoHash } = params;
|
|
46
|
-
const scriptInfo = params.scriptInfo ?? getSporeScriptInfo(signer.client);
|
|
47
|
-
// prepare transaction
|
|
48
|
-
const actions = [];
|
|
49
|
-
const ids = [];
|
|
50
|
-
const tx = ccc.Transaction.from(params.tx ?? {});
|
|
51
|
-
await tx.completeInputsAtLeastOne(signer);
|
|
52
|
-
const { script: lock } = await signer.getRecommendedAddressObj();
|
|
53
|
-
// build spore cell
|
|
54
|
-
const id = ccc.hashTypeId(tx.inputs[0], tx.outputs.length);
|
|
55
|
-
ids.push(id);
|
|
56
|
-
const packedData = packRawSporeData(data);
|
|
57
|
-
tx.addOutput({
|
|
58
|
-
lock: to ?? lock,
|
|
59
|
-
type: {
|
|
60
|
-
...scriptInfo,
|
|
61
|
-
args: id,
|
|
62
|
-
},
|
|
63
|
-
}, packedData);
|
|
64
|
-
// create spore action
|
|
65
|
-
if (scriptInfo.cobuild) {
|
|
66
|
-
const output = tx.outputs[tx.outputs.length - 1];
|
|
67
|
-
const createAction = assembleCreateSporeAction(output, packedData, scriptInfoHash);
|
|
68
|
-
actions.push(createAction);
|
|
69
|
-
}
|
|
70
|
-
// complete cellDeps
|
|
71
|
-
await tx.addCellDepInfos(signer.client, scriptInfo.cellDeps);
|
|
72
|
-
const action = await prepareCluster(signer, tx, data, clusterMode);
|
|
73
|
-
if (action) {
|
|
74
|
-
actions.push(action);
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
tx: await prepareSporeTransaction(signer, tx, actions),
|
|
78
|
-
id,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Transfer one Spore cell
|
|
83
|
-
*
|
|
84
|
-
* @param params.signer who takes the responsibility to balance and sign the transaction
|
|
85
|
-
* @param params.id sporeId
|
|
86
|
-
* @param params.to Spore's new owner
|
|
87
|
-
* @param params.tx the transaction skeleton, if not provided, a new one will be created
|
|
88
|
-
* @param params.scriptInfoHash the script info hash used in cobuild
|
|
89
|
-
* @returns
|
|
90
|
-
* - **tx**: a new transaction that contains transferred Spore cells
|
|
91
|
-
*/
|
|
92
|
-
export async function transferSpore(params) {
|
|
93
|
-
const { signer, id, to, scripts, scriptInfoHash } = params;
|
|
94
|
-
// prepare transaction
|
|
95
|
-
const tx = ccc.Transaction.from(params.tx ?? {});
|
|
96
|
-
const { cell: sporeCell, scriptInfo: sporeScriptInfo } = await assertSpore(signer.client, id, scripts);
|
|
97
|
-
await tx.addCellDepInfos(signer.client, sporeScriptInfo.cellDeps);
|
|
98
|
-
tx.addInput(sporeCell);
|
|
99
|
-
tx.addOutput({
|
|
100
|
-
lock: to,
|
|
101
|
-
type: sporeCell.cellOutput.type,
|
|
102
|
-
}, sporeCell.outputData);
|
|
103
|
-
const actions = sporeScriptInfo.cobuild
|
|
104
|
-
? [
|
|
105
|
-
assembleTransferSporeAction(sporeCell.cellOutput, tx.outputs[tx.outputs.length - 1], scriptInfoHash),
|
|
106
|
-
]
|
|
107
|
-
: [];
|
|
108
|
-
return {
|
|
109
|
-
tx: await prepareSporeTransaction(signer, tx, actions),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Melt one Spore cell
|
|
114
|
-
*
|
|
115
|
-
* @param params.signer who takes the responsibility to balance and sign the transaction
|
|
116
|
-
* @param params.id sporeId to be melted
|
|
117
|
-
* @param params.tx the transaction skeleton, if not provided, a new one will be created
|
|
118
|
-
* @param params.scriptInfoHash the script info hash used in cobuild
|
|
119
|
-
* @returns
|
|
120
|
-
* - **tx**: a new transaction that contains melted Spore cell
|
|
121
|
-
*/
|
|
122
|
-
export async function meltSpore(params) {
|
|
123
|
-
const { signer, id, scripts, scriptInfoHash } = params;
|
|
124
|
-
// prepare transaction
|
|
125
|
-
const tx = ccc.Transaction.from(params.tx ?? {});
|
|
126
|
-
// build spore cell
|
|
127
|
-
const { cell: sporeCell, scriptInfo: sporeScriptInfo } = await assertSpore(signer.client, id, scripts);
|
|
128
|
-
await tx.addCellDepInfos(signer.client, sporeScriptInfo.cellDeps);
|
|
129
|
-
tx.addInput(sporeCell);
|
|
130
|
-
const actions = sporeScriptInfo.cobuild
|
|
131
|
-
? [assembleMeltSporeAction(sporeCell.cellOutput, scriptInfoHash)]
|
|
132
|
-
: [];
|
|
133
|
-
return {
|
|
134
|
-
tx: await prepareSporeTransaction(signer, tx, actions),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Search on-chain spores under the signer's control, if cluster provided, filter spores belonging to this cluster
|
|
139
|
-
*
|
|
140
|
-
* @param params.signer the owner of spores
|
|
141
|
-
* @param params.order the order in creation time of spores
|
|
142
|
-
* @param params.clusterId the cluster that spores belong to. "" to find public spores
|
|
143
|
-
* @param params.scriptInfos the deployed script infos of spores
|
|
144
|
-
* @returns specified spore cells
|
|
145
|
-
*/
|
|
146
|
-
export async function* findSporesBySigner(params) {
|
|
147
|
-
const { signer, clusterId, scriptInfos, limit, order } = params;
|
|
148
|
-
for (const scriptInfo of scriptInfos ??
|
|
149
|
-
Object.values(getSporeScriptInfos(signer.client))) {
|
|
150
|
-
if (!scriptInfo) {
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
for await (const spore of signer.findCells({
|
|
154
|
-
script: {
|
|
155
|
-
...scriptInfo,
|
|
156
|
-
args: [],
|
|
157
|
-
},
|
|
158
|
-
}, true, order, limit)) {
|
|
159
|
-
const sporeData = unpackToRawSporeData(spore.outputData);
|
|
160
|
-
if (!clusterId ||
|
|
161
|
-
(clusterId === "" && !sporeData.clusterId) ||
|
|
162
|
-
sporeData.clusterId === ccc.hexFrom(clusterId)) {
|
|
163
|
-
yield {
|
|
164
|
-
cell: spore,
|
|
165
|
-
spore,
|
|
166
|
-
sporeData,
|
|
167
|
-
scriptInfo: SporeScriptInfo.from(scriptInfo),
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Search on-chain spores under the specified lock or not, if cluster provided, filter spores belonging to this cluster
|
|
175
|
-
*
|
|
176
|
-
* @param params.client the client to search spores
|
|
177
|
-
* @param params.lock the lock of spores
|
|
178
|
-
* @param params.clusterId the cluster that spores belong to. "" to find public spores
|
|
179
|
-
* @param params.scriptInfos the deployed script infos of spores
|
|
180
|
-
* @param params.limit the limit of spores to search
|
|
181
|
-
* @param params.order the order in creation time of spores
|
|
182
|
-
* @returns specified spore cells
|
|
183
|
-
*/
|
|
184
|
-
export async function* findSpores(params) {
|
|
185
|
-
const { client, lock, clusterId, scriptInfos, limit, order } = params;
|
|
186
|
-
for (const scriptInfo of scriptInfos ??
|
|
187
|
-
Object.values(getSporeScriptInfos(client))) {
|
|
188
|
-
if (!scriptInfo) {
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
for await (const spore of client.findCells({
|
|
192
|
-
script: {
|
|
193
|
-
...scriptInfo,
|
|
194
|
-
args: [],
|
|
195
|
-
},
|
|
196
|
-
scriptType: "type",
|
|
197
|
-
scriptSearchMode: "prefix",
|
|
198
|
-
withData: true,
|
|
199
|
-
filter: lock
|
|
200
|
-
? {
|
|
201
|
-
script: lock,
|
|
202
|
-
}
|
|
203
|
-
: undefined,
|
|
204
|
-
}, order, limit)) {
|
|
205
|
-
const sporeData = unpackToRawSporeData(spore.outputData);
|
|
206
|
-
if (!clusterId ||
|
|
207
|
-
(clusterId === "" && !sporeData.clusterId) ||
|
|
208
|
-
sporeData.clusterId === ccc.hexFrom(clusterId)) {
|
|
209
|
-
yield {
|
|
210
|
-
cell: spore,
|
|
211
|
-
spore,
|
|
212
|
-
sporeData,
|
|
213
|
-
scriptInfo: SporeScriptInfo.from(scriptInfo),
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../src/advanced.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"barrel.d.ts","sourceRoot":"","sources":["../src/barrel.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { ccc } from "@ckb-ccc/core";
|
|
2
|
-
import { ClusterDataView } from "../codec/index.js";
|
|
3
|
-
import { SporeScriptInfo, SporeScriptInfoLike } from "../predefined/index.js";
|
|
4
|
-
export declare function findCluster(client: ccc.Client, id: ccc.HexLike, scripts?: SporeScriptInfoLike[]): Promise<{
|
|
5
|
-
cell: ccc.Cell;
|
|
6
|
-
cluster: ccc.Cell;
|
|
7
|
-
clusterData: ClusterDataView;
|
|
8
|
-
scriptInfo: SporeScriptInfo;
|
|
9
|
-
} | undefined>;
|
|
10
|
-
export declare function assertCluster(client: ccc.Client, args: ccc.HexLike, scripts?: SporeScriptInfoLike[]): Promise<{
|
|
11
|
-
cell: ccc.Cell;
|
|
12
|
-
scriptInfo: SporeScriptInfo;
|
|
13
|
-
}>;
|
|
14
|
-
/**
|
|
15
|
-
* Create a new Cluster cell
|
|
16
|
-
*
|
|
17
|
-
* @param params.signer who takes the responsibility to balance and sign the transaction
|
|
18
|
-
* @param params.data specific format of data required by Cluster protocol
|
|
19
|
-
* @param params.to the owner of the Cluster cell, which will be replaced with signer if not provided
|
|
20
|
-
* @param params.tx the transaction skeleton, if not provided, a new one will be created
|
|
21
|
-
* @param params.scriptInfo the script info of new cluster, default spore version if undefined
|
|
22
|
-
* @param params.scriptInfoHash the script info hash used in cobuild
|
|
23
|
-
* @returns
|
|
24
|
-
* - **tx**: a new transaction that contains created Cluster cell
|
|
25
|
-
* - **id**: the id of the created Cluster cell
|
|
26
|
-
*/
|
|
27
|
-
export declare function createSporeCluster(params: {
|
|
28
|
-
signer: ccc.Signer;
|
|
29
|
-
data: ClusterDataView;
|
|
30
|
-
to?: ccc.ScriptLike;
|
|
31
|
-
tx?: ccc.TransactionLike;
|
|
32
|
-
scriptInfo?: SporeScriptInfoLike;
|
|
33
|
-
scriptInfoHash?: ccc.HexLike;
|
|
34
|
-
}): Promise<{
|
|
35
|
-
tx: ccc.Transaction;
|
|
36
|
-
id: ccc.Hex;
|
|
37
|
-
}>;
|
|
38
|
-
/**
|
|
39
|
-
* Transfer a Cluster cell
|
|
40
|
-
*
|
|
41
|
-
* @param params.signer who takes the responsibility to balance and sign the transaction
|
|
42
|
-
* @param params.id the id of the Cluster cell to be transferred
|
|
43
|
-
* @param params.to the new owner of the Cluster cell
|
|
44
|
-
* @param params.tx the transaction skeleton, if not provided, a new one will be created
|
|
45
|
-
* @param params.scriptInfoHash the script info hash used in cobuild
|
|
46
|
-
* @returns
|
|
47
|
-
* - **tx**: a new transaction that contains transferred Cluster cell
|
|
48
|
-
*/
|
|
49
|
-
export declare function transferSporeCluster(params: {
|
|
50
|
-
signer: ccc.Signer;
|
|
51
|
-
id: ccc.HexLike;
|
|
52
|
-
to: ccc.ScriptLike;
|
|
53
|
-
tx?: ccc.TransactionLike;
|
|
54
|
-
scripts?: SporeScriptInfoLike[];
|
|
55
|
-
scriptInfoHash?: ccc.HexLike;
|
|
56
|
-
}): Promise<{
|
|
57
|
-
tx: ccc.Transaction;
|
|
58
|
-
}>;
|
|
59
|
-
/**
|
|
60
|
-
* Search on-chain clusters under the signer's control
|
|
61
|
-
*
|
|
62
|
-
* @param params.signer the owner of clusters
|
|
63
|
-
* @param params.order the order in creation time of clusters
|
|
64
|
-
* @param params.scriptInfos the deployed script infos of clusters
|
|
65
|
-
*/
|
|
66
|
-
export declare function findSporeClustersBySigner(params: {
|
|
67
|
-
signer: ccc.Signer;
|
|
68
|
-
order?: "asc" | "desc";
|
|
69
|
-
limit?: number;
|
|
70
|
-
scriptInfos?: SporeScriptInfoLike[];
|
|
71
|
-
}): AsyncGenerator<{
|
|
72
|
-
cell: ccc.Cell;
|
|
73
|
-
cluster: ccc.Cell;
|
|
74
|
-
clusterData: ClusterDataView;
|
|
75
|
-
scriptInfo: SporeScriptInfo;
|
|
76
|
-
}>;
|
|
77
|
-
/**
|
|
78
|
-
* Search on-chain clusters under the specified lock or not
|
|
79
|
-
*
|
|
80
|
-
* @param params.client the client to search clusters
|
|
81
|
-
* @param params.lock the lock of clusters
|
|
82
|
-
*/
|
|
83
|
-
export declare function findSporeClusters(params: {
|
|
84
|
-
client: ccc.Client;
|
|
85
|
-
lock?: ccc.ScriptLike;
|
|
86
|
-
order?: "asc" | "desc";
|
|
87
|
-
limit?: number;
|
|
88
|
-
scriptInfos?: SporeScriptInfoLike[];
|
|
89
|
-
}): AsyncGenerator<{
|
|
90
|
-
cell: ccc.Cell;
|
|
91
|
-
cluster: ccc.Cell;
|
|
92
|
-
clusterData: ClusterDataView;
|
|
93
|
-
scriptInfo: SporeScriptInfo;
|
|
94
|
-
}>;
|
|
95
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cluster/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findCluster = findCluster;
|
|
4
|
-
exports.assertCluster = assertCluster;
|
|
5
|
-
exports.createSporeCluster = createSporeCluster;
|
|
6
|
-
exports.transferSporeCluster = transferSporeCluster;
|
|
7
|
-
exports.findSporeClustersBySigner = findSporeClustersBySigner;
|
|
8
|
-
exports.findSporeClusters = findSporeClusters;
|
|
9
|
-
const core_1 = require("@ckb-ccc/core");
|
|
10
|
-
const advanced_js_1 = require("../advanced.js");
|
|
11
|
-
const index_js_1 = require("../codec/index.js");
|
|
12
|
-
const index_js_2 = require("../helper/index.js");
|
|
13
|
-
const index_js_3 = require("../predefined/index.js");
|
|
14
|
-
async function findCluster(client, id, scripts) {
|
|
15
|
-
const found = await (0, index_js_2.findSingletonCellByArgs)(client, id, scripts ?? Object.values((0, index_js_3.getClusterScriptInfos)(client)));
|
|
16
|
-
if (!found) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
cell: found.cell,
|
|
21
|
-
cluster: found.cell,
|
|
22
|
-
clusterData: (0, index_js_1.unpackToRawClusterData)(found.cell.outputData),
|
|
23
|
-
scriptInfo: found.scriptInfo,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
async function assertCluster(client, args, scripts) {
|
|
27
|
-
const res = await findCluster(client, args, scripts);
|
|
28
|
-
if (!res) {
|
|
29
|
-
throw new Error(`Cluster ${core_1.ccc.hexFrom(args)} not found`);
|
|
30
|
-
}
|
|
31
|
-
return res;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Create a new Cluster cell
|
|
35
|
-
*
|
|
36
|
-
* @param params.signer who takes the responsibility to balance and sign the transaction
|
|
37
|
-
* @param params.data specific format of data required by Cluster protocol
|
|
38
|
-
* @param params.to the owner of the Cluster cell, which will be replaced with signer if not provided
|
|
39
|
-
* @param params.tx the transaction skeleton, if not provided, a new one will be created
|
|
40
|
-
* @param params.scriptInfo the script info of new cluster, default spore version if undefined
|
|
41
|
-
* @param params.scriptInfoHash the script info hash used in cobuild
|
|
42
|
-
* @returns
|
|
43
|
-
* - **tx**: a new transaction that contains created Cluster cell
|
|
44
|
-
* - **id**: the id of the created Cluster cell
|
|
45
|
-
*/
|
|
46
|
-
async function createSporeCluster(params) {
|
|
47
|
-
const { signer, data, to, scriptInfoHash } = params;
|
|
48
|
-
const scriptInfo = params.scriptInfo ?? (0, index_js_3.getClusterScriptInfo)(signer.client);
|
|
49
|
-
// prepare transaction
|
|
50
|
-
const tx = core_1.ccc.Transaction.from(params.tx ?? {});
|
|
51
|
-
await tx.completeInputsAtLeastOne(signer);
|
|
52
|
-
// build cluster cell
|
|
53
|
-
const id = core_1.ccc.hashTypeId(tx.inputs[0], tx.outputs.length);
|
|
54
|
-
const packedClusterData = (0, index_js_1.packRawClusterData)(data);
|
|
55
|
-
tx.addOutput({
|
|
56
|
-
lock: to ?? (await signer.getRecommendedAddressObj()).script,
|
|
57
|
-
type: {
|
|
58
|
-
...scriptInfo,
|
|
59
|
-
args: id,
|
|
60
|
-
},
|
|
61
|
-
}, packedClusterData);
|
|
62
|
-
// complete cellDeps
|
|
63
|
-
await tx.addCellDepInfos(signer.client, scriptInfo.cellDeps);
|
|
64
|
-
// generate cobuild action
|
|
65
|
-
const actions = scriptInfo.cobuild
|
|
66
|
-
? [
|
|
67
|
-
(0, advanced_js_1.assembleCreateClusterAction)(tx.outputs[tx.outputs.length - 1], packedClusterData, scriptInfoHash),
|
|
68
|
-
]
|
|
69
|
-
: [];
|
|
70
|
-
return {
|
|
71
|
-
tx: await (0, advanced_js_1.prepareSporeTransaction)(signer, tx, actions),
|
|
72
|
-
id,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Transfer a Cluster cell
|
|
77
|
-
*
|
|
78
|
-
* @param params.signer who takes the responsibility to balance and sign the transaction
|
|
79
|
-
* @param params.id the id of the Cluster cell to be transferred
|
|
80
|
-
* @param params.to the new owner of the Cluster cell
|
|
81
|
-
* @param params.tx the transaction skeleton, if not provided, a new one will be created
|
|
82
|
-
* @param params.scriptInfoHash the script info hash used in cobuild
|
|
83
|
-
* @returns
|
|
84
|
-
* - **tx**: a new transaction that contains transferred Cluster cell
|
|
85
|
-
*/
|
|
86
|
-
async function transferSporeCluster(params) {
|
|
87
|
-
const { signer, id, to, scripts, scriptInfoHash } = params;
|
|
88
|
-
// prepare transaction
|
|
89
|
-
const tx = core_1.ccc.Transaction.from(params.tx ?? {});
|
|
90
|
-
// build cluster cell
|
|
91
|
-
const { cell: cluster, scriptInfo: clusterScriptInfo } = await assertCluster(signer.client, id, scripts);
|
|
92
|
-
tx.addInput(cluster);
|
|
93
|
-
tx.addOutput({
|
|
94
|
-
lock: to,
|
|
95
|
-
type: cluster.cellOutput.type,
|
|
96
|
-
}, cluster.outputData);
|
|
97
|
-
// complete cellDeps
|
|
98
|
-
await tx.addCellDepInfos(signer.client, clusterScriptInfo.cellDeps);
|
|
99
|
-
// generate cobuild action
|
|
100
|
-
const actions = clusterScriptInfo.cobuild
|
|
101
|
-
? [
|
|
102
|
-
(0, advanced_js_1.assembleTransferClusterAction)(cluster.cellOutput, tx.outputs[tx.outputs.length - 1], scriptInfoHash),
|
|
103
|
-
]
|
|
104
|
-
: [];
|
|
105
|
-
return {
|
|
106
|
-
tx: await (0, advanced_js_1.prepareSporeTransaction)(signer, tx, actions),
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Search on-chain clusters under the signer's control
|
|
111
|
-
*
|
|
112
|
-
* @param params.signer the owner of clusters
|
|
113
|
-
* @param params.order the order in creation time of clusters
|
|
114
|
-
* @param params.scriptInfos the deployed script infos of clusters
|
|
115
|
-
*/
|
|
116
|
-
async function* findSporeClustersBySigner(params) {
|
|
117
|
-
const { signer, order, limit, scriptInfos } = params;
|
|
118
|
-
for (const scriptInfo of scriptInfos ??
|
|
119
|
-
Object.values((0, index_js_3.getClusterScriptInfos)(signer.client))) {
|
|
120
|
-
if (!scriptInfo) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
for await (const cluster of signer.findCells({
|
|
124
|
-
script: {
|
|
125
|
-
...scriptInfo,
|
|
126
|
-
args: "",
|
|
127
|
-
},
|
|
128
|
-
}, true, order, limit)) {
|
|
129
|
-
yield {
|
|
130
|
-
cell: cluster,
|
|
131
|
-
cluster,
|
|
132
|
-
clusterData: (0, index_js_1.unpackToRawClusterData)(cluster.outputData),
|
|
133
|
-
scriptInfo: index_js_3.SporeScriptInfo.from(scriptInfo),
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Search on-chain clusters under the specified lock or not
|
|
140
|
-
*
|
|
141
|
-
* @param params.client the client to search clusters
|
|
142
|
-
* @param params.lock the lock of clusters
|
|
143
|
-
*/
|
|
144
|
-
async function* findSporeClusters(params) {
|
|
145
|
-
const { client, lock, order, limit, scriptInfos } = params;
|
|
146
|
-
for (const scriptInfo of scriptInfos ??
|
|
147
|
-
Object.values((0, index_js_3.getClusterScriptInfos)(client))) {
|
|
148
|
-
if (!scriptInfo) {
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
for await (const cluster of client.findCells({
|
|
152
|
-
script: {
|
|
153
|
-
...scriptInfo,
|
|
154
|
-
args: "",
|
|
155
|
-
},
|
|
156
|
-
scriptType: "type",
|
|
157
|
-
scriptSearchMode: "prefix",
|
|
158
|
-
withData: true,
|
|
159
|
-
filter: lock
|
|
160
|
-
? {
|
|
161
|
-
script: lock,
|
|
162
|
-
}
|
|
163
|
-
: undefined,
|
|
164
|
-
}, order, limit)) {
|
|
165
|
-
yield {
|
|
166
|
-
cell: cluster,
|
|
167
|
-
cluster,
|
|
168
|
-
clusterData: (0, index_js_1.unpackToRawClusterData)(cluster.outputData),
|
|
169
|
-
scriptInfo: index_js_3.SporeScriptInfo.from(scriptInfo),
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ccc } from "@ckb-ccc/core";
|
|
2
|
-
import { Action, ActionVec, WitnessLayout } from "../codec/index.js";
|
|
3
|
-
export declare function assembleCreateSporeAction(sporeOutput: ccc.CellOutputLike, sporeData: ccc.BytesLike, scriptInfoHash?: ccc.HexLike): ccc.EncodableType<typeof Action>;
|
|
4
|
-
export declare function assembleTransferSporeAction(sporeInput: ccc.CellOutputLike, sporeOutput: ccc.CellOutputLike, scriptInfoHash?: ccc.HexLike): ccc.EncodableType<typeof Action>;
|
|
5
|
-
export declare function assembleMeltSporeAction(sporeInput: ccc.CellOutputLike, scriptInfoHash?: ccc.HexLike): ccc.EncodableType<typeof Action>;
|
|
6
|
-
export declare function assembleCreateClusterAction(clusterOutput: ccc.CellOutputLike, clusterData: ccc.BytesLike, scriptInfoHash?: ccc.HexLike): ccc.EncodableType<typeof Action>;
|
|
7
|
-
export declare function assembleTransferClusterAction(clusterInput: ccc.CellOutputLike, clusterOutput: ccc.CellOutputLike, scriptInfoHash?: ccc.HexLike): ccc.EncodableType<typeof Action>;
|
|
8
|
-
export declare function prepareSporeTransaction(signer: ccc.Signer, txLike: ccc.TransactionLike, actions: ccc.EncodableType<typeof ActionVec>): Promise<ccc.Transaction>;
|
|
9
|
-
export declare function unpackCommonCobuildProof(data: ccc.HexLike): ccc.EncodableType<typeof WitnessLayout> | undefined;
|
|
10
|
-
export declare function extractCobuildActionsFromTx(tx: ccc.Transaction): ccc.EncodableType<typeof ActionVec>;
|
|
11
|
-
export declare function injectCobuild(tx: ccc.Transaction, actions: ccc.EncodableType<typeof ActionVec>): void;
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cobuild/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EACL,MAAM,EACN,SAAS,EAET,aAAa,EACd,MAAM,mBAAmB,CAAC;AAG3B,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,GAAG,CAAC,cAAc,EAC/B,SAAS,EAAE,GAAG,CAAC,SAAS,EACxB,cAAc,GAAE,GAAG,CAAC,OAAmC,GACtD,GAAG,CAAC,aAAa,CAAC,OAAO,MAAM,CAAC,CAsBlC;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,GAAG,CAAC,cAAc,EAC9B,WAAW,EAAE,GAAG,CAAC,cAAc,EAC/B,cAAc,GAAE,GAAG,CAAC,OAAmC,GACtD,GAAG,CAAC,aAAa,CAAC,OAAO,MAAM,CAAC,CA0BlC;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,GAAG,CAAC,cAAc,EAC9B,cAAc,GAAE,GAAG,CAAC,OAAmC,GACtD,GAAG,CAAC,aAAa,CAAC,OAAO,MAAM,CAAC,CAqBlC;AAED,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,GAAG,CAAC,cAAc,EACjC,WAAW,EAAE,GAAG,CAAC,SAAS,EAC1B,cAAc,GAAE,GAAG,CAAC,OAAmC,GACtD,GAAG,CAAC,aAAa,CAAC,OAAO,MAAM,CAAC,CAsBlC;AAED,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,GAAG,CAAC,cAAc,EAChC,aAAa,EAAE,GAAG,CAAC,cAAc,EACjC,cAAc,GAAE,GAAG,CAAC,OAAmC,GACtD,GAAG,CAAC,aAAa,CAAC,OAAO,MAAM,CAAC,CAyBlC;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,MAAM,EAAE,GAAG,CAAC,eAAe,EAC3B,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,OAAO,SAAS,CAAC,GAC3C,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAW1B;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,GAAG,CAAC,OAAO,GAChB,GAAG,CAAC,aAAa,CAAC,OAAO,aAAa,CAAC,GAAG,SAAS,CAMrD;AAED,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,GAAG,CAAC,WAAW,GAClB,GAAG,CAAC,aAAa,CAAC,OAAO,SAAS,CAAC,CAiBrC;AAED,wBAAgB,aAAa,CAC3B,EAAE,EAAE,GAAG,CAAC,WAAW,EACnB,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,OAAO,SAAS,CAAC,GAC3C,IAAI,CAaN"}
|