@usdu-finance/usdu-core 0.0.5 → 0.0.6
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/index.d.mts +1 -8
- package/dist/index.d.ts +1 -8
- package/dist/index.js +2 -44
- package/dist/index.mjs +1 -38
- package/exports/index.ts +0 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
1
|
import * as abitype from 'abitype';
|
|
3
2
|
import * as viem_chains from 'viem/chains';
|
|
4
3
|
import { mainnet, polygon, arbitrum, optimism, base, avalanche, gnosis, sonic } from 'viem/chains';
|
|
5
4
|
import * as viem from 'viem';
|
|
6
5
|
import { Chain, Address } from 'viem';
|
|
7
6
|
|
|
8
|
-
declare function getChildFromSeed(seed: string, index: number): ethers.HDNodeWallet;
|
|
9
|
-
declare function getAddressFromChildIndex(seed: string, index: number): string;
|
|
10
|
-
declare function getPublicKeyFromChildIndex(seed: string, index: number): string;
|
|
11
|
-
declare function getPrivateKeyFromChildIndex(seed: string, index: number): string;
|
|
12
|
-
declare function getWalletInto(seed?: string | undefined, index?: string | undefined, amount?: number): void;
|
|
13
|
-
|
|
14
7
|
declare const ChainMain: {
|
|
15
8
|
readonly mainnet: {
|
|
16
9
|
blockExplorers: {
|
|
@@ -22197,4 +22190,4 @@ declare const VaultAdapterV1_ABI: readonly [{
|
|
|
22197
22190
|
readonly type: "function";
|
|
22198
22191
|
}];
|
|
22199
22192
|
|
|
22200
|
-
export { ADDRESS, AggregatorV3Interface_ABI, AragonDao_ABI, AragonDelayedAction_ABI, AragonMultiSig_ABI, AragonVetoMultiSig_ABI, type ChainAddressArbitrum, type ChainAddressAvalanche, type ChainAddressBase, type ChainAddressGnosis, type ChainAddressMainnet, type ChainAddressMap, type ChainAddressOptimism, type ChainAddressPolygon, type ChainAddressSonic, type ChainId, type ChainIdMain, type ChainIdSide, ChainMain, ChainSide, CurveAdapterV1_1_ABI, CurveAdapterV1_2_ABI, CurveAdapterV1_ABI, ERC20Permit_ABI, ERC20_ABI, ErrorsLib_ABI, EventsLib_ABI, ICurveStableSwapNG_ABI, IERC20Metadata_ABI, IERC20Permit_ABI, IERC20_ABI, IERC4626ABI, IMetaMorphoV1_1Base_ABI, IMetaMorphoV1_1StaticTyping_ABI, IMetaMorphoV1_1_ABI, IMorphoBase_ABI, IMorphoChainlinkOracleV2Factory_ABI, IMorphoChainlinkOracleV2_ABI, IMorphoFlashLoanCallback_ABI, IMorphoLiquidateCallback_ABI, IMorphoRepayCallback_ABI, IMorphoStaticTyping_ABI, IMorphoSupplyCallback_ABI, IMorphoSupplyCollateralCallback_ABI, IMorpho_ABI, IMulticall_ABI, IOracle_ABI, IOwnable_ABI, IStablecoinMetadata_ABI, IStablecoinModifier_ABI, IStablecoin_ABI, ITermMaxVault_ABI, MorphoAdapterV1_1_ABI, MorphoAdapterV1_2_ABI, MorphoAdapterV1_ABI, MorphoChainlinkOracleV2_ABI, RewardDistributionV1_ABI, Stablecoin_ABI, type SupportedChain, SupportedChainIds, SupportedChains, SupportedChainsMap, VaultAdapterRecoverV1_ABI, VaultAdapterV1_ABI
|
|
22193
|
+
export { ADDRESS, AggregatorV3Interface_ABI, AragonDao_ABI, AragonDelayedAction_ABI, AragonMultiSig_ABI, AragonVetoMultiSig_ABI, type ChainAddressArbitrum, type ChainAddressAvalanche, type ChainAddressBase, type ChainAddressGnosis, type ChainAddressMainnet, type ChainAddressMap, type ChainAddressOptimism, type ChainAddressPolygon, type ChainAddressSonic, type ChainId, type ChainIdMain, type ChainIdSide, ChainMain, ChainSide, CurveAdapterV1_1_ABI, CurveAdapterV1_2_ABI, CurveAdapterV1_ABI, ERC20Permit_ABI, ERC20_ABI, ErrorsLib_ABI, EventsLib_ABI, ICurveStableSwapNG_ABI, IERC20Metadata_ABI, IERC20Permit_ABI, IERC20_ABI, IERC4626ABI, IMetaMorphoV1_1Base_ABI, IMetaMorphoV1_1StaticTyping_ABI, IMetaMorphoV1_1_ABI, IMorphoBase_ABI, IMorphoChainlinkOracleV2Factory_ABI, IMorphoChainlinkOracleV2_ABI, IMorphoFlashLoanCallback_ABI, IMorphoLiquidateCallback_ABI, IMorphoRepayCallback_ABI, IMorphoStaticTyping_ABI, IMorphoSupplyCallback_ABI, IMorphoSupplyCollateralCallback_ABI, IMorpho_ABI, IMulticall_ABI, IOracle_ABI, IOwnable_ABI, IStablecoinMetadata_ABI, IStablecoinModifier_ABI, IStablecoin_ABI, ITermMaxVault_ABI, MorphoAdapterV1_1_ABI, MorphoAdapterV1_2_ABI, MorphoAdapterV1_ABI, MorphoChainlinkOracleV2_ABI, RewardDistributionV1_ABI, Stablecoin_ABI, type SupportedChain, SupportedChainIds, SupportedChains, SupportedChainsMap, VaultAdapterRecoverV1_ABI, VaultAdapterV1_ABI };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
1
|
import * as abitype from 'abitype';
|
|
3
2
|
import * as viem_chains from 'viem/chains';
|
|
4
3
|
import { mainnet, polygon, arbitrum, optimism, base, avalanche, gnosis, sonic } from 'viem/chains';
|
|
5
4
|
import * as viem from 'viem';
|
|
6
5
|
import { Chain, Address } from 'viem';
|
|
7
6
|
|
|
8
|
-
declare function getChildFromSeed(seed: string, index: number): ethers.HDNodeWallet;
|
|
9
|
-
declare function getAddressFromChildIndex(seed: string, index: number): string;
|
|
10
|
-
declare function getPublicKeyFromChildIndex(seed: string, index: number): string;
|
|
11
|
-
declare function getPrivateKeyFromChildIndex(seed: string, index: number): string;
|
|
12
|
-
declare function getWalletInto(seed?: string | undefined, index?: string | undefined, amount?: number): void;
|
|
13
|
-
|
|
14
7
|
declare const ChainMain: {
|
|
15
8
|
readonly mainnet: {
|
|
16
9
|
blockExplorers: {
|
|
@@ -22197,4 +22190,4 @@ declare const VaultAdapterV1_ABI: readonly [{
|
|
|
22197
22190
|
readonly type: "function";
|
|
22198
22191
|
}];
|
|
22199
22192
|
|
|
22200
|
-
export { ADDRESS, AggregatorV3Interface_ABI, AragonDao_ABI, AragonDelayedAction_ABI, AragonMultiSig_ABI, AragonVetoMultiSig_ABI, type ChainAddressArbitrum, type ChainAddressAvalanche, type ChainAddressBase, type ChainAddressGnosis, type ChainAddressMainnet, type ChainAddressMap, type ChainAddressOptimism, type ChainAddressPolygon, type ChainAddressSonic, type ChainId, type ChainIdMain, type ChainIdSide, ChainMain, ChainSide, CurveAdapterV1_1_ABI, CurveAdapterV1_2_ABI, CurveAdapterV1_ABI, ERC20Permit_ABI, ERC20_ABI, ErrorsLib_ABI, EventsLib_ABI, ICurveStableSwapNG_ABI, IERC20Metadata_ABI, IERC20Permit_ABI, IERC20_ABI, IERC4626ABI, IMetaMorphoV1_1Base_ABI, IMetaMorphoV1_1StaticTyping_ABI, IMetaMorphoV1_1_ABI, IMorphoBase_ABI, IMorphoChainlinkOracleV2Factory_ABI, IMorphoChainlinkOracleV2_ABI, IMorphoFlashLoanCallback_ABI, IMorphoLiquidateCallback_ABI, IMorphoRepayCallback_ABI, IMorphoStaticTyping_ABI, IMorphoSupplyCallback_ABI, IMorphoSupplyCollateralCallback_ABI, IMorpho_ABI, IMulticall_ABI, IOracle_ABI, IOwnable_ABI, IStablecoinMetadata_ABI, IStablecoinModifier_ABI, IStablecoin_ABI, ITermMaxVault_ABI, MorphoAdapterV1_1_ABI, MorphoAdapterV1_2_ABI, MorphoAdapterV1_ABI, MorphoChainlinkOracleV2_ABI, RewardDistributionV1_ABI, Stablecoin_ABI, type SupportedChain, SupportedChainIds, SupportedChains, SupportedChainsMap, VaultAdapterRecoverV1_ABI, VaultAdapterV1_ABI
|
|
22193
|
+
export { ADDRESS, AggregatorV3Interface_ABI, AragonDao_ABI, AragonDelayedAction_ABI, AragonMultiSig_ABI, AragonVetoMultiSig_ABI, type ChainAddressArbitrum, type ChainAddressAvalanche, type ChainAddressBase, type ChainAddressGnosis, type ChainAddressMainnet, type ChainAddressMap, type ChainAddressOptimism, type ChainAddressPolygon, type ChainAddressSonic, type ChainId, type ChainIdMain, type ChainIdSide, ChainMain, ChainSide, CurveAdapterV1_1_ABI, CurveAdapterV1_2_ABI, CurveAdapterV1_ABI, ERC20Permit_ABI, ERC20_ABI, ErrorsLib_ABI, EventsLib_ABI, ICurveStableSwapNG_ABI, IERC20Metadata_ABI, IERC20Permit_ABI, IERC20_ABI, IERC4626ABI, IMetaMorphoV1_1Base_ABI, IMetaMorphoV1_1StaticTyping_ABI, IMetaMorphoV1_1_ABI, IMorphoBase_ABI, IMorphoChainlinkOracleV2Factory_ABI, IMorphoChainlinkOracleV2_ABI, IMorphoFlashLoanCallback_ABI, IMorphoLiquidateCallback_ABI, IMorphoRepayCallback_ABI, IMorphoStaticTyping_ABI, IMorphoSupplyCallback_ABI, IMorphoSupplyCollateralCallback_ABI, IMorpho_ABI, IMulticall_ABI, IOracle_ABI, IOwnable_ABI, IStablecoinMetadata_ABI, IStablecoinModifier_ABI, IStablecoin_ABI, ITermMaxVault_ABI, MorphoAdapterV1_1_ABI, MorphoAdapterV1_2_ABI, MorphoAdapterV1_ABI, MorphoChainlinkOracleV2_ABI, RewardDistributionV1_ABI, Stablecoin_ABI, type SupportedChain, SupportedChainIds, SupportedChains, SupportedChainsMap, VaultAdapterRecoverV1_ABI, VaultAdapterV1_ABI };
|
package/dist/index.js
CHANGED
|
@@ -70,47 +70,10 @@ __export(exports_exports, {
|
|
|
70
70
|
SupportedChains: () => SupportedChains,
|
|
71
71
|
SupportedChainsMap: () => SupportedChainsMap,
|
|
72
72
|
VaultAdapterRecoverV1_ABI: () => VaultAdapterRecoverV1_ABI,
|
|
73
|
-
VaultAdapterV1_ABI: () => VaultAdapterV1_ABI
|
|
74
|
-
getAddressFromChildIndex: () => getAddressFromChildIndex,
|
|
75
|
-
getChildFromSeed: () => getChildFromSeed,
|
|
76
|
-
getPrivateKeyFromChildIndex: () => getPrivateKeyFromChildIndex,
|
|
77
|
-
getPublicKeyFromChildIndex: () => getPublicKeyFromChildIndex,
|
|
78
|
-
getWalletInto: () => getWalletInto
|
|
73
|
+
VaultAdapterV1_ABI: () => VaultAdapterV1_ABI
|
|
79
74
|
});
|
|
80
75
|
module.exports = __toCommonJS(exports_exports);
|
|
81
76
|
|
|
82
|
-
// helper/wallet.ts
|
|
83
|
-
var import_ethers = require("ethers");
|
|
84
|
-
function getChildFromSeed(seed, index) {
|
|
85
|
-
return import_ethers.ethers.HDNodeWallet.fromPhrase(seed, void 0, `m/44'/60'/0'/0/${index}`);
|
|
86
|
-
}
|
|
87
|
-
function getAddressFromChildIndex(seed, index) {
|
|
88
|
-
return getChildFromSeed(seed, index).address;
|
|
89
|
-
}
|
|
90
|
-
function getPublicKeyFromChildIndex(seed, index) {
|
|
91
|
-
return getChildFromSeed(seed, index).publicKey;
|
|
92
|
-
}
|
|
93
|
-
function getPrivateKeyFromChildIndex(seed, index) {
|
|
94
|
-
return getChildFromSeed(seed, index).privateKey;
|
|
95
|
-
}
|
|
96
|
-
function getWalletInto(seed = process.env.DEPLOYER_SEED, index = process.env.DEPLOYER_SEED_INDEX, amount = 3) {
|
|
97
|
-
if (!seed) throw new Error("Failed to import the seed string from .env");
|
|
98
|
-
if (!index) throw new Error("Failed to import the index string from .env");
|
|
99
|
-
console.log("seed:", seed);
|
|
100
|
-
const start = index && index?.length > 0 ? parseInt(index) : 0;
|
|
101
|
-
for (let i = start; i < start + amount; i++) {
|
|
102
|
-
const w = getChildFromSeed(seed, i);
|
|
103
|
-
console.log("Wallet", i);
|
|
104
|
-
console.log({
|
|
105
|
-
address: w.address,
|
|
106
|
-
pubKey: w.publicKey,
|
|
107
|
-
privKey: w.privateKey,
|
|
108
|
-
path: w.path,
|
|
109
|
-
index: w.index
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
77
|
// exports/address.config.ts
|
|
115
78
|
var import_chains = require("viem/chains");
|
|
116
79
|
var import_viem = require("viem");
|
|
@@ -23732,10 +23695,5 @@ var VaultAdapterV1_ABI = [
|
|
|
23732
23695
|
SupportedChains,
|
|
23733
23696
|
SupportedChainsMap,
|
|
23734
23697
|
VaultAdapterRecoverV1_ABI,
|
|
23735
|
-
VaultAdapterV1_ABI
|
|
23736
|
-
getAddressFromChildIndex,
|
|
23737
|
-
getChildFromSeed,
|
|
23738
|
-
getPrivateKeyFromChildIndex,
|
|
23739
|
-
getPublicKeyFromChildIndex,
|
|
23740
|
-
getWalletInto
|
|
23698
|
+
VaultAdapterV1_ABI
|
|
23741
23699
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
// helper/wallet.ts
|
|
2
|
-
import { ethers } from "ethers";
|
|
3
|
-
function getChildFromSeed(seed, index) {
|
|
4
|
-
return ethers.HDNodeWallet.fromPhrase(seed, void 0, `m/44'/60'/0'/0/${index}`);
|
|
5
|
-
}
|
|
6
|
-
function getAddressFromChildIndex(seed, index) {
|
|
7
|
-
return getChildFromSeed(seed, index).address;
|
|
8
|
-
}
|
|
9
|
-
function getPublicKeyFromChildIndex(seed, index) {
|
|
10
|
-
return getChildFromSeed(seed, index).publicKey;
|
|
11
|
-
}
|
|
12
|
-
function getPrivateKeyFromChildIndex(seed, index) {
|
|
13
|
-
return getChildFromSeed(seed, index).privateKey;
|
|
14
|
-
}
|
|
15
|
-
function getWalletInto(seed = process.env.DEPLOYER_SEED, index = process.env.DEPLOYER_SEED_INDEX, amount = 3) {
|
|
16
|
-
if (!seed) throw new Error("Failed to import the seed string from .env");
|
|
17
|
-
if (!index) throw new Error("Failed to import the index string from .env");
|
|
18
|
-
console.log("seed:", seed);
|
|
19
|
-
const start = index && index?.length > 0 ? parseInt(index) : 0;
|
|
20
|
-
for (let i = start; i < start + amount; i++) {
|
|
21
|
-
const w = getChildFromSeed(seed, i);
|
|
22
|
-
console.log("Wallet", i);
|
|
23
|
-
console.log({
|
|
24
|
-
address: w.address,
|
|
25
|
-
pubKey: w.publicKey,
|
|
26
|
-
privKey: w.privateKey,
|
|
27
|
-
path: w.path,
|
|
28
|
-
index: w.index
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
1
|
// exports/address.config.ts
|
|
34
2
|
import { arbitrum, avalanche, base, gnosis, mainnet, optimism, polygon, sonic } from "viem/chains";
|
|
35
3
|
import { zeroAddress } from "viem";
|
|
@@ -23650,10 +23618,5 @@ export {
|
|
|
23650
23618
|
SupportedChains,
|
|
23651
23619
|
SupportedChainsMap,
|
|
23652
23620
|
VaultAdapterRecoverV1_ABI,
|
|
23653
|
-
VaultAdapterV1_ABI
|
|
23654
|
-
getAddressFromChildIndex,
|
|
23655
|
-
getChildFromSeed,
|
|
23656
|
-
getPrivateKeyFromChildIndex,
|
|
23657
|
-
getPublicKeyFromChildIndex,
|
|
23658
|
-
getWalletInto
|
|
23621
|
+
VaultAdapterV1_ABI
|
|
23659
23622
|
};
|
package/exports/index.ts
CHANGED