@mento-protocol/mento-sdk 0.2.1 → 0.2.3

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.
Files changed (79) hide show
  1. package/dist/cjs/ChainClient.d.ts +1 -1
  2. package/dist/cjs/TestChainClient.d.ts +1 -1
  3. package/dist/cjs/TestChainClient.js +1 -1
  4. package/dist/cjs/constants/addresses.d.ts +2 -0
  5. package/dist/cjs/constants/addresses.js +72 -0
  6. package/dist/cjs/constants/index.d.ts +1 -0
  7. package/dist/cjs/constants/index.js +17 -0
  8. package/dist/cjs/enums/chainId.d.ts +5 -0
  9. package/dist/cjs/enums/chainId.js +9 -0
  10. package/dist/cjs/enums/index.d.ts +2 -0
  11. package/dist/cjs/enums/index.js +18 -0
  12. package/dist/cjs/enums/proposalState.d.ts +10 -0
  13. package/dist/cjs/governance.d.ts +1 -1
  14. package/dist/cjs/governance.js +8 -4
  15. package/dist/cjs/index.d.ts +1 -0
  16. package/dist/cjs/index.js +1 -0
  17. package/dist/cjs/interfaces/IChainClient.d.ts +6 -0
  18. package/dist/cjs/interfaces/IChainClient.js +2 -0
  19. package/dist/cjs/interfaces/index.d.ts +4 -0
  20. package/dist/cjs/interfaces/index.js +20 -0
  21. package/dist/cjs/interfaces/tradingLimit.d.ts +7 -0
  22. package/dist/cjs/interfaces/tradingLimit.js +2 -0
  23. package/dist/cjs/interfaces/tradingLimitsConfig.d.ts +8 -0
  24. package/dist/cjs/interfaces/tradingLimitsConfig.js +2 -0
  25. package/dist/cjs/interfaces/tradingLimitsState.d.ts +7 -0
  26. package/dist/cjs/interfaces/tradingLimitsState.js +2 -0
  27. package/dist/cjs/limits.d.ts +1 -1
  28. package/dist/cjs/mento.d.ts +1 -1
  29. package/dist/cjs/types/contractAddressMap.d.ts +4 -0
  30. package/dist/cjs/types/contractAddressMap.js +2 -0
  31. package/dist/cjs/types/contractAddresses.d.ts +22 -0
  32. package/dist/cjs/types/contractAddresses.js +2 -0
  33. package/dist/cjs/types/index.d.ts +2 -0
  34. package/dist/cjs/types/index.js +18 -0
  35. package/dist/cjs/utils.d.ts +1 -2
  36. package/dist/cjs/utils.js +1 -14
  37. package/dist/esm/ChainClient.d.ts +1 -1
  38. package/dist/esm/TestChainClient.d.ts +1 -1
  39. package/dist/esm/TestChainClient.js +1 -1
  40. package/dist/esm/constants/addresses.d.ts +2 -0
  41. package/dist/esm/constants/addresses.js +69 -0
  42. package/dist/esm/constants/index.d.ts +1 -0
  43. package/dist/esm/constants/index.js +1 -0
  44. package/dist/esm/enums/chainId.d.ts +5 -0
  45. package/dist/esm/enums/chainId.js +6 -0
  46. package/dist/esm/enums/index.d.ts +2 -0
  47. package/dist/esm/enums/index.js +2 -0
  48. package/dist/esm/enums/proposalState.d.ts +10 -0
  49. package/dist/esm/governance.d.ts +1 -1
  50. package/dist/esm/governance.js +7 -3
  51. package/dist/esm/index.d.ts +1 -0
  52. package/dist/esm/index.js +1 -0
  53. package/dist/esm/interfaces/IChainClient.d.ts +6 -0
  54. package/dist/esm/interfaces/IChainClient.js +1 -0
  55. package/dist/esm/interfaces/index.d.ts +4 -0
  56. package/dist/esm/interfaces/index.js +4 -0
  57. package/dist/esm/interfaces/tradingLimit.d.ts +7 -0
  58. package/dist/esm/interfaces/tradingLimit.js +1 -0
  59. package/dist/esm/interfaces/tradingLimitsConfig.d.ts +8 -0
  60. package/dist/esm/interfaces/tradingLimitsConfig.js +1 -0
  61. package/dist/esm/interfaces/tradingLimitsState.d.ts +7 -0
  62. package/dist/esm/interfaces/tradingLimitsState.js +1 -0
  63. package/dist/esm/limits.d.ts +1 -1
  64. package/dist/esm/mento.d.ts +1 -1
  65. package/dist/esm/types/contractAddressMap.d.ts +4 -0
  66. package/dist/esm/types/contractAddressMap.js +1 -0
  67. package/dist/esm/types/contractAddresses.d.ts +22 -0
  68. package/dist/esm/types/contractAddresses.js +1 -0
  69. package/dist/esm/types/index.d.ts +2 -0
  70. package/dist/esm/types/index.js +2 -0
  71. package/dist/esm/utils.d.ts +1 -2
  72. package/dist/esm/utils.js +0 -9
  73. package/package.json +1 -1
  74. package/dist/cjs/contracts.json +0 -29
  75. package/dist/cjs/types.d.ts +0 -50
  76. package/dist/esm/contracts.json +0 -29
  77. package/dist/esm/types.d.ts +0 -50
  78. /package/dist/cjs/{types.js → enums/proposalState.js} +0 -0
  79. /package/dist/esm/{types.js → enums/proposalState.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { PopulatedTransaction, ethers, providers } from 'ethers';
2
- import { IChainClient } from './types';
2
+ import { IChainClient } from './interfaces';
3
3
  export declare class ChainClient implements IChainClient {
4
4
  private readonly signerOrProvider;
5
5
  constructor(signerOrProvider: ethers.Signer | providers.Provider);
@@ -1,5 +1,5 @@
1
1
  import { PopulatedTransaction, ethers, providers } from 'ethers';
2
- import { IChainClient } from './types';
2
+ import { IChainClient } from './interfaces';
3
3
  export declare class TestChainClient implements IChainClient {
4
4
  getSigner(): Promise<ethers.Signer | providers.Provider>;
5
5
  getChainId(): Promise<number>;
@@ -19,7 +19,7 @@ class TestChainClient {
19
19
  }
20
20
  getChainId() {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
- return 1;
22
+ return 44787;
23
23
  });
24
24
  }
25
25
  populateTransaction(tx) {
@@ -0,0 +1,2 @@
1
+ import { ContractAddressMap } from '../types';
2
+ export declare const addresses: ContractAddressMap;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addresses = void 0;
4
+ const enums_1 = require("./../enums");
5
+ exports.addresses = {
6
+ [enums_1.ChainId.CELO]: {
7
+ GovernanceFactory: '',
8
+ Airgrab: '',
9
+ Emission: '',
10
+ MentoGovernor: '',
11
+ MentoToken: '',
12
+ TimelockController: '',
13
+ Locking: '',
14
+ Broker: '0x777A8255cA72412f0d706dc03C9D1987306B4CaD',
15
+ BiPoolManager: '0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901',
16
+ BreakerBox: '0x303ED1df62Fa067659B586EbEe8De0EcE824Ab39',
17
+ Reserve: '0x9380fA34Fd9e4Fd14c06305fd7B6199089eD4eb9',
18
+ ConstantSumPricingModule: '0xDebED1F6f6ce9F6e73AA25F95acBFFE2397550Fb',
19
+ ConstantProductPricingModule: '0x0c07126d0CB30E66eF7553Cc7C37143B4f06DddB',
20
+ MedianDeltaBreaker: '0x49349F92D2B17d491e42C8fdB02D19f072F9B5D9',
21
+ ValueDeltaBreaker: '0x4DBC33B3abA78475A5AA4BC7A5B11445d387BF68',
22
+ StableToken: '0x765DE816845861e75A25fCA122bb6898B8B1282a',
23
+ StableTokenEUR: '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73',
24
+ StableTokenBRL: '0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787',
25
+ StableTokenXOF: '0x73F93dcc49cB8A239e2032663e9475dd5ef29A08',
26
+ SortedOracles: '0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33',
27
+ },
28
+ [enums_1.ChainId.ALFAJORES]: {
29
+ GovernanceFactory: '0xD4079B322c392D6b196f90AA4c439fC2C16d6770',
30
+ Airgrab: '0x281fA47f59456fA04DF699539fA4b1F25e7769A3',
31
+ Emission: '0x8D1267bFf3f8166AEB2B58217b74188d1fe326f3',
32
+ MentoGovernor: '0x84382a356c1Dc6ada21997E64dc72e5a7AcF5826',
33
+ MentoToken: '0x53De3F938c64baB8C621c8A3C5000b385afE2404',
34
+ TimelockController: '0x2AFC4a1e7928Fb3bfC81076740d3142FF8B1DE05',
35
+ Locking: '0x65a1271ce7B2ec8D564A4Bc752E13A36a46e81B8',
36
+ Broker: '0xD3Dff18E465bCa6241A244144765b4421Ac14D09',
37
+ BiPoolManager: '0x9B64E8EaBD1a035b148cE970d3319c5C3Ad53EC3',
38
+ BreakerBox: '0xC76BDf0AFb654888728003683cf748A8B1b4f5fD',
39
+ Reserve: '0xa7ed835288Aa4524bB6C73DD23c0bF4315D9Fe3e',
40
+ ConstantSumPricingModule: '0x474DBf1eDF845410bdaC6aeE97C3CC403651ba2E',
41
+ ConstantProductPricingModule: '0x99EDce8143FF8AeFA1fBB6C2103B349Add2B9519',
42
+ MedianDeltaBreaker: '0x6B0a2076713fDAef4F9301fe8404a228e3682DE4',
43
+ ValueDeltaBreaker: '0xfa6fFf746a5E74055e432f3bba26138956AEfbFe',
44
+ StableToken: '0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1',
45
+ StableTokenEUR: '0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F',
46
+ StableTokenBRL: '0xE4D517785D091D3c54818832dB6094bcc2744545',
47
+ StableTokenXOF: '0xB0FA15e002516d0301884059c0aaC0F0C72b019D',
48
+ SortedOracles: '0xFdd8bD58115FfBf04e47411c1d228eCC45E93075',
49
+ },
50
+ [enums_1.ChainId.BAKLAVA]: {
51
+ GovernanceFactory: '0x77645271665AdDF195202dEf1ad3cA678B442411',
52
+ Airgrab: '0x349aa8910577A6fE16cA7b98b5A135d14CE4dF9f',
53
+ Emission: '0xcd427DDB27D835E5353312e7897bb9ad35F0E214',
54
+ MentoGovernor: '0x5dFE8CC7743C636a86bED8F8d0de982d502E22fC',
55
+ MentoToken: '0xD2f4f160BAF7D88a7A9189b03D0B3AA6A5D9775B',
56
+ TimelockController: '0xb5977b1d208ef35FAf97A9534Dd849c356F362C5',
57
+ Locking: '0x831DAfC0912e1c2aBa2Da90668c0856d48a8C06b',
58
+ Broker: '0x6723749339e320E1EFcd9f1B0D997ecb45587208',
59
+ BiPoolManager: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411',
60
+ BreakerBox: '0x5Ea5A5F694F10de979BEeC7b8041E9f931F54bc7',
61
+ Reserve: '0x68Dd816611d3DE196FDeb87438B74A9c29fd649f',
62
+ ConstantSumPricingModule: '0x2901da88dd444a3c41AF51696548DEe3524Cf8Dc',
63
+ ConstantProductPricingModule: '0x7586680Dd2e4F977C33cDbd597fa2490e342CbA2',
64
+ MedianDeltaBreaker: '0x286a8137EE9EE6dE8B5e5be334706fA812400994',
65
+ ValueDeltaBreaker: '0xf631F58b1B51E99dF3Ad1CE18f5C42ab41e4A17a',
66
+ StableToken: '0x62492A644A588FD904270BeD06ad52B9abfEA1aE',
67
+ StableTokenEUR: '0xf9ecE301247aD2CE21894941830A2470f4E774ca',
68
+ StableTokenBRL: '0x6a0EEf2bed4C30Dc2CB42fe6c5f01F80f7EF16d1',
69
+ StableTokenXOF: '0x64c1D812673E93Bc036AdC3D547d9950696DA5Af',
70
+ SortedOracles: '0x88A187a876290E9843175027902B9f7f1B092c88',
71
+ },
72
+ };
@@ -0,0 +1 @@
1
+ export * from './addresses';
@@ -0,0 +1,17 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./addresses"), exports);
@@ -0,0 +1,5 @@
1
+ export declare enum ChainId {
2
+ CELO = 42220,
3
+ ALFAJORES = 44787,
4
+ BAKLAVA = 62320
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChainId = void 0;
4
+ var ChainId;
5
+ (function (ChainId) {
6
+ ChainId[ChainId["CELO"] = 42220] = "CELO";
7
+ ChainId[ChainId["ALFAJORES"] = 44787] = "ALFAJORES";
8
+ ChainId[ChainId["BAKLAVA"] = 62320] = "BAKLAVA";
9
+ })(ChainId = exports.ChainId || (exports.ChainId = {}));
@@ -0,0 +1,2 @@
1
+ export * from './proposalState';
2
+ export * from './chainId';
@@ -0,0 +1,18 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./proposalState"), exports);
18
+ __exportStar(require("./chainId"), exports);
@@ -0,0 +1,10 @@
1
+ export declare enum ProposalState {
2
+ PENDING = 0,
3
+ ACTIVE = 1,
4
+ CANCELED = 2,
5
+ DEFEATED = 3,
6
+ SUCCEEDED = 4,
7
+ QUEUED = 5,
8
+ EXPIRED = 6,
9
+ EXECUTED = 7
10
+ }
@@ -1,6 +1,6 @@
1
1
  import { BigNumberish, Signer, providers } from 'ethers';
2
2
  import { MentoGovernor } from '@mento-protocol/mento-core-ts';
3
- import { IChainClient } from './types';
3
+ import { IChainClient } from './interfaces';
4
4
  export declare class Governance {
5
5
  private chainClient;
6
6
  constructor(chainClient: IChainClient);
@@ -11,11 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Governance = void 0;
13
13
  const ethers_1 = require("ethers");
14
- const utils_1 = require("./utils");
15
14
  const mento_core_ts_1 = require("@mento-protocol/mento-core-ts");
16
- const types_1 = require("./types");
17
15
  const ChainClient_1 = require("./ChainClient");
18
16
  const TestChainClient_1 = require("./TestChainClient");
17
+ const enums_1 = require("./enums");
18
+ const constants_1 = require("./constants");
19
19
  class Governance {
20
20
  constructor(arg) {
21
21
  // TODO: Remove use of TestChainClient in future this is only meant for testing
@@ -35,7 +35,11 @@ class Governance {
35
35
  */
36
36
  getGovernorContract() {
37
37
  return __awaiter(this, void 0, void 0, function* () {
38
- const contracts = (0, utils_1.getContractsByChainId)(yield this.chainClient.getChainId());
38
+ const chainId = yield this.chainClient.getChainId();
39
+ const contracts = constants_1.addresses[chainId];
40
+ if (!contracts) {
41
+ throw new Error(`Contracts not deployed on network with chain id ${chainId}`);
42
+ }
39
43
  const mentoGovernorAddress = contracts.MentoGovernor;
40
44
  return mento_core_ts_1.MentoGovernor__factory.connect(mentoGovernorAddress, yield this.chainClient.getSigner());
41
45
  });
@@ -115,7 +119,7 @@ class Governance {
115
119
  return __awaiter(this, void 0, void 0, function* () {
116
120
  const governor = yield this.getGovernorContract();
117
121
  const state = (yield governor.functions.state(proposalId))[0];
118
- return types_1.ProposalState[state];
122
+ return enums_1.ProposalState[state];
119
123
  });
120
124
  }
121
125
  /**
@@ -1,4 +1,5 @@
1
1
  export * from './mento';
2
2
  export * from './governance';
3
3
  export * from './utils';
4
+ export * from './constants';
4
5
  export { ContractAddresses } from './types';
package/dist/cjs/index.js CHANGED
@@ -18,3 +18,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  __exportStar(require("./mento"), exports);
19
19
  __exportStar(require("./governance"), exports);
20
20
  __exportStar(require("./utils"), exports);
21
+ __exportStar(require("./constants"), exports);
@@ -0,0 +1,6 @@
1
+ import { ethers, providers } from 'ethers';
2
+ export interface IChainClient {
3
+ getSigner(): Promise<ethers.Signer | providers.Provider>;
4
+ getChainId(): Promise<number>;
5
+ populateTransaction(tx: ethers.PopulatedTransaction): Promise<providers.TransactionRequest>;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export * from './tradingLimit';
2
+ export * from './tradingLimitsConfig';
3
+ export * from './tradingLimitsState';
4
+ export * from './IChainClient';
@@ -0,0 +1,20 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./tradingLimit"), exports);
18
+ __exportStar(require("./tradingLimitsConfig"), exports);
19
+ __exportStar(require("./tradingLimitsState"), exports);
20
+ __exportStar(require("./IChainClient"), exports);
@@ -0,0 +1,7 @@
1
+ export type Address = string;
2
+ export interface TradingLimit {
3
+ asset: Address;
4
+ maxIn: number;
5
+ maxOut: number;
6
+ until: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface TradingLimitsConfig {
2
+ timestep0: number;
3
+ timestep1: number;
4
+ limit0: number;
5
+ limit1: number;
6
+ limitGlobal: number;
7
+ flags: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface TradingLimitsState {
2
+ lastUpdated0: number;
3
+ lastUpdated1: number;
4
+ netflow0: number;
5
+ netflow1: number;
6
+ netflowGlobal: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './types';
1
+ import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './interfaces';
2
2
  import { Broker } from '@mento-protocol/mento-core-ts';
3
3
  /**
4
4
  * Returns the limit configuration in the broker for the given exchange and asset
@@ -1,4 +1,4 @@
1
- import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './types';
1
+ import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './interfaces';
2
2
  import { IBroker } from '@mento-protocol/mento-core-ts';
3
3
  import { BigNumber, BigNumberish, Signer, providers } from 'ethers';
4
4
  export interface Exchange {
@@ -0,0 +1,4 @@
1
+ import { ContractAddresses } from '.';
2
+ export type ContractAddressMap = {
3
+ [chainId: number]: ContractAddresses;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ export type ContractAddresses = {
2
+ GovernanceFactory: string;
3
+ Airgrab: string;
4
+ Emission: string;
5
+ MentoGovernor: string;
6
+ MentoToken: string;
7
+ TimelockController: string;
8
+ Locking: string;
9
+ Broker: string;
10
+ BiPoolManager: string;
11
+ BreakerBox: string;
12
+ Reserve: string;
13
+ ConstantSumPricingModule: string;
14
+ ConstantProductPricingModule: string;
15
+ MedianDeltaBreaker: string;
16
+ ValueDeltaBreaker: string;
17
+ StableToken: string;
18
+ StableTokenEUR: string;
19
+ StableTokenBRL: string;
20
+ StableTokenXOF: string;
21
+ SortedOracles: string;
22
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './contractAddresses';
2
+ export * from './contractAddressMap';
@@ -0,0 +1,18 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./contractAddresses"), exports);
18
+ __exportStar(require("./contractAddressMap"), exports);
@@ -1,5 +1,5 @@
1
1
  import { BigNumberish, providers, Signer } from 'ethers';
2
- import { Address, ContractAddresses } from './types';
2
+ import { Address } from './interfaces';
3
3
  /**
4
4
  * Ensures that given signer is truly a a connected signer
5
5
  * @param signer an ethers signer
@@ -34,4 +34,3 @@ export declare function getSymbolFromTokenAddress(tokenAddr: Address, signerOrPr
34
34
  * @returns the populated TransactionRequest object
35
35
  */
36
36
  export declare function increaseAllowance(tokenAddr: string, spender: string, amount: BigNumberish, signerOrProvider: Signer | providers.Provider): Promise<providers.TransactionRequest>;
37
- export declare function getContractsByChainId(chainId: number): ContractAddresses;
package/dist/cjs/utils.js CHANGED
@@ -8,13 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getContractsByChainId = exports.increaseAllowance = exports.getSymbolFromTokenAddress = exports.getBrokerAddressFromRegistry = exports.validateSignerOrProvider = exports.validateSigner = void 0;
12
+ exports.increaseAllowance = exports.getSymbolFromTokenAddress = exports.getBrokerAddressFromRegistry = exports.validateSignerOrProvider = exports.validateSigner = void 0;
16
13
  const ethers_1 = require("ethers");
17
- const contracts_json_1 = __importDefault(require("./contracts.json"));
18
14
  /**
19
15
  * Ensures that given signer is truly a a connected signer
20
16
  * @param signer an ethers signer
@@ -100,12 +96,3 @@ function increaseAllowance(tokenAddr, spender, amount, signerOrProvider) {
100
96
  });
101
97
  }
102
98
  exports.increaseAllowance = increaseAllowance;
103
- function getContractsByChainId(chainId) {
104
- const addresses = contracts_json_1.default;
105
- const contracts = addresses[chainId];
106
- if (!contracts) {
107
- throw new Error(`No contracts found for chainId ${chainId}`);
108
- }
109
- return contracts;
110
- }
111
- exports.getContractsByChainId = getContractsByChainId;
@@ -1,5 +1,5 @@
1
1
  import { PopulatedTransaction, ethers, providers } from 'ethers';
2
- import { IChainClient } from './types';
2
+ import { IChainClient } from './interfaces';
3
3
  export declare class ChainClient implements IChainClient {
4
4
  private readonly signerOrProvider;
5
5
  constructor(signerOrProvider: ethers.Signer | providers.Provider);
@@ -1,5 +1,5 @@
1
1
  import { PopulatedTransaction, ethers, providers } from 'ethers';
2
- import { IChainClient } from './types';
2
+ import { IChainClient } from './interfaces';
3
3
  export declare class TestChainClient implements IChainClient {
4
4
  getSigner(): Promise<ethers.Signer | providers.Provider>;
5
5
  getChainId(): Promise<number>;
@@ -16,7 +16,7 @@ export class TestChainClient {
16
16
  }
17
17
  getChainId() {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
- return 1;
19
+ return 44787;
20
20
  });
21
21
  }
22
22
  populateTransaction(tx) {
@@ -0,0 +1,2 @@
1
+ import { ContractAddressMap } from '../types';
2
+ export declare const addresses: ContractAddressMap;
@@ -0,0 +1,69 @@
1
+ import { ChainId } from './../enums';
2
+ export const addresses = {
3
+ [ChainId.CELO]: {
4
+ GovernanceFactory: '',
5
+ Airgrab: '',
6
+ Emission: '',
7
+ MentoGovernor: '',
8
+ MentoToken: '',
9
+ TimelockController: '',
10
+ Locking: '',
11
+ Broker: '0x777A8255cA72412f0d706dc03C9D1987306B4CaD',
12
+ BiPoolManager: '0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901',
13
+ BreakerBox: '0x303ED1df62Fa067659B586EbEe8De0EcE824Ab39',
14
+ Reserve: '0x9380fA34Fd9e4Fd14c06305fd7B6199089eD4eb9',
15
+ ConstantSumPricingModule: '0xDebED1F6f6ce9F6e73AA25F95acBFFE2397550Fb',
16
+ ConstantProductPricingModule: '0x0c07126d0CB30E66eF7553Cc7C37143B4f06DddB',
17
+ MedianDeltaBreaker: '0x49349F92D2B17d491e42C8fdB02D19f072F9B5D9',
18
+ ValueDeltaBreaker: '0x4DBC33B3abA78475A5AA4BC7A5B11445d387BF68',
19
+ StableToken: '0x765DE816845861e75A25fCA122bb6898B8B1282a',
20
+ StableTokenEUR: '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73',
21
+ StableTokenBRL: '0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787',
22
+ StableTokenXOF: '0x73F93dcc49cB8A239e2032663e9475dd5ef29A08',
23
+ SortedOracles: '0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33',
24
+ },
25
+ [ChainId.ALFAJORES]: {
26
+ GovernanceFactory: '0xD4079B322c392D6b196f90AA4c439fC2C16d6770',
27
+ Airgrab: '0x281fA47f59456fA04DF699539fA4b1F25e7769A3',
28
+ Emission: '0x8D1267bFf3f8166AEB2B58217b74188d1fe326f3',
29
+ MentoGovernor: '0x84382a356c1Dc6ada21997E64dc72e5a7AcF5826',
30
+ MentoToken: '0x53De3F938c64baB8C621c8A3C5000b385afE2404',
31
+ TimelockController: '0x2AFC4a1e7928Fb3bfC81076740d3142FF8B1DE05',
32
+ Locking: '0x65a1271ce7B2ec8D564A4Bc752E13A36a46e81B8',
33
+ Broker: '0xD3Dff18E465bCa6241A244144765b4421Ac14D09',
34
+ BiPoolManager: '0x9B64E8EaBD1a035b148cE970d3319c5C3Ad53EC3',
35
+ BreakerBox: '0xC76BDf0AFb654888728003683cf748A8B1b4f5fD',
36
+ Reserve: '0xa7ed835288Aa4524bB6C73DD23c0bF4315D9Fe3e',
37
+ ConstantSumPricingModule: '0x474DBf1eDF845410bdaC6aeE97C3CC403651ba2E',
38
+ ConstantProductPricingModule: '0x99EDce8143FF8AeFA1fBB6C2103B349Add2B9519',
39
+ MedianDeltaBreaker: '0x6B0a2076713fDAef4F9301fe8404a228e3682DE4',
40
+ ValueDeltaBreaker: '0xfa6fFf746a5E74055e432f3bba26138956AEfbFe',
41
+ StableToken: '0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1',
42
+ StableTokenEUR: '0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F',
43
+ StableTokenBRL: '0xE4D517785D091D3c54818832dB6094bcc2744545',
44
+ StableTokenXOF: '0xB0FA15e002516d0301884059c0aaC0F0C72b019D',
45
+ SortedOracles: '0xFdd8bD58115FfBf04e47411c1d228eCC45E93075',
46
+ },
47
+ [ChainId.BAKLAVA]: {
48
+ GovernanceFactory: '0x77645271665AdDF195202dEf1ad3cA678B442411',
49
+ Airgrab: '0x349aa8910577A6fE16cA7b98b5A135d14CE4dF9f',
50
+ Emission: '0xcd427DDB27D835E5353312e7897bb9ad35F0E214',
51
+ MentoGovernor: '0x5dFE8CC7743C636a86bED8F8d0de982d502E22fC',
52
+ MentoToken: '0xD2f4f160BAF7D88a7A9189b03D0B3AA6A5D9775B',
53
+ TimelockController: '0xb5977b1d208ef35FAf97A9534Dd849c356F362C5',
54
+ Locking: '0x831DAfC0912e1c2aBa2Da90668c0856d48a8C06b',
55
+ Broker: '0x6723749339e320E1EFcd9f1B0D997ecb45587208',
56
+ BiPoolManager: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411',
57
+ BreakerBox: '0x5Ea5A5F694F10de979BEeC7b8041E9f931F54bc7',
58
+ Reserve: '0x68Dd816611d3DE196FDeb87438B74A9c29fd649f',
59
+ ConstantSumPricingModule: '0x2901da88dd444a3c41AF51696548DEe3524Cf8Dc',
60
+ ConstantProductPricingModule: '0x7586680Dd2e4F977C33cDbd597fa2490e342CbA2',
61
+ MedianDeltaBreaker: '0x286a8137EE9EE6dE8B5e5be334706fA812400994',
62
+ ValueDeltaBreaker: '0xf631F58b1B51E99dF3Ad1CE18f5C42ab41e4A17a',
63
+ StableToken: '0x62492A644A588FD904270BeD06ad52B9abfEA1aE',
64
+ StableTokenEUR: '0xf9ecE301247aD2CE21894941830A2470f4E774ca',
65
+ StableTokenBRL: '0x6a0EEf2bed4C30Dc2CB42fe6c5f01F80f7EF16d1',
66
+ StableTokenXOF: '0x64c1D812673E93Bc036AdC3D547d9950696DA5Af',
67
+ SortedOracles: '0x88A187a876290E9843175027902B9f7f1B092c88',
68
+ },
69
+ };
@@ -0,0 +1 @@
1
+ export * from './addresses';
@@ -0,0 +1 @@
1
+ export * from './addresses';
@@ -0,0 +1,5 @@
1
+ export declare enum ChainId {
2
+ CELO = 42220,
3
+ ALFAJORES = 44787,
4
+ BAKLAVA = 62320
5
+ }
@@ -0,0 +1,6 @@
1
+ export var ChainId;
2
+ (function (ChainId) {
3
+ ChainId[ChainId["CELO"] = 42220] = "CELO";
4
+ ChainId[ChainId["ALFAJORES"] = 44787] = "ALFAJORES";
5
+ ChainId[ChainId["BAKLAVA"] = 62320] = "BAKLAVA";
6
+ })(ChainId || (ChainId = {}));
@@ -0,0 +1,2 @@
1
+ export * from './proposalState';
2
+ export * from './chainId';
@@ -0,0 +1,2 @@
1
+ export * from './proposalState';
2
+ export * from './chainId';
@@ -0,0 +1,10 @@
1
+ export declare enum ProposalState {
2
+ PENDING = 0,
3
+ ACTIVE = 1,
4
+ CANCELED = 2,
5
+ DEFEATED = 3,
6
+ SUCCEEDED = 4,
7
+ QUEUED = 5,
8
+ EXPIRED = 6,
9
+ EXECUTED = 7
10
+ }
@@ -1,6 +1,6 @@
1
1
  import { BigNumberish, Signer, providers } from 'ethers';
2
2
  import { MentoGovernor } from '@mento-protocol/mento-core-ts';
3
- import { IChainClient } from './types';
3
+ import { IChainClient } from './interfaces';
4
4
  export declare class Governance {
5
5
  private chainClient;
6
6
  constructor(chainClient: IChainClient);
@@ -8,11 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { Signer, providers } from 'ethers';
11
- import { getContractsByChainId } from './utils';
12
11
  import { MentoGovernor__factory, } from '@mento-protocol/mento-core-ts';
13
- import { ProposalState } from './types';
14
12
  import { ChainClient } from './ChainClient';
15
13
  import { TestChainClient } from './TestChainClient';
14
+ import { ProposalState } from './enums';
15
+ import { addresses } from './constants';
16
16
  export class Governance {
17
17
  constructor(arg) {
18
18
  // TODO: Remove use of TestChainClient in future this is only meant for testing
@@ -32,7 +32,11 @@ export class Governance {
32
32
  */
33
33
  getGovernorContract() {
34
34
  return __awaiter(this, void 0, void 0, function* () {
35
- const contracts = getContractsByChainId(yield this.chainClient.getChainId());
35
+ const chainId = yield this.chainClient.getChainId();
36
+ const contracts = addresses[chainId];
37
+ if (!contracts) {
38
+ throw new Error(`Contracts not deployed on network with chain id ${chainId}`);
39
+ }
36
40
  const mentoGovernorAddress = contracts.MentoGovernor;
37
41
  return MentoGovernor__factory.connect(mentoGovernorAddress, yield this.chainClient.getSigner());
38
42
  });
@@ -1,4 +1,5 @@
1
1
  export * from './mento';
2
2
  export * from './governance';
3
3
  export * from './utils';
4
+ export * from './constants';
4
5
  export { ContractAddresses } from './types';
package/dist/esm/index.js CHANGED
@@ -2,3 +2,4 @@
2
2
  export * from './mento';
3
3
  export * from './governance';
4
4
  export * from './utils';
5
+ export * from './constants';
@@ -0,0 +1,6 @@
1
+ import { ethers, providers } from 'ethers';
2
+ export interface IChainClient {
3
+ getSigner(): Promise<ethers.Signer | providers.Provider>;
4
+ getChainId(): Promise<number>;
5
+ populateTransaction(tx: ethers.PopulatedTransaction): Promise<providers.TransactionRequest>;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './tradingLimit';
2
+ export * from './tradingLimitsConfig';
3
+ export * from './tradingLimitsState';
4
+ export * from './IChainClient';
@@ -0,0 +1,4 @@
1
+ export * from './tradingLimit';
2
+ export * from './tradingLimitsConfig';
3
+ export * from './tradingLimitsState';
4
+ export * from './IChainClient';
@@ -0,0 +1,7 @@
1
+ export type Address = string;
2
+ export interface TradingLimit {
3
+ asset: Address;
4
+ maxIn: number;
5
+ maxOut: number;
6
+ until: number;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface TradingLimitsConfig {
2
+ timestep0: number;
3
+ timestep1: number;
4
+ limit0: number;
5
+ limit1: number;
6
+ limitGlobal: number;
7
+ flags: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface TradingLimitsState {
2
+ lastUpdated0: number;
3
+ lastUpdated1: number;
4
+ netflow0: number;
5
+ netflow1: number;
6
+ netflowGlobal: number;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './types';
1
+ import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './interfaces';
2
2
  import { Broker } from '@mento-protocol/mento-core-ts';
3
3
  /**
4
4
  * Returns the limit configuration in the broker for the given exchange and asset
@@ -1,4 +1,4 @@
1
- import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './types';
1
+ import { Address, TradingLimit, TradingLimitsConfig, TradingLimitsState } from './interfaces';
2
2
  import { IBroker } from '@mento-protocol/mento-core-ts';
3
3
  import { BigNumber, BigNumberish, Signer, providers } from 'ethers';
4
4
  export interface Exchange {
@@ -0,0 +1,4 @@
1
+ import { ContractAddresses } from '.';
2
+ export type ContractAddressMap = {
3
+ [chainId: number]: ContractAddresses;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ export type ContractAddresses = {
2
+ GovernanceFactory: string;
3
+ Airgrab: string;
4
+ Emission: string;
5
+ MentoGovernor: string;
6
+ MentoToken: string;
7
+ TimelockController: string;
8
+ Locking: string;
9
+ Broker: string;
10
+ BiPoolManager: string;
11
+ BreakerBox: string;
12
+ Reserve: string;
13
+ ConstantSumPricingModule: string;
14
+ ConstantProductPricingModule: string;
15
+ MedianDeltaBreaker: string;
16
+ ValueDeltaBreaker: string;
17
+ StableToken: string;
18
+ StableTokenEUR: string;
19
+ StableTokenBRL: string;
20
+ StableTokenXOF: string;
21
+ SortedOracles: string;
22
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './contractAddresses';
2
+ export * from './contractAddressMap';
@@ -0,0 +1,2 @@
1
+ export * from './contractAddresses';
2
+ export * from './contractAddressMap';
@@ -1,5 +1,5 @@
1
1
  import { BigNumberish, providers, Signer } from 'ethers';
2
- import { Address, ContractAddresses } from './types';
2
+ import { Address } from './interfaces';
3
3
  /**
4
4
  * Ensures that given signer is truly a a connected signer
5
5
  * @param signer an ethers signer
@@ -34,4 +34,3 @@ export declare function getSymbolFromTokenAddress(tokenAddr: Address, signerOrPr
34
34
  * @returns the populated TransactionRequest object
35
35
  */
36
36
  export declare function increaseAllowance(tokenAddr: string, spender: string, amount: BigNumberish, signerOrProvider: Signer | providers.Provider): Promise<providers.TransactionRequest>;
37
- export declare function getContractsByChainId(chainId: number): ContractAddresses;
package/dist/esm/utils.js CHANGED
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { constants, Contract, providers, Signer } from 'ethers';
11
- import contractAddresses from './contracts.json';
12
11
  /**
13
12
  * Ensures that given signer is truly a a connected signer
14
13
  * @param signer an ethers signer
@@ -89,11 +88,3 @@ export function increaseAllowance(tokenAddr, spender, amount, signerOrProvider)
89
88
  return yield contract.populateTransaction.increaseAllowance(spender, amount);
90
89
  });
91
90
  }
92
- export function getContractsByChainId(chainId) {
93
- const addresses = contractAddresses;
94
- const contracts = addresses[chainId];
95
- if (!contracts) {
96
- throw new Error(`No contracts found for chainId ${chainId}`);
97
- }
98
- return contracts;
99
- }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mento-protocol/mento-sdk",
3
3
  "description": "Official SDK for interacting with the Mento Protocol",
4
- "version": "0.2.1",
4
+ "version": "0.2.3",
5
5
  "license": "MIT",
6
6
  "author": "Mento Labs",
7
7
  "keywords": [
@@ -1,29 +0,0 @@
1
- {
2
- "42220": {
3
- "GovernanceFactory": "",
4
- "Airgrab": "",
5
- "Emission": "",
6
- "MentoGovernor": "",
7
- "MentoToken": "",
8
- "TimelockController": "",
9
- "Locking": ""
10
- },
11
- "62320": {
12
- "GovernanceFactory": "0x77645271665AdDF195202dEf1ad3cA678B442411",
13
- "Airgrab": "0x349aa8910577A6fE16cA7b98b5A135d14CE4dF9f",
14
- "Emission": "0xcd427DDB27D835E5353312e7897bb9ad35F0E214",
15
- "MentoGovernor": "0x5dFE8CC7743C636a86bED8F8d0de982d502E22fC",
16
- "MentoToken": "0xD2f4f160BAF7D88a7A9189b03D0B3AA6A5D9775B",
17
- "TimelockController": "0xb5977b1d208ef35FAf97A9534Dd849c356F362C5",
18
- "Locking": "0x831DAfC0912e1c2aBa2Da90668c0856d48a8C06b"
19
- },
20
- "44787": {
21
- "GovernanceFactory": "0xD4079B322c392D6b196f90AA4c439fC2C16d6770",
22
- "Airgrab": "0x281fA47f59456fA04DF699539fA4b1F25e7769A3",
23
- "Emission": "0x8D1267bFf3f8166AEB2B58217b74188d1fe326f3",
24
- "MentoGovernor": "0x84382a356c1Dc6ada21997E64dc72e5a7AcF5826",
25
- "MentoToken": "0x53De3F938c64baB8C621c8A3C5000b385afE2404",
26
- "TimelockController": "0x2AFC4a1e7928Fb3bfC81076740d3142FF8B1DE05",
27
- "Locking": "0x65a1271ce7B2ec8D564A4Bc752E13A36a46e81B8"
28
- }
29
- }
@@ -1,50 +0,0 @@
1
- import { ethers, providers } from 'ethers';
2
- export type Address = string;
3
- export interface TradingLimit {
4
- asset: Address;
5
- maxIn: number;
6
- maxOut: number;
7
- until: number;
8
- }
9
- export interface TradingLimitsConfig {
10
- timestep0: number;
11
- timestep1: number;
12
- limit0: number;
13
- limit1: number;
14
- limitGlobal: number;
15
- flags: number;
16
- }
17
- export interface TradingLimitsState {
18
- lastUpdated0: number;
19
- lastUpdated1: number;
20
- netflow0: number;
21
- netflow1: number;
22
- netflowGlobal: number;
23
- }
24
- export interface ContractAddressMap {
25
- [chainId: string]: ContractAddresses;
26
- }
27
- export interface ContractAddresses {
28
- GovernanceFactory: string;
29
- Airgrab: string;
30
- Emission: string;
31
- MentoGovernor: string;
32
- MentoToken: string;
33
- TimelockController: string;
34
- Locking: string;
35
- }
36
- export declare enum ProposalState {
37
- PENDING = 0,
38
- ACTIVE = 1,
39
- CANCELED = 2,
40
- DEFEATED = 3,
41
- SUCCEEDED = 4,
42
- QUEUED = 5,
43
- EXPIRED = 6,
44
- EXECUTED = 7
45
- }
46
- export interface IChainClient {
47
- getSigner(): Promise<ethers.Signer | providers.Provider>;
48
- getChainId(): Promise<number>;
49
- populateTransaction(tx: ethers.PopulatedTransaction): Promise<providers.TransactionRequest>;
50
- }
@@ -1,29 +0,0 @@
1
- {
2
- "42220": {
3
- "GovernanceFactory": "",
4
- "Airgrab": "",
5
- "Emission": "",
6
- "MentoGovernor": "",
7
- "MentoToken": "",
8
- "TimelockController": "",
9
- "Locking": ""
10
- },
11
- "62320": {
12
- "GovernanceFactory": "0x77645271665AdDF195202dEf1ad3cA678B442411",
13
- "Airgrab": "0x349aa8910577A6fE16cA7b98b5A135d14CE4dF9f",
14
- "Emission": "0xcd427DDB27D835E5353312e7897bb9ad35F0E214",
15
- "MentoGovernor": "0x5dFE8CC7743C636a86bED8F8d0de982d502E22fC",
16
- "MentoToken": "0xD2f4f160BAF7D88a7A9189b03D0B3AA6A5D9775B",
17
- "TimelockController": "0xb5977b1d208ef35FAf97A9534Dd849c356F362C5",
18
- "Locking": "0x831DAfC0912e1c2aBa2Da90668c0856d48a8C06b"
19
- },
20
- "44787": {
21
- "GovernanceFactory": "0xD4079B322c392D6b196f90AA4c439fC2C16d6770",
22
- "Airgrab": "0x281fA47f59456fA04DF699539fA4b1F25e7769A3",
23
- "Emission": "0x8D1267bFf3f8166AEB2B58217b74188d1fe326f3",
24
- "MentoGovernor": "0x84382a356c1Dc6ada21997E64dc72e5a7AcF5826",
25
- "MentoToken": "0x53De3F938c64baB8C621c8A3C5000b385afE2404",
26
- "TimelockController": "0x2AFC4a1e7928Fb3bfC81076740d3142FF8B1DE05",
27
- "Locking": "0x65a1271ce7B2ec8D564A4Bc752E13A36a46e81B8"
28
- }
29
- }
@@ -1,50 +0,0 @@
1
- import { ethers, providers } from 'ethers';
2
- export type Address = string;
3
- export interface TradingLimit {
4
- asset: Address;
5
- maxIn: number;
6
- maxOut: number;
7
- until: number;
8
- }
9
- export interface TradingLimitsConfig {
10
- timestep0: number;
11
- timestep1: number;
12
- limit0: number;
13
- limit1: number;
14
- limitGlobal: number;
15
- flags: number;
16
- }
17
- export interface TradingLimitsState {
18
- lastUpdated0: number;
19
- lastUpdated1: number;
20
- netflow0: number;
21
- netflow1: number;
22
- netflowGlobal: number;
23
- }
24
- export interface ContractAddressMap {
25
- [chainId: string]: ContractAddresses;
26
- }
27
- export interface ContractAddresses {
28
- GovernanceFactory: string;
29
- Airgrab: string;
30
- Emission: string;
31
- MentoGovernor: string;
32
- MentoToken: string;
33
- TimelockController: string;
34
- Locking: string;
35
- }
36
- export declare enum ProposalState {
37
- PENDING = 0,
38
- ACTIVE = 1,
39
- CANCELED = 2,
40
- DEFEATED = 3,
41
- SUCCEEDED = 4,
42
- QUEUED = 5,
43
- EXPIRED = 6,
44
- EXECUTED = 7
45
- }
46
- export interface IChainClient {
47
- getSigner(): Promise<ethers.Signer | providers.Provider>;
48
- getChainId(): Promise<number>;
49
- populateTransaction(tx: ethers.PopulatedTransaction): Promise<providers.TransactionRequest>;
50
- }
File without changes
File without changes