repo_id stringclasses 279
values | file_path stringlengths 43 179 | content stringlengths 1 4.18M | __index_level_0__ int64 0 0 |
|---|---|---|---|
solana_public_repos/Lightprotocol/light-protocol/cli/test/commands | solana_public_repos/Lightprotocol/light-protocol/cli/test/commands/compress-sol/index.test.ts | import { expect, test } from "@oclif/test";
import { initTestEnvIfNeeded } from "../../../src/utils/initTestEnv";
import { defaultSolanaWalletKeypair } from "../../../src";
import { requestAirdrop } from "../../helpers/helpers";
describe("compress-sol", () => {
const keypair = defaultSolanaWalletKeypair();
const t... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/test | solana_public_repos/Lightprotocol/light-protocol/cli/test/helpers/helpers.ts | import {
Connection,
Keypair,
PublicKey,
Signer,
SystemProgram,
} from "@solana/web3.js";
import { getPayer, getSolanaRpcUrl } from "../../src";
import {
Rpc,
buildAndSignTx,
confirmTx,
dedupeSigner,
getTestRpc,
sendAndConfirmTx,
} from "@lightprotocol/stateless.js";
import { createMint, mintTo } ... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/test | solana_public_repos/Lightprotocol/light-protocol/cli/test/helpers/init.js | const { execSync } = require("child_process");
const path = require("path");
process.env.TS_NODE_PROJECT = path.resolve("tsconfig.test.json");
process.env.NODE_ENV = "development";
global.oclif = global.oclif || {};
global.oclif.columns = 80;
| 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/test_bin/dev | #!/usr/bin/env node
const oclif = require('@oclif/core')
const path = require('path')
const project = path.join(__dirname, '..', 'tsconfig.test.json')
// In dev mode -> use ts-node and dev plugins
process.env.NODE_ENV = 'development'
require('ts-node').register({project})
// In dev mode, always show stack traces
o... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/test_bin/run | #!/usr/bin/env node
const oclif = require('@oclif/core')
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
| 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/nullifier_queue_pubkey_nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148.json | {"pubkey":"nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148","account":{"lamports":9626515200,"data":["pMhsPlc/e0EP2NRH06M+VSyY8R8Xdq4y4g7ChxQIOUQPXTDG51dI2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXwAAAAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAA0BySirRd... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/address_merkle_tree_queue_aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F.json | {"pubkey":"aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F","account":{"lamports":9626515200,"data":["pMhsPlc/e0EP2NRH06M+VSyY8R8Xdq4y4g7ChxQIOUQPXTDG51dI2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgBAAAAAAAAXwAAAAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAim6XXnEi... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/epoch_pda_34w7KcLBXabMkHuXE2fY368vFe6kP3v5EJn8nPvQ8SKn.json | {"pubkey":"34w7KcLBXabMkHuXE2fY368vFe6kP3v5EJn8nPvQ8SKn","account":{"lamports":2171520,"data":["QuAuAqeJeGsAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAKAAAAAAAAAGQAAAAAAAAAyAAAAAAAAABkAAAAAAAAAIgTAAAAAAAACFAAAAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/registered_forester_pda_2KNqEh23Se8AHecuzR1UkxL26euq2qXSpQPTH1jH7VqU.json | {"pubkey":"2KNqEh23Se8AHecuzR1UkxL26euq2qXSpQPTH1jH7VqU","account":{"lamports":1670400,"data":["My+7VlKZdQXMuMIVdedaPnWzorVHJCIvMcPXWnMDRUrSS6K/PzOqzAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==","base64"],"owner":"Lighton6oQpVkeewmo2mcPTQQp7kYHr4fWpAgJyEmDX","execu... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/registered_program_pda_35hkDgaAKwMCaxRz2ocSZ6NaUrtKkyNqU6c4RV3tYJRh.json | {"pubkey":"35hkDgaAKwMCaxRz2ocSZ6NaUrtKkyNqU6c4RV3tYJRh","account":{"lamports":1392000,"data":["H/u06wN0MgQGp1X4ITkFTUQksVrwxDDPL0t/mHk62hJS1I82ZsbLzg/Y1EfToz5VLJjxHxd2rjLiDsKHFAg5RA9dMMbnV0jY","base64"],"owner":"compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq","executable":false,"rentEpoch":18446744073709551615,"space":72... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/cpi_context_cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4.json | {"pubkey":"cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4","account":{"lamports":143487360,"data":["FhSV2krMgKYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0BySirRdNlWVo06HcX+7AAihnSLwUsnaH5iMR8V946AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/merkle_tree_pubkey_smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT.json | {"pubkey":"smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT","account":{"lamports":9496335360,"data":["rCusuh1J21QP2NRH06M+VSyY8R8Xdq4y4g7ChxQIOUQPXTDG51dI2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwBAAAAAAAAXwAAAAAAAACIEwAAAAAAAP////////////////////8AAAAAAAAAAAuzCf2uDj... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/group_pda_24rt4RgeyjUCWGS2eF7L7gyNMuz6JWdqYpAvb1KRoHxs.json | {"pubkey":"24rt4RgeyjUCWGS2eF7L7gyNMuz6JWdqYpAvb1KRoHxs","account":{"lamports":1392000,"data":["D88EoH8mjqIQpl591jkE+Dg60Dze4Hi5FNhzGIA7FTWAcNeS4Fz959gvYscJPdVIze1MSnf9YAGMXJWU+iA1NroPMILezQNi","base64"],"owner":"compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq","executable":false,"rentEpoch":18446744073709551615,"space":72... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/registered_registry_program_pda_DumMsyvkaGJG4QnQ1BhTgvoRMXsgGxfpKDUCr22Xqu4w.json | {"pubkey":"DumMsyvkaGJG4QnQ1BhTgvoRMXsgGxfpKDUCr22Xqu4w","account":{"lamports":1392000,"data":["H/u06wN0MgQFDSsTeVE2hc8C8rX9UpG9lZsrBgqlJepbNIE7Hbm3bg/Y1EfToz5VLJjxHxd2rjLiDsKHFAg5RA9dMMbnV0jY","base64"],"owner":"compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq","executable":false,"rentEpoch":18446744073709551615,"space":72... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/governance_authority_pda_CuEtcKkkbTn6qy2qxqDswq5U2ADsqoipYDAYfRvxPjcp.json | {"pubkey":"CuEtcKkkbTn6qy2qxqDswq5U2ADsqoipYDAYfRvxPjcp","account":{"lamports":2234160,"data":["YLDvkgH+Y5ICY+L7WEJcIRnY07lwy9TuaZBIebD9aqhznpq8Pv+mUf8AAAAAAAAAAAEAAAAAAAAACgAAAAAAAABkAAAAAAAAAMgAAAAAAAAAZAAAAAAAAACIEwAAAAAAAAhQAAAAAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/forester_epoch_pda_3FBt1BPQHCQkS8k3wrUXMfB6JBhtMhEqQXueHRw2ojZV.json | {"pubkey":"3FBt1BPQHCQkS8k3wrUXMfB6JBhtMhEqQXueHRw2ojZV","account":{"lamports":2735280,"data":["HXXTjWOP+nLMuMIVdedaPnWzorVHJCIvMcPXWnMDRUrSS6K/PzOqzAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZAAAAAAAAAABAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAACgAAAAAAAABkAAAAAAAAAMgAAAAAAAAAZAAAAAAAAACIEwAAAAAAAAhQAAAAAAAAZAAAAAAA... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/accounts/address_merkle_tree_amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2.json | {"pubkey":"amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2","account":{"lamports":15342958080,"data":["C6GvCdTlSUkP2NRH06M+VSyY8R8Xdq4y4g7ChxQIOUQPXTDG51dI2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXwAAAAAAAACIEwAAAAAAAP////////////////////8AAAAAAAAAAAiqcuzqQ... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/scripts/buildProver.sh | #!/usr/bin/env sh
set -eux
build_prover() {
GOOS=$1 GOARCH=$2 go build -o "$3"
}
root_dir="$(git rev-parse --show-toplevel)"
gnark_dir="${root_dir}/light-prover"
out_dir="${root_dir}/cli/bin"
if [ ! -e "$out_dir" ]; then
mkdir -p "$out_dir"
fi
cp -r "${gnark_dir}/proving-keys" "$out_dir"
cd "$gnark_dir"
# ... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/scripts/checkAddProgram.ts | const fs = require('fs');
function main() {
const dir = process.argv[2];
const name = process.argv[3];
// check whether program Cargo.toml file exists
const programDir = `${dir}/programs/${name}/Cargo.toml`;
if (!fs.existsSync(programDir))
throw new Error(`Program ${programDir} does not ex... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/scripts/copyLocalProgramBinaries.sh | #!/usr/bin/env sh
set -eux
root_dir=$(git rev-parse --show-toplevel)
out_dir="$root_dir/cli/bin"
if [ ! -e "$out_dir" ]; then
mkdir -p "$out_dir"
fi
keys="account_compression light_system_program light_compressed_token light_registry"
for key in $keys
do
cp "$root_dir/target/deploy/$key.so" "$out_dir"/"$key"... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli | solana_public_repos/Lightprotocol/light-protocol/cli/src/index.ts | export { run } from "@oclif/core";
export * from "./utils";
export * from "./psp-utils";
| 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/process.ts | import { spawn, SpawnOptionsWithoutStdio } from "child_process";
import path from "path";
import fs from "fs";
import find from "find-process";
import { exec as execCb } from "node:child_process";
import { promisify } from "util";
import axios from "axios";
const waitOn = require("wait-on");
export async function kill... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/initTestEnv.ts | import { airdropSol } from "@lightprotocol/stateless.js";
import { getConfig, getPayer, setAnchorProvider, setConfig } from "./utils";
import {
BASE_PATH,
LIGHT_ACCOUNT_COMPRESSION_TAG,
LIGHT_COMPRESSED_TOKEN_TAG,
LIGHT_PROTOCOL_PROGRAMS_DIR_ENV,
LIGHT_REGISTRY_TAG,
LIGHT_SYSTEM_PROGRAM_TAG,
SPL_NOOP_PROG... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/utils.ts | import * as fs from "fs";
import { existsSync } from "fs";
import * as path from "path";
import * as anchor from "@coral-xyz/anchor";
import * as solana from "@solana/web3.js";
import { Keypair } from "@solana/web3.js";
import { confirmConfig, createRpc, Rpc } from "@lightprotocol/stateless.js";
import { bs58 } from "@... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/constants.ts | export const SPL_NOOP_PROGRAM_TAG = "spl-noop-v0.2.0";
export const LIGHT_ACCOUNT_COMPRESSION_TAG = "account-compression-v1.0.0";
export const LIGHT_SYSTEM_PROGRAM_TAG = "light-system-program-v1.0.0";
export const LIGHT_REGISTRY_TAG = "light-registry-v1.0.0";
export const LIGHT_COMPRESSED_TOKEN_TAG = "light-compressed-... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/processPhotonIndexer.ts | import which from "which";
import { killProcess, spawnBinary, waitForServers } from "./process";
import { INDEXER_PROCESS_NAME, PHOTON_VERSION } from "./constants";
import { exec } from "node:child_process";
import * as util from "node:util";
export async function startIndexer(
rpcUrl: string,
indexerPort: number,... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/index.ts | export * from "./utils";
export * from "./initTestEnv";
export * from "./processPhotonIndexer";
export * from "./processProverServer";
export * from "./constants";
| 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/processProverServer.ts | import path from "path";
import {
executeCommand,
killProcess,
killProcessByPort,
spawnBinary,
waitForServers,
} from "./process";
import { LIGHT_PROVER_PROCESS_NAME } from "./constants";
const KEYS_DIR = "proving-keys/";
export async function killProver() {
await killProcess(getProverNameByArch());
awa... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/utils/standardFlags.ts | import { Flags } from "@oclif/core";
export const standardFlags = {
skipFetchBalance: Flags.boolean({
char: "b",
description: "Skip fetching the most recent balance prior to the operation",
required: false,
default: false,
parse: async () => true,
}),
localTestRpc: Flags.boolean({
descrip... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/psp-utils/download.ts | import axios from "axios";
import * as fs from "fs";
import { promisify } from "util";
import cliProgress from "cli-progress";
import * as path from "path";
import * as tar from "tar";
import * as zlib from "zlib";
import { sleep } from "@lightprotocol/stateless.js";
const fileExists = promisify(fs.exists);
async fun... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src | solana_public_repos/Lightprotocol/light-protocol/cli/src/psp-utils/index.ts | export * from "./download";
| 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/init/index.ts | import { sleep, UtilsError, UtilsErrorCode } from "@lightprotocol/stateless.js";
import { Args, Command, Flags } from "@oclif/core";
import { executeCommand } from "../../utils/process";
import { downloadBinIfNotExists } from "../../psp-utils";
import {
PROGRAM_ID,
ANCHOR_VERSION,
BORSH_VERSION,
LIGHT_HASHER_VE... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/mint-to/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
rpc,
} from "../../utils/utils";
import { getKeypairFromFile } from "@solana-developers/helpers";
import { Keypair, PublicKey } from "@solana/web3.js";
import { mintTo } from "@lightpro... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/create-mint/index.ts | import { Command, Flags } from "@oclif/core";
import { getKeypairFromFile } from "@solana-developers/helpers";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
rpc,
} from "../../utils/utils";
import { createMint } from "@lightprotocol/compressed-token";
import { Keypair, PublicK... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/config/index.ts | import ConfigCommand from "./config";
export default ConfigCommand;
| 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/config/config.ts | import { Command, Flags, ux } from "@oclif/core";
import {
CustomLoader,
getConfig,
isValidURL,
setConfig,
} from "../../utils/utils";
class ConfigCommand extends Command {
static description =
"Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can ... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/decompress-sol/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
getSolanaRpcUrl,
rpc,
} from "../../utils/utils";
import { PublicKey } from "@solana/web3.js";
import { decompress, getTestRpc } from "@lightprotocol/stateless.js";
import { WasmFacto... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/create-token-pool/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
rpc,
} from "../../utils/utils";
import { PublicKey } from "@solana/web3.js";
import { createTokenPool } from "@lightprotocol/compressed-token";
class RegisterMintCommand extends Comm... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/approve-and-mint-to/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
getSolanaRpcUrl,
rpc,
} from "../../utils/utils";
import { getKeypairFromFile } from "@solana-developers/helpers";
import { Keypair, PublicKey } from "@solana/web3.js";
import { appro... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/transfer/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
rpc,
} from "../../utils/utils";
import { transfer } from "@lightprotocol/compressed-token";
import { PublicKey } from "@solana/web3.js";
import { getKeypairFromFile } from "@solana-dev... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/balance/index.ts | import { Command, Flags } from "@oclif/core";
import { CustomLoader, rpc } from "../../utils/utils";
import { PublicKey } from "@solana/web3.js";
class BalanceCommand extends Command {
static summary = "Get balance";
static examples = ["$ light balance --mint=<ADDRESS> --owner=<ADDRESS>"];
static flags = {
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/decompress-spl/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
rpc,
} from "../../utils/utils";
import { PublicKey } from "@solana/web3.js";
import { decompress } from "@lightprotocol/compressed-token";
import { getOrCreateAssociatedTokenAccount } ... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/start-prover/index.ts | import { Command, Flags } from "@oclif/core";
import { CustomLoader, startProver } from "../../utils/index";
class StartProver extends Command {
static description = "Start gnark prover";
protected finally(_: Error | undefined): Promise<any> {
process.exit();
}
static flags = {
"prover-port": Flags.i... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/test-validator/index.ts | import { Command, Flags } from "@oclif/core";
import {
initTestEnv,
stopTestEnv,
SYSTEM_PROGRAMS,
} from "../../utils/initTestEnv";
import { CustomLoader } from "../../utils/index";
import path from "path";
import fs from "fs";
class SetupCommand extends Command {
static description =
"Start a local test s... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/compress-spl/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
getSolanaRpcUrl,
rpc,
} from "../../utils/utils";
import { PublicKey } from "@solana/web3.js";
import { getTestRpc } from "@lightprotocol/stateless.js";
import { compress } from "@lig... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/merge-token-accounts/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
rpc,
} from "../../utils/utils";
import { mergeTokenAccounts } from "@lightprotocol/compressed-token";
import { PublicKey } from "@solana/web3.js";
import { getKeypairFromFile } from "@... | 0 |
solana_public_repos/Lightprotocol/light-protocol/cli/src/commands | solana_public_repos/Lightprotocol/light-protocol/cli/src/commands/compress-sol/index.ts | import { Command, Flags } from "@oclif/core";
import {
CustomLoader,
defaultSolanaWalletKeypair,
generateSolanaTransactionURL,
rpc,
} from "../../utils/utils";
import { PublicKey } from "@solana/web3.js";
import { compress } from "@lightprotocol/stateless.js";
class CompressSolCommand extends Command {
stati... | 0 |
solana_public_repos/Lightprotocol/light-protocol | solana_public_repos/Lightprotocol/light-protocol/.devcontainer/devcontainer.json | // For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Light Protocol",
"image": "ghcr.io/lightprotocol/devcontainer-core:main",
"mounts": [
// Solana keypair.
{
"source": "lightprotocol-so... | 0 |
solana_public_repos/Lightprotocol/light-protocol | solana_public_repos/Lightprotocol/light-protocol/.cargo/config.toml | [alias]
xtask = "run --package xtask --"
# On Windows
# ```
# cargo install -f cargo-binutils
# rustup component add llvm-tools-preview
# ```
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[target.x86_64-pc-windows-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
# On Linux:
# - Ubuntu,... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/Cargo.toml | [package]
name = "light-sdk-macros"
version = "0.4.0"
description = "Macros for Programs using the Light SDK for ZK Compression "
repository = "https://github.com/Lightprotocol/light-protocol"
license = "Apache-2.0"
edition = "2021"
[dependencies]
bs58 = "0.5"
proc-macro2 = { workspace = true }
quote = { workspace = t... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/Cargo.lock | # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aead"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
dependencies = [
"generic-ar... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/README.md | # light-sdk-macros
Set of proc-macros for programs using the Light SDK for ZK Compression
| 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/tests/hasher.rs | use std::{cell::RefCell, marker::PhantomData, rc::Rc};
use light_hasher::{bytes::AsByteVec, DataHasher, Hasher, Poseidon};
use light_sdk_macros::LightHasher;
#[derive(LightHasher, Clone)]
pub struct MyAccount {
pub a: bool,
pub b: u64,
#[nested]
pub c: MyNestedStruct,
#[truncate]
pub d: [u8; 3... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/src/accounts.rs | use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use syn::{
parse::{Parse, ParseStream},
parse_quote,
punctuated::Punctuated,
token::PathSep,
Error, Expr, Fields, Ident, ItemStruct, Meta, Path, PathSegment, Result, Stmt, Token, Type,
TypePath,
};
pub(crate) fn process_light_s... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/src/lib.rs | extern crate proc_macro;
use accounts::{process_light_accounts, process_light_system_accounts};
use proc_macro::TokenStream;
use syn::{parse_macro_input, DeriveInput, ItemMod, ItemStruct};
use traits::process_light_traits;
mod account;
mod accounts;
mod discriminator;
mod hasher;
mod program;
mod traits;
/// Adds req... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/src/discriminator.rs | use light_hasher::{Hasher, Sha256};
use proc_macro2::TokenStream;
use quote::quote;
use syn::{ItemStruct, Result};
pub(crate) fn discriminator(input: ItemStruct) -> Result<TokenStream> {
let account_name = &input.ident;
let (impl_gen, type_gen, where_clause) = input.generics.split_for_impl();
let mut dis... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/src/account.rs | use proc_macro2::TokenStream;
use quote::quote;
use syn::{ItemStruct, Result};
pub(crate) fn account(input: ItemStruct) -> Result<TokenStream> {
Ok(quote! {
#[derive(
::anchor_lang::AnchorDeserialize,
::anchor_lang::AnchorSerialize,
::light_sdk::LightDiscriminator,
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/src/hasher.rs | use proc_macro2::TokenStream;
use quote::quote;
use syn::{Error, Fields, ItemStruct, Result};
pub(crate) fn hasher(input: ItemStruct) -> Result<TokenStream> {
let struct_name = &input.ident;
let (impl_gen, type_gen, where_clause) = input.generics.split_for_impl();
let fields = match input.fields {
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/src/traits.rs | use proc_macro2::TokenStream;
use quote::quote;
use syn::{Data, DeriveInput, Fields, FieldsNamed, Ident, Result};
pub(crate) fn process_light_traits(input: DeriveInput) -> Result<TokenStream> {
let name = &input.ident;
let trait_impls = match input.data {
Data::Struct(data_struct) => match data_struct... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros | solana_public_repos/Lightprotocol/light-protocol/macros/light-sdk-macros/src/program.rs | use std::{
collections::HashMap,
ops::{Deref, DerefMut},
};
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use syn::{
parse_quote, visit_mut::VisitMut, Attribute, FnArg, GenericArgument, Ident, Item, ItemFn,
ItemMod, ItemStruct, Pat, PathArguments, Result, Stmt, Token, Type,
};
//... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/light/Cargo.toml | [package]
name = "light-macros"
version = "1.1.0"
description = "Macros used in Light Protocol on-chain programs"
repository = "https://github.com/Lightprotocol/light-protocol"
license = "Apache-2.0"
edition = "2021"
[dependencies]
bs58 = "0.5"
proc-macro2 = { workspace = true }
quote = { workspace = true }
syn = { wo... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/light/Cargo.lock | # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aead"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
dependencies = [
"generic-ar... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/light/README.md | # light-macros
Set of proc-macros used in Light Protocol
| 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light | solana_public_repos/Lightprotocol/light-protocol/macros/light/src/pubkey.rs | use bs58::decode;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{parse::Parse, Error, LitStr, Result};
const PUBKEY_LEN: usize = 32;
pub(crate) struct PubkeyArgs {
pub(crate) pubkey: LitStr,
}
impl Parse for PubkeyArgs {
fn parse(input: syn::parse::ParseStream) -> Result<Self> {
Ok(Self {
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/light | solana_public_repos/Lightprotocol/light-protocol/macros/light/src/lib.rs | extern crate proc_macro;
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, parse_quote, ItemFn};
mod pubkey;
/// Converts a base58 encoded public key into a byte array.
#[proc_macro]
pub fn pubkey(input: TokenStream) -> TokenStream {
let args = parse_macro_input!(input as pubkey::Pubkey... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized/Cargo.toml | [package]
name = "aligned-sized"
version = "1.1.0"
description = "A macro which ensures the alignment and calculates the size of a struct"
repository = "https://github.com/Lightprotocol/light-protocol"
license = "Apache-2.0"
edition = "2021"
[lib]
proc-macro = true
[dependencies]
proc-macro2 = { workspace = true }
qu... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized/LICENSE | MIT License
Copyright (c) 2023 Light Protocol Labs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized/Cargo.lock | # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aligned-sized"
version = "0.1.0"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "proc-macro2"
version = "1.0.67"
source = "registry+https://github.com/rust-lang/crates.io... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros | solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized/README.md | # aligned-sized
A macro which ensures the alignment and calculates the size of a struct
| 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized | solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized/tests/test.rs | use std::mem;
use aligned_sized::aligned_sized;
#[aligned_sized]
#[derive(Debug)]
#[allow(dead_code)]
struct TestStruct {
pub a: u64,
pub b: u32,
pub c: i32,
pub d: TestStructNested,
}
#[aligned_sized]
#[derive(Debug)]
#[allow(dead_code)]
struct TestStructNested {
pub e: usize,
pub f: isize,
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized | solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized/src/lib.rs | //! **aligned-sized** is a library providing the `aligned_sized` macro, which:
//!
//! * Calculates a size of the given struct and provides a `LEN` constant with
//! that value.
//!
//! Future plans:
//!
//! * Ensuring that the struct is aligned, adding padding fields when
//! neccessary.
//!
//! # Motivation
//!
/... | 0 |
solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized | solana_public_repos/Lightprotocol/light-protocol/macros/aligned-sized/src/expand.rs | use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;
use syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
ConstParam, Error, Field, Fields, FieldsNamed, GenericParam, ItemStruct, LifetimeParam, Meta,
Result, Token, TypeParam,
};
pub(crate) struct AlignedSizedArgs {
/// Include ... | 0 |
solana_public_repos/Lightprotocol/light-protocol | solana_public_repos/Lightprotocol/light-protocol/programs/package.json | {
"name": "@lightprotocol/programs",
"version": "0.3.0",
"license": "Apache-2.0",
"scripts": {
"push-idls": "../scripts/push-stateless-js-idls.sh && ../scripts/push-compressed-token-idl.sh",
"build": "anchor build",
"build-idls": "anchor build && pnpm build-system && pnpm build-compressed-token && p... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs | solana_public_repos/Lightprotocol/light-protocol/programs/system/Cargo.toml | [package]
name = "light-system-program"
version = "1.2.0"
description = "ZK Compression on Solana"
repository = "https://github.com/Lightprotocol/light-protocol"
license = "Apache-2.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "lib"]
name = "light_system_program"
[features]
no-entrypoint = []
no-log-ix-name = []
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs | solana_public_repos/Lightprotocol/light-protocol/programs/system/README.md | # System program
The Light Protocol system program, usable for ZK Compression on Solana.
Documentation is available at https://zkcompression.com
Source code: https://github.com/Lightprotocol/light-protocol/tree/main/programs/system
## Audit
This code is unaudited. Use at your own risk.
| 0 |
solana_public_repos/Lightprotocol/light-protocol/programs | solana_public_repos/Lightprotocol/light-protocol/programs/system/Xargo.toml | [target.bpfel-unknown-unknown.dependencies.std]
features = []
| 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/constants.rs | pub const CPI_AUTHORITY_PDA_BUMP: u8 = 255;
| 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/lib.rs | use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey};
pub mod invoke;
pub use invoke::instruction::*;
pub mod invoke_cpi;
pub use invoke_cpi::{initialize::*, instruction::*};
pub mod constants;
pub mod errors;
pub mod sdk;
pub mod utils;
use errors::SystemProgramError;
use sdk::event::PublicTransactionEvent;
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/errors.rs | use anchor_lang::prelude::*;
#[error_code]
pub enum SystemProgramError {
#[msg("Sum check failed")]
SumCheckFailed,
#[msg("Signer check failed")]
SignerCheckFailed,
#[msg("Cpi signer check failed")]
CpiSignerCheckFailed,
#[msg("Computing input sum failed.")]
ComputeInputSumFailed,
#... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/utils.rs | use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED;
use anchor_lang::solana_program::pubkey::Pubkey;
pub fn get_registered_program_pda(program_id: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
&[program_id.to_bytes().as_slice()],
&account_compression::ID,
)
.0
}
pub fn ... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/processor.rs | use account_compression::utils::transfer_lamports::transfer_lamports_cpi;
use anchor_lang::{prelude::*, Bumps};
use light_heap::{bench_sbf_end, bench_sbf_start};
use light_verifier::CompressedProof as CompressedVerifierProof;
use crate::{
errors::SystemProgramError,
invoke::{
address::{derive_new_addre... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/nullify_state.rs | use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED;
use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey, Bumps, InstructionData};
use light_macros::heap_neutral;
use crate::{
constants::CPI_AUTHORITY_PDA_BUMP,
invoke::InstructionDataInvoke,
invoke_cpi::verify_signer::check_program_o... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/sol_compression.rs | use account_compression::utils::transfer_lamports::transfer_lamports_cpi;
use aligned_sized::*;
use anchor_lang::{
prelude::*,
solana_program::{account_info::AccountInfo, pubkey::Pubkey},
Bumps,
};
use crate::{
errors::SystemProgramError,
sdk::accounts::{InvokeAccounts, SignerAccounts},
Instruc... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/verify_signer.rs | use anchor_lang::{
err,
solana_program::{msg, pubkey::Pubkey},
Result,
};
use crate::{
errors::SystemProgramError, sdk::compressed_account::PackedCompressedAccountWithMerkleContext,
};
pub fn input_compressed_accounts_signer_check(
input_compressed_accounts_with_merkle_context: &[PackedCompressedA... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/address.rs | use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED;
use anchor_lang::{prelude::*, Bumps};
use crate::{
constants::CPI_AUTHORITY_PDA_BUMP,
invoke_cpi::verify_signer::check_program_owner_address_merkle_tree,
sdk::{
accounts::{InvokeAccounts, SignerAccounts},
address::derive_add... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/verify_state_proof.rs | use crate::{
sdk::{accounts::InvokeAccounts, compressed_account::PackedCompressedAccountWithMerkleContext},
NewAddressParamsPacked,
};
use account_compression::{
utils::check_discrimininator::check_discriminator, AddressMerkleTreeAccount,
StateMerkleTreeAccount,
};
use anchor_lang::{prelude::*, Bumps};
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/mod.rs | pub mod instruction;
pub use instruction::*;
pub mod address;
pub mod append_state;
pub mod emit_event;
pub mod nullify_state;
pub mod processor;
pub mod sol_compression;
pub mod sum_check;
pub mod verify_signer;
pub mod verify_state_proof;
| 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/append_state.rs | use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED;
use anchor_lang::{
prelude::*,
solana_program::{program::invoke_signed, pubkey::Pubkey},
Bumps,
};
use light_hasher::Poseidon;
use light_heap::{bench_sbf_end, bench_sbf_start};
use light_macros::heap_neutral;
use light_utils::hash_to_bn254_f... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/emit_event.rs | use account_compression::emit_indexer_event;
use anchor_lang::{prelude::*, Bumps};
use crate::{
errors::SystemProgramError,
sdk::{
accounts::InvokeAccounts,
event::{MerkleTreeSequenceNumber, PublicTransactionEvent},
},
InstructionDataInvoke,
};
pub fn emit_state_transition_event<'a, 'b... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/sum_check.rs | use crate::{
errors::SystemProgramError, sdk::compressed_account::PackedCompressedAccountWithMerkleContext,
OutputCompressedAccountWithPackedContext,
};
use anchor_lang::solana_program::program_error::ProgramError;
use anchor_lang::Result;
use light_macros::heap_neutral;
#[inline(never)]
#[heap_neutral]
pub fn... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke/instruction.rs | use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED};
use anchor_lang::prelude::*;
use super::processor::CompressedProof;
use crate::{
invoke::sol_compression::SOL_POOL_PDA_SEED,
sdk::{
accounts::{InvokeAccounts, SignerAccounts},
compressed_account::{... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/sdk/accounts.rs | use account_compression::program::AccountCompression;
use anchor_lang::prelude::*;
pub trait InvokeAccounts<'info> {
fn get_registered_program_pda(&self) -> &AccountInfo<'info>;
fn get_noop_program(&self) -> &UncheckedAccount<'info>;
fn get_account_compression_authority(&self) -> &UncheckedAccount<'info>;
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/sdk/address.rs | use std::collections::HashMap;
use anchor_lang::{err, solana_program::pubkey::Pubkey, Result};
use light_utils::hash_to_bn254_field_size_be;
use crate::{errors::SystemProgramError, NewAddressParams, NewAddressParamsPacked};
pub fn derive_address(merkle_tree_pubkey: &Pubkey, seed: &[u8; 32]) -> Result<[u8; 32]> {
... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/sdk/event.rs | use std::io::Write;
use anchor_lang::{
prelude::borsh, solana_program::pubkey::Pubkey, AnchorDeserialize, AnchorSerialize,
};
use crate::OutputCompressedAccountWithPackedContext;
#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, Default, PartialEq)]
pub struct MerkleTreeSequenceNumber {
pub pubkey: ... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/sdk/mod.rs | pub mod accounts;
pub mod address;
pub mod compressed_account;
pub mod event;
pub mod invoke;
use anchor_lang::prelude::*;
#[derive(AnchorSerialize, AnchorDeserialize, Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct CompressedCpiContext {
/// Is set by the program that is invoking the CPI to signal that is... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/sdk/invoke.rs | #![cfg(not(target_os = "solana"))]
use std::collections::HashMap;
use anchor_lang::{AnchorSerialize, InstructionData, ToAccountMetas};
use solana_sdk::{
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
};
use super::compressed_account::{
CompressedAccount, MerkleContext, PackedCompressedAccountWit... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/sdk/compressed_account.rs | use std::collections::HashMap;
use anchor_lang::prelude::*;
use light_hasher::{Hasher, Poseidon};
use light_utils::hash_to_bn254_field_size_be;
#[derive(Debug, PartialEq, Default, Clone, AnchorSerialize, AnchorDeserialize)]
pub struct PackedCompressedAccountWithMerkleContext {
pub compressed_account: CompressedAc... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke_cpi/processor.rs | pub use anchor_lang::prelude::*;
use light_heap::{bench_sbf_end, bench_sbf_start};
use super::verify_signer::cpi_signer_checks;
use crate::{
invoke::processor::process, invoke_cpi::instruction::InvokeCpiInstruction,
sdk::accounts::SignerAccounts, InstructionDataInvoke, InstructionDataInvokeCpi,
};
/// Process... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke_cpi/process_cpi_context.rs | use super::{account::CpiContextAccount, InstructionDataInvokeCpi};
use crate::errors::SystemProgramError;
use anchor_lang::prelude::*;
/// Cpi context enables the use of input compressed accounts owned by different
/// programs.
///
/// Example:
/// - a transaction calling a pda program needs to transfer tokens and mo... | 0 |
solana_public_repos/Lightprotocol/light-protocol/programs/system/src | solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke_cpi/initialize.rs | use account_compression::StateMerkleTreeAccount;
use anchor_lang::prelude::*;
use super::account::CpiContextAccount;
pub const CPI_SEED: &[u8] = b"cpi_signature_pda";
#[derive(Accounts)]
pub struct InitializeCpiContextAccount<'info> {
#[account(mut)]
pub fee_payer: Signer<'info>,
#[account(zero)]
pub ... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.