Socket
Socket
Sign inDemoInstall

@solana/spl-token

Package Overview
Dependencies
Maintainers
11
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/spl-token - npm Package Compare versions

Comparing version 0.1.8 to 0.2.0-alpha.0

lib/cjs/actions/approve.d.ts

176

package.json
{
"name": "@solana/spl-token",
"version": "0.1.8",
"description": "SPL Token JavaScript API",
"license": "MIT",
"author": "Solana Maintainers <maintainers@solana.com>",
"homepage": "https://solana.com/",
"repository": {
"type": "git",
"url": "https://github.com/solana-labs/solana-program-library"
},
"bugs": {
"url": "https://github.com/solana-labs/solana-program-library/issues"
},
"publishConfig": {
"access": "public"
},
"browser": {
"./lib/index.cjs.js": "./lib/index.browser.esm.js",
"./lib/index.esm.js": "./lib/index.browser.esm.js"
},
"main": "lib/index.cjs.js",
"module": "lib/index.esm.js",
"types": "lib/index.d.ts",
"browserslist": [
"defaults",
"not IE 11",
"maintained node versions"
],
"files": [
"/lib",
"/module.flow.js"
],
"testnetDefaultChannel": "v1.3.17",
"scripts": {
"build": "rollup -c",
"build:browser-test": "rollup -c test/rollup.config.js",
"start": "babel-node cli/main.js",
"start-with-test-validator": "start-server-and-test 'solana-test-validator --reset --quiet' http://localhost:8899/health start",
"lint": "npm run pretty && eslint .",
"lint:fix": "npm run pretty:fix && eslint . --fix",
"flow": "flow check-contents < module.flow.js",
"flow:watch": "watch 'flow' . --wait=1 --ignoreDirectoryPattern=/doc/",
"lint:watch": "watch 'npm run lint:fix' . --wait=1",
"build:program": "rm -f client/util/store/config.json; cargo build-bpf --manifest-path ../program/Cargo.toml",
"cluster:localnet": "rm -f .env",
"cluster:devnet": "cp cluster-devnet.env .env",
"cluster:testnet": "cp cluster-testnet.env .env",
"cluster:mainnet-beta": "cp cluster-mainnet-beta.env .env",
"defs": "set -ex; flow check-contents < module.flow.js; tsc --esModuleInterop module.d.ts",
"pretty": "prettier --check '{,cli*/**/}*.[jt]s'",
"pretty:fix": "prettier --write '{,cli*/**/}*.[jt]s'",
"test": "mocha './test/**/*.test.js'",
"test:browser": "npm run build:browser-test && mocha-headless-chrome -f http://localhost:8080/mocha.html --timeout 180000",
"test:browser-with-server": "start-server-and-test 'http-server -p 8080' 8080 test:browser"
},
"dependencies": {
"@babel/runtime": "^7.10.5",
"@solana/web3.js": "^1.21.0",
"bn.js": "^5.1.0",
"buffer": "6.0.3",
"buffer-layout": "^1.2.0",
"dotenv": "10.0.0"
},
"devDependencies": {
"@babel/cli": "^7.10.5",
"@babel/core": "^7.10.5",
"@babel/node": "^7.10.5",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"@babel/preset-flow": "^7.10.4",
"@babel/register": "^7.13.0",
"@rollup/plugin-alias": "^3.1.2",
"@rollup/plugin-babel": "^5.1.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@types/bn.js": "^5.1.0",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"babel-eslint": "^10.1.0",
"chai": "^4.3.0",
"chai-as-promised": "^7.1.1",
"eslint": "^7.4.0",
"eslint-plugin-flowtype": "^5.3.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-mocha": "^9.0.0",
"esm": "^3.2.25",
"flow-bin": "^0.157.0",
"flow-remove-types": "^2.145.0",
"flow-typed": "^3.3.1",
"http-server": "^0.12.3",
"mkdirp": "^1.0.4",
"mocha": "^9.0.0",
"mocha-headless-chrome": "^3.1.0",
"mz": "^2.7.0",
"prettier": "^2.0.5",
"rollup": "^2.23.0",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"rollup-plugin-terser": "^7.0.2",
"start-server-and-test": "^1.11.6",
"typescript": "^4.1.3",
"watch": "^1.0.2"
},
"engines": {
"node": ">= 10"
}
"name": "@solana/spl-token",
"version": "0.2.0-alpha.0",
"author": "Solana Maintainers <maintainers@solana.foundation>",
"repository": "https://github.com/solana-labs/solana-program-library",
"license": "Apache-2.0",
"engines": {
"node": ">= 14"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"src",
"LICENSE",
"README.md"
],
"type": "module",
"sideEffects": false,
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/esm/index.d.ts",
"exports": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
},
"scripts": {
"clean": "shx rm -rf lib",
"build": "yarn clean && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
"postbuild": "echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json && echo '{\"type\":\"module\"}' > lib/esm/package.json",
"deploy": "yarn docs && gh-pages --dist docs --dotfiles",
"example": "node --experimental-specifier-resolution=node --loader ts-node/esm examples/create_mint_and_transfer_tokens.ts",
"test": "mocha",
"docs": "shx rm -rf docs && NODE_OPTIONS=--max_old_space_size=4096 typedoc && shx cp .nojekyll docs/",
"fmt": "prettier --write '{*,**/*}.{js,ts,jsx,tsx,json}'",
"lint": "eslint --ext .ts . && prettier --check '{*,**/*}.{js,ts,jsx,tsx,json}'",
"lint:fix": "eslint --fix --ext .ts . && yarn fmt",
"nuke": "shx rm -rf node_modules yarn.lock"
},
"dependencies": {
"@solana/buffer-layout": "^4.0.0",
"@solana/buffer-layout-utils": "^0.1.1",
"@solana/web3.js": "^1.20.0"
},
"devDependencies": {
"@types/chai-as-promised": "^7.1.4",
"@types/eslint": "^8.2.1",
"@types/eslint-plugin-prettier": "^3.1.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.13",
"@types/prettier": "^2.4.2",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"gh-pages": "^3.2.3",
"mocha": "^9.1.3",
"prettier": "^2.5.1",
"shx": "^0.3.3",
"ts-node": "^10.4.0",
"tslib": "^2.3.1",
"typedoc": "^0.22.10",
"typescript": "^4.4.4"
}
}

