@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/dist/consts/constants.d.ts +1 -0
- package/dist/interactors/Referral.d.ts +2 -0
- package/dist/sdk.cjs.development.js +87 -25
- 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 +87 -26
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/consts/constants.ts +2 -0
- package/src/interactors/Referral.ts +15 -4
package/package.json
CHANGED
package/src/consts/constants.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
2
|
-
import
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { ethers } from 'ethers';
|
|
3
4
|
import {
|
|
4
|
-
|
|
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 {
|