Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
if in nodejs require ws
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Aug 9, 2023
1 parent 5e14fc1 commit a2fb42e
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 41 deletions.
190 changes: 152 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"namespace": "multiplechain",
"name": "@multiplechain/solana",
"version": "0.1.9",
"version": "0.1.11",
"description": "Solana has ready-made methods to connect to wallets and perform many transactions.",
"scripts": {
"serve": "parcel test.html --no-cache --dist-dir test",
"build": "webpack",
"push": "webpack && npm publish"
},
"files": [
"dist",
"resources"
"src",
"dist"
],
"main": "dist/solana-provider.js",
"types": "index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const Token = require('./entity/token');
const SplToken = require('@solana/spl-token');
const Transaction = require('./entity/transaction');

if (typeof window === 'undefined') {
WebSocket = require('ws');
}

class Provider {

/**
Expand Down

0 comments on commit a2fb42e

Please sign in to comment.