@0dotxyz/p0-ts-sdk 2.3.0-alpha.5 → 2.3.0-alpha.7
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.
- package/dist/index.cjs +212 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -4
- package/dist/index.d.ts +53 -4
- package/dist/index.js +210 -128
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.cts +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/{types-Dw9hSftB.d.cts → types-6ULf9Ciw.d.cts} +203 -203
- package/dist/{types-CZtn4lP8.d.ts → types-BC4kJXuQ.d.ts} +203 -203
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +6 -0
- package/dist/vendor.d.ts +6 -0
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -296,12 +296,11 @@ var MARGINFI_PROGRAM_STAGING_ALT = new PublicKey(
|
|
|
296
296
|
);
|
|
297
297
|
var ADDRESS_LOOKUP_TABLE_FOR_GROUP = {
|
|
298
298
|
"4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8": [
|
|
299
|
-
new PublicKey("
|
|
300
|
-
new PublicKey("
|
|
301
|
-
new PublicKey("
|
|
302
|
-
new PublicKey("qmH8NYYdHkbLYwAdAwnrqiPdBvayjn3DQwRUi9MoXX4")
|
|
299
|
+
new PublicKey("8dk6oxKXC4iMLMa8Q4AVtPJPkEfitZuHSB4JqUsLLV2R"),
|
|
300
|
+
new PublicKey("43xneYSZYLFkaksMcfBMJANibRiKsWgxkPbsrmcYjqF6"),
|
|
301
|
+
new PublicKey("67cS6yqmAy5D1QRJwAXcFv9GLvrMbe88GFGDJcntkL7C")
|
|
303
302
|
],
|
|
304
|
-
// Main pool
|
|
303
|
+
// Main pool — general group
|
|
305
304
|
FCPfpHA69EbS8f9KKSreTRkXbzFpunsKuYf5qNmnJjpo: [
|
|
306
305
|
new PublicKey("9p1CwvXMYNEY9CqSwuWySVXsG37NGb36nua94ea5KsiQ")
|
|
307
306
|
],
|
|
@@ -311,6 +310,13 @@ var ADDRESS_LOOKUP_TABLE_FOR_GROUP = {
|
|
|
311
310
|
]
|
|
312
311
|
// staging
|
|
313
312
|
};
|
|
313
|
+
var ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE = {
|
|
314
|
+
"4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8": [
|
|
315
|
+
new PublicKey("FhVyrX2gfHmxKHq8wWWBJB3ZvHZcAQ6UAcjWxUyfyXuE"),
|
|
316
|
+
new PublicKey("GYEJ3BcgwHfNSL2BAuDcth3KKKt9eiK14EHwLCjU9Eoo")
|
|
317
|
+
]
|
|
318
|
+
// Main pool — native-stake group
|
|
319
|
+
};
|
|
314
320
|
var ADDRESS_LOOKUP_TABLE_FOR_SWAP = new PublicKey(
|
|
315
321
|
"5X5gDr8Bp9BpizTeZ3VJhxMw4z3q2rwoexJvwttmATs5"
|
|
316
322
|
);
|
|
@@ -14879,6 +14885,99 @@ var marginfi_0_1_8_default = {
|
|
|
14879
14885
|
|
|
14880
14886
|
// src/idl/index.ts
|
|
14881
14887
|
var MARGINFI_IDL = marginfi_0_1_8_default;
|
|
14888
|
+
|
|
14889
|
+
// src/services/bank/types/bank.types.ts
|
|
14890
|
+
var RiskTier = /* @__PURE__ */ ((RiskTier3) => {
|
|
14891
|
+
RiskTier3["Collateral"] = "Collateral";
|
|
14892
|
+
RiskTier3["Isolated"] = "Isolated";
|
|
14893
|
+
return RiskTier3;
|
|
14894
|
+
})(RiskTier || {});
|
|
14895
|
+
var OperationalState = /* @__PURE__ */ ((OperationalState3) => {
|
|
14896
|
+
OperationalState3["Paused"] = "Paused";
|
|
14897
|
+
OperationalState3["Operational"] = "Operational";
|
|
14898
|
+
OperationalState3["ReduceOnly"] = "ReduceOnly";
|
|
14899
|
+
OperationalState3["KilledByBankruptcy"] = "KilledByBankruptcy";
|
|
14900
|
+
return OperationalState3;
|
|
14901
|
+
})(OperationalState || {});
|
|
14902
|
+
var OracleSetup = /* @__PURE__ */ ((OracleSetup3) => {
|
|
14903
|
+
OracleSetup3["None"] = "None";
|
|
14904
|
+
OracleSetup3["PythLegacy"] = "PythLegacy";
|
|
14905
|
+
OracleSetup3["SwitchboardV2"] = "SwitchboardV2";
|
|
14906
|
+
OracleSetup3["PythPushOracle"] = "PythPushOracle";
|
|
14907
|
+
OracleSetup3["SwitchboardPull"] = "SwitchboardPull";
|
|
14908
|
+
OracleSetup3["StakedWithPythPush"] = "StakedWithPythPush";
|
|
14909
|
+
OracleSetup3["KaminoPythPush"] = "KaminoPythPush";
|
|
14910
|
+
OracleSetup3["KaminoSwitchboardPull"] = "KaminoSwitchboardPull";
|
|
14911
|
+
OracleSetup3["Fixed"] = "Fixed";
|
|
14912
|
+
OracleSetup3["DriftPythPull"] = "DriftPythPull";
|
|
14913
|
+
OracleSetup3["DriftSwitchboardPull"] = "DriftSwitchboardPull";
|
|
14914
|
+
OracleSetup3["SolendPythPull"] = "SolendPythPull";
|
|
14915
|
+
OracleSetup3["SolendSwitchboardPull"] = "SolendSwitchboardPull";
|
|
14916
|
+
OracleSetup3["FixedKamino"] = "FixedKamino";
|
|
14917
|
+
OracleSetup3["FixedDrift"] = "FixedDrift";
|
|
14918
|
+
OracleSetup3["JuplendPythPull"] = "JuplendPythPull";
|
|
14919
|
+
OracleSetup3["JuplendSwitchboardPull"] = "JuplendSwitchboardPull";
|
|
14920
|
+
OracleSetup3["FixedJuplend"] = "FixedJuplend";
|
|
14921
|
+
return OracleSetup3;
|
|
14922
|
+
})(OracleSetup || {});
|
|
14923
|
+
var AssetTag = /* @__PURE__ */ ((AssetTag3) => {
|
|
14924
|
+
AssetTag3[AssetTag3["DEFAULT"] = 0] = "DEFAULT";
|
|
14925
|
+
AssetTag3[AssetTag3["SOL"] = 1] = "SOL";
|
|
14926
|
+
AssetTag3[AssetTag3["STAKED"] = 2] = "STAKED";
|
|
14927
|
+
AssetTag3[AssetTag3["KAMINO"] = 3] = "KAMINO";
|
|
14928
|
+
AssetTag3[AssetTag3["DRIFT"] = 4] = "DRIFT";
|
|
14929
|
+
AssetTag3[AssetTag3["SOLEND"] = 5] = "SOLEND";
|
|
14930
|
+
AssetTag3[AssetTag3["JUPLEND"] = 6] = "JUPLEND";
|
|
14931
|
+
return AssetTag3;
|
|
14932
|
+
})(AssetTag || {});
|
|
14933
|
+
var BankConfigFlag = /* @__PURE__ */ ((BankConfigFlag3) => {
|
|
14934
|
+
BankConfigFlag3[BankConfigFlag3["PYTH_MIGRATED"] = 1] = "PYTH_MIGRATED";
|
|
14935
|
+
return BankConfigFlag3;
|
|
14936
|
+
})(BankConfigFlag || {});
|
|
14937
|
+
var EmodeEntryFlags = /* @__PURE__ */ ((EmodeEntryFlags2) => {
|
|
14938
|
+
EmodeEntryFlags2[EmodeEntryFlags2["APPLIES_TO_ISOLATED"] = 1] = "APPLIES_TO_ISOLATED";
|
|
14939
|
+
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_1"] = 2] = "RESERVED_1";
|
|
14940
|
+
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_2"] = 4] = "RESERVED_2";
|
|
14941
|
+
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_3"] = 8] = "RESERVED_3";
|
|
14942
|
+
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_4"] = 16] = "RESERVED_4";
|
|
14943
|
+
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_5"] = 32] = "RESERVED_5";
|
|
14944
|
+
return EmodeEntryFlags2;
|
|
14945
|
+
})(EmodeEntryFlags || {});
|
|
14946
|
+
var EmodeFlags = /* @__PURE__ */ ((EmodeFlags3) => {
|
|
14947
|
+
EmodeFlags3[EmodeFlags3["EMODE_ON"] = 1] = "EMODE_ON";
|
|
14948
|
+
EmodeFlags3[EmodeFlags3["RESERVED_1"] = 2] = "RESERVED_1";
|
|
14949
|
+
EmodeFlags3[EmodeFlags3["RESERVED_2"] = 4] = "RESERVED_2";
|
|
14950
|
+
EmodeFlags3[EmodeFlags3["RESERVED_3"] = 8] = "RESERVED_3";
|
|
14951
|
+
return EmodeFlags3;
|
|
14952
|
+
})(EmodeFlags || {});
|
|
14953
|
+
var EmodeTag = /* @__PURE__ */ ((EmodeTag3) => {
|
|
14954
|
+
EmodeTag3[EmodeTag3["UNSET"] = 0] = "UNSET";
|
|
14955
|
+
EmodeTag3[EmodeTag3["SOL"] = 501] = "SOL";
|
|
14956
|
+
EmodeTag3[EmodeTag3["LST_T1"] = 1571] = "LST_T1";
|
|
14957
|
+
EmodeTag3[EmodeTag3["LST_T2"] = 1572] = "LST_T2";
|
|
14958
|
+
EmodeTag3[EmodeTag3["LST_PT"] = 15787] = "LST_PT";
|
|
14959
|
+
EmodeTag3[EmodeTag3["JLP"] = 619] = "JLP";
|
|
14960
|
+
EmodeTag3[EmodeTag3["STABLE_T1"] = 57481] = "STABLE_T1";
|
|
14961
|
+
EmodeTag3[EmodeTag3["STABLE_T2"] = 57482] = "STABLE_T2";
|
|
14962
|
+
EmodeTag3[EmodeTag3["BTC_T1"] = 871] = "BTC_T1";
|
|
14963
|
+
EmodeTag3[EmodeTag3["BTC_T2"] = 872] = "BTC_T2";
|
|
14964
|
+
return EmodeTag3;
|
|
14965
|
+
})(EmodeTag || {});
|
|
14966
|
+
var EmodeImpactStatus = /* @__PURE__ */ ((EmodeImpactStatus3) => {
|
|
14967
|
+
EmodeImpactStatus3[EmodeImpactStatus3["ActivateEmode"] = 0] = "ActivateEmode";
|
|
14968
|
+
EmodeImpactStatus3[EmodeImpactStatus3["ExtendEmode"] = 1] = "ExtendEmode";
|
|
14969
|
+
EmodeImpactStatus3[EmodeImpactStatus3["IncreaseEmode"] = 2] = "IncreaseEmode";
|
|
14970
|
+
EmodeImpactStatus3[EmodeImpactStatus3["ReduceEmode"] = 3] = "ReduceEmode";
|
|
14971
|
+
EmodeImpactStatus3[EmodeImpactStatus3["RemoveEmode"] = 4] = "RemoveEmode";
|
|
14972
|
+
EmodeImpactStatus3[EmodeImpactStatus3["InactiveEmode"] = 5] = "InactiveEmode";
|
|
14973
|
+
return EmodeImpactStatus3;
|
|
14974
|
+
})(EmodeImpactStatus || {});
|
|
14975
|
+
var BankVaultType = /* @__PURE__ */ ((BankVaultType2) => {
|
|
14976
|
+
BankVaultType2[BankVaultType2["LiquidityVault"] = 0] = "LiquidityVault";
|
|
14977
|
+
BankVaultType2[BankVaultType2["InsuranceVault"] = 1] = "InsuranceVault";
|
|
14978
|
+
BankVaultType2[BankVaultType2["FeeVault"] = 2] = "FeeVault";
|
|
14979
|
+
return BankVaultType2;
|
|
14980
|
+
})(BankVaultType || {});
|
|
14882
14981
|
function decodeInstruction(idl, encoded) {
|
|
14883
14982
|
const coder = new BorshInstructionCoder(idl);
|
|
14884
14983
|
return coder.decode(encoded, "base58");
|
|
@@ -14991,6 +15090,37 @@ function getTotalAccountKeys(tx) {
|
|
|
14991
15090
|
}
|
|
14992
15091
|
|
|
14993
15092
|
// src/services/transaction/helpers/tx-formatting.ts
|
|
15093
|
+
var NATIVE_STAKE_LUT_KEYS = new Set(
|
|
15094
|
+
Object.values(ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE).flat().map((key) => key.toBase58())
|
|
15095
|
+
);
|
|
15096
|
+
function selectLutsForBanks(luts, banks) {
|
|
15097
|
+
const nativeStakeLuts = luts.filter(
|
|
15098
|
+
(lut) => NATIVE_STAKE_LUT_KEYS.has(lut.key.toBase58())
|
|
15099
|
+
);
|
|
15100
|
+
const generalLuts = luts.filter(
|
|
15101
|
+
(lut) => !NATIVE_STAKE_LUT_KEYS.has(lut.key.toBase58())
|
|
15102
|
+
);
|
|
15103
|
+
const allStakedOrSol = banks.length > 0 && banks.every(
|
|
15104
|
+
(bank) => bank.config.assetTag === 2 /* STAKED */ || bank.config.assetTag === 1 /* SOL */
|
|
15105
|
+
);
|
|
15106
|
+
if (allStakedOrSol && nativeStakeLuts.length > 0) {
|
|
15107
|
+
return nativeStakeLuts;
|
|
15108
|
+
}
|
|
15109
|
+
return generalLuts.length > 0 ? generalLuts : luts;
|
|
15110
|
+
}
|
|
15111
|
+
function selectLutsForAccountAction(luts, targetBank, balances, bankMap, extraBankAddresses = []) {
|
|
15112
|
+
const banks = [targetBank];
|
|
15113
|
+
for (const balance of balances) {
|
|
15114
|
+
if (!balance.active) continue;
|
|
15115
|
+
const bank = bankMap.get(balance.bankPk.toBase58());
|
|
15116
|
+
if (bank) banks.push(bank);
|
|
15117
|
+
}
|
|
15118
|
+
for (const address of extraBankAddresses) {
|
|
15119
|
+
const bank = bankMap.get(address.toBase58());
|
|
15120
|
+
if (bank) banks.push(bank);
|
|
15121
|
+
}
|
|
15122
|
+
return selectLutsForBanks(luts, banks);
|
|
15123
|
+
}
|
|
14994
15124
|
function isV0Tx(tx) {
|
|
14995
15125
|
return "message" in tx;
|
|
14996
15126
|
}
|
|
@@ -15701,101 +15831,6 @@ var instructions = {
|
|
|
15701
15831
|
makePulseHealthIx
|
|
15702
15832
|
};
|
|
15703
15833
|
var instructions_default = instructions;
|
|
15704
|
-
|
|
15705
|
-
// src/services/bank/types/bank.types.ts
|
|
15706
|
-
var RiskTier = /* @__PURE__ */ ((RiskTier3) => {
|
|
15707
|
-
RiskTier3["Collateral"] = "Collateral";
|
|
15708
|
-
RiskTier3["Isolated"] = "Isolated";
|
|
15709
|
-
return RiskTier3;
|
|
15710
|
-
})(RiskTier || {});
|
|
15711
|
-
var OperationalState = /* @__PURE__ */ ((OperationalState3) => {
|
|
15712
|
-
OperationalState3["Paused"] = "Paused";
|
|
15713
|
-
OperationalState3["Operational"] = "Operational";
|
|
15714
|
-
OperationalState3["ReduceOnly"] = "ReduceOnly";
|
|
15715
|
-
OperationalState3["KilledByBankruptcy"] = "KilledByBankruptcy";
|
|
15716
|
-
return OperationalState3;
|
|
15717
|
-
})(OperationalState || {});
|
|
15718
|
-
var OracleSetup = /* @__PURE__ */ ((OracleSetup3) => {
|
|
15719
|
-
OracleSetup3["None"] = "None";
|
|
15720
|
-
OracleSetup3["PythLegacy"] = "PythLegacy";
|
|
15721
|
-
OracleSetup3["SwitchboardV2"] = "SwitchboardV2";
|
|
15722
|
-
OracleSetup3["PythPushOracle"] = "PythPushOracle";
|
|
15723
|
-
OracleSetup3["SwitchboardPull"] = "SwitchboardPull";
|
|
15724
|
-
OracleSetup3["StakedWithPythPush"] = "StakedWithPythPush";
|
|
15725
|
-
OracleSetup3["KaminoPythPush"] = "KaminoPythPush";
|
|
15726
|
-
OracleSetup3["KaminoSwitchboardPull"] = "KaminoSwitchboardPull";
|
|
15727
|
-
OracleSetup3["Fixed"] = "Fixed";
|
|
15728
|
-
OracleSetup3["DriftPythPull"] = "DriftPythPull";
|
|
15729
|
-
OracleSetup3["DriftSwitchboardPull"] = "DriftSwitchboardPull";
|
|
15730
|
-
OracleSetup3["SolendPythPull"] = "SolendPythPull";
|
|
15731
|
-
OracleSetup3["SolendSwitchboardPull"] = "SolendSwitchboardPull";
|
|
15732
|
-
OracleSetup3["FixedKamino"] = "FixedKamino";
|
|
15733
|
-
OracleSetup3["FixedDrift"] = "FixedDrift";
|
|
15734
|
-
OracleSetup3["JuplendPythPull"] = "JuplendPythPull";
|
|
15735
|
-
OracleSetup3["JuplendSwitchboardPull"] = "JuplendSwitchboardPull";
|
|
15736
|
-
OracleSetup3["FixedJuplend"] = "FixedJuplend";
|
|
15737
|
-
return OracleSetup3;
|
|
15738
|
-
})(OracleSetup || {});
|
|
15739
|
-
var AssetTag = /* @__PURE__ */ ((AssetTag3) => {
|
|
15740
|
-
AssetTag3[AssetTag3["DEFAULT"] = 0] = "DEFAULT";
|
|
15741
|
-
AssetTag3[AssetTag3["SOL"] = 1] = "SOL";
|
|
15742
|
-
AssetTag3[AssetTag3["STAKED"] = 2] = "STAKED";
|
|
15743
|
-
AssetTag3[AssetTag3["KAMINO"] = 3] = "KAMINO";
|
|
15744
|
-
AssetTag3[AssetTag3["DRIFT"] = 4] = "DRIFT";
|
|
15745
|
-
AssetTag3[AssetTag3["SOLEND"] = 5] = "SOLEND";
|
|
15746
|
-
AssetTag3[AssetTag3["JUPLEND"] = 6] = "JUPLEND";
|
|
15747
|
-
return AssetTag3;
|
|
15748
|
-
})(AssetTag || {});
|
|
15749
|
-
var BankConfigFlag = /* @__PURE__ */ ((BankConfigFlag3) => {
|
|
15750
|
-
BankConfigFlag3[BankConfigFlag3["PYTH_MIGRATED"] = 1] = "PYTH_MIGRATED";
|
|
15751
|
-
return BankConfigFlag3;
|
|
15752
|
-
})(BankConfigFlag || {});
|
|
15753
|
-
var EmodeEntryFlags = /* @__PURE__ */ ((EmodeEntryFlags2) => {
|
|
15754
|
-
EmodeEntryFlags2[EmodeEntryFlags2["APPLIES_TO_ISOLATED"] = 1] = "APPLIES_TO_ISOLATED";
|
|
15755
|
-
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_1"] = 2] = "RESERVED_1";
|
|
15756
|
-
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_2"] = 4] = "RESERVED_2";
|
|
15757
|
-
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_3"] = 8] = "RESERVED_3";
|
|
15758
|
-
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_4"] = 16] = "RESERVED_4";
|
|
15759
|
-
EmodeEntryFlags2[EmodeEntryFlags2["RESERVED_5"] = 32] = "RESERVED_5";
|
|
15760
|
-
return EmodeEntryFlags2;
|
|
15761
|
-
})(EmodeEntryFlags || {});
|
|
15762
|
-
var EmodeFlags = /* @__PURE__ */ ((EmodeFlags3) => {
|
|
15763
|
-
EmodeFlags3[EmodeFlags3["EMODE_ON"] = 1] = "EMODE_ON";
|
|
15764
|
-
EmodeFlags3[EmodeFlags3["RESERVED_1"] = 2] = "RESERVED_1";
|
|
15765
|
-
EmodeFlags3[EmodeFlags3["RESERVED_2"] = 4] = "RESERVED_2";
|
|
15766
|
-
EmodeFlags3[EmodeFlags3["RESERVED_3"] = 8] = "RESERVED_3";
|
|
15767
|
-
return EmodeFlags3;
|
|
15768
|
-
})(EmodeFlags || {});
|
|
15769
|
-
var EmodeTag = /* @__PURE__ */ ((EmodeTag3) => {
|
|
15770
|
-
EmodeTag3[EmodeTag3["UNSET"] = 0] = "UNSET";
|
|
15771
|
-
EmodeTag3[EmodeTag3["SOL"] = 501] = "SOL";
|
|
15772
|
-
EmodeTag3[EmodeTag3["LST_T1"] = 1571] = "LST_T1";
|
|
15773
|
-
EmodeTag3[EmodeTag3["LST_T2"] = 1572] = "LST_T2";
|
|
15774
|
-
EmodeTag3[EmodeTag3["LST_PT"] = 15787] = "LST_PT";
|
|
15775
|
-
EmodeTag3[EmodeTag3["JLP"] = 619] = "JLP";
|
|
15776
|
-
EmodeTag3[EmodeTag3["STABLE_T1"] = 57481] = "STABLE_T1";
|
|
15777
|
-
EmodeTag3[EmodeTag3["STABLE_T2"] = 57482] = "STABLE_T2";
|
|
15778
|
-
EmodeTag3[EmodeTag3["BTC_T1"] = 871] = "BTC_T1";
|
|
15779
|
-
EmodeTag3[EmodeTag3["BTC_T2"] = 872] = "BTC_T2";
|
|
15780
|
-
return EmodeTag3;
|
|
15781
|
-
})(EmodeTag || {});
|
|
15782
|
-
var EmodeImpactStatus = /* @__PURE__ */ ((EmodeImpactStatus3) => {
|
|
15783
|
-
EmodeImpactStatus3[EmodeImpactStatus3["ActivateEmode"] = 0] = "ActivateEmode";
|
|
15784
|
-
EmodeImpactStatus3[EmodeImpactStatus3["ExtendEmode"] = 1] = "ExtendEmode";
|
|
15785
|
-
EmodeImpactStatus3[EmodeImpactStatus3["IncreaseEmode"] = 2] = "IncreaseEmode";
|
|
15786
|
-
EmodeImpactStatus3[EmodeImpactStatus3["ReduceEmode"] = 3] = "ReduceEmode";
|
|
15787
|
-
EmodeImpactStatus3[EmodeImpactStatus3["RemoveEmode"] = 4] = "RemoveEmode";
|
|
15788
|
-
EmodeImpactStatus3[EmodeImpactStatus3["InactiveEmode"] = 5] = "InactiveEmode";
|
|
15789
|
-
return EmodeImpactStatus3;
|
|
15790
|
-
})(EmodeImpactStatus || {});
|
|
15791
|
-
var BankVaultType = /* @__PURE__ */ ((BankVaultType2) => {
|
|
15792
|
-
BankVaultType2[BankVaultType2["LiquidityVault"] = 0] = "LiquidityVault";
|
|
15793
|
-
BankVaultType2[BankVaultType2["InsuranceVault"] = 1] = "InsuranceVault";
|
|
15794
|
-
BankVaultType2[BankVaultType2["FeeVault"] = 2] = "FeeVault";
|
|
15795
|
-
return BankVaultType2;
|
|
15796
|
-
})(BankVaultType || {});
|
|
15797
|
-
|
|
15798
|
-
// src/services/bank/utils/serialize.utils.ts
|
|
15799
15834
|
function serializeBankConfigOpt(bankConfigOpt) {
|
|
15800
15835
|
const toWrappedI80F48 = (value) => value && bigNumberToWrappedI80F48(value);
|
|
15801
15836
|
const toBN = (value) => value && new BN11(value.toString());
|
|
@@ -59166,6 +59201,12 @@ async function makeDriftWithdrawIx3({
|
|
|
59166
59201
|
}
|
|
59167
59202
|
async function makeDriftWithdrawTx(params) {
|
|
59168
59203
|
const { luts, connection, ...withdrawIxParams } = params;
|
|
59204
|
+
const selectedLuts = selectLutsForAccountAction(
|
|
59205
|
+
luts,
|
|
59206
|
+
withdrawIxParams.bank,
|
|
59207
|
+
params.marginfiAccount.balances,
|
|
59208
|
+
params.bankMap
|
|
59209
|
+
);
|
|
59169
59210
|
const hasLiabilities = params.marginfiAccount.balances.some((balance) => {
|
|
59170
59211
|
return balance.liabilityShares.gt(0);
|
|
59171
59212
|
});
|
|
@@ -59236,7 +59277,7 @@ async function makeDriftWithdrawTx(params) {
|
|
|
59236
59277
|
],
|
|
59237
59278
|
payerKey: params.authority,
|
|
59238
59279
|
recentBlockhash: blockhash
|
|
59239
|
-
}).compileToV0Message(
|
|
59280
|
+
}).compileToV0Message(selectedLuts)
|
|
59240
59281
|
),
|
|
59241
59282
|
{
|
|
59242
59283
|
signers: [
|
|
@@ -59245,7 +59286,7 @@ async function makeDriftWithdrawTx(params) {
|
|
|
59245
59286
|
...updateJupLendRateIxs.keys,
|
|
59246
59287
|
...withdrawIxs.keys
|
|
59247
59288
|
],
|
|
59248
|
-
addressLookupTables:
|
|
59289
|
+
addressLookupTables: selectedLuts,
|
|
59249
59290
|
type: "WITHDRAW" /* WITHDRAW */
|
|
59250
59291
|
}
|
|
59251
59292
|
);
|
|
@@ -59450,6 +59491,12 @@ async function makeWithdrawIx3({
|
|
|
59450
59491
|
}
|
|
59451
59492
|
async function makeWithdrawTx(params) {
|
|
59452
59493
|
const { luts, connection, ...withdrawIxParams } = params;
|
|
59494
|
+
const selectedLuts = selectLutsForAccountAction(
|
|
59495
|
+
luts,
|
|
59496
|
+
withdrawIxParams.bank,
|
|
59497
|
+
params.marginfiAccount.balances,
|
|
59498
|
+
params.bankMap
|
|
59499
|
+
);
|
|
59453
59500
|
const hasLiabilities = params.marginfiAccount.balances.some((balance) => {
|
|
59454
59501
|
return balance.liabilityShares.gt(0);
|
|
59455
59502
|
});
|
|
@@ -59520,7 +59567,7 @@ async function makeWithdrawTx(params) {
|
|
|
59520
59567
|
],
|
|
59521
59568
|
payerKey: params.authority,
|
|
59522
59569
|
recentBlockhash: blockhash
|
|
59523
|
-
}).compileToV0Message(
|
|
59570
|
+
}).compileToV0Message(selectedLuts)
|
|
59524
59571
|
),
|
|
59525
59572
|
{
|
|
59526
59573
|
signers: [
|
|
@@ -59529,7 +59576,7 @@ async function makeWithdrawTx(params) {
|
|
|
59529
59576
|
...updateJupLendRateIxs.keys,
|
|
59530
59577
|
...withdrawIxs.keys
|
|
59531
59578
|
],
|
|
59532
|
-
addressLookupTables:
|
|
59579
|
+
addressLookupTables: selectedLuts,
|
|
59533
59580
|
type: "WITHDRAW" /* WITHDRAW */
|
|
59534
59581
|
}
|
|
59535
59582
|
);
|
|
@@ -59538,6 +59585,12 @@ async function makeWithdrawTx(params) {
|
|
|
59538
59585
|
}
|
|
59539
59586
|
async function makeKaminoWithdrawTx(params) {
|
|
59540
59587
|
const { luts, connection, amount, assetShareValueMultiplierByBank, ...withdrawIxParams } = params;
|
|
59588
|
+
const selectedLuts = selectLutsForAccountAction(
|
|
59589
|
+
luts,
|
|
59590
|
+
withdrawIxParams.bank,
|
|
59591
|
+
params.marginfiAccount.balances,
|
|
59592
|
+
params.bankMap
|
|
59593
|
+
);
|
|
59541
59594
|
if (!withdrawIxParams.bank.kaminoIntegrationAccounts) {
|
|
59542
59595
|
throw new Error("Bank has no kamino integration accounts");
|
|
59543
59596
|
}
|
|
@@ -59608,7 +59661,7 @@ async function makeKaminoWithdrawTx(params) {
|
|
|
59608
59661
|
],
|
|
59609
59662
|
payerKey: params.authority,
|
|
59610
59663
|
recentBlockhash: blockhash
|
|
59611
|
-
}).compileToV0Message(
|
|
59664
|
+
}).compileToV0Message(selectedLuts)
|
|
59612
59665
|
),
|
|
59613
59666
|
{
|
|
59614
59667
|
signers: [
|
|
@@ -59617,7 +59670,7 @@ async function makeKaminoWithdrawTx(params) {
|
|
|
59617
59670
|
...updateJupLendRateIxs.keys,
|
|
59618
59671
|
...withdrawIxs.keys
|
|
59619
59672
|
],
|
|
59620
|
-
addressLookupTables:
|
|
59673
|
+
addressLookupTables: selectedLuts,
|
|
59621
59674
|
type: "WITHDRAW" /* WITHDRAW */
|
|
59622
59675
|
}
|
|
59623
59676
|
);
|
|
@@ -59712,6 +59765,12 @@ async function makeJuplendWithdrawIx2({
|
|
|
59712
59765
|
}
|
|
59713
59766
|
async function makeJuplendWithdrawTx(params) {
|
|
59714
59767
|
const { luts, connection, ...withdrawIxParams } = params;
|
|
59768
|
+
const selectedLuts = selectLutsForAccountAction(
|
|
59769
|
+
luts,
|
|
59770
|
+
withdrawIxParams.bank,
|
|
59771
|
+
params.marginfiAccount.balances,
|
|
59772
|
+
params.bankMap
|
|
59773
|
+
);
|
|
59715
59774
|
const hasLiabilities = params.marginfiAccount.balances.some((balance) => {
|
|
59716
59775
|
return balance.liabilityShares.gt(0);
|
|
59717
59776
|
});
|
|
@@ -59782,11 +59841,11 @@ async function makeJuplendWithdrawTx(params) {
|
|
|
59782
59841
|
],
|
|
59783
59842
|
payerKey: params.authority,
|
|
59784
59843
|
recentBlockhash: blockhash
|
|
59785
|
-
}).compileToV0Message(
|
|
59844
|
+
}).compileToV0Message(selectedLuts)
|
|
59786
59845
|
),
|
|
59787
59846
|
{
|
|
59788
59847
|
signers: [...refreshIxs.keys, ...withdrawIxs.keys],
|
|
59789
|
-
addressLookupTables:
|
|
59848
|
+
addressLookupTables: selectedLuts,
|
|
59790
59849
|
type: "WITHDRAW" /* WITHDRAW */
|
|
59791
59850
|
}
|
|
59792
59851
|
);
|
|
@@ -59879,6 +59938,13 @@ async function makeBorrowIx3({
|
|
|
59879
59938
|
}
|
|
59880
59939
|
async function makeBorrowTx(params) {
|
|
59881
59940
|
const { luts, connection, ...borrowIxParams } = params;
|
|
59941
|
+
const selectedLuts = selectLutsForAccountAction(
|
|
59942
|
+
luts,
|
|
59943
|
+
borrowIxParams.bank,
|
|
59944
|
+
params.marginfiAccount.balances,
|
|
59945
|
+
params.bankMap,
|
|
59946
|
+
borrowIxParams.opts?.additionalHealthCheckBanks
|
|
59947
|
+
);
|
|
59882
59948
|
const updateJupLendRateIxs = makeUpdateJupLendRateIxs(
|
|
59883
59949
|
params.marginfiAccount,
|
|
59884
59950
|
params.bankMap,
|
|
@@ -59940,11 +60006,11 @@ async function makeBorrowTx(params) {
|
|
|
59940
60006
|
],
|
|
59941
60007
|
payerKey: params.authority,
|
|
59942
60008
|
recentBlockhash: blockhash
|
|
59943
|
-
}).compileToV0Message(
|
|
60009
|
+
}).compileToV0Message(selectedLuts)
|
|
59944
60010
|
),
|
|
59945
60011
|
{
|
|
59946
60012
|
signers: [...kaminoRefreshIxs.keys, ...borrowIxs.keys],
|
|
59947
|
-
addressLookupTables:
|
|
60013
|
+
addressLookupTables: selectedLuts,
|
|
59948
60014
|
type: "BORROW" /* BORROW */
|
|
59949
60015
|
}
|
|
59950
60016
|
);
|
|
@@ -60026,6 +60092,7 @@ async function makeDriftDepositIx3({
|
|
|
60026
60092
|
}
|
|
60027
60093
|
async function makeDriftDepositTx(params) {
|
|
60028
60094
|
const { luts, connection, amount, ...depositIxParams } = params;
|
|
60095
|
+
const selectedLuts = selectLutsForBanks(luts, [depositIxParams.bank]);
|
|
60029
60096
|
if (!depositIxParams.bank.driftIntegrationAccounts) {
|
|
60030
60097
|
throw new Error("Bank has no drift integration accounts");
|
|
60031
60098
|
}
|
|
@@ -60040,18 +60107,18 @@ async function makeDriftDepositTx(params) {
|
|
|
60040
60107
|
instructions: [...depositIxs.instructions],
|
|
60041
60108
|
payerKey: params.authority,
|
|
60042
60109
|
recentBlockhash: blockhash
|
|
60043
|
-
}).compileToV0Message(
|
|
60110
|
+
}).compileToV0Message(selectedLuts)
|
|
60044
60111
|
),
|
|
60045
60112
|
{
|
|
60046
60113
|
signers: depositIxs.keys,
|
|
60047
|
-
addressLookupTables:
|
|
60114
|
+
addressLookupTables: selectedLuts,
|
|
60048
60115
|
type: "DEPOSIT" /* DEPOSIT */
|
|
60049
60116
|
}
|
|
60050
60117
|
);
|
|
60051
60118
|
const solanaTx = addTransactionMetadata(depositTx, {
|
|
60052
60119
|
type: "DEPOSIT" /* DEPOSIT */,
|
|
60053
60120
|
signers: depositIxs.keys,
|
|
60054
|
-
addressLookupTables:
|
|
60121
|
+
addressLookupTables: selectedLuts
|
|
60055
60122
|
});
|
|
60056
60123
|
return solanaTx;
|
|
60057
60124
|
}
|
|
@@ -60143,6 +60210,7 @@ async function makeKaminoDepositIx3({
|
|
|
60143
60210
|
}
|
|
60144
60211
|
async function makeKaminoDepositTx(params) {
|
|
60145
60212
|
const { luts, connection, amount, ...depositIxParams } = params;
|
|
60213
|
+
const selectedLuts = selectLutsForBanks(luts, [depositIxParams.bank]);
|
|
60146
60214
|
if (!depositIxParams.bank.kaminoIntegrationAccounts) {
|
|
60147
60215
|
throw new Error("Bank has no kamino integration accounts");
|
|
60148
60216
|
}
|
|
@@ -60176,18 +60244,18 @@ async function makeKaminoDepositTx(params) {
|
|
|
60176
60244
|
instructions: [...refreshIxs, ...depositIxs.instructions],
|
|
60177
60245
|
payerKey: params.authority,
|
|
60178
60246
|
recentBlockhash: blockhash
|
|
60179
|
-
}).compileToV0Message(
|
|
60247
|
+
}).compileToV0Message(selectedLuts)
|
|
60180
60248
|
),
|
|
60181
60249
|
{
|
|
60182
60250
|
signers: depositIxs.keys,
|
|
60183
|
-
addressLookupTables:
|
|
60251
|
+
addressLookupTables: selectedLuts,
|
|
60184
60252
|
type: "DEPOSIT" /* DEPOSIT */
|
|
60185
60253
|
}
|
|
60186
60254
|
);
|
|
60187
60255
|
const solanaTx = addTransactionMetadata(depositTx, {
|
|
60188
60256
|
type: "DEPOSIT" /* DEPOSIT */,
|
|
60189
60257
|
signers: depositIxs.keys,
|
|
60190
|
-
addressLookupTables:
|
|
60258
|
+
addressLookupTables: selectedLuts
|
|
60191
60259
|
});
|
|
60192
60260
|
return solanaTx;
|
|
60193
60261
|
}
|
|
@@ -60253,10 +60321,11 @@ async function makeDepositTx(params) {
|
|
|
60253
60321
|
const ixs = await makeDepositIx3(depositIxParams);
|
|
60254
60322
|
const tx = new Transaction().add(...ixs.instructions);
|
|
60255
60323
|
tx.feePayer = params.authority;
|
|
60324
|
+
const selectedLuts = selectLutsForBanks(luts, [depositIxParams.bank]);
|
|
60256
60325
|
const solanaTx = addTransactionMetadata(tx, {
|
|
60257
60326
|
type: "DEPOSIT" /* DEPOSIT */,
|
|
60258
60327
|
signers: ixs.keys,
|
|
60259
|
-
addressLookupTables:
|
|
60328
|
+
addressLookupTables: selectedLuts
|
|
60260
60329
|
});
|
|
60261
60330
|
return solanaTx;
|
|
60262
60331
|
}
|
|
@@ -60328,6 +60397,7 @@ async function makeJuplendDepositIx2({
|
|
|
60328
60397
|
}
|
|
60329
60398
|
async function makeJuplendDepositTx(params) {
|
|
60330
60399
|
const { luts, connection, amount, ...depositIxParams } = params;
|
|
60400
|
+
const selectedLuts = selectLutsForBanks(luts, [depositIxParams.bank]);
|
|
60331
60401
|
if (!depositIxParams.bank.jupLendIntegrationAccounts) {
|
|
60332
60402
|
throw new Error("Bank has no JupLend integration accounts");
|
|
60333
60403
|
}
|
|
@@ -60342,18 +60412,18 @@ async function makeJuplendDepositTx(params) {
|
|
|
60342
60412
|
instructions: [...depositIxs.instructions],
|
|
60343
60413
|
payerKey: params.authority,
|
|
60344
60414
|
recentBlockhash: blockhash
|
|
60345
|
-
}).compileToV0Message(
|
|
60415
|
+
}).compileToV0Message(selectedLuts)
|
|
60346
60416
|
),
|
|
60347
60417
|
{
|
|
60348
60418
|
signers: depositIxs.keys,
|
|
60349
|
-
addressLookupTables:
|
|
60419
|
+
addressLookupTables: selectedLuts,
|
|
60350
60420
|
type: "DEPOSIT" /* DEPOSIT */
|
|
60351
60421
|
}
|
|
60352
60422
|
);
|
|
60353
60423
|
const solanaTx = addTransactionMetadata(depositTx, {
|
|
60354
60424
|
type: "DEPOSIT" /* DEPOSIT */,
|
|
60355
60425
|
signers: depositIxs.keys,
|
|
60356
|
-
addressLookupTables:
|
|
60426
|
+
addressLookupTables: selectedLuts
|
|
60357
60427
|
});
|
|
60358
60428
|
return solanaTx;
|
|
60359
60429
|
}
|
|
@@ -61324,6 +61394,12 @@ async function buildCandidates2(req, apiConfig) {
|
|
|
61324
61394
|
transaction: {
|
|
61325
61395
|
userPublicKey: req.taker.toBytes(),
|
|
61326
61396
|
outputAccount: req.destinationTokenAccount.toBytes(),
|
|
61397
|
+
// Keep a wSOL output wrapped in the destination ATA (the analog of
|
|
61398
|
+
// Jupiter's `wrapAndUnwrapSol: false`). Our flashloan flows consume the
|
|
61399
|
+
// output with a subsequent marginfi ix built with `wrapAndUnwrapSol:
|
|
61400
|
+
// false`, so the wSOL must NOT be unwrapped to native lamports. Ignored
|
|
61401
|
+
// by Titan when the output mint isn't wSOL.
|
|
61402
|
+
outputWsol: true,
|
|
61327
61403
|
titanSwapVersion: 3 /* V3 */,
|
|
61328
61404
|
...fee !== void 0 && feeAccount ? { feeBps: fee, feeAccount: new PublicKey(feeAccount).toBytes() } : {}
|
|
61329
61405
|
},
|
|
@@ -61563,10 +61639,11 @@ async function makeRepayTx(params) {
|
|
|
61563
61639
|
const ixs = await makeRepayIx3(depositIxParams);
|
|
61564
61640
|
const tx = new Transaction().add(...ixs.instructions);
|
|
61565
61641
|
tx.feePayer = params.authority;
|
|
61642
|
+
const selectedLuts = selectLutsForBanks(luts, [depositIxParams.bank]);
|
|
61566
61643
|
const solanaTx = addTransactionMetadata(tx, {
|
|
61567
61644
|
type: "REPAY" /* REPAY */,
|
|
61568
61645
|
signers: ixs.keys,
|
|
61569
|
-
addressLookupTables:
|
|
61646
|
+
addressLookupTables: selectedLuts
|
|
61570
61647
|
});
|
|
61571
61648
|
return solanaTx;
|
|
61572
61649
|
}
|
|
@@ -61703,7 +61780,7 @@ async function buildRepayWithCollatFlashloanTx({
|
|
|
61703
61780
|
const swapNeeded = !repayOpts.repayBank.mint.equals(withdrawOpts.withdrawBank.mint);
|
|
61704
61781
|
let amountToRepay = swapNeeded ? 0 : withdrawOpts.withdrawAmount;
|
|
61705
61782
|
let swapInstructions = [];
|
|
61706
|
-
|
|
61783
|
+
let setupInstructions = [];
|
|
61707
61784
|
let swapLookupTables = [];
|
|
61708
61785
|
let swapQuote;
|
|
61709
61786
|
let sizeConstraintUsed = 0;
|
|
@@ -61916,6 +61993,7 @@ async function buildRepayWithCollatFlashloanTx({
|
|
|
61916
61993
|
);
|
|
61917
61994
|
amountToRepay = outAmount > repayOpts.totalPositionAmount ? repayOpts.totalPositionAmount : outAmountThreshold;
|
|
61918
61995
|
swapInstructions = engineResult.swapInstructions;
|
|
61996
|
+
setupInstructions = engineResult.setupInstructions;
|
|
61919
61997
|
swapLookupTables = engineResult.swapLuts;
|
|
61920
61998
|
swapQuote = engineResult.quoteResponse;
|
|
61921
61999
|
}
|
|
@@ -70003,11 +70081,15 @@ var Project0Client = class _Project0Client {
|
|
|
70003
70081
|
});
|
|
70004
70082
|
}
|
|
70005
70083
|
});
|
|
70006
|
-
const
|
|
70007
|
-
|
|
70008
|
-
|
|
70009
|
-
|
|
70010
|
-
|
|
70084
|
+
const fetchLuts = async (keys) => {
|
|
70085
|
+
if (!keys || keys.length === 0) return [];
|
|
70086
|
+
return (await Promise.all(keys.map((lut) => connection.getAddressLookupTable(lut)))).map((response) => response?.value ?? null).filter((table) => table !== null);
|
|
70087
|
+
};
|
|
70088
|
+
const [generalLuts, nativeStakeLuts] = await Promise.all([
|
|
70089
|
+
fetchLuts(ADDRESS_LOOKUP_TABLE_FOR_GROUP[groupPk.toBase58()]),
|
|
70090
|
+
fetchLuts(ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE[groupPk.toBase58()])
|
|
70091
|
+
]);
|
|
70092
|
+
const addressLookupTables = [...generalLuts, ...nativeStakeLuts];
|
|
70011
70093
|
const bankIntegrationMap = await fetchBankIntegrationMetadata({
|
|
70012
70094
|
connection,
|
|
70013
70095
|
banks: banksArray
|
|
@@ -70115,6 +70197,6 @@ var EmodeSettings = class _EmodeSettings {
|
|
|
70115
70197
|
}
|
|
70116
70198
|
};
|
|
70117
70199
|
|
|
70118
|
-
export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_SWAP, AccountFlags, AccountType, AssetTag, BUNDLE_TX_SIZE, Balance, Bank, BankConfig, BankConfigFlag, BankVaultType, DEFAULT_CROSSBAR_URL, DEFAULT_FALLBACK_CROSSBAR_URL, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, EMPTY_HEALTH_CACHE, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodeSettings, EmodeTag, FLASHLOAN_ENABLED_FLAG, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, HealthCacheSimulationError, HealthCacheStatus, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, LST_MINT, MARGINFI_IDL, MARGINFI_PROGRAM, MARGINFI_PROGRAM_STAGING, MARGINFI_PROGRAM_STAGING_ALT, MARGINFI_SPONSORED_SHARD_ID, MAX_ACCOUNT_LOCKS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, MarginRequirementType, MarginfiAccount, MarginfiAccountWrapper, MarginfiGroup, OperationalState, OracleSetup, PDA_BANK_EMISSIONS_AUTH_SEED, PDA_BANK_EMISSIONS_VAULT_SEED, PDA_BANK_FEE_STATE_SEED, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PDA_MARGINFI_ACCOUNT_SEED, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, PriceBias, Project0Client, RiskTier, SINGLE_POOL_PROGRAM_ID, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, SwapProvider, TRANSFER_ACCOUNT_AUTHORITY_FLAG, TransactionArenaKeyMap, TransactionBuildingError, TransactionBuildingErrorCode, TransactionConfigMap, TransactionType, USDC_DECIMALS, USDC_MINT, WSOL_MINT, ZERO_ORACLE_KEY, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkJupiterFeeAccount, checkMultipleOraclesCrankability, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, compileFlashloanPrecheck, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeAssetUsdValue, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiabilityUsdValue, computeLiquidationPriceForBank, computeLoopingParams, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxLeverage, computeMaxWithdrawForBank, computeNetApy, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeSmartCrank, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeTvl, computeUsdValue, computeUtilizationRate, computeV0TxSize, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, deserializeInstruction, deserializeLut, deserializeSwapEngineRequest, deserializeSwapEngineResult, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchMarginfiAccountAddresses, fetchMarginfiAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleAccountsFromAPI, fetchSwbOracleAccountsFromChain, fetchSwbOracleData, fetchSwbOraclePricesFromAPI, fetchSwbOraclePricesFromCrossbar, findRandomAvailableAccountIndex, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getAssetWeight, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEmodePairs, getExactOutEstimate, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isDepositIx, isFlashloan, isV0Tx, isWeightedPrice, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx3 as makeBeginFlashLoanIx, makeBorrowIx3 as makeBorrowIx, makeBorrowTx, makeBundleTipIx, makeClearEmissionsIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCrankSwbFeedIx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx3 as makeDepositIx, makeDepositTx, makeDriftDepositIx3 as makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx3 as makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx3 as makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx2 as makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx2 as makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx3 as makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx3 as makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePoolAddBankIx3 as makePoolAddBankIx, makePoolConfigureBankIx3 as makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx2 as makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshKaminoBanksIxs, makeRepayIx3 as makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSmartCrankSwbFeedIx, makeSwapCollateralTx, makeSwapDebtTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx3 as makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, patchDepositAmount, resolveAmount, runSwapEngine, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
|
|
70200
|
+
export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE, ADDRESS_LOOKUP_TABLE_FOR_SWAP, AccountFlags, AccountType, AssetTag, BUNDLE_TX_SIZE, Balance, Bank, BankConfig, BankConfigFlag, BankVaultType, DEFAULT_CROSSBAR_URL, DEFAULT_FALLBACK_CROSSBAR_URL, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, EMPTY_HEALTH_CACHE, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodeSettings, EmodeTag, FLASHLOAN_ENABLED_FLAG, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, HealthCacheSimulationError, HealthCacheStatus, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, LST_MINT, MARGINFI_IDL, MARGINFI_PROGRAM, MARGINFI_PROGRAM_STAGING, MARGINFI_PROGRAM_STAGING_ALT, MARGINFI_SPONSORED_SHARD_ID, MAX_ACCOUNT_LOCKS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, MarginRequirementType, MarginfiAccount, MarginfiAccountWrapper, MarginfiGroup, OperationalState, OracleSetup, PDA_BANK_EMISSIONS_AUTH_SEED, PDA_BANK_EMISSIONS_VAULT_SEED, PDA_BANK_FEE_STATE_SEED, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PDA_MARGINFI_ACCOUNT_SEED, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, PriceBias, Project0Client, RiskTier, SINGLE_POOL_PROGRAM_ID, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, SwapProvider, TRANSFER_ACCOUNT_AUTHORITY_FLAG, TransactionArenaKeyMap, TransactionBuildingError, TransactionBuildingErrorCode, TransactionConfigMap, TransactionType, USDC_DECIMALS, USDC_MINT, WSOL_MINT, ZERO_ORACLE_KEY, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkJupiterFeeAccount, checkMultipleOraclesCrankability, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, compileFlashloanPrecheck, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeAssetUsdValue, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiabilityUsdValue, computeLiquidationPriceForBank, computeLoopingParams, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxLeverage, computeMaxWithdrawForBank, computeNetApy, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeSmartCrank, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeTvl, computeUsdValue, computeUtilizationRate, computeV0TxSize, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, deserializeInstruction, deserializeLut, deserializeSwapEngineRequest, deserializeSwapEngineResult, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchMarginfiAccountAddresses, fetchMarginfiAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleAccountsFromAPI, fetchSwbOracleAccountsFromChain, fetchSwbOracleData, fetchSwbOraclePricesFromAPI, fetchSwbOraclePricesFromCrossbar, findRandomAvailableAccountIndex, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getAssetWeight, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEmodePairs, getExactOutEstimate, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isDepositIx, isFlashloan, isV0Tx, isWeightedPrice, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx3 as makeBeginFlashLoanIx, makeBorrowIx3 as makeBorrowIx, makeBorrowTx, makeBundleTipIx, makeClearEmissionsIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCrankSwbFeedIx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx3 as makeDepositIx, makeDepositTx, makeDriftDepositIx3 as makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx3 as makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx3 as makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx2 as makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx2 as makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx3 as makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx3 as makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePoolAddBankIx3 as makePoolAddBankIx, makePoolConfigureBankIx3 as makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx2 as makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshKaminoBanksIxs, makeRepayIx3 as makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSmartCrankSwbFeedIx, makeSwapCollateralTx, makeSwapDebtTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx3 as makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, patchDepositAmount, resolveAmount, runSwapEngine, selectLutsForAccountAction, selectLutsForBanks, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
|
|
70119
70201
|
//# sourceMappingURL=index.js.map
|
|
70120
70202
|
//# sourceMappingURL=index.js.map
|