@paw-wallet/wallet
v0.1.0
Published
🛠 An Wallet SDK - PanWallet
Downloads
34
Readme
Sdk Wallet
- Support a single type of wallet or multi type of wallet
- Create/Import wallet
- Some basic functions of a wallet: signMessage, transferToken, ...
How to install local
- Create file
.npmrc
in the root folder, with the content:
@digi-money:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=your_token
- Visit https://github.com/settings/tokens to create Classic Token if you don't have (at least has role
read:packages
) - Ping admin to add to whitelist at this link
- Run
npm install @digi-money/wallet
Install via git workflow
- Add
registry-url
,scope
andNODE_AUTH_TOKEN
...
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 20.x
registry-url: 'https://npm.pkg.github.com'
scope: '@digi-money'
...
- name: Install dependencies
uses: bahmutov/npm-install@HEAD
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ### authen npm
...
- Add your repo to
Manage Actions access
in at this link
How to use
Initialize SDK
- Make sure call these lines once
const config = {
debug: true, // enable logging to debug
userId: 'your_id', // telegram userId
getEncryptionKeyFn, // a function to get encryption key
}
// if your wallet support only 1 type of wallet:
const walletInstance = new EvmWallet(config)
// or
const walletInstance = new SolanaWallet(config)
// if your wallet support (or will support) multi-type wallet at the same time, we suggest you use this `MultiChainWallet`
const walletInstance = new MultiChainWallet(config)
Use by specific usecase
- See the code example at here: https://github.com/digi-money/pan-wallet-sdk/tree/main/src/test
How to publish this package
- Create file
.npmrc
in root folder, with content same as above - Update version in package.json
- Run
npm publish
- Check here