@haven-fi/solauto-sdk 1.0.242 → 1.0.244
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/solautoClient.d.ts.map +1 -1
- package/dist/clients/solautoClient.js +4 -2
- package/dist/transactions/transactionsManager.d.ts.map +1 -1
- package/dist/transactions/transactionsManager.js +1 -3
- package/package.json +1 -1
- package/src/clients/solautoClient.ts +4 -3
- package/src/transactions/transactionsManager.ts +10 -8
@@ -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,EAMnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAEhC,sBAAsB,EAKvB,MAAM,cAAc,CAAC;AAUtB,OAAO,EACL,gBAAgB,EAChB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,8BAAsB,aAAc,SAAQ,oBAAoB;IACvD,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC,SAAS,EAAG,SAAS,CAAC;IACtB,MAAM,EAAG,MAAM,CAAC;IAEhB,U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AEf,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAalE"}
|
@@ -111,6 +111,9 @@ class SolautoClient extends referralStateManager_1.ReferralStateManager {
|
|
111
111
|
this.referralState,
|
112
112
|
...(this.referredBySupplyTa() ? [this.referredBySupplyTa()] : []),
|
113
113
|
...(this.referredByDebtTa() ? [this.referredByDebtTa()] : []),
|
114
|
+
...(this.referredBy && !this.referralStateData?.referredByState
|
115
|
+
? [this.referredBy]
|
116
|
+
: []),
|
114
117
|
];
|
115
118
|
}
|
116
119
|
async fetchExistingAuthorityLutAccounts() {
|
@@ -150,11 +153,10 @@ class SolautoClient extends referralStateManager_1.ReferralStateManager {
|
|
150
153
|
addresses: accountsToAdd,
|
151
154
|
})));
|
152
155
|
}
|
153
|
-
const addingReferredBy = accountsToAdd.length <= 2;
|
154
156
|
if (tx.getInstructions().length > 0) {
|
155
157
|
this.log("Updating authority lookup table...");
|
156
158
|
}
|
157
|
-
return { updateLutTx: tx, needsToBeIsolated:
|
159
|
+
return { updateLutTx: tx, needsToBeIsolated: true };
|
158
160
|
}
|
159
161
|
solautoPositionSettings() {
|
160
162
|
return (this.livePositionUpdates.settings ??
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAI7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAKjB,OAAO,EAA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initialize();
|
252
252
|
}
|
253
|
-
let choresBeforeName;
|
254
253
|
const [choresBefore, choresAfter] = await (0, transactionUtils_1.getTransactionChores)(client, (0, umi_1.transactionBuilder)().add(items
|
255
254
|
.filter((x) => x.tx && x.tx.getInstructions().length > 0)
|
256
255
|
.map((x) => x.tx)));
|
257
256
|
if (updateLookupTable && !updateLookupTable.needsToBeIsolated) {
|
258
257
|
choresBefore.prepend(updateLookupTable.updateLutTx);
|
259
|
-
choresBeforeName = "update lookup table";
|
260
258
|
}
|
261
259
|
if (choresBefore.getInstructions().length > 0) {
|
262
|
-
const chore = new TransactionItem(async () => ({ tx: choresBefore
|
260
|
+
const chore = new TransactionItem(async () => ({ tx: choresBefore }));
|
263
261
|
await chore.initialize();
|
264
262
|
items.unshift(chore);
|
265
263
|
this.txHandler.log("Chores before: ", choresBefore.getInstructions().length);
|
package/package.json
CHANGED
@@ -230,6 +230,9 @@ export abstract class SolautoClient extends ReferralStateManager {
|
|
230
230
|
this.referralState,
|
231
231
|
...(this.referredBySupplyTa() ? [this.referredBySupplyTa()!] : []),
|
232
232
|
...(this.referredByDebtTa() ? [this.referredByDebtTa()!] : []),
|
233
|
+
...(this.referredBy && !this.referralStateData?.referredByState
|
234
|
+
? [this.referredBy]
|
235
|
+
: []),
|
233
236
|
];
|
234
237
|
}
|
235
238
|
|
@@ -290,13 +293,11 @@ export abstract class SolautoClient extends ReferralStateManager {
|
|
290
293
|
);
|
291
294
|
}
|
292
295
|
|
293
|
-
const addingReferredBy = accountsToAdd.length <= 2;
|
294
|
-
|
295
296
|
if (tx.getInstructions().length > 0) {
|
296
297
|
this.log("Updating authority lookup table...");
|
297
298
|
}
|
298
299
|
|
299
|
-
return { updateLutTx: tx, needsToBeIsolated:
|
300
|
+
return { updateLutTx: tx, needsToBeIsolated: true };
|
300
301
|
}
|
301
302
|
|
302
303
|
solautoPositionSettings(): SolautoSettingsParameters | undefined {
|
@@ -372,7 +372,6 @@ export class TransactionsManager {
|
|
372
372
|
await item.initialize();
|
373
373
|
}
|
374
374
|
|
375
|
-
let choresBeforeName: string | undefined;
|
376
375
|
const [choresBefore, choresAfter] = await getTransactionChores(
|
377
376
|
client,
|
378
377
|
transactionBuilder().add(
|
@@ -383,10 +382,9 @@ export class TransactionsManager {
|
|
383
382
|
);
|
384
383
|
if (updateLookupTable && !updateLookupTable.needsToBeIsolated) {
|
385
384
|
choresBefore.prepend(updateLookupTable.updateLutTx);
|
386
|
-
choresBeforeName = "update lookup table";
|
387
385
|
}
|
388
386
|
if (choresBefore.getInstructions().length > 0) {
|
389
|
-
const chore = new TransactionItem(async () => ({ tx: choresBefore
|
387
|
+
const chore = new TransactionItem(async () => ({ tx: choresBefore }));
|
390
388
|
await chore.initialize();
|
391
389
|
items.unshift(chore);
|
392
390
|
this.txHandler.log(
|
@@ -490,7 +488,7 @@ export class TransactionsManager {
|
|
490
488
|
this.updateStatus(
|
491
489
|
itemSet.name(),
|
492
490
|
TransactionStatus.Failed,
|
493
|
-
this.retries
|
491
|
+
this.retries
|
494
492
|
);
|
495
493
|
}
|
496
494
|
throw e;
|
@@ -504,17 +502,21 @@ export class TransactionsManager {
|
|
504
502
|
): Promise<TransactionSet | undefined> {
|
505
503
|
const itemSet = itemSets[currentIndex];
|
506
504
|
await itemSet.refetchAll(attemptNum);
|
507
|
-
|
505
|
+
|
508
506
|
const newItemSets = await this.assembleTransactionSets([
|
509
507
|
...itemSet.items,
|
510
508
|
...itemSets.slice(currentIndex + 1).flatMap((set) => set.items),
|
511
509
|
]);
|
512
|
-
|
510
|
+
|
513
511
|
if (newItemSets.length > 1) {
|
514
|
-
itemSets.splice(
|
512
|
+
itemSets.splice(
|
513
|
+
currentIndex + 1,
|
514
|
+
itemSets.length - currentIndex - 1,
|
515
|
+
...newItemSets.slice(1)
|
516
|
+
);
|
515
517
|
this.updateStatusForSets(newItemSets.slice(1));
|
516
518
|
}
|
517
|
-
|
519
|
+
|
518
520
|
return newItemSets[0];
|
519
521
|
}
|
520
522
|
|