Skip to content

Instantly share code, notes, and snippets.

View verdotte's full-sized avatar
🏠
Working from home

Verdotte Aututu verdotte

🏠
Working from home
View GitHub Profile
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"nft-api/config"
"nft-api/database"
"nft-api/handlers"
"nft-api/middleware"
package middleware
import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"nft-api/validators"
"nft-api/models"
"nft-api/config"
"time"
"net/http"
package handlers
import (
"fmt"
"net/http"
"strings"
"time"
"nft-api/config"
"nft-api/models"
"nft-api/validators"
package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type User struct {
ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:gen_random_uuid()"`
package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type AuthMessageStatus string
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {CCIPReceiver} from "@chainlink/contracts-ccip/contracts/applications/CCIPReceiver.sol";
import {Client} from "@chainlink/contracts-ccip/contracts/libraries/Client.sol";
import {Counters} from "@openzeppelin/contracts/utils/Counters.sol";
contract NFTReceiver is CCIPReceiver, ERC721 {
using Counters for Counters.Counter;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {IRouterClient} from "@chainlink/contracts-ccip/contracts/interfaces/IRouterClient.sol";
import {OwnerIsCreator} from "@chainlink/contracts/src/v0.8/shared/access/OwnerIsCreator.sol";
import {Client} from "@chainlink/contracts-ccip/contracts/libraries/Client.sol";
import {LinkTokenInterface} from "@chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol";
import {Counters} from "@openzeppelin/contracts/utils/Counters.sol";
contract NFTSender {
import * as anchor from "@coral-xyz/anchor";
import { BN, Program } from "@coral-xyz/anchor";
import { PublicKey } from "@solana/web3.js";
import { Crudapp } from "../target/types/crudapp";
import { BankrunProvider, startAnchor } from "anchor-bankrun";
const IDL = require("../target/idl/crudapp.json");
const crudAppAddress = new PublicKey(
"8RH45jCscGdN5itQ3kt5Zqwhzi3BAVarTrnuvoQEUedg"
#![allow(clippy::result_large_err)]
use anchor_lang::prelude::*;
declare_id!("8RH45jCscGdN5itQ3kt5Zqwhzi3BAVarTrnuvoQEUedg");
#[program]
pub mod crudapp {
use super::*;
declare_id!("8RH45jCscGdN5itQ3kt5Zqwhzi3BAVarTrnuvoQEUedg");