near-safe 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -4
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/lib/bundler.d.ts +4 -1
- package/dist/cjs/lib/bundler.js +15 -5
- package/dist/cjs/lib/multisend.d.ts +3 -0
- package/dist/cjs/lib/multisend.js +40 -0
- package/dist/cjs/lib/safe.d.ts +9 -9
- package/dist/cjs/lib/safe.js +22 -18
- package/dist/cjs/tx-manager.d.ts +24 -23
- package/dist/cjs/tx-manager.js +63 -48
- package/dist/cjs/types.d.ts +34 -27
- package/dist/cjs/types.js +6 -0
- package/dist/cjs/util.d.ts +8 -7
- package/dist/cjs/util.js +10 -10
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/lib/bundler.d.ts +4 -1
- package/dist/esm/lib/bundler.js +17 -5
- package/dist/esm/lib/multisend.d.ts +3 -0
- package/dist/esm/lib/multisend.js +36 -0
- package/dist/esm/lib/safe.d.ts +9 -9
- package/dist/esm/lib/safe.js +22 -18
- package/dist/esm/tx-manager.d.ts +24 -23
- package/dist/esm/tx-manager.js +67 -53
- package/dist/esm/types.d.ts +34 -27
- package/dist/esm/types.js +5 -1
- package/dist/esm/util.d.ts +8 -7
- package/dist/esm/util.js +10 -10
- package/package.json +10 -4
- package/dist/cjs/lib/near.d.ts +0 -3
- package/dist/cjs/lib/near.js +0 -14
- package/dist/esm/lib/near.d.ts +0 -3
- package/dist/esm/lib/near.js +0 -11
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "near-safe",
|
3
|
-
"version": "0.
|
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
|
-
"
|
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"
|
package/dist/cjs/lib/near.d.ts
DELETED
package/dist/cjs/lib/near.js
DELETED
@@ -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
|
-
}
|
package/dist/esm/lib/near.d.ts
DELETED
package/dist/esm/lib/near.js
DELETED
@@ -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
|
-
}
|