@haven-fi/solauto-sdk 1.0.52 → 1.0.53
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 +1 -7
- package/dist/clients/solautoMarginfiClient.d.ts.map +1 -1
- package/dist/clients/solautoMarginfiClient.js +3 -1
- package/dist/generated/accounts/referralState.d.ts.map +1 -1
- package/dist/generated/accounts/referralState.js +8 -9
- package/dist/generated/accounts/solautoPosition.d.ts.map +1 -1
- package/dist/generated/accounts/solautoPosition.js +8 -9
- package/dist/generated/errors/solauto.js +3 -3
- package/dist/generated/instructions/cancelDCA.js +2 -3
- package/dist/generated/instructions/claimReferralFees.js +2 -3
- package/dist/generated/instructions/closePosition.js +2 -3
- package/dist/generated/instructions/convertReferralFees.js +2 -3
- package/dist/generated/instructions/marginfiOpenPosition.d.ts +1 -0
- package/dist/generated/instructions/marginfiOpenPosition.d.ts.map +1 -1
- package/dist/generated/instructions/marginfiOpenPosition.js +22 -18
- package/dist/generated/instructions/marginfiProtocolInteraction.js +2 -3
- package/dist/generated/instructions/marginfiRebalance.js +2 -3
- package/dist/generated/instructions/marginfiRefreshData.js +2 -3
- package/dist/generated/instructions/updatePosition.js +2 -3
- package/dist/generated/instructions/updateReferralStates.js +2 -3
- package/dist/generated/programs/solauto.d.ts.map +1 -1
- package/dist/generated/programs/solauto.js +4 -4
- package/dist/generated/shared/index.js +4 -5
- package/dist/generated/types/automationSettings.js +1 -2
- package/dist/generated/types/automationSettingsInp.js +1 -2
- package/dist/generated/types/dCASettings.js +1 -2
- package/dist/generated/types/dCASettingsInp.js +1 -2
- package/dist/generated/types/feeType.js +3 -3
- package/dist/generated/types/lendingPlatform.js +3 -3
- package/dist/generated/types/podBool.js +1 -2
- package/dist/generated/types/positionData.js +1 -2
- package/dist/generated/types/positionState.js +1 -2
- package/dist/generated/types/positionTokenUsage.js +1 -2
- package/dist/generated/types/rebalanceData.js +1 -2
- package/dist/generated/types/solautoAction.js +3 -4
- package/dist/generated/types/solautoRebalanceType.js +3 -3
- package/dist/generated/types/solautoSettingsParameters.js +1 -2
- package/dist/generated/types/solautoSettingsParametersInp.js +1 -2
- package/dist/generated/types/tokenAmount.js +1 -2
- package/dist/generated/types/tokenBalanceAmount.js +3 -4
- package/dist/generated/types/updatePositionData.js +1 -2
- package/dist/marginfi-sdk/accounts/bank.d.ts.map +1 -1
- package/dist/marginfi-sdk/accounts/bank.js +8 -9
- package/dist/marginfi-sdk/accounts/marginfiAccount.d.ts.map +1 -1
- package/dist/marginfi-sdk/accounts/marginfiAccount.js +8 -9
- package/dist/marginfi-sdk/accounts/marginfiGroup.d.ts.map +1 -1
- package/dist/marginfi-sdk/accounts/marginfiGroup.js +8 -9
- package/dist/marginfi-sdk/errors/marginfi.js +3 -3
- package/dist/marginfi-sdk/instructions/lendingAccountBorrow.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountCloseBalance.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountDeposit.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountEndFlashloan.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountLiquidate.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountRepay.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountSettleEmissions.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountStartFlashloan.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountWithdraw.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingAccountWithdrawEmissions.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolAccrueBankInterest.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolAddBank.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolAddBankWithSeed.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolCollectBankFees.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolConfigureBank.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolHandleBankruptcy.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolSetupEmissions.js +2 -3
- package/dist/marginfi-sdk/instructions/lendingPoolUpdateEmissionsParameters.js +2 -3
- package/dist/marginfi-sdk/instructions/marginfiAccountInitialize.js +2 -3
- package/dist/marginfi-sdk/instructions/marginfiGroupConfigure.js +2 -3
- package/dist/marginfi-sdk/instructions/marginfiGroupInitialize.js +2 -3
- package/dist/marginfi-sdk/instructions/setAccountFlag.js +2 -3
- package/dist/marginfi-sdk/instructions/setNewAccountAuthority.js +2 -3
- package/dist/marginfi-sdk/instructions/unsetAccountFlag.js +2 -3
- package/dist/marginfi-sdk/programs/marginfi.d.ts.map +1 -1
- package/dist/marginfi-sdk/programs/marginfi.js +4 -4
- package/dist/marginfi-sdk/shared/index.js +4 -5
- package/dist/marginfi-sdk/types/accountEventHeader.js +1 -2
- package/dist/marginfi-sdk/types/balance.js +1 -2
- package/dist/marginfi-sdk/types/balanceDecreaseType.js +3 -3
- package/dist/marginfi-sdk/types/balanceIncreaseType.js +3 -3
- package/dist/marginfi-sdk/types/balanceSide.js +3 -3
- package/dist/marginfi-sdk/types/bankConfig.js +1 -2
- package/dist/marginfi-sdk/types/bankConfigCompact.js +1 -2
- package/dist/marginfi-sdk/types/bankOperationalState.js +3 -3
- package/dist/marginfi-sdk/types/bankVaultType.js +3 -3
- package/dist/marginfi-sdk/types/groupEventHeader.js +1 -2
- package/dist/marginfi-sdk/types/interestRateConfig.js +1 -2
- package/dist/marginfi-sdk/types/interestRateConfigCompact.js +1 -2
- package/dist/marginfi-sdk/types/interestRateConfigOpt.js +1 -2
- package/dist/marginfi-sdk/types/lendingAccount.js +1 -2
- package/dist/marginfi-sdk/types/liquidationBalances.js +1 -2
- package/dist/marginfi-sdk/types/oracleConfig.js +1 -2
- package/dist/marginfi-sdk/types/oraclePriceType.js +3 -3
- package/dist/marginfi-sdk/types/oracleSetup.js +3 -3
- package/dist/marginfi-sdk/types/priceBias.js +3 -3
- package/dist/marginfi-sdk/types/requirementType.js +3 -3
- package/dist/marginfi-sdk/types/riskRequirementType.js +3 -3
- package/dist/marginfi-sdk/types/riskTier.js +3 -3
- package/dist/marginfi-sdk/types/wrappedI80F48.js +1 -2
- package/dist/transactions/transactionUtils.js +4 -5
- package/dist/transactions/transactionsManager.d.ts.map +1 -1
- package/dist/transactions/transactionsManager.js +1 -1
- package/dist/types/solauto.js +1 -1
- package/dist/utils/accountUtils.d.ts +0 -1
- package/dist/utils/accountUtils.d.ts.map +1 -1
- package/dist/utils/accountUtils.js +7 -8
- package/dist/utils/generalUtils.js +8 -9
- package/dist/utils/jupiterUtils.js +1 -2
- package/dist/utils/marginfiUtils.js +5 -6
- package/dist/utils/numberUtils.js +11 -12
- package/dist/utils/solanaUtils.js +13 -14
- package/dist/utils/solauto/generalUtils.js +13 -13
- package/dist/utils/solauto/rebalanceUtils.js +3 -4
- package/package.json +3 -2
- package/src/clients/solautoClient.ts +1 -10
- package/src/clients/solautoMarginfiClient.ts +2 -0
- package/src/generated/instructions/marginfiOpenPosition.ts +21 -15
@@ -7,7 +7,10 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.SOLAUTO_PROGRAM_ID = void 0;
|
11
|
+
exports.createSolautoProgram = createSolautoProgram;
|
12
|
+
exports.getSolautoProgram = getSolautoProgram;
|
13
|
+
exports.getSolautoProgramId = getSolautoProgramId;
|
11
14
|
const errors_1 = require("../errors");
|
12
15
|
exports.SOLAUTO_PROGRAM_ID = 'AutoyKBRaHSBHy9RsmXCZMy6nNFAg5FYijrvZyQcNLV';
|
13
16
|
function createSolautoProgram() {
|
@@ -25,12 +28,9 @@ function createSolautoProgram() {
|
|
25
28
|
},
|
26
29
|
};
|
27
30
|
}
|
28
|
-
exports.createSolautoProgram = createSolautoProgram;
|
29
31
|
function getSolautoProgram(context, clusterFilter) {
|
30
32
|
return context.programs.get('solauto', clusterFilter);
|
31
33
|
}
|
32
|
-
exports.getSolautoProgram = getSolautoProgram;
|
33
34
|
function getSolautoProgramId(context, clusterFilter) {
|
34
35
|
return context.programs.getPublicKey('solauto', exports.SOLAUTO_PROGRAM_ID, clusterFilter);
|
35
36
|
}
|
36
|
-
exports.getSolautoProgramId = getSolautoProgramId;
|
@@ -7,7 +7,10 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.expectSome = expectSome;
|
11
|
+
exports.expectPublicKey = expectPublicKey;
|
12
|
+
exports.expectPda = expectPda;
|
13
|
+
exports.getAccountMetasAndSigners = getAccountMetasAndSigners;
|
11
14
|
const umi_1 = require("@metaplex-foundation/umi");
|
12
15
|
/**
|
13
16
|
* Asserts that the given value is not null or undefined.
|
@@ -19,7 +22,6 @@ function expectSome(value) {
|
|
19
22
|
}
|
20
23
|
return value;
|
21
24
|
}
|
22
|
-
exports.expectSome = expectSome;
|
23
25
|
/**
|
24
26
|
* Asserts that the given value is a PublicKey.
|
25
27
|
* @internal
|
@@ -30,7 +32,6 @@ function expectPublicKey(value) {
|
|
30
32
|
}
|
31
33
|
return (0, umi_1.publicKey)(value, false);
|
32
34
|
}
|
33
|
-
exports.expectPublicKey = expectPublicKey;
|
34
35
|
/**
|
35
36
|
* Asserts that the given value is a PDA.
|
36
37
|
* @internal
|
@@ -41,7 +42,6 @@ function expectPda(value) {
|
|
41
42
|
}
|
42
43
|
return value;
|
43
44
|
}
|
44
|
-
exports.expectPda = expectPda;
|
45
45
|
/**
|
46
46
|
* Get account metas and signers from resolved accounts.
|
47
47
|
* @internal
|
@@ -67,4 +67,3 @@ function getAccountMetasAndSigners(accounts, optionalAccountStrategy, programId)
|
|
67
67
|
});
|
68
68
|
return [keys, signers];
|
69
69
|
}
|
70
|
-
exports.getAccountMetasAndSigners = getAccountMetasAndSigners;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getAutomationSettingsSerializer =
|
10
|
+
exports.getAutomationSettingsSerializer = getAutomationSettingsSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
function getAutomationSettingsSerializer() {
|
13
13
|
return (0, serializers_1.struct)([
|
@@ -19,4 +19,3 @@ function getAutomationSettingsSerializer() {
|
|
19
19
|
['padding', (0, serializers_1.bytes)({ size: 32 })],
|
20
20
|
], { description: 'AutomationSettings' });
|
21
21
|
}
|
22
|
-
exports.getAutomationSettingsSerializer = getAutomationSettingsSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getAutomationSettingsInpSerializer =
|
10
|
+
exports.getAutomationSettingsInpSerializer = getAutomationSettingsInpSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
function getAutomationSettingsInpSerializer() {
|
13
13
|
return (0, serializers_1.struct)([
|
@@ -17,4 +17,3 @@ function getAutomationSettingsInpSerializer() {
|
|
17
17
|
['intervalSeconds', (0, serializers_1.u64)()],
|
18
18
|
], { description: 'AutomationSettingsInp' });
|
19
19
|
}
|
20
|
-
exports.getAutomationSettingsInpSerializer = getAutomationSettingsInpSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getDCASettingsSerializer =
|
10
|
+
exports.getDCASettingsSerializer = getDCASettingsSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getDCASettingsSerializer() {
|
@@ -17,4 +17,3 @@ function getDCASettingsSerializer() {
|
|
17
17
|
['padding', (0, serializers_1.bytes)({ size: 32 })],
|
18
18
|
], { description: 'DCASettings' });
|
19
19
|
}
|
20
|
-
exports.getDCASettingsSerializer = getDCASettingsSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getDCASettingsInpSerializer =
|
10
|
+
exports.getDCASettingsInpSerializer = getDCASettingsInpSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getDCASettingsInpSerializer() {
|
@@ -16,4 +16,3 @@ function getDCASettingsInpSerializer() {
|
|
16
16
|
['debtToAddBaseUnit', (0, serializers_1.u64)()],
|
17
17
|
], { description: 'DCASettingsInp' });
|
18
18
|
}
|
19
|
-
exports.getDCASettingsInpSerializer = getDCASettingsInpSerializer;
|
@@ -7,14 +7,14 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.FeeType = void 0;
|
11
|
+
exports.getFeeTypeSerializer = getFeeTypeSerializer;
|
11
12
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
13
|
var FeeType;
|
13
14
|
(function (FeeType) {
|
14
15
|
FeeType[FeeType["Small"] = 0] = "Small";
|
15
16
|
FeeType[FeeType["Default"] = 1] = "Default";
|
16
|
-
})(FeeType
|
17
|
+
})(FeeType || (exports.FeeType = FeeType = {}));
|
17
18
|
function getFeeTypeSerializer() {
|
18
19
|
return (0, serializers_1.scalarEnum)(FeeType, { description: 'FeeType' });
|
19
20
|
}
|
20
|
-
exports.getFeeTypeSerializer = getFeeTypeSerializer;
|
@@ -7,16 +7,16 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.LendingPlatform = void 0;
|
11
|
+
exports.getLendingPlatformSerializer = getLendingPlatformSerializer;
|
11
12
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
13
|
var LendingPlatform;
|
13
14
|
(function (LendingPlatform) {
|
14
15
|
LendingPlatform[LendingPlatform["Marginfi"] = 0] = "Marginfi";
|
15
16
|
LendingPlatform[LendingPlatform["Kamino"] = 1] = "Kamino";
|
16
|
-
})(LendingPlatform
|
17
|
+
})(LendingPlatform || (exports.LendingPlatform = LendingPlatform = {}));
|
17
18
|
function getLendingPlatformSerializer() {
|
18
19
|
return (0, serializers_1.scalarEnum)(LendingPlatform, {
|
19
20
|
description: 'LendingPlatform',
|
20
21
|
});
|
21
22
|
}
|
22
|
-
exports.getLendingPlatformSerializer = getLendingPlatformSerializer;
|
@@ -7,11 +7,10 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getPodBoolSerializer =
|
10
|
+
exports.getPodBoolSerializer = getPodBoolSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
function getPodBoolSerializer() {
|
13
13
|
return (0, serializers_1.struct)([['val', (0, serializers_1.bool)()]], {
|
14
14
|
description: 'PodBool',
|
15
15
|
});
|
16
16
|
}
|
17
|
-
exports.getPodBoolSerializer = getPodBoolSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getPositionDataSerializer =
|
10
|
+
exports.getPositionDataSerializer = getPositionDataSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getPositionDataSerializer() {
|
@@ -22,4 +22,3 @@ function getPositionDataSerializer() {
|
|
22
22
|
['padding', (0, serializers_1.array)((0, serializers_1.u32)(), { size: 4 })],
|
23
23
|
], { description: 'PositionData' });
|
24
24
|
}
|
25
|
-
exports.getPositionDataSerializer = getPositionDataSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getPositionStateSerializer =
|
10
|
+
exports.getPositionStateSerializer = getPositionStateSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getPositionStateSerializer() {
|
@@ -24,4 +24,3 @@ function getPositionStateSerializer() {
|
|
24
24
|
['padding', (0, serializers_1.array)((0, serializers_1.u32)(), { size: 2 })],
|
25
25
|
], { description: 'PositionState' });
|
26
26
|
}
|
27
|
-
exports.getPositionStateSerializer = getPositionStateSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getPositionTokenUsageSerializer =
|
10
|
+
exports.getPositionTokenUsageSerializer = getPositionTokenUsageSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getPositionTokenUsageSerializer() {
|
@@ -24,4 +24,3 @@ function getPositionTokenUsageSerializer() {
|
|
24
24
|
['padding', (0, serializers_1.bytes)({ size: 32 })],
|
25
25
|
], { description: 'PositionTokenUsage' });
|
26
26
|
}
|
27
|
-
exports.getPositionTokenUsageSerializer = getPositionTokenUsageSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getRebalanceDataSerializer =
|
10
|
+
exports.getRebalanceDataSerializer = getRebalanceDataSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getRebalanceDataSerializer() {
|
@@ -21,4 +21,3 @@ function getRebalanceDataSerializer() {
|
|
21
21
|
['padding', (0, serializers_1.bytes)({ size: 32 })],
|
22
22
|
], { description: 'RebalanceData' });
|
23
23
|
}
|
24
|
-
exports.getRebalanceDataSerializer = getRebalanceDataSerializer;
|
@@ -7,7 +7,9 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.getSolautoActionSerializer = getSolautoActionSerializer;
|
11
|
+
exports.solautoAction = solautoAction;
|
12
|
+
exports.isSolautoAction = isSolautoAction;
|
11
13
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
14
|
const _1 = require(".");
|
13
15
|
function getSolautoActionSerializer() {
|
@@ -38,14 +40,11 @@ function getSolautoActionSerializer() {
|
|
38
40
|
],
|
39
41
|
], { description: 'SolautoAction' });
|
40
42
|
}
|
41
|
-
exports.getSolautoActionSerializer = getSolautoActionSerializer;
|
42
43
|
function solautoAction(kind, data) {
|
43
44
|
return Array.isArray(data)
|
44
45
|
? { __kind: kind, fields: data }
|
45
46
|
: { __kind: kind, ...(data ?? {}) };
|
46
47
|
}
|
47
|
-
exports.solautoAction = solautoAction;
|
48
48
|
function isSolautoAction(kind, value) {
|
49
49
|
return value.__kind === kind;
|
50
50
|
}
|
51
|
-
exports.isSolautoAction = isSolautoAction;
|
@@ -7,7 +7,8 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.SolautoRebalanceType = void 0;
|
11
|
+
exports.getSolautoRebalanceTypeSerializer = getSolautoRebalanceTypeSerializer;
|
11
12
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
13
|
var SolautoRebalanceType;
|
13
14
|
(function (SolautoRebalanceType) {
|
@@ -15,10 +16,9 @@ var SolautoRebalanceType;
|
|
15
16
|
SolautoRebalanceType[SolautoRebalanceType["Regular"] = 1] = "Regular";
|
16
17
|
SolautoRebalanceType[SolautoRebalanceType["DoubleRebalanceWithFL"] = 2] = "DoubleRebalanceWithFL";
|
17
18
|
SolautoRebalanceType[SolautoRebalanceType["SingleRebalanceWithFL"] = 3] = "SingleRebalanceWithFL";
|
18
|
-
})(SolautoRebalanceType
|
19
|
+
})(SolautoRebalanceType || (exports.SolautoRebalanceType = SolautoRebalanceType = {}));
|
19
20
|
function getSolautoRebalanceTypeSerializer() {
|
20
21
|
return (0, serializers_1.scalarEnum)(SolautoRebalanceType, {
|
21
22
|
description: 'SolautoRebalanceType',
|
22
23
|
});
|
23
24
|
}
|
24
|
-
exports.getSolautoRebalanceTypeSerializer = getSolautoRebalanceTypeSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getSolautoSettingsParametersSerializer =
|
10
|
+
exports.getSolautoSettingsParametersSerializer = getSolautoSettingsParametersSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getSolautoSettingsParametersSerializer() {
|
@@ -22,4 +22,3 @@ function getSolautoSettingsParametersSerializer() {
|
|
22
22
|
['padding', (0, serializers_1.bytes)({ size: 32 })],
|
23
23
|
], { description: 'SolautoSettingsParameters' });
|
24
24
|
}
|
25
|
-
exports.getSolautoSettingsParametersSerializer = getSolautoSettingsParametersSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getSolautoSettingsParametersInpSerializer =
|
10
|
+
exports.getSolautoSettingsParametersInpSerializer = getSolautoSettingsParametersInpSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getSolautoSettingsParametersInpSerializer() {
|
@@ -20,4 +20,3 @@ function getSolautoSettingsParametersInpSerializer() {
|
|
20
20
|
['automation', (0, serializers_1.option)((0, _1.getAutomationSettingsInpSerializer)())],
|
21
21
|
], { description: 'SolautoSettingsParametersInp' });
|
22
22
|
}
|
23
|
-
exports.getSolautoSettingsParametersInpSerializer = getSolautoSettingsParametersInpSerializer;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getTokenAmountSerializer =
|
10
|
+
exports.getTokenAmountSerializer = getTokenAmountSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
function getTokenAmountSerializer() {
|
13
13
|
return (0, serializers_1.struct)([
|
@@ -15,4 +15,3 @@ function getTokenAmountSerializer() {
|
|
15
15
|
['baseAmountUsdValue', (0, serializers_1.u64)()],
|
16
16
|
], { description: 'TokenAmount' });
|
17
17
|
}
|
18
|
-
exports.getTokenAmountSerializer = getTokenAmountSerializer;
|
@@ -7,7 +7,9 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.getTokenBalanceAmountSerializer = getTokenBalanceAmountSerializer;
|
11
|
+
exports.tokenBalanceAmount = tokenBalanceAmount;
|
12
|
+
exports.isTokenBalanceAmount = isTokenBalanceAmount;
|
11
13
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
14
|
function getTokenBalanceAmountSerializer() {
|
13
15
|
return (0, serializers_1.dataEnum)([
|
@@ -20,14 +22,11 @@ function getTokenBalanceAmountSerializer() {
|
|
20
22
|
['All', (0, serializers_1.unit)()],
|
21
23
|
], { description: 'TokenBalanceAmount' });
|
22
24
|
}
|
23
|
-
exports.getTokenBalanceAmountSerializer = getTokenBalanceAmountSerializer;
|
24
25
|
function tokenBalanceAmount(kind, data) {
|
25
26
|
return Array.isArray(data)
|
26
27
|
? { __kind: kind, fields: data }
|
27
28
|
: { __kind: kind, ...(data ?? {}) };
|
28
29
|
}
|
29
|
-
exports.tokenBalanceAmount = tokenBalanceAmount;
|
30
30
|
function isTokenBalanceAmount(kind, value) {
|
31
31
|
return value.__kind === kind;
|
32
32
|
}
|
33
|
-
exports.isTokenBalanceAmount = isTokenBalanceAmount;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.getUpdatePositionDataSerializer =
|
10
|
+
exports.getUpdatePositionDataSerializer = getUpdatePositionDataSerializer;
|
11
11
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
12
12
|
const _1 = require(".");
|
13
13
|
function getUpdatePositionDataSerializer() {
|
@@ -17,4 +17,3 @@ function getUpdatePositionDataSerializer() {
|
|
17
17
|
['dca', (0, serializers_1.option)((0, _1.getDCASettingsInpSerializer)())],
|
18
18
|
], { description: 'UpdatePositionData' });
|
19
19
|
}
|
20
|
-
exports.getUpdatePositionDataSerializer = getUpdatePositionDataSerializer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bank.d.ts","sourceRoot":"","sources":["../../../src/marginfi-sdk/accounts/bank.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,OAAO,EACP,GAAG,EACH,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EAKtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UA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M;iCACG,MAAM;kBACrB,KAAK,CAAC,MAAM,CAAC;uCACQ,iBAAiB;cAC1C,SAAS;kBACL,MAAM;2BACG,MAAM;kBACf,KAAK,CAAC,MAAM,CAAC;mCACI,iBAAiB;0BAC1B,iBAAiB;sBACrB,iBAAiB;gBACvB,MAAM,GAAG,MAAM;YACnB,cAAc;oBACN,MAAM,GAAG,MAAM;mBAChB,MAAM,GAAG,MAAM;wBACV,iBAAiB;mBACtB,SAAS;cACd,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;cACtB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;GAmCrC;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|
@@ -7,7 +7,14 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.getBankAccountDataSerializer = getBankAccountDataSerializer;
|
11
|
+
exports.deserializeBank = deserializeBank;
|
12
|
+
exports.fetchBank = fetchBank;
|
13
|
+
exports.safeFetchBank = safeFetchBank;
|
14
|
+
exports.fetchAllBank = fetchAllBank;
|
15
|
+
exports.safeFetchAllBank = safeFetchAllBank;
|
16
|
+
exports.getBankGpaBuilder = getBankGpaBuilder;
|
17
|
+
exports.getBankSize = getBankSize;
|
11
18
|
const umi_1 = require("@metaplex-foundation/umi");
|
12
19
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
13
20
|
const types_1 = require("../types");
|
@@ -48,22 +55,18 @@ function getBankAccountDataSerializer() {
|
|
48
55
|
discriminator: [142, 49, 166, 242, 50, 66, 97, 188],
|
49
56
|
}));
|
50
57
|
}
|
51
|
-
exports.getBankAccountDataSerializer = getBankAccountDataSerializer;
|
52
58
|
function deserializeBank(rawAccount) {
|
53
59
|
return (0, umi_1.deserializeAccount)(rawAccount, getBankAccountDataSerializer());
|
54
60
|
}
|
55
|
-
exports.deserializeBank = deserializeBank;
|
56
61
|
async function fetchBank(context, publicKey, options) {
|
57
62
|
const maybeAccount = await context.rpc.getAccount((0, umi_1.publicKey)(publicKey, false), options);
|
58
63
|
(0, umi_1.assertAccountExists)(maybeAccount, 'Bank');
|
59
64
|
return deserializeBank(maybeAccount);
|
60
65
|
}
|
61
|
-
exports.fetchBank = fetchBank;
|
62
66
|
async function safeFetchBank(context, publicKey, options) {
|
63
67
|
const maybeAccount = await context.rpc.getAccount((0, umi_1.publicKey)(publicKey, false), options);
|
64
68
|
return maybeAccount.exists ? deserializeBank(maybeAccount) : null;
|
65
69
|
}
|
66
|
-
exports.safeFetchBank = safeFetchBank;
|
67
70
|
async function fetchAllBank(context, publicKeys, options) {
|
68
71
|
const maybeAccounts = await context.rpc.getAccounts(publicKeys.map((key) => (0, umi_1.publicKey)(key, false)), options);
|
69
72
|
return maybeAccounts.map((maybeAccount) => {
|
@@ -71,14 +74,12 @@ async function fetchAllBank(context, publicKeys, options) {
|
|
71
74
|
return deserializeBank(maybeAccount);
|
72
75
|
});
|
73
76
|
}
|
74
|
-
exports.fetchAllBank = fetchAllBank;
|
75
77
|
async function safeFetchAllBank(context, publicKeys, options) {
|
76
78
|
const maybeAccounts = await context.rpc.getAccounts(publicKeys.map((key) => (0, umi_1.publicKey)(key, false)), options);
|
77
79
|
return maybeAccounts
|
78
80
|
.filter((maybeAccount) => maybeAccount.exists)
|
79
81
|
.map((maybeAccount) => deserializeBank(maybeAccount));
|
80
82
|
}
|
81
|
-
exports.safeFetchAllBank = safeFetchAllBank;
|
82
83
|
function getBankGpaBuilder(context) {
|
83
84
|
const programId = context.programs.getPublicKey('marginfi', 'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA');
|
84
85
|
return (0, umi_1.gpaBuilder)(context, programId)
|
@@ -117,8 +118,6 @@ function getBankGpaBuilder(context) {
|
|
117
118
|
.deserializeUsing((account) => deserializeBank(account))
|
118
119
|
.whereField('discriminator', [142, 49, 166, 242, 50, 66, 97, 188]);
|
119
120
|
}
|
120
|
-
exports.getBankGpaBuilder = getBankGpaBuilder;
|
121
121
|
function getBankSize() {
|
122
122
|
return 1864;
|
123
123
|
}
|
124
|
-
exports.getBankSize = getBankSize;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marginfiAccount.d.ts","sourceRoot":"","sources":["../../../src/marginfi-sdk/accounts/marginfiAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,OAAO,EACP,GAAG,EACH,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EAKtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAOX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAElE,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAC/B;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,kBAAkB,CAAC;IACnC;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACjC,CAAC;AAEF,wBAAgB,uCAAuC,IAAI,UAAU,CACnE,8BAA8B,EAC9B,0BAA0B,CAC3B,CAsBA;AAED,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,GACrB,eA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AAK,CAAC,EAC7B,UAAU,EAAE,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,EAClC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,eAAe,EAAE,CAAC,CAS5B;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAC7B,UAAU,EAAE,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,EAClC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,eAAe,EAAE,CAAC,CAU5B;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC;mBAQvB,KAAK,CAAC,MAAM,CAAC;WACrB,SAAS;eACL,SAAS;oBACJ,kBAAkB;kBACpB,MAAM,GAAG,MAAM;aACpB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;GAapC;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C"}
|
@@ -7,7 +7,14 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.getMarginfiAccountAccountDataSerializer = getMarginfiAccountAccountDataSerializer;
|
11
|
+
exports.deserializeMarginfiAccount = deserializeMarginfiAccount;
|
12
|
+
exports.fetchMarginfiAccount = fetchMarginfiAccount;
|
13
|
+
exports.safeFetchMarginfiAccount = safeFetchMarginfiAccount;
|
14
|
+
exports.fetchAllMarginfiAccount = fetchAllMarginfiAccount;
|
15
|
+
exports.safeFetchAllMarginfiAccount = safeFetchAllMarginfiAccount;
|
16
|
+
exports.getMarginfiAccountGpaBuilder = getMarginfiAccountGpaBuilder;
|
17
|
+
exports.getMarginfiAccountSize = getMarginfiAccountSize;
|
11
18
|
const umi_1 = require("@metaplex-foundation/umi");
|
12
19
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
13
20
|
const types_1 = require("../types");
|
@@ -24,22 +31,18 @@ function getMarginfiAccountAccountDataSerializer() {
|
|
24
31
|
discriminator: [67, 178, 130, 109, 126, 114, 28, 42],
|
25
32
|
}));
|
26
33
|
}
|
27
|
-
exports.getMarginfiAccountAccountDataSerializer = getMarginfiAccountAccountDataSerializer;
|
28
34
|
function deserializeMarginfiAccount(rawAccount) {
|
29
35
|
return (0, umi_1.deserializeAccount)(rawAccount, getMarginfiAccountAccountDataSerializer());
|
30
36
|
}
|
31
|
-
exports.deserializeMarginfiAccount = deserializeMarginfiAccount;
|
32
37
|
async function fetchMarginfiAccount(context, publicKey, options) {
|
33
38
|
const maybeAccount = await context.rpc.getAccount((0, umi_1.publicKey)(publicKey, false), options);
|
34
39
|
(0, umi_1.assertAccountExists)(maybeAccount, 'MarginfiAccount');
|
35
40
|
return deserializeMarginfiAccount(maybeAccount);
|
36
41
|
}
|
37
|
-
exports.fetchMarginfiAccount = fetchMarginfiAccount;
|
38
42
|
async function safeFetchMarginfiAccount(context, publicKey, options) {
|
39
43
|
const maybeAccount = await context.rpc.getAccount((0, umi_1.publicKey)(publicKey, false), options);
|
40
44
|
return maybeAccount.exists ? deserializeMarginfiAccount(maybeAccount) : null;
|
41
45
|
}
|
42
|
-
exports.safeFetchMarginfiAccount = safeFetchMarginfiAccount;
|
43
46
|
async function fetchAllMarginfiAccount(context, publicKeys, options) {
|
44
47
|
const maybeAccounts = await context.rpc.getAccounts(publicKeys.map((key) => (0, umi_1.publicKey)(key, false)), options);
|
45
48
|
return maybeAccounts.map((maybeAccount) => {
|
@@ -47,14 +50,12 @@ async function fetchAllMarginfiAccount(context, publicKeys, options) {
|
|
47
50
|
return deserializeMarginfiAccount(maybeAccount);
|
48
51
|
});
|
49
52
|
}
|
50
|
-
exports.fetchAllMarginfiAccount = fetchAllMarginfiAccount;
|
51
53
|
async function safeFetchAllMarginfiAccount(context, publicKeys, options) {
|
52
54
|
const maybeAccounts = await context.rpc.getAccounts(publicKeys.map((key) => (0, umi_1.publicKey)(key, false)), options);
|
53
55
|
return maybeAccounts
|
54
56
|
.filter((maybeAccount) => maybeAccount.exists)
|
55
57
|
.map((maybeAccount) => deserializeMarginfiAccount(maybeAccount));
|
56
58
|
}
|
57
|
-
exports.safeFetchAllMarginfiAccount = safeFetchAllMarginfiAccount;
|
58
59
|
function getMarginfiAccountGpaBuilder(context) {
|
59
60
|
const programId = context.programs.getPublicKey('marginfi', 'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA');
|
60
61
|
return (0, umi_1.gpaBuilder)(context, programId)
|
@@ -69,8 +70,6 @@ function getMarginfiAccountGpaBuilder(context) {
|
|
69
70
|
.deserializeUsing((account) => deserializeMarginfiAccount(account))
|
70
71
|
.whereField('discriminator', [67, 178, 130, 109, 126, 114, 28, 42]);
|
71
72
|
}
|
72
|
-
exports.getMarginfiAccountGpaBuilder = getMarginfiAccountGpaBuilder;
|
73
73
|
function getMarginfiAccountSize() {
|
74
74
|
return 2312;
|
75
75
|
}
|
76
|
-
exports.getMarginfiAccountSize = getMarginfiAccountSize;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marginfiGroup.d.ts","sourceRoot":"","sources":["../../../src/marginfi-sdk/accounts/marginfiGroup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,OAAO,EACP,GAAG,EACH,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EAKtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAOX,MAAM,sCAAsC,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE9D,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,E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,EAC7B,SAAS,EAAE,SAAS,GAAG,GAAG,EAC1B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAM/B;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAC7B,UAAU,EAAE,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,EAClC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,aAAa,EAAE,CAAC,CAS1B;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAC7B,UAAU,EAAE,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,EAClC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,aAAa,EAAE,CAAC,CAU1B;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC;mBAQvB,KAAK,CAAC,MAAM,CAAC;WACrB,SAAS;cACN,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;cACtB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;GAWrC;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
@@ -7,7 +7,14 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.getMarginfiGroupAccountDataSerializer = getMarginfiGroupAccountDataSerializer;
|
11
|
+
exports.deserializeMarginfiGroup = deserializeMarginfiGroup;
|
12
|
+
exports.fetchMarginfiGroup = fetchMarginfiGroup;
|
13
|
+
exports.safeFetchMarginfiGroup = safeFetchMarginfiGroup;
|
14
|
+
exports.fetchAllMarginfiGroup = fetchAllMarginfiGroup;
|
15
|
+
exports.safeFetchAllMarginfiGroup = safeFetchAllMarginfiGroup;
|
16
|
+
exports.getMarginfiGroupGpaBuilder = getMarginfiGroupGpaBuilder;
|
17
|
+
exports.getMarginfiGroupSize = getMarginfiGroupSize;
|
11
18
|
const umi_1 = require("@metaplex-foundation/umi");
|
12
19
|
const serializers_1 = require("@metaplex-foundation/umi/serializers");
|
13
20
|
function getMarginfiGroupAccountDataSerializer() {
|
@@ -21,22 +28,18 @@ function getMarginfiGroupAccountDataSerializer() {
|
|
21
28
|
discriminator: [182, 23, 173, 240, 151, 206, 182, 67],
|
22
29
|
}));
|
23
30
|
}
|
24
|
-
exports.getMarginfiGroupAccountDataSerializer = getMarginfiGroupAccountDataSerializer;
|
25
31
|
function deserializeMarginfiGroup(rawAccount) {
|
26
32
|
return (0, umi_1.deserializeAccount)(rawAccount, getMarginfiGroupAccountDataSerializer());
|
27
33
|
}
|
28
|
-
exports.deserializeMarginfiGroup = deserializeMarginfiGroup;
|
29
34
|
async function fetchMarginfiGroup(context, publicKey, options) {
|
30
35
|
const maybeAccount = await context.rpc.getAccount((0, umi_1.publicKey)(publicKey, false), options);
|
31
36
|
(0, umi_1.assertAccountExists)(maybeAccount, 'MarginfiGroup');
|
32
37
|
return deserializeMarginfiGroup(maybeAccount);
|
33
38
|
}
|
34
|
-
exports.fetchMarginfiGroup = fetchMarginfiGroup;
|
35
39
|
async function safeFetchMarginfiGroup(context, publicKey, options) {
|
36
40
|
const maybeAccount = await context.rpc.getAccount((0, umi_1.publicKey)(publicKey, false), options);
|
37
41
|
return maybeAccount.exists ? deserializeMarginfiGroup(maybeAccount) : null;
|
38
42
|
}
|
39
|
-
exports.safeFetchMarginfiGroup = safeFetchMarginfiGroup;
|
40
43
|
async function fetchAllMarginfiGroup(context, publicKeys, options) {
|
41
44
|
const maybeAccounts = await context.rpc.getAccounts(publicKeys.map((key) => (0, umi_1.publicKey)(key, false)), options);
|
42
45
|
return maybeAccounts.map((maybeAccount) => {
|
@@ -44,14 +47,12 @@ async function fetchAllMarginfiGroup(context, publicKeys, options) {
|
|
44
47
|
return deserializeMarginfiGroup(maybeAccount);
|
45
48
|
});
|
46
49
|
}
|
47
|
-
exports.fetchAllMarginfiGroup = fetchAllMarginfiGroup;
|
48
50
|
async function safeFetchAllMarginfiGroup(context, publicKeys, options) {
|
49
51
|
const maybeAccounts = await context.rpc.getAccounts(publicKeys.map((key) => (0, umi_1.publicKey)(key, false)), options);
|
50
52
|
return maybeAccounts
|
51
53
|
.filter((maybeAccount) => maybeAccount.exists)
|
52
54
|
.map((maybeAccount) => deserializeMarginfiGroup(maybeAccount));
|
53
55
|
}
|
54
|
-
exports.safeFetchAllMarginfiGroup = safeFetchAllMarginfiGroup;
|
55
56
|
function getMarginfiGroupGpaBuilder(context) {
|
56
57
|
const programId = context.programs.getPublicKey('marginfi', 'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA');
|
57
58
|
return (0, umi_1.gpaBuilder)(context, programId)
|
@@ -64,8 +65,6 @@ function getMarginfiGroupGpaBuilder(context) {
|
|
64
65
|
.deserializeUsing((account) => deserializeMarginfiGroup(account))
|
65
66
|
.whereField('discriminator', [182, 23, 173, 240, 151, 206, 182, 67]);
|
66
67
|
}
|
67
|
-
exports.getMarginfiGroupGpaBuilder = getMarginfiGroupGpaBuilder;
|
68
68
|
function getMarginfiGroupSize() {
|
69
69
|
return 1064;
|
70
70
|
}
|
71
|
-
exports.getMarginfiGroupSize = getMarginfiGroupSize;
|
@@ -7,7 +7,9 @@
|
|
7
7
|
* @see https://github.com/metaplex-foundation/kinobi
|
8
8
|
*/
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.
|
10
|
+
exports.IllegalAccountAuthorityTransferError = exports.IllegalBalanceStateError = exports.IllegalFlagError = exports.IllegalFlashloanError = exports.AccountInFlashloanError = exports.AccountTempActiveBalanceLimitExceededError = exports.AccountDisabledError = exports.EmissionsUpdateErrorError = exports.CannotCloseOutstandingEmissionsError = exports.InvalidSwitchboardDecimalConversionError = exports.OracleNotSetupError = exports.EmissionsAlreadySetupError = exports.IsolatedAccountIllegalStateError = exports.InvalidPriceError = exports.BankLiabilityCapacityExceededError = exports.IllegalUtilizationRatioError = exports.InvalidOracleSetupError = exports.NoLiabilityFoundError = exports.NoAssetFoundError = exports.OperationRepayOnlyError = exports.OperationBorrowOnlyError = exports.OperationWithdrawOnlyError = exports.OperationDepositOnlyError = exports.BankAccoutNotFoundError = exports.BankReduceOnlyError = exports.BankPausedError = exports.StaleOracleError = exports.InvalidConfigError = exports.BalanceNotBadDebtError = exports.AccountNotBankruptError = exports.IllegalLiquidationError = exports.BankAlreadyExistsError = exports.LendingAccountBalanceSlotsFullError = exports.BadAccountHealthError = exports.InvalidBankAccountError = exports.MissingBankAccountError = exports.InvalidOracleAccountError = exports.MissingPythAccountError = exports.MissingPythOrBankAccountError = exports.InvalidTransferError = exports.BankAssetCapacityExceededError = exports.LendingAccountBalanceNotFoundError = exports.BankNotFoundError = exports.MathErrorError = void 0;
|
11
|
+
exports.getMarginfiErrorFromCode = getMarginfiErrorFromCode;
|
12
|
+
exports.getMarginfiErrorFromName = getMarginfiErrorFromName;
|
11
13
|
const umi_1 = require("@metaplex-foundation/umi");
|
12
14
|
const codeToErrorMap = new Map();
|
13
15
|
const nameToErrorMap = new Map();
|
@@ -503,7 +505,6 @@ function getMarginfiErrorFromCode(code, program, cause) {
|
|
503
505
|
const constructor = codeToErrorMap.get(code);
|
504
506
|
return constructor ? new constructor(program, cause) : null;
|
505
507
|
}
|
506
|
-
exports.getMarginfiErrorFromCode = getMarginfiErrorFromCode;
|
507
508
|
/**
|
508
509
|
* Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'.
|
509
510
|
* @category Errors
|
@@ -512,4 +513,3 @@ function getMarginfiErrorFromName(name, program, cause) {
|
|
512
513
|
const constructor = nameToErrorMap.get(name);
|
513
514
|
return constructor ? new constructor(program, cause) : null;
|
514
515
|
}
|
515
|
-
exports.getMarginfiErrorFromName = getMarginfiErrorFromName;
|