Skip to content

Instantly share code, notes, and snippets.

@0xlxy
0xlxy / lambda_function.py
Last active September 8, 2022 22:09
AWS Lambda function for periodically retrieving the best offers from opensea, looksrare, x2y2, sudoswap, nftx
import threading
from datetime import datetime
from decimal import Decimal
import boto3
import cloudscraper
import pymysql
import requests
from bs4 import BeautifulSoup
from pytz import timezone
@0xlxy
0xlxy / lambda_function.py
Created September 8, 2022 21:52
Sudoswap API
import boto3
import requests
class UpdateDB:
def __init__(self):
self.result = []
self.get_sudoswap()
self.update_db()
@0xlxy
0xlxy / lambda_function.py
Created September 8, 2022 22:06
Best Offer Aggregator API across Opensea, Looksrare, X2Y2, Sudoswap, NFTX
import json
import threading
from decimal import Decimal
from time import time
import boto3
import cloudscraper
import requests
from bs4 import BeautifulSoup
@0xlxy
0xlxy / sell-opensea.js
Created September 13, 2022 02:04
PoC for NFT instant sell on Opensea
// if type module -> cannot use reqiure, need import
// In package.json: "type": "module",
import { OpenSeaSDK, Network } from "opensea-js";
import HDWalletProvider from "@truffle/hdwallet-provider";
import { config } from 'dotenv';
config();
const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY
const OPENSEA_API_KEY = process.env.OPENSEA_API_KEY
const RPC_URL = process.env.RPC_URL
@0xlxy
0xlxy / sell-x2y2.ts
Created September 13, 2022 02:06
PoC for NFT instant sell on X2Y2
import { Signer } from 'ethers'
import { ethersWallet, init, acceptOffer } from '@x2y2-io/sdk'
import { Network } from '@x2y2-io/sdk/dist/network'
require('dotenv').config()
// https://github.com/X2Y2-io/x2y2-sdk
const X2Y2_API_KEY: string = process.env.X2Y2_API_KEY || ""
const WALLET_PRIVATE_KEY: string = process.env.WALLET_PRIVATE_KEY || ""
@0xlxy
0xlxy / make-offer-x2y2.ts
Created September 14, 2022 03:21
Script for making an offer on X2Y2
import { Signer } from 'ethers'
import { ethersWallet, init, offer } from '@x2y2-io/sdk'
import { Network } from '@x2y2-io/sdk/dist/network'
require('dotenv').config()
// https://github.com/X2Y2-io/x2y2-sdk#making-offers--collection-offers
const X2Y2_API_KEY: string = process.env.X2Y2_API_KEY || ""
const WALLET_PRIVATE_KEY: string = process.env.WALLET_PRIVATE_KEY || ""
@0xlxy
0xlxy / make-offer-opensea.js
Created September 14, 2022 03:37
Script for making an offer on opensea
// if type module -> cannot use reqiure, need import
// In package.json: "type": "module",
import { OpenSeaSDK, Network } from "opensea-js";
import HDWalletProvider from "@truffle/hdwallet-provider";
import { config } from 'dotenv';
config();
// https://github.com/ProjectOpenSea/opensea-js#making-offers
const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY
@0xlxy
0xlxy / make-offer-looksrare.js
Created September 14, 2022 03:56
Script for making an offer on looksrare
const https = require('https')
const { Wallet } = require('ethers')
const {
addressesByNetwork,
SupportedChainId,
generateMakerOrderTypedData,
} = require('@looksrare/sdk')
require('dotenv').config()
const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY
@0xlxy
0xlxy / seaport-collection-offers.py
Created October 8, 2022 00:32
Opensea Collection & Traits Offers - Beta
import requests
import json
slug = "azuki"
url = f'https://api.opensea.io/vnext/offers/collection/{slug}/traits'
headers = {
"X-API-KEY": "2972994f68bb4dfc9f68c944f473c329"
}
@0xlxy
0xlxy / lambda_function.py
Created October 24, 2022 19:47
sudoswap sell_quote & buy_quote
import json
from decimal import Decimal
import boto3
import requests
class UpdateDB:
def __init__(self):
self.result = []