From 68bb26d64d48b9382238be8dce3e757c38874251 Mon Sep 17 00:00:00 2001 From: drbh Date: Sun, 19 Sep 2021 10:44:16 -0400 Subject: [PATCH 1/4] Fix/osx cli build issue (#433) * remove --no-bytecode flag from osx build * remove accidental trailing space --- js/packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/packages/cli/package.json b/js/packages/cli/package.json index ce4f576..6e5e3f7 100644 --- a/js/packages/cli/package.json +++ b/js/packages/cli/package.json @@ -11,7 +11,7 @@ "watch": "tsc -w -p ./src", "package:linux": "pkg . --no-bytecode --targets node14-linux-x64 --output bin/linux/metaplex", "package:linuxb": "pkg . --targets node14-linux-x64 --output bin/linux/metaplex", - "package:macos": "pkg . --no-bytecode --targets node14-macos-x64 --output bin/macos/metaplex", + "package:macos": "pkg . --targets node14-macos-x64 --output bin/macos/metaplex", "format": "prettier --loglevel warn --write \"**/*.{ts,js,json,yaml}\"", "format:check": "prettier --loglevel warn --check \"**/*.{ts,js,json,yaml}\"", "lint": "eslint \"src/**/*.ts\" --fix", From 1bf4c7fff57df42279c7faccbfdab51e3c0bc70a Mon Sep 17 00:00:00 2001 From: Richard Fisher Date: Sun, 19 Sep 2021 22:46:04 +0800 Subject: [PATCH 2/4] Allow override of sol wallet address (#431) * Allow specifying a different sol wallet address to receive mint funds * remove debug logging --- js/packages/cli/src/cli.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/js/packages/cli/src/cli.ts b/js/packages/cli/src/cli.ts index 1e25cab..c4e7ec3 100755 --- a/js/packages/cli/src/cli.ts +++ b/js/packages/cli/src/cli.ts @@ -35,7 +35,7 @@ programCommand('upload') ) .option('-n, --number ', 'Number of images to upload') .action(async (files: string[], options, cmd) => { - const {number, keypair, env, cacheName} = cmd.opts(); + const { number, keypair, env, cacheName } = cmd.opts(); const pngFileCount = files.filter(it => { return it.endsWith(EXTENSION_PNG); @@ -193,9 +193,10 @@ programCommand('verify_price') programCommand('create_candy_machine') .option('-p, --price ', 'Price denominated in SOL or spl-token override', '1') .option('-t, --spl-token ', 'SPL token used to price NFT mint. To use SOL leave this empty.') - .option('-t, --spl-token-account ', 'SPL token account that receives mint payments. Only required if spl-token is specified.') + .option('-a, --spl-token-account ', 'SPL token account that receives mint payments. Only required if spl-token is specified.') + .option('-s, --sol-treasury-account ', 'SOL account that receives mint payments.') .action(async (directory, cmd) => { - const { keypair, env, price, cacheName, splToken, splTokenAccount } = cmd.opts(); + const { keypair, env, price, cacheName, splToken, splTokenAccount, solTreasuryAccount } = cmd.opts(); let parsedPrice = parsePrice(price); const cacheContent = loadCache(cacheName, env); @@ -206,6 +207,9 @@ programCommand('create_candy_machine') let wallet = walletKeyPair.publicKey; const remainingAccounts = []; if (splToken || splTokenAccount) { + if (solTreasuryAccount) { + throw new Error("If spl-token-account or spl-token is set then sol-treasury-account cannot be set") + } if (!splToken) { throw new Error("If spl-token-account is set, spl-token must also be set") } @@ -239,6 +243,11 @@ programCommand('create_candy_machine') remainingAccounts.push({ pubkey: splTokenKey, isWritable: false, isSigner: false }); } + if (solTreasuryAccount) { + const solAccountKey = new PublicKey(solTreasuryAccount); + wallet = solAccountKey; + } + const config = new PublicKey(cacheContent.program.config); const [candyMachine, bump] = await getCandyMachineAddress( config, @@ -306,11 +315,11 @@ programCommand('update_candy_machine') programCommand('mint_one_token') .option('-t, --spl-token-account ', 'SPL token account to payfrom') .action(async (directory, cmd) => { - const {keypair, env, cacheName, splTokenAccount} = cmd.opts(); + const { keypair, env, cacheName, splTokenAccount } = cmd.opts(); const cacheContent = loadCache(cacheName, env); const configAddress = new PublicKey(cacheContent.program.config); - const splTokenAccountKey = splTokenAccount ? new PublicKey(splTokenAccount) : undefined; + const splTokenAccountKey = splTokenAccount ? new PublicKey(splTokenAccount) : undefined; const tx = await mint(keypair, env, configAddress, splTokenAccountKey); log.info('Done', tx); @@ -370,7 +379,7 @@ programCommand("sign_candy_machine_metadata") const config = new PublicKey(cacheContent.program.config); const [candyMachine, bump] = await getCandyMachineAddress( config, - cacheContent.program.uuid, + cacheContent.program.uuid, ); candyAddress = candyMachine.toBase58(); } From 633d3668c72023695a83dd15f83b45d44416f787 Mon Sep 17 00:00:00 2001 From: Slavomir Date: Sun, 19 Sep 2021 17:47:27 +0300 Subject: [PATCH 3/4] Improve doc comments (#436) * token-metadata: fix doc formatting for SignMetadata instruction. * auction: add doc to `SetAuthority` instruction. Deduced from `pub fn set_authority_instruction` See https://github.com/metaplex-foundation/metaplex/blob/09d323accd8c494454c5b94fc18ef04a71212e74/rust/auction/program/src/instruction.rs#L115 * Remove newline * Improve comment --- rust/auction/program/src/instruction.rs | 3 +++ rust/token-metadata/program/src/instruction.rs | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/auction/program/src/instruction.rs b/rust/auction/program/src/instruction.rs index f9d599a..6124c08 100644 --- a/rust/auction/program/src/instruction.rs +++ b/rust/auction/program/src/instruction.rs @@ -56,6 +56,9 @@ pub enum AuctionInstruction { StartAuction(StartAuctionArgs), /// Update the authority for an auction account. + /// 0. `[writable]` auction (pda of ['auction', program id, resource id]) + /// 1. `[signer]` authority + /// 2. `[]` newAuthority SetAuthority, /// Place a bid on a running auction. diff --git a/rust/token-metadata/program/src/instruction.rs b/rust/token-metadata/program/src/instruction.rs index e69680e..cc7ef7d 100644 --- a/rust/token-metadata/program/src/instruction.rs +++ b/rust/token-metadata/program/src/instruction.rs @@ -144,8 +144,7 @@ pub enum MetadataInstruction { /// 7. `[]` Rent info DeprecatedCreateReservationList, - // Sign a piece of metadata that has you as an unverified creator so that it is now verified. - // + /// Sign a piece of metadata that has you as an unverified creator so that it is now verified. /// 0. `[writable]` Metadata (pda of ['metadata', program id, mint id]) /// 1. `[signer]` Creator SignMetadata, From f2dbf6f8faac7952add9467c48575a0d946846b3 Mon Sep 17 00:00:00 2001 From: Bertrand Date: Sun, 19 Sep 2021 17:01:18 +0200 Subject: [PATCH 4/4] update README (#410) --- js/packages/cli/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/packages/cli/README.md b/js/packages/cli/README.md index a419665..d91c3c8 100644 --- a/js/packages/cli/README.md +++ b/js/packages/cli/README.md @@ -91,10 +91,10 @@ metaplex create_candy_machine -k ~/.config/solana/id.json -p 1 ts-node cli create_candy_machine -k ~/.config/solana/id.json -p 3 ``` -4. Set the start date for your candy machine. +4. Set the start date and update the price of your candy machine. ``` -metaplex set_start_date -k ~/.config/solana/id.json -d "20 Apr 2021 04:20:00 GMT" -ts-node cli set_start_date -k ~/.config/solana/id.json -d "20 Apr 2021 04:20:00 GMT" +metaplex update_candy_machine -k ~/.config/solana/id.json -d "20 Apr 2021 04:20:00 GMT" -p 0.1 +ts-node cli update_candy_machine -k ~/.config/solana/id.json -d "20 Apr 2021 04:20:00 GMT" -p 0.1 ``` 5. Test mint a token (provided it's after the start date)