Skip to content

Commit 9f57855

Browse files
ch1ehardworker
authored andcommitted
Add sweat-wallet package
1 parent d06e51c commit 9f57855

File tree

15 files changed

+177
-30
lines changed

15 files changed

+177
-30
lines changed

examples/react/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"export": {
138138
"executor": "@nx/next:export",
139139
"options": {
140-
"buildTarget": "next:build:production"
140+
"buildTarget": "react:build:production"
141141
}
142142
},
143143
"lint": {

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"near-mobile-wallet",
2727
"mintbase-wallet",
2828
"bitte-wallet",
29-
"okx-wallet"
29+
"okx-wallet",
30+
"sweat-wallet"
3031
],
3132
"homepage": "https://github.com/near/wallet-selector#README",
3233
"bugs": {
@@ -72,6 +73,7 @@
7273
"build:wallet-utils": "nx run-many --target=build --projects=wallet-utils --configuration=production",
7374
"build:welldone-wallet": "nx run-many --target=build --projects=welldone-wallet --configuration=production",
7475
"build:xdefi-wallet": "nx run-many --target=build --projects=xdefi --configuration=production",
76+
"build:sweat-wallet": "nx run-many --target=build --projects=sweat-wallet --configuration=production",
7577
"examples:vanillajs:generateimportmap": "(cd examples/vanillajs && jspm link index.html -o index.html)",
7678
"find:unused": "ts-prune -p tsprune.json",
7779
"postinstall": "yarn build:all",
@@ -106,6 +108,7 @@
106108
"@noble/hashes": "1.4.0",
107109
"@peersyst/near-mobile-signer": "1.1.4",
108110
"@ramper/near": "0.0.30",
111+
"@sweatco/wallet-selector": "1.0.0-alpha.0",
109112
"@tanstack/react-query": "5.24.8",
110113
"@walletconnect/modal": "2.6.2",
111114
"@walletconnect/sign-client": "2.13.0",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

packages/sweat-wallet/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# sweat-wallet
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Building
6+
7+
Run `nx build sweat-wallet` to build the library.
8+
9+
## Running unit tests
10+
11+
Run `nx test sweat-wallet` to execute the unit tests via [Jest](https://jestjs.io).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: "sweat-wallet",
4+
preset: "../../jest.preset.js",
5+
transform: {
6+
"^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }],
7+
},
8+
moduleFileExtensions: ["ts", "js", "html"],
9+
coverageDirectory: "../../coverage/packages/sweat-wallet",
10+
};

packages/sweat-wallet/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "@near-wallet-selector/sweat-wallet",
3+
"version": "0.0.1",
4+
"description": "Sweat Wallet package for NEAR Wallet Selector."
5+
}

packages/sweat-wallet/project.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "sweat-wallet",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "packages/sweat-wallet/src",
5+
"projectType": "library",
6+
"targets": {
7+
"build": {
8+
"executor": "@nx/js:tsc",
9+
"outputs": ["{options.outputPath}"],
10+
"options": {
11+
"outputPath": "dist/packages/sweat-wallet",
12+
"main": "packages/sweat-wallet/src/index.ts",
13+
"tsConfig": "packages/sweat-wallet/tsconfig.lib.json",
14+
"assets": ["packages/sweat-wallet/*.md"]
15+
}
16+
},
17+
"publish": {
18+
"command": "node tools/scripts/publish.mjs sweat-wallet {args.ver} {args.tag}",
19+
"dependsOn": ["build"]
20+
},
21+
"lint": {
22+
"executor": "@nx/linter:eslint",
23+
"outputs": ["{options.outputFile}"],
24+
"options": {
25+
"lintFilePatterns": ["packages/sweat-wallet/**/*.ts"]
26+
}
27+
},
28+
"test": {
29+
"executor": "@nx/jest:jest",
30+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
31+
"options": {
32+
"jestConfig": "packages/sweat-wallet/jest.config.ts",
33+
"passWithNoTests": true
34+
},
35+
"configurations": {
36+
"ci": {
37+
"ci": true,
38+
"codeCoverage": true
39+
}
40+
}
41+
}
42+
},
43+
"tags": ["injected-wallet"]
44+
}

packages/sweat-wallet/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./lib/sweat-wallet";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAA8UExURf4Jdf+wzP+Wu//z9/8+hv96qv/L3v////8Mdf/l7v4Ndf95qv+jxP8qfv9Oj//Y5f+91f9dmf+Hs/9roRvStz8AAAI4SURBVFjD1ZnbkoMwCIaNJub3UGu77/+ue9FqDhASd+nMLnfF6Td/CQihXVexGYnN3a8MvOnSfohE1ZRx15CAKhEXTJvXQMRl0+bJRECXCOgSAV0ioEsEdImAMlEbCOgSAWUiebpMh9nTtx8uVwWSh9vgD9sPnzldU02ixPP+8fKtkauvEPMHdoq+/NbTJy4rAmWe9y7neW9EiRWen4Bn5vK2HXi7n6CD7JYTNIgSZd6wuYzivbENElPXHnjAmP3QPRz22AgMybYAsCnvfosizGb3nPPWhBfz37xwPlNJYvyxz1PXMsknSkyBjpaCocnsJIkp8NSz0qSMimMSCnBOQ9jTI+ypni+pADu+SKL4MHpGIbuzLGTi46geKbvzQhYkGpqtpg4UJPomieTd1RYyUyxAAnw0haxcgPT1b5r09KXspkArhMyJp1cAShIn8fRKwMaQHa5nFdhYgI4vQA54sQDXKpCJjx2onpXN7vz6yh9h1FkNfRm7tAc0SEw6tS283NkWwIcs7fwvic/CnFMCxgUYOnWQGDr/SvsoSwzZnfP8GPMMs0FggSG7Q+c/jypMe2N9csglhjFkOY9qSDt1ZbgB7chH5ydj2a1pnCN5dh6my3gWV4BpsvRJNpW6qHypcHSofrTxSrcUpt7CZDJsl64BrwlhfFs0mRyucbt4UVG/Sf2By96/uy/rrwj0lxj6axb9RZD+qkp/maa/7tNfSH5gZaq/1P3A2ll/Mf6B1b3EVP3Hogr7Bvz9mPgeLhfRAAAAAElFTkSuQmCC";
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type {
2+
WalletModuleFactory,
3+
InjectedWallet,
4+
} from "@near-wallet-selector/core";
5+
import { initSweatWallet } from "@sweatco/wallet-selector";
6+
7+
import iconUrl from "./icon";
8+
9+
export function setupSweatWallet(): WalletModuleFactory<InjectedWallet> {
10+
return async () => {
11+
return {
12+
id: "sweat-wallet",
13+
type: "injected",
14+
metadata: {
15+
iconUrl,
16+
name: "SWEAT Wallet",
17+
description: "SWEAT Wallet for NEAR Protocol",
18+
downloadUrl: "https://sweateconomy.org",
19+
deprecated: false,
20+
available: true,
21+
},
22+
init: initSweatWallet,
23+
};
24+
};
25+
}

0 commit comments

Comments
 (0)