@aurigami/sdk 1.5.10 → 1.6.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/dist/SDK.d.ts +23 -16
- package/dist/consts/deployments.d.ts +3 -0
- package/dist/{dummy.d.ts → consts/dummy.d.ts} +3 -3
- package/dist/consts/index.d.ts +4 -0
- package/dist/{MoneyMarket.d.ts → contracts/MoneyMarket.d.ts} +3 -5
- package/dist/{Papermill.d.ts → contracts/Papermill.d.ts} +25 -4
- package/dist/{Staking.d.ts → contracts/Staking.d.ts} +8 -3
- package/dist/{airdrop-lottery.d.ts → contracts/airdrop-lottery.d.ts} +12 -4
- package/dist/contracts/index.d.ts +4 -0
- package/dist/{BlockchainEntity.d.ts → entities/BlockchainEntity.d.ts} +1 -1
- package/dist/entities/index.d.ts +3 -0
- package/dist/{tokenAmount.d.ts → entities/tokenAmount.d.ts} +1 -1
- package/dist/{helpers.d.ts → helpers/helpers.d.ts} +10 -1
- package/dist/helpers/index.d.ts +4 -0
- package/dist/{priceFetcher.d.ts → helpers/priceFetcher.d.ts} +2 -2
- package/dist/{transfer-event-query.d.ts → helpers/transfer-event-query.d.ts} +11 -2
- package/dist/index.d.ts +4 -11
- package/dist/sdk.cjs.development.js +2511 -2271
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +2508 -2275
- package/dist/sdk.esm.js.map +1 -1
- package/dist/{types.d.ts → types/index.d.ts} +15 -1
- package/package.json +11 -11
- package/src/SDK.ts +63 -65
- package/src/{constants.ts → consts/constants.ts} +19 -19
- package/src/consts/deployments.ts +4 -0
- package/src/{dummy.ts → consts/dummy.ts} +3 -3
- package/src/consts/index.ts +4 -0
- package/src/{MoneyMarket.ts → contracts/MoneyMarket.ts} +66 -66
- package/src/{Papermill.ts → contracts/Papermill.ts} +26 -30
- package/src/{Staking.ts → contracts/Staking.ts} +29 -29
- package/src/{airdrop-lottery.ts → contracts/airdrop-lottery.ts} +30 -37
- package/src/contracts/index.ts +4 -0
- package/src/{BlockchainEntity.ts → entities/BlockchainEntity.ts} +1 -1
- package/src/entities/index.ts +3 -0
- package/src/{token.ts → entities/token.ts} +2 -2
- package/src/{tokenAmount.ts → entities/tokenAmount.ts} +2 -2
- package/src/{helpers.ts → helpers/helpers.ts} +8 -2
- package/src/helpers/index.ts +4 -0
- package/src/{priceFetcher.ts → helpers/priceFetcher.ts} +16 -8
- package/src/{transfer-event-query.ts → helpers/transfer-event-query.ts} +2 -2
- package/src/index.ts +4 -11
- package/src/{types.ts → types/index.ts} +1 -1
- package/src/airdrop_misc/whitelist.example.txt +0 -4
- package/src/deployments/aurora_mainnet.json +0 -31
- package/src/deployments/aurora_testnet.json +0 -31
- /package/dist/{constants.d.ts → consts/constants.d.ts} +0 -0
- /package/dist/{decimals.d.ts → consts/decimals.d.ts} +0 -0
- /package/dist/{token.d.ts → entities/token.d.ts} +0 -0
- /package/dist/{aurora-api-helpers.d.ts → helpers/aurora-api-helpers.d.ts} +0 -0
- /package/src/{decimals.ts → consts/decimals.ts} +0 -0
- /package/src/{aurora-api-helpers.ts → helpers/aurora-api-helpers.ts} +0 -0
- /package/src/{airdrop_misc → misc/airdrop_misc}/auTokensInfo.json +0 -0
- /package/src/{airdrop_misc → misc/airdrop_misc}/whitelist.json +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { providers, Signer } from 'ethers';
|
|
2
|
-
import { TokenAmount } from '
|
|
2
|
+
import { TokenAmount } from '../entities/tokenAmount';
|
|
3
3
|
export declare enum ComptrollerRewardType {
|
|
4
4
|
PLY = 0,
|
|
5
5
|
AURORA = 1
|
|
@@ -40,12 +40,26 @@ export declare type UserDetails = {
|
|
|
40
40
|
};
|
|
41
41
|
export declare type UserLockingDetails = {
|
|
42
42
|
vestingStart: number;
|
|
43
|
+
/** % of reward they will receive in PLY, if they claim this week */
|
|
43
44
|
currentUnlockPortion: number;
|
|
44
45
|
accruedPly: TokenAmount;
|
|
46
|
+
/** Amount of PLY they will receive, if they claim this week */
|
|
45
47
|
currentPly: TokenAmount;
|
|
48
|
+
/** Amount of PULP they will receive, if they claim this week */
|
|
46
49
|
currentPulp: TokenAmount;
|
|
50
|
+
/** % of reward they will receive in PLY, if they claim next week */
|
|
47
51
|
nextUnlockPortion: number;
|
|
52
|
+
/**
|
|
53
|
+
* Amount of PLY they will receive, if they claim next week.
|
|
54
|
+
* This doesn't include the additional reward that they will earn
|
|
55
|
+
* in the next week.
|
|
56
|
+
*/
|
|
48
57
|
nextPly: TokenAmount;
|
|
58
|
+
/**
|
|
59
|
+
* Amount of PULP they will receive, if they claim next week.
|
|
60
|
+
* This doesn't include the additional reward that they will earn
|
|
61
|
+
* in the next week.
|
|
62
|
+
*/
|
|
49
63
|
nextPulp: TokenAmount;
|
|
50
64
|
};
|
|
51
65
|
export declare type UserMarketDetails = {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.6.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -41,29 +41,29 @@
|
|
|
41
41
|
}
|
|
42
42
|
],
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
44
|
+
"@nomiclabs/hardhat-ethers": "^2.0.5",
|
|
45
|
+
"@nomiclabs/hardhat-etherscan": "^3.0.3",
|
|
46
|
+
"@nomiclabs/hardhat-waffle": "^2.0.3",
|
|
47
|
+
"@size-limit/preset-small-lib": "^7.0.8",
|
|
48
|
+
"@types/mocha": "^9.1.0",
|
|
49
|
+
"chai": "^4.3.6",
|
|
45
50
|
"eslint-config-prettier": "^8.3.0",
|
|
46
51
|
"eslint-plugin-prettier": "^4.0.0",
|
|
52
|
+
"ethereum-waffle": "^3.4.4",
|
|
53
|
+
"hardhat": "^2.9.3",
|
|
47
54
|
"husky": "^7.0.4",
|
|
48
55
|
"prettier": "^2.5.1",
|
|
49
56
|
"size-limit": "^7.0.5",
|
|
57
|
+
"ts-node": "^10.7.0",
|
|
50
58
|
"tsdx": "^0.14.1",
|
|
51
59
|
"tslib": "^2.3.1",
|
|
52
60
|
"typescript": "^4.5.4"
|
|
53
61
|
},
|
|
54
62
|
"dependencies": {
|
|
55
63
|
"@aurigami/contracts": "3.3.0",
|
|
56
|
-
"@nomiclabs/hardhat-ethers": "^2.0.5",
|
|
57
|
-
"@nomiclabs/hardhat-etherscan": "^3.0.3",
|
|
58
|
-
"@nomiclabs/hardhat-waffle": "^2.0.3",
|
|
59
|
-
"@types/mocha": "^9.1.0",
|
|
60
64
|
"axios": "^0.26.1",
|
|
61
65
|
"bignumber.js": "^9.0.2",
|
|
62
|
-
"chai": "^4.3.6",
|
|
63
66
|
"dotenv": "^16.0.0",
|
|
64
|
-
"
|
|
65
|
-
"ethers": "^5.6.4",
|
|
66
|
-
"hardhat": "^2.9.3",
|
|
67
|
-
"ts-node": "^10.7.0"
|
|
67
|
+
"ethers": "^5.6.4"
|
|
68
68
|
}
|
|
69
69
|
}
|
package/src/SDK.ts
CHANGED
|
@@ -10,66 +10,58 @@ import {
|
|
|
10
10
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
11
11
|
import BigNumber from 'bignumber.js';
|
|
12
12
|
import { BigNumber as BN, Contract } from 'ethers';
|
|
13
|
-
import
|
|
13
|
+
import * as consts from './consts';
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from './constants';
|
|
21
|
-
import { decimalFactor, isSameAddress } from './helpers';
|
|
22
|
-
import { MoneyMarketRead } from './MoneyMarket';
|
|
23
|
-
import { PapermillRead } from './Papermill';
|
|
24
|
-
import { calcValuation, fetchPrice } from './priceFetcher';
|
|
25
|
-
import { StakingRead, StakingReadWrite } from './Staking';
|
|
26
|
-
import { Token } from './token';
|
|
27
|
-
import { TokenAmount } from './tokenAmount';
|
|
15
|
+
MoneyMarketRead,
|
|
16
|
+
PapermillRead,
|
|
17
|
+
StakingRead,
|
|
18
|
+
StakingReadWrite,
|
|
19
|
+
} from './contracts';
|
|
28
20
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} from './types';
|
|
21
|
+
BlockchainEntity,
|
|
22
|
+
BlockchainEntityRead,
|
|
23
|
+
Token,
|
|
24
|
+
TokenAmount,
|
|
25
|
+
} from './entities';
|
|
26
|
+
import { decimalFactor, isSameAddress } from './helpers/helpers';
|
|
27
|
+
import { calcValuation, fetchPrice } from './helpers/priceFetcher';
|
|
28
|
+
import * as types from './types';
|
|
38
29
|
|
|
39
30
|
export class SdkRead extends BlockchainEntityRead {
|
|
40
31
|
protected _comptroller: Comptroller;
|
|
41
32
|
protected _auriFairLaunch: AuriFairLaunch;
|
|
42
33
|
protected _auriLens: AuriLens;
|
|
43
34
|
protected _stakingRead: StakingRead;
|
|
44
|
-
constructor(networkConnection: NetworkConnection) {
|
|
35
|
+
constructor(networkConnection: types.NetworkConnection) {
|
|
45
36
|
super(networkConnection);
|
|
46
37
|
this._stakingRead = new StakingRead(networkConnection);
|
|
47
38
|
this._comptroller = new Contract(
|
|
48
|
-
networkAddresses.misc.COMPTROLLER,
|
|
39
|
+
consts.networkAddresses.misc.COMPTROLLER,
|
|
49
40
|
ComptrollerABI.abi,
|
|
50
41
|
networkConnection.provider
|
|
51
42
|
) as Comptroller;
|
|
52
43
|
this._auriFairLaunch = new Contract(
|
|
53
|
-
networkAddresses.misc.AURIFAIRLAUNCH,
|
|
44
|
+
consts.networkAddresses.misc.AURIFAIRLAUNCH,
|
|
54
45
|
AuriFairLaunchABI.abi,
|
|
55
46
|
networkConnection.provider
|
|
56
47
|
) as AuriFairLaunch;
|
|
57
48
|
this._auriLens = new Contract(
|
|
58
|
-
networkAddresses.misc.AURILENS,
|
|
49
|
+
consts.networkAddresses.misc.AURILENS,
|
|
59
50
|
AuriLensABI.abi,
|
|
60
51
|
networkConnection.provider
|
|
61
52
|
) as AuriLens;
|
|
62
53
|
}
|
|
63
54
|
|
|
64
|
-
public async getUserDetails(userAddress: string): Promise<UserDetails> {
|
|
65
|
-
const marketCount = networkAddresses.auTokens.length;
|
|
66
|
-
var userMarketDetails: UserMarketDetails[] = [],
|
|
55
|
+
public async getUserDetails(userAddress: string): Promise<types.UserDetails> {
|
|
56
|
+
const marketCount = consts.networkAddresses.auTokens.length;
|
|
57
|
+
var userMarketDetails: types.UserMarketDetails[] = [],
|
|
67
58
|
assetsIn: string[];
|
|
68
59
|
var promises = [];
|
|
69
60
|
var totalBorrowLimit = new BigNumber(0);
|
|
70
61
|
var pricePromises = [];
|
|
71
|
-
for (const auToken of networkAddresses.auTokens) {
|
|
72
|
-
const userMarketDetail: UserMarketDetails =
|
|
62
|
+
for (const auToken of consts.networkAddresses.auTokens) {
|
|
63
|
+
const userMarketDetail: types.UserMarketDetails =
|
|
64
|
+
{} as types.UserMarketDetails;
|
|
73
65
|
userMarketDetails.push(userMarketDetail);
|
|
74
66
|
userMarketDetail.market = auToken.underlying;
|
|
75
67
|
const moneyMarket: MoneyMarketRead = new MoneyMarketRead(
|
|
@@ -117,9 +109,9 @@ export class SdkRead extends BlockchainEntityRead {
|
|
|
117
109
|
var underlyingPrices = await Promise.all(pricePromises);
|
|
118
110
|
var depositValues = [];
|
|
119
111
|
for (var i = 0; i < marketCount; i++) {
|
|
120
|
-
const auToken = networkAddresses.auTokens[i];
|
|
112
|
+
const auToken = consts.networkAddresses.auTokens[i];
|
|
121
113
|
if (
|
|
122
|
-
assetsIn!.find((auAddress: Address) =>
|
|
114
|
+
assetsIn!.find((auAddress: types.Address) =>
|
|
123
115
|
isSameAddress(auToken.address, auAddress)
|
|
124
116
|
) !== undefined
|
|
125
117
|
) {
|
|
@@ -155,10 +147,12 @@ export class SdkRead extends BlockchainEntityRead {
|
|
|
155
147
|
borrowedvaluation = new BigNumber(0);
|
|
156
148
|
}
|
|
157
149
|
|
|
158
|
-
const bufferedBorrowLimit: BigNumber =
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
150
|
+
const bufferedBorrowLimit: BigNumber = totalBorrowLimit.multipliedBy(
|
|
151
|
+
consts.BORROW_LIMIT_BUFFER
|
|
152
|
+
);
|
|
153
|
+
const minimumBorrowLimitAllowed = borrowedvaluation.div(
|
|
154
|
+
consts.BORROW_LIMIT_BUFFER
|
|
155
|
+
);
|
|
162
156
|
|
|
163
157
|
var borrowableAmount: BigNumber;
|
|
164
158
|
if (bufferedBorrowLimit.lte(borrowedvaluation)) {
|
|
@@ -168,7 +162,7 @@ export class SdkRead extends BlockchainEntityRead {
|
|
|
168
162
|
}
|
|
169
163
|
|
|
170
164
|
for (var i = 0; i < marketCount; i++) {
|
|
171
|
-
const auToken = networkAddresses.auTokens[i];
|
|
165
|
+
const auToken = consts.networkAddresses.auTokens[i];
|
|
172
166
|
const moneyMarket: MoneyMarketRead = new MoneyMarketRead(
|
|
173
167
|
this._networkConnection,
|
|
174
168
|
auToken.address,
|
|
@@ -200,30 +194,30 @@ export class SdkRead extends BlockchainEntityRead {
|
|
|
200
194
|
markets: userMarketDetails,
|
|
201
195
|
borrowLimit: {
|
|
202
196
|
currency: 'USD',
|
|
203
|
-
amount: bufferedBorrowLimit.toFixed(DECIMAL_PRECISION),
|
|
197
|
+
amount: bufferedBorrowLimit.toFixed(consts.DECIMAL_PRECISION),
|
|
204
198
|
},
|
|
205
199
|
userLockingDetails: await new PapermillRead(
|
|
206
200
|
this._networkConnection
|
|
207
201
|
).getLockingDetails(userAddress),
|
|
208
202
|
borrowableAmount: {
|
|
209
203
|
currency: 'USD',
|
|
210
|
-
amount: borrowableAmount.toFixed(DECIMAL_PRECISION),
|
|
204
|
+
amount: borrowableAmount.toFixed(consts.DECIMAL_PRECISION),
|
|
211
205
|
},
|
|
212
206
|
};
|
|
213
207
|
}
|
|
214
208
|
|
|
215
|
-
public async getPLYWNEARPoolDetails(): Promise<PLYWNEARPoolDetails> {
|
|
209
|
+
public async getPLYWNEARPoolDetails(): Promise<types.PLYWNEARPoolDetails> {
|
|
216
210
|
return this._stakingRead.getPLYWNEARPoolDetails();
|
|
217
211
|
}
|
|
218
212
|
|
|
219
|
-
public async getTokenPrice(token: Token): Promise<CurrencyAmount> {
|
|
213
|
+
public async getTokenPrice(token: Token): Promise<types.CurrencyAmount> {
|
|
220
214
|
const price = await fetchPrice(
|
|
221
215
|
token.address,
|
|
222
216
|
this._networkConnection.provider
|
|
223
217
|
);
|
|
224
218
|
return {
|
|
225
219
|
currency: 'USD',
|
|
226
|
-
amount: price.toFixed(DECIMAL_PRECISION),
|
|
220
|
+
amount: price.toFixed(consts.DECIMAL_PRECISION),
|
|
227
221
|
};
|
|
228
222
|
}
|
|
229
223
|
|
|
@@ -252,58 +246,58 @@ export class SdkRead extends BlockchainEntityRead {
|
|
|
252
246
|
action,
|
|
253
247
|
tokenAmount,
|
|
254
248
|
}: {
|
|
255
|
-
userMarketDetail: UserMarketDetails;
|
|
256
|
-
currentBorrowLimit: CurrencyAmount;
|
|
257
|
-
currentBorrowValuation: CurrencyAmount;
|
|
258
|
-
action: MarketAction;
|
|
249
|
+
userMarketDetail: types.UserMarketDetails;
|
|
250
|
+
currentBorrowLimit: types.CurrencyAmount;
|
|
251
|
+
currentBorrowValuation: types.CurrencyAmount;
|
|
252
|
+
action: types.MarketAction;
|
|
259
253
|
tokenAmount?: TokenAmount;
|
|
260
|
-
}): HypotheticalStats {
|
|
254
|
+
}): types.HypotheticalStats {
|
|
261
255
|
var newBorrowLimit = new BigNumber(currentBorrowLimit.amount),
|
|
262
256
|
newBorrowValuation = new BigNumber(currentBorrowValuation.amount);
|
|
263
257
|
switch (action) {
|
|
264
|
-
case MarketAction.EnableCollateral:
|
|
265
|
-
case MarketAction.DisableCollateral:
|
|
258
|
+
case types.MarketAction.EnableCollateral:
|
|
259
|
+
case types.MarketAction.DisableCollateral:
|
|
266
260
|
var deltaBorrowLimit = calcValuation(
|
|
267
261
|
userMarketDetail.depositBalance,
|
|
268
262
|
new BigNumber(userMarketDetail.underlyingPrice)
|
|
269
263
|
)
|
|
270
264
|
.multipliedBy(userMarketDetail.collateralRatio)
|
|
271
|
-
.multipliedBy(BORROW_LIMIT_BUFFER);
|
|
265
|
+
.multipliedBy(consts.BORROW_LIMIT_BUFFER);
|
|
272
266
|
newBorrowLimit =
|
|
273
|
-
action == MarketAction.EnableCollateral
|
|
267
|
+
action == types.MarketAction.EnableCollateral
|
|
274
268
|
? newBorrowLimit.plus(deltaBorrowLimit)
|
|
275
269
|
: newBorrowLimit.minus(deltaBorrowLimit);
|
|
276
270
|
break;
|
|
277
271
|
|
|
278
|
-
case MarketAction.Deposit:
|
|
279
|
-
case MarketAction.Withdraw:
|
|
272
|
+
case types.MarketAction.Deposit:
|
|
273
|
+
case types.MarketAction.Withdraw:
|
|
280
274
|
deltaBorrowLimit = calcValuation(
|
|
281
275
|
tokenAmount!,
|
|
282
276
|
new BigNumber(userMarketDetail.underlyingPrice)
|
|
283
277
|
)
|
|
284
278
|
.multipliedBy(userMarketDetail.collateralRatio)
|
|
285
|
-
.multipliedBy(BORROW_LIMIT_BUFFER);
|
|
279
|
+
.multipliedBy(consts.BORROW_LIMIT_BUFFER);
|
|
286
280
|
newBorrowLimit =
|
|
287
|
-
action == MarketAction.Deposit
|
|
281
|
+
action == types.MarketAction.Deposit
|
|
288
282
|
? newBorrowLimit.plus(deltaBorrowLimit)
|
|
289
283
|
: newBorrowLimit.minus(deltaBorrowLimit);
|
|
290
284
|
break;
|
|
291
285
|
|
|
292
|
-
case MarketAction.Borrow:
|
|
293
|
-
case MarketAction.Repay:
|
|
286
|
+
case types.MarketAction.Borrow:
|
|
287
|
+
case types.MarketAction.Repay:
|
|
294
288
|
var deltaBorrowValuation = calcValuation(
|
|
295
289
|
tokenAmount!,
|
|
296
290
|
new BigNumber(userMarketDetail.underlyingPrice)
|
|
297
291
|
);
|
|
298
292
|
newBorrowValuation =
|
|
299
|
-
action == MarketAction.Borrow
|
|
293
|
+
action == types.MarketAction.Borrow
|
|
300
294
|
? newBorrowValuation.plus(deltaBorrowValuation)
|
|
301
295
|
: newBorrowValuation.minus(deltaBorrowValuation);
|
|
302
296
|
break;
|
|
303
297
|
}
|
|
304
298
|
return {
|
|
305
299
|
newBorrowLimit: {
|
|
306
|
-
amount: newBorrowLimit!.toFixed(DECIMAL_PRECISION),
|
|
300
|
+
amount: newBorrowLimit!.toFixed(consts.DECIMAL_PRECISION),
|
|
307
301
|
currency: 'USD',
|
|
308
302
|
},
|
|
309
303
|
newBorrowUtilization: newBorrowLimit.eq(0)
|
|
@@ -331,7 +325,11 @@ export class SdkReadWrite extends SdkRead {
|
|
|
331
325
|
public async claimLpRewards(): Promise<TransactionResponse> {
|
|
332
326
|
return this._auriFairLaunch
|
|
333
327
|
.connect(this._networkConnection.signer!)
|
|
334
|
-
.harvest(
|
|
328
|
+
.harvest(
|
|
329
|
+
await this._networkConnection.signer!.getAddress(),
|
|
330
|
+
0,
|
|
331
|
+
consts.INF
|
|
332
|
+
);
|
|
335
333
|
}
|
|
336
334
|
|
|
337
335
|
public async stake(amount: TokenAmount): Promise<TransactionResponse> {
|
|
@@ -344,7 +342,7 @@ export class SdkReadWrite extends SdkRead {
|
|
|
344
342
|
|
|
345
343
|
public async faucetDrip(): Promise<TransactionResponse> {
|
|
346
344
|
const faucet = new Contract(
|
|
347
|
-
networkAddresses.misc.FAUCET,
|
|
345
|
+
consts.networkAddresses.misc.FAUCET,
|
|
348
346
|
FaucetABI.abi,
|
|
349
347
|
this._networkConnection.provider
|
|
350
348
|
);
|
|
@@ -356,11 +354,11 @@ export class SDK extends BlockchainEntity {
|
|
|
356
354
|
constructor() {
|
|
357
355
|
super();
|
|
358
356
|
}
|
|
359
|
-
public read(networkConnection: NetworkConnection): SdkRead {
|
|
357
|
+
public read(networkConnection: types.NetworkConnection): SdkRead {
|
|
360
358
|
return new SdkRead(networkConnection);
|
|
361
359
|
}
|
|
362
360
|
|
|
363
|
-
public readWrite(networkConnection: NetworkConnection): SdkReadWrite {
|
|
361
|
+
public readWrite(networkConnection: types.NetworkConnection): SdkReadWrite {
|
|
364
362
|
return new SdkReadWrite(networkConnection);
|
|
365
363
|
}
|
|
366
364
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { ethers, Signer, BigNumber as BN } from 'ethers';
|
|
3
|
+
import { MAINNET_ADDRESSES } from './deployments';
|
|
3
4
|
export const dummyAddress: string =
|
|
4
5
|
'0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
|
|
5
6
|
export const ETHAddress: string = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
|
|
@@ -21,63 +22,62 @@ export const networkAddresses: NetworkAddresses = {
|
|
|
21
22
|
auTokens: [
|
|
22
23
|
{
|
|
23
24
|
name: 'auUSDC',
|
|
24
|
-
address:
|
|
25
|
+
address: MAINNET_ADDRESSES.auTokens.USDC.toLowerCase(),
|
|
25
26
|
underlying: '0xb12bfca5a55806aaf64e99521918a4bf0fc40802'.toLowerCase(),
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
name: 'auETH',
|
|
29
|
-
address:
|
|
30
|
+
address: MAINNET_ADDRESSES.auTokens.ETH.toLowerCase(),
|
|
30
31
|
underlying: ETHAddress.toLowerCase(),
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
name: 'auWBTC',
|
|
34
|
-
address:
|
|
35
|
+
address: MAINNET_ADDRESSES.auTokens.WBTC.toLowerCase(),
|
|
35
36
|
underlying: '0xf4eb217ba2454613b15dbdea6e5f22276410e89e'.toLowerCase(),
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
name: 'auUSDT',
|
|
39
|
-
address:
|
|
40
|
+
address: MAINNET_ADDRESSES.auTokens.USDT.toLowerCase(),
|
|
40
41
|
underlying: '0x4988a896b1227218e4a686fde5eabdcabd91571f'.toLowerCase(),
|
|
41
42
|
},
|
|
42
43
|
{
|
|
43
44
|
name: 'auDAI',
|
|
44
|
-
address:
|
|
45
|
+
address: MAINNET_ADDRESSES.auTokens.DAI.toLowerCase(),
|
|
45
46
|
underlying: '0xe3520349f477a5f6eb06107066048508498a291b'.toLowerCase(),
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
name: 'auWNEAR',
|
|
49
|
-
address:
|
|
50
|
+
address: MAINNET_ADDRESSES.auTokens.WNEAR.toLowerCase(),
|
|
50
51
|
underlying: '0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d'.toLowerCase(),
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
name: 'auSTNEAR',
|
|
54
|
-
address:
|
|
55
|
+
address: MAINNET_ADDRESSES.auTokens.STNEAR.toLowerCase(),
|
|
55
56
|
underlying: '0x07F9F7f963C5cD2BBFFd30CcfB964Be114332E30'.toLowerCase(),
|
|
56
57
|
},
|
|
57
58
|
{
|
|
58
59
|
name: 'auAURORA',
|
|
59
|
-
address:
|
|
60
|
+
address: MAINNET_ADDRESSES.auTokens.AURORA.toLowerCase(),
|
|
60
61
|
underlying: '0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
name: 'auTRI',
|
|
64
|
-
address:
|
|
65
|
+
address: MAINNET_ADDRESSES.auTokens.TRI.toLowerCase(),
|
|
65
66
|
underlying: '0xFa94348467f64D5A457F75F8bc40495D33c65aBB'.toLowerCase(),
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
name: 'auPLY',
|
|
69
|
-
address:
|
|
70
|
+
address: MAINNET_ADDRESSES.auTokens.PLY.toLowerCase(),
|
|
70
71
|
underlying: '0x09c9d464b58d96837f8d8b6f4d9fe4ad408d3a4f'.toLowerCase(),
|
|
71
72
|
},
|
|
72
73
|
],
|
|
73
74
|
misc: {
|
|
74
|
-
COMPTROLLER:
|
|
75
|
-
oracle:
|
|
76
|
-
AURIFAIRLAUNCH:
|
|
77
|
-
AURILENS:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
AURI_AIRDROP: '0x6C42aA5b128B62D6CCf357726D7d13F3888335EC'.toLowerCase(),
|
|
75
|
+
COMPTROLLER: MAINNET_ADDRESSES.comptroller.toLowerCase(),
|
|
76
|
+
oracle: MAINNET_ADDRESSES.oracle.toLowerCase(),
|
|
77
|
+
AURIFAIRLAUNCH: MAINNET_ADDRESSES.fairLaunch.toLowerCase(),
|
|
78
|
+
AURILENS: MAINNET_ADDRESSES.auriLens.toLowerCase(),
|
|
79
|
+
ETHREPAYHELPER: MAINNET_ADDRESSES.ethRepayHelper.toLowerCase(),
|
|
80
|
+
AURI_AIRDROP: MAINNET_ADDRESSES.auriAirdrop.toLowerCase(),
|
|
81
81
|
},
|
|
82
82
|
tokens: {
|
|
83
83
|
AURORA: '0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -87,8 +87,8 @@ export const networkAddresses: NetworkAddresses = {
|
|
|
87
87
|
WNEAR: '0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d'.toLowerCase(),
|
|
88
88
|
TRI: '0xFa94348467f64D5A457F75F8bc40495D33c65aBB'.toLowerCase(),
|
|
89
89
|
META: '0xc21ff01229e982d7c8b8691163b0a3cb8f357453'.toLocaleLowerCase(),
|
|
90
|
-
PULP:
|
|
91
|
-
PLYWNEAR:
|
|
90
|
+
PULP: MAINNET_ADDRESSES.PULP.toLowerCase(),
|
|
91
|
+
PLYWNEAR: MAINNET_ADDRESSES.ply_wnear_lp.toLowerCase(),
|
|
92
92
|
},
|
|
93
93
|
};
|
|
94
94
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Token } from '
|
|
2
|
-
import { TokenAmount } from '
|
|
3
|
-
import { UserMarketDetails } from '
|
|
1
|
+
import { Token } from '../entities';
|
|
2
|
+
import { TokenAmount } from '../entities';
|
|
3
|
+
import { UserMarketDetails } from '../types';
|
|
4
4
|
|
|
5
5
|
export const dummyToken = new Token(
|
|
6
6
|
'0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
|