@haven-fi/solauto-sdk 1.0.113 → 1.0.114
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/solautoMarginfiClient.d.ts.map +1 -1
- package/dist/clients/solautoMarginfiClient.js +3 -0
- package/dist/transactions/transactionsManager.d.ts +5 -5
- package/dist/transactions/transactionsManager.d.ts.map +1 -1
- package/dist/transactions/transactionsManager.js +9 -8
- package/dist/utils/numberUtils.d.ts.map +1 -1
- package/dist/utils/solanaUtils.d.ts.map +1 -1
- package/dist/utils/solanaUtils.js +1 -0
- package/package.json +1 -1
- package/src/clients/solautoMarginfiClient.ts +3 -0
- package/src/transactions/transactionsManager.ts +11 -8
- package/src/utils/numberUtils.ts +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoMarginfiClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoMarginfiClient.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,MAAM,EACN,kBAAkB,EAMnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EACL,kBAAkB,EAElB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,gCAAgC,EAKjC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,eAAe,EAUhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAWnE,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IACrC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,qBAAa,qBAAsB,SAA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e,EAAG,SAAS,CAAC;IAG5B,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,6BAA6B,EAAG,SAAS,CAAC;IAC1C,2BAA2B,CAAC,EAAE,eAAe,CAAC;IAE/C,UAAU,CAAC,IAAI,EAAE,yBAAyB;IAkE1C,8BAA8B;IA0CpC,eAAe,IAAI,SAAS;IAI5B,mBAAmB,IAAI,MAAM,EAAE;IAI/B,gBAAgB,IAAI,SAAS,EAAE;IAU/B,yBAAyB,IAAI,kBAAkB;IAS/C,YAAY,CACV,aAAa,CAAC,EAAE,gCAAgC,EAChD,GAAG,CAAC,EAAE,kBAAkB,GACvB,kBAAkB;IAMrB,OAAO,CAAC,sBAAsB;IA6C9B,OAAO,IAAI,kBAAkB;IAc7B,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB;IAUhE,OAAO,CAAC,6BAA6B;IAmErC,OAAO,CAAC,oCAAoC;IA0D5C,SAAS,CACP,aAAa,EAAE,GAAG,GAAG,GAAG,EACxB,WAAW,EAAE,cAAc,EAC3B,aAAa,EAAE,wBAAwB,EACvC,SAAS,CAAC,EAAE,gBAAgB,EAC5B,2BAA2B,CAAC,EAAE,MAAM,EACpC,WAAW,CAAC,EAAE,MAAM,GACnB,kBAAkB;IA2DrB,WAAW,CACT,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,SAAS,GACjC,kBAAkB;IA2BrB,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,kBAAkB;IAoFlE,iCAAiC,IAAI,kBAAkB;IASjD,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAoBlE"}
|
@@ -413,7 +413,10 @@ class SolautoMarginfiClient extends solautoClient_1.SolautoClient {
|
|
413
413
|
if (state) {
|
414
414
|
return state;
|
415
415
|
}
|
416
|
+
this.log("Live position updates:");
|
417
|
+
this.log(this.livePositionUpdates);
|
416
418
|
const freshState = await (0, marginfiUtils_1.getMarginfiAccountPositionState)(this.umi, this.marginfiAccountPk, this.supplyMint, this.debtMint, this.livePositionUpdates);
|
419
|
+
this.log("Fresh state:");
|
417
420
|
this.log(freshState);
|
418
421
|
return freshState;
|
419
422
|
}
|
@@ -39,11 +39,11 @@ declare class TransactionSet {
|
|
39
39
|
name(): string;
|
40
40
|
}
|
41
41
|
export declare enum TransactionStatus {
|
42
|
-
Skipped =
|
43
|
-
Processing =
|
44
|
-
AwaitingSignature =
|
45
|
-
Queued =
|
46
|
-
Successful =
|
42
|
+
Skipped = 0,
|
43
|
+
Processing = 1,
|
44
|
+
AwaitingSignature = 2,
|
45
|
+
Queued = 3,
|
46
|
+
Successful = 4
|
47
47
|
}
|
48
48
|
export type TransactionManagerStatuses = {
|
49
49
|
name: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,GAAG,EACJ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG7D,cAAM,YAAY;IAGG,WAAW,EAAE,MAAM,EAAE;IAAE,OAAO,CAAC,GAAG;IAFrD,KAAK,EAAE,uBAAuB,EAAE,CAAM;gBAEnB,WAAW,EAAE,MAAM,EAAE,EAAU,GAAG,EAAE,GAAG;IAGpD,YAAY,CAChB,mBAAmB,EAAE,MAAM,EAAE,GAC5B,OAAO,CAAC,uBAAuB,EAAE,CAAC;CAoBtC;AAED,qBAAa,eAAe;IAKjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CACV;QAAE,EAAE,EAAE,kBAAkB,C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112,11 @@ class TransactionSet {
|
|
112
112
|
}
|
113
113
|
var TransactionStatus;
|
114
114
|
(function (TransactionStatus) {
|
115
|
-
TransactionStatus["Skipped"] = "Skipped";
|
116
|
-
TransactionStatus["Processing"] = "Processing";
|
117
|
-
TransactionStatus["AwaitingSignature"] = "
|
118
|
-
TransactionStatus["Queued"] = "Queued";
|
119
|
-
TransactionStatus["Successful"] = "Successful";
|
115
|
+
TransactionStatus[TransactionStatus["Skipped"] = 0] = "Skipped";
|
116
|
+
TransactionStatus[TransactionStatus["Processing"] = 1] = "Processing";
|
117
|
+
TransactionStatus[TransactionStatus["AwaitingSignature"] = 2] = "AwaitingSignature";
|
118
|
+
TransactionStatus[TransactionStatus["Queued"] = 3] = "Queued";
|
119
|
+
TransactionStatus[TransactionStatus["Successful"] = 4] = "Successful";
|
120
120
|
})(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
|
121
121
|
class TransactionsManager {
|
122
122
|
constructor(txHandler, statusCallback, simulateOnly, mustBeAtomic, errorsToThrow) {
|
@@ -193,12 +193,13 @@ class TransactionsManager {
|
|
193
193
|
async clientSend(items, prioritySetting) {
|
194
194
|
const client = this.txHandler;
|
195
195
|
const updateLookupTable = await client.updateLookupTable();
|
196
|
+
const updateLutTxName = "update lookup table";
|
196
197
|
if (updateLookupTable &&
|
197
198
|
updateLookupTable.updateLutTx.getInstructions().length > 0 &&
|
198
199
|
updateLookupTable?.needsToBeIsolated) {
|
199
|
-
this.updateStatus(
|
200
|
-
await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum) => await (0, solanaUtils_1.sendSingleOptimizedTransaction)(this.txHandler.umi, this.txHandler.connection, updateLookupTable.updateLutTx, this.simulateOnly, attemptNum), 3, 150, this.errorsToThrow);
|
201
|
-
this.updateStatus(
|
200
|
+
this.updateStatus(updateLutTxName, TransactionStatus.Processing);
|
201
|
+
await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum) => await (0, solanaUtils_1.sendSingleOptimizedTransaction)(this.txHandler.umi, this.txHandler.connection, updateLookupTable.updateLutTx, this.simulateOnly, attemptNum, prioritySetting, () => this.updateStatus(updateLutTxName, TransactionStatus.AwaitingSignature)), 3, 150, this.errorsToThrow);
|
202
|
+
this.updateStatus(updateLutTxName, TransactionStatus.Successful);
|
202
203
|
}
|
203
204
|
this.lookupTables.defaultLuts = client.defaultLookupTables();
|
204
205
|
for (const item of items) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"numberUtils.d.ts","sourceRoot":"","sources":["../../src/utils/numberUtils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"numberUtils.d.ts","sourceRoot":"","sources":["../../src/utils/numberUtils.ts"],"names":[],"mappings":"AAEA,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,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,2BAA2B,EAAE,MAAM,EACnC,gBAAgB,CAAC,EAAE,MAAM,UAW1B;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,OAAO,EACnB,2BAA2B,EAAE,MAAM,GAAG,SAAS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pB;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,GAAG,EACR,oBAAoB,EAAE,MAAM,EAAE,GAC7B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAkBpC;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,kBAAkB,EACtB,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,CAAC,EAAE,MAAM,sBA4D1B;AAmBD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,kBAAkB,EACtB,eAAe,EAAE,kBAAkB,GAClC,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,kBAAkB,EACtB,YAAY,CAAC,EAAE,OAAO,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,GAAE,kBAA+C,EAChE,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CA0DjC"}
|
@@ -160,6 +160,7 @@ async function sendSingleOptimizedTransaction(umi, connection, tx, simulateOnly,
|
|
160
160
|
console.log("Serialized transaction size: ", tx.getTransactionSize(umi));
|
161
161
|
const feeEstimate = await getComputeUnitPriceEstimate(umi, tx, prioritySetting);
|
162
162
|
console.log("Compute unit price: ", feeEstimate);
|
163
|
+
// TODO: we should only retry simulation if it's not a solauto error
|
163
164
|
const simulationResult = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await simulateTransaction(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(await (await assembleFinalTransaction(umi.identity, tx, feeEstimate, 1400000).setLatestBlockhash(umi)).build(umi))), 3);
|
164
165
|
const computeUnitLimit = Math.round(simulationResult.value.unitsConsumed * 1.1);
|
165
166
|
console.log("Compute unit limit: ", computeUnitLimit);
|
package/package.json
CHANGED
@@ -618,6 +618,8 @@ export class SolautoMarginfiClient extends SolautoClient {
|
|
618
618
|
return state;
|
619
619
|
}
|
620
620
|
|
621
|
+
this.log("Live position updates:");
|
622
|
+
this.log(this.livePositionUpdates);
|
621
623
|
const freshState = await getMarginfiAccountPositionState(
|
622
624
|
this.umi,
|
623
625
|
this.marginfiAccountPk,
|
@@ -625,6 +627,7 @@ export class SolautoMarginfiClient extends SolautoClient {
|
|
625
627
|
this.debtMint,
|
626
628
|
this.livePositionUpdates
|
627
629
|
);
|
630
|
+
this.log("Fresh state:");
|
628
631
|
this.log(freshState);
|
629
632
|
|
630
633
|
return freshState;
|
@@ -165,11 +165,11 @@ class TransactionSet {
|
|
165
165
|
}
|
166
166
|
|
167
167
|
export enum TransactionStatus {
|
168
|
-
Skipped
|
169
|
-
Processing
|
170
|
-
AwaitingSignature
|
171
|
-
Queued
|
172
|
-
Successful
|
168
|
+
Skipped,
|
169
|
+
Processing,
|
170
|
+
AwaitingSignature,
|
171
|
+
Queued,
|
172
|
+
Successful,
|
173
173
|
}
|
174
174
|
|
175
175
|
export type TransactionManagerStatuses = {
|
@@ -269,12 +269,13 @@ export class TransactionsManager {
|
|
269
269
|
const client = this.txHandler as SolautoClient;
|
270
270
|
|
271
271
|
const updateLookupTable = await client.updateLookupTable();
|
272
|
+
const updateLutTxName = "update lookup table";
|
272
273
|
if (
|
273
274
|
updateLookupTable &&
|
274
275
|
updateLookupTable.updateLutTx.getInstructions().length > 0 &&
|
275
276
|
updateLookupTable?.needsToBeIsolated
|
276
277
|
) {
|
277
|
-
this.updateStatus(
|
278
|
+
this.updateStatus(updateLutTxName, TransactionStatus.Processing);
|
278
279
|
await retryWithExponentialBackoff(
|
279
280
|
async (attemptNum) =>
|
280
281
|
await sendSingleOptimizedTransaction(
|
@@ -282,13 +283,15 @@ export class TransactionsManager {
|
|
282
283
|
this.txHandler.connection,
|
283
284
|
updateLookupTable.updateLutTx,
|
284
285
|
this.simulateOnly,
|
285
|
-
attemptNum
|
286
|
+
attemptNum,
|
287
|
+
prioritySetting,
|
288
|
+
() => this.updateStatus(updateLutTxName, TransactionStatus.AwaitingSignature)
|
286
289
|
),
|
287
290
|
3,
|
288
291
|
150,
|
289
292
|
this.errorsToThrow
|
290
293
|
);
|
291
|
-
this.updateStatus(
|
294
|
+
this.updateStatus(updateLutTxName, TransactionStatus.Successful);
|
292
295
|
}
|
293
296
|
|
294
297
|
this.lookupTables.defaultLuts = client.defaultLookupTables();
|