Skip to content

Commit 8a787b1

Browse files
author
adpthegreat
committed
feat : added create tokens
1 parent 2c4bc25 commit 8a787b1

File tree

14 files changed

+179
-0
lines changed

14 files changed

+179
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.anchor
2+
.DS_Store
3+
target
4+
**/*.rs.bk
5+
node_modules
6+
test-ledger
7+
.yarn
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.anchor
2+
.DS_Store
3+
target
4+
node_modules
5+
dist
6+
build
7+
test-ledger
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[toolchain]
2+
3+
[features]
4+
resolution = true
5+
skip-lint = false
6+
7+
[programs.localnet]
8+
create_tokens = "9zHaE8x381ZRg78MiEykQbgs1jDcLT52dooPrEj3PN9Z"
9+
10+
[registry]
11+
url = "https://api.apr.dev"
12+
13+
[provider]
14+
cluster = "Localnet"
15+
wallet = "~/.config/solana/id.json"
16+
17+
[scripts]
18+
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[workspace]
2+
members = [
3+
"programs/*"
4+
]
5+
resolver = "2"
6+
7+
[profile.release]
8+
overflow-checks = true
9+
lto = "fat"
10+
codegen-units = 1
11+
[profile.release.build-override]
12+
opt-level = 3
13+
incremental = false
14+
codegen-units = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Migrations are an early feature. Currently, they're nothing more than this
2+
// single deploy script that's invoked from the CLI, injecting a provider
3+
// configured from the workspace's Anchor.toml.
4+
5+
const anchor = require("@coral-xyz/anchor");
6+
7+
module.exports = async function (provider) {
8+
// Configure client to use the provider.
9+
anchor.setProvider(provider);
10+
11+
// Add your deploy script here.
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"license": "ISC",
3+
"scripts": {
4+
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
5+
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
6+
},
7+
"dependencies": {
8+
"@coral-xyz/anchor": "^0.30.1"
9+
},
10+
"devDependencies": {
11+
"chai": "^4.3.4",
12+
"mocha": "^9.0.3",
13+
"ts-mocha": "^10.0.0",
14+
"@types/bn.js": "^5.1.0",
15+
"@types/chai": "^4.3.0",
16+
"@types/mocha": "^9.0.0",
17+
"typescript": "^4.3.5",
18+
"prettier": "^2.6.2"
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "create_tokens"
3+
version = "0.1.0"
4+
description = "Created with Anchor"
5+
edition = "2021"
6+
7+
[lib]
8+
crate-type = ["cdylib", "lib"]
9+
name = "create_tokens"
10+
11+
[features]
12+
default = []
13+
cpi = ["no-entrypoint"]
14+
no-entrypoint = []
15+
no-idl = []
16+
no-log-ix-name = []
17+
idl-build = ["anchor-lang/idl-build"]
18+
19+
[dependencies]
20+
anchor-lang = "0.30.1"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.bpfel-unknown-unknown.dependencies.std]
2+
features = []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use anchor_lang::prelude::*;
2+
3+
declare_id!("9zHaE8x381ZRg78MiEykQbgs1jDcLT52dooPrEj3PN9Z");
4+
5+
#[program]
6+
pub mod create_tokens {
7+
use super::*;
8+
9+
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
10+
msg!("Greetings from: {:?}", ctx.program_id);
11+
Ok(())
12+
}
13+
}
14+
15+
#[derive(Accounts)]
16+
pub struct Initialize {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as anchor from "@coral-xyz/anchor";
2+
import { Program } from "@coral-xyz/anchor";
3+
import { CreateTokens } from "../target/types/create_tokens";
4+
5+
describe("create_tokens", () => {
6+
// Configure the client to use the local cluster.
7+
anchor.setProvider(anchor.AnchorProvider.env());
8+
9+
const program = anchor.workspace.CreateTokens as Program<CreateTokens>;
10+
11+
it("Is initialized!", async () => {
12+
// Add your test here.
13+
const tx = await program.methods.initialize().rpc();
14+
console.log("Your transaction signature", tx);
15+
});
16+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"types": ["mocha", "chai"],
4+
"typeRoots": ["./node_modules/@types"],
5+
"lib": ["es2015"],
6+
"module": "commonjs",
7+
"target": "es6",
8+
"esModuleInterop": true
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "ts-programs",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
12+
"dependencies": {
13+
"@solanaturbine/poseidon": "^0.0.6"
14+
}
15+
}

tokens/create-token/poseidon/ts-programs/pnpm-lock.yaml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tokens/create-token/poseidon/ts-programs/src/testing.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)