@kamino-finance/klend-sdk 7.1.3 → 7.1.4-beta.0
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/@codegen/klend/accounts/LendingMarket.d.ts +144 -3
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.js +105 -3
- package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.d.ts +30 -15
- package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.js +31 -21
- package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
- package/dist/@codegen/klend/accounts/PoolState.d.ts +53 -0
- package/dist/@codegen/klend/accounts/PoolState.d.ts.map +1 -0
- package/dist/@codegen/klend/accounts/PoolState.js +167 -0
- package/dist/@codegen/klend/accounts/PoolState.js.map +1 -0
- package/dist/@codegen/klend/accounts/Reserve.d.ts +6 -0
- package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.js +9 -2
- package/dist/@codegen/klend/accounts/Reserve.js.map +1 -1
- package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts +41 -0
- package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts.map +1 -0
- package/dist/@codegen/klend/accounts/UnstakeTicket.js +143 -0
- package/dist/@codegen/klend/accounts/UnstakeTicket.js.map +1 -0
- package/dist/@codegen/klend/accounts/UserState.d.ts +0 -75
- package/dist/@codegen/klend/accounts/UserState.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/UserState.js +0 -25
- package/dist/@codegen/klend/accounts/UserState.js.map +1 -1
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts +132 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts.map +1 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.js +191 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.js.map +1 -0
- package/dist/@codegen/klend/accounts/index.d.ts +6 -0
- package/dist/@codegen/klend/accounts/index.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/index.js +7 -1
- package/dist/@codegen/klend/accounts/index.js.map +1 -1
- package/dist/@codegen/klend/errors/custom.d.ts +226 -2
- package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/klend/errors/custom.js +396 -3
- package/dist/@codegen/klend/errors/custom.js.map +1 -1
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts +39 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js +67 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js.map +1 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts +36 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.js +49 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.js.map +1 -0
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +1 -2
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.js +6 -2
- package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
- package/dist/@codegen/klend/instructions/index.d.ts +16 -0
- package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/index.js +18 -1
- package/dist/@codegen/klend/instructions/index.js.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.d.ts +1 -1
- package/dist/@codegen/klend/instructions/initReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.js +1 -5
- package/dist/@codegen/klend/instructions/initReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.js +1 -1
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts +47 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js +66 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js.map +1 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts +31 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.js +64 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.js.map +1 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts +53 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js +190 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js.map +1 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts +70 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js +261 -0
- package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js.map +1 -0
- package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.js +1 -0
- package/dist/@codegen/klend/instructions/updateGlobalConfig.js.map +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.js +1 -0
- package/dist/@codegen/klend/instructions/updateReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts +41 -0
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.js +135 -0
- package/dist/@codegen/klend/instructions/withdrawObligationUsol.js.map +1 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts +51 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js +28 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrder.d.ts +192 -0
- package/dist/@codegen/klend/types/BorrowOrder.d.ts.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrder.js +194 -0
- package/dist/@codegen/klend/types/BorrowOrder.js.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts +39 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js +100 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js.map +1 -0
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts +35 -5
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ObligationLiquidity.js +17 -7
- package/dist/@codegen/klend/types/ObligationLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/ObligationOrder.d.ts +4 -4
- package/dist/@codegen/klend/types/ObligationOrder.js +2 -2
- package/dist/@codegen/klend/types/ReserveConfig.d.ts +141 -29
- package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveConfig.js +89 -25
- package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/types/ReserveFees.d.ts +8 -8
- package/dist/@codegen/klend/types/ReserveFees.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveFees.js +8 -8
- package/dist/@codegen/klend/types/ReserveFees.js.map +1 -1
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts +26 -8
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveLiquidity.js +14 -8
- package/dist/@codegen/klend/types/ReserveLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +92 -14
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.js +168 -23
- package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +130 -0
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +241 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/@codegen/klend/types/WithdrawQueue.d.ts +64 -0
- package/dist/@codegen/klend/types/WithdrawQueue.d.ts.map +1 -0
- package/dist/@codegen/klend/types/WithdrawQueue.js +104 -0
- package/dist/@codegen/klend/types/WithdrawQueue.js.map +1 -0
- package/dist/@codegen/klend/types/index.d.ts +10 -8
- package/dist/@codegen/klend/types/index.d.ts.map +1 -1
- package/dist/@codegen/klend/types/index.js +7 -3
- package/dist/@codegen/klend/types/index.js.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts +9 -4
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.js +22 -13
- package/dist/@codegen/klend/zero_padding/ObligationZP.js.map +1 -1
- package/dist/classes/action.d.ts +30 -3
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +364 -10
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +10 -0
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +6 -2
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +26 -6
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.js +1 -1
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +13 -7
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/unstakingPool.d.ts +20 -3
- package/dist/classes/unstakingPool.d.ts.map +1 -1
- package/dist/classes/unstakingPool.js +62 -8
- package/dist/classes/unstakingPool.js.map +1 -1
- package/dist/idl/klend.json +2125 -232
- package/dist/lending_operations/index.d.ts +1 -0
- package/dist/lending_operations/index.d.ts.map +1 -1
- package/dist/lending_operations/index.js +1 -0
- package/dist/lending_operations/index.js.map +1 -1
- package/dist/lending_operations/unstake_lst_collateral.d.ts +12 -0
- package/dist/lending_operations/unstake_lst_collateral.d.ts.map +1 -0
- package/dist/lending_operations/unstake_lst_collateral.js +104 -0
- package/dist/lending_operations/unstake_lst_collateral.js.map +1 -0
- package/dist/manager/client_kamino_manager.js +11 -8
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/utils/managerTypes.d.ts.map +1 -1
- package/dist/utils/managerTypes.js +9 -4
- package/dist/utils/managerTypes.js.map +1 -1
- package/dist/utils/seeds.d.ts +10 -14
- package/dist/utils/seeds.d.ts.map +1 -1
- package/dist/utils/seeds.js +25 -22
- package/dist/utils/seeds.js.map +1 -1
- package/package.json +1 -1
- package/src/@codegen/klend/accounts/LendingMarket.ts +210 -5
- package/src/@codegen/klend/accounts/Obligation.ts +53 -31
- package/src/@codegen/klend/accounts/PoolState.ts +192 -0
- package/src/@codegen/klend/accounts/Reserve.ts +13 -2
- package/src/@codegen/klend/accounts/UnstakeTicket.ts +160 -0
- package/src/@codegen/klend/accounts/UserState.ts +0 -75
- package/src/@codegen/klend/accounts/WithdrawTicket.ts +256 -0
- package/src/@codegen/klend/accounts/index.ts +6 -0
- package/src/@codegen/klend/errors/custom.ts +427 -2
- package/src/@codegen/klend/instructions/enqueueToWithdraw.ts +89 -0
- package/src/@codegen/klend/instructions/fillBorrowOrder.ts +96 -0
- package/src/@codegen/klend/instructions/idlMissingTypes.ts +7 -4
- package/src/@codegen/klend/instructions/index.ts +34 -0
- package/src/@codegen/klend/instructions/initReserve.ts +2 -6
- package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.ts +1 -1
- package/src/@codegen/klend/instructions/recoverInvalidTicketCollateral.ts +96 -0
- package/src/@codegen/klend/instructions/setBorrowOrder.ts +77 -0
- package/src/@codegen/klend/instructions/unstakeLstCollateralEnd.ts +251 -0
- package/src/@codegen/klend/instructions/unstakeLstCollateralStart.ts +353 -0
- package/src/@codegen/klend/instructions/updateGlobalConfig.ts +2 -1
- package/src/@codegen/klend/instructions/updateReserveConfig.ts +2 -1
- package/src/@codegen/klend/instructions/withdrawObligationCollateral.ts +1 -1
- package/src/@codegen/klend/instructions/withdrawObligationCollateralV2.ts +1 -1
- package/src/@codegen/klend/instructions/withdrawObligationUsol.ts +168 -0
- package/src/@codegen/klend/instructions/withdrawQueuedLiquidity.ts +92 -0
- package/src/@codegen/klend/types/BorrowOrder.ts +267 -0
- package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +87 -0
- package/src/@codegen/klend/types/ObligationLiquidity.ts +39 -9
- package/src/@codegen/klend/types/ObligationOrder.ts +4 -4
- package/src/@codegen/klend/types/ReserveConfig.ts +171 -39
- package/src/@codegen/klend/types/ReserveFees.ts +12 -12
- package/src/@codegen/klend/types/ReserveLiquidity.ts +30 -12
- package/src/@codegen/klend/types/UpdateConfigMode.ts +206 -26
- package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +300 -0
- package/src/@codegen/klend/types/WithdrawQueue.ts +117 -0
- package/src/@codegen/klend/types/index.ts +45 -16
- package/src/@codegen/klend/zero_padding/ObligationZP.ts +22 -13
- package/src/classes/action.ts +577 -8
- package/src/classes/manager.ts +11 -0
- package/src/classes/market.ts +36 -5
- package/src/classes/obligation.ts +1 -1
- package/src/classes/reserve.ts +13 -8
- package/src/classes/unstakingPool.ts +83 -6
- package/src/idl/klend.json +2126 -233
- package/src/lending_operations/index.ts +1 -0
- package/src/lending_operations/unstake_lst_collateral.ts +174 -0
- package/src/manager/client_kamino_manager.ts +11 -8
- package/src/utils/managerTypes.ts +9 -4
- package/src/utils/seeds.ts +28 -26
- package/dist/@codegen/klend/types/AssetTier.d.ts +0 -45
- package/dist/@codegen/klend/types/AssetTier.d.ts.map +0 -1
- package/dist/@codegen/klend/types/AssetTier.js +0 -132
- package/dist/@codegen/klend/types/AssetTier.js.map +0 -1
- package/src/@codegen/klend/types/AssetTier.ts +0 -119
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.UnstakeTicket = void 0;
|
|
40
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
41
|
+
const kit_1 = require("@solana/kit");
|
|
42
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
43
|
+
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
44
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
45
|
+
const utils_1 = require("../utils"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
46
|
+
const programId_1 = require("../programId");
|
|
47
|
+
class UnstakeTicket {
|
|
48
|
+
authority;
|
|
49
|
+
poolState;
|
|
50
|
+
obligationMetadata;
|
|
51
|
+
initialUsol;
|
|
52
|
+
remainingUsol;
|
|
53
|
+
minimumEpochToBurn;
|
|
54
|
+
padding0;
|
|
55
|
+
padding;
|
|
56
|
+
static discriminator = Buffer.from([
|
|
57
|
+
131, 84, 209, 38, 145, 157, 181, 127,
|
|
58
|
+
]);
|
|
59
|
+
static layout = borsh.struct([
|
|
60
|
+
(0, utils_1.borshAddress)("authority"),
|
|
61
|
+
(0, utils_1.borshAddress)("poolState"),
|
|
62
|
+
(0, utils_1.borshAddress)("obligationMetadata"),
|
|
63
|
+
borsh.u64("initialUsol"),
|
|
64
|
+
borsh.u64("remainingUsol"),
|
|
65
|
+
borsh.u64("minimumEpochToBurn"),
|
|
66
|
+
borsh.array(borsh.u64(), 1, "padding0"),
|
|
67
|
+
borsh.array(borsh.u128(), 16, "padding"),
|
|
68
|
+
]);
|
|
69
|
+
constructor(fields) {
|
|
70
|
+
this.authority = fields.authority;
|
|
71
|
+
this.poolState = fields.poolState;
|
|
72
|
+
this.obligationMetadata = fields.obligationMetadata;
|
|
73
|
+
this.initialUsol = fields.initialUsol;
|
|
74
|
+
this.remainingUsol = fields.remainingUsol;
|
|
75
|
+
this.minimumEpochToBurn = fields.minimumEpochToBurn;
|
|
76
|
+
this.padding0 = fields.padding0;
|
|
77
|
+
this.padding = fields.padding;
|
|
78
|
+
}
|
|
79
|
+
static async fetch(rpc, address, programId = programId_1.PROGRAM_ID) {
|
|
80
|
+
const info = await (0, kit_1.fetchEncodedAccount)(rpc, address);
|
|
81
|
+
if (!info.exists) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
if (info.programAddress !== programId) {
|
|
85
|
+
throw new Error(`UnstakeTicketFields account ${address} belongs to wrong program ${info.programAddress}, expected ${programId}`);
|
|
86
|
+
}
|
|
87
|
+
return this.decode(Buffer.from(info.data));
|
|
88
|
+
}
|
|
89
|
+
static async fetchMultiple(rpc, addresses, programId = programId_1.PROGRAM_ID) {
|
|
90
|
+
const infos = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses);
|
|
91
|
+
return infos.map((info) => {
|
|
92
|
+
if (!info.exists) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
if (info.programAddress !== programId) {
|
|
96
|
+
throw new Error(`UnstakeTicketFields account ${info.address} belongs to wrong program ${info.programAddress}, expected ${programId}`);
|
|
97
|
+
}
|
|
98
|
+
return this.decode(Buffer.from(info.data));
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
static decode(data) {
|
|
102
|
+
if (!data.slice(0, 8).equals(UnstakeTicket.discriminator)) {
|
|
103
|
+
throw new Error("invalid account discriminator");
|
|
104
|
+
}
|
|
105
|
+
const dec = UnstakeTicket.layout.decode(data.slice(8));
|
|
106
|
+
return new UnstakeTicket({
|
|
107
|
+
authority: dec.authority,
|
|
108
|
+
poolState: dec.poolState,
|
|
109
|
+
obligationMetadata: dec.obligationMetadata,
|
|
110
|
+
initialUsol: dec.initialUsol,
|
|
111
|
+
remainingUsol: dec.remainingUsol,
|
|
112
|
+
minimumEpochToBurn: dec.minimumEpochToBurn,
|
|
113
|
+
padding0: dec.padding0,
|
|
114
|
+
padding: dec.padding,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
toJSON() {
|
|
118
|
+
return {
|
|
119
|
+
authority: this.authority,
|
|
120
|
+
poolState: this.poolState,
|
|
121
|
+
obligationMetadata: this.obligationMetadata,
|
|
122
|
+
initialUsol: this.initialUsol.toString(),
|
|
123
|
+
remainingUsol: this.remainingUsol.toString(),
|
|
124
|
+
minimumEpochToBurn: this.minimumEpochToBurn.toString(),
|
|
125
|
+
padding0: this.padding0.map((item) => item.toString()),
|
|
126
|
+
padding: this.padding.map((item) => item.toString()),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
static fromJSON(obj) {
|
|
130
|
+
return new UnstakeTicket({
|
|
131
|
+
authority: (0, kit_1.address)(obj.authority),
|
|
132
|
+
poolState: (0, kit_1.address)(obj.poolState),
|
|
133
|
+
obligationMetadata: (0, kit_1.address)(obj.obligationMetadata),
|
|
134
|
+
initialUsol: new bn_js_1.default(obj.initialUsol),
|
|
135
|
+
remainingUsol: new bn_js_1.default(obj.remainingUsol),
|
|
136
|
+
minimumEpochToBurn: new bn_js_1.default(obj.minimumEpochToBurn),
|
|
137
|
+
padding0: obj.padding0.map((item) => new bn_js_1.default(item)),
|
|
138
|
+
padding: obj.padding.map((item) => new bn_js_1.default(item)),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.UnstakeTicket = UnstakeTicket;
|
|
143
|
+
//# sourceMappingURL=UnstakeTicket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnstakeTicket.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/UnstakeTicket.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,qCAQoB;AACpB,qDAAqD;AACrD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,oCAAuC,CAAC,wDAAwD;AAEhG,4CAAyC;AAwBzC,MAAa,aAAa;IACf,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,kBAAkB,CAAS;IAC3B,WAAW,CAAI;IACf,aAAa,CAAI;IACjB,kBAAkB,CAAI;IACtB,QAAQ,CAAW;IACnB,OAAO,CAAW;IAE3B,MAAM,CAAU,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC;QAC1C,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;KACrC,CAAC,CAAA;IAEF,MAAM,CAAU,MAAM,GAAG,KAAK,CAAC,MAAM,CAAgB;QACnD,IAAA,oBAAY,EAAC,WAAW,CAAC;QACzB,IAAA,oBAAY,EAAC,WAAW,CAAC;QACzB,IAAA,oBAAY,EAAC,oBAAoB,CAAC;QAClC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC;QACxB,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;QAC1B,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC;QAC/B,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,UAAU,CAAC;QACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC;KACzC,CAAC,CAAA;IAEF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Address;
|
|
7
|
-
/** Indicate if this user state is part of a delegated farm */
|
|
8
7
|
isFarmDelegated: number;
|
|
9
8
|
padding0: Array<number>;
|
|
10
|
-
/**
|
|
11
|
-
* Rewards tally used for computation of gained rewards
|
|
12
|
-
* (scaled from `Decimal` representation).
|
|
13
|
-
*/
|
|
14
9
|
rewardsTallyScaled: Array<BN>;
|
|
15
|
-
/** Number of reward tokens ready for claim */
|
|
16
10
|
rewardsIssuedUnclaimed: Array<BN>;
|
|
17
11
|
lastClaimTs: Array<BN>;
|
|
18
|
-
/**
|
|
19
|
-
* User stake deposited and usable, generating rewards and fees.
|
|
20
|
-
* (scaled from `Decimal` representation).
|
|
21
|
-
*/
|
|
22
12
|
activeStakeScaled: BN;
|
|
23
|
-
/**
|
|
24
|
-
* User stake deposited but not usable and not generating rewards yet.
|
|
25
|
-
* (scaled from `Decimal` representation).
|
|
26
|
-
*/
|
|
27
13
|
pendingDepositStakeScaled: BN;
|
|
28
|
-
/**
|
|
29
|
-
* After this timestamp, pending user stake can be moved to user stake
|
|
30
|
-
* Initialized to now() + delayed user stake period
|
|
31
|
-
*/
|
|
32
14
|
pendingDepositStakeTs: BN;
|
|
33
|
-
/**
|
|
34
|
-
* User deposits unstaked, pending for withdrawal, not usable and not generating rewards.
|
|
35
|
-
* (scaled from `Decimal` representation).
|
|
36
|
-
*/
|
|
37
15
|
pendingWithdrawalUnstakeScaled: BN;
|
|
38
|
-
/** After this timestamp, user can withdraw their deposit. */
|
|
39
16
|
pendingWithdrawalUnstakeTs: BN;
|
|
40
|
-
/** User bump used for account address validation */
|
|
41
17
|
bump: BN;
|
|
42
|
-
/** Delegatee used for initialisation - useful to check against */
|
|
43
18
|
delegatee: Address;
|
|
44
19
|
lastStakeTs: BN;
|
|
45
20
|
padding1: Array<BN>;
|
|
@@ -48,42 +23,17 @@ export interface UserStateJSON {
|
|
|
48
23
|
userId: string;
|
|
49
24
|
farmState: string;
|
|
50
25
|
owner: string;
|
|
51
|
-
/** Indicate if this user state is part of a delegated farm */
|
|
52
26
|
isFarmDelegated: number;
|
|
53
27
|
padding0: Array<number>;
|
|
54
|
-
/**
|
|
55
|
-
* Rewards tally used for computation of gained rewards
|
|
56
|
-
* (scaled from `Decimal` representation).
|
|
57
|
-
*/
|
|
58
28
|
rewardsTallyScaled: Array<string>;
|
|
59
|
-
/** Number of reward tokens ready for claim */
|
|
60
29
|
rewardsIssuedUnclaimed: Array<string>;
|
|
61
30
|
lastClaimTs: Array<string>;
|
|
62
|
-
/**
|
|
63
|
-
* User stake deposited and usable, generating rewards and fees.
|
|
64
|
-
* (scaled from `Decimal` representation).
|
|
65
|
-
*/
|
|
66
31
|
activeStakeScaled: string;
|
|
67
|
-
/**
|
|
68
|
-
* User stake deposited but not usable and not generating rewards yet.
|
|
69
|
-
* (scaled from `Decimal` representation).
|
|
70
|
-
*/
|
|
71
32
|
pendingDepositStakeScaled: string;
|
|
72
|
-
/**
|
|
73
|
-
* After this timestamp, pending user stake can be moved to user stake
|
|
74
|
-
* Initialized to now() + delayed user stake period
|
|
75
|
-
*/
|
|
76
33
|
pendingDepositStakeTs: string;
|
|
77
|
-
/**
|
|
78
|
-
* User deposits unstaked, pending for withdrawal, not usable and not generating rewards.
|
|
79
|
-
* (scaled from `Decimal` representation).
|
|
80
|
-
*/
|
|
81
34
|
pendingWithdrawalUnstakeScaled: string;
|
|
82
|
-
/** After this timestamp, user can withdraw their deposit. */
|
|
83
35
|
pendingWithdrawalUnstakeTs: string;
|
|
84
|
-
/** User bump used for account address validation */
|
|
85
36
|
bump: string;
|
|
86
|
-
/** Delegatee used for initialisation - useful to check against */
|
|
87
37
|
delegatee: string;
|
|
88
38
|
lastStakeTs: string;
|
|
89
39
|
padding1: Array<string>;
|
|
@@ -92,42 +42,17 @@ export declare class UserState {
|
|
|
92
42
|
readonly userId: BN;
|
|
93
43
|
readonly farmState: Address;
|
|
94
44
|
readonly owner: Address;
|
|
95
|
-
/** Indicate if this user state is part of a delegated farm */
|
|
96
45
|
readonly isFarmDelegated: number;
|
|
97
46
|
readonly padding0: Array<number>;
|
|
98
|
-
/**
|
|
99
|
-
* Rewards tally used for computation of gained rewards
|
|
100
|
-
* (scaled from `Decimal` representation).
|
|
101
|
-
*/
|
|
102
47
|
readonly rewardsTallyScaled: Array<BN>;
|
|
103
|
-
/** Number of reward tokens ready for claim */
|
|
104
48
|
readonly rewardsIssuedUnclaimed: Array<BN>;
|
|
105
49
|
readonly lastClaimTs: Array<BN>;
|
|
106
|
-
/**
|
|
107
|
-
* User stake deposited and usable, generating rewards and fees.
|
|
108
|
-
* (scaled from `Decimal` representation).
|
|
109
|
-
*/
|
|
110
50
|
readonly activeStakeScaled: BN;
|
|
111
|
-
/**
|
|
112
|
-
* User stake deposited but not usable and not generating rewards yet.
|
|
113
|
-
* (scaled from `Decimal` representation).
|
|
114
|
-
*/
|
|
115
51
|
readonly pendingDepositStakeScaled: BN;
|
|
116
|
-
/**
|
|
117
|
-
* After this timestamp, pending user stake can be moved to user stake
|
|
118
|
-
* Initialized to now() + delayed user stake period
|
|
119
|
-
*/
|
|
120
52
|
readonly pendingDepositStakeTs: BN;
|
|
121
|
-
/**
|
|
122
|
-
* User deposits unstaked, pending for withdrawal, not usable and not generating rewards.
|
|
123
|
-
* (scaled from `Decimal` representation).
|
|
124
|
-
*/
|
|
125
53
|
readonly pendingWithdrawalUnstakeScaled: BN;
|
|
126
|
-
/** After this timestamp, user can withdraw their deposit. */
|
|
127
54
|
readonly pendingWithdrawalUnstakeTs: BN;
|
|
128
|
-
/** User bump used for account address validation */
|
|
129
55
|
readonly bump: BN;
|
|
130
|
-
/** Delegatee used for initialisation - useful to check against */
|
|
131
56
|
readonly delegatee: Address;
|
|
132
57
|
readonly lastStakeTs: BN;
|
|
133
58
|
readonly padding1: Array<BN>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserState.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/UserState.ts"],"names":[],"mappings":"AACA,OAAO,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AE,EAAE,CAAA;IACjB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;IAE5B,MAAM,CAAC,QAAQ,CAAC,aAAa,sBAE3B;IAEF,MAAM,CAAC,QAAQ,CAAC,MAAM,4CAkBpB;gBAEU,MAAM,EAAE,eAAe;WAoBtB,KAAK,CAChB,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,OAAoB,GAC9B,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;WAef,aAAa,CACxB,GAAG,EAAE,GAAG,CAAC,sBAAsB,CAAC,EAChC,SAAS,EAAE,OAAO,EAAE,EACpB,SAAS,GAAE,OAAoB,GAC9B,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAiBnC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;IA4BtC,MAAM,IAAI,aAAa;IA2BvB,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS;CAyB/C"}
|
|
@@ -48,42 +48,17 @@ class UserState {
|
|
|
48
48
|
userId;
|
|
49
49
|
farmState;
|
|
50
50
|
owner;
|
|
51
|
-
/** Indicate if this user state is part of a delegated farm */
|
|
52
51
|
isFarmDelegated;
|
|
53
52
|
padding0;
|
|
54
|
-
/**
|
|
55
|
-
* Rewards tally used for computation of gained rewards
|
|
56
|
-
* (scaled from `Decimal` representation).
|
|
57
|
-
*/
|
|
58
53
|
rewardsTallyScaled;
|
|
59
|
-
/** Number of reward tokens ready for claim */
|
|
60
54
|
rewardsIssuedUnclaimed;
|
|
61
55
|
lastClaimTs;
|
|
62
|
-
/**
|
|
63
|
-
* User stake deposited and usable, generating rewards and fees.
|
|
64
|
-
* (scaled from `Decimal` representation).
|
|
65
|
-
*/
|
|
66
56
|
activeStakeScaled;
|
|
67
|
-
/**
|
|
68
|
-
* User stake deposited but not usable and not generating rewards yet.
|
|
69
|
-
* (scaled from `Decimal` representation).
|
|
70
|
-
*/
|
|
71
57
|
pendingDepositStakeScaled;
|
|
72
|
-
/**
|
|
73
|
-
* After this timestamp, pending user stake can be moved to user stake
|
|
74
|
-
* Initialized to now() + delayed user stake period
|
|
75
|
-
*/
|
|
76
58
|
pendingDepositStakeTs;
|
|
77
|
-
/**
|
|
78
|
-
* User deposits unstaked, pending for withdrawal, not usable and not generating rewards.
|
|
79
|
-
* (scaled from `Decimal` representation).
|
|
80
|
-
*/
|
|
81
59
|
pendingWithdrawalUnstakeScaled;
|
|
82
|
-
/** After this timestamp, user can withdraw their deposit. */
|
|
83
60
|
pendingWithdrawalUnstakeTs;
|
|
84
|
-
/** User bump used for account address validation */
|
|
85
61
|
bump;
|
|
86
|
-
/** Delegatee used for initialisation - useful to check against */
|
|
87
62
|
delegatee;
|
|
88
63
|
lastStakeTs;
|
|
89
64
|
padding1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserState.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/UserState.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,qCAQoB;AACpB,qDAAqD;AACrD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,oCAAuC,CAAC,wDAAwD;AAEhG,4CAAyC;
|
|
1
|
+
{"version":3,"file":"UserState.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/UserState.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,qCAQoB;AACpB,qDAAqD;AACrD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,oCAAuC,CAAC,wDAA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
export interface WithdrawTicketFields {
|
|
4
|
+
/** This ticket's place in the queue; the same as used for PDA derivation. */
|
|
5
|
+
sequenceNumber: BN;
|
|
6
|
+
/** The funds' owner (the user who called the `enqueue_to_withdraw` handler). */
|
|
7
|
+
owner: Address;
|
|
8
|
+
/** The reserve to withdraw from. */
|
|
9
|
+
reserve: Address;
|
|
10
|
+
/**
|
|
11
|
+
* The token account to which the finally-available liquidity should be transferred (by the
|
|
12
|
+
* `withdraw_queued_liquidity` handler).
|
|
13
|
+
*/
|
|
14
|
+
userDestinationLiquidityTa: Address;
|
|
15
|
+
/** The amount of collateral still waiting to be withdrawn using this ticket. */
|
|
16
|
+
queuedCollateralAmount: BN;
|
|
17
|
+
/**
|
|
18
|
+
* The timestamp at which the queue was entered.
|
|
19
|
+
*
|
|
20
|
+
* This is currently only a piece of metadata, not used by the logic.
|
|
21
|
+
*/
|
|
22
|
+
createdAtTimestamp: BN;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]
|
|
25
|
+
* has been repurposed) by the `withdraw_queued_liquidity` handler.
|
|
26
|
+
* To be specific: valid = `0`, invalid = `1`.
|
|
27
|
+
*
|
|
28
|
+
* An invalid ticket cannot be made valid again, and can only be passed to the
|
|
29
|
+
* `recover_invalid_ticket_collateral` handler.
|
|
30
|
+
*/
|
|
31
|
+
invalid: number;
|
|
32
|
+
/** Inner padding, for alignment. */
|
|
33
|
+
alignmentPadding: Array<number>;
|
|
34
|
+
/** Trailing padding, for future developments. */
|
|
35
|
+
endPadding: Array<BN>;
|
|
36
|
+
}
|
|
37
|
+
export interface WithdrawTicketJSON {
|
|
38
|
+
/** This ticket's place in the queue; the same as used for PDA derivation. */
|
|
39
|
+
sequenceNumber: string;
|
|
40
|
+
/** The funds' owner (the user who called the `enqueue_to_withdraw` handler). */
|
|
41
|
+
owner: string;
|
|
42
|
+
/** The reserve to withdraw from. */
|
|
43
|
+
reserve: string;
|
|
44
|
+
/**
|
|
45
|
+
* The token account to which the finally-available liquidity should be transferred (by the
|
|
46
|
+
* `withdraw_queued_liquidity` handler).
|
|
47
|
+
*/
|
|
48
|
+
userDestinationLiquidityTa: string;
|
|
49
|
+
/** The amount of collateral still waiting to be withdrawn using this ticket. */
|
|
50
|
+
queuedCollateralAmount: string;
|
|
51
|
+
/**
|
|
52
|
+
* The timestamp at which the queue was entered.
|
|
53
|
+
*
|
|
54
|
+
* This is currently only a piece of metadata, not used by the logic.
|
|
55
|
+
*/
|
|
56
|
+
createdAtTimestamp: string;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]
|
|
59
|
+
* has been repurposed) by the `withdraw_queued_liquidity` handler.
|
|
60
|
+
* To be specific: valid = `0`, invalid = `1`.
|
|
61
|
+
*
|
|
62
|
+
* An invalid ticket cannot be made valid again, and can only be passed to the
|
|
63
|
+
* `recover_invalid_ticket_collateral` handler.
|
|
64
|
+
*/
|
|
65
|
+
invalid: number;
|
|
66
|
+
/** Inner padding, for alignment. */
|
|
67
|
+
alignmentPadding: Array<number>;
|
|
68
|
+
/** Trailing padding, for future developments. */
|
|
69
|
+
endPadding: Array<string>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A finite-lifecycle account representing a specific depositor's place in the withdraw queue of
|
|
73
|
+
* a specific reserve.
|
|
74
|
+
*
|
|
75
|
+
* The lifecycle:
|
|
76
|
+
* 1. The depositor holding ctokens wants to withdraw funds from the reserve, and finds out that
|
|
77
|
+
* the required amount is not available (due to high utilization).
|
|
78
|
+
* 2. The depositor calls the `enqueue_to_withdraw` handler.
|
|
79
|
+
* 3. The handler transfers the depositor's ctokens to the reserve's internal "pending" vault.
|
|
80
|
+
* 4. The handler initializes a new [WithdrawTicket] account, with the next available sequence
|
|
81
|
+
* number.
|
|
82
|
+
* 5. The depositor waits until his ticket is the next expected one for actual withdraw, and until
|
|
83
|
+
* the reserve has enough liquidity.
|
|
84
|
+
* 6. Anyone (the depositor or a bot) calls the permissionless `withdraw_queued_liquidity`
|
|
85
|
+
* handler. If the ticket became invalid (e.g. destination account no longer exists), then the
|
|
86
|
+
* depositor can call the `recover_invalid_ticket_collateral` handler instead.
|
|
87
|
+
* 7. The handler transfers the liquidity amount according to the current exchange rate.
|
|
88
|
+
* 8. The handler closes the ticket account.
|
|
89
|
+
*/
|
|
90
|
+
export declare class WithdrawTicket {
|
|
91
|
+
/** This ticket's place in the queue; the same as used for PDA derivation. */
|
|
92
|
+
readonly sequenceNumber: BN;
|
|
93
|
+
/** The funds' owner (the user who called the `enqueue_to_withdraw` handler). */
|
|
94
|
+
readonly owner: Address;
|
|
95
|
+
/** The reserve to withdraw from. */
|
|
96
|
+
readonly reserve: Address;
|
|
97
|
+
/**
|
|
98
|
+
* The token account to which the finally-available liquidity should be transferred (by the
|
|
99
|
+
* `withdraw_queued_liquidity` handler).
|
|
100
|
+
*/
|
|
101
|
+
readonly userDestinationLiquidityTa: Address;
|
|
102
|
+
/** The amount of collateral still waiting to be withdrawn using this ticket. */
|
|
103
|
+
readonly queuedCollateralAmount: BN;
|
|
104
|
+
/**
|
|
105
|
+
* The timestamp at which the queue was entered.
|
|
106
|
+
*
|
|
107
|
+
* This is currently only a piece of metadata, not used by the logic.
|
|
108
|
+
*/
|
|
109
|
+
readonly createdAtTimestamp: BN;
|
|
110
|
+
/**
|
|
111
|
+
* Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]
|
|
112
|
+
* has been repurposed) by the `withdraw_queued_liquidity` handler.
|
|
113
|
+
* To be specific: valid = `0`, invalid = `1`.
|
|
114
|
+
*
|
|
115
|
+
* An invalid ticket cannot be made valid again, and can only be passed to the
|
|
116
|
+
* `recover_invalid_ticket_collateral` handler.
|
|
117
|
+
*/
|
|
118
|
+
readonly invalid: number;
|
|
119
|
+
/** Inner padding, for alignment. */
|
|
120
|
+
readonly alignmentPadding: Array<number>;
|
|
121
|
+
/** Trailing padding, for future developments. */
|
|
122
|
+
readonly endPadding: Array<BN>;
|
|
123
|
+
static readonly discriminator: Buffer<ArrayBuffer>;
|
|
124
|
+
static readonly layout: import("buffer-layout").Layout<WithdrawTicket>;
|
|
125
|
+
constructor(fields: WithdrawTicketFields);
|
|
126
|
+
static fetch(rpc: Rpc<GetAccountInfoApi>, address: Address, programId?: Address): Promise<WithdrawTicket | null>;
|
|
127
|
+
static fetchMultiple(rpc: Rpc<GetMultipleAccountsApi>, addresses: Address[], programId?: Address): Promise<Array<WithdrawTicket | null>>;
|
|
128
|
+
static decode(data: Buffer): WithdrawTicket;
|
|
129
|
+
toJSON(): WithdrawTicketJSON;
|
|
130
|
+
static fromJSON(obj: WithdrawTicketJSON): WithdrawTicket;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=WithdrawTicket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawTicket.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/WithdrawTicket.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EAGP,iBAAiB,EACjB,sBAAsB,EACtB,GAAG,EACJ,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,MAAM,OAAO,CAAA;AAMtB,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,cAAc,EAAE,EAAE,CAAA;IAClB,gFAAgF;IAChF,KAAK,EAAE,OAAO,CAAA;IACd,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,0BAA0B,EAAE,OAAO,CAAA;IACnC,gFAAgF;IAChF,sBAAsB,EAAE,EAAE,CAAA;IAC1B;;;;OAIG;IACH,kBAAkB,EAAE,EAAE,CAAA;IACtB;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,iDAAiD;IACjD,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,C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