near-safe 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/dist/cjs/scripts/fetch-deployments.d.ts +0 -17
- package/dist/cjs/scripts/fetch-deployments.js +0 -59
- package/dist/esm/scripts/fetch-deployments.d.ts +0 -17
- package/dist/esm/scripts/fetch-deployments.js +0 -54
- /package/dist/cjs/{src/_gen → _gen}/deployments.d.ts +0 -0
- /package/dist/cjs/{src/_gen → _gen}/deployments.js +0 -0
- /package/dist/cjs/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/cjs/{src/index.js → index.js} +0 -0
- /package/dist/cjs/{src/lib → lib}/bundler.d.ts +0 -0
- /package/dist/cjs/{src/lib → lib}/bundler.js +0 -0
- /package/dist/cjs/{src/lib → lib}/multisend.d.ts +0 -0
- /package/dist/cjs/{src/lib → lib}/multisend.js +0 -0
- /package/dist/cjs/{src/lib → lib}/safe-message.d.ts +0 -0
- /package/dist/cjs/{src/lib → lib}/safe-message.js +0 -0
- /package/dist/cjs/{src/lib → lib}/safe.d.ts +0 -0
- /package/dist/cjs/{src/lib → lib}/safe.js +0 -0
- /package/dist/cjs/{src/near-safe.d.ts → near-safe.d.ts} +0 -0
- /package/dist/cjs/{src/near-safe.js → near-safe.js} +0 -0
- /package/dist/cjs/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/cjs/{src/types.js → types.js} +0 -0
- /package/dist/cjs/{src/util.d.ts → util.d.ts} +0 -0
- /package/dist/cjs/{src/util.js → util.js} +0 -0
- /package/dist/esm/{src/_gen → _gen}/deployments.d.ts +0 -0
- /package/dist/esm/{src/_gen → _gen}/deployments.js +0 -0
- /package/dist/esm/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/esm/{src/index.js → index.js} +0 -0
- /package/dist/esm/{src/lib → lib}/bundler.d.ts +0 -0
- /package/dist/esm/{src/lib → lib}/bundler.js +0 -0
- /package/dist/esm/{src/lib → lib}/multisend.d.ts +0 -0
- /package/dist/esm/{src/lib → lib}/multisend.js +0 -0
- /package/dist/esm/{src/lib → lib}/safe-message.d.ts +0 -0
- /package/dist/esm/{src/lib → lib}/safe-message.js +0 -0
- /package/dist/esm/{src/lib → lib}/safe.d.ts +0 -0
- /package/dist/esm/{src/lib → lib}/safe.js +0 -0
- /package/dist/esm/{src/near-safe.d.ts → near-safe.d.ts} +0 -0
- /package/dist/esm/{src/near-safe.js → near-safe.js} +0 -0
- /package/dist/esm/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/esm/{src/types.js → types.js} +0 -0
- /package/dist/esm/{src/util.d.ts → util.d.ts} +0 -0
- /package/dist/esm/{src/util.js → util.js} +0 -0
package/package.json
CHANGED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Deployment, SafeDeployments } from "../src/types";
|
2
|
-
export declare const SAFE_VERSION = "1.4.1";
|
3
|
-
export declare const MODULE_VERSION = "0.3.0";
|
4
|
-
type DeploymentFn = (filter?: {
|
5
|
-
version: string;
|
6
|
-
}) => {
|
7
|
-
networkAddresses: {
|
8
|
-
[chainId: string]: string;
|
9
|
-
};
|
10
|
-
abi: unknown[];
|
11
|
-
} | undefined;
|
12
|
-
type DeploymentArgs = {
|
13
|
-
version: string;
|
14
|
-
};
|
15
|
-
export declare function getDeployment(fn: DeploymentFn, { version }: DeploymentArgs): Promise<Deployment>;
|
16
|
-
export declare function fetchDeployments(safeVersion?: string, moduleVersion?: string): Promise<SafeDeployments>;
|
17
|
-
export {};
|
@@ -1,59 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.MODULE_VERSION = exports.SAFE_VERSION = void 0;
|
4
|
-
exports.getDeployment = getDeployment;
|
5
|
-
exports.fetchDeployments = fetchDeployments;
|
6
|
-
const safe_deployments_1 = require("@safe-global/safe-deployments");
|
7
|
-
const safe_modules_deployments_1 = require("@safe-global/safe-modules-deployments");
|
8
|
-
const viem_1 = require("viem");
|
9
|
-
const util_1 = require("../src/util");
|
10
|
-
// Define the deployment version and chain ID (e.g., "1.4.1" for Safe contracts, "0.3.0" for modules)
|
11
|
-
exports.SAFE_VERSION = "1.4.1";
|
12
|
-
exports.MODULE_VERSION = "0.3.0";
|
13
|
-
async function getDeployment(fn, { version }) {
|
14
|
-
const deployment = fn({ version });
|
15
|
-
if (!deployment) {
|
16
|
-
throw new Error(`Deployment not found for ${fn.name} version ${version}`);
|
17
|
-
}
|
18
|
-
// TODO: maybe call parseAbi on deployment.abi here.
|
19
|
-
return {
|
20
|
-
address: deployment.networkAddresses["11155111"],
|
21
|
-
abi: deployment.abi,
|
22
|
-
};
|
23
|
-
}
|
24
|
-
async function fetchDeployments(safeVersion = exports.SAFE_VERSION, moduleVersion = exports.MODULE_VERSION) {
|
25
|
-
console.log("Fetching deployments...");
|
26
|
-
const safeDeployment = async (fn) => getDeployment(fn, { version: safeVersion });
|
27
|
-
const m4337Deployment = async (fn) => getDeployment(fn, { version: moduleVersion });
|
28
|
-
try {
|
29
|
-
// Fetch deployments for Safe and 4337 modules
|
30
|
-
const [singleton, proxyFactory, moduleSetup, m4337] = await Promise.all([
|
31
|
-
safeDeployment(safe_deployments_1.getSafeL2SingletonDeployment),
|
32
|
-
safeDeployment(safe_deployments_1.getProxyFactoryDeployment),
|
33
|
-
m4337Deployment(safe_modules_deployments_1.getSafeModuleSetupDeployment),
|
34
|
-
m4337Deployment(safe_modules_deployments_1.getSafe4337ModuleDeployment),
|
35
|
-
]);
|
36
|
-
// TODO - this is a cheeky hack.
|
37
|
-
const client = (0, util_1.getClient)(11155111);
|
38
|
-
const entryPoint = {
|
39
|
-
address: (await client.readContract({
|
40
|
-
address: m4337.address,
|
41
|
-
abi: m4337.abi,
|
42
|
-
functionName: "SUPPORTED_ENTRYPOINT",
|
43
|
-
})),
|
44
|
-
abi: (0, viem_1.parseAbi)([
|
45
|
-
"function getNonce(address, uint192 key) view returns (uint256 nonce)",
|
46
|
-
]),
|
47
|
-
};
|
48
|
-
return {
|
49
|
-
singleton,
|
50
|
-
proxyFactory,
|
51
|
-
moduleSetup,
|
52
|
-
m4337,
|
53
|
-
entryPoint,
|
54
|
-
};
|
55
|
-
}
|
56
|
-
catch (error) {
|
57
|
-
throw new Error(`Error fetching deployments: ${error}`);
|
58
|
-
}
|
59
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Deployment, SafeDeployments } from "../src/types";
|
2
|
-
export declare const SAFE_VERSION = "1.4.1";
|
3
|
-
export declare const MODULE_VERSION = "0.3.0";
|
4
|
-
type DeploymentFn = (filter?: {
|
5
|
-
version: string;
|
6
|
-
}) => {
|
7
|
-
networkAddresses: {
|
8
|
-
[chainId: string]: string;
|
9
|
-
};
|
10
|
-
abi: unknown[];
|
11
|
-
} | undefined;
|
12
|
-
type DeploymentArgs = {
|
13
|
-
version: string;
|
14
|
-
};
|
15
|
-
export declare function getDeployment(fn: DeploymentFn, { version }: DeploymentArgs): Promise<Deployment>;
|
16
|
-
export declare function fetchDeployments(safeVersion?: string, moduleVersion?: string): Promise<SafeDeployments>;
|
17
|
-
export {};
|
@@ -1,54 +0,0 @@
|
|
1
|
-
import { getProxyFactoryDeployment, getSafeL2SingletonDeployment, } from "@safe-global/safe-deployments";
|
2
|
-
import { getSafe4337ModuleDeployment, getSafeModuleSetupDeployment, } from "@safe-global/safe-modules-deployments";
|
3
|
-
import { parseAbi } from "viem";
|
4
|
-
import { getClient } from "../src/util";
|
5
|
-
// Define the deployment version and chain ID (e.g., "1.4.1" for Safe contracts, "0.3.0" for modules)
|
6
|
-
export const SAFE_VERSION = "1.4.1";
|
7
|
-
export const MODULE_VERSION = "0.3.0";
|
8
|
-
export async function getDeployment(fn, { version }) {
|
9
|
-
const deployment = fn({ version });
|
10
|
-
if (!deployment) {
|
11
|
-
throw new Error(`Deployment not found for ${fn.name} version ${version}`);
|
12
|
-
}
|
13
|
-
// TODO: maybe call parseAbi on deployment.abi here.
|
14
|
-
return {
|
15
|
-
address: deployment.networkAddresses["11155111"],
|
16
|
-
abi: deployment.abi,
|
17
|
-
};
|
18
|
-
}
|
19
|
-
export async function fetchDeployments(safeVersion = SAFE_VERSION, moduleVersion = MODULE_VERSION) {
|
20
|
-
console.log("Fetching deployments...");
|
21
|
-
const safeDeployment = async (fn) => getDeployment(fn, { version: safeVersion });
|
22
|
-
const m4337Deployment = async (fn) => getDeployment(fn, { version: moduleVersion });
|
23
|
-
try {
|
24
|
-
// Fetch deployments for Safe and 4337 modules
|
25
|
-
const [singleton, proxyFactory, moduleSetup, m4337] = await Promise.all([
|
26
|
-
safeDeployment(getSafeL2SingletonDeployment),
|
27
|
-
safeDeployment(getProxyFactoryDeployment),
|
28
|
-
m4337Deployment(getSafeModuleSetupDeployment),
|
29
|
-
m4337Deployment(getSafe4337ModuleDeployment),
|
30
|
-
]);
|
31
|
-
// TODO - this is a cheeky hack.
|
32
|
-
const client = getClient(11155111);
|
33
|
-
const entryPoint = {
|
34
|
-
address: (await client.readContract({
|
35
|
-
address: m4337.address,
|
36
|
-
abi: m4337.abi,
|
37
|
-
functionName: "SUPPORTED_ENTRYPOINT",
|
38
|
-
})),
|
39
|
-
abi: parseAbi([
|
40
|
-
"function getNonce(address, uint192 key) view returns (uint256 nonce)",
|
41
|
-
]),
|
42
|
-
};
|
43
|
-
return {
|
44
|
-
singleton,
|
45
|
-
proxyFactory,
|
46
|
-
moduleSetup,
|
47
|
-
m4337,
|
48
|
-
entryPoint,
|
49
|
-
};
|
50
|
-
}
|
51
|
-
catch (error) {
|
52
|
-
throw new Error(`Error fetching deployments: ${error}`);
|
53
|
-
}
|
54
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|