diff --git a/.env.exmple b/.env.exmple new file mode 100644 index 0000000..6fb6500 --- /dev/null +++ b/.env.exmple @@ -0,0 +1,3 @@ +RINKEBY_RPC_URL= +KOVAN_RPC_URL= +MAINNET_RPC_URL= \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b7025f0 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ +| Type | Ticket | +| :---------------: | :------------------------------: | +| Bug/Feature/Chore | [Link]() | + +## Problem + +Brief descriptions of the problem that this PR will fix or if it a new feature brief description of what is the business need. + +## Solution + +How we fixed the problem or implemented the new feature + +## Other notes + +Not mandatory section. Use this section to provide extra info like: + +- PR's related to this one (maybe form maple-api) +- additional fixes +- how this feature should be tested if it's hard to test +- ... + +## Screenshots + +Paste all the needed screenshots or animated gifs. If this PR is a bug fix you could include the before and after screenshots. diff --git a/config.json b/config.json index ca14ae7..cd89da3 100644 --- a/config.json +++ b/config.json @@ -2,68 +2,142 @@ "contractPackages": { "collateralLocker": { "repo": "@maplelabs/collateral-locker", - "alias": ["collateralLocker"], - "versions": ["v1.0.0"] + "alias": [ + "collateralLocker" + ], + "versions": [ + "v1.0.0" + ] }, "debtLocker": { "repo": "@maplelabs/debt-locker", - "alias": ["debtLockerV1", "debtLockerV2"], - "versions": ["v1.0.0", "v2.0.0"] + "alias": [ + "debtLockerV1", + "debtLockerV2" + ], + "versions": [ + "v1.0.0", + "v2.0.0" + ] }, "fundingLocker": { "repo": "@maplelabs/funding-locker", - "alias": ["fundingLocker"], - "versions": ["v1.0.0"] + "alias": [ + "fundingLocker" + ], + "versions": [ + "v1.0.0" + ] }, "lateFeeCalculator": { "repo": "@maplelabs/late-fee-calculator", - "alias": ["lateFeeCalculator"], - "versions": ["v1.0.0"] + "alias": [ + "lateFeeCalculator" + ], + "versions": [ + "v1.0.0" + ] }, "liquidityLocker": { "repo": "@maplelabs/liquidity-locker", - "alias": ["liquidityLocker"], - "versions": ["v1.0.0"] + "alias": [ + "liquidityLocker" + ], + "versions": [ + "v1.0.0" + ] }, "loan": { "repo": "@maplelabs/loan", - "alias": ["loanV1", "loanV2"], - "versions": ["v1.0.0", "v2.0.0"] + "alias": [ + "loanV1", + "loanV2" + ], + "versions": [ + "v1.0.0", + "v2.0.0" + ] }, "mapleGlobals": { "repo": "@maplelabs/globals", - "alias": ["mapleGlobals"], - "versions": ["v1.0.0"] + "alias": [ + "mapleGlobals" + ], + "versions": [ + "v1.0.0" + ] }, "mplRewards": { "repo": "@maplelabs/mpl-rewards", - "alias": ["mplRewards"], - "versions": ["v1.0.0"] + "alias": [ + "mplRewards" + ], + "versions": [ + "v1.0.0" + ] }, "pool": { "repo": "@maplelabs/pool", - "alias": ["pool"], - "versions": ["v1.0.0"] + "alias": [ + "pool" + ], + "versions": [ + "v1.0.0" + ] }, "premiumCalculator": { "repo": "@maplelabs/premium-calculator", - "alias": ["premiumCalculator"], - "versions": ["v1.0.0"] + "alias": [ + "premiumCalculator" + ], + "versions": [ + "v1.0.0" + ] }, "repaymentCalculator": { "repo": "@maplelabs/repayment-calculator", - "alias": ["repaymentCalculator"], - "versions": ["v1.0.0"] + "alias": [ + "repaymentCalculator" + ], + "versions": [ + "v1.0.0" + ] }, "stakeLocker": { "repo": "@maplelabs/stake-locker", - "alias": ["stakeLocker"], - "versions": ["v1.0.0"] + "alias": [ + "stakeLocker" + ], + "versions": [ + "v1.0.0" + ] + }, + "xmpl": { + "repo": "@maplelabs/xmpl", + "alias": [ + "xmpl" + ], + "versions": [ + "v1.0.1" + ] + }, + "mapleToken": { + "repo": "@maplelabs/maple-token", + "alias": [ + "mapleToken" + ], + "versions": [ + "v1.0.0" + ] }, "external": { "repo": "@maplelabs/environment-mocks", - "alias": ["environment-mocks"], - "versions": ["v1.0.0"] + "alias": [ + "environment-mocks" + ], + "versions": [ + "v1.0.0" + ] } } } diff --git a/package.json b/package.json index d96d84a..c72778d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.0.2", + "version": "0.0.3", "license": "MIT", "name": "@maplelabs/maple-js", "description": "Maple SDK for JavaScript", @@ -43,6 +43,7 @@ "@maplelabs/liquidityLocker": "npm:@maplelabs/liquidity-locker@v1.0.0", "@maplelabs/loanV1": "npm:@maplelabs/loan@v1.0.0", "@maplelabs/loanV2": "npm:@maplelabs/loan@v2.0.0", + "@maplelabs/mapleToken": "npm:@maplelabs/maple-token@1.0.0 ", "@maplelabs/mapleGlobals": "npm:@maplelabs/globals@v1.0.0", "@maplelabs/mplRewards": "npm:@maplelabs/mpl-rewards@v1.0.0", "@maplelabs/pool": "npm:@maplelabs/pool@v1.0.0", @@ -50,9 +51,10 @@ "@maplelabs/repaymentCalculator": "npm:@maplelabs/repayment-calculator@v1.0.0", "@maplelabs/stakeLocker": "npm:@maplelabs/stake-locker@v1.0.0", "@maplelabs/util": "npm:@maplelabs/util@v1.0.0", + "@maplelabs/xmpl": "npm:@maplelabs/xmpl@v1.0.1", "@typechain/ethers-v5": "^9.0.0", "ethers": "^5.5.3", "shelljs": "^0.8.5", "typechain": "^7.0.0" } -} +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index e243612..9f27bde 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,12 +6,14 @@ import * as lateFeeCalcImports from './typechain/lateFeeCalculator' import * as liquidityLockerImports from './typechain/liquidityLocker' import * as loanV1Imports from './typechain/loanV1' import * as loanV2Imports from './typechain/loanV2' +import * as mapleTokenImports from './typechain/mapleToken' import * as mapleGlobalsImports from './typechain/mapleGlobals' import * as mapleRewardsImports from './typechain/mplRewards' import * as poolImports from './typechain/pool' import * as premiumCalcImports from './typechain/premiumCalculator' import * as repaymentCalcImports from './typechain/repaymentCalculator' import * as stakeLockerImports from './typechain/stakeLocker' +import * as xmplImports from './typechain/xmpl' import * as environmentMocksImports from './typechain/environment-mocks' import kovanAddresses from './addresses/kovan' @@ -72,6 +74,10 @@ const mapleRewards = { factory: mapleRewardsImports.MplRewardsFactory__factory } +const mapleToken = { + factory: mapleTokenImports.MapleToken__factory +} + const pool = { core: poolImports.Pool__factory, factory: poolImports.PoolFactory__factory, @@ -109,6 +115,10 @@ const uniswapRouterV2 = { core: environmentMocksImports.UniswapV2Router02__factory } +const xmpl = { + factory: xmplImports.XMPL__factory +} + const addresses = { kovan: kovanAddresses, kovanDev: kovanDevAddresses, @@ -117,6 +127,11 @@ const addresses = { mainnet: mainnetAddresses } +interface ContractTypes { + xmpl: xmplImports.XMPL + mapleToken: mapleTokenImports.MapleToken +} + export { addresses, bPool, @@ -132,9 +147,12 @@ export { loanV2, mapleGlobals, mapleRewards, + mapleToken, pool, premiumCalc, repaymentCalculator, stakeLocker, - uniswapRouterV2 + uniswapRouterV2, + xmpl, + ContractTypes } diff --git a/yarn.lock b/yarn.lock index ff18358..ce849fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -915,6 +915,11 @@ resolved "https://registry.npmjs.org/@maplelabs/globals/-/globals-1.0.0.tgz#85fd3e667cdb5cd26e5882951e8a7cf7426645fe" integrity sha512-pNqeltNI03JD0PdvZinJKP9UE9Xu8jFRzVxXm3mHMmLFkJmsEgwh2J8Sr8+2HSKouS9eX9RiH6vCh+nUwo45ug== +"@maplelabs/mapleToken@npm:@maplelabs/maple-token@1.0.0 ": + version "1.0.0" + resolved "https://registry.npmjs.org/@maplelabs/maple-token/-/maple-token-1.0.0.tgz#c160531e3be688d4cd90c524a1baa2d585da772c" + integrity sha512-WiJFk15Xic43gnqKC8u6Fnl11AfCADbtcY1668PswnMMIC08RJJgDlwlDy5dq1bYqyWFpMfPem6Ye/McMNua+A== + "@maplelabs/mplRewards@npm:@maplelabs/mpl-rewards@v1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@maplelabs/mpl-rewards/-/mpl-rewards-1.0.0.tgz#7915e10bd59bd80374784f0f8772817ca87e45ad" @@ -940,6 +945,11 @@ resolved "https://registry.npmjs.org/@maplelabs/stake-locker/-/stake-locker-1.0.0.tgz#ea24815c50d68d2490f9e5851493732976182c00" integrity sha512-kU6veFILrHJp8uJgf6XDWVvQCVlwSbPJTEIYYG1Z6SM9C5UuIAcau6r30HRAG0g7/Pk+oorH9bZPUm3ow8SGNw== +"@maplelabs/xmpl@npm:@maplelabs/xmpl@v1.0.1": + version "1.0.1" + resolved "https://registry.npmjs.org/@maplelabs/xmpl/-/xmpl-1.0.1.tgz#3d90df79f56e1105b1dbce9a3557d916afe2ea19" + integrity sha512-kVg7Aq5o2l9C1JgI7OQIETjmNox5CqRxg/QS9lV/k2pkp95KJKsSCMQOfh4Asp5e4zu248iMLHEakWOhr7pCgQ== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz"