repo_id
stringclasses
563 values
file_path
stringlengths
40
166
content
stringlengths
1
2.94M
__index_level_0__
int64
0
0
solana_public_repos/nautilus-project/nautilus/tests
solana_public_repos/nautilus-project/nautilus/tests/tests/all-tests.sh
echo "\n\n=================================================" echo "\n Nautilus Program Tests" echo "\n\n=================================================" sleep 2 echo "\nBuilding all test programs...\n" sleep 5 cargo build-sbf --manifest-path="./programs/wallets/Cargo.toml" cargo build-sbf --manifest-pat...
0
solana_public_repos/nautilus-project/nautilus/tests/tests
solana_public_repos/nautilus-project/nautilus/tests/tests/records/test.ts
import { it, describe, } from 'mocha' import { Keypair, LAMPORTS_PER_SOL, sendAndConfirmTransaction, Transaction, TransactionInstruction, } from '@solana/web3.js' import { PAYER, PROGRAM_RECORDS, TEST_CONFIGS } from '../const' import { MyInstructions, createCreateCarInstruction, ...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records
solana_public_repos/nautilus-project/nautilus/tests/tests/records/instructions/car.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, fetchIndex, MyInstructions } from "." import assert from "assert" class CreateCarInstructionData { ...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records
solana_public_repos/nautilus-project/nautilus/tests/tests/records/instructions/transfer.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, TransactionInstruction } from '@solana/web3.js' import { MyInstructions, deriveCarAddress, deriveHomeAddress, derivePersonAddress, fetchIndex } from "." import assert from "assert" class FundOrTransferInst...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records
solana_public_repos/nautilus-project/nautilus/tests/tests/records/instructions/index.ts
export * from './car' export * from './home' export * from './person' export * from './transfer' import { PublicKey, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionInstruction } from '@solana/web3.js' import * as borsh from "borsh" import { Buffer } from "buffer" import { TEST_CONFIGS } from '../../const' export enum ...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records
solana_public_repos/nautilus-project/nautilus/tests/tests/records/instructions/home.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, deriveIndexAddress, fetchIndex, MyInstructions } from "." class CreateHomeInstructionData { inst...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records
solana_public_repos/nautilus-project/nautilus/tests/tests/records/instructions/person.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, fetchIndex, MyInstructions } from "." import assert from "assert" class CreatePersonInstructionData ...
0
solana_public_repos/nautilus-project/nautilus/tests/tests
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2/test.ts
import { it, describe, } from 'mocha' import { Keypair, sendAndConfirmTransaction, Transaction, TransactionInstruction, } from '@solana/web3.js' import { PAYER, PROGRAM_RECORDS, TEST_CONFIGS } from '../const' import { createCreateCarInstruction, createCreateHomeInstruction, createCr...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2/instructions/car.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, fetchIndex, MyInstructions } from "." import assert from "assert" class CreateCarInstructionData { ...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2/instructions/index.ts
export * from './car' export * from './home' export * from './person' import { PublicKey, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionInstruction } from '@solana/web3.js' import * as borsh from "borsh" import { Buffer } from "buffer" import { TEST_CONFIGS } from '../../const' export enum MyInstructions { Initia...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2/instructions/home.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, deriveIndexAddress, fetchIndex, MyInstructions } from "." class CreateHomeInstructionData { inst...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2
solana_public_repos/nautilus-project/nautilus/tests/tests/records-2/instructions/person.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, fetchIndex, MyInstructions } from "." import assert from "assert" class CreatePersonInstructionData ...
0
solana_public_repos/nautilus-project/nautilus/tests/tests
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts/test.ts
import { it, describe, } from 'mocha' import { Keypair, sendAndConfirmTransaction, Transaction, TransactionInstruction, } from '@solana/web3.js' import { PAYER, PROGRAM_ACCOUNTS, TEST_CONFIGS } from '../const' import { createCreateCarInstruction, createCreateHomeInstruction, createC...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts/instructions/car.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, MyInstructions } from "." import assert from "assert" class CreateCarInstructionData { instructi...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts/instructions/index.ts
export * from './car' export * from './home' export * from './person' import { PublicKey, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionInstruction } from '@solana/web3.js' import * as borsh from "borsh" import { Buffer } from "buffer" import { TEST_CONFIGS } from '../../const' export enum MyInstructions { Create...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts/instructions/home.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, MyInstructions } from "." class CreateHomeInstructionData { instruction: MyInstructions hous...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts
solana_public_repos/nautilus-project/nautilus/tests/tests/accounts/instructions/person.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, MyInstructions } from "." import assert from "assert" class CreatePersonInstructionData { instru...
0
solana_public_repos/nautilus-project/nautilus/tests/tests
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets/test.ts
import { it, describe, } from 'mocha' import { Keypair, LAMPORTS_PER_SOL, PublicKey, sendAndConfirmTransaction, Transaction, TransactionInstruction, } from '@solana/web3.js' import { PAYER, PROGRAM_WALLETS, TEST_CONFIGS } from '../const' import { createAllocateWalletInstruction, ...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets/instructions/wallet.ts
import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { MyInstructions, createBaseInstruction } from "." export function createAllocateWalletInstruction( newWallet: PublicKey, payer: PublicKey, programId: PublicKey, ): Transaction...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets/instructions/complex.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionInstruction } from '@solana/web3.js' import { MyInstructions } from "." class ComplexInstructionData { instruction: MyInstructions amount_to_fund: number amo...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets/instructions/assign.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, TransactionInstruction } from '@solana/web3.js' import { MyInstructions } from "." class AssignInstructionData { instruction: MyInstructions owner: Uint8Array constructor(props: { instr...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets/instructions/transfer.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, TransactionInstruction } from '@solana/web3.js' import { MyInstructions } from "." class TransferInstructionData { instruction: MyInstructions amount: number constructor(props: { instru...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets
solana_public_repos/nautilus-project/nautilus/tests/tests/wallets/instructions/index.ts
export * from './complex' export * from './transfer' export * from './wallet' import { PublicKey, TransactionInstruction } from '@solana/web3.js' import * as borsh from "borsh" import { Buffer } from "buffer" export enum MyInstructions { Allocate, Assign, Create, CreateWithPayer, Read, Transfe...
0
solana_public_repos/nautilus-project/nautilus/tests/tests
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens/test.ts
import { it, describe, } from 'mocha' import { Keypair, LAMPORTS_PER_SOL, PublicKey, sendAndConfirmTransaction, Transaction, TransactionInstruction, } from '@solana/web3.js' import { PAYER, PROGRAM_TOKENS, TEST_CONFIGS } from '../const' import { MyInstructions, createBurnTokensI...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens/instructions/mint.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseI...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens/instructions/associated-token.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js' import { createBaseInstruction, MyInstructions } from "." import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync, TOKEN_...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens/instructions/nft.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PROGRAM_ID as METADATA_PROGRAM_ID } from '@metaplex-foundation/mpl-token-metadata' import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { PublicKey, SystemProgram, SY...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens/instructions/index.ts
export * from './associated-token' export * from './mint' export * from './metadata' export * from './nft' export * from './token' import { TOKEN_PROGRAM_ID } from '@solana/spl-token' import { PublicKey, SystemProgram, TransactionInstruction } from '@solana/web3.js' import * as borsh from "borsh" import { Buffer } fro...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens/instructions/metadata.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PROGRAM_ID as METADATA_PROGRAM_ID } from '@metaplex-foundation/mpl-token-metadata' import { TOKEN_PROGRAM_ID } from '@solana/spl-token' import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@sola...
0
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens
solana_public_repos/nautilus-project/nautilus/tests/tests/tokens/instructions/token.ts
import * as borsh from "borsh" import { Buffer } from "buffer" import { PROGRAM_ID as METADATA_PROGRAM_ID } from '@metaplex-foundation/mpl-token-metadata' import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from '@solana/spl-token' import { PublicKey, SystemProgram, SY...
0
solana_public_repos/nautilus-project/nautilus/tests/programs
solana_public_repos/nautilus-project/nautilus/tests/programs/records/Cargo.toml
[package] name = "program-nautilus" version = "0.1.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] [dependencies] nautilus = { path = "../../../solana", version = "0.0.1" }
0
solana_public_repos/nautilus-project/nautilus/tests/programs/records
solana_public_repos/nautilus-project/nautilus/tests/programs/records/src/lib.rs
//! Testing data records (PDAs). use nautilus::splogger::{info, Splog}; use nautilus::*; #[nautilus] mod program_nautilus { // Right now, the Nautilus Index must be initialized ahead of time. // Perhaps we can do this with the CLI. fn initialize<'a>(mut nautilus_index: Create<'a, NautilusIndex<'a>>) -> Pro...
0
solana_public_repos/nautilus-project/nautilus/tests/programs
solana_public_repos/nautilus-project/nautilus/tests/programs/accounts/Cargo.toml
[package] name = "program-nautilus" version = "0.1.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] [dependencies] nautilus = { path = "../../../solana", version = "0.0.1" }
0
solana_public_repos/nautilus-project/nautilus/tests/programs/accounts
solana_public_repos/nautilus-project/nautilus/tests/programs/accounts/src/lib.rs
//! Testing non-record data accounts (PDAs). use nautilus::splogger::{info, Splog}; use nautilus::*; #[nautilus] mod program_nautilus { fn create_person<'a>( mut new_person: Create<'a, Account<'a, Person>>, name: String, authority: Pubkey, ) -> ProgramResult { info!(" * New Pers...
0
solana_public_repos/nautilus-project/nautilus/tests/programs
solana_public_repos/nautilus-project/nautilus/tests/programs/wallets/Cargo.toml
[package] name = "program-nautilus" version = "0.1.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] [dependencies] nautilus = { path = "../../../solana", version = "0.0.1" }
0
solana_public_repos/nautilus-project/nautilus/tests/programs/wallets
solana_public_repos/nautilus-project/nautilus/tests/programs/wallets/src/lib.rs
//! Testing system accounts. use nautilus::splogger::{info, Splog}; use nautilus::*; #[nautilus] mod program_nautilus { fn allocate<'a>(new_wallet: Create<'a, Wallet<'a>>) -> ProgramResult { print_wallet_details(&new_wallet, "Allocate acct pre-allocate"); // // /* Business Logic */ ...
0
solana_public_repos/nautilus-project/nautilus/tests/programs
solana_public_repos/nautilus-project/nautilus/tests/programs/tokens/Cargo.toml
[package] name = "program-nautilus" version = "0.1.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] [dependencies] nautilus = { path = "../../../solana", version = "0.0.1" }
0
solana_public_repos/nautilus-project/nautilus/tests/programs/tokens
solana_public_repos/nautilus-project/nautilus/tests/programs/tokens/src/lib.rs
//! Testing token-related objects. use nautilus::spl_token::instruction::AuthorityType; use nautilus::splogger::{info, Splog}; use nautilus::*; #[nautilus] mod program_nautilus { // Mints fn create_mint<'a>( mut new_mint: Create<'a, Mint<'a>>, decimals: u8, mint_authority: Signer<Wall...
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/solana/Cargo.toml
[package] name = "nautilus" version = "0.0.1" authors = ["Joe Caulfield <jcaulfield135@gmail.com>"] repository = "https://github.com/nautilus-project/nautilus" license = "Apache-2.0" description = "SQL-native Solana program framework" rust-version = "1.59" edition = "2021" [dependencies] borsh = "0.9.3" borsh-derive =...
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/solana/rustfmt.toml
comment_width = 80 wrap_comments = true
0
solana_public_repos/nautilus-project/nautilus/solana
solana_public_repos/nautilus-project/nautilus/solana/idl/Cargo.toml
[package] name = "nautilus-idl" version = "0.0.1" authors = ["Joe Caulfield <jcaulfield135@gmail.com>"] repository = "https://github.com/nautilus-project/nautilus" license = "Apache-2.0" description = "Generates an IDL for a Nautilus program" rust-version = "1.59" edition = "2021" [dependencies] borsh = "0.10.2" borsh...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/tests/idl.rs
use nautilus_idl::*; #[test] fn idl() { let (name, version) = parse_cargo_toml("Cargo.toml").unwrap(); let metadata = IdlMetadata::new("some-program-id"); let types = vec![IdlType::new( "CustomArgs", IdlTypeType::new( "struct", vec![ IdlTypeTypeField...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/src/util.rs
use super::{idl_metadata::IdlMetadata, Idl}; pub fn load_idl_from_json(idl_path: &str) -> std::io::Result<Idl> { let file = std::fs::File::open(idl_path)?; let idl: Idl = serde_json::from_reader(file)?; Ok(idl) } pub fn update_program_id(idl_path: &str, program_id: &str) -> std::io::Result<()> { let m...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/src/idl_instruction.rs
use serde::{Deserialize, Serialize}; use super::idl_type::IdlType; /// An IDL instruction. #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IdlInstruction { pub name: String, pub accounts: Vec<IdlInstructionAccount>, pub args: Vec<IdlInstructionArg>, pub di...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/src/lib.rs
// // // ---------------------------------------------------------------- // Nautilus IDL // ---------------------------------------------------------------- // // Much of this IDL crate is inspired by or borrowed directly from Metaplex's // Shank. // // Nautilus and its contributors intend to ...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/src/idl_type_def.rs
use serde::{Deserialize, Serialize}; use super::{idl_nautilus_config::IdlTypeDefNautilusConfig, idl_type::IdlType}; /// An IDL type definition. #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IdlTypeDef { pub name: String, #[serde(rename = "type")] pub idl_typ...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/src/idl_metadata.rs
use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IdlMetadata { pub origin: String, #[serde(skip_serializing_if = "Option::is_none")] pub address: Option<String>, } impl IdlMetadata { pub fn new(address: &str) -> Self { ...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/src/idl_type.rs
use serde::{Deserialize, Serialize}; /// An IDL type enum for converting from Rust types to IDL type. /// /// Copied from Shank: https://github.com/metaplex-foundation/shank #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub enum IdlType { Array(Box<IdlType>, usize), Bool, ...
0
solana_public_repos/nautilus-project/nautilus/solana/idl
solana_public_repos/nautilus-project/nautilus/solana/idl/src/idl_nautilus_config.rs
use serde::{Deserialize, Serialize}; use crate::idl_type::IdlType; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub enum IdlSeed { Lit { value: String }, Field { key: String }, Param { key: String, value: IdlType }, } /// Additional Nautilus-specific IDL configuratio...
0
solana_public_repos/nautilus-project/nautilus/solana/idl/src
solana_public_repos/nautilus-project/nautilus/solana/idl/src/converters/py.rs
//! Converts a JSON IDL to Python bindings. use std::{ fs::{self, File}, io::Write, path::Path, }; use crate::{ idl_instruction::IdlInstruction, idl_type::IdlType, idl_type_def::{IdlTypeDef, IdlTypeDefType}, Idl, }; pub trait PythonIdlWrite { fn write_to_py(&self, dir_path: &str) -> st...
0
solana_public_repos/nautilus-project/nautilus/solana/idl/src
solana_public_repos/nautilus-project/nautilus/solana/idl/src/converters/mod.rs
pub mod py; pub mod ts;
0
solana_public_repos/nautilus-project/nautilus/solana/idl/src
solana_public_repos/nautilus-project/nautilus/solana/idl/src/converters/ts.rs
//! Converts a JSON IDL to TypeScript bindings. use std::{ fs::{self, File}, io::Write, path::Path, }; use crate::{ idl_instruction::IdlInstruction, idl_type::IdlType, idl_type_def::{IdlTypeDef, IdlTypeDefType, IdlTypeEnumFields}, Idl, }; pub trait TypeScriptIdlWrite { fn write_to_ts(&...
0
solana_public_repos/nautilus-project/nautilus/solana
solana_public_repos/nautilus-project/nautilus/solana/derive/Cargo.toml
[package] name = "nautilus-derive" version = "0.0.1" authors = ["Joe Caulfield <jcaulfield135@gmail.com>"] repository = "https://github.com/nautilus-project/nautilus" license = "Apache-2.0" description = "Nautilus derive macro for adding CRUD operations to data types" rust-version = "1.59" edition = "2021" [lib] proc-...
0
solana_public_repos/nautilus-project/nautilus/solana/derive
solana_public_repos/nautilus-project/nautilus/solana/derive/src/lib.rs
//! Nautilus' macros used to power its abstraction. use nautilus_syn::{entry::NautilusEntrypoint, object::NautilusObject}; use proc_macro::TokenStream; use quote::ToTokens; use syn::{parse_macro_input, ItemStruct}; extern crate proc_macro; /// The procedural macro to build the entirety of a Nautilus program. /// /// ...
0
solana_public_repos/nautilus-project/nautilus/solana
solana_public_repos/nautilus-project/nautilus/solana/syn/Cargo.toml
[package] name = "nautilus-syn" version = "0.0.1" authors = ["Joe Caulfield <jcaulfield135@gmail.com>"] repository = "https://github.com/nautilus-project/nautilus" license = "Apache-2.0" description = "Lib for parsing syntax for Nautilus derive macros" rust-version = "1.59" edition = "2021" [dependencies] borsh = "0.9...
0
solana_public_repos/nautilus-project/nautilus/solana/syn
solana_public_repos/nautilus-project/nautilus/solana/syn/src/lib.rs
// // // ---------------------------------------------------------------- // Nautilus Token Generation // ---------------------------------------------------------------- // // pub mod entry; pub mod object;
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/entry/entry_variant.rs
//! A `syn`-powered struct that dissolves to the required components to create //! the variants of the program's instruction enum and it's associated processor //! match arm initialization logic. use nautilus_idl::idl_instruction::IdlInstruction; use proc_macro2::{Span, TokenStream}; use quote::quote; use syn::{Ident, ...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/entry/idl.rs
//! Converters to allow for dissolving of Nautilus token-generation //! configuration structs, // such as `NautilusEntrypointEnum` and `NautilusEntrypointEnumVariant`, // into IDL components. use nautilus_idl::{ idl_instruction::{ IdlInstruction, IdlInstructionAccount, IdlInstructionArg, IdlInstructionDiscr...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/entry/mod.rs
//! Builds the entrypoint, processor, and IDL for a Nautilus program. pub mod entry_enum; pub mod entry_variant; pub mod idl; pub mod parser; pub mod required_account; use nautilus_idl::{ converters::{py::PythonIdlWrite, ts::TypeScriptIdlWrite}, idl_metadata::IdlMetadata, Idl, }; use proc_macro2::TokenStre...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/entry/entry_enum.rs
//! A `syn`-powered enum that dissolves to the required components to create the //! program's entrypoint, processor, and IDL. use nautilus_idl::idl_instruction::IdlInstruction; use proc_macro2::{Span, TokenStream}; use quote::quote; use syn::{Ident, ItemFn}; use crate::{ entry::entry_variant::NautilusEntrypointEn...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/entry/required_account.rs
//! The module for determining accounts required for a Nautilus object. use case::CaseExt; use convert_case::{Case, Casing}; use proc_macro2::Span; use quote::quote; use syn::Ident; use crate::object::NautilusObjectType; /// The details of a required account for a Nautilus object. /// /// These details pretty much ma...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/entry/parser.rs
//! Parses information about the user's entire crate. use cargo_toml::Manifest; use convert_case::{Case::Pascal, Casing}; use nautilus_idl::idl_type_def::IdlTypeDef; use proc_macro2::Span; use quote::quote; use shank_macro_impl::krate::CrateContext; use syn::{FnArg, Ident, Item, ItemFn, Pat, PathArguments, Type, TypePa...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/object/default_instructions.rs
use syn::{Attribute, NestedMeta}; /// Possible default instructions for records. #[derive(Clone, Debug)] pub enum DefaultInstruction { Create(String), Delete(String), Update(String), } impl DefaultInstruction { pub fn parse(nested_meta: &NestedMeta, struct_name: &str) -> syn::Result<Self> { if...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/object/source.rs
//! Spawns all objects from Nautilus's `src/objects/.` into `syn::ItemStruct` //! types for `syn` processing. use syn::{punctuated::Punctuated, Field, FieldsNamed, Ident, ItemStruct}; use super::NautilusObject; /// Enum vehicle used to build a `syn::Field`. enum SourceField { ProgramId, AccountInfo, Metad...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/object/mod.rs
//! Builds the required trait implementations for an annotated struct. pub mod data; pub mod default_instructions; pub mod parser; pub mod seeds; pub mod source; use proc_macro2::TokenStream; use quote::{quote, ToTokens}; use syn::{Ident, ItemEnum, ItemStruct}; use crate::entry::required_account::RequiredAccount; us...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/object/data.rs
//! Spawns the tokens for the required trait implementations for an annotated //! struct. use proc_macro2::{Span, TokenStream}; use quote::quote; use syn::{token::Colon, Fields, FnArg, Ident, Pat, PatIdent, PatType, Type}; use super::seeds::Seed; /// Generates tokens to implement `Clone` on a struct. pub fn impl_clon...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/object/seeds.rs
use syn::{ parse::{Parse, ParseStream}, punctuated::Punctuated, token::Comma, Ident, LitStr, Type, }; /// Possible account seeds. #[derive(Clone, Debug)] pub enum Seed { Lit { value: String }, Field { ident: Ident }, Param { ident: Ident, ty: Type }, } impl Parse for Seed { /// Parses ...
0
solana_public_repos/nautilus-project/nautilus/solana/syn/src
solana_public_repos/nautilus-project/nautilus/solana/syn/src/object/parser.rs
//! Parses a user's defined struct. use proc_macro2::TokenStream; use syn::{Fields, Ident, ItemStruct, Type}; use crate::object::seeds::SeedParser; use super::{ default_instructions::{DefaultInstruction, DefaultInstructionParser}, seeds::Seed, NautilusObjectType, }; /// Object configurations for either a...
0
solana_public_repos/nautilus-project/nautilus/solana
solana_public_repos/nautilus-project/nautilus/solana/src/error.rs
//! Nautilus custom errors. use num_traits::{FromPrimitive, ToPrimitive}; use solana_program::{ decode_error::DecodeError, program_error::{PrintProgramError, ProgramError}, }; use splogger::{error, Splog}; use thiserror::Error; /// Custom errors for Nautilus functionality. Convertible to /// `solana_program::p...
0
solana_public_repos/nautilus-project/nautilus/solana
solana_public_repos/nautilus-project/nautilus/solana/src/lib.rs
// // // ---------------------------------------------------------------- // Nautilus // ---------------------------------------------------------------- // // extern crate self as nautilus; pub mod cpi; pub mod error; pub mod objects; pub mod properties; pub use mpl_token_metadata; pub use s...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/cpi/token_metadata.rs
//! Cross-Program invocations to the Metaplex Token Metadata Program. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program::invoke, pubkey::Pubkey, }; use crate::{Create, Metadata, NautilusAccountInfo, NautilusMut, NautilusSigner}; /// Creates a Metadata account with the Token Meta...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/cpi/token.rs
//! Cross-Program invocations to the Token Program (legacy). use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program::invoke, pubkey::Pubkey, }; use spl_token::instruction::AuthorityType; use crate::{NautilusAccountInfo, NautilusMut, NautilusSigner}; /// Approves a delegate. A delegat...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/cpi/system.rs
//! Cross-Program invocations to the System Program use borsh::BorshSerialize; use solana_program::{ entrypoint::ProgramResult, program::{invoke, invoke_signed}, pubkey::Pubkey, system_instruction, }; use crate::{NautilusAccountInfo, NautilusMut, NautilusSigner}; /// Allocate space for an account. pub...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/cpi/associated_token.rs
//! Cross-Program invocations to the Associated Token Program use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, program::invoke}; use crate::{AssociatedTokenAccount, NautilusAccountInfo, NautilusSigner}; /// Creates an associated token account. #[allow(clippy::boxed_local)] pub fn create_asso...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/cpi/mod.rs
//! Submodule for cross-program invocations (CPI) to other Solana programs. pub mod associated_token; pub mod system; pub mod token; pub mod token_metadata;
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/objects/mod.rs
//! Submodule containing all Nautilus objects and their associated trait //! implementations. pub mod accounts; pub mod records; pub mod tokens; pub mod wallets;
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/records/index.rs
//! The special `NautilusIndex` Nautilus object and all associated trait //! implementations. use borsh::{BorshDeserialize, BorshSerialize}; use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, }; use crate::{ cpi, error::NautilusError, Cr...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/records/mod.rs
//! The `Record<T>` Nautilus object and all associated trait implementations. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, }; use crate::{ cpi, error::NautilusError, Create, Mut, NautilusAccountInfo, NautilusIndex, NautilusMut, ...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/accounts/mod.rs
//! The `Account<T>` Nautilus object and all associated trait implementations. use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; use crate::{ error::NautilusError, Mut, NautilusAccount, NautilusAccountData, NautilusAccountInfo, NautilusMut, NautilusTransferLamports, ...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/wallets/mod.rs
//! The `Wallet<T>` Nautilus object and all associated trait implementations. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, }; use crate::{ cpi, Create, NautilusAccountInfo, NautilusAssignable, NautilusMut, NautilusSigner, Nauti...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/tokens/nft.rs
//! The `Nft<T>` Nautilus object and all associated trait implementations. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, }; use spl_token::instruction::AuthorityType; use crate::{ cpi, edition::MasterEdition, Create, Metadata, Mint,...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/tokens/metadata.rs
//! The `Metadata<T>` Nautilus object and all associated trait implementations. pub use mpl_token_metadata::state::{Metadata as MetadataState, TokenMetadataAccount}; use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, }; use crate::{ cpi,...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/tokens/token.rs
//! The `Token<T>` Nautilus object and all associated trait implementations. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, }; use spl_token::instruction::AuthorityType; use crate::{ cpi, Create, Metadata, Mint, Mut, NautilusAccountI...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/tokens/associated_token.rs
//! The `AssociatedTokenAccount<T>` Nautilus object and all associated trait //! implementations. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, program_pack::Pack, pubkey::Pubkey, }; pub use spl_token::state::Account as AssociatedTokenAccountState; use...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/tokens/mod.rs
//! Submodule containing all token-based Nautilus objects and their associated //! trait implementations. pub mod associated_token; pub mod edition; pub mod metadata; pub mod mint; pub mod nft; pub mod token;
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/tokens/mint.rs
//! The `Mint<T>` Nautilus object and all associated trait implementations. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, program_pack::Pack, pubkey::Pubkey, }; use spl_token::instruction::AuthorityType; pub use spl_token::state::Mint as MintState; use...
0
solana_public_repos/nautilus-project/nautilus/solana/src/objects
solana_public_repos/nautilus-project/nautilus/solana/src/objects/tokens/edition.rs
//! The `Edition<T>` and `MasterEdition<T>` Nautilus object` and all associated //! trait implementations. pub use mpl_token_metadata::state::{ Edition as EditionState, MasterEditionV2 as MasterEditionState, TokenMetadataAccount, }; use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/properties/create.rs
//! Traits used for creating Nautilus objects. use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; use crate::{error::NautilusError, NautilusMut}; use super::{signer::NautilusSigner, NautilusAccountInfo}; /// The struct to wrap an object so that it has the necessary accounts...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/properties/mutable.rs
//! Traits used for marking Nautilus objects as mutable. use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; use crate::error::NautilusError; use super::NautilusAccountInfo; /// The trait that ensures an object's underlying `AccountInfo` must be mutable. pub trait NautilusMu...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/properties/mod.rs
//! Submodule defining the trait hierarchy for Nautilus objects. use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, }; use self::mutable::NautilusMut; pub mod create; pub mod data; pub mod mutable; pub mod signer; /// The core trait that m...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/properties/_update.rs
//! Traits used for updating Nautilus objects. use solana_program::entrypoint::ProgramResult; use super::signer::NautilusSigner; pub trait NautilusUpdate<'a> { fn update(&self) -> ProgramResult; fn update_with_payer(&self, payer: impl NautilusSigner<'a>) -> ProgramResult; } pub trait NautilusUpdateMetadata<'...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/properties/data.rs
//! Traits used for managing the account data of Nautilus objects. use borsh::{BorshDeserialize, BorshSerialize}; use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; use super::NautilusAccountInfo; /// The trait that represents account data for non-record Nautilus accounts. /...
0
solana_public_repos/nautilus-project/nautilus/solana/src
solana_public_repos/nautilus-project/nautilus/solana/src/properties/signer.rs
//! Traits used for marking Nautilus objects as signers. use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; use crate::{error::NautilusError, NautilusMut}; use super::NautilusAccountInfo; /// The trait that ensures an object's underlying `AccountInfo` must be a /// signer. ...
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/docs/.babelrc
{ "presets": ["next/babel"], "plugins": [] }
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/docs/tailwind.config.js
/** @type {import('tailwindcss').Config} */ module.exports = { content: ["./src/**/*.{js,ts,jsx,tsx}"], plugins: [require("daisyui"), require("@tailwindcss/typography")], darkMode: "class", theme: { backgroundImage: { hero: "url('/sea.jpeg')", }, extend: { colors: { primary: { ...
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/docs/next.config.js
/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, } module.exports = nextConfig
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/docs/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@babel/runtime@^7.20.7": version "7.21.0" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz" integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== dep...
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/docs/package-lock.json
{ "name": "docs", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "docs", "version": "0.1.0", "dependencies": { "@tailwindcss/typography": "^0.5.9", "@types/node": "18.15.11", "@types/react": "18.0.32", "@types/react...
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/docs/package.json
{ "name": "docs", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@tailwindcss/typography": "^0.5.9", "@types/node": "18.15.11", "@types/react": "18.0.32", "@types/rea...
0
solana_public_repos/nautilus-project/nautilus
solana_public_repos/nautilus-project/nautilus/docs/tsconfig.json
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "resol...
0