@mixerx/config 0.1.0
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/LICENSE +674 -0
- package/README.md +13 -0
- package/dist/assertions.d.ts +25 -0
- package/dist/assertions.d.ts.map +1 -0
- package/dist/assertions.js +86 -0
- package/dist/assertions.js.map +1 -0
- package/dist/check-shape.d.ts +2 -0
- package/dist/check-shape.d.ts.map +1 -0
- package/dist/check-shape.js +16 -0
- package/dist/check-shape.js.map +1 -0
- package/dist/config.d.ts +68 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +352 -0
- package/dist/config.js.map +1 -0
- package/dist/guards.d.ts +3 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +8 -0
- package/dist/guards.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +110 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +31 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.assertValidConfigShape = exports.isSupportedNetId = exports.getInstancesForNetId = exports.getNetworkConfig = exports.networkConfigByNetId = exports.wrappedStablecoin = exports.mixerxToken = exports.tornadoProxyMainnet = exports.governanceProxy = exports.offchainOracle = exports.aggregator = exports.relayerRegistryProxy = exports.deployer = exports.instanceRegistry = exports.tornadoRouter = exports.relayerRegistry = exports.tornadoStakingRewards = exports.feeManager = exports.poseidonHasher3 = exports.poseidonHasher2 = exports.withdrawVerifier = exports.treeUpdateVerifier = exports.rewardVerifier = exports.tornadoProxyLight = exports.tornadoProxy = exports.governanceImpl = exports.governance = exports.tornadoTrees = exports.rewardSwap = exports.voucher = exports.instances = exports.vesting = exports.miningV2 = exports.torn = exports.config = void 0;
|
|
21
|
+
__exportStar(require("./types.js"), exports);
|
|
22
|
+
var config_js_1 = require("./config.js");
|
|
23
|
+
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return __importDefault(config_js_1).default; } });
|
|
24
|
+
Object.defineProperty(exports, "torn", { enumerable: true, get: function () { return config_js_1.torn; } });
|
|
25
|
+
Object.defineProperty(exports, "miningV2", { enumerable: true, get: function () { return config_js_1.miningV2; } });
|
|
26
|
+
Object.defineProperty(exports, "vesting", { enumerable: true, get: function () { return config_js_1.vesting; } });
|
|
27
|
+
Object.defineProperty(exports, "instances", { enumerable: true, get: function () { return config_js_1.instances; } });
|
|
28
|
+
Object.defineProperty(exports, "voucher", { enumerable: true, get: function () { return config_js_1.voucher; } });
|
|
29
|
+
Object.defineProperty(exports, "rewardSwap", { enumerable: true, get: function () { return config_js_1.rewardSwap; } });
|
|
30
|
+
Object.defineProperty(exports, "tornadoTrees", { enumerable: true, get: function () { return config_js_1.tornadoTrees; } });
|
|
31
|
+
Object.defineProperty(exports, "governance", { enumerable: true, get: function () { return config_js_1.governance; } });
|
|
32
|
+
Object.defineProperty(exports, "governanceImpl", { enumerable: true, get: function () { return config_js_1.governanceImpl; } });
|
|
33
|
+
Object.defineProperty(exports, "tornadoProxy", { enumerable: true, get: function () { return config_js_1.tornadoProxy; } });
|
|
34
|
+
Object.defineProperty(exports, "tornadoProxyLight", { enumerable: true, get: function () { return config_js_1.tornadoProxyLight; } });
|
|
35
|
+
Object.defineProperty(exports, "rewardVerifier", { enumerable: true, get: function () { return config_js_1.rewardVerifier; } });
|
|
36
|
+
Object.defineProperty(exports, "treeUpdateVerifier", { enumerable: true, get: function () { return config_js_1.treeUpdateVerifier; } });
|
|
37
|
+
Object.defineProperty(exports, "withdrawVerifier", { enumerable: true, get: function () { return config_js_1.withdrawVerifier; } });
|
|
38
|
+
Object.defineProperty(exports, "poseidonHasher2", { enumerable: true, get: function () { return config_js_1.poseidonHasher2; } });
|
|
39
|
+
Object.defineProperty(exports, "poseidonHasher3", { enumerable: true, get: function () { return config_js_1.poseidonHasher3; } });
|
|
40
|
+
Object.defineProperty(exports, "feeManager", { enumerable: true, get: function () { return config_js_1.feeManager; } });
|
|
41
|
+
Object.defineProperty(exports, "tornadoStakingRewards", { enumerable: true, get: function () { return config_js_1.tornadoStakingRewards; } });
|
|
42
|
+
Object.defineProperty(exports, "relayerRegistry", { enumerable: true, get: function () { return config_js_1.relayerRegistry; } });
|
|
43
|
+
Object.defineProperty(exports, "tornadoRouter", { enumerable: true, get: function () { return config_js_1.tornadoRouter; } });
|
|
44
|
+
Object.defineProperty(exports, "instanceRegistry", { enumerable: true, get: function () { return config_js_1.instanceRegistry; } });
|
|
45
|
+
Object.defineProperty(exports, "deployer", { enumerable: true, get: function () { return config_js_1.deployer; } });
|
|
46
|
+
Object.defineProperty(exports, "relayerRegistryProxy", { enumerable: true, get: function () { return config_js_1.relayerRegistryProxy; } });
|
|
47
|
+
Object.defineProperty(exports, "aggregator", { enumerable: true, get: function () { return config_js_1.aggregator; } });
|
|
48
|
+
Object.defineProperty(exports, "offchainOracle", { enumerable: true, get: function () { return config_js_1.offchainOracle; } });
|
|
49
|
+
Object.defineProperty(exports, "governanceProxy", { enumerable: true, get: function () { return config_js_1.governanceProxy; } });
|
|
50
|
+
Object.defineProperty(exports, "tornadoProxyMainnet", { enumerable: true, get: function () { return config_js_1.tornadoProxyMainnet; } });
|
|
51
|
+
Object.defineProperty(exports, "mixerxToken", { enumerable: true, get: function () { return config_js_1.mixerxToken; } });
|
|
52
|
+
Object.defineProperty(exports, "wrappedStablecoin", { enumerable: true, get: function () { return config_js_1.wrappedStablecoin; } });
|
|
53
|
+
Object.defineProperty(exports, "networkConfigByNetId", { enumerable: true, get: function () { return config_js_1.networkConfigByNetId; } });
|
|
54
|
+
Object.defineProperty(exports, "getNetworkConfig", { enumerable: true, get: function () { return config_js_1.getNetworkConfig; } });
|
|
55
|
+
Object.defineProperty(exports, "getInstancesForNetId", { enumerable: true, get: function () { return config_js_1.getInstancesForNetId; } });
|
|
56
|
+
var guards_js_1 = require("./guards.js");
|
|
57
|
+
Object.defineProperty(exports, "isSupportedNetId", { enumerable: true, get: function () { return guards_js_1.isSupportedNetId; } });
|
|
58
|
+
var assertions_js_1 = require("./assertions.js");
|
|
59
|
+
Object.defineProperty(exports, "assertValidConfigShape", { enumerable: true, get: function () { return assertions_js_1.assertValidConfigShape; } });
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yCAkCqB;AAjCnB,oHAAA,OAAO,OAAU;AACjB,iGAAA,IAAI,OAAA;AACJ,qGAAA,QAAQ,OAAA;AACR,oGAAA,OAAO,OAAA;AACP,sGAAA,SAAS,OAAA;AACT,oGAAA,OAAO,OAAA;AACP,uGAAA,UAAU,OAAA;AACV,yGAAA,YAAY,OAAA;AACZ,uGAAA,UAAU,OAAA;AACV,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AACZ,8GAAA,iBAAiB,OAAA;AACjB,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,6GAAA,gBAAgB,OAAA;AAChB,4GAAA,eAAe,OAAA;AACf,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AACV,kHAAA,qBAAqB,OAAA;AACrB,4GAAA,eAAe,OAAA;AACf,0GAAA,aAAa,OAAA;AACb,6GAAA,gBAAgB,OAAA;AAChB,qGAAA,QAAQ,OAAA;AACR,iHAAA,oBAAoB,OAAA;AACpB,uGAAA,UAAU,OAAA;AACV,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,gHAAA,mBAAmB,OAAA;AACnB,wGAAA,WAAW,OAAA;AACX,8GAAA,iBAAiB,OAAA;AACjB,iHAAA,oBAAoB,OAAA;AACpB,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AAEtB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,iDAAyD;AAAhD,uHAAA,sBAAsB,OAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export declare const SUPPORTED_NET_IDS: readonly [1, 5, 10, 56, 100, 137, 42161, 43114];
|
|
2
|
+
export type availableIds = (typeof SUPPORTED_NET_IDS)[number];
|
|
3
|
+
export type AvailableId = availableIds;
|
|
4
|
+
export type Address = {
|
|
5
|
+
address: string;
|
|
6
|
+
};
|
|
7
|
+
export type TokenConfig = {
|
|
8
|
+
address: string;
|
|
9
|
+
symbol: string;
|
|
10
|
+
decimals: number;
|
|
11
|
+
};
|
|
12
|
+
export type Torn = {
|
|
13
|
+
address: string;
|
|
14
|
+
capitalization: string;
|
|
15
|
+
pausePeriod: number;
|
|
16
|
+
distribution: {
|
|
17
|
+
airdrop: {
|
|
18
|
+
to: string;
|
|
19
|
+
amount: string;
|
|
20
|
+
};
|
|
21
|
+
miningV2: {
|
|
22
|
+
to: string;
|
|
23
|
+
amount: string;
|
|
24
|
+
};
|
|
25
|
+
governance: {
|
|
26
|
+
to: string;
|
|
27
|
+
amount: string;
|
|
28
|
+
};
|
|
29
|
+
team1: {
|
|
30
|
+
to: string;
|
|
31
|
+
amount: string;
|
|
32
|
+
};
|
|
33
|
+
team2: {
|
|
34
|
+
to: string;
|
|
35
|
+
amount: string;
|
|
36
|
+
};
|
|
37
|
+
team3: {
|
|
38
|
+
to: string;
|
|
39
|
+
amount: string;
|
|
40
|
+
};
|
|
41
|
+
team4: {
|
|
42
|
+
to: string;
|
|
43
|
+
amount: string;
|
|
44
|
+
};
|
|
45
|
+
team5: {
|
|
46
|
+
to: string;
|
|
47
|
+
amount: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export type Mining = {
|
|
52
|
+
address: string;
|
|
53
|
+
initialBalance: string;
|
|
54
|
+
rates: Array<{
|
|
55
|
+
instance: string;
|
|
56
|
+
value: string;
|
|
57
|
+
}>;
|
|
58
|
+
};
|
|
59
|
+
export type VestingInfo = {
|
|
60
|
+
address: string;
|
|
61
|
+
cliff: number;
|
|
62
|
+
duration: number;
|
|
63
|
+
beneficiary?: string;
|
|
64
|
+
};
|
|
65
|
+
export type Vesting = {
|
|
66
|
+
team1: VestingInfo;
|
|
67
|
+
team2: VestingInfo;
|
|
68
|
+
team3: VestingInfo;
|
|
69
|
+
team4: VestingInfo;
|
|
70
|
+
team5: VestingInfo;
|
|
71
|
+
governance: VestingInfo;
|
|
72
|
+
};
|
|
73
|
+
export type Voucher = {
|
|
74
|
+
address: string;
|
|
75
|
+
duration: number;
|
|
76
|
+
};
|
|
77
|
+
export type RewardSwap = {
|
|
78
|
+
address: string;
|
|
79
|
+
poolWeight: number;
|
|
80
|
+
};
|
|
81
|
+
export type TornadoTrees = {
|
|
82
|
+
address: string;
|
|
83
|
+
levels: number;
|
|
84
|
+
};
|
|
85
|
+
export type InstanceCurrency = {
|
|
86
|
+
instanceAddress: Record<number | string, string | undefined>;
|
|
87
|
+
symbol: string;
|
|
88
|
+
decimals: number;
|
|
89
|
+
tokenAddress?: string;
|
|
90
|
+
};
|
|
91
|
+
export type Instances = Partial<Record<availableIds, Record<string, InstanceCurrency>>>;
|
|
92
|
+
export type CurrencyConfig = InstanceCurrency;
|
|
93
|
+
export type NetworkContractsConfig = {
|
|
94
|
+
relayerRegistryAddress: string;
|
|
95
|
+
aggregator: string;
|
|
96
|
+
offchainOracleAddress: string;
|
|
97
|
+
governanceAddress: string;
|
|
98
|
+
oldMixerXProxy: string;
|
|
99
|
+
};
|
|
100
|
+
export type NetworkTokensConfig = {
|
|
101
|
+
mixerXTokenAddress: string;
|
|
102
|
+
mixerXTokenSymbol: string;
|
|
103
|
+
mixerXTokenDecimals: number;
|
|
104
|
+
wrappedStablecoinAddress: string;
|
|
105
|
+
};
|
|
106
|
+
export type NetworkConfig = {
|
|
107
|
+
contracts: NetworkContractsConfig;
|
|
108
|
+
tokens: NetworkTokensConfig;
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,iDAAkD,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;AAEvC,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;A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AC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,sBAAsB,CAAC;IAClC,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mixerx/config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed network and instance config for MixerX",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=20"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.json",
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
25
|
+
"check:shape": "node dist/check-shape.js"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^20.10.0",
|
|
29
|
+
"typescript": "^5.3.0"
|
|
30
|
+
}
|
|
31
|
+
}
|