@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/ChangeLog.md +4 -0
- package/dist/contracts/Airdrop.d.ts +1 -1
- package/dist/contracts/MoneyMarket.d.ts +1 -1
- package/dist/contracts/Multicall.d.ts +1 -1
- package/dist/contracts/Papermill.d.ts +3 -3
- package/dist/contracts/Referral.d.ts +1 -1
- package/dist/contracts/Staking.d.ts +1 -1
- package/dist/contracts/misc.d.ts +2 -2
- package/dist/sdk.cjs.development.js +12 -12
- 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 +12 -12
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/contracts/Airdrop.ts +4 -4
- package/src/contracts/MoneyMarket.ts +1 -1
- package/src/contracts/Multicall.ts +3 -3
- package/src/contracts/Papermill.ts +3 -3
- package/src/contracts/Referral.ts +7 -7
- package/src/contracts/Staking.ts +1 -1
- package/src/contracts/misc.ts +3 -3
package/package.json
CHANGED
package/src/contracts/Airdrop.ts
CHANGED
|
@@ -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
|
-
|
|
11
|
+
public readonly airDrop: AuriAirdrop;
|
|
12
12
|
|
|
13
13
|
public constructor(networkConnection: NetworkConnection) {
|
|
14
14
|
super(networkConnection);
|
|
15
15
|
|
|
16
|
-
this.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
10
|
+
public readonly multicall: Multicall2;
|
|
11
11
|
constructor(networkConnection: NetworkConnection) {
|
|
12
12
|
super(networkConnection);
|
|
13
|
-
this.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
10
|
+
public readonly referral: ReferralDirectory;
|
|
11
11
|
constructor(networkConnection: NetworkConnection) {
|
|
12
12
|
super(networkConnection);
|
|
13
|
-
this.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
78
|
+
return this.referral
|
|
79
79
|
.connect(this._networkConnection.signer!)
|
|
80
80
|
.registerReferralCodeUsed(referralCode);
|
|
81
81
|
}
|
package/src/contracts/Staking.ts
CHANGED
|
@@ -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
|
-
|
|
20
|
+
public readonly env: AuriEnv;
|
|
21
21
|
constructor(networkConnection: NetworkConnection) {
|
|
22
22
|
super(networkConnection);
|
|
23
23
|
this.env = new AuriEnv(networkConnection);
|
package/src/contracts/misc.ts
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
12
|
+
public readonly env: AuriEnv;
|
|
13
|
+
public readonly stakingRead: StakingRead;
|
|
14
14
|
constructor(networkConnection: types.NetworkConnection) {
|
|
15
15
|
super(networkConnection);
|
|
16
|
-
this.
|
|
16
|
+
this.stakingRead = new StakingRead(networkConnection);
|
|
17
17
|
this.env = new AuriEnv(networkConnection);
|
|
18
18
|
}
|
|
19
19
|
|