@lidofinance/lsv-cli 1.0.0-alpha.10 → 1.0.0-alpha.11
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/dist/abi/Dashboard.js +1 -4
- package/dist/abi/Dashboard.js.map +1 -1
- package/dist/abi/Delegation.js +1 -4
- package/dist/abi/Delegation.js.map +1 -1
- package/dist/abi/LidoLocator.js +1 -4
- package/dist/abi/LidoLocator.js.map +1 -1
- package/dist/abi/StEth.js +1 -4
- package/dist/abi/StEth.js.map +1 -1
- package/dist/abi/StakingVault.js +1 -4
- package/dist/abi/StakingVault.js.map +1 -1
- package/dist/abi/TokenManager.js +1 -4
- package/dist/abi/TokenManager.js.map +1 -1
- package/dist/abi/VaultFactory.js +1 -4
- package/dist/abi/VaultFactory.js.map +1 -1
- package/dist/abi/VaultHub.js +1 -4
- package/dist/abi/VaultHub.js.map +1 -1
- package/dist/abi/Voting.js +1 -4
- package/dist/abi/Voting.js.map +1 -1
- package/dist/abi/index.js +9 -25
- package/dist/abi/index.js.map +1 -1
- package/dist/command/index.js +5 -8
- package/dist/command/index.js.map +1 -1
- package/dist/configs/constants.js +2 -5
- package/dist/configs/constants.js.map +1 -1
- package/dist/configs/deployed.js +63 -96
- package/dist/configs/deployed.js.map +1 -1
- package/dist/configs/envs.js +9 -45
- package/dist/configs/envs.js.map +1 -1
- package/dist/configs/index.js +3 -19
- package/dist/configs/index.js.map +1 -1
- package/dist/configs/utils.js +10 -16
- package/dist/configs/utils.js.map +1 -1
- package/dist/contracts/dashboard.js +7 -11
- package/dist/contracts/dashboard.js.map +1 -1
- package/dist/contracts/delegation.js +7 -11
- package/dist/contracts/delegation.js.map +1 -1
- package/dist/contracts/index.js +9 -25
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/locator.js +11 -15
- package/dist/contracts/locator.js.map +1 -1
- package/dist/contracts/steth.js +11 -15
- package/dist/contracts/steth.js.map +1 -1
- package/dist/contracts/token-manager.js +11 -15
- package/dist/contracts/token-manager.js.map +1 -1
- package/dist/contracts/vault-factory.js +11 -15
- package/dist/contracts/vault-factory.js.map +1 -1
- package/dist/contracts/vault-hub.js +12 -16
- package/dist/contracts/vault-hub.js.map +1 -1
- package/dist/contracts/vault.js +9 -13
- package/dist/contracts/vault.js.map +1 -1
- package/dist/contracts/voting.js +11 -15
- package/dist/contracts/voting.js.map +1 -1
- package/dist/features/advanced-config.js +7 -12
- package/dist/features/advanced-config.js.map +1 -1
- package/dist/features/dashboard-delegation.js +3 -7
- package/dist/features/dashboard-delegation.js.map +1 -1
- package/dist/features/index.js +4 -20
- package/dist/features/index.js.map +1 -1
- package/dist/features/token-manager.js +5 -4
- package/dist/features/token-manager.js.map +1 -1
- package/dist/features/vault-factory.js +15 -22
- package/dist/features/vault-factory.js.map +1 -1
- package/dist/features/voting.js +49 -52
- package/dist/features/voting.js.map +1 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/programs/config.js +12 -14
- package/dist/programs/config.js.map +1 -1
- package/dist/programs/dashboard.js +218 -220
- package/dist/programs/dashboard.js.map +1 -1
- package/dist/programs/delegation.js +319 -343
- package/dist/programs/delegation.js.map +1 -1
- package/dist/programs/index.js +6 -22
- package/dist/programs/index.js.map +1 -1
- package/dist/programs/vault-factory.js +41 -38
- package/dist/programs/vault-factory.js.map +1 -1
- package/dist/programs/vault-hub.js +130 -126
- package/dist/programs/vault-hub.js.map +1 -1
- package/dist/programs/vault.js +141 -136
- package/dist/programs/vault.js.map +1 -1
- package/dist/programs/voting.js +32 -30
- package/dist/programs/voting.js.map +1 -1
- package/dist/providers/index.js +1 -17
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/wallet.js +18 -24
- package/dist/providers/wallet.js.map +1 -1
- package/dist/types/common.js +1 -2
- package/dist/types/config.js +1 -2
- package/dist/types/index.js +2 -18
- package/dist/types/index.js.map +1 -1
- package/dist/utils/call-contract.js +9 -14
- package/dist/utils/call-contract.js.map +1 -1
- package/dist/utils/data-validators.js +12 -15
- package/dist/utils/data-validators.js.map +1 -1
- package/dist/utils/error-handler.js +3 -7
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/get-value.js +5 -11
- package/dist/utils/get-value.js.map +1 -1
- package/dist/utils/index.js +6 -22
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/resolve-path.js +9 -12
- package/dist/utils/resolve-path.js.map +1 -1
- package/dist/utils/sleep.js +1 -5
- package/dist/utils/sleep.js.map +1 -1
- package/package.json +38 -3
package/dist/contracts/index.js
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./vault-hub"), exports);
|
|
18
|
-
__exportStar(require("./vault-factory"), exports);
|
|
19
|
-
__exportStar(require("./vault"), exports);
|
|
20
|
-
__exportStar(require("./dashboard"), exports);
|
|
21
|
-
__exportStar(require("./delegation"), exports);
|
|
22
|
-
__exportStar(require("./steth"), exports);
|
|
23
|
-
__exportStar(require("./locator"), exports);
|
|
24
|
-
__exportStar(require("./token-manager"), exports);
|
|
25
|
-
__exportStar(require("./voting"), exports);
|
|
1
|
+
export * from "./vault-hub.js";
|
|
2
|
+
export * from "./vault-factory.js";
|
|
3
|
+
export * from "./vault.js";
|
|
4
|
+
export * from "./dashboard.js";
|
|
5
|
+
export * from "./delegation.js";
|
|
6
|
+
export * from "./steth.js";
|
|
7
|
+
export * from "./locator.js";
|
|
8
|
+
export * from "./token-manager.js";
|
|
9
|
+
export * from "./voting.js";
|
|
26
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../contracts/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const rpcUrl = (0, _configs_1.getRpcUrl)();
|
|
9
|
-
const address = (0, _configs_1.getLocatorAddress)();
|
|
10
|
-
return (0, viem_1.getContract)({
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { lidoLocator } from '../abi/index.js';
|
|
3
|
+
import { getChain, getLocatorAddress, getRpcUrl } from '../configs/index.js';
|
|
4
|
+
export const getLocatorContract = () => {
|
|
5
|
+
const rpcUrl = getRpcUrl();
|
|
6
|
+
const address = getLocatorAddress();
|
|
7
|
+
return getContract({
|
|
11
8
|
address,
|
|
12
|
-
abi:
|
|
13
|
-
client:
|
|
14
|
-
chain:
|
|
15
|
-
transport:
|
|
9
|
+
abi: lidoLocator,
|
|
10
|
+
client: createPublicClient({
|
|
11
|
+
chain: getChain(),
|
|
12
|
+
transport: http(rpcUrl),
|
|
16
13
|
}),
|
|
17
14
|
});
|
|
18
15
|
};
|
|
19
|
-
exports.getLocatorContract = getLocatorContract;
|
|
20
16
|
//# sourceMappingURL=locator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locator.js","sourceRoot":"","sources":["../../contracts/locator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locator.js","sourceRoot":"","sources":["../../contracts/locator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IAEpC,OAAO,WAAW,CAAC;QACjB,OAAO;QACP,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,kBAAkB,CAAC;YACzB,KAAK,EAAE,QAAQ,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;SACxB,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/dist/contracts/steth.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
client: (0, viem_1.createPublicClient)({
|
|
13
|
-
chain: (0, _configs_1.getChain)(),
|
|
14
|
-
transport: (0, viem_1.http)(rpcUrl),
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { StEthAbi } from '../abi/index.js';
|
|
3
|
+
import { getDeployedAddress, getChain, getRpcUrl } from '../configs/index.js';
|
|
4
|
+
export const getStethContract = () => {
|
|
5
|
+
const rpcUrl = getRpcUrl();
|
|
6
|
+
return getContract({
|
|
7
|
+
address: getDeployedAddress('eip712StETH'),
|
|
8
|
+
abi: StEthAbi,
|
|
9
|
+
client: createPublicClient({
|
|
10
|
+
chain: getChain(),
|
|
11
|
+
transport: http(rpcUrl),
|
|
15
12
|
}),
|
|
16
13
|
});
|
|
17
14
|
};
|
|
18
|
-
exports.getStethContract = getStethContract;
|
|
19
15
|
//# sourceMappingURL=steth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steth.js","sourceRoot":"","sources":["../../contracts/steth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"steth.js","sourceRoot":"","sources":["../../contracts/steth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,WAAW,CAAC;QACjB,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC;QAC1C,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,kBAAkB,CAAC;YACzB,KAAK,EAAE,QAAQ,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;SACxB,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const rpcUrl = (0, _configs_1.getRpcUrl)();
|
|
9
|
-
const address = (0, _configs_1.getTokenMasterAddress)();
|
|
10
|
-
return (0, viem_1.getContract)({
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { tokenManagerAbi } from '../abi/index.js';
|
|
3
|
+
import { getChain, getRpcUrl, getTokenMasterAddress } from '../configs/index.js';
|
|
4
|
+
export const getTokenManagerContract = () => {
|
|
5
|
+
const rpcUrl = getRpcUrl();
|
|
6
|
+
const address = getTokenMasterAddress();
|
|
7
|
+
return getContract({
|
|
11
8
|
address,
|
|
12
|
-
abi:
|
|
13
|
-
client:
|
|
14
|
-
chain:
|
|
15
|
-
transport:
|
|
9
|
+
abi: tokenManagerAbi,
|
|
10
|
+
client: createPublicClient({
|
|
11
|
+
chain: getChain(),
|
|
12
|
+
transport: http(rpcUrl),
|
|
16
13
|
}),
|
|
17
14
|
});
|
|
18
15
|
};
|
|
19
|
-
exports.getTokenManagerContract = getTokenManagerContract;
|
|
20
16
|
//# sourceMappingURL=token-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../contracts/token-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../contracts/token-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IAExC,OAAO,WAAW,CAAC;QACjB,OAAO;QACP,GAAG,EAAE,eAAe;QACpB,MAAM,EAAE,kBAAkB,CAAC;YACzB,KAAK,EAAE,QAAQ,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;SACxB,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const _configs_1 = require("../configs");
|
|
7
|
-
const getVaultFactoryContract = () => {
|
|
8
|
-
const rpcUrls = (0, _configs_1.getRpcUrl)();
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { VaultFactoryAbi } from '../abi/index.js';
|
|
3
|
+
import { getDeployedAddress, getRpcUrl, getChain } from '../configs/index.js';
|
|
4
|
+
export const getVaultFactoryContract = () => {
|
|
5
|
+
const rpcUrls = getRpcUrl();
|
|
9
6
|
const url = rpcUrls.split(',')[0];
|
|
10
|
-
const client =
|
|
11
|
-
chain:
|
|
12
|
-
transport:
|
|
7
|
+
const client = createPublicClient({
|
|
8
|
+
chain: getChain(),
|
|
9
|
+
transport: http(url),
|
|
13
10
|
});
|
|
14
|
-
const contract =
|
|
15
|
-
address:
|
|
16
|
-
abi:
|
|
11
|
+
const contract = getContract({
|
|
12
|
+
address: getDeployedAddress('stakingVaultFactory'),
|
|
13
|
+
abi: VaultFactoryAbi,
|
|
17
14
|
client,
|
|
18
15
|
});
|
|
19
16
|
return { client, contract };
|
|
20
17
|
};
|
|
21
|
-
exports.getVaultFactoryContract = getVaultFactoryContract;
|
|
22
18
|
//# sourceMappingURL=vault-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-factory.js","sourceRoot":"","sources":["../../contracts/vault-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vault-factory.js","sourceRoot":"","sources":["../../contracts/vault-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAElC,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAChC,KAAK,EAAE,QAAQ,EAAE;QACjB,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC;KACrB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,WAAW,CAAC;QAC3B,OAAO,EAAE,kBAAkB,CAAC,qBAAqB,CAAC;QAClD,GAAG,EAAE,eAAe;QACpB,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC,CAAC"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const getVaultHubContract = async () => {
|
|
9
|
-
const rpcUrl = (0, _configs_1.getRpcUrl)();
|
|
10
|
-
const locator = (0, _contracts_1.getLocatorContract)();
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { VaultHubAbi } from '../abi/index.js';
|
|
3
|
+
import { getChain, getRpcUrl } from '../configs/index.js';
|
|
4
|
+
import { getLocatorContract } from './index.js';
|
|
5
|
+
export const getVaultHubContract = async () => {
|
|
6
|
+
const rpcUrl = getRpcUrl();
|
|
7
|
+
const locator = getLocatorContract();
|
|
11
8
|
const address = await locator.read.accounting();
|
|
12
|
-
return
|
|
9
|
+
return getContract({
|
|
13
10
|
address,
|
|
14
|
-
abi:
|
|
15
|
-
client:
|
|
16
|
-
chain:
|
|
17
|
-
transport:
|
|
11
|
+
abi: VaultHubAbi,
|
|
12
|
+
client: createPublicClient({
|
|
13
|
+
chain: getChain(),
|
|
14
|
+
transport: http(rpcUrl),
|
|
18
15
|
}),
|
|
19
16
|
});
|
|
20
17
|
};
|
|
21
|
-
exports.getVaultHubContract = getVaultHubContract;
|
|
22
18
|
//# sourceMappingURL=vault-hub.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-hub.js","sourceRoot":"","sources":["../../contracts/vault-hub.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vault-hub.js","sourceRoot":"","sources":["../../contracts/vault-hub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,IAAI,EAAE;IAC5C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;IAEhD,OAAO,WAAW,CAAC;QACjB,OAAO;QACP,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,kBAAkB,CAAC;YACzB,KAAK,EAAE,QAAQ,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;SACxB,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/dist/contracts/vault.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const _configs_1 = require("../configs");
|
|
7
|
-
const getStakingVaultContract = (address) => {
|
|
8
|
-
return (0, viem_1.getContract)({
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { StakingVaultAbi } from '../abi/index.js';
|
|
3
|
+
import { getChain, getRpcUrl } from '../configs/index.js';
|
|
4
|
+
export const getStakingVaultContract = (address) => {
|
|
5
|
+
return getContract({
|
|
9
6
|
address,
|
|
10
|
-
abi:
|
|
11
|
-
client:
|
|
12
|
-
chain:
|
|
13
|
-
transport:
|
|
7
|
+
abi: StakingVaultAbi,
|
|
8
|
+
client: createPublicClient({
|
|
9
|
+
chain: getChain(),
|
|
10
|
+
transport: http(getRpcUrl()),
|
|
14
11
|
}),
|
|
15
12
|
});
|
|
16
13
|
};
|
|
17
|
-
exports.getStakingVaultContract = getStakingVaultContract;
|
|
18
14
|
//# sourceMappingURL=vault.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault.js","sourceRoot":"","sources":["../../contracts/vault.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vault.js","sourceRoot":"","sources":["../../contracts/vault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAW,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC1D,OAAO,WAAW,CAAC;QACjB,OAAO;QACP,GAAG,EAAE,eAAe;QACpB,MAAM,EAAE,kBAAkB,CAAC;YACzB,KAAK,EAAE,QAAQ,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;SAC7B,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/dist/contracts/voting.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const client = (0, viem_1.createPublicClient)({
|
|
11
|
-
chain: (0, _configs_1.getChain)(),
|
|
12
|
-
transport: (0, viem_1.http)(rpcUrl),
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { votingAbi } from '../abi/index.js';
|
|
3
|
+
import { getChain, getRpcUrl, getVotingAddress } from '../configs/index.js';
|
|
4
|
+
export const getVotingContract = () => {
|
|
5
|
+
const rpcUrl = getRpcUrl();
|
|
6
|
+
const address = getVotingAddress();
|
|
7
|
+
const client = createPublicClient({
|
|
8
|
+
chain: getChain(),
|
|
9
|
+
transport: http(rpcUrl),
|
|
13
10
|
});
|
|
14
|
-
const contract =
|
|
15
|
-
abi:
|
|
11
|
+
const contract = getContract({
|
|
12
|
+
abi: votingAbi,
|
|
16
13
|
address,
|
|
17
14
|
client,
|
|
18
15
|
});
|
|
19
16
|
return { client, contract };
|
|
20
17
|
};
|
|
21
|
-
exports.getVotingContract = getVotingContract;
|
|
22
18
|
//# sourceMappingURL=voting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voting.js","sourceRoot":"","sources":["../../contracts/voting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"voting.js","sourceRoot":"","sources":["../../contracts/voting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAChC,KAAK,EAAE,QAAQ,EAAE;QACjB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;KACxB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,WAAW,CAAC;QAC3B,GAAG,EAAE,SAAS;QACd,OAAO;QACP,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC,CAAC"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.setAdvancedConfig = exports.getAdvancedConfig = void 0;
|
|
4
|
-
const node_async_hooks_1 = require("node:async_hooks");
|
|
5
|
-
const advancedConfigStore = new node_async_hooks_1.AsyncLocalStorage();
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
const advancedConfigStore = new AsyncLocalStorage();
|
|
6
3
|
advancedConfigStore.enterWith({ config: null });
|
|
7
|
-
const getAdvancedConfig = () => {
|
|
4
|
+
export const getAdvancedConfig = () => {
|
|
8
5
|
const store = advancedConfigStore.getStore();
|
|
9
|
-
console.
|
|
6
|
+
console.info('getAdvancedConfig::store', store);
|
|
10
7
|
return store;
|
|
11
8
|
};
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const store = (0, exports.getAdvancedConfig)();
|
|
9
|
+
export const setAdvancedConfig = async (payload) => {
|
|
10
|
+
const store = getAdvancedConfig();
|
|
15
11
|
if (store) {
|
|
16
12
|
store.config = payload;
|
|
17
13
|
}
|
|
18
|
-
console.
|
|
14
|
+
console.info('setAdvancedConfig::store', store);
|
|
19
15
|
};
|
|
20
|
-
exports.setAdvancedConfig = setAdvancedConfig;
|
|
21
16
|
//# sourceMappingURL=advanced-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-config.js","sourceRoot":"","sources":["../../features/advanced-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"advanced-config.js","sourceRoot":"","sources":["../../features/advanced-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,mBAAmB,GAAG,IAAI,iBAAiB,EAE7C,CAAC;AACL,mBAAmB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,KAAK,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAmB,EAAE,EAAE;IAC7D,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,IAAI,KAAK,EAAE,CAAC;QACV,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getBaseInfo = void 0;
|
|
4
|
-
const _utils_1 = require("../utils");
|
|
5
|
-
const getBaseInfo = async (contract) => {
|
|
1
|
+
import { printError } from '../utils/index.js';
|
|
2
|
+
export const getBaseInfo = async (contract) => {
|
|
6
3
|
try {
|
|
7
4
|
const steth = await contract.read.STETH();
|
|
8
5
|
const wsteth = await contract.read.WSTETH();
|
|
@@ -19,8 +16,7 @@ const getBaseInfo = async (contract) => {
|
|
|
19
16
|
console.table(Object.entries(payload));
|
|
20
17
|
}
|
|
21
18
|
catch (err) {
|
|
22
|
-
|
|
19
|
+
printError(err, 'Error when getting base info');
|
|
23
20
|
}
|
|
24
21
|
};
|
|
25
|
-
exports.getBaseInfo = getBaseInfo;
|
|
26
22
|
//# sourceMappingURL=dashboard-delegation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-delegation.js","sourceRoot":"","sources":["../../features/dashboard-delegation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard-delegation.js","sourceRoot":"","sources":["../../features/dashboard-delegation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC9B,QAAgD,EAChD,EAAE;IACF,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QAEjD,MAAM,OAAO,GAAG;YACd,KAAK;YACL,MAAM;YACN,IAAI;YACJ,KAAK;YACL,MAAM;SACP,CAAC;QAEF,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC"}
|
package/dist/features/index.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./advanced-config"), exports);
|
|
18
|
-
__exportStar(require("./vault-factory"), exports);
|
|
19
|
-
__exportStar(require("./voting"), exports);
|
|
20
|
-
__exportStar(require("./dashboard-delegation"), exports);
|
|
1
|
+
export * from "./advanced-config.js";
|
|
2
|
+
export * from "./vault-factory.js";
|
|
3
|
+
export * from "./voting.js";
|
|
4
|
+
export * from "./dashboard-delegation.js";
|
|
21
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../features/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../features/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../features/token-manager.ts"],"names":[],"mappings":";AAAA;;;
|
|
1
|
+
{"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../features/token-manager.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C;;;KAGK"}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const chain = (0, _configs_1.getChain)();
|
|
13
|
-
const tx = await contract.write.createVaultWithDelegation([
|
|
14
|
-
{ ...payload },
|
|
15
|
-
'0x'
|
|
16
|
-
], {
|
|
17
|
-
account: (0, _providers_1.getAccount)(),
|
|
1
|
+
import { waitForTransactionReceipt } from 'viem/actions';
|
|
2
|
+
import { parseEventLogs } from 'viem';
|
|
3
|
+
import { getChain } from '../configs/index.js';
|
|
4
|
+
import { getAccount } from '../providers/index.js';
|
|
5
|
+
import { getVaultFactoryContract } from '../contracts/index.js';
|
|
6
|
+
import { VaultFactoryAbi } from '../abi/index.js';
|
|
7
|
+
export const createVault = async (payload) => {
|
|
8
|
+
const { contract, client } = getVaultFactoryContract();
|
|
9
|
+
const chain = getChain();
|
|
10
|
+
const tx = await contract.write.createVaultWithDelegation([{ ...payload }, '0x'], {
|
|
11
|
+
account: getAccount(),
|
|
18
12
|
chain,
|
|
19
13
|
});
|
|
20
|
-
const receipt = await
|
|
21
|
-
const events =
|
|
22
|
-
abi:
|
|
14
|
+
const receipt = await waitForTransactionReceipt(client, { hash: tx });
|
|
15
|
+
const events = parseEventLogs({
|
|
16
|
+
abi: VaultFactoryAbi,
|
|
23
17
|
logs: receipt.logs,
|
|
24
18
|
});
|
|
25
|
-
const vaultEvent = events.find(event => event.eventName === 'VaultCreated');
|
|
19
|
+
const vaultEvent = events.find((event) => event.eventName === 'VaultCreated');
|
|
26
20
|
const vault = vaultEvent?.args.vault;
|
|
27
21
|
const delegation = vaultEvent?.args.owner;
|
|
28
22
|
return {
|
|
@@ -32,5 +26,4 @@ const createVault = async (payload) => {
|
|
|
32
26
|
blockNumber: receipt.blockNumber,
|
|
33
27
|
};
|
|
34
28
|
};
|
|
35
|
-
exports.createVault = createVault;
|
|
36
29
|
//# sourceMappingURL=vault-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-factory.js","sourceRoot":"","sources":["../../features/vault-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vault-factory.js","sourceRoot":"","sources":["../../features/vault-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,OAA4B,EAAE,EAAE;IAChE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,uBAAuB,EAAE,CAAC;IACvD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,yBAAyB,CACvD,CAAC,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,EACtB;QACE,OAAO,EAAE,UAAU,EAAE;QACrB,KAAK;KACN,CACF,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,cAAc,CAAC;QAC5B,GAAG,EAAE,eAAe;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,KAAK,cAAc,CAAC,CAAC;IAC9E,MAAM,KAAK,GAAG,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC;IACrC,MAAM,UAAU,GAAG,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC;IAE1C,OAAO;QACL,KAAK;QACL,UAAU;QACV,EAAE;QACF,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAC;AACJ,CAAC,CAAC"}
|