@@ -1,74 +0,50 @@

# Token JavaScript API
# `@solana/spl-token`
The Token JavaScript library comprises:
A TypeScript library for interacting with the SPL Token program.
* A library to interact with the on-chain program
* A test client that exercises the program
* Scripts to facilitate building the program
## Links
## Getting Started
- [TypeScript Docs](...)
- [FAQ (Frequently Asked Questions)](.../FAQ.md)
- [Install](#install)
- [Usage](#usage)
- [Build from Source](#build-from-source)
First fetch the npm dependencies, including `@solana/web3.js`, by running:
```bash
$ npm install
## Install
```shell
yarn add @solana/spl-token
```
### Select a Network
## Usage
The client connects to a local Solana cluster by default.
To enable on-chain program logs, set the `RUST_LOG` environment variable:
```bash
$ export RUST_LOG=solana_runtime::native_loader=trace,solana_runtime::system_instruction_processor=trace,solana_runtime::bank=debug,solana_bpf_loader=debug,solana_rbpf=debug
```ts
@TODO
```
To start a local Solana cluster run:
```bash
$ solana-test-validator
```
## Build from Source
Solana cluster logs are available with:
```bash
$ solana --url http://127.0.0.1:8899/ logs
1. Clone the project:
```shell
git clone https://github.com/solana-labs/solana-program-library.git
```
### Build the on-chain program
```bash
$ npm run build:program
2. Navigate to the library:
```shell
cd solana-program-library/token/ts
```
### Run the test client
```bash
$ npm run start
3. Install the dependencies:
```shell
yarn install
```
## Pointing to a public Solana cluster
Solana maintains three public clusters:
- `devnet` - Development cluster with airdrops enabled
- `testnet` - Tour De Sol test cluster without airdrops enabled
- `mainnet-beta` - Main cluster
Use npm scripts to configure which cluster.
To point to `devnet`:
```bash
$ npm run cluster:devnet
4. Build the library:
```shell
yarn build
```
To point back to the local cluster:
```bash
$ npm run cluster:localnet
5. Run the tests:
```shell
yarn test
```
## Releasing
1. (first-time only) Create your account on npmjs.com (with 2FA enabled!) and ask @mvines about granting the publish right and run `npm login`
3. Bump version in `package.json` and `npm install` (to update `package-lock.json`)
4. Create a PR for the version bump
5. Merge the PR and push new git tag on master branch
6. Create release on github.com from the pushed tag
7. Run `npm run build` and `npm publish`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc