repo_id stringclasses 279
values | file_path stringlengths 43 179 | content stringlengths 1 4.18M | __index_level_0__ int64 0 0 |
|---|---|---|---|
solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src | solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router/batch-swap-quote.ts | import type { Address } from "@coral-xyz/anchor";
import { AddressUtil } from "@orca-so/common-sdk";
import type BN from "bn.js";
import invariant from "tiny-invariant";
import type {
WhirlpoolAccountFetcherInterface,
WhirlpoolAccountFetchOptions,
} from "../network/public/fetcher";
import type { SwapQuoteParam } f... | 0 |
solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src | solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router/quote-map.ts | import type { Address } from "@coral-xyz/anchor";
import { AddressUtil, Percentage } from "@orca-so/common-sdk";
import type { PublicKey } from "@solana/web3.js";
import BN from "bn.js";
import type { SwapErrorCode, WhirlpoolsError } from "../errors/errors";
import type { WhirlpoolAccountFetcherInterface } from "../net... | 0 |
solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src | solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router/router-impl.ts | import type { Address } from "@coral-xyz/anchor";
import type { Percentage, TransactionBuilder } from "@orca-so/common-sdk";
import { AddressUtil } from "@orca-so/common-sdk";
import type { Account } from "@solana/spl-token";
import type { WhirlpoolContext } from "..";
import {
RouteQueryErrorCode,
SwapErrorCode,
... | 0 |
solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router | solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router/public/index.ts | import type { Address } from "@coral-xyz/anchor";
import type { Percentage, TransactionBuilder } from "@orca-so/common-sdk";
import type { AddressLookupTableAccount } from "@solana/web3.js";
import type BN from "bn.js";
import type { WhirlpoolAccountFetchOptions } from "../../network/public/fetcher";
import type { Swap... | 0 |
solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router | solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router/public/router-builder.ts | import type { Address } from "@coral-xyz/anchor";
import type { WhirlpoolRouter } from ".";
import type { WhirlpoolContext } from "../..";
import type { PoolGraph } from "../../utils/public";
import { PoolGraphBuilder } from "../../utils/public";
import { WhirlpoolRouterImpl } from "../router-impl";
/**
* Builder to ... | 0 |
solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router | solana_public_repos/orca-so/whirlpools/legacy-sdk/whirlpool/src/router/public/router-utils.ts | import type {
LookupTableFetcher,
TransactionBuilder,
} from "@orca-so/common-sdk";
import {
AddressUtil,
MEASUREMENT_BLOCKHASH,
Percentage,
TX_SIZE_LIMIT,
} from "@orca-so/common-sdk";
import type { Account } from "@solana/spl-token";
import type { PublicKey } from "@solana/web3.js";
import BN from "bn.js"... | 0 |
solana_public_repos/nautilus-project | solana_public_repos/nautilus-project/nautilus/CODE_OF_CONDUCT.md | # Code of Conduct
As contributors and maintainers of this project, we are committed to fostering an inclusive and welcoming community for all, and to promoting a respectful and collaborative environment that values the diversity of its participants. We believe that everyone should be treated with respect and dignity.
... | 0 |
solana_public_repos/nautilus-project | solana_public_repos/nautilus-project/nautilus/LICENSE | Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
... | 0 |
solana_public_repos/nautilus-project | solana_public_repos/nautilus-project/nautilus/README.md | # Nautilus
[](https://github.com/nautilus-project/nautilus/actions/workflows/rust.yml)
[](https://github.com/nautilus-project/na... | 0 |
solana_public_repos/nautilus-project | solana_public_repos/nautilus-project/nautilus/CONTRIBUTING.md | # Contributing Guidelines
Welcome to Nautilus! Please take a moment to review these guidelines before submitting your contributions.
## Getting Started
To get started, first **fork this repository to your own account**. Then clone the repository to your local machine and create a new branch for your changes:
```shell... | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/py/README.md | # 🐍 Nautilus Py | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/py/setup.py | import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
setup(
name='nautilus_py',
version='0.0.1',
author='Joe Caulfield',
author_email='jcaulfield135@gmail.com',
pack... | 0 |
solana_public_repos/nautilus-project/nautilus/py | solana_public_repos/nautilus-project/nautilus/py/nautilus/index.py | #
#
# ----------------------------------------------------------------
# Nautilus
# ----------------------------------------------------------------
#
#
from .util.index import NautilusUtils
from solana.rpc.async_api import AsyncClient
from solders.pubkey import Pubkey
from solders.keypair imp... | 0 |
solana_public_repos/nautilus-project/nautilus/py | solana_public_repos/nautilus-project/nautilus/py/nautilus/__init__.py | __version__ = "0.0.1"
from .index import Nautilus
from .util import NautilusUtils | 0 |
solana_public_repos/nautilus-project/nautilus/py/nautilus | solana_public_repos/nautilus-project/nautilus/py/nautilus/idl/program_shank.json | {
"version": "0.1.0",
"name": "program_shank",
"instructions": [
{
"name": "CreatePerson",
"accounts": [
{
"name": "autoincAccount",
"isMut": true,
"isSigner": false,
"desc": "The account for autoincrementing this table"
},
{
... | 0 |
solana_public_repos/nautilus-project/nautilus/py/nautilus | solana_public_repos/nautilus-project/nautilus/py/nautilus/util/index.py |
class NautilusUtils:
def __init__(self) -> None:
pass | 0 |
solana_public_repos/nautilus-project/nautilus/py/nautilus | solana_public_repos/nautilus-project/nautilus/py/nautilus/util/__init__.py | from .index import NautilusUtils | 0 |
solana_public_repos/nautilus-project/nautilus/py | solana_public_repos/nautilus-project/nautilus/py/tests/sql_parse.py | from solana.rpc.async_api import AsyncClient
from solders.pubkey import Pubkey
from termcolor import colored
from nautilus import Nautilus
CONNECTION = AsyncClient("https://api.devnet.solana.com", "confirmed")
PROGRAM_ID = Pubkey.from_string("9kYnTzxTSTtKJjBBScH2m3SLBq8grogLhwMLZdcD2wG4")
nautilus = Nautilus(CONNECT... | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/js/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2":
version "7.21.0"
resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz"
integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaV... | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/js/package-lock.json | {
"name": "nautilus-js",
"version": "0.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "nautilus-js",
"version": "0.0.1",
"license": "MIT",
"dependencies": {
"@solana/web3.js": "^1.73.2",
"node-sql-parser": "^4.6.5"
},
"devDepen... | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/js/package.json | {
"name": "nautilus-js",
"version": "0.0.1",
"description": "SQL server for Solana",
"main": "index.js",
"repository": "https://github.com/realbuffalojoe/nautilus",
"author": "Joe Caulfield",
"license": "MIT",
"private": true,
"dependencies": {
"@solana/web3.js": "^1.73.2",
"node-sql-parser": ... | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/js/tsconfig.json | {
"compilerOptions": {
"target": "es2021",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"outDir": "./dist",
},
"exclude": ["./tests"]
} | 0 |
solana_public_repos/nautilus-project/nautilus/js | solana_public_repos/nautilus-project/nautilus/js/idl/program_shank.json | {
"version": "0.1.0",
"name": "program_shank",
"instructions": [
{
"name": "CreatePerson",
"accounts": [
{
"name": "autoincAccount",
"isMut": true,
"isSigner": false,
"desc": "The account for autoincrementing this table"
},
{
... | 0 |
solana_public_repos/nautilus-project/nautilus/js | solana_public_repos/nautilus-project/nautilus/js/tests/instantiate.test.ts | import assert from "assert"
import { describe, it } from "mocha"
import { Nautilus } from "../src"
import { CONNECTION, PROGRAM_ID, PROGRAM_ID_STRING } from "./main.test"
export function tests() {
describe("[Unit Tests]: Instantiating", () => {
function canInstantiate(method: string, nautilus: Nautilus... | 0 |
solana_public_repos/nautilus-project/nautilus/js | solana_public_repos/nautilus-project/nautilus/js/tests/tsconfig.test.json | {
"compilerOptions": {
"types": ["mocha", "chai"],
"typeRoots": ["./node_modules/@types"],
"lib": ["es2021"],
"module": "commonjs",
"target": "es6",
"esModuleInterop": true
}
} | 0 |
solana_public_repos/nautilus-project/nautilus/js | solana_public_repos/nautilus-project/nautilus/js/tests/sql-parse.test.ts | import assert from "assert"
import { describe, it } from "mocha"
import { Nautilus } from "../src"
import { CONNECTION, PROGRAM_ID } from "./main.test"
export function tests() {
describe("[Unit Tests]: SQL Parsing", () => {
const nautilus = new Nautilus(CONNECTION, PROGRAM_ID);
function testPa... | 0 |
solana_public_repos/nautilus-project/nautilus/js | solana_public_repos/nautilus-project/nautilus/js/tests/main.test.ts | import { Connection, PublicKey } from "@solana/web3.js"
//
// Deploy test program before executing
//
export const CONNECTION = new Connection("http://localhost:8899", "confirmed")
export const PROGRAM_ID_STRING = "9kYnTzxTSTtKJjBBScH2m3SLBq8grogLhwMLZdcD2wG4"
export const PROGRAM_ID = new PublicKey("9kYnTzxTSTtKJjBBS... | 0 |
solana_public_repos/nautilus-project/nautilus/js | solana_public_repos/nautilus-project/nautilus/js/src/index.ts | //
//
// ----------------------------------------------------------------
// Nautilus
// ----------------------------------------------------------------
//
//
import {
Connection,
Keypair,
PublicKey,
} from '@solana/web3.js';
import {
NautilusQuery,
NautilusTable,
} f... | 0 |
solana_public_repos/nautilus-project/nautilus/js/src | solana_public_repos/nautilus-project/nautilus/js/src/util/index.ts | import {
AccountInfo,
Connection,
GetProgramAccountsConfig,
GetProgramAccountsFilter,
PublicKey,
SendOptions,
Signer,
TransactionInstruction,
TransactionMessage,
VersionedTransaction,
} from '@solana/web3.js';
export class NautilusUtils {
// Get Program Accounts
stati... | 0 |
solana_public_repos/nautilus-project/nautilus/js/src | solana_public_repos/nautilus-project/nautilus/js/src/sql/table.ts | import {
AccountInfo,
GetProgramAccountsConfig,
PublicKey,
SendOptions,
Signer,
TransactionInstruction,
} from '@solana/web3.js';
import { Nautilus } from '../';
import { NautilusUtils } from '../util';
enum FetchFirst {
Delete,
Update,
}
export class NautilusTable {
nautilus:... | 0 |
solana_public_repos/nautilus-project/nautilus/js/src | solana_public_repos/nautilus-project/nautilus/js/src/sql/index.ts | export * from './query';
export * from './table'; | 0 |
solana_public_repos/nautilus-project/nautilus/js/src | solana_public_repos/nautilus-project/nautilus/js/src/sql/query.ts | import NodeSQLParser, { From } from 'node-sql-parser';
import {
AST,
Delete,
Dual,
Insert_Replace,
Select,
Update,
} from 'node-sql-parser';
import { Nautilus } from '..';
import { NautilusTable } from './table';
const SUPPORTED_ACTIONS = [
"select",
"insert",
"delete",
"update... | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/tests/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2":
version "7.20.13"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b"
integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NE... | 0 |
solana_public_repos/nautilus-project/nautilus | solana_public_repos/nautilus-project/nautilus/tests/package.json | {
"name": "program-nautilus",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@metaplex-foundation/solita": "^0.19.4",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.14.2",
"chai": "^4.3.7",
"mocha": "^10.2.0",
"ts-mocha": "^... | 0 |
solana_public_repos/nautilus-project/nautilus/tests | solana_public_repos/nautilus-project/nautilus/tests/tests/const.ts | import { Connection, Keypair, clusterApiUrl } from '@solana/web3.js'
import fs from 'fs'
import os from 'os'
import { parse as yamlParse, stringify as yamlStringify } from 'yaml'
export const PAYER = loadKeypairFromFile(os.homedir() + '/.config/solana/id.json')
export const PROGRAM_WALLETS = loadKeypairFromFile('./pro... | 0 |
solana_public_repos/nautilus-project/nautilus/tests | solana_public_repos/nautilus-project/nautilus/tests/tests/tsconfig.test.json | {
"compilerOptions": {
"types": ["mocha", "chai"],
"typeRoots": ["./node_modules/@types"],
"lib": ["es2015"],
"module": "commonjs",
"target": "es6",
"esModuleInterop": true
}
} | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.