@haven-fi/solauto-sdk 1.0.210 → 1.0.212

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.
@@ -16,7 +16,6 @@ export declare class ReferralStateManager extends TxHandler {
16
16
  referralAuthority: PublicKey;
17
17
  referralState: PublicKey;
18
18
  referralStateData: ReferralState | null;
19
- referredByAuthority?: PublicKey;
20
19
  referredByState?: PublicKey;
21
20
  constructor(heliusApiUrl: string, localTest?: boolean | undefined);
22
21
  initialize(args: ReferralStateManagerArgs): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"referralStateManager.d.ts","sourceRoot":"","sources":["../../src/clients/referralStateManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,MAAM,EAEN,kBAAkB,EAClB,GAAG,EACJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,aAAa,EAEd,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAGL,aAAa,EAGd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,UAAU,wBAAwB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,mBAAmB,CAAC,EAAE,SAAS,CAAC;CACjC;AAED,qBAAa,oBAAqB,SAAQ,SAAS;IAaxC,SAAS,CAAC,EAAE,OAAO;IAZrB,GAAG,EAAG,GAAG,CAAC;IACV,MAAM,EAAG,MAAM,CAAC;IAEhB,iBAAiB,EAAG,SAAS,CAAC;IAC9B,aAAa,EAAG,SAAS,CAAC;IAC1B,iBAAiB,EAAG,aAAa,GAAG,IAAI,CAAC;IAEzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,SAAS,CAAC;gBAGjC,YAAY,EAAE,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;gBAGjC,YAAY,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,OAAO,YAAA;IAUtB,UAAU,CAAC,IAAI,EAAE,wBAAwB;IAuB/C,mBAAmB,IAAI,MAAM,EAAE;IASxB,aAAa,CAAC,UAAU,CAAC,EAAE,SAAS;IAoB3C,sBAAsB,CACpB,YAAY,CAAC,EAAE,SAAS,EACxB,UAAU,CAAC,EAAE,SAAS,EACtB,WAAW,CAAC,EAAE,SAAS,GACtB,kBAAkB;IAerB,mBAAmB,CAAC,YAAY,CAAC,EAAE,SAAS,GAAG,kBAAkB;IA8B3D,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAC3D"}
@@ -32,7 +32,8 @@ class ReferralStateManager extends txHandler_1.TxHandler {
32
32
  this.setReferredBy(args.referredByAuthority);
33
33
  }
34
34
  defaultLookupTables() {
35
- return this.referralStateData?.lookupTable
35
+ return this.referralStateData?.lookupTable &&
36
+ !(0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.referralStateData.lookupTable).equals(web3_js_1.PublicKey.default)
36
37
  ? [this.referralStateData?.lookupTable.toString()]
37
38
  : [];
38
39
  }
@@ -51,7 +52,7 @@ class ReferralStateManager extends txHandler_1.TxHandler {
51
52
  : referredByAuthority
52
53
  ? (0, utils_1.getReferralState)(referredByAuthority)
53
54
  : undefined;
54
- this.referredByAuthority = referredByAuthority;
55
+ this.referredBy = referredByAuthority;
55
56
  }
56
57
  updateReferralStatesIx(destFeesMint, referredBy, lookupTable) {
57
58
  return (0, generated_1.updateReferralStates)(this.umi, {
@@ -4,6 +4,7 @@ export declare abstract class TxHandler {
4
4
  rpcUrl: string;
5
5
  umi: Umi;
6
6
  connection: Connection;
7
+ referredBy?: PublicKey;
7
8
  constructor(rpcUrl: string, localTest?: boolean);
8
9
  log(...args: any[]): void;
9
10
  abstract defaultLookupTables(): string[];
@@ -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,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGxD,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;IAE7D,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,IAAI;CACrD"}
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,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGxD,8BAAsB,SAAS;IACtB,MAAM,EAAG,MAAM,CAAC;IAChB,GAAG,EAAG,GAAG,CAAC;IACV,UAAU,EAAG,UAAU,CAAC;IAExB,UAAU,CAAC,EAAE,SAAS,CAAC;gBAG5B,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;IAE7D,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,IAAI;CACrD"}
@@ -58,7 +58,7 @@ async function transactionChoresBefore(client, accountsGettingCreated, solautoAc
58
58
  (client.authorityLutAddress !== undefined &&
59
59
  client.referralStateManager.referralStateData.lookupTable ==
60
60
  (0, umi_1.publicKey)(web3_js_1.PublicKey.default))) {
61
- chores = chores.add(client.referralStateManager.updateReferralStatesIx(undefined, client.referralStateManager.referredByAuthority, client.authorityLutAddress));
61
+ chores = chores.add(client.referralStateManager.updateReferralStatesIx(undefined, client.referralStateManager.referredBy, client.authorityLutAddress));
62
62
  }
63
63
  if (client.selfManaged) {
64
64
  if (client.solautoPositionData === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.210",
3
+ "version": "1.0.212",
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",
@@ -37,7 +37,6 @@ export class ReferralStateManager extends TxHandler {
37
37
  public referralState!: PublicKey;
38
38
  public referralStateData!: ReferralState | null;
39
39
 
40
- public referredByAuthority?: PublicKey;
41
40
  public referredByState?: PublicKey;
42
41
 
43
42
  constructor(
@@ -76,7 +75,10 @@ export class ReferralStateManager extends TxHandler {
76
75
  }
77
76
 
78
77
  defaultLookupTables(): string[] {
79
- return this.referralStateData?.lookupTable
78
+ return this.referralStateData?.lookupTable &&
79
+ !toWeb3JsPublicKey(this.referralStateData!.lookupTable).equals(
80
+ PublicKey.default
81
+ )
80
82
  ? [this.referralStateData?.lookupTable.toString()]
81
83
  : [];
82
84
  }
@@ -98,7 +100,7 @@ export class ReferralStateManager extends TxHandler {
98
100
  : referredByAuthority
99
101
  ? getReferralState(referredByAuthority!)
100
102
  : undefined;
101
- this.referredByAuthority = referredByAuthority;
103
+ this.referredBy = referredByAuthority;
102
104
  }
103
105
 
104
106
  updateReferralStatesIx(
@@ -7,6 +7,8 @@ export abstract class TxHandler {
7
7
  public umi!: Umi;
8
8
  public connection!: Connection;
9
9
 
10
+ public referredBy?: PublicKey;
11
+
10
12
  constructor(
11
13
  rpcUrl: string,
12
14
  localTest?: boolean
@@ -150,7 +150,7 @@ async function transactionChoresBefore(
150
150
  chores = chores.add(
151
151
  client.referralStateManager.updateReferralStatesIx(
152
152
  undefined,
153
- client.referralStateManager.referredByAuthority,
153
+ client.referralStateManager.referredBy,
154
154
  client.authorityLutAddress
155
155
  )
156
156
  );