Skip to content

Commit

Permalink
uploaded nft image and metadata and minted it at address `5Xavp6vaHUB…
Browse files Browse the repository at this point in the history
…NQ9cq55xmz6zFVtZC29qJpfHogtsEDLkT`
  • Loading branch information
HermanCeaser committed Jan 16, 2025
1 parent b9e2228 commit 51c27cd
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 3,467 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*wallet.json
.DS_Store
.vscode
.vscode
**/*yarn-error.log
8 changes: 4 additions & 4 deletions solana-starter/ts/cluster1/nft_image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ umi.use(signerIdentity(signer));
//2. Convert image to generic file.
//3. Upload image

// const image = ???

// const [myUri] = ???
// console.log("Your image URI: ", myUri);
const imageBuffer = await readFile("./metadata/generug.png")
const image = createGenericFile(imageBuffer, "rug.png");
const [myUri] = await umi.uploader.upload([image]);
console.log("Your image URI: ", myUri);
}
catch(error) {
console.log("Oops.. Something went wrong", error);
Expand Down
42 changes: 21 additions & 21 deletions solana-starter/ts/cluster1/nft_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ umi.use(signerIdentity(signer));
// Follow this JSON structure
// https://docs.metaplex.com/programs/token-metadata/changelog/v1.0#json-structure

// const image = ???
// const metadata = {
// name: "?",
// symbol: "?",
// description: "?",
// image: "?",
// attributes: [
// {trait_type: '?', value: '?'}
// ],
// properties: {
// files: [
// {
// type: "image/png",
// uri: "?"
// },
// ]
// },
// creators: []
// };
// const myUri = ???
// console.log("Your metadata URI: ", myUri);
const image = createGenericFile(
"https://arweave.net/4DEqKqfMU1Q48AUuiCaNsQmY2NwYBMrn1d2imBhQR6Sz", "Cool Rug"
);
const metadata = {
name: "Cool Rug",
symbol: "CRG",
description: "A Super Beautiful RUG",
image: image,
attributes: [{ trait_type: "NFT", value: "RUG" }],
properties: {
files: [
{
type: "image/png",
uri: "https://arweave.net/4DEqKqfMU1Q48AUuiCaNsQmY2NwYBMrn1d2imBhQR6Sz",
},
],
},
creators: [],
};
const myUri = await umi.uploader.uploadJson(metadata)
console.log("Your metadata URI: ", myUri);
}
catch(error) {
console.log("Oops.. Something went wrong", error);
Expand Down
22 changes: 18 additions & 4 deletions solana-starter/ts/cluster1/nft_mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,25 @@ umi.use(mplTokenMetadata())
const mint = generateSigner(umi);

(async () => {
// let tx = ???
// let result = await tx.sendAndConfirm(umi);
// const signature = base58.encode(result.signature);
let tx = await createNft(umi, {
mint,
name: "Cool Rug",
symbol: "CRG",
uri: "https://arweave.net/9dUxmVbT2ud4wwC3m1ZVZxLkqghFLrBSD8oABfE4y5ai",
sellerFeeBasisPoints: percentAmount(10, 2),
creators: [
{
address: myKeypairSigner.publicKey,
share: 100,
verified: true,
},
],
isMutable: true,
});
let result = await tx.sendAndConfirm(umi);
const signature = base58.encode(result.signature);

// console.log(`Succesfully Minted! Check out your TX here:\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`)
console.log(`Succesfully Minted! Check out your TX here:\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`)

console.log("Mint Address: ", mint.publicKey);
})();
Binary file added solana-starter/ts/metadata/generug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 51c27cd

Please sign in to comment.