@haven-fi/solauto-sdk 1.0.198 → 1.0.199

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,7 +42,7 @@ export declare abstract class SolautoClient extends TxHandler {
42
42
  solautoFeesSupplyTa: PublicKey;
43
43
  authorityLutAddress?: PublicKey;
44
44
  livePositionUpdates: LivePositionUpdates;
45
- constructor(heliusApiUrl: string, localTest?: boolean);
45
+ constructor(rpcUrl: string, localTest?: boolean);
46
46
  initialize(args: SolautoClientArgs, lendingPlatform: LendingPlatform): Promise<void>;
47
47
  setReferredBy(referredBy: PublicKey): void;
48
48
  resetLiveTxUpdates(success?: boolean): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,MAAM,EACN,kBAAkB,EAOnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,aAAa,EAEd,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAEhC,sBAAsB,EAMvB,MAAM,cAAc,CAAC;AAYtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;I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a,CAAC,EAAE,gCAAgC,EAChD,GAAG,CAAC,EAAE,kBAAkB,GACvB,kBAAkB;IA0BrB,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,GAAG,kBAAkB;IAwDlE,eAAe,IAAI,kBAAkB;IAYrC,WAAW,IAAI,kBAAkB;IAgCjC,QAAQ,CAAC,OAAO,IAAI,kBAAkB;IAEtC,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB;IAuFhE,QAAQ,CAAC,WAAW,CAClB,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,SAAS,GACjC,kBAAkB;IAErB,QAAQ,CAAC,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,kBAAkB;IAE3E,QAAQ,CAAC,SAAS,CAChB,aAAa,EAAE,GAAG,GAAG,GAAG,EACxB,QAAQ,EAAE,aAAa,EACvB,aAAa,EAAE,wBAAwB,EACvC,SAAS,CAAC,EAAE,gBAAgB,EAC5B,2BAA2B,CAAC,EAAE,MAAM,GACnC,kBAAkB;IAEf,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAalE"}
@@ -16,8 +16,8 @@ const generalUtils_2 = require("../utils/solauto/generalUtils");
16
16
  const referralStateManager_1 = require("./referralStateManager");
17
17
  const txHandler_1 = require("./txHandler");
18
18
  class SolautoClient extends txHandler_1.TxHandler {
19
- constructor(heliusApiUrl, localTest) {
20
- super(heliusApiUrl, localTest);
19
+ constructor(rpcUrl, localTest) {
20
+ super(rpcUrl, localTest);
21
21
  this.livePositionUpdates = new generalUtils_2.LivePositionUpdates();
22
22
  this.umi = this.umi.use({
23
23
  install(umi) {
@@ -40,6 +40,8 @@ class SolautoClient extends txHandler_1.TxHandler {
40
40
  this.solautoPosition = (0, accountUtils_1.getSolautoPositionAccount)(this.authority, this.positionId);
41
41
  this.solautoPositionData = await (0, generated_1.safeFetchSolautoPosition)(this.umi, (0, umi_1.publicKey)(this.solautoPosition), { commitment: "confirmed" });
42
42
  this.solautoPositionState = this.solautoPositionData?.state;
43
+ this.maxLtvBps = undefined;
44
+ this.liqThresholdBps = undefined;
43
45
  this.supplyMint =
44
46
  args.supplyMint ??
45
47
  (this.solautoPositionData
@@ -54,7 +56,7 @@ class SolautoClient extends txHandler_1.TxHandler {
54
56
  : web3_js_1.PublicKey.default);
55
57
  this.positionDebtTa = (0, accountUtils_1.getTokenAccount)(this.solautoPosition, this.debtMint);
56
58
  this.signerDebtTa = (0, accountUtils_1.getTokenAccount)((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey), this.debtMint);
57
- this.referralStateManager = new referralStateManager_1.ReferralStateManager(this.heliusApiUrl);
59
+ this.referralStateManager = new referralStateManager_1.ReferralStateManager(this.rpcUrl);
58
60
  await this.referralStateManager.initialize({
59
61
  referralAuthority: this.authority,
60
62
  signer: args.signer,
@@ -1,10 +1,10 @@
1
1
  import { Umi } from "@metaplex-foundation/umi";
2
2
  import { Connection } from "@solana/web3.js";
3
3
  export declare abstract class TxHandler {
4
- heliusApiUrl: string;
4
+ rpcUrl: string;
5
5
  umi: Umi;
6
6
  connection: Connection;
7
- constructor(heliusApiUrl: string, localTest?: boolean);
7
+ constructor(rpcUrl: string, localTest?: boolean);
8
8
  log(...args: any[]): void;
9
9
  abstract defaultLookupTables(): string[];
10
10
  abstract resetLiveTxUpdates(success?: boolean): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"txHandler.d.ts","sourceRoot":"","sources":["../../src/clients/txHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,8BAAsB,SAAS;IACtB,YAAY,EAAG,MAAM,CAAC;IACtB,GAAG,EAAG,GAAG,CAAC;IACV,UAAU,EAAG,UAAU,CAAC;gBAG7B,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,OAAO;IAYrB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAIzB,QAAQ,CAAC,mBAAmB,IAAI,MAAM,EAAE;IAExC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9D"}
1
+ {"version":3,"file":"txHandler.d.ts","sourceRoot":"","sources":["../../src/clients/txHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,8BAAsB,SAAS;IACtB,MAAM,EAAG,MAAM,CAAC;IAChB,GAAG,EAAG,GAAG,CAAC;IACV,UAAU,EAAG,UAAU,CAAC;gBAG7B,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,OAAO;IAYrB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAIzB,QAAQ,CAAC,mBAAmB,IAAI,MAAM,EAAE;IAExC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9D"}
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TxHandler = void 0;
4
4
  const utils_1 = require("../utils");
5
5
  class TxHandler {
6
- constructor(heliusApiUrl, localTest) {
7
- this.heliusApiUrl = heliusApiUrl;
8
- const [connection, umi] = (0, utils_1.getSolanaRpcConnection)(this.heliusApiUrl);
6
+ constructor(rpcUrl, localTest) {
7
+ this.rpcUrl = rpcUrl;
8
+ const [connection, umi] = (0, utils_1.getSolanaRpcConnection)(this.rpcUrl);
9
9
  this.connection = connection;
10
10
  this.umi = umi;
11
11
  if (!globalThis.LOCAL_TEST && localTest) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.198",
3
+ "version": "1.0.199",
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",
@@ -103,8 +103,8 @@ export abstract class SolautoClient extends TxHandler {
103
103
 
104
104
  public livePositionUpdates: LivePositionUpdates = new LivePositionUpdates();
105
105
 
106
- constructor(heliusApiUrl: string, localTest?: boolean) {
107
- super(heliusApiUrl, localTest);
106
+ constructor(rpcUrl: string, localTest?: boolean) {
107
+ super(rpcUrl, localTest);
108
108
 
109
109
  this.umi = this.umi.use({
110
110
  install(umi) {
@@ -140,6 +140,9 @@ export abstract class SolautoClient extends TxHandler {
140
140
  );
141
141
  this.solautoPositionState = this.solautoPositionData?.state;
142
142
 
143
+ this.maxLtvBps = undefined;
144
+ this.liqThresholdBps = undefined;
145
+
143
146
  this.supplyMint =
144
147
  args.supplyMint ??
145
148
  (this.solautoPositionData
@@ -165,7 +168,7 @@ export abstract class SolautoClient extends TxHandler {
165
168
  this.debtMint
166
169
  );
167
170
 
168
- this.referralStateManager = new ReferralStateManager(this.heliusApiUrl);
171
+ this.referralStateManager = new ReferralStateManager(this.rpcUrl);
169
172
  await this.referralStateManager.initialize({
170
173
  referralAuthority: this.authority,
171
174
  signer: args.signer,
@@ -3,16 +3,16 @@ import { Connection } from "@solana/web3.js";
3
3
  import { consoleLog, getSolanaRpcConnection } from "../utils";
4
4
 
5
5
  export abstract class TxHandler {
6
- public heliusApiUrl!: string;
6
+ public rpcUrl!: string;
7
7
  public umi!: Umi;
8
8
  public connection!: Connection;
9
9
 
10
10
  constructor(
11
- heliusApiUrl: string,
11
+ rpcUrl: string,
12
12
  localTest?: boolean
13
13
  ) {
14
- this.heliusApiUrl = heliusApiUrl;
15
- const [connection, umi] = getSolanaRpcConnection(this.heliusApiUrl);
14
+ this.rpcUrl = rpcUrl;
15
+ const [connection, umi] = getSolanaRpcConnection(this.rpcUrl);
16
16
  this.connection = connection;
17
17
  this.umi = umi;
18
18