repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
Mirrored from https://github.com/ProjectOpenSea/opensea-skill
stars
latest
clone command
git clone gitlawb://did:key:z6MkqRzA...RfoM/ProjectOpenSea-...git clone gitlawb://did:key:z6MkqRzA.../ProjectOpenSea-...fef93001Release v2.14.012h ago| #1 | #!/usr/bin/env bash |
| #2 | set -euo pipefail |
| #3 | |
| #4 | if [ "$#" -lt 2 ]; then |
| #5 | echo "Usage: opensea-drop-mint.sh <collection_slug> <minter_address> [quantity]" >&2 |
| #6 | echo "Returns ready-to-sign transaction data for minting tokens from a drop" >&2 |
| #7 | echo "Example: opensea-drop-mint.sh cool-cats 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 1" >&2 |
| #8 | exit 1 |
| #9 | fi |
| #10 | |
| #11 | slug="$1" |
| #12 | minter="$2" |
| #13 | quantity="${3:-1}" |
| #14 | |
| #15 | # Validate Ethereum address |
| #16 | if [[ ! "$minter" =~ ^0x[0-9a-fA-F]{40}$ ]]; then |
| #17 | echo "opensea-drop-mint.sh: minter must be a valid Ethereum address (0x + 40 hex chars)" >&2 |
| #18 | exit 1 |
| #19 | fi |
| #20 | |
| #21 | # Validate quantity is a positive integer |
| #22 | if ! [[ "$quantity" =~ ^[1-9][0-9]*$ ]]; then |
| #23 | echo "opensea-drop-mint.sh: quantity must be a positive integer" >&2 |
| #24 | exit 1 |
| #25 | fi |
| #26 | |
| #27 | body=$(cat <<EOF |
| #28 | { |
| #29 | "minter": "$minter", |
| #30 | "quantity": $quantity |
| #31 | } |
| #32 | EOF |
| #33 | ) |
| #34 | |
| #35 | "$(dirname "$0")/../opensea-post.sh" "/api/v2/drops/${slug}/mint" "$body" |
| #36 |