@aurigami/sdk 1.6.5 → 1.6.6

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.5",
2
+ "version": "1.6.6",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -8,12 +8,12 @@ import * as helpers from '../helpers';
8
8
  import { Address, NetworkConnection } from '../types';
9
9
 
10
10
  export class AirdropRead extends BlockchainEntityRead {
11
- protected _airDrop: AuriAirdrop;
11
+ public readonly airDrop: AuriAirdrop;
12
12
 
13
13
  public constructor(networkConnection: NetworkConnection) {
14
14
  super(networkConnection);
15
15
 
16
- this._airDrop = new Contract(
16
+ this.airDrop = new Contract(
17
17
  consts.networkAddresses.misc.AURI_AIRDROP,
18
18
  AuriAirdropABI.abi,
19
19
  networkConnection.provider
@@ -30,7 +30,7 @@ export class AirdropRead extends BlockchainEntityRead {
30
30
  ): Promise<TokenAmount> {
31
31
  let tokenInstance: Token = new Token(token, helpers.getDecimal(token));
32
32
 
33
- let rewards: BN = await this._airDrop.getRedeemableReward(
33
+ let rewards: BN = await this.airDrop.getRedeemableReward(
34
34
  utils.formatBytes32String(campaign),
35
35
  token,
36
36
  user
@@ -52,7 +52,7 @@ export class AirdropReadWrite extends AirdropRead {
52
52
  campaigns.length == tokens.length,
53
53
  'campaigns and tokens must have the same length'
54
54
  );
55
- return this._airDrop.connect(this._networkConnection.signer!).redeem(
55
+ return this.airDrop.connect(this._networkConnection.signer!).redeem(
56
56
  campaigns.map((e) => utils.formatBytes32String(e)),
57
57
  tokens,
58
58
  await this._networkConnection.signer!.getAddress()
@@ -26,7 +26,7 @@ type RewardSpeeds = {
26
26
  export class MoneyMarketRead extends BlockchainEntityRead {
27
27
  public underlying: Token;
28
28
  public auToken: AuErc20 | AuETH;
29
- protected env: AuriEnv;
29
+ public readonly env: AuriEnv;
30
30
  constructor(networkConnection: NetworkConnection, auToken: Address, underlyingAsset: Address) {
31
31
  super(networkConnection);
32
32
  this.env = new AuriEnv(networkConnection);
@@ -7,10 +7,10 @@ import { BlockchainEntityRead } from '../entities';
7
7
  import { NetworkConnection } from '../types';
8
8
 
9
9
  export class MulticallRead extends BlockchainEntityRead {
10
- protected _multicall: Multicall2;
10
+ public readonly multicall: Multicall2;
11
11
  constructor(networkConnection: NetworkConnection) {
12
12
  super(networkConnection);
13
- this._multicall = new Contract(
13
+ this.multicall = new Contract(
14
14
  consts.networkAddresses.misc.MULTICALL,
15
15
  abis.Multicall2ABI.abi,
16
16
  networkConnection.provider
@@ -36,7 +36,7 @@ export class MulticallRead extends BlockchainEntityRead {
36
36
  txns.push({ target: txn.to!, callData: txn.data! });
37
37
  }
38
38
 
39
- const response = await this._multicall.callStatic.aggregate(txns);
39
+ const response = await this.multicall.callStatic.aggregate(txns);
40
40
 
41
41
  // parse results
42
42
  const decodedReturn = [];
@@ -8,9 +8,9 @@ import { Address, NetworkConnection, UserLockingDetails } from '../types';
8
8
 
9
9
  const LOCKING_DENOMINATOR = BN.from(10000);
10
10
  export class PapermillRead extends BlockchainEntityRead {
11
- public plyToken: Token;
12
- public pulpToken: Token;
13
- protected env: AuriEnv;
11
+ public readonly plyToken: Token;
12
+ public readonly pulpToken: Token;
13
+ public readonly env: AuriEnv;
14
14
 
15
15
  constructor(networkConnection: NetworkConnection) {
16
16
  super(networkConnection);
@@ -7,10 +7,10 @@ import { BlockchainEntity, BlockchainEntityRead } from '../entities';
7
7
  import { Address, NetworkConnection } from '../types';
8
8
 
9
9
  export class ReferralRead extends BlockchainEntityRead {
10
- protected _referral: ReferralDirectory;
10
+ public readonly referral: ReferralDirectory;
11
11
  constructor(networkConnection: NetworkConnection) {
12
12
  super(networkConnection);
13
- this._referral = new Contract(
13
+ this.referral = new Contract(
14
14
  consts.networkAddresses.misc.REFERRAL,
15
15
  abis.ReferralDirectoryABI.abi,
16
16
  networkConnection.provider
@@ -36,7 +36,7 @@ export class ReferralRead extends BlockchainEntityRead {
36
36
  * Called to check if a user has a referral code.
37
37
  */
38
38
  public async getUserReferralCode(userAddr: Address): Promise<string> {
39
- const result = await this._referral.userReferralCode(userAddr);
39
+ const result = await this.referral.userReferralCode(userAddr);
40
40
  return ethers.utils.parseBytes32String(result);
41
41
  }
42
42
 
@@ -44,7 +44,7 @@ export class ReferralRead extends BlockchainEntityRead {
44
44
  * Get referral code that a user was referred by, returns empty string if not found.
45
45
  */
46
46
  public async getReferralCodeUsed(userAddr: Address): Promise<string> {
47
- const result = await this._referral.referralCodeUsed(userAddr);
47
+ const result = await this.referral.referralCodeUsed(userAddr);
48
48
  return ethers.utils.parseBytes32String(result);
49
49
  }
50
50
 
@@ -53,7 +53,7 @@ export class ReferralRead extends BlockchainEntityRead {
53
53
  */
54
54
  public async getReferralCodeOwner(code: string): Promise<Address> {
55
55
  const referralCode = ethers.utils.formatBytes32String(code);
56
- return this._referral.referralCodeOwner(referralCode);
56
+ return this.referral.referralCodeOwner(referralCode);
57
57
  }
58
58
  }
59
59
 
@@ -65,7 +65,7 @@ export class ReferralReadWrite extends ReferralRead {
65
65
  */
66
66
  public async registerNewReferralCode(): Promise<TransactionResponse> {
67
67
  const referralCode = ethers.utils.formatBytes32String(this.generateReferralCode());
68
- return this._referral
68
+ return this.referral
69
69
  .connect(this._networkConnection.signer!)
70
70
  .registerNewUserReferralCode(referralCode);
71
71
  }
@@ -75,7 +75,7 @@ export class ReferralReadWrite extends ReferralRead {
75
75
  */
76
76
  public async useReferralCode(code: string): Promise<TransactionResponse> {
77
77
  const referralCode = ethers.utils.formatBytes32String(code);
78
- return this._referral
78
+ return this.referral
79
79
  .connect(this._networkConnection.signer!)
80
80
  .registerReferralCodeUsed(referralCode);
81
81
  }
@@ -17,7 +17,7 @@ import { fetchValuation } from '../helpers/priceFetcher';
17
17
  import { NetworkConnection, PLYWNEARPoolDetails, TokenAPY } from '../types';
18
18
 
19
19
  export class StakingRead extends BlockchainEntityRead {
20
- protected env: AuriEnv;
20
+ public readonly env: AuriEnv;
21
21
  constructor(networkConnection: NetworkConnection) {
22
22
  super(networkConnection);
23
23
  this.env = new AuriEnv(networkConnection);
@@ -9,11 +9,11 @@ import { calcValuation, fetchPrice } from '../helpers/priceFetcher';
9
9
  import * as types from '../types';
10
10
 
11
11
  export class MiscRead extends BlockchainEntityRead {
12
- protected env: AuriEnv;
13
- protected _stakingRead: StakingRead;
12
+ public readonly env: AuriEnv;
13
+ public readonly stakingRead: StakingRead;
14
14
  constructor(networkConnection: types.NetworkConnection) {
15
15
  super(networkConnection);
16
- this._stakingRead = new StakingRead(networkConnection);
16
+ this.stakingRead = new StakingRead(networkConnection);
17
17
  this.env = new AuriEnv(networkConnection);
18
18
  }
19
19