CCC Docs
    Preparing search index...

    Function createSpore

    • Create one Spore cell with the specified Spore data.

      Parameters

      • params: {
            signer: Signer;
            data: SporeDataView;
            to?: ScriptLike;
            clusterMode?: "lockProxy" | "clusterCell" | "skip";
            tx?: TransactionLike;
            scriptInfo?: SporeScriptInfoLike;
            scriptInfoHash?: BytesLike;
        }
        • signer: Signer

          who takes the responsibility to balance and sign the transaction

        • data: SporeDataView

          specific format of data required by Spore protocol

        • Optionalto?: ScriptLike

          owner of new spore cell, signer if no provided

        • OptionalclusterMode?: "lockProxy" | "clusterCell" | "skip"

          how to process cluster cell (if clusterId is not provided in SporeData, this parameter will be ignored)

          • undefined: error if the spore has a cluster but the clusterMode is not set
          • lockProxy: put a cell that uses the same lock from Cluster cell in both Inputs and Outputs
          • clusterCell: directly put Cluster cell in Inputs and Outputs
          • skip: don't handle the cluster logic
        • Optionaltx?: TransactionLike

          the transaction skeleton, if not provided, a new one will be created

        • OptionalscriptInfo?: SporeScriptInfoLike

          the script info of Spore cell, if not provided, the default script info will be used

        • OptionalscriptInfoHash?: BytesLike

          the script info hash used in cobuild

      Returns Promise<{ tx: Transaction; id: `0x${string}` }>

      • tx: a new transaction that contains created Spore cells
      • id: the sporeId of created Spore cell