@aurigami/sdk 0.5.0 → 0.5.1
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 -0
- package/dist/sdk.cjs.development.js +43 -5
- 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 +43 -5
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/MoneyMarket.ts +8 -3
- package/src/SDK.ts +5 -0
package/package.json
CHANGED
package/src/MoneyMarket.ts
CHANGED
|
@@ -187,7 +187,6 @@ export class MoneyMarketRead extends BlockchainEntityRead {
|
|
|
187
187
|
totalDeposit.toString()
|
|
188
188
|
)
|
|
189
189
|
}
|
|
190
|
-
|
|
191
190
|
|
|
192
191
|
}
|
|
193
192
|
|
|
@@ -209,10 +208,16 @@ export class MoneyMarketReadWrite extends MoneyMarketRead {
|
|
|
209
208
|
return this.auToken.connect(this._networkConnection.signer!).redeemUnderlying(amount.rawAmount());
|
|
210
209
|
}
|
|
211
210
|
public async repay(amount: TokenAmount): Promise<TransactionResponse> {
|
|
211
|
+
var repayAmount: BN;
|
|
212
|
+
if (new BigNumber(amount.rawAmount()).lt(0)) {
|
|
213
|
+
repayAmount = INF;
|
|
214
|
+
} else {
|
|
215
|
+
repayAmount = BN.from(amount.rawAmount());
|
|
216
|
+
}
|
|
212
217
|
if (isSameAddress(amount.token.address, ETHAddress)) {
|
|
213
|
-
return (this.auToken as AuETH).connect(this._networkConnection.signer!).repayBorrow({value:
|
|
218
|
+
return (this.auToken as AuETH).connect(this._networkConnection.signer!).repayBorrow({value: repayAmount});
|
|
214
219
|
} else {
|
|
215
|
-
return (this.auToken as AuErc20).connect(this._networkConnection.signer!).repayBorrow(
|
|
220
|
+
return (this.auToken as AuErc20).connect(this._networkConnection.signer!).repayBorrow(repayAmount);
|
|
216
221
|
}
|
|
217
222
|
}
|
|
218
223
|
public async enableCollateral(): Promise<TransactionResponse> {
|
package/src/SDK.ts
CHANGED
|
@@ -24,6 +24,7 @@ import AuriLensABI from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/Au
|
|
|
24
24
|
import ComptrollerABI from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
|
|
25
25
|
import TokenLockABI from "@aurigami/contracts/artifacts/contracts/TokenLock.sol/TokenLock.json";
|
|
26
26
|
import AuriFairLaunchABI from "@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json";
|
|
27
|
+
import FaucetABI from "./abis/dummy.json"; //To-do
|
|
27
28
|
|
|
28
29
|
export class SdkRead extends BlockchainEntityRead {
|
|
29
30
|
|
|
@@ -252,6 +253,10 @@ export class SdkReadWrite extends SdkRead {
|
|
|
252
253
|
public async unstake(amount: TokenAmount): Promise<TransactionResponse> {
|
|
253
254
|
return this._auriFairLaunch.connect(this._networkConnection.signer!).withdraw(AurPlyPid, amount.rawAmount());
|
|
254
255
|
}
|
|
256
|
+
public async faucetDrip(): Promise<TransactionResponse> {
|
|
257
|
+
const faucet = new Contract(networkAddresses.misc.FAUCET, FaucetABI.abi, this._networkConnection.provider);
|
|
258
|
+
return faucet.connect(this._networkConnection.signer!).drip();
|
|
259
|
+
}
|
|
255
260
|
}
|
|
256
261
|
|
|
257
262
|
export class SDK extends BlockchainEntity {
|