Skip to content

Commit

Permalink
fix issue with wallet icons, fix module path
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Jan 11, 2024
1 parent 2217add commit 69c73c7
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 15 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,11 @@ Then, you can start naxius as follows:
import naxios from '@wpdas/naxios'
import { setupMyNearWallet } from '@near-wallet-selector/my-near-wallet'
import { setupLedger } from '@near-wallet-selector/ledger'
import MyNearIconUrl from '@near-wallet-selector/my-near-wallet/assets/my-near-wallet-icon.png'
import LedgerIconUrl from '@near-wallet-selector/ledger/assets/ledger-icon.png'

const naxiosApi = new naxios({
contractId: CONTRACT_ID,
network: 'testnet', // or mainnet, localnet
walletSelectorModules: [
setupMyNearWallet({ iconUrl: MyNearIconUrl.src }),
setupLedger({ iconUrl: LedgerIconUrl.src }),
],
walletSelectorModules: [setupMyNearWallet(), setupLedger()],
})
```

Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "@wpdas/naxios",
"version": "1.0.1",
"version": "1.0.2",
"description": "Promise based NEAR Contract and NEAR Wallet client for browser",
"main": "dist/cjs/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"homepage": "https://github.com/wpdas/naxios",
"repository": {
"type": "git",
Expand All @@ -17,9 +16,7 @@
"LICENSE.md"
],
"scripts": {
"build": "rm -rf dist; npm run build:esm; npm run build:cjs",
"build:esm": "tsc",
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
"build": "rm -rf dist; tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json",
"prepack": "npm install; npm run build"
},
"keywords": [
Expand Down
3 changes: 1 addition & 2 deletions src/naxios.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { WalletModuleFactory } from '@near-wallet-selector/core'
import { setupMyNearWallet } from '@near-wallet-selector/my-near-wallet'
import MyNearIconUrl from '@near-wallet-selector/my-near-wallet/assets/my-near-wallet-icon.png'
import ContractManager from './managers/contract-manager'
import WalletManager from './managers/wallet-manager'
import { Config, Network } from './managers/types'

class naxios {
private contractId: string
private network: Network
private walletSelectorModules: WalletModuleFactory[] = [setupMyNearWallet({ iconUrl: MyNearIconUrl.src })]
private walletSelectorModules: WalletModuleFactory[] = [setupMyNearWallet()]

constructor(config: Config) {
this.contractId = config.contractId
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"module": "commonjs"
}
}
7 changes: 7 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/esm",
"module": "esnext"
}
}
8 changes: 8 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/types",
"declaration": true,
"emitDeclarationOnly": true
}
}

0 comments on commit 69c73c7

Please sign in to comment.