diff --git a/clients/cli/commands/create/shards.ts b/clients/cli/commands/create/shards.ts index 3e7a07a..3619339 100644 --- a/clients/cli/commands/create/shards.ts +++ b/clients/cli/commands/create/shards.ts @@ -1,13 +1,13 @@ import { createUmi } from "@metaplex-foundation/umi-bundle-defaults"; -import { loadWalletKey } from "../../utils"; -import { MplInscription, createShard, findInscriptionShardPda, safeFetchInscriptionShard } from "@metaplex-foundation/mpl-inscription"; +import { loadWalletKey } from "../../utils.js"; +import { mplInscription, createShard, findInscriptionShardPda, safeFetchInscriptionShard } from "@metaplex-foundation/mpl-inscription"; export async function create_shards(str: any, options: any) { const { rpc, keypair } = options.opts(); let umi = createUmi(rpc); umi = loadWalletKey(umi, keypair); - umi.use(MplInscription()); + umi.use(mplInscription()); for (let shardNumber = 0; shardNumber < 32; shardNumber++) { const shardAccount = findInscriptionShardPda(umi, { shardNumber }); diff --git a/clients/cli/commands/inscribe/nft.ts b/clients/cli/commands/inscribe/nft.ts index 06bae40..20a37cd 100644 --- a/clients/cli/commands/inscribe/nft.ts +++ b/clients/cli/commands/inscribe/nft.ts @@ -1,7 +1,7 @@ import { fetchDigitalAsset, mplTokenMetadata } from "@metaplex-foundation/mpl-token-metadata"; import { createUmi } from "@metaplex-foundation/umi-bundle-defaults"; import { accountExists, accountValid, inscribe, loadWalletKey } from "../../utils.js"; -import { MplInscription, findAssociatedInscriptionPda, findInscriptionMetadataPda, findMintInscriptionPda, initializeAssociatedInscription, initializeFromMint } from "@metaplex-foundation/mpl-inscription"; +import { mplInscription, findAssociatedInscriptionPda, findInscriptionMetadataPda, findMintInscriptionPda, initializeAssociatedInscription, initializeFromMint } from "@metaplex-foundation/mpl-inscription"; import { PublicKey } from "@metaplex-foundation/umi"; import pMap from "p-map"; @@ -10,7 +10,7 @@ const INSCRIPTION_GATEWAY: string = 'https://igw.metaplex.com/'; export async function inscribe_nfts(rpc: string, keypair: string, mints: PublicKey[], concurrency: number) { let umi = createUmi(rpc); umi = loadWalletKey(umi, keypair); - umi.use(MplInscription()); + umi.use(mplInscription()); umi.use(mplTokenMetadata()); const network = umi.rpc.getCluster().toString().replace('-beta', ''); @@ -83,6 +83,9 @@ export async function inscribe_nfts(rpc: string, keypair: string, mints: PublicK console.log(`Initializing ${mediaBytes.length} Inscription Image Accounts...`); const associatedInscriptionAccounts = await pMap(inscriptionMetadataAccounts, async (inscriptionMetadataAccount, i) => { + const mintInscriptionAccount = findMintInscriptionPda(umi, { + mint: nfts[i].mint.publicKey + }); const associatedInscriptionAccount = findAssociatedInscriptionPda(umi, { associated_tag: 'image', inscriptionMetadataAccount, @@ -90,7 +93,7 @@ export async function inscribe_nfts(rpc: string, keypair: string, mints: PublicK if (!await accountExists(umi, associatedInscriptionAccount[0])) { await initializeAssociatedInscription(umi, { - inscriptionMetadataAccount, + inscriptionAccount: mintInscriptionAccount[0], associationTag: 'image' }).sendAndConfirm(umi, { confirm: { commitment: 'finalized' } }); } diff --git a/clients/cli/package.json b/clients/cli/package.json index e42976d..bcedd28 100644 --- a/clients/cli/package.json +++ b/clients/cli/package.json @@ -17,7 +17,7 @@ "license": "ISC", "dependencies": { "@metaplex-foundation/digital-asset-standard-api": "^1.0.0", - "@metaplex-foundation/mpl-inscription": "^0.5.2", + "@metaplex-foundation/mpl-inscription": "^0.8.0", "@metaplex-foundation/mpl-token-metadata": "^3.1.2", "@metaplex-foundation/umi": "^0.8.10", "@metaplex-foundation/umi-bundle-defaults": "^0.8.10", @@ -42,4 +42,4 @@ "tsx": "^4.7.0", "typescript": "^5.3.3" } -} +} \ No newline at end of file diff --git a/clients/cli/pnpm-lock.yaml b/clients/cli/pnpm-lock.yaml index eb8ff88..c523337 100644 --- a/clients/cli/pnpm-lock.yaml +++ b/clients/cli/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^1.0.0 version: 1.0.0(@metaplex-foundation/umi@0.8.10) '@metaplex-foundation/mpl-inscription': - specifier: ^0.5.2 - version: 0.5.2(@metaplex-foundation/umi@0.8.10) + specifier: ^0.8.0 + version: 0.8.0(@metaplex-foundation/umi@0.8.10) '@metaplex-foundation/mpl-token-metadata': specifier: ^3.1.2 version: 3.1.2(@metaplex-foundation/umi@0.8.10) @@ -651,8 +651,8 @@ packages: '@metaplex-foundation/umi': 0.8.10 dev: false - /@metaplex-foundation/mpl-inscription@0.5.2(@metaplex-foundation/umi@0.8.10): - resolution: {integrity: sha512-Sb6OuT+EUGp1XK4pGSm81Zfns8JRe+rakmEqNGGDC+1ph7gDhZivEoIJ4hhqCTlT2j0ssNPOEDHq7oUvMcTZUA==} + /@metaplex-foundation/mpl-inscription@0.8.0(@metaplex-foundation/umi@0.8.10): + resolution: {integrity: sha512-F/xxtPghGrUEzJr1j3AAdMcHgzQIRr+8F9899EhLtrGio+9hHtsyEFnzzXb4z2y541MXFLOY2Vg4+gGicqHR0Q==} peerDependencies: '@metaplex-foundation/umi': ^0.8.2 dependencies: diff --git a/clients/js/README.md b/clients/js/README.md index cf69116..8101129 100644 --- a/clients/js/README.md +++ b/clients/js/README.md @@ -11,8 +11,8 @@ A Umi-compatible JavaScript library for the project. ``` 2. Finally, register the library with your Umi instance like so. ```ts - import { MplInscription } from '@metaplex-foundation/mpl-inscription'; - umi.use(MplInscription()); + import { mplInscription } from '@metaplex-foundation/mpl-inscription'; + umi.use(mplInscription()); ``` 3. Inscribe any binary data on chain