Skip to content

Commit

Permalink
Merge pull request #824 from near/dev
Browse files Browse the repository at this point in the history
v8.1.2 Release (dev -> main)
  • Loading branch information
DamirSQA authored Jun 6, 2023
2 parents 107ba92 + 3c0e881 commit 63dc202
Show file tree
Hide file tree
Showing 32 changed files with 106 additions and 172 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-wallet-selector",
"version": "8.1.1",
"version": "8.1.2",
"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 Down Expand Up @@ -88,11 +88,11 @@
"@ledgerhq/hw-transport": "6.27.1",
"@ledgerhq/hw-transport-webhid": "6.27.1",
"@metamask/detect-provider": "^2.0.0",
"@meteorwallet/sdk": "^0.6.0",
"@meteorwallet/sdk": "^0.8.0",
"@nightlylabs/connect-near": "0.0.15",
"@walletconnect/sign-client": "2.7.2",
"@walletconnect/sign-client": "2.7.8",
"@web3modal/standalone": "^2.2.2",
"better-sqlite3": "^8.2.0",
"better-sqlite3": "^8.4.0",
"big.js": "^6.1.1",
"bn.js": "^5.2.0",
"bs58": "^5.0.0",
Expand All @@ -115,7 +115,7 @@
"rxjs": "^7.8.1",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"tslib": "^2.3.0",
"tslib": "^2.5.2",
"tweetnacl": "^1.0.3",
"tweetnacl-util": "^0.15.1",
"url": "^0.11.0",
Expand Down Expand Up @@ -163,7 +163,7 @@
"@types/w3c-web-usb": "^1.0.5",
"@typescript-eslint/eslint-plugin": "5.13.0",
"@typescript-eslint/parser": "5.13.0",
"@walletconnect/types": "^2.7.2",
"@walletconnect/types": "^2.7.8",
"babel-jest": "27.2.3",
"cypress": "^9.1.0",
"eslint": "~8.15.0",
Expand Down
11 changes: 8 additions & 3 deletions packages/account-export/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @near-wallet-selector/account-export

This is the Export Selector UI package for NEAR Wallet Selector.
This is the Account Export Selector UI package for NEAR Wallet Selector.

## Installation and Usage

Expand Down Expand Up @@ -45,9 +45,14 @@ modal.show();
- `description` (`string?`): Define a custom description in the UI.
- `onComplete` (`(accounts: Array<string>) => void`): Triggers when the user completes the flow. By default it is not set.

