near-safe 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "near-safe",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "description": "An SDK for controlling Ethereum Smart Accounts via ERC4337 from a Near Account.",
6
6
  "author": "bh2smith",
@@ -35,25 +35,31 @@
35
35
  "start": "yarn example",
36
36
  "example": "tsx examples/send-tx.ts",
37
37
  "lint": "eslint . --ignore-pattern dist/",
38
- "fmt": "prettier --write '{src,examples,tests}/**/*.{js,jsx,ts,tsx}'",
38
+ "test": "jest",
39
+ "fmt": "prettier --write '{src,examples,tests}/**/*.{js,jsx,ts,tsx}' && yarn lint --fix",
39
40
  "all": "yarn fmt && yarn lint && yarn build"
40
41
  },
41
42
  "dependencies": {
42
43
  "@safe-global/safe-deployments": "^1.37.0",
43
44
  "@safe-global/safe-modules-deployments": "^2.2.0",
44
45
  "ethers": "^6.13.1",
45
- "ethers-multisend": "^3.1.0",
46
46
  "near-api-js": "^5.0.0",
47
- "near-ca": "^0.5.2"
47
+ "near-ca": "^0.5.2",
48
+ "viem": "^2.16.5",
49
+ "yargs": "^17.7.2"
48
50
  },
49
51
  "devDependencies": {
52
+ "@types/jest": "^29.5.12",
50
53
  "@types/node": "^22.3.0",
51
54
  "@types/yargs": "^17.0.32",
52
55
  "@typescript-eslint/eslint-plugin": "^8.1.0",
53
56
  "@typescript-eslint/parser": "^8.1.0",
54
57
  "dotenv": "^16.4.5",
55
58
  "eslint": "^9.6.0",
59
+ "eslint-plugin-import": "^2.30.0",
60
+ "jest": "^29.7.0",
56
61
  "prettier": "^3.3.2",
62
+ "ts-jest": "^29.1.5",
57
63
  "tsx": "^4.16.0",
58
64
  "typescript": "^5.5.2",
59
65
  "yargs": "^17.7.2"
@@ -1,3 +0,0 @@
1
- import { ethers } from "ethers";
2
- import { NearEthAdapter } from "near-ca";
3
- export declare function getNearSignature(adapter: NearEthAdapter, hash: ethers.BytesLike): Promise<string>;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNearSignature = getNearSignature;
4
- const ethers_1 = require("ethers");
5
- async function getNearSignature(adapter, hash) {
6
- const viemHash = typeof hash === "string" ? hash : hash;
7
- // MPC Contract produces two possible signatures.
8
- const signature = await adapter.sign(viemHash);
9
- if (ethers_1.ethers.recoverAddress(hash, signature).toLocaleLowerCase() ===
10
- adapter.address.toLocaleLowerCase()) {
11
- return signature;
12
- }
13
- throw new Error("Invalid signature!");
14
- }
@@ -1,3 +0,0 @@
1
- import { ethers } from "ethers";
2
- import { NearEthAdapter } from "near-ca";
3
- export declare function getNearSignature(adapter: NearEthAdapter, hash: ethers.BytesLike): Promise<string>;
@@ -1,11 +0,0 @@
1
- import { ethers } from "ethers";
2
- export async function getNearSignature(adapter, hash) {
3
- const viemHash = typeof hash === "string" ? hash : hash;
4
- // MPC Contract produces two possible signatures.
5
- const signature = await adapter.sign(viemHash);
6
- if (ethers.recoverAddress(hash, signature).toLocaleLowerCase() ===
7
- adapter.address.toLocaleLowerCase()) {
8
- return signature;
9
- }
10
- throw new Error("Invalid signature!");
11
- }