near-safe 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/tx-manager.d.ts +1 -3
- package/dist/cjs/tx-manager.js +5 -10
- package/dist/esm/tx-manager.d.ts +1 -3
- package/dist/esm/tx-manager.js +5 -10
- package/package.json +1 -1
package/dist/cjs/tx-manager.d.ts
CHANGED
@@ -4,7 +4,6 @@ import { Erc4337Bundler } from "./lib/bundler";
|
|
4
4
|
import { UserOperation, UserOperationReceipt } from "./types";
|
5
5
|
import { MetaTransaction } from "ethers-multisend";
|
6
6
|
import { ContractSuite } from "./lib/safe";
|
7
|
-
import { Account } from "near-api-js";
|
8
7
|
export declare class TransactionManager {
|
9
8
|
readonly provider: ethers.JsonRpcProvider;
|
10
9
|
readonly nearAdapter: NearEthAdapter;
|
@@ -18,8 +17,7 @@ export declare class TransactionManager {
|
|
18
17
|
static create(config: {
|
19
18
|
ethRpc: string;
|
20
19
|
erc4337BundlerUrl: string;
|
21
|
-
|
22
|
-
mpcContractId: string;
|
20
|
+
nearAdapter: NearEthAdapter;
|
23
21
|
safeSaltNonce?: string;
|
24
22
|
}): Promise<TransactionManager>;
|
25
23
|
get safeNotDeployed(): boolean;
|
package/dist/cjs/tx-manager.js
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TransactionManager = void 0;
|
4
4
|
const ethers_1 = require("ethers");
|
5
|
-
const near_ca_1 = require("near-ca");
|
6
5
|
const bundler_1 = require("./lib/bundler");
|
7
6
|
const util_1 = require("./util");
|
8
7
|
const near_1 = require("./lib/near");
|
@@ -20,20 +19,16 @@ class TransactionManager {
|
|
20
19
|
this._safeNotDeployed = safeNotDeployed;
|
21
20
|
}
|
22
21
|
static async create(config) {
|
22
|
+
const adapter = config.nearAdapter;
|
23
23
|
const provider = new ethers_1.ethers.JsonRpcProvider(config.ethRpc);
|
24
|
-
const
|
25
|
-
|
26
|
-
mpcContract: new near_ca_1.MpcContract(config.nearAccount, config.mpcContractId),
|
27
|
-
}),
|
28
|
-
safe_1.ContractSuite.init(provider),
|
29
|
-
]);
|
30
|
-
console.log(`Near Adapter: ${nearAdapter.nearAccountId()} <> ${nearAdapter.address}`);
|
24
|
+
const safePack = await safe_1.ContractSuite.init(provider);
|
25
|
+
console.log(`Near Adapter: ${adapter.nearAccountId()} <> ${adapter.address}`);
|
31
26
|
const bundler = new bundler_1.Erc4337Bundler(config.erc4337BundlerUrl, await safePack.entryPoint.getAddress());
|
32
|
-
const setup = await safePack.getSetup([
|
27
|
+
const setup = await safePack.getSetup([adapter.address]);
|
33
28
|
const safeAddress = await safePack.addressForSetup(setup, config.safeSaltNonce);
|
34
29
|
const safeNotDeployed = (await provider.getCode(safeAddress)) === "0x";
|
35
30
|
console.log(`Safe Address: ${safeAddress} - deployed? ${!safeNotDeployed}`);
|
36
|
-
return new TransactionManager(provider,
|
31
|
+
return new TransactionManager(provider, adapter, safePack, bundler, setup, safeAddress, config.safeSaltNonce || "0", safeNotDeployed);
|
37
32
|
}
|
38
33
|
get safeNotDeployed() {
|
39
34
|
return this._safeNotDeployed;
|
package/dist/esm/tx-manager.d.ts
CHANGED
@@ -4,7 +4,6 @@ import { Erc4337Bundler } from "./lib/bundler";
|
|
4
4
|
import { UserOperation, UserOperationReceipt } from "./types";
|
5
5
|
import { MetaTransaction } from "ethers-multisend";
|
6
6
|
import { ContractSuite } from "./lib/safe";
|
7
|
-
import { Account } from "near-api-js";
|
8
7
|
export declare class TransactionManager {
|
9
8
|
readonly provider: ethers.JsonRpcProvider;
|
10
9
|
readonly nearAdapter: NearEthAdapter;
|
@@ -18,8 +17,7 @@ export declare class TransactionManager {
|
|
18
17
|
static create(config: {
|
19
18
|
ethRpc: string;
|
20
19
|
erc4337BundlerUrl: string;
|
21
|
-
|
22
|
-
mpcContractId: string;
|
20
|
+
nearAdapter: NearEthAdapter;
|
23
21
|
safeSaltNonce?: string;
|
24
22
|
}): Promise<TransactionManager>;
|
25
23
|
get safeNotDeployed(): boolean;
|
package/dist/esm/tx-manager.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { ethers } from "ethers";
|
2
|
-
import { NearEthAdapter, MpcContract } from "near-ca";
|
3
2
|
import { Erc4337Bundler } from "./lib/bundler";
|
4
3
|
import { packSignature } from "./util";
|
5
4
|
import { getNearSignature } from "./lib/near";
|
@@ -25,20 +24,16 @@ export class TransactionManager {
|
|
25
24
|
this._safeNotDeployed = safeNotDeployed;
|
26
25
|
}
|
27
26
|
static async create(config) {
|
27
|
+
const adapter = config.nearAdapter;
|
28
28
|
const provider = new ethers.JsonRpcProvider(config.ethRpc);
|
29
|
-
const
|
30
|
-
|
31
|
-
mpcContract: new MpcContract(config.nearAccount, config.mpcContractId),
|
32
|
-
}),
|
33
|
-
ContractSuite.init(provider),
|
34
|
-
]);
|
35
|
-
console.log(`Near Adapter: ${nearAdapter.nearAccountId()} <> ${nearAdapter.address}`);
|
29
|
+
const safePack = await ContractSuite.init(provider);
|
30
|
+
console.log(`Near Adapter: ${adapter.nearAccountId()} <> ${adapter.address}`);
|
36
31
|
const bundler = new Erc4337Bundler(config.erc4337BundlerUrl, await safePack.entryPoint.getAddress());
|
37
|
-
const setup = await safePack.getSetup([
|
32
|
+
const setup = await safePack.getSetup([adapter.address]);
|
38
33
|
const safeAddress = await safePack.addressForSetup(setup, config.safeSaltNonce);
|
39
34
|
const safeNotDeployed = (await provider.getCode(safeAddress)) === "0x";
|
40
35
|
console.log(`Safe Address: ${safeAddress} - deployed? ${!safeNotDeployed}`);
|
41
|
-
return new TransactionManager(provider,
|
36
|
+
return new TransactionManager(provider, adapter, safePack, bundler, setup, safeAddress, config.safeSaltNonce || "0", safeNotDeployed);
|
42
37
|
}
|
43
38
|
get safeNotDeployed() {
|
44
39
|
return this._safeNotDeployed;
|