## Styles & Customizing CSS
### Supported Wallets
- [Nightly Wallet](https://github.com/near/wallet-selector/blob/main/packages/nightly/src/lib/nightly.ts#L224)
- [Meteor Wallet](https://github.com/near/wallet-selector/blob/main/packages/meteor-wallet/src/lib/meteor-wallet.ts#L204)
- [Welldone Wallet](https://github.com/near/wallet-selector/blob/main/packages/welldone-wallet/src/lib/welldone.ts#L335)
- [Here Wallet](https://github.com/near/wallet-selector/blob/main/packages/here-wallet/src/lib/selector.ts#LL42)
- [My Near Wallet](https://github.com/near/wallet-selector/blob/main/packages/my-near-wallet/src/lib/my-near-wallet.ts#L227)

Import modal css styles:
## Styles & Customizing CSS

### React & Vue

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.1.1",
"version": "8.1.2",
"description": "This is the Export Selector UI package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
4 changes: 4 additions & 0 deletions packages/account-export/src/lib/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@
filter: blur(4px);
}

.account-export .passphrase-text:hover {
filter: none;
}

.account-export .passphrase-label {
font-size: 12px;
cursor: copy;
Expand Down
2 changes: 1 addition & 1 deletion packages/coin98-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/coin98-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "Coin 98 wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
33 changes: 1 addition & 32 deletions packages/coin98-wallet/src/lib/coin98-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,39 +114,8 @@ const Coin98Wallet: WalletBehaviourFactory<InjectedWallet> = async ({
return getAccounts();
},

async verifyOwner({ message }) {
const account = getActiveAccount(store.getState());

if (!account) {
throw new Error("No active account");
}

const accountId = account.accountId;
const pubKey = await _state.wallet.near.signer.getPublicKey(accountId);
const block = await provider.block({ finality: "final" });

const data = {
accountId,
message,
blockId: block.header.hash,
publicKey: Buffer.from(pubKey.data).toString("base64"),
keyType: pubKey.keyType,
};
const encoded = JSON.stringify(data);

async verifyOwner() {
throw new Error(`Method not supported by ${metadata.name}`);

const signed = await _state.wallet.near.signer.signMessage(
new Uint8Array(Buffer.from(encoded)),
accountId,
options.network.networkId
);

return {
...data,
signature: Buffer.from(signed.signature).toString("base64"),
keyType: signed.publicKey.keyType,
};
},

async signAndSendTransaction({ signerId, receiverId, actions }) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/core",
"version": "8.1.1",
"version": "8.1.2",
"description": "This is the core package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/default-wallets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/default-wallets",
"version": "8.1.1",
"version": "8.1.2",
"description": "Default wallets package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/finer-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/finer-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "FiNER Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/here-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/here-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "Here wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/ledger",
"version": "8.1.1",
"version": "8.1.2",
"description": "Ledger package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/math-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/math-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "Math wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/meteor-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/meteor-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "Meteor wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/modal-ui-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/modal-ui-js",
"version": "8.1.1",
"version": "8.1.2",
"description": "Modal UI package for NEAR wallet Selector",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/modal-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/modal-ui",
"version": "8.1.1",
"version": "8.1.2",
"description": "Modal UI package for NEAR wallet Selector",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/my-near-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/my-near-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "My Near Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
24 changes: 0 additions & 24 deletions packages/my-near-wallet/src/lib/my-near-wallet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,6 @@ describe("signAndSendTransaction", () => {
});
});

describe("verifyOwner", () => {
it("verifies owner", async () => {
const { wallet } = await createMyNearWallet();

const replace = window.location.replace;

await wallet.signIn({ contractId: "test.testnet" });

Object.defineProperty(window, "location", {
value: { replace: jest.fn() },
});

const result = await wallet.verifyOwner({
message: "message",
callbackUrl: "http://localhost",
});

expect(result).toBe(undefined);
expect(window.location.replace).toHaveBeenCalled();

window.location.replace = replace;
});
});

describe("buildImportAccountsUrl", () => {
it("returns import url", async () => {
const { wallet } = await createMyNearWallet();
Expand Down
27 changes: 2 additions & 25 deletions packages/my-near-wallet/src/lib/my-near-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,31 +156,8 @@ const MyNearWallet: WalletBehaviourFactory<
return getAccounts();
},

async verifyOwner({ message, callbackUrl, meta }) {
logger.log("verifyOwner", { message });

const account = _state.wallet.account();

if (!account) {
throw new Error("Wallet not signed in");
}
const locationUrl =
typeof window !== "undefined" ? window.location.href : "";

const url = callbackUrl || locationUrl;

if (!url) {
throw new Error(`The callbackUrl is missing for ${metadata.name}`);
}

const encodedUrl = encodeURIComponent(url);
const extraMeta = meta ? `&meta=${meta}` : "";

window.location.replace(
`${params.walletUrl}/verify-owner?message=${message}&callbackUrl=${encodedUrl}${extraMeta}`
);

return;
async verifyOwner() {
throw new Error(`Method not supported by ${metadata.name}`);
},

async signAndSendTransaction({
Expand Down
2 changes: 1 addition & 1 deletion packages/narwallets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/narwallets",
"version": "8.1.1",
"version": "8.1.2",
"description": "This is the Narwallets package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/near-snap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/near-snap",
"version": "8.1.1",
"version": "8.1.2",
"description": "Metamask snap to interact with Near dapps.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/near-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/near-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "Near Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/nearfi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/nearfi",
"version": "8.1.1",
"version": "8.1.2",
"description": "Nearfi package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/neth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/neth",
"version": "8.1.1",
"version": "8.1.2",
"description": "Control NEAR accounts with ETH accounts",
"author": "mattlockyer",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/nightly-connect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/nightly-connect",
"version": "8.1.1",
"version": "8.1.2",
"description": "Nightly connect package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/nightly/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/nightly",
"version": "8.1.1",
"version": "8.1.2",
"description": "Nightly wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/opto-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/opto-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "Opto wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/sender/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/sender",
"version": "8.1.1",
"version": "8.1.2",
"description": "Sender wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-connect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/wallet-connect",
"version": "8.1.1",
"version": "8.1.2",
"description": "Wallet Connect package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/wallet-utils",
"version": "8.1.1",
"version": "8.1.2",
"description": "Wallet utils package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/welldone-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/welldone-wallet",
"version": "8.1.1",
"version": "8.1.2",
"description": "Welldone wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/xdefi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/xdefi",
"version": "8.1.1",
"version": "8.1.2",
"description": "This is the XDEFI package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
Loading

0 comments on commit 63dc202

Please sign in to comment.