This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/web3 provider #6
Open
ArtSuslov
wants to merge
5
commits into
main
Choose a base branch
from
feature/web3-provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ lerna.json | |
esbuild.js | ||
babel.config.json | ||
babel.config.node.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/.github/ | ||
/.vscode/ | ||
/node_modules/ | ||
packages/**/node_modules/ | ||
/tmp/ | ||
.idea/* | ||
/docs/ | ||
|
||
coverage | ||
*.log | ||
|
||
package-lock.json | ||
/*.tgz | ||
/tmp* | ||
/mnt/ | ||
/package/ | ||
/src/test/ | ||
*.test.ts | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
babel-debug.log | ||
|
||
.browserslistrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitlab-ci.yml | ||
jest.config.js | ||
.prettierrc | ||
tsconfig.json | ||
tsconfig.base.json | ||
lerna.json | ||
/scripts/ | ||
esbuild.js | ||
babel.config.json | ||
babel.config.node.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/.github/ | ||
/.vscode/ | ||
/node_modules/ | ||
packages/**/node_modules/ | ||
/tmp/ | ||
.idea/* | ||
/docs/ | ||
|
||
coverage | ||
*.log | ||
|
||
package-lock.json | ||
/*.tgz | ||
/tmp* | ||
/mnt/ | ||
/package/ | ||
/src/test/ | ||
*.test.ts | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
babel-debug.log | ||
|
||
.browserslistrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitlab-ci.yml | ||
jest.config.js | ||
.prettierrc | ||
tsconfig.json | ||
tsconfig.base.json | ||
lerna.json | ||
/scripts/ | ||
esbuild.js | ||
babel.config.json | ||
babel.config.node.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './promise-helpers' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function sleep(ms: number): Promise<void> { | ||
return new Promise(resolve => setTimeout(resolve, ms)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './math' | ||
export * from './date' | ||
export * from '../types/index' | ||
export * from './helpers' |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/.github/ | ||
/.vscode/ | ||
/node_modules/ | ||
packages/**/node_modules/ | ||
/tmp/ | ||
.idea/* | ||
/docs/ | ||
|
||
coverage | ||
*.log | ||
|
||
package-lock.json | ||
/*.tgz | ||
/tmp* | ||
/mnt/ | ||
/package/ | ||
/src/test/ | ||
*.test.ts | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
babel-debug.log | ||
|
||
.browserslistrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitlab-ci.yml | ||
jest.config.js | ||
.prettierrc | ||
tsconfig.json | ||
tsconfig.base.json | ||
lerna.json | ||
/scripts/ | ||
esbuild.js | ||
babel.config.json | ||
babel.config.node.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# @distributedlab/utils | ||
Typescript-based utils for Distributed Lab projects | ||
|
||
![version (scoped package)](https://badgen.net/npm/v/@distributedlab/utils) | ||
![types](https://badgen.net/npm/types/@distributedlab/utils) | ||
![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@distributedlab/utils) | ||
![checks](https://badgen.net/github/checks/distributed-lab/web-kit/main) | ||
|
||
## Changelog | ||
ArtSuslov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
<details><summary>1.0.0</summary> | ||
<h4>Under the hood changes</h4> | ||
<ul> | ||
<li>Initiated project</li> | ||
</ul> | ||
</details> | ||
<details><summary>1.0.1</summary> | ||
<h4>Fixed</h4> | ||
<ul> | ||
<li>Readme</li> | ||
</ul> | ||
</details> | ||
<details><summary>1.0.2</summary> | ||
<h4>Fixed</h4> | ||
<ul> | ||
<li>@babel/runtime dependency</li> | ||
</ul> | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../babel.config.base.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../babel.config.base.node.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env node | ||
|
||
const esbuild = require('esbuild') | ||
const plugin = require('node-stdlib-browser/helpers/esbuild/plugin') | ||
const stdLibBrowser = require('node-stdlib-browser') | ||
|
||
;(async () => { | ||
await esbuild.build({ | ||
entryPoints: ['src/browser.ts'], | ||
bundle: true, | ||
minify: true, | ||
sourcemap: 'external', | ||
outfile: 'lib/web3-provider.min.js', | ||
inject: [require.resolve('node-stdlib-browser/helpers/esbuild/shim')], | ||
define: { | ||
global: 'global', | ||
process: 'process', | ||
Buffer: 'Buffer', | ||
}, | ||
plugins: [plugin(stdLibBrowser)], | ||
}) | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const baseConfig = require('../../jest.config.base') | ||
|
||
module.exports = { | ||
...baseConfig, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "@distributedlab/web3-provider", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about rename it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's a lib to work with providers, and web3 - is a common term and can we like web3.js, etc... |
||
"description": "Web3 Provider", | ||
"version": "1.0.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1.0.0 |
||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"main": "./lib/cjs/index.js", | ||
"module": "./lib/esm/index.js", | ||
"browser": "./lib/web3-provider.min.js", | ||
"unpkg": "./lib/web3-provider.min.js", | ||
"types": "./lib/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./lib/esm/index.js", | ||
"require": "./lib/cjs/index.js" | ||
} | ||
}, | ||
"typedoc": { | ||
"entryPoint": "./src/index.ts", | ||
"readmeFile": "./README.md", | ||
"displayName": "@distributedlab/web3-provider" | ||
}, | ||
"sideEffects": false, | ||
"scripts": { | ||
"type-check": "tsc --noEmit", | ||
"build": "yarn clean && yarn build:types && yarn build:cjs && yarn build:esm && yarn build:browser", | ||
"build:cjs": "babel src --out-dir lib/cjs --extensions \".ts,.tsx\" --config-file ./babel.config.node.json", | ||
"build:esm": "babel src --out-dir lib/esm --extensions \".ts,.tsx\" --config-file ./babel.config.json", | ||
"build:types": "tsc --emitDeclarationOnly && tsc-alias -p tsconfig.json", | ||
"build:browser": "node ./esbuild.js", | ||
"clean": "rm -rf lib" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.19.0", | ||
"@distributedlab/utils": "*", | ||
"@solana/web3.js": "^1.63.1", | ||
"@vue/reactivity": "^3.2.39", | ||
"bs58": "^5.0.0", | ||
"ethers": "^5.7.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* This file is the entrypoint of browser builds. | ||
* The code executes when loaded in a browser. | ||
*/ | ||
import * as Web3Provider from './index' | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
;(window as any).webKitWeb3Provider = Web3Provider | ||
|
||
console.warn('Web3 provider was added to the window object.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useProvider' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './use-provider' | ||
export * from './providers' | ||
export * from './use-web3' |
4 changes: 4 additions & 0 deletions
4
packages/web3-provider/src/composables/useProvider/providers/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './use-coinbase' | ||
export * from './use-metamask' | ||
export * from './use-solflare' | ||
export * from './use-phantom' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove