@haven-fi/solauto-sdk 1.0.224 → 1.0.225

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ export declare class ReferralStateManager extends TxHandler {
24
24
  defaultLookupTables(): string[];
25
25
  setReferredBy(referredBy?: PublicKey): void;
26
26
  updateReferralStatesIx(destFeesMint?: PublicKey, lookupTable?: PublicKey): TransactionBuilder;
27
- claimReferralFeesIx(destFeesMint?: PublicKey): TransactionBuilder;
27
+ claimReferralFeesIx(): TransactionBuilder;
28
28
  resetLiveTxUpdates(success?: boolean): Promise<void>;
29
29
  }
30
30
  //# sourceMappingURL=referralStateManager.d.ts.map
@@ -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;AAGxC,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,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,aAAa,EAAG,SAAS,CAAC;IAC1B,iBAAiB,EAAG,aAAa,GAAG,IAAI,CAAC;IACzC,SAAS,EAAG,SAAS,CAAC;IAEtB,UAAU,CAAC,EAAE,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AI,CAAC;IACzC,SAAS,EAAG,SAAS,CAAC;IAEtB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,eAAe,CAAC,EAAE,SAAS,CAAC;gBAGjC,MAAM,EAAE,MAAM,EACP,SAAS,CAAC,EAAE,OAAO,YAAA;IAUtB,UAAU,CAAC,IAAI,EAAE,wBAAwB;IA4B/C,mBAAmB,IAAI,MAAM,EAAE;IAS/B,aAAa,CAAC,UAAU,CAAC,EAAE,SAAS;IAmBpC,sBAAsB,CACpB,YAAY,CAAC,EAAE,SAAS,EACxB,WAAW,CAAC,EAAE,SAAS,GACtB,kBAAkB;IAerB,mBAAmB,IAAI,kBAAkB;IA+BnC,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAC3D"}
@@ -72,11 +72,11 @@ class ReferralStateManager extends txHandler_1.TxHandler {
72
72
  addressLookupTable: lookupTable ? (0, umi_1.publicKey)(lookupTable) : null,
73
73
  });
74
74
  }
75
- claimReferralFeesIx(destFeesMint) {
76
- const referralFeesDestMint = destFeesMint ?? (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.referralStateData.destFeesMint);
75
+ claimReferralFeesIx() {
76
+ const referralFeesDestMint = (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.referralStateData.destFeesMint);
77
77
  const referralDestTa = (0, utils_1.getTokenAccount)(this.referralState, referralFeesDestMint);
78
78
  const feesDestinationTa = referralFeesDestMint !== spl_token_1.NATIVE_MINT
79
- ? (0, umi_1.publicKey)((0, utils_1.getTokenAccount)((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey), referralFeesDestMint))
79
+ ? (0, umi_1.publicKey)((0, utils_1.getTokenAccount)(this.authority, referralFeesDestMint))
80
80
  : undefined;
81
81
  return (0, generated_1.claimReferralFees)(this.umi, {
82
82
  signer: this.signer,
@@ -21,7 +21,7 @@ class LookupTables {
21
21
  const currentCacheAddresses = this.cache.map((x) => x.publicKey.toString());
22
22
  const missingAddresses = addresses.filter((x) => !currentCacheAddresses.includes(x));
23
23
  if (missingAddresses) {
24
- const additionalInputs = await (0, solanaUtils_1.getAdressLookupInputs)(this.umi, missingAddresses);
24
+ const additionalInputs = await (0, solanaUtils_1.getAddressLookupInputs)(this.umi, missingAddresses);
25
25
  this.cache.push(...additionalInputs);
26
26
  }
27
27
  return this.cache;
@@ -11,7 +11,7 @@ export declare function createAssociatedTokenAccountUmiIx(signer: Signer, wallet
11
11
  export declare function systemTransferUmiIx(signer: Signer, destination: PublicKey, lamports: bigint): WrappedInstruction;
12
12
  export declare function closeTokenAccountUmiIx(signer: Signer, tokenAccount: PublicKey, authority: PublicKey): WrappedInstruction;
13
13
  export declare function splTokenTransferUmiIx(signer: Signer, fromTa: PublicKey, toTa: PublicKey, authority: PublicKey, amount: bigint): WrappedInstruction;
14
- export declare function getAdressLookupInputs(umi: Umi, lookupTableAddresses: string[]): Promise<AddressLookupTableInput[]>;
14
+ export declare function getAddressLookupInputs(umi: Umi, lookupTableAddresses: string[]): Promise<AddressLookupTableInput[]>;
15
15
  export declare function assembleFinalTransaction(signer: Signer, tx: TransactionBuilder, computeUnitPrice: number, computeUnitLimit?: number): TransactionBuilder;
16
16
  export declare function getComputeUnitPriceEstimate(umi: Umi, tx: TransactionBuilder, prioritySetting: PriorityFeeSetting): Promise<number | undefined>;
17
17
  export declare function sendSingleOptimizedTransaction(umi: Umi, connection: Connection, tx: TransactionBuilder, txType?: TransactionRunType, attemptNum?: number, prioritySetting?: PriorityFeeSetting, onAwaitingSign?: () => void): Promise<Uint8Array | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../../src/utils/solanaUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,UAAU,EACV,SAAS,EAIT,sBA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1B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAmEjC"}
@@ -13,7 +13,7 @@ exports.createAssociatedTokenAccountUmiIx = createAssociatedTokenAccountUmiIx;
13
13
  exports.systemTransferUmiIx = systemTransferUmiIx;
14
14
  exports.closeTokenAccountUmiIx = closeTokenAccountUmiIx;
15
15
  exports.splTokenTransferUmiIx = splTokenTransferUmiIx;
16
- exports.getAdressLookupInputs = getAdressLookupInputs;
16
+ exports.getAddressLookupInputs = getAddressLookupInputs;
17
17
  exports.assembleFinalTransaction = assembleFinalTransaction;
18
18
  exports.getComputeUnitPriceEstimate = getComputeUnitPriceEstimate;
19
19
  exports.sendSingleOptimizedTransaction = sendSingleOptimizedTransaction;
@@ -71,7 +71,7 @@ function closeTokenAccountUmiIx(signer, tokenAccount, authority) {
71
71
  function splTokenTransferUmiIx(signer, fromTa, toTa, authority, amount) {
72
72
  return getWrappedInstruction(signer, (0, spl_token_1.createTransferInstruction)(fromTa, toTa, authority, amount));
73
73
  }
74
- async function getAdressLookupInputs(umi, lookupTableAddresses) {
74
+ async function getAddressLookupInputs(umi, lookupTableAddresses) {
75
75
  const addressLookupTableAccountInfos = await umi.rpc.getAccounts(lookupTableAddresses.map((key) => (0, umi_1.publicKey)(key)));
76
76
  return addressLookupTableAccountInfos.reduce((acc, accountInfo, index) => {
77
77
  const addressLookupTableAddress = lookupTableAddresses[index];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.224",
3
+ "version": "1.0.225",
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",
@@ -128,9 +128,10 @@ export class ReferralStateManager extends TxHandler {
128
128
  });
129
129
  }
130
130
 
131
- claimReferralFeesIx(destFeesMint?: PublicKey): TransactionBuilder {
132
- const referralFeesDestMint =
133
- destFeesMint ?? toWeb3JsPublicKey(this.referralStateData!.destFeesMint);
131
+ claimReferralFeesIx(): TransactionBuilder {
132
+ const referralFeesDestMint = toWeb3JsPublicKey(
133
+ this.referralStateData!.destFeesMint
134
+ );
134
135
  const referralDestTa = getTokenAccount(
135
136
  this.referralState,
136
137
  referralFeesDestMint
@@ -139,7 +140,7 @@ export class ReferralStateManager extends TxHandler {
139
140
  referralFeesDestMint !== NATIVE_MINT
140
141
  ? publicKey(
141
142
  getTokenAccount(
142
- toWeb3JsPublicKey(this.signer.publicKey),
143
+ this.authority,
143
144
  referralFeesDestMint
144
145
  )
145
146
  )
@@ -7,7 +7,7 @@ import {
7
7
  } from "@metaplex-foundation/umi";
8
8
  import { SolautoClient } from "../clients/solautoClient";
9
9
  import {
10
- getAdressLookupInputs,
10
+ getAddressLookupInputs,
11
11
  sendSingleOptimizedTransaction,
12
12
  } from "../utils/solanaUtils";
13
13
  import {
@@ -37,7 +37,7 @@ class LookupTables {
37
37
  (x) => !currentCacheAddresses.includes(x)
38
38
  );
39
39
  if (missingAddresses) {
40
- const additionalInputs = await getAdressLookupInputs(
40
+ const additionalInputs = await getAddressLookupInputs(
41
41
  this.umi,
42
42
  missingAddresses
43
43
  );
@@ -144,7 +144,7 @@ export function splTokenTransferUmiIx(
144
144
  );
145
145
  }
146
146
 
147
- export async function getAdressLookupInputs(
147
+ export async function getAddressLookupInputs(
148
148
  umi: Umi,
149
149
  lookupTableAddresses: string[]
150
150
  ): Promise<AddressLookupTableInput[]> {