@haven-fi/solauto-sdk 1.0.224 → 1.0.226
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/referralStateManager.d.ts +1 -1
- package/dist/clients/referralStateManager.d.ts.map +1 -1
- package/dist/clients/referralStateManager.js +3 -3
- package/dist/transactions/transactionsManager.js +1 -1
- package/dist/utils/numberUtils.d.ts.map +1 -1
- package/dist/utils/numberUtils.js +7 -0
- package/dist/utils/solanaUtils.d.ts +1 -1
- package/dist/utils/solanaUtils.d.ts.map +1 -1
- package/dist/utils/solanaUtils.js +2 -2
- package/package.json +1 -1
- package/src/clients/referralStateManager.ts +5 -4
- package/src/transactions/transactionsManager.ts +2 -2
- package/src/utils/numberUtils.ts +8 -0
- package/src/utils/solanaUtils.ts +1 -1
@@ -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(
|
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,C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AAE,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,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(
|
76
|
-
const referralFeesDestMint =
|
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)(
|
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.
|
24
|
+
const additionalInputs = await (0, solanaUtils_1.getAddressLookupInputs)(this.umi, missingAddresses);
|
25
25
|
this.cache.push(...additionalInputs);
|
26
26
|
}
|
27
27
|
return this.cache;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"numberUtils.d.ts","sourceRoot":"","sources":["../../src/utils/numberUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GACtB,MAAM,CAMR;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAqBrD;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAejE;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MA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A2B,EAAE,MAAM,GAAG,SAAS,EAC/C,mBAAmB,EAAE,MAAM,EAC3B,kBAAkB,EAAE,kBAAkB,GACrC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAwCA;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAER;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAKzE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAKvE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAKvE"}
|
@@ -73,6 +73,13 @@ function getSolautoFeesBps(isReferred, targetLiqUtilizationRateBps, positionNetW
|
|
73
73
|
const maxFeeBps = 200; // Fee in basis points for minSize (2%)
|
74
74
|
const minFeeBps = 50; // Fee in basis points for maxSize (0.5%)
|
75
75
|
const k = 1.5;
|
76
|
+
if (targetLiqUtilizationRateBps !== undefined && targetLiqUtilizationRateBps === 0) {
|
77
|
+
return {
|
78
|
+
solauto: 0,
|
79
|
+
referrer: 0,
|
80
|
+
total: 0
|
81
|
+
};
|
82
|
+
}
|
76
83
|
let feeBps = 0;
|
77
84
|
if (targetLiqUtilizationRateBps !== undefined || rebalanceDirection === generated_1.RebalanceDirection.Repay) {
|
78
85
|
feeBps = 25;
|
@@ -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
|
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,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAElE,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,UAErD;AAED,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,UAE3D;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,GACb,CAAC,UAAU,EAAE,GAAG,CAAC,CAInB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,sBAAsB,GACzB,kBAAkB,CAMpB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,kBAAkB,CAOpB;AAED,wBAAgB,wBAAwB,CACtC,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Ae,GAAE,kBAA+C,EAChE,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,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.
|
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
|
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
@@ -128,9 +128,10 @@ export class ReferralStateManager extends TxHandler {
|
|
128
128
|
});
|
129
129
|
}
|
130
130
|
|
131
|
-
claimReferralFeesIx(
|
132
|
-
const referralFeesDestMint =
|
133
|
-
|
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
|
-
|
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
|
-
|
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
|
40
|
+
const additionalInputs = await getAddressLookupInputs(
|
41
41
|
this.umi,
|
42
42
|
missingAddresses
|
43
43
|
);
|
package/src/utils/numberUtils.ts
CHANGED
@@ -103,6 +103,14 @@ export function getSolautoFeesBps(
|
|
103
103
|
const minFeeBps = 50; // Fee in basis points for maxSize (0.5%)
|
104
104
|
const k = 1.5;
|
105
105
|
|
106
|
+
if (targetLiqUtilizationRateBps !== undefined && targetLiqUtilizationRateBps === 0) {
|
107
|
+
return {
|
108
|
+
solauto: 0,
|
109
|
+
referrer: 0,
|
110
|
+
total: 0
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
106
114
|
let feeBps: number = 0;
|
107
115
|
|
108
116
|
if (targetLiqUtilizationRateBps !== undefined || rebalanceDirection === RebalanceDirection.Repay) {
|
package/src/utils/solanaUtils.ts
CHANGED