Skip to content

Commit

Permalink
merge main into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelvanderwaal committed Dec 28, 2023
2 parents 944cfda + ea4fcc6 commit 4a34ee7
Show file tree
Hide file tree
Showing 44 changed files with 802 additions and 202 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 6 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metaboss"
version = "0.32.1"
version = "0.34.0"
edition = "2021"
description = "The Metaplex NFT-standard Swiss Army Knife tool."
repository = "https://github.com/samuelvanderwaal/metaboss"
Expand All @@ -14,20 +14,23 @@ borsh = "0.10.3"
bs58 = "0.4.0"
chrono = "0.4.31"
console = "0.15.7"
dirs = "5.0.1"
env_logger = "0.9.3"
futures = "0.3.29"
glob = "0.3.1"
indexmap = { version = "1.9.3", features = ["serde"] }
indicatif = { version = "0.16.2", features = ["rayon"] }
jib = "0.4.1"
jib = "0.5.0"
lazy_static = "1.4.0"
log = "0.4.20"
metaboss_lib = "0.16.1"
metaboss_lib = "0.17.0"
mpl-token-metadata = { version = "3.2.3", features = ["serde"] }
num_cpus = "1.16.0"
once_cell = "1.19.0"
phf = { version = "0.10", features = ["macros"] }
ratelimit = "0.4.4"
rayon = "1.8.0"
regex = "1.10.2"
reqwest = { version = "0.11.23", features = ["json"] }
retry = "1.3.1"
serde = { version = "1.0.193", features = ["derive"] }
Expand All @@ -44,11 +47,3 @@ spl-token = "3.5.0"
structopt = "0.3.26"
thiserror = "1.0.51"
tokio = "1.35.1"
regex = "1.10.2"
once_cell = "1.19.0"
dirs = "5.0.1"

[features]

[dev-dependencies]
regex = "1.10.2"
40 changes: 37 additions & 3 deletions docs-src/src/airdrop.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Airdrop

