Skip to content

Instantly share code, notes, and snippets.

const magicEdenURL = "https://api-mainnet.magiceden.io/rpc/getListedNFTsByQuery?q=%7B%22%24match%22%3A%7B%22collectionSymbol%22%3A%22essence_by_enigma_expanses%22%7D%2C%22%24sort%22%3A%7B%22takerAmount%22%3A1%2C%22createdAt%22%3A-1%7D%2C%22%24skip%22%3A0%2C%22%24limit%22%3A10%7D";
const exchangeURL = "https://api.exchange.art/v1/public/tokens?limit=10&sort=price-asc&from=0&filters=%7B%22tokenListingTypes%22:%5B%22listed%22,%22unlisted%22%5D,%22collections%22:%5B%22Essence%22%5D%7D&view=collection";
var XMLHttpRequest = require('xhr2');
function floorPiecesMagicEden() {
var http = new XMLHttpRequest();
http.open("GET", magicEdenURL);
http.send();
http.onreadystatechange = (e) => {
@dtmrc
dtmrc / sales-bot.js
Created December 14, 2021 22:16 — forked from mertimus/sales-bot.js
Solana NFT bot
const solanaWeb3 = require('@solana/web3.js');
const { Connection, programs } = require('@metaplex/js')
const axios = require('axios');
// Check if the env variables have been set
if(!process.env.PROJECT_ADDRESS || !process.env.DISCORD_URL) {
console.log("Please set your environment variables!")
return;
}
@dtmrc
dtmrc / esm-package.md
Created December 11, 2021 22:20 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@dtmrc
dtmrc / fake_exiled.py
Created October 26, 2021 07:30
Generates a transaction to modify metadata on an exiled ape (clone a known mythic)
import json
from solana.account import Account
from solana.rpc.api import Client
from solana.transaction import Transaction
from metaplex.transactions import update_metadata_instruction
from metaplex.metadata import (
get_metadata,
update_metadata_instruction_data
)
cellvibr.io
pelobact.er
shewane.la
myxococc.us
stigmate.la
cystobact.er
nannocyst.is
vitreosci.la
lysobact.er
simonsie.la
@dtmrc
dtmrc / MetaplexDisplay.md
Created October 26, 2021 07:23
Steps for Metaplex NFT Display

So you want to display a Metaplex NFT

This guide will attempt to give an overview of the technical/coding steps that are required to render a Metaplex NFT with any programming language/platform. I'll attempt to write it a programming language-agnostic manner; you'll need to fill in the particular methods of performing the steps with your coding language of choice.

For the purposes of discussion, we'll call the Solana account that holds the Metaplex NFTs the "NFT-Account."

Step 1: Call getTokenAccountsByOwner

The first thing you need to do is call the getTokenAccountsByOwner JSON RPC method as documented here:

@dtmrc
dtmrc / index.ts
Created October 13, 2021 02:47 — forked from dvcrn/index.ts
get metadata from metaplex
import * as web3 from "@solana/web3.js";
import * as metadata from "./metadata"; // see metadata.ts
const tokenAddress = new web3.PublicKey(
"CxkKDaBvtHqg8aHBVY8E4YYBsCfJkJVsTAEdTo5k4SEw"
);
(async () => {
// Connect to cluster
var connection = new web3.Connection(
@dtmrc
dtmrc / index.js
Created October 9, 2021 00:26 — forked from fukaoi/memo-exmaple.js
solana-program-library-memo
const Web3 = ({
Account,
Transaction,
TransactionInstruction,
PublicKey,
Connection,
} = require("@solana/web3.js"));
const testMemo = (conn, account) => {
const instruction = new TransactionInstruction({
@dtmrc
dtmrc / Solana
Created October 8, 2021 01:27 — forked from hoakbuilds/Solana
Solana dev resources
Guides / Walkthroughs
Intro to Programming on Solana
https://paulx.dev/blog/2021/01/14/programming-on-solana-an-introduction/
Development Tutorial by Solong
https://solongwallet.medium.com/solana-development-tutorial-things-you-should-know-before-structuring-your-code-807f0e2ee43
Intro to Anchor Framework
https://project-serum.github.io/anchor/getting-started/introduction.html
@dtmrc
dtmrc / CANDYMACHINE.md
Created October 8, 2021 01:27 — forked from grahamplata/CANDYMACHINE.md
A guide for myself for setting up metaplex candymachine and frontend boilerplate

Candy Machine Guide

Abridged guide of getting started with metaplex candy machine and exiled-apes frontend starter.

I wanted to capture this guide so I could quickly skip the boilerplate.

Table of Contents