Skip to content

Commit

Permalink
Merge branch 'main' of github.com:near/wallet-selector into ledger/fe…
Browse files Browse the repository at this point in the history
…at/sign-message
  • Loading branch information
JordiParraCrespo committed Dec 19, 2024
2 parents 8c48c13 + f7ca952 commit 7a315f9
Show file tree
Hide file tree
Showing 34 changed files with 78 additions and 204 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/add-to-devtools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Add to DevTools Project'

on:
issues:
types:
- opened
- reopened
pull_request:
types:
- opened
- reopened

jobs:
add-to-project:
name: Add issue/PR to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
# add to DevTools Project #156
project-url: https://github.com/orgs/near/projects/156
github-token: ${{ secrets.GH_TOKEN }}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-wallet-selector",
"version": "8.9.14",
"version": "8.9.15",
"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 @@ -107,9 +107,8 @@
"@walletconnect/modal": "2.6.2",
"@walletconnect/sign-client": "2.13.0",
"@web3modal/wagmi": "5.0.6",
"better-sqlite3": "11.3.0",
"big.js": "6.2.2",
"borsh": "0.7.0",
"borsh": "1.0.0",
"browserify-fs": "1.0.0",
"bs58": "5.0.0",
"buffer": "6.0.3",
Expand Down Expand Up @@ -223,4 +222,4 @@
"webpack": "5.75.0",
"webpack-merge": "5.8.0"
}
}
}
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.9.14",
"version": "8.9.15",
"description": "This is the Export Selector UI package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/arepa-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/arepa-wallet",
"version": "8.9.14",
"version": "8.9.15",
"description": "Arepa Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/bitget-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/bitget-wallet",
"version": "8.9.14",
"version": "8.9.15",
"description": "Bitget wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/bitte-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/bitte-wallet",
"version": "8.9.14",
"version": "8.9.15",
"description": "Bitte wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
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.9.14",
"version": "8.9.15",
"description": "Coin 98 wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
7 changes: 3 additions & 4 deletions 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.9.14",
"version": "8.9.15",
"description": "This is the core package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand All @@ -20,7 +20,6 @@
},
"homepage": "https://github.com/near/wallet-selector/tree/main/packages/core",
"peerDependencies": {
"near-api-js": "4.0.3",
"@near-js/providers": "latest"
"near-api-js": "4.0.3"
}
}
}
31 changes: 10 additions & 21 deletions packages/core/src/lib/helpers/verify-signature/payload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { SignMessageParams } from "../../wallet";
import type { Schema } from "borsh";
import { serialize } from "borsh";

export class Payload {
Expand All @@ -21,27 +22,15 @@ export class Payload {
}
}

export const payloadSchema = new Map([
[
Payload,
{
kind: "struct",
fields: [
["tag", "u32"],
["message", "string"],
["nonce", [32]],
["recipient", "string"],
[
"callbackUrl",
{
kind: "option",
type: "string",
},
],
],
},
],
]);
export const payloadSchema: Schema = {
struct: {
tag: "u32",
message: "string",
nonce: { array: { type: "u8", len: 32 } },
recipient: "string",
callbackUrl: { option: "string" },
},
};

export const serializeNep413 = (
signMessageParams: SignMessageParams
Expand Down
10 changes: 6 additions & 4 deletions packages/core/src/lib/wallet-selector.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { setupWalletSelector } from "./wallet-selector";
import { FailoverRpcProvider } from "@near-js/providers";
import { getNetworkPreset } from "./options";
import { JsonRpcProvider } from "near-api-js/lib/providers";
import {
JsonRpcProvider,
FailoverRpcProvider,
} from "near-api-js/lib/providers";
import type { Network } from "./options.types";
import type { Store } from "./store.types";
import type { WalletModuleFactory } from "./wallet";
Expand Down Expand Up @@ -52,8 +54,8 @@ jest.mock("./store", () => {
};
});

jest.mock("@near-js/providers", () => {
const originalModule = jest.requireActual("@near-js/providers");
jest.mock("near-api-js/lib/providers", () => {
const originalModule = jest.requireActual("near-api-js/lib/providers");
return {
...originalModule,
FailoverRpcProvider: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-wallets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/ethereum-wallets",
"version": "8.9.14",
"version": "8.9.15",
"description": "Ethereum wallets 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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"description": "Meteor wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/mintbase-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/mintbase-wallet",
"version": "8.9.14",
"version": "8.9.15",
"description": "Mintbase 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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"description": "My Near Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
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.9.14",
"version": "8.9.15",
"description": "This is the Narwallets package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/near-mobile-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/near-mobile-wallet",
"version": "8.9.14",
"version": "8.9.15",
"description": "NEAR Mobile wallet 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.9.14",
"version": "8.9.15",
"description": "Metamask snap to interact with Near dapps.",
"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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"description": "Control NEAR accounts with ETH accounts",
"author": "mattlockyer",
"keywords": [
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.9.14",
"version": "8.9.15",
"description": "Nightly wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/okx-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/okx-wallet",
"version": "8.9.14",
"version": "8.9.15",
"description": "OKX Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/ramper-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/ramper-wallet",
"version": "8.9.14",
"version": "8.9.15",
"description": "Ramper 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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"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.9.14",
"version": "8.9.15",
"description": "This is the XDEFI package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
6 changes: 0 additions & 6 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
"baseUrl": ".",
"strictPropertyInitialization": false,
"paths": {
"@near-js/types": [
"node_modules/@near-js/types"
],
"@near-js/keystores": [
"node_modules/@near-js/keystores"
],
"@near-wallet-selector/account-export": [
"packages/account-export/src/index.ts"
],
Expand Down
Loading

0 comments on commit 7a315f9

Please sign in to comment.