Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8.9.0 Release (dev -> main) #1020

Merged
merged 19 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cb9f9ff
Add signMessage to sender.
kujtimprenkuSQA Nov 6, 2023
9b3ce22
Rename params -> message.
kujtimprenkuSQA Nov 6, 2023
820d736
Add tests for signMessage.
kujtimprenkuSQA Nov 6, 2023
7262341
Example with Vanilla JS
petersalomonsen Nov 17, 2023
485ee31
rename and combine according to suggestion
petersalomonsen Nov 20, 2023
60b0107
add open wallet selector button,
petersalomonsen Nov 20, 2023
76ed58a
Merge pull request #1011 from petersalomonsen/feat/example-vanilla-js
kujtimprenkuSQA Nov 20, 2023
81fb404
feat: Bitget wallet
Nov 20, 2023
72c4fe0
Update explorerUrl to Nearblocks.
kujtimprenkuSQA Nov 21, 2023
3a604f7
Merge pull request #1016 from near/966-update-explorerurl-in-network-…
kujtimprenkuSQA Nov 21, 2023
fbc2a97
Remove the extra if checks.
kujtimprenkuSQA Nov 22, 2023
223e134
Merge branch 'dev' into 996-add-support-for-signmessage-in-sender
kujtimprenkuSQA Nov 22, 2023
863be06
Include vanillajs/ to main readme of examples.
kujtimprenkuSQA Nov 24, 2023
a993fb1
Merge pull request #1013 from abner-jie/task-add-bitgetWallet
kujtimprenkuSQA Nov 24, 2023
c1c98ad
Merge pull request #1018 from near/1015-update-docs-for-main-readme-i…
kujtimprenkuSQA Nov 24, 2023
783c25f
Merge pull request #997 from near/996-add-support-for-signmessage-in-…
kujtimprenkuSQA Nov 24, 2023
c7c83ef
Bump version to 8.9.0
kujtimprenkuSQA Nov 27, 2023
7300394
Move bitget wallet publishing script to the end.
kujtimprenkuSQA Nov 27, 2023
db2eac0
Merge pull request #1019 from near/bump-version
kujtimprenkuSQA Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ NEAR Wallet Selector makes it easy for users to interact with your dApp by provi
- [WalletConnect](https://www.npmjs.com/package/@near-wallet-selector/wallet-connect) - Bridge wallet.
- [Here Wallet](https://www.npmjs.com/package/@near-wallet-selector/here-wallet) - Mobile wallet.
- [NearFi Wallet](https://www.npmjs.com/package/@near-wallet-selector/nearfi) - Mobile wallet.
- [Bitget Wallet](https://www.npmjs.com/package/@near-wallet-selector/bitget-wallet) - Browser wallet.
- [Ramper Wallet](https://www.npmjs.com/package/@near-wallet-selector/ramper-wallet) - Browser wallet.
- [Near Mobile Wallet](https://nearmobile.app/) - Mobile Wallet.
- [Mintbase Wallet](https://www.npmjs.com/package/@near-wallet-selector/mintbase-wallet) - Browser wallet.
Expand Down Expand Up @@ -54,6 +55,7 @@ Next, you'll need to install the wallets you want to support:
# Using Yarn
yarn add \
@near-wallet-selector/near-wallet \
@near-wallet-selector/bitget-wallet \
@near-wallet-selector/my-near-wallet \
@near-wallet-selector/sender \
@near-wallet-selector/nearfi \
Expand All @@ -76,6 +78,7 @@ yarn add \
# Using NPM.
npm install \
@near-wallet-selector/near-wallet \
@near-wallet-selector/bitget-wallet \
@near-wallet-selector/my-near-wallet \
@near-wallet-selector/sender \
@near-wallet-selector/nearfi \
Expand Down Expand Up @@ -111,6 +114,7 @@ Then in your dApp:
```ts
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupModal } from "@near-wallet-selector/modal-ui";
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
Expand All @@ -136,6 +140,7 @@ const selector = await setupWalletSelector({
network: "testnet",
modules: [
setupNearWallet(),
setupBitgetWallet(),
setupMyNearWallet(),
setupSender(),
setupHereWallet(),
Expand Down
2 changes: 2 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This folder contains two example projects that demonstrate how to integrate Near

- **`react/`**: React Example
- A React example project demonstrating the integration of the Near Wallet Selector.
- **`vanillajs/`**: Vanillajs Example
- A Vanillajs example project demonstrating the integration of the Near Wallet Selector.

## Getting Started

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { setupWalletSelector } from "@near-wallet-selector/core";
import type { WalletSelectorModal } from "@near-wallet-selector/account-export";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
import { setupXDEFI } from "@near-wallet-selector/xdefi";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
Expand Down Expand Up @@ -58,6 +59,7 @@ export class WalletSelectorExportComponent implements OnInit {
setupLedger(),
setupNearWallet(),
setupSender(),
setupBitgetWallet(),
setupXDEFI(),
setupMathWallet(),
setupNightly(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui-js";
import { setupModal } from "@near-wallet-selector/modal-ui-js";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
import { setupXDEFI } from "@near-wallet-selector/xdefi";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
Expand Down Expand Up @@ -60,6 +61,7 @@ export class WalletSelectorComponent implements OnInit {
setupLedger(),
setupNearWallet(),
setupSender(),
setupBitgetWallet(),
setupXDEFI(),
setupMathWallet(),
setupNightly(),
Expand Down
2 changes: 2 additions & 0 deletions examples/react/contexts/WalletSelectorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupNearFi } from "@near-wallet-selector/nearfi";
import { setupNightly } from "@near-wallet-selector/nightly";
import { setupSender } from "@near-wallet-selector/sender";
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupWelldoneWallet } from "@near-wallet-selector/welldone-wallet";
import { setupNearSnap } from "@near-wallet-selector/near-snap";
Expand Down Expand Up @@ -70,6 +71,7 @@ export const WalletSelectorContextProvider: React.FC<{
setupLedger(),
setupNearWallet(),
setupSender(),
setupBitgetWallet(),
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
Expand Down
2 changes: 2 additions & 0 deletions examples/react/contexts/WalletSelectorExportContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type { WalletSelectorModal } from "@near-wallet-selector/account-export";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
Expand Down Expand Up @@ -62,6 +63,7 @@ export const ExportAccountSelectorContextProvider: React.FC<{
setupLedger(),
setupNearWallet(),
setupSender(),
setupBitgetWallet(),
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
Expand Down
20 changes: 20 additions & 0 deletions examples/vanillajs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# NEAR wallet selector - vanilla JS example

This example shows how to use the NEAR wallet selector from a "vanilla" Javascript app, without using any framework like React or Angular.

In order to handle the imports and [importmap](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) is used. This has to be re-generated each time there is a change in the imports, but otherwise you can just make changes to the javascript or html and it will be visible instantly. For generating the import map [JSPM](https://jspm.org/) is used. The benefit of this while developing is that there is no re-bundling time like when using e.g. WebPack with React or Angular.

JSPM can also be used for creating a single file production bundle if needed.

## Creating the import map

This is only needed if imports of external scripts are changed. There's a yarn script for creating the importmap:

`yarn examples:vanillajs:generateimportmap`

## Serving the static files

[http-server](https://github.com/http-party/http-server) is used for serving the static files if you run:

`yarn serve:vanillajs`

91 changes: 91 additions & 0 deletions examples/vanillajs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@near-wallet-selector/[email protected]/styles.css">
</head>
<body>
<button id="open-walletselector-button">Open wallet selector</button>
</body>
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script>
<script type="importmap">
{
"imports": {
"@near-wallet-selector/core": "https://ga.jspm.io/npm:@near-wallet-selector/[email protected]/index.js",
"@near-wallet-selector/here-wallet": "https://ga.jspm.io/npm:@near-wallet-selector/[email protected]/index.js",
"@near-wallet-selector/modal-ui-js": "https://ga.jspm.io/npm:@near-wallet-selector/[email protected]/index.js",
"@near-wallet-selector/my-near-wallet": "https://ga.jspm.io/npm:@near-wallet-selector/[email protected]/index.js"
},
"scopes": {
"https://ga.jspm.io/": {
"@here-wallet/core": "https://ga.jspm.io/npm:@here-wallet/[email protected]/build/index.js",
"@near-js/accounts": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/crypto": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/keystores": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/keystores-browser": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/providers": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/signers": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/transactions": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/types": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/utils": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-js/wallet-account": "https://ga.jspm.io/npm:@near-js/[email protected]/lib/index.js",
"@near-wallet-selector/wallet-utils": "https://ga.jspm.io/npm:@near-wallet-selector/[email protected]/index.js",
"ajv": "https://ga.jspm.io/npm:[email protected]/dist/dev.ajv.js",
"ajv-formats": "https://ga.jspm.io/npm:[email protected]/dist/index.js",
"ajv/dist/compile/codegen": "https://ga.jspm.io/npm:[email protected]/dist/compile/codegen/index.js",
"base-x": "https://ga.jspm.io/npm:[email protected]/src/index.js",
"bn.js": "https://ga.jspm.io/npm:[email protected]/lib/bn.js",
"borsh": "https://ga.jspm.io/npm:[email protected]/lib/index.js",
"bs58": "https://ga.jspm.io/npm:[email protected]/index.js",
"buffer": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/buffer.js",
"capability": "https://ga.jspm.io/npm:[email protected]/index.js",
"capability/es5": "https://ga.jspm.io/npm:[email protected]/es5.js",
"charenc": "https://ga.jspm.io/npm:[email protected]/charenc.js",
"copy-to-clipboard": "https://ga.jspm.io/npm:[email protected]/index.js",
"crypt": "https://ga.jspm.io/npm:[email protected]/crypt.js",
"crypto": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/crypto.js",
"depd": "https://ga.jspm.io/npm:[email protected]/lib/browser/index.js",
"dijkstrajs": "https://ga.jspm.io/npm:[email protected]/dijkstra.js",
"encode-utf8": "https://ga.jspm.io/npm:[email protected]/index.js",
"error-polyfill": "https://ga.jspm.io/npm:[email protected]/index.js",
"events": "https://ga.jspm.io/npm:[email protected]/events.js",
"fast-deep-equal": "https://ga.jspm.io/npm:[email protected]/index.js",
"http": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/http.js",
"http-errors": "https://ga.jspm.io/npm:[email protected]/index.js",
"https": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/https.js",
"inherits": "https://ga.jspm.io/npm:[email protected]/inherits_browser.js",
"js-sha256": "https://ga.jspm.io/npm:[email protected]/src/sha256.js",
"json-schema-traverse": "https://ga.jspm.io/npm:[email protected]/index.js",
"mustache": "https://ga.jspm.io/npm:[email protected]/mustache.js",
"near-abi": "https://ga.jspm.io/npm:[email protected]/lib/index.js",
"near-api-js": "https://ga.jspm.io/npm:[email protected]/lib/browser-index.js",
"near-api-js/lib/providers": "https://ga.jspm.io/npm:[email protected]/lib/providers/index.js",
"near-api-js/lib/utils": "https://ga.jspm.io/npm:[email protected]/lib/utils/index.js",
"near-api-js/lib/utils/key_pair": "https://ga.jspm.io/npm:[email protected]/lib/utils/key_pair.js",
"near-api-js/lib/utils/serialize": "https://ga.jspm.io/npm:[email protected]/lib/utils/serialize.js",
"node-fetch": "https://ga.jspm.io/npm:[email protected]/browser.js",
"o3": "https://ga.jspm.io/npm:[email protected]/index.js",
"process": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/process.js",
"qrcode": "https://ga.jspm.io/npm:[email protected]/lib/browser.js",
"rxjs": "https://ga.jspm.io/npm:[email protected]/dist/esm5/index.js",
"safe-buffer": "https://ga.jspm.io/npm:[email protected]/index.js",
"setprototypeof": "https://ga.jspm.io/npm:[email protected]/index.js",
"sha1": "https://ga.jspm.io/npm:[email protected]/sha1.js",
"statuses": "https://ga.jspm.io/npm:[email protected]/dev.index.js",
"text-encoding-utf-8": "https://ga.jspm.io/npm:[email protected]/lib/encoding.lib.js",
"toggle-selection": "https://ga.jspm.io/npm:[email protected]/index.js",
"toidentifier": "https://ga.jspm.io/npm:[email protected]/index.js",
"tslib": "https://ga.jspm.io/npm:[email protected]/tslib.es6.mjs",
"tweetnacl": "https://ga.jspm.io/npm:[email protected]/nacl-fast.js",
"u3": "https://ga.jspm.io/npm:[email protected]/index.js",
"uri-js": "https://ga.jspm.io/npm:[email protected]/dist/es5/uri.all.js",
"uuid4": "https://ga.jspm.io/npm:[email protected]/browser.mjs"
},
"https://ga.jspm.io/npm:[email protected]/": {
"depd": "https://ga.jspm.io/npm:[email protected]/lib/browser/index.js"
}
}
}
</script>
<script type="module" src="main.js"></script>
</html>
19 changes: 19 additions & 0 deletions examples/vanillajs/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupModal } from "@near-wallet-selector/modal-ui-js";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupHereWallet } from "@near-wallet-selector/here-wallet";

const selector = await setupWalletSelector({
network: "testnet",
modules: [setupMyNearWallet(), setupHereWallet()],
});

const modal = setupModal(selector, {
contractId: "test.testnet",
});

window.selector = selector;
window.modal = modal;

document.getElementById('open-walletselector-button').addEventListener('click', () => modal.show());

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-wallet-selector",
"version": "8.8.0",
"version": "8.9.0",
"description": "NEAR Wallet Selector makes it easy for users to interact with your dApp by providing an abstraction over various wallets within the NEAR ecosystem",
"keywords": [
"near",
Expand All @@ -12,6 +12,7 @@
"near-wallet",
"near-snap",
"my-near-wallet",
"bitget-wallet",
"sender",
"neth",
"math-wallet",
Expand Down Expand Up @@ -45,6 +46,7 @@
"build:core": "nx run-many --target=build --projects=core --configuration=production",
"build:modal-ui": "nx run-many --target=build --projects=modal-ui --configuration=production",
"build:modal-ui-js": "nx run-many --target=build --projects=modal-ui-js --configuration=production",
"build:bitget-wallet": "nx run-many --target=build --projects=bitget-wallet --configuration=production",
"build:ledger": "nx run-many --target=build --projects=ledger --configuration=production",
"build:math-wallet": "nx run-many --target=build --projects=math-wallet --configuration=production",
"build:near-wallet": "nx run-many --target=build --projects=near-wallet --configuration=production",
Expand All @@ -66,6 +68,8 @@
"build:ramper-wallet": "nx run-many --target=build --projects=ramper-wallet --configuration=production",
"build:near-mobile-wallet": "nx run-many --target=build --projects=near-mobile-wallet --configuration=production",
"build:mintbase-wallet": "nx run-many --target=build --projects=mintbase-wallet --configuration=production",
"examples:vanillajs:generateimportmap": "(cd examples/vanillajs && jspm link index.html -o index.html)",
"serve:vanillajs": "yarn examples:vanillajs:generateimportmap && http-server -c-1 examples/vanillajs",
"lint": "nx workspace-lint && nx run-many --target=lint --all --parallel",
"lint:fix": "nx run-many --target=lint --all --fix",
"serve:react": "nx serve react --host=0.0.0.0",
Expand Down Expand Up @@ -194,6 +198,7 @@
"jest-mock-extended": "^2.0.6",
"jest-preset-angular": "13.0.0",
"jsdoc": "^4.0.2",
"jspm": "^3.1.0",
"nx": "16.0.0",
"nx-cloud": "16.0.5",
"path-browserify": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/account-export/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/account-export",
"version": "8.8.0",
"version": "8.9.0",
"description": "This is the Export Selector UI package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
10 changes: 10 additions & 0 deletions packages/bitget-wallet/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
18 changes: 18 additions & 0 deletions packages/bitget-wallet/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
59 changes: 59 additions & 0 deletions packages/bitget-wallet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# @near-wallet-selector/bitget-wallet

This is the [Bitget Wallet](https://chrome.google.com/webstore/detail/bitkeep-crypto-nft-wallet/jiidiaalihmmhddjgbnbgdfflelocpak) package for NEAR Wallet Selector.

## Installation and Usage

The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above:

```bash
# Using Yarn
yarn add near-api-js

# Using NPM.
npm install near-api-js
```
```bash
# Using Yarn
yarn add @near-wallet-selector/bitget-wallet

# Using NPM.
npm install @near-wallet-selector/bitget-wallet
```

Then use it in your dApp:

```ts
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";

// Bitget Wallet for Wallet Selector can be setup without any params or it can take one optional param.
const bitgetWallet = setupBitgetWallet());

const selector = await setupWalletSelector({
network: "testnet",
modules: [bitgetWallet],
});
```

## Options

- `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/bitget-wallet-icon`.
- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`.

## Assets

Assets such as icons can be found in the `/assets` directory of the package. Below is an example using Webpack:

```ts
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
import bitgetWalletIconUrl from "@near-wallet-selector/bitget-wallet/assets/bitget-wallet-icon";

const bitgetWallet = setupBitgetWallet({
iconUrl: bitgetWalletIconUrl
});
```

## License

This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading