@aurigami/sdk 1.9.2 → 1.9.4
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 +1 -1
- package/dist/interactors/misc.d.ts +1 -1
- package/dist/sdk.cjs.development.js +32 -28
- 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 +32 -28
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/SDK.ts +3 -2
- package/src/consts/constants.ts +3 -0
- package/src/interactors/misc.ts +20 -25
package/dist/SDK.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare class SdkRead extends BlockchainEntityRead {
|
|
|
37
37
|
*/
|
|
38
38
|
getPlyCirculatingSupply(): Promise<TokenAmount>;
|
|
39
39
|
getUtilisation(userAddr: types.Address): Promise<BigNumber>;
|
|
40
|
-
sneakAccounts(accounts: string[], tokenAddresses: string[]): Promise<types.AccountAuTokensInfo[]>;
|
|
40
|
+
sneakAccounts(accounts: string[], tokenAddresses: string[], dust?: BigNumber): Promise<types.AccountAuTokensInfo[]>;
|
|
41
41
|
}
|
|
42
42
|
export declare class SdkReadWrite extends SdkRead {
|
|
43
43
|
/**
|
|
@@ -25,5 +25,5 @@ export declare class MiscRead extends BlockchainEntityRead {
|
|
|
25
25
|
*/
|
|
26
26
|
getPlyCirculatingSupply(): Promise<TokenAmount>;
|
|
27
27
|
getUtilisation(userAddr: types.Address): Promise<BigNumber>;
|
|
28
|
-
sneakAccounts(accounts: string[], tokenAddresses: string[]): Promise<types.AccountAuTokensInfo[]>;
|
|
28
|
+
sneakAccounts(accounts: string[], tokenAddresses: string[], dust?: BigNumber): Promise<types.AccountAuTokensInfo[]>;
|
|
29
29
|
}
|
|
@@ -107,6 +107,9 @@ var networkAddresses = {
|
|
|
107
107
|
AURI_AIRDROP: /*#__PURE__*/MAINNET_ADDRESSES.auriAirdrop.toLowerCase(),
|
|
108
108
|
MULTICALL: /*#__PURE__*/MAINNET_ADDRESSES.multicall.toLowerCase(),
|
|
109
109
|
TEAM_MULTISIG: /*#__PURE__*/'0x2D05FfFE70CE64c5954710D4C308dB31C8dBd8dE'.toLowerCase(),
|
|
110
|
+
TEAM_MULTISIG_AURORA_PLUS: /*#__PURE__*/'0x31f501589c7a090bf68f2fe2687744bf9130e1ab'.toLowerCase(),
|
|
111
|
+
AURORA_PLUS: /*#__PURE__*/'0xf075c896cbbb625e7911e284cd23ee19bdccf299'.toLowerCase(),
|
|
112
|
+
PULP_CONTRACT: /*#__PURE__*/'0x04ac48711bcdc45b4d223fb021e09da73c71095e'.toLowerCase(),
|
|
110
113
|
PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
111
114
|
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
|
|
112
115
|
AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase()
|
|
@@ -4388,7 +4391,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4388
4391
|
/*#__PURE__*/
|
|
4389
4392
|
function () {
|
|
4390
4393
|
var _getPlyCirculatingSupply = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
|
|
4391
|
-
var multicallRead, baseBalanceOfCall, callResults, circulatingSupply;
|
|
4394
|
+
var multicallRead, baseBalanceOfCall, listAddrs, calls, callResults, circulatingSupply;
|
|
4392
4395
|
return runtime_1.wrap(function _callee3$(_context3) {
|
|
4393
4396
|
while (1) {
|
|
4394
4397
|
switch (_context3.prev = _context3.next) {
|
|
@@ -4399,22 +4402,16 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4399
4402
|
method: 'balanceOf',
|
|
4400
4403
|
returnTypes: ['uint256']
|
|
4401
4404
|
};
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
_extends({}, baseBalanceOfCall, {
|
|
4411
|
-
args: [networkAddresses.misc.AURIFAIRLAUNCH]
|
|
4412
|
-
}), // balance in vesting contract
|
|
4413
|
-
_extends({}, baseBalanceOfCall, {
|
|
4414
|
-
args: [networkAddresses.misc.PLY_TOKEN_LOCK]
|
|
4415
|
-
})]);
|
|
4405
|
+
listAddrs = [networkAddresses.misc.TEAM_MULTISIG, networkAddresses.misc.COMPTROLLER, networkAddresses.misc.AURIFAIRLAUNCH, networkAddresses.misc.PLY_TOKEN_LOCK, networkAddresses.misc.TEAM_MULTISIG_AURORA_PLUS, networkAddresses.misc.AURORA_PLUS, networkAddresses.misc.PULP_CONTRACT];
|
|
4406
|
+
calls = listAddrs.map(function (addr) {
|
|
4407
|
+
return _extends({}, baseBalanceOfCall, {
|
|
4408
|
+
args: [addr]
|
|
4409
|
+
});
|
|
4410
|
+
});
|
|
4411
|
+
_context3.next = 6;
|
|
4412
|
+
return multicallRead.aggregate(calls);
|
|
4416
4413
|
|
|
4417
|
-
case
|
|
4414
|
+
case 6:
|
|
4418
4415
|
callResults = _context3.sent;
|
|
4419
4416
|
circulatingSupply = ethers.BigNumber.from('1' + '0'.repeat(10) + '0'.repeat(getDecimal(this.env.ply.address)));
|
|
4420
4417
|
callResults.forEach(function (result, i) {
|
|
@@ -4422,7 +4419,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4422
4419
|
});
|
|
4423
4420
|
return _context3.abrupt("return", new TokenAmount(PLYToken, circulatingSupply.toString()));
|
|
4424
4421
|
|
|
4425
|
-
case
|
|
4422
|
+
case 10:
|
|
4426
4423
|
case "end":
|
|
4427
4424
|
return _context3.stop();
|
|
4428
4425
|
}
|
|
@@ -4469,17 +4466,20 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4469
4466
|
}();
|
|
4470
4467
|
|
|
4471
4468
|
_proto.sneakAccounts = /*#__PURE__*/function () {
|
|
4472
|
-
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(accounts, tokenAddresses) {
|
|
4469
|
+
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(accounts, tokenAddresses, dust) {
|
|
4473
4470
|
var _this3 = this;
|
|
4474
4471
|
|
|
4475
|
-
var _1E18,
|
|
4472
|
+
var _1E18, oracle, tokens, prices, exrate, res, _iterator2, _step2, addr, infos, _i, snapshot, bal, bor, balR, borR;
|
|
4476
4473
|
|
|
4477
4474
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4478
4475
|
while (1) {
|
|
4479
4476
|
switch (_context5.prev = _context5.next) {
|
|
4480
4477
|
case 0:
|
|
4478
|
+
if (dust === void 0) {
|
|
4479
|
+
dust = /*#__PURE__*/new BigNumber(0.1);
|
|
4480
|
+
}
|
|
4481
|
+
|
|
4481
4482
|
_1E18 = ethers.BigNumber.from(10).pow(18);
|
|
4482
|
-
dust = new BigNumber(0.1);
|
|
4483
4483
|
oracle = this.env.getContract(networkAddresses.misc.oracle, AuriOracleABI.abi);
|
|
4484
4484
|
tokens = tokenAddresses.map(function (addr) {
|
|
4485
4485
|
return _this3.env.getContract(addr, abis$5.abi);
|
|
@@ -4523,7 +4523,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4523
4523
|
balR = new BigNumber(bal.toString()).dividedBy(_1E18.toString());
|
|
4524
4524
|
borR = new BigNumber(bor.toString()).dividedBy(_1E18.toString());
|
|
4525
4525
|
|
|
4526
|
-
if (!(balR.
|
|
4526
|
+
if (!(balR.lte(dust) && borR.lte(dust))) {
|
|
4527
4527
|
_context5.next = 26;
|
|
4528
4528
|
break;
|
|
4529
4529
|
}
|
|
@@ -4563,7 +4563,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4563
4563
|
}, _callee5, this);
|
|
4564
4564
|
}));
|
|
4565
4565
|
|
|
4566
|
-
function sneakAccounts(_x4, _x5) {
|
|
4566
|
+
function sneakAccounts(_x4, _x5, _x6) {
|
|
4567
4567
|
return _sneakAccounts.apply(this, arguments);
|
|
4568
4568
|
}
|
|
4569
4569
|
|
|
@@ -5242,14 +5242,18 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5242
5242
|
}();
|
|
5243
5243
|
|
|
5244
5244
|
_proto.sneakAccounts = /*#__PURE__*/function () {
|
|
5245
|
-
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(accounts, tokenAddresses) {
|
|
5245
|
+
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(accounts, tokenAddresses, dust) {
|
|
5246
5246
|
return runtime_1.wrap(function _callee9$(_context9) {
|
|
5247
5247
|
while (1) {
|
|
5248
5248
|
switch (_context9.prev = _context9.next) {
|
|
5249
5249
|
case 0:
|
|
5250
|
-
|
|
5250
|
+
if (dust === void 0) {
|
|
5251
|
+
dust = /*#__PURE__*/new BigNumber(0.1);
|
|
5252
|
+
}
|
|
5251
5253
|
|
|
5252
|
-
|
|
5254
|
+
return _context9.abrupt("return", this._misc.sneakAccounts(accounts, tokenAddresses, dust));
|
|
5255
|
+
|
|
5256
|
+
case 2:
|
|
5253
5257
|
case "end":
|
|
5254
5258
|
return _context9.stop();
|
|
5255
5259
|
}
|
|
@@ -5257,7 +5261,7 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5257
5261
|
}, _callee9, this);
|
|
5258
5262
|
}));
|
|
5259
5263
|
|
|
5260
|
-
function sneakAccounts(_x7, _x8) {
|
|
5264
|
+
function sneakAccounts(_x7, _x8, _x9) {
|
|
5261
5265
|
return _sneakAccounts.apply(this, arguments);
|
|
5262
5266
|
}
|
|
5263
5267
|
|
|
@@ -5319,7 +5323,7 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
5319
5323
|
}, _callee11, this);
|
|
5320
5324
|
}));
|
|
5321
5325
|
|
|
5322
|
-
function stake(
|
|
5326
|
+
function stake(_x10) {
|
|
5323
5327
|
return _stake.apply(this, arguments);
|
|
5324
5328
|
}
|
|
5325
5329
|
|
|
@@ -5342,7 +5346,7 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
5342
5346
|
}, _callee12, this);
|
|
5343
5347
|
}));
|
|
5344
5348
|
|
|
5345
|
-
function unstake(
|
|
5349
|
+
function unstake(_x11) {
|
|
5346
5350
|
return _unstake.apply(this, arguments);
|
|
5347
5351
|
}
|
|
5348
5352
|
|