-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore-nft-mint.ts
59 lines (51 loc) · 1.5 KB
/
core-nft-mint.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
import {
createV1,
mplCore,
createCollectionV1,
pluginAuthorityPair,
ruleSet,
} from "@metaplex-foundation/mpl-core";
import {
TransactionBuilderSendAndConfirmOptions,
createSignerFromKeypair,
generateSigner,
Keypair as umiKeypair,
signerIdentity,
} from "@metaplex-foundation/umi";
import type { PublicKey as umiPublicKey } from "@metaplex-foundation/umi-public-keys";
import { Keypair as web3Keypair, Connection } from "@solana/web3.js";
// Create Main function
async function main() {
await createCollectionV1(umi, {
name: "Quick Collection",
uri: "https://your.domain.com/collection.json",
collection: collectionAddress,
updateAuthority: payer.publicKey,
plugins: [
pluginAuthorityPair({
type: "Royalties",
data: {
basisPoints: 300,
creators: [
{
address: payer.publicKey,
percentage: 100,
},
],
ruleSet: ruleSet("None"), // Compatibility rule set
},
}),
],
}).sendAndConfirm(umi, txConfig);
console.log("collection creating success");
await createV1(umi, {
name: name,
uri: uri,
asset: asset,
collection: collectionAddress.publicKey,
authority: payer,
}).sendAndConfirm(umi, txConfig);
console.log("token minting success");
}
main().catch(console.error);