Skip to content

Commit cd2b055

Browse files
authored
feat(lazer): create js solana sdk package (#2899)
* feat(lazer): create js solana sdk package * refactor(lazer): improve js package configs
1 parent b2fcf52 commit cd2b055

File tree

14 files changed

+2380
-461
lines changed

14 files changed

+2380
-461
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ turbo.json @pyth-network/web-team
2323
/lazer/contracts/solana @Riateche @ali-behjati
2424
/lazer/publisher_sdk @darunrs @Riateche
2525
/lazer/sdk/js @ali-behjati @keyvankhademi
26+
/lazer/sdk/js-solana @ali-behjati @keyvankhademi
2627
/lazer/sdk/rust @darunrs @Riateche
2728

2829
flake.lock @cprussin

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pnpm-lock.yaml
22
patches/
3+
.mypy_cache/
34
.turbo/
45
target_chains/sui/vendor/
56
lazer/contracts/evm/lib/
@@ -38,3 +39,4 @@ target_chains/ton/sdk/js
3839
contract_manager
3940
lazer/contracts/solana
4041
lazer/sdk/js
42+
lazer/sdk/js-solana

lazer/contracts/solana/Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazer/sdk/js-solana/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Coverage directory used by tools like istanbul
2+
coverage
3+
4+
# Dependency directories
5+
node_modules/
6+
7+
# Optional npm cache directory
8+
.npm
9+
10+
# Optional REPL history
11+
.node_repl_history
12+
13+
# Output of 'npm pack'
14+
*.tgz
15+
16+
# dotenv environment variables file
17+
.env
18+
19+
# Build directory
20+
dist/
21+
22+
tsconfig.tsbuildinfo

lazer/sdk/js-solana/.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.vscode/
2+
coverage/
3+
dist/
4+
doc/
5+
doc*/
6+
node_modules/
7+
src/idl/

lazer/sdk/js-solana/eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { base as default } from "@cprussin/eslint-config";

lazer/sdk/js-solana/package.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "@pythnetwork/pyth-lazer-solana-sdk",
3+
"version": "0.1.0",
4+
"description": "Pyth Lazer Solana SDK",
5+
"publishConfig": {
6+
"access": "public"
7+
},
8+
"files": [
9+
"dist/**/*"
10+
],
11+
"main": "./dist/cjs/index.js",
12+
"types": "./dist/cjs/index.d.ts",
13+
"exports": {
14+
"import": {
15+
"types": "./dist/esm/index.d.ts",
16+
"default": "./dist/esm/index.js"
17+
},
18+
"require": {
19+
"types": "./dist/cjs/index.d.ts",
20+
"default": "./dist/cjs/index.js"
21+
}
22+
},
23+
"scripts": {
24+
"update-idl": "cd ../../contracts/solana && RUSTUP_TOOLCHAIN=nightly-2025-04-15 anchor build && cp target/types/pyth_lazer_solana_contract.ts ../../sdk/js-solana/src/idl/pyth-lazer-solana-contract.ts && cp target/idl/pyth_lazer_solana_contract.json ../../sdk/js-solana/src/idl/pyth-lazer-solana-contract.json",
25+
"build:cjs": "swc src -d dist/cjs --strip-leading-paths --copy-files -C module.type=commonjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
26+
"build:esm": "swc src -d dist/esm --strip-leading-paths --copy-files -C jsc.experimental.keepImportAttributes=true && echo '{\"type\":\"module\"}' > dist/esm/package.json",
27+
"fix:lint": "eslint --fix . --max-warnings 0",
28+
"test:lint": "eslint . --max-warnings 0",
29+
"test:types": "tsc",
30+
"test:format": "prettier --check .",
31+
"fix:format": "prettier --write .",
32+
"build:docs": "typedoc --out docs/typedoc src"
33+
},
34+
"devDependencies": {
35+
"@cprussin/eslint-config": "catalog:",
36+
"@cprussin/tsconfig": "catalog:",
37+
"@swc/cli": "catalog:",
38+
"@swc/core": "catalog:",
39+
"@types/node": "catalog:",
40+
"eslint": "catalog:",
41+
"prettier": "catalog:",
42+
"typedoc": "catalog:",
43+
"typescript": "catalog:"
44+
},
45+
"bugs": {
46+
"url": "https://github.com/pyth-network/pyth-crosschain/issues"
47+
},
48+
"type": "module",
49+
"homepage": "https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js-solana",
50+
"repository": {
51+
"type": "git",
52+
"url": "https://github.com/pyth-network/pyth-crosschain",
53+
"directory": "lazer/sdk/js-solana"
54+
},
55+
"keywords": [
56+
"pyth",
57+
"oracle"
58+
],
59+
"license": "Apache-2.0",
60+
"dependencies": {
61+
"@solana/buffer-layout": "catalog:",
62+
"@solana/web3.js": "catalog:"
63+
}
64+
}

0 commit comments

Comments
 (0)