Skip to content

Commit

Permalink
Merge pull request #3 from independenceee/feature/documents
Browse files Browse the repository at this point in the history
develop: write document mint opensource dynamic asset
  • Loading branch information
independenceee authored Sep 27, 2024
2 parents e7ba8d2 + c01f5fb commit d324f26
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,60 @@
# cip68generator
# CIP68 Generator

CIP-68 is an open-source standard designed for creating and managing NFTs on the Cardano blockchain. It introduces advanced features for flexible and scalable token management, allowing developers to mint, burn, update, and remove NFTs with enhanced security and efficiency.

## Features

- [x] **Mint**: Create new NFTs with customizable metadata, adhering to Cardano standards.
- [x] **Burn**: Permanently remove NFTs from circulation, controlling supply.
- [x] **Update**: Modify the metadata of existing NFTs without changing their identity.
- [x] **Remove**: Change metadata to retire NFTs from active use without destroying them.

We primarily use two main SDKs, Mesh and Blockfrost, to efficiently retrieve information and execute transactions on the blockchain. Additionally, Mesh provides the flexibility to use other providers beyond Blockfrost (such as Koios ...).

- [x] **Blockfrost**: use [Blockfrost](https://blockfrost.io) to query data
- [x] **Mesh**: use [Mesh](https://meshjs.dev) join blockfrost to make transactions and work with Wallets simply

## Install

- npm: `npm i @independenceee/cip68generator`
- yarn: `yarn add @independenceee/cip68generator`

## Create `BlockfrostProvider` and `MeshTxBuilder` to efficiently retrieve information and execute transactions.

```ts
import { BlockfrostProvider, MeshTxBuilder } from "@meshsdk/core";

const blockfrostProvider: BlockfrostProvider = new BlockfrostProvider("<Your-Api-Key>");

const meshTxBuilder: MeshTxBuilder = new MeshTxBuilder({
fetcher: blockfrostProvider,
evaluator: blockfrostProvider,
submitter: blockfrostProvider,
});
```

## Mint: Create new NFTs with customizable metadata, adhering to Cardano standards.

```ts
import { Cip68Contract } from "@independenceee/cip68generator";

const cip68Contract: Cip68Contract = new Cip68Contract({
wallet: wallet,
fetcher: blockfrostProvider,
meshTxBuilder: meshTxBuilder,
});

const unsignedTx = await cip68Contract.mint({
assetName: "CIP68 Generator",
quantity: "1",
metadata: {
name: "CIP68 Generator",
image: "ipfs://QmRzicpReutwCkM6aotuKjErFCUD213DpwPq6ByuzMJaua",
mediaType: "image/jpg",
description: "Open source dynamic assets (Token/NFT) generator (CIP68)",
},
});

const signedTx = await wallet.signTx(unsignedTx, true);
const txHash = await wallet.submitTx(signedTx);
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@independenceee/cip68generator",
"version": "1.0.0",
"version": "1.0.1",
"description": "Open source dynamic assets (Token/NFT) generator (CIP68)",
"main": "src/index.ts",
"type": "module",
Expand Down
5 changes: 2 additions & 3 deletions tests/cip68.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
KoiosProvider,
MeshTxBuilder,
MeshWallet,
metadataToCip68,
} from "@meshsdk/core";
import { Cip68Contract } from "../src";

Expand Down Expand Up @@ -35,13 +34,13 @@ describe("Mint, Burn, Update, Remove Assets (NFT/TOKEN) CIP68", function () {
});

test("Mint", async function () {
const cip68Contract = new Cip68Contract({
const cip68Contract: Cip68Contract = new Cip68Contract({
fetcher: blockfrostProvider,
wallet: wallet,
meshTxBuilder: meshTxBuilder,
});

const unsignedTx = await cip68Contract.mint("Nguyen Duy Khanh", "1", {
const unsignedTx: string = await cip68Contract.mint("Nguyen Duy Khanh", "1", {
name: "ERC721",
image: "ipfs://QmRzicpReutwCkM6aotuKjErFCUD213DpwPq6ByuzMJaua",
mediaType: "image/jpg",
Expand Down

0 comments on commit d324f26

Please sign in to comment.