repo_id stringclasses 563
values | file_path stringlengths 40 166 | content stringlengths 1 2.94M | __index_level_0__ int64 0 0 |
|---|---|---|---|
solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src | solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src/state/source.rs | use anchor_lang::prelude::*;
use crate::{error::ProtocolError, util::MAX_NAME_LEN};
#[account]
pub struct FundingSource {
pub name: String,
pub authority: Pubkey,
pub pool_id: u64,
pub amount: u64,
pub bump: u8,
}
impl FundingSource {
pub const SEED_PREFIX: &'static str = "source";
pub c... | 0 |
solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src | solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src/state/mod.rs | pub mod pool;
pub mod project;
pub mod source;
pub mod milestone; | 0 |
solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src | solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src/state/project.rs | use anchor_lang::prelude::*;
use crate::{error::ProtocolError, util::MAX_NAME_LEN};
#[account]
#[derive(Default)]
pub struct Project {
pub project_id: u64,
pub name: String,
pub raised: u64, // Denominated in USDC
pub goal: u64, // Denominated in USDC
pub balance: u64, // Denominated in USDC
p... | 0 |
solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src | solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src/state/pool.rs | use anchor_lang::prelude::*;
use pyth_sdk_solana::load_price_feed_from_account_info;
use std::collections::{BTreeMap, HashMap};
use crate::{
error::ProtocolError,
util::{to_pubkey, MAX_NAME_LEN, USDC_MINT, USDC_DEVNET_MINT},
};
#[account]
#[derive(Default)]
pub struct Pool {
pub pool_id: u64,
pub name... | 0 |
solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src | solana_public_repos/StockpileLabs/stockpile-v2/programs/stockpile-v2/src/state/milestone.rs | use anchor_lang::prelude::*;
use crate::{error::ProtocolError, util::MAX_NAME_LEN};
#[account]
#[derive(Default)]
pub struct Milestone {
pub milestone_id: u64,
pub name: String,
pub percentage: f64,
pub close: u64,
pub associated_project: Pubkey,
pub bump: u8,
pub status: MilestoneStatus,
... | 0 |
solana_public_repos | solana_public_repos/helpers/tsconfig.types.json | {
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./dist/types"
}
} | 0 |
solana_public_repos | solana_public_repos/helpers/make-table-of-contents.ts | // A quick tool to generate the table of contents in the README
// Usage: 'esrun make-table-of-contents.ts'
import { exec as oldExec } from "node:child_process";
import { promisify } from "node:util";
const exec = promisify(oldExec);
const log = console.log.bind(console);
// Get all the headings from the README
const... | 0 |
solana_public_repos | solana_public_repos/helpers/tsconfig.esm.json | {
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"outDir": "./dist/esm",
"sourceMap": true
}
} | 0 |
solana_public_repos | solana_public_repos/helpers/.prettierrc.json | {}
| 0 |
solana_public_repos | solana_public_repos/helpers/package-lock.json | {
"name": "@solana-developers/helpers",
"version": "2.5.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@solana-developers/helpers",
"version": "2.5.6",
"license": "MIT",
"dependencies": {
"@solana/spl-token": "^0.4.8",
"@solana/spl-token-me... | 0 |
solana_public_repos | solana_public_repos/helpers/package.json | {
"name": "@solana-developers/helpers",
"version": "2.5.6",
"description": "Solana helper functions",
"type": "module",
"main": "./dist/esm/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/types/index.d.ts"... | 0 |
solana_public_repos | solana_public_repos/helpers/post-build.mjs | // In some cases, where you have { type: module } in package.json at the root
// We will workaround builds manually, since we aren't using any bundler
// tsc is missing extensions with esm exports
// and tsc doesn't export .cjs hence, index.js won't be read as cjs in cjs distribution
// See https://github.com/microsoft... | 0 |
solana_public_repos | solana_public_repos/helpers/tsconfig.cjs.json | {
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"outDir": "./dist/cjs",
"sourceMap": true
}
} | 0 |
solana_public_repos | solana_public_repos/helpers/tsconfig.json | {
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022", "DOM"],
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"isolatedModules": true,
"preserveConstEnums": true,
... | 0 |
solana_public_repos/helpers | solana_public_repos/helpers/tests/tsconfig.test.json | {
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"target": "ES2022",
"moduleResolution": "node",
"rootDir": "../",
"outDir": "../tests/dist",
"types": ["node"],
"esModuleInterop": true
},
"include": ["src/**/*", "tests/src/*"],
"exclude": [
"node_modu... | 0 |
solana_public_repos/helpers | solana_public_repos/helpers/tests/package.json | {
"scripts": {
"clean": "rm -rf dist",
"test": "npm run test:esm",
"test:ci": "npm run test:cjs && npm run test:esm",
"pretest:cjs": "npm run clean && tsc -p tsconfig.test.json",
"test:cjs": "node --test dist/tests/src/**/*.test.js",
"test:esm": "node --test --require esbuild-register src/**"
... | 0 |
solana_public_repos/helpers/tests | solana_public_repos/helpers/tests/src/airdrop.test.ts | import { describe, test } from "node:test";
import { Connection } from "@solana/web3.js";
import { airdropIfRequired, initializeKeypair, type InitializeKeypairOptions } from "../../src";
import assert from "node:assert";
import dotenv from "dotenv";
import { unlink as deleteFile } from "node:fs/promises"
import { LAMPO... | 0 |
solana_public_repos/helpers/tests | solana_public_repos/helpers/tests/src/transaction.test.ts | import { describe, test } from "node:test";
import { Keypair } from "@solana/web3.js";
import { LAMPORTS_PER_SOL } from "@solana/web3.js";
import { Connection } from "@solana/web3.js";
import { airdropIfRequired, confirmTransaction, getSimulationComputeUnits } from "../../src";
import { sendAndConfirmTransaction } from... | 0 |
solana_public_repos/helpers/tests | solana_public_repos/helpers/tests/src/logs.test.ts | import { describe, test } from "node:test";
import { Connection } from "@solana/web3.js";
import { airdropIfRequired, getCustomErrorMessage, getLogs } from "../../src";
import { LAMPORTS_PER_SOL } from "@solana/web3.js";
import { Keypair } from "@solana/web3.js";
import { Transaction } from "@solana/web3.js";
import { ... | 0 |
solana_public_repos/helpers/tests | solana_public_repos/helpers/tests/src/token.test.ts | import { describe, test } from "node:test";
import { LAMPORTS_PER_SOL } from "@solana/web3.js";
import { airdropIfRequired, createAccountsMintsAndTokenAccounts, makeTokenMint } from "../../src";
import { Connection } from "@solana/web3.js";
import { Keypair } from "@solana/web3.js";
import { getTokenMetadata } from "@s... | 0 |
solana_public_repos/helpers/tests | solana_public_repos/helpers/tests/src/keypair.test.ts | import { describe, test, before } from "node:test";
import assert from "node:assert";
import { addKeypairToEnvFile, getKeypairFromEnvironment, getKeypairFromFile, makeKeypairs } from "../../src";
import { Keypair } from "@solana/web3.js";
import base58 from "bs58";
// See https://m.media-amazon.com/images/I/51TJeGHxyTL... | 0 |
solana_public_repos/helpers/tests | solana_public_repos/helpers/tests/src/explorer.test.ts | import { getExplorerLink } from "../../src/index";
import { describe, test } from "node:test";
import assert from "node:assert";
describe("getExplorerLink", () => {
test("getExplorerLink works for a block on mainnet", () => {
const link = getExplorerLink("block", "242233124", "mainnet-beta");
assert.equal(li... | 0 |
solana_public_repos/helpers | solana_public_repos/helpers/src/types.ts | export interface InitializeKeypairOptions {
envFileName?: string;
envVariableName?: string;
airdropAmount?: number | null;
minimumBalance?: number;
keypairPath?: string;
} | 0 |
solana_public_repos/helpers | solana_public_repos/helpers/src/index.ts | export * from './lib/keypair';
export * from './lib/transaction';
export * from './lib/explorer';
export * from './lib/airdrop';
export * from './lib/token';
export * from './lib/logs';
export * from './types'; | 0 |
solana_public_repos/helpers/src | solana_public_repos/helpers/src/lib/airdrop.ts | import { type Connection, Keypair, LAMPORTS_PER_SOL, type PublicKey } from "@solana/web3.js";
import type { InitializeKeypairOptions } from "../types";
import { addKeypairToEnvFile, getKeypairFromEnvironment, getKeypairFromFile } from "./keypair";
const DEFAULT_AIRDROP_AMOUNT = 1 * LAMPORTS_PER_SOL;
const DEFAULT_MINI... | 0 |
solana_public_repos/helpers/src | solana_public_repos/helpers/src/lib/logs.ts | import { Connection, RpcResponseAndContext, SignatureResult, SimulatedTransactionResponse } from "@solana/web3.js";
import { confirmTransaction } from "./transaction";
export const getLogs = async (
connection: Connection,
tx: string,
): Promise<Array<string>> => {
await confirmTransaction(connection, tx);
con... | 0 |
solana_public_repos/helpers/src | solana_public_repos/helpers/src/lib/keypair.ts | import { Keypair } from "@solana/web3.js";
import base58 from "bs58";
// Default value from Solana CLI
const DEFAULT_FILEPATH = "~/.config/solana/id.json";
export const keypairToSecretKeyJSON = (keypair: Keypair): string => {
return JSON.stringify(Array.from(keypair.secretKey));
};
export const getKeypairFromFile ... | 0 |
solana_public_repos/helpers/src | solana_public_repos/helpers/src/lib/explorer.ts | import { Cluster } from "@solana/web3.js";
export const getCustomErrorMessage = (
possibleProgramErrors: Array<string>,
errorMessage: string,
): string | null => {
const customErrorExpression =
/.*custom program error: 0x(?<errorNumber>[0-9abcdef]+)/;
let match = customErrorExpression.exec(errorMessage);
... | 0 |
solana_public_repos/helpers/src | solana_public_repos/helpers/src/lib/transaction.ts | import { AddressLookupTableAccount, Commitment, ComputeBudgetProgram, Connection, PublicKey, TransactionInstruction, TransactionMessage, VersionedTransaction } from "@solana/web3.js";
import { getErrorFromRPCResponse } from "./logs";
export const confirmTransaction = async (
connection: Connection,
signature: stri... | 0 |
solana_public_repos/helpers/src | solana_public_repos/helpers/src/lib/token.ts | import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, Signer, SystemProgram, Transaction, TransactionInstruction, TransactionMessage, VersionedTransaction } from "@solana/web3.js";
import { makeKeypairs } from "./keypair";
import { createAssociatedTokenAccountIdempotentInstruction, createInitializeInstruc... | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/LICENSE | MIT License
Copyright (c) 2022 Solana Developers
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, publish,... | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/app.json | {
"name": "SolanaDappScaffold",
"displayName": "SolanaDappScaffold"
} | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/index.js | import 'react-native-get-random-values';
import 'react-native-url-polyfill/auto';
import {AppRegistry} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
| 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/_ruby-version | 2.7.5
| 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@ampproject/remapping@^2.1.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d"
integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAas... | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/metro.config.js | /**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const {getDefaultConfig} = require('metro-config');
module.exports = async () => {
const {
resolver: {sourceExts},
} = await getDefaultConfig();
return {
transformer: {
getTransformOptions: as... | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/babel.config.js | module.exports = {
presets: [
[
'module:metro-react-native-babel-preset',
{unstable_transformProfile: 'hermes-stable'},
],
],
};
| 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/package.json | {
"name": "solanadappscaffold",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@solana/web3.js": "^... | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/.buckconfig |
[android]
target = Google Inc.:Google APIs:23
[maven_repositories]
central = https://repo1.maven.org/maven2
| 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/.prettierrc.js | module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};
| 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/.watchmanconfig | {} | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/.eslintrc.js | module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-shadow': ['error'],
'no-shadow': 'off',
'no-undef': 'off',
... | 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/Gemfile | source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
| 0 |
solana_public_repos | solana_public_repos/dapp-scaffold-react-native/tsconfig.json |
{
"compilerOptions": {
/* Basic Options */
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', ... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/ios/.xcode.env | # This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_B... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/ios/Podfile | require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
target 'SolanaDappScaffold' do
config = use_native_modules!
# Flags change... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/ios/Podfile.lock | PODS:
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- FBLazyVector (0.70.0-rc.4)
- FBReactNativeSpec (0.70.0-rc.4):
- RCT-Folly (= 2021.07.22.00)
- RCTRequired (= 0.70.0-rc.4)
- RCTTypeSafety (= 0.70.0-rc.4)
- React-Core (= 0.70.0-rc.4)
- React-jsi (= 0.70.0-rc.4)
... | 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/LaunchScreen.storyboard | <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewC... | 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/AppDelegate.h | #import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window;
@end
| 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/main.m | #import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
| 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/AppDelegate.mm | #import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTAppSetupUtils.h>
#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#impo... | 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/Info.plist | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>SolanaDappScaffold</string>
<key>CFBundleExecuta... | 0 |
solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/Images.xcassets/Contents.json | {
"info" : {
"version" : 1,
"author" : "xcode"
}
}
| 0 |
solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/Images.xcassets | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold/Images.xcassets/AppIcon.appiconset/Contents.json | {
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x... | 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffold.xcworkspace/contents.xcworkspacedata | <?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:SolanaDappScaffold.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
| 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffoldTests/SolanaDappScaffoldTests.m | #import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React"
@interface SolanaDappScaffoldTests : XCTestCase
@end
@implementation SolanaDappScaffoldTests
- (BOOL)findSubviewInView:(UIView *)view ma... | 0 |
solana_public_repos/dapp-scaffold-react-native/ios | solana_public_repos/dapp-scaffold-react-native/ios/SolanaDappScaffoldTests/Info.plist | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifi... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/__tests__/App-test.tsx | /**
* @format
*/
import 'react-native';
import React from 'react';
import App from '../App';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
renderer.create(<App />);
});
| 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/_bundle/config | BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
| 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/android/gradlew | #!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/android/build.gradle | // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
if (System.properties['os.arch'] == "aarch64") {
... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/android/gradle.properties | # Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies ... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/android/gradlew.bat | @rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unles... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/android/settings.gradle | rootProject.name = 'SolanaDappScaffold'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.new... | 0 |
solana_public_repos/dapp-scaffold-react-native/android | solana_public_repos/dapp-scaffold-react-native/android/app/proguard-rules.pro | # Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# ... | 0 |
solana_public_repos/dapp-scaffold-react-native/android | solana_public_repos/dapp-scaffold-react-native/android/app/_BUCK | # To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Androi... | 0 |
solana_public_repos/dapp-scaffold-react-native/android | solana_public_repos/dapp-scaffold-react-native/android/app/build.gradle | apply plugin: "com.android.application"
import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the corre... | 0 |
solana_public_repos/dapp-scaffold-react-native/android | solana_public_repos/dapp-scaffold-react-native/android/app/build_defs.bzl | """Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/AndroidManifest.xml | <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.solanadappscaffold">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
andro... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/res | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/res/drawable/rn_edit_text_material.xml | <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/license... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/res | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/res/values/styles.xml | <resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
</style>
</resources>
| 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/res | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/res/values/strings.xml | <resources>
<string name="app_name">SolanaDappScaffold</string>
</resources>
| 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold/MainApplication.java | package com.solanadappscaffold;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import co... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold/MainActivity.java | package com.solanadappscaffold;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold/newarchitecture/MainApplicationReactNativeHost.java | package com.solanadappscaffold.newarchitecture;
import android.app.Application;
import androidx.annotation.NonNull;
import com.facebook.react.PackageList;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPa... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold/newarchitecture | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold/newarchitecture/components/MainComponentsRegistry.java | package com.solanadappscaffold.newarchitecture.components;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.soloader.SoLoader;
/**
* Class responsible to load the custom Fabric Components. This class has na... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold/newarchitecture | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/java/com/solanadappscaffold/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java | package com.solanadappscaffold.newarchitecture.modules;
import com.facebook.jni.HybridData;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.soloader.SoLoader;
import java.util.List;
... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/MainApplicationModuleProvider.h | #pragma once
#include <memory>
#include <string>
#include <ReactCommon/JavaTurboModule.h>
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string &moduleName,
const JavaTurboModule::InitParams ¶ms);
} // namespace react
} // namespace faceboo... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/MainApplicationModuleProvider.cpp | #include "MainApplicationModuleProvider.h"
#include <rncli.h>
#include <rncore.h>
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string &moduleName,
const JavaTurboModule::InitParams ¶ms) {
// Here you can provide your own module provider f... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/CMakeLists.txt | cmake_minimum_required(VERSION 3.13)
# Define the library name here.
project(solanadappscaffold_appmodules)
# This file includes all the necessary to let you build your application with the New Architecture.
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/MainComponentsRegistry.cpp | #include "MainComponentsRegistry.h"
#include <CoreComponentsRegistry.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/components/rncore/ComponentDescriptors.h>
#include <rncli.h>
namespace facebook {
namespace react {
MainComponent... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/MainComponentsRegistry.h | #pragma once
#include <ComponentFactory.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
namespace facebook {
namespace react {
class MainComponentsRegistry
: public facebook::jn... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/OnLoad.cpp | #include <fbjni/fbjni.h>
#include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainComponentsRegistry.h"
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
return facebook::jni::initialize(vm, [] {
facebook::react::MainApplicationTurboModuleManagerDelegate::
registerNatives();
faceboo... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h | #include <memory>
#include <string>
#include <ReactCommon/TurboModuleManagerDelegate.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
class MainApplicationTurboModuleManagerDelegate
: public jni::HybridClass<
MainApplicationTurboModuleManagerDelegate,
TurboModuleManagerDeleg... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/main | solana_public_repos/dapp-scaffold-react-native/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp | #include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainApplicationModuleProvider.h"
namespace facebook {
namespace react {
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
MainApplicationTurboModuleManagerDelegate::initHybrid(
jni::alias_ref<jhybridobject>) {
return makeCxxIn... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src | solana_public_repos/dapp-scaffold-react-native/android/app/src/debug/AndroidManifest.xml | <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:usesCleartextTraffic="true"
tools:target... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/app/src/debug/java/com | solana_public_repos/dapp-scaffold-react-native/android/app/src/debug/java/com/solanadappscaffold/ReactNativeFlipper.java | /**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.solanadappscaffold;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
imp... | 0 |
solana_public_repos/dapp-scaffold-react-native/android/gradle | solana_public_repos/dapp-scaffold-react-native/android/gradle/wrapper/gradle-wrapper.properties | distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
| 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/src/App.tsx | import React, {useRef} from 'react';
import {SafeAreaView, ScrollView, StatusBar} from 'react-native';
import {Header} from './components';
import {AccountProvider, ConnectionProvider} from './providers';
import {Wallet} from './screens';
export const App = () => {
const scrollViewRef = useRef<null | ScrollView>(nul... | 0 |
solana_public_repos/dapp-scaffold-react-native | solana_public_repos/dapp-scaffold-react-native/src/App.spec.tsx | import * as React from 'react';
import {render} from '@testing-library/react-native';
import '@testing-library/jest-native/extend-expect';
import App from './App';
test('renders correctly', () => {
const {getByTestId} = render(<App />);
expect(getByTestId('heading')).toHaveTextContent('Hi 👋');
});
| 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/providers/ConnectionProvider.tsx | import {Cluster, clusterApiUrl, Connection} from '@solana/web3.js';
import React, {ReactNode, useEffect, useState} from 'react';
const networks: Network[] = [
{id: 'devnet', name: 'Devnet', endpoint: 'devnet'},
{id: 'mainnet-beta', name: 'Mainnet Beta', endpoint: 'mainnet-beta'},
{id: 'testnet', name: 'Testnet',... | 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/providers/AccountProvider.tsx | import {Keypair, PublicKey} from '@solana/web3.js';
import React, {ReactNode, useEffect, useMemo, useState} from 'react';
export function elipsify(str = '', len = 4) {
if (str.length > 30) {
return (
str.substring(0, len) +
'...' +
str.substring(str.length - len, str.length)
);
}
return... | 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/providers/index.ts | export * from './AccountProvider';
export * from './ConnectionProvider';
| 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/screens/Wallet.tsx | import {LAMPORTS_PER_SOL} from '@solana/web3.js';
import React, {useEffect, useState} from 'react';
import {Button, Text, View} from 'react-native';
import {AccountSelect, Balance, NetworkSelect, Section} from '../components';
import {useAccounts, useConnections} from '../providers';
export const Wallet = () => {
co... | 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/screens/index.ts | export * from './Wallet';
| 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/components/Colors.tsx | export const Colors = {
primary: '#1292B4',
white: '#FFF',
lighter: '#F3F3F3',
light: '#DAE1E7',
dark: '#444',
darker: '#222',
black: '#000',
};
| 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/components/AccountSelect.tsx | import React from 'react';
import {Button} from 'react-native';
import {useAccounts} from '../providers';
import {Section} from './Section';
export const AccountSelect = () => {
const {accounts, selectedAccount, selectAccount, createAccount} =
useAccounts();
return (
<Section title={`Account: ${selectedAc... | 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/components/Section.tsx | import React, {ReactNode} from 'react';
import {StyleSheet, Text, useColorScheme, View} from 'react-native';
import {Colors} from './Colors';
export const Section: React.FC<{
children?: ReactNode;
description?: string;
title?: string;
}> = ({children, description, title}) => {
const isDarkMode = useColorScheme... | 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/components/Balance.tsx | import React from 'react';
import { Text } from 'react-native';
export function formatValue(value: string, decimals = 10) {
return Number.parseFloat(value).toFixed(decimals);
}
export function Balance({
balance,
decimals,
symbol,
}: {
balance: string;
decimals?: number;
symbol?: string;
}) {
return (
... | 0 |
solana_public_repos/dapp-scaffold-react-native/src | solana_public_repos/dapp-scaffold-react-native/src/components/NetworkSelect.tsx | import React from 'react';
import {Button} from 'react-native';
import {useConnections} from '../providers';
import {Section} from './Section';
export const NetworkSelect = () => {
const {
networkError,
networkVersion,
networks,
selectedNetwork,
selectNetwork,
} = useConnections();
return (
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.