Skip to content

Instantly share code, notes, and snippets.

View AjiteshBD's full-sized avatar
🎯
Focusing

Ajitesh Mishra AjiteshBD

🎯
Focusing
  • Mumbai
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract ASTNFT is ERC721 {
// Define the different categories of NFTs
enum Category { Gold, Silver, Bronze }
//Define token id counter
// create a new wallet
const {Wallet, Network} = require('bsv-wallet');
const network = Network.defaultNetworks.mainnet;
const wallet = new Wallet(network);
// send bsv to an address
wallet.send(toAddress, amount, feeRate);
// import private key
wallet.importPrivateKey(privateKey);
contract ERC721MintBurn is ERC721 {
address public owner;
uint256 public default_royalty;
constructor(uint256 royalty) public {
owner = msg.sender;
default_royalty = royalty;
}
//Import required MoneyButton library
const MoneyButton = require('@moneybutton/api-client');
//Instantiate MoneyButton object
const mb = new MoneyButton({
accessToken: '[YOUR_ACCESS_TOKEN]',
environment: 'mainnet',
});
//Construct the NFT contract
//Create a NFT contract
const { Tokenized } = require('@bitboss/tokenized');
//Connect to the Bitcoin SV testnet
const network = 'testnet';
const tokenized = new Tokenized(network);
//Deploy a NFT contract
const deployTransaction = await tokenized.contracts.NFT.deploy();
// Import the Tokenized library
const Tokenized = require('@tokenized/tokenized');
// Establish a connection to the Bitcoin SV node
let config = {
host: 'localhost',
port: 8332,
username: 'admin',
password: 'password'
};
@AjiteshBD
AjiteshBD / bsv
Last active December 5, 2022 13:10
// Load the Bitcoin SV library
const BitcoinSVCore = require('bitcoinsv-core');
// Create an instance of the Bitcoin SV library
const bsvCore = new BitcoinSVCore();
// Set the network to the Bitcoin SV testnet
bsvCore.Networks.defaultNetwork = bsvCore.Networks.testnet
// Define the NFT contract
contract NFT {
address public owner;
uint public defaultRoyalties;
mapping (uint => NFTItem) public items;
mapping (uint => address) public itemOwners;
struct NFTItem {
uint itemId;
bool isMinted;
#!/usr/bin/env python
from BitcoinSV import Script
class NFT(Script):
def __init__(self):
self.owner = None
self.items = {}
self.itemOwners = {}
super(NFT, self).__init__()
//Creating a wallet
const { PrivateKey } = require('bsv');
const privateKey = new PrivateKey();
const address = privateKey.toAddress();
console.log(`Your new wallet address is ${address}`);
//Sending money
const { Transaction } = require('bsv');