Merge branch 'metaplex-foundation:master' into master

This commit is contained in:
stegaBOB 2021-09-19 23:52:20 -04:00 committed by GitHub
commit 3fdb859243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 12 deletions

View File

@ -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)

View File

@ -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",

View File

@ -35,7 +35,7 @@ programCommand('upload')
)
.option('-n, --number <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 <string>', 'Price denominated in SOL or spl-token override', '1')
.option('-t, --spl-token <string>', 'SPL token used to price NFT mint. To use SOL leave this empty.')
.option('-t, --spl-token-account <string>', 'SPL token account that receives mint payments. Only required if spl-token is specified.')
.option('-a, --spl-token-account <string>', 'SPL token account that receives mint payments. Only required if spl-token is specified.')
.option('-s, --sol-treasury-account <string>', '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 <string>', '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();
}

View File

@ -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.

View File

@ -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,