This is an experimental feature that uses the TPU client to rapidly and efficiently make transfers. It relies on the [Jib library](https://github.com/samuelvanderwaal/jib) for transmitting instructiosn via TPU. You should carefully test it on devnet prior to running it on mainnet.
This is an experimental feature that uses the TPU client to rapidly and efficiently make transfers. It relies on the [Jib library](https://github.com/samuelvanderwaal/jib) for transmitting instructions via TPU. **You should carefully test it on devnet prior to running it on mainnet.**

The benefit of using the TPU client is that is can rapidly transmit the transactions directly to the consensus leader and the command does not require a high-throughput private RPC node and can use the public ones by default as the RPC node is only used for determining the current leader.
The benefit of using the TPU client is that is can rapidly transmit the transactions directly to the consensus leader and the command does not require a high-throughput private RPC node and can use the public ones by default, as the RPC node is only used for determining the current leader.

### Airdrop SOL

Expand Down Expand Up @@ -60,4 +60,38 @@ To re-run failed transactions run the command with the cache file instead of the
metaboss airdrop sol -c <PATH_TO_CACHE_FILE> -n devnet
```

If transactions continuously fail you should look at the errors in the cache file and determine the cause.
If transactions continuously fail you should look at the errors in the cache file and determine the cause.

### Airdrop SPL Tokens

Airdrop SPL tokens to a list of accounts.

```bash
Airdrop SPL tokens

USAGE:
metaboss airdrop spl [FLAGS] [OPTIONS] --mint <mint>

FLAGS:
--boost Boost the transactions w/ priority fees
-h, --help Prints help information
--mint-tokens
-V, --version Prints version information

OPTIONS:
-c, --cache-file <cache-file> Cache file
-k, --keypair <keypair> Path to the owner keypair file
-l, --log-level <log-level> Log level [default: off]
-m, --mint <mint> Mint from the SPL token mint
-n, --network <network> Network cluster to use, defaults to devnet [default: devnet]
-L, --recipient-list <recipient-list> Path to the mint list file
-r, --rpc <rpc> RPC endpoint url to override using the Solana config or the hard-coded
default
-T, --timeout <timeout> Timeout to override default value of 90 seconds [default: 90]
```

This command works similarly to the SOL airdrop command, but expects the amount to be in the display units of the SPL token. E.g. for a token with three decimal places the amount of 10 will be converted to 10,000 base units behind the scenes.

Be aware that airdropping SPL tokens to wallets that do not already have a token account for that mint will cost 0.002 SOL per transaction. This is because the token account needs to be created first. This could end up being a significant cost if you are airdropping to a large number of wallets.

For large SPL token airdrops you may want to consider setting up a claim site instead.
10 changes: 10 additions & 0 deletions docs-src/src/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ Use the `--initial-suply` option to mint the specified amount directly to your k
metaboss create fungible -d 3 -m crab.json --initial-supply 10.1
```

#### Vanity Mints

You can specify a vanity mint address by using the `--mint-path` option to specify a path to a keypair on your file system.
It will use this for the mint account instead of creating a new one.

```bash
metaboss create fungible -d <decimals> -m <metadata_file> --mint-path <path_to_keypair>
```


### Metadata

Decorate an existing SPL token mint with metadata.
Expand Down
16 changes: 14 additions & 2 deletions docs-src/src/mint.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ If `receiver` is set, the NFT will be minted directly to the receiver's address,

Use the `--sign` option to sign the metadata with the keypair immediately after minting.

#### Vanity Mints

You can specify a vanity mint address by using the `--mint-path` option to specify a path to a keypair on your file system.
It will use this for the mint account instead of creating a new one.

#### Editions

To mint a NFT with the ability to print editions from it use the `--max-editions <max-editions>` option. This defaults to `0` meaning no editions are allowed. Setting it to a positive integer means you can print up to that many editions. Setting to a value of `-1` means unlimited editions. Because of how the CLI interprets the `-` symbol to set max editions to infinite you should use the `=` sign for the `--max-editions` option: `metaboss mint one -a <master_account> --max-editions='-1'`.
Expand Down Expand Up @@ -98,12 +103,15 @@ OPTIONS:
Amount of tokens to mint, for NonFungible types this must be 1 [default: 1]
-d, --asset-data <asset-data> Asset data
--decimals <decimals> Mint decimals for fungible tokens
--decimals <decimals> Mint decimals for fungible tokens [default: 0]
-k, --keypair <keypair> Path to the update_authority keypair file
-l, --log-level <log-level> Log level [default: off]
-s, --max-print-edition-supply <max-print-edition-supply>
Max supply of print editions. Only applies to NonFungible types. 0 for no prints, n for n prints,
'unlimited' for unlimited prints
-m, --mint-path <mint-path>
Path to mint keypair file, if minting from existing keypair
-R, --receiver <receiver> Receiving address, if different from update authority
-r, --rpc <rpc>
RPC endpoint url to override using the Solana config or the hard-coded default
Expand Down Expand Up @@ -141,7 +149,6 @@ You need an asset json file of this format:

Substitute appropriate values for each field. The creator can only be set as verified if it is the same keypair as the one used to mint the asset, otherwise leave it as `false`.


```bash
metaboss mint asset -d <asset_json_file> -k <keypair> -R <receiver> -s <print_supply>
```
Expand All @@ -159,3 +166,8 @@ Leave off the `--receiver` option to mint to your keypair.
All non-fungible type assets: currently `NonFungible` and `ProgrammableNonFungible`, require the `print-supply` option to be specified to set the maximum number of print editions that can be minted from the asset. For most PFP, 1/1, style NFTs, this should be set to `0` to prevent any editions being minted. Other options are: `n` for a limited number of `n` editions (e.g. `10`), or `unlimited` to allow unlimited editions to be minted.

Fungible types such as `Fungible` and `FungibleAsset` should leave this value off as it has no meaning for them and the `mint asset` command will fail if that is specified for a fungible type.

#### Vanity Mints

You can specify a vanity mint address by using the `--mint-path` option to specify a path to a keypair on your file system.
It will use this for the mint account instead of creating a new one.
4 changes: 3 additions & 1 deletion docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="overview.html"><strong aria-hidden="true">1.</strong> Overview</a></li><li class="chapter-item expanded "><a href="quick_start.html"><strong aria-hidden="true">2.</strong> Quick Start</a></li><li class="chapter-item expanded "><a href="installation.html"><strong aria-hidden="true">3.</strong> Installation</a></li><li class="chapter-item expanded "><a href="examples.html"><strong aria-hidden="true">4.</strong> Examples</a></li><li class="chapter-item expanded "><a href="recipes.html"><strong aria-hidden="true">5.</strong> Recipes</a></li><li class="chapter-item expanded "><a href="global_options.html"><strong aria-hidden="true">6.</strong> Global Options</a></li><li class="chapter-item expanded "><a href="airdrop.html"><strong aria-hidden="true">7.</strong> Airdrop</a></li><li class="chapter-item expanded "><a href="burn.html"><strong aria-hidden="true">8.</strong> Burn</a></li><li class="chapter-item expanded "><a href="check.html"><strong aria-hidden="true">9.</strong> Check</a></li><li class="chapter-item expanded "><a href="collections.html"><strong aria-hidden="true">10.</strong> Collections</a></li><li class="chapter-item expanded "><a href="create.html"><strong aria-hidden="true">11.</strong> Create</a></li><li class="chapter-item expanded "><a href="decode.html"><strong aria-hidden="true">12.</strong> Decode</a></li><li class="chapter-item expanded "><a href="derive.html"><strong aria-hidden="true">13.</strong> Derive</a></li><li class="chapter-item expanded "><a href="find.html"><strong aria-hidden="true">14.</strong> Find</a></li><li class="chapter-item expanded "><a href="mint.html"><strong aria-hidden="true">15.</strong> Mint</a></li><li class="chapter-item expanded "><a href="set.html"><strong aria-hidden="true">16.</strong> Set</a></li><li class="chapter-item expanded "><a href="sign.html"><strong aria-hidden="true">17.</strong> Sign</a></li><li class="chapter-item expanded "><a href="snapshot.html"><strong aria-hidden="true">18.</strong> Snapshot</a></li><li class="chapter-item expanded "><a href="transfer.html"><strong aria-hidden="true">19.</strong> Transfer</a></li><li class="chapter-item expanded "><a href="update.html"><strong aria-hidden="true">20.</strong> Update</a></li><li class="chapter-item expanded "><a href="verify_unverify.html"><strong aria-hidden="true">21.</strong> Verify/Unverify</a></li><li class="chapter-item expanded "><a href="withdraw.html"><strong aria-hidden="true">22.</strong> Withdraw</a></li><li class="chapter-item expanded "><a href="contact.html"><strong aria-hidden="true">23.</strong> Contact</a></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
Expand Down
35 changes: 32 additions & 3 deletions docs/airdrop.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="overview.html"><strong aria-hidden="true">1.</strong> Overview</a></li><li class="chapter-item expanded "><a href="quick_start.html"><strong aria-hidden="true">2.</strong> Quick Start</a></li><li class="chapter-item expanded "><a href="installation.html"><strong aria-hidden="true">3.</strong> Installation</a></li><li class="chapter-item expanded "><a href="examples.html"><strong aria-hidden="true">4.</strong> Examples</a></li><li class="chapter-item expanded "><a href="recipes.html"><strong aria-hidden="true">5.</strong> Recipes</a></li><li class="chapter-item expanded "><a href="global_options.html"><strong aria-hidden="true">6.</strong> Global Options</a></li><li class="chapter-item expanded "><a href="airdrop.html" class="active"><strong aria-hidden="true">7.</strong> Airdrop</a></li><li class="chapter-item expanded "><a href="burn.html"><strong aria-hidden="true">8.</strong> Burn</a></li><li class="chapter-item expanded "><a href="check.html"><strong aria-hidden="true">9.</strong> Check</a></li><li class="chapter-item expanded "><a href="collections.html"><strong aria-hidden="true">10.</strong> Collections</a></li><li class="chapter-item expanded "><a href="create.html"><strong aria-hidden="true">11.</strong> Create</a></li><li class="chapter-item expanded "><a href="decode.html"><strong aria-hidden="true">12.</strong> Decode</a></li><li class="chapter-item expanded "><a href="derive.html"><strong aria-hidden="true">13.</strong> Derive</a></li><li class="chapter-item expanded "><a href="find.html"><strong aria-hidden="true">14.</strong> Find</a></li><li class="chapter-item expanded "><a href="mint.html"><strong aria-hidden="true">15.</strong> Mint</a></li><li class="chapter-item expanded "><a href="set.html"><strong aria-hidden="true">16.</strong> Set</a></li><li class="chapter-item expanded "><a href="sign.html"><strong aria-hidden="true">17.</strong> Sign</a></li><li class="chapter-item expanded "><a href="snapshot.html"><strong aria-hidden="true">18.</strong> Snapshot</a></li><li class="chapter-item expanded "><a href="transfer.html"><strong aria-hidden="true">19.</strong> Transfer</a></li><li class="chapter-item expanded "><a href="update.html"><strong aria-hidden="true">20.</strong> Update</a></li><li class="chapter-item expanded "><a href="verify_unverify.html"><strong aria-hidden="true">21.</strong> Verify/Unverify</a></li><li class="chapter-item expanded "><a href="withdraw.html"><strong aria-hidden="true">22.</strong> Withdraw</a></li><li class="chapter-item expanded "><a href="contact.html"><strong aria-hidden="true">23.</strong> Contact</a></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
Expand Down Expand Up @@ -172,8 +174,8 @@ <h1 class="menu-title">Metaboss</h1>
<div id="content" class="content">
<main>
<h2 id="airdrop"><a class="header" href="#airdrop">Airdrop</a></h2>
<p>This is an experimental feature that uses the TPU client to rapidly and efficiently make transfers. It relies on the <a href="https://github.com/samuelvanderwaal/jib">Jib library</a> for transmitting instructiosn via TPU. You should carefully test it on devnet prior to running it on mainnet.</p>
<p>The benefit of using the TPU client is that is can rapidly transmit the transactions directly to the consensus leader and the command does not require a high-throughput private RPC node and can use the public ones by default as the RPC node is only used for determining the current leader.</p>
<p>This is an experimental feature that uses the TPU client to rapidly and efficiently make transfers. It relies on the <a href="https://github.com/samuelvanderwaal/jib">Jib library</a> for transmitting instructions via TPU. <strong>You should carefully test it on devnet prior to running it on mainnet.</strong></p>
<p>The benefit of using the TPU client is that is can rapidly transmit the transactions directly to the consensus leader and the command does not require a high-throughput private RPC node and can use the public ones by default, as the RPC node is only used for determining the current leader.</p>
<h3 id="airdrop-sol"><a class="header" href="#airdrop-sol">Airdrop SOL</a></h3>
<p>Airdrop SOL to a list of accounts. </p>
<pre><code>Airdrop SOL
Expand Down Expand Up @@ -213,6 +215,33 @@ <h4 id="usage"><a class="header" href="#usage">Usage</a></h4>
<pre><code class="language-bash">metaboss airdrop sol -c &lt;PATH_TO_CACHE_FILE&gt; -n devnet
</code></pre>
<p>If transactions continuously fail you should look at the errors in the cache file and determine the cause.</p>
<h3 id="airdrop-spl-tokens"><a class="header" href="#airdrop-spl-tokens">Airdrop SPL Tokens</a></h3>
<p>Airdrop SPL tokens to a list of accounts.</p>
<pre><code class="language-bash">Airdrop SPL tokens

USAGE:
metaboss airdrop spl [FLAGS] [OPTIONS] --mint &lt;mint&gt;

FLAGS:
--boost Boost the transactions w/ priority fees
-h, --help Prints help information
--mint-tokens
-V, --version Prints version information

OPTIONS:
-c, --cache-file &lt;cache-file&gt; Cache file
-k, --keypair &lt;keypair&gt; Path to the owner keypair file
-l, --log-level &lt;log-level&gt; Log level [default: off]
-m, --mint &lt;mint&gt; Mint from the SPL token mint
-n, --network &lt;network&gt; Network cluster to use, defaults to devnet [default: devnet]
-L, --recipient-list &lt;recipient-list&gt; Path to the mint list file
-r, --rpc &lt;rpc&gt; RPC endpoint url to override using the Solana config or the hard-coded
default
-T, --timeout &lt;timeout&gt; Timeout to override default value of 90 seconds [default: 90]
</code></pre>
<p>This command works similarly to the SOL airdrop command, but expects the amount to be in the display units of the SPL token. E.g. for a token with three decimal places the amount of 10 will be converted to 10,000 base units behind the scenes.</p>
<p>Be aware that airdropping SPL tokens to wallets that do not already have a token account for that mint will cost 0.002 SOL per transaction. This is because the token account needs to be created first. This could end up being a significant cost if you are airdropping to a large number of wallets. </p>
<p>For large SPL token airdrops you may want to consider setting up a claim site instead.</p>

</main>

Expand Down
Loading

0 comments on commit 4a34ee7

Please sign in to comment.