@haven-fi/solauto-sdk 1.0.108 → 1.0.109

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,13 +42,13 @@ class SolautoClient extends txHandler_1.TxHandler {
42
42
  this.solautoPositionData = await (0, generated_1.safeFetchSolautoPosition)(this.umi, (0, umi_1.publicKey)(this.solautoPosition));
43
43
  this.solautoPositionState = this.solautoPositionData?.state;
44
44
  this.supplyMint =
45
- args.supplyMint ??
46
- (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.solautoPositionData.position.supplyMint);
45
+ (args.supplyMint ??
46
+ this.solautoPositionData) ? (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.solautoPositionData.position.supplyMint) : web3_js_1.PublicKey.default;
47
47
  this.positionSupplyTa = (0, accountUtils_1.getTokenAccount)(this.solautoPosition, this.supplyMint);
48
48
  this.signerSupplyTa = (0, accountUtils_1.getTokenAccount)((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey), this.supplyMint);
49
49
  this.debtMint =
50
- args.debtMint ??
51
- (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.solautoPositionData.position.debtMint);
50
+ (args.debtMint ??
51
+ this.solautoPositionData) ? (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.solautoPositionData.position.debtMint) : web3_js_1.PublicKey.default;
52
52
  this.positionDebtTa = (0, accountUtils_1.getTokenAccount)(this.solautoPosition, this.debtMint);
53
53
  this.signerDebtTa = (0, accountUtils_1.getTokenAccount)((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey), this.debtMint);
54
54
  this.referralStateManager = new referralStateManager_1.ReferralStateManager(this.heliusApiKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.108",
3
+ "version": "1.0.109",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -144,7 +144,7 @@ export abstract class SolautoClient extends TxHandler {
144
144
 
145
145
  this.supplyMint =
146
146
  args.supplyMint ??
147
- toWeb3JsPublicKey(this.solautoPositionData!.position.supplyMint);
147
+ this.solautoPositionData ? toWeb3JsPublicKey(this.solautoPositionData!.position.supplyMint) : PublicKey.default;
148
148
  this.positionSupplyTa = getTokenAccount(
149
149
  this.solautoPosition,
150
150
  this.supplyMint
@@ -156,7 +156,7 @@ export abstract class SolautoClient extends TxHandler {
156
156
 
157
157
  this.debtMint =
158
158
  args.debtMint ??
159
- toWeb3JsPublicKey(this.solautoPositionData!.position.debtMint);
159
+ this.solautoPositionData ? toWeb3JsPublicKey(this.solautoPositionData!.position.debtMint) : PublicKey.default;
160
160
  this.positionDebtTa = getTokenAccount(this.solautoPosition, this.debtMint);
161
161
  this.signerDebtTa = getTokenAccount(
162
162
  toWeb3JsPublicKey(this.signer.publicKey),