@aurigami/sdk 1.11.2-dummy1 → 1.12.0-beta2

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.11.2-dummy1",
2
+ "version": "1.12.0-beta2",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -8,6 +8,8 @@ export const AURORA_CHAINID = 1313161554;
8
8
 
9
9
  export const DECIMAL_PRECISION = 10;
10
10
 
11
+ export const AURORA_PLUS_API_PREFIX = 'https://aurora.plus/api/wallet/';
12
+
11
13
  export type NetworkAddresses = {
12
14
  auTokens: {
13
15
  name: string;
@@ -1,10 +1,10 @@
1
1
  import { TransactionResponse } from '@ethersproject/abstract-provider';
2
- import { ethers, BigNumber as BN } from 'ethers';
2
+ import axios from 'axios';
3
+ import { ethers } from 'ethers';
3
4
  import {
4
- networkAddresses,
5
- referralRewardDummy1,
5
+ AURORA_PLUS_API_PREFIX, referralRewardDummy1,
6
6
  referralRewardDummy2,
7
- REFERRAL_CAMPAIGNS,
7
+ REFERRAL_CAMPAIGNS
8
8
  } from '../consts';
9
9
  import { AuriEnv, BlockchainEntity, BlockchainEntityRead, TokenAmount } from '../entities';
10
10
  import { getBlocksTimestamp } from '../helpers';
@@ -134,6 +134,17 @@ export class ReferralRead extends BlockchainEntityRead {
134
134
  return 'notReferred';
135
135
  }
136
136
  }
137
+
138
+ public async isWhitelistedAddress(address: Address): Promise<boolean> {
139
+ let result = await AuriAPI.getApi('/referral/whitelisted', { address: address });
140
+ return result.isWhitelisted;
141
+ }
142
+
143
+ public async isOnAuroraPlus(address: Address): Promise<boolean> {
144
+ let resp = await axios.get(AURORA_PLUS_API_PREFIX + address);
145
+
146
+ return resp.data.status == 'active';
147
+ }
137
148
  }
138
149
 
139
150
  export class ReferralReadWrite extends ReferralRead {