@reflectmoney/junior 1.0.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/README.md +119 -0
- package/dist/classes/JuniorTranche.d.ts +201 -0
- package/dist/classes/JuniorTranche.js +709 -0
- package/dist/classes/PdaClient.d.ts +20 -0
- package/dist/classes/PdaClient.js +68 -0
- package/dist/classes/index.d.ts +2 -0
- package/dist/classes/index.js +18 -0
- package/dist/constants/index.d.ts +22 -0
- package/dist/constants/index.js +25 -0
- package/dist/generated/accounts/asset.d.ts +38 -0
- package/dist/generated/accounts/asset.js +74 -0
- package/dist/generated/accounts/cooldown.d.ts +40 -0
- package/dist/generated/accounts/cooldown.js +79 -0
- package/dist/generated/accounts/index.d.ts +12 -0
- package/dist/generated/accounts/index.js +28 -0
- package/dist/generated/accounts/liquidityPool.d.ts +57 -0
- package/dist/generated/accounts/liquidityPool.js +81 -0
- package/dist/generated/accounts/settings.d.ts +41 -0
- package/dist/generated/accounts/settings.js +80 -0
- package/dist/generated/accounts/userPermissions.d.ts +34 -0
- package/dist/generated/accounts/userPermissions.js +70 -0
- package/dist/generated/errors/index.d.ts +8 -0
- package/dist/generated/errors/index.js +24 -0
- package/dist/generated/errors/rlp.d.ts +131 -0
- package/dist/generated/errors/rlp.js +197 -0
- package/dist/generated/index.d.ts +12 -0
- package/dist/generated/index.js +28 -0
- package/dist/generated/instructions/addAsset.d.ts +80 -0
- package/dist/generated/instructions/addAsset.js +188 -0
- package/dist/generated/instructions/createPermissionAccount.d.ts +67 -0
- package/dist/generated/instructions/createPermissionAccount.js +166 -0
- package/dist/generated/instructions/deposit.d.ts +115 -0
- package/dist/generated/instructions/deposit.js +294 -0
- package/dist/generated/instructions/forceRemoveAsset.d.ts +82 -0
- package/dist/generated/instructions/forceRemoveAsset.js +186 -0
- package/dist/generated/instructions/freezeFunctionality.d.ts +72 -0
- package/dist/generated/instructions/freezeFunctionality.js +175 -0
- package/dist/generated/instructions/index.d.ts +23 -0
- package/dist/generated/instructions/index.js +39 -0
- package/dist/generated/instructions/initializeLp.d.ts +99 -0
- package/dist/generated/instructions/initializeLp.js +230 -0
- package/dist/generated/instructions/initializePoolReserve.d.ts +83 -0
- package/dist/generated/instructions/initializePoolReserve.js +228 -0
- package/dist/generated/instructions/initializeRlp.d.ts +67 -0
- package/dist/generated/instructions/initializeRlp.js +163 -0
- package/dist/generated/instructions/requestWithdrawal.d.ts +99 -0
- package/dist/generated/instructions/requestWithdrawal.js +254 -0
- package/dist/generated/instructions/slash.d.ts +151 -0
- package/dist/generated/instructions/slash.js +212 -0
- package/dist/generated/instructions/swap.d.ts +119 -0
- package/dist/generated/instructions/swap.js +309 -0
- package/dist/generated/instructions/updateActionRole.d.ts +76 -0
- package/dist/generated/instructions/updateActionRole.js +174 -0
- package/dist/generated/instructions/updateDepositCap.d.ts +71 -0
- package/dist/generated/instructions/updateDepositCap.js +156 -0
- package/dist/generated/instructions/updateOracle.d.ts +66 -0
- package/dist/generated/instructions/updateOracle.js +151 -0
- package/dist/generated/instructions/updateRoleHolder.d.ts +80 -0
- package/dist/generated/instructions/updateRoleHolder.js +185 -0
- package/dist/generated/instructions/withdraw.d.ts +95 -0
- package/dist/generated/instructions/withdraw.js +235 -0
- package/dist/generated/programs/index.d.ts +8 -0
- package/dist/generated/programs/index.js +24 -0
- package/dist/generated/programs/rlp.d.ts +75 -0
- package/dist/generated/programs/rlp.js +233 -0
- package/dist/generated/shared/index.d.ts +49 -0
- package/dist/generated/shared/index.js +94 -0
- package/dist/generated/types/accessControl.d.ts +20 -0
- package/dist/generated/types/accessControl.js +29 -0
- package/dist/generated/types/accessLevel.d.ts +16 -0
- package/dist/generated/types/accessLevel.js +28 -0
- package/dist/generated/types/accessMap.d.ts +20 -0
- package/dist/generated/types/accessMap.js +35 -0
- package/dist/generated/types/action.d.ts +32 -0
- package/dist/generated/types/action.js +44 -0
- package/dist/generated/types/actionMapping.d.ts +22 -0
- package/dist/generated/types/actionMapping.js +31 -0
- package/dist/generated/types/addAssetEvent.d.ts +17 -0
- package/dist/generated/types/addAssetEvent.js +30 -0
- package/dist/generated/types/createPermissionAccountEvent.d.ts +16 -0
- package/dist/generated/types/createPermissionAccountEvent.js +28 -0
- package/dist/generated/types/depositEvent.d.ts +27 -0
- package/dist/generated/types/depositEvent.js +36 -0
- package/dist/generated/types/depositRewardEvent.d.ts +21 -0
- package/dist/generated/types/depositRewardEvent.js +30 -0
- package/dist/generated/types/forceRemoveAssetEvent.d.ts +18 -0
- package/dist/generated/types/forceRemoveAssetEvent.js +32 -0
- package/dist/generated/types/freezeProtocolActionEvent.d.ts +20 -0
- package/dist/generated/types/freezeProtocolActionEvent.js +29 -0
- package/dist/generated/types/index.d.ts +32 -0
- package/dist/generated/types/index.js +48 -0
- package/dist/generated/types/initializeLiquidityPoolEvent.d.ts +17 -0
- package/dist/generated/types/initializeLiquidityPoolEvent.js +30 -0
- package/dist/generated/types/initializeRlpEvent.d.ts +15 -0
- package/dist/generated/types/initializeRlpEvent.js +22 -0
- package/dist/generated/types/killSwitch.d.ts +15 -0
- package/dist/generated/types/killSwitch.js +22 -0
- package/dist/generated/types/levelRoles.d.ts +18 -0
- package/dist/generated/types/levelRoles.js +23 -0
- package/dist/generated/types/oracle.d.ts +25 -0
- package/dist/generated/types/oracle.js +56 -0
- package/dist/generated/types/requestWithdrawEvent.d.ts +21 -0
- package/dist/generated/types/requestWithdrawEvent.js +30 -0
- package/dist/generated/types/role.d.ts +21 -0
- package/dist/generated/types/role.js +33 -0
- package/dist/generated/types/slashEvent.d.ts +27 -0
- package/dist/generated/types/slashEvent.js +36 -0
- package/dist/generated/types/swapEvent.d.ts +23 -0
- package/dist/generated/types/swapEvent.js +32 -0
- package/dist/generated/types/update.d.ts +16 -0
- package/dist/generated/types/update.js +28 -0
- package/dist/generated/types/updateActionRoleEvent.d.ts +22 -0
- package/dist/generated/types/updateActionRoleEvent.js +31 -0
- package/dist/generated/types/updateDepositCapEvent.d.ts +21 -0
- package/dist/generated/types/updateDepositCapEvent.js +30 -0
- package/dist/generated/types/updateOracleEvent.d.ts +18 -0
- package/dist/generated/types/updateOracleEvent.js +32 -0
- package/dist/generated/types/updateRoleHolderEvent.d.ts +22 -0
- package/dist/generated/types/updateRoleHolderEvent.js +31 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/package.json +41 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SETTINGS_DISCRIMINATOR = void 0;
|
|
11
|
+
exports.getSettingsDiscriminatorBytes = getSettingsDiscriminatorBytes;
|
|
12
|
+
exports.getSettingsEncoder = getSettingsEncoder;
|
|
13
|
+
exports.getSettingsDecoder = getSettingsDecoder;
|
|
14
|
+
exports.getSettingsCodec = getSettingsCodec;
|
|
15
|
+
exports.decodeSettings = decodeSettings;
|
|
16
|
+
exports.fetchSettings = fetchSettings;
|
|
17
|
+
exports.fetchMaybeSettings = fetchMaybeSettings;
|
|
18
|
+
exports.fetchAllSettings = fetchAllSettings;
|
|
19
|
+
exports.fetchAllMaybeSettings = fetchAllMaybeSettings;
|
|
20
|
+
exports.getSettingsSize = getSettingsSize;
|
|
21
|
+
const kit_1 = require("@solana/kit");
|
|
22
|
+
const types_1 = require("../types");
|
|
23
|
+
exports.SETTINGS_DISCRIMINATOR = new Uint8Array([
|
|
24
|
+
223, 179, 163, 190, 177, 224, 67, 173,
|
|
25
|
+
]);
|
|
26
|
+
function getSettingsDiscriminatorBytes() {
|
|
27
|
+
return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.SETTINGS_DISCRIMINATOR);
|
|
28
|
+
}
|
|
29
|
+
/** Gets the encoder for {@link SettingsArgs} account data. */
|
|
30
|
+
function getSettingsEncoder() {
|
|
31
|
+
return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
|
|
32
|
+
["discriminator", (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)],
|
|
33
|
+
["bump", (0, kit_1.getU8Encoder)()],
|
|
34
|
+
["liquidityPools", (0, kit_1.getU8Encoder)()],
|
|
35
|
+
["assets", (0, kit_1.getU8Encoder)()],
|
|
36
|
+
["accessControl", (0, types_1.getAccessControlEncoder)()],
|
|
37
|
+
["swapFeeBps", (0, kit_1.getU16Encoder)()],
|
|
38
|
+
["supremoCount", (0, kit_1.getU8Encoder)()],
|
|
39
|
+
]), (value) => ({ ...value, discriminator: exports.SETTINGS_DISCRIMINATOR }));
|
|
40
|
+
}
|
|
41
|
+
/** Gets the decoder for {@link Settings} account data. */
|
|
42
|
+
function getSettingsDecoder() {
|
|
43
|
+
return (0, kit_1.getStructDecoder)([
|
|
44
|
+
["discriminator", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
|
|
45
|
+
["bump", (0, kit_1.getU8Decoder)()],
|
|
46
|
+
["liquidityPools", (0, kit_1.getU8Decoder)()],
|
|
47
|
+
["assets", (0, kit_1.getU8Decoder)()],
|
|
48
|
+
["accessControl", (0, types_1.getAccessControlDecoder)()],
|
|
49
|
+
["swapFeeBps", (0, kit_1.getU16Decoder)()],
|
|
50
|
+
["supremoCount", (0, kit_1.getU8Decoder)()],
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
/** Gets the codec for {@link Settings} account data. */
|
|
54
|
+
function getSettingsCodec() {
|
|
55
|
+
return (0, kit_1.combineCodec)(getSettingsEncoder(), getSettingsDecoder());
|
|
56
|
+
}
|
|
57
|
+
function decodeSettings(encodedAccount) {
|
|
58
|
+
return (0, kit_1.decodeAccount)(encodedAccount, getSettingsDecoder());
|
|
59
|
+
}
|
|
60
|
+
async function fetchSettings(rpc, address, config) {
|
|
61
|
+
const maybeAccount = await fetchMaybeSettings(rpc, address, config);
|
|
62
|
+
(0, kit_1.assertAccountExists)(maybeAccount);
|
|
63
|
+
return maybeAccount;
|
|
64
|
+
}
|
|
65
|
+
async function fetchMaybeSettings(rpc, address, config) {
|
|
66
|
+
const maybeAccount = await (0, kit_1.fetchEncodedAccount)(rpc, address, config);
|
|
67
|
+
return decodeSettings(maybeAccount);
|
|
68
|
+
}
|
|
69
|
+
async function fetchAllSettings(rpc, addresses, config) {
|
|
70
|
+
const maybeAccounts = await fetchAllMaybeSettings(rpc, addresses, config);
|
|
71
|
+
(0, kit_1.assertAccountsExist)(maybeAccounts);
|
|
72
|
+
return maybeAccounts;
|
|
73
|
+
}
|
|
74
|
+
async function fetchAllMaybeSettings(rpc, addresses, config) {
|
|
75
|
+
const maybeAccounts = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses, config);
|
|
76
|
+
return maybeAccounts.map((maybeAccount) => decodeSettings(maybeAccount));
|
|
77
|
+
}
|
|
78
|
+
function getSettingsSize() {
|
|
79
|
+
return 379;
|
|
80
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from "@solana/kit";
|
|
9
|
+
import { type LevelRoles, type LevelRolesArgs } from "../types";
|
|
10
|
+
export declare const USER_PERMISSIONS_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getUserPermissionsDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
12
|
+
export type UserPermissions = {
|
|
13
|
+
discriminator: ReadonlyUint8Array;
|
|
14
|
+
bump: number;
|
|
15
|
+
authority: Address;
|
|
16
|
+
protocolRoles: LevelRoles;
|
|
17
|
+
};
|
|
18
|
+
export type UserPermissionsArgs = {
|
|
19
|
+
bump: number;
|
|
20
|
+
authority: Address;
|
|
21
|
+
protocolRoles: LevelRolesArgs;
|
|
22
|
+
};
|
|
23
|
+
/** Gets the encoder for {@link UserPermissionsArgs} account data. */
|
|
24
|
+
export declare function getUserPermissionsEncoder(): Encoder<UserPermissionsArgs>;
|
|
25
|
+
/** Gets the decoder for {@link UserPermissions} account data. */
|
|
26
|
+
export declare function getUserPermissionsDecoder(): Decoder<UserPermissions>;
|
|
27
|
+
/** Gets the codec for {@link UserPermissions} account data. */
|
|
28
|
+
export declare function getUserPermissionsCodec(): Codec<UserPermissionsArgs, UserPermissions>;
|
|
29
|
+
export declare function decodeUserPermissions<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<UserPermissions, TAddress>;
|
|
30
|
+
export declare function decodeUserPermissions<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<UserPermissions, TAddress>;
|
|
31
|
+
export declare function fetchUserPermissions<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<UserPermissions, TAddress>>;
|
|
32
|
+
export declare function fetchMaybeUserPermissions<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<UserPermissions, TAddress>>;
|
|
33
|
+
export declare function fetchAllUserPermissions(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<UserPermissions>[]>;
|
|
34
|
+
export declare function fetchAllMaybeUserPermissions(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<UserPermissions>[]>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.USER_PERMISSIONS_DISCRIMINATOR = void 0;
|
|
11
|
+
exports.getUserPermissionsDiscriminatorBytes = getUserPermissionsDiscriminatorBytes;
|
|
12
|
+
exports.getUserPermissionsEncoder = getUserPermissionsEncoder;
|
|
13
|
+
exports.getUserPermissionsDecoder = getUserPermissionsDecoder;
|
|
14
|
+
exports.getUserPermissionsCodec = getUserPermissionsCodec;
|
|
15
|
+
exports.decodeUserPermissions = decodeUserPermissions;
|
|
16
|
+
exports.fetchUserPermissions = fetchUserPermissions;
|
|
17
|
+
exports.fetchMaybeUserPermissions = fetchMaybeUserPermissions;
|
|
18
|
+
exports.fetchAllUserPermissions = fetchAllUserPermissions;
|
|
19
|
+
exports.fetchAllMaybeUserPermissions = fetchAllMaybeUserPermissions;
|
|
20
|
+
const kit_1 = require("@solana/kit");
|
|
21
|
+
const types_1 = require("../types");
|
|
22
|
+
exports.USER_PERMISSIONS_DISCRIMINATOR = new Uint8Array([
|
|
23
|
+
195, 173, 80, 32, 40, 216, 78, 110,
|
|
24
|
+
]);
|
|
25
|
+
function getUserPermissionsDiscriminatorBytes() {
|
|
26
|
+
return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.USER_PERMISSIONS_DISCRIMINATOR);
|
|
27
|
+
}
|
|
28
|
+
/** Gets the encoder for {@link UserPermissionsArgs} account data. */
|
|
29
|
+
function getUserPermissionsEncoder() {
|
|
30
|
+
return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
|
|
31
|
+
["discriminator", (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)],
|
|
32
|
+
["bump", (0, kit_1.getU8Encoder)()],
|
|
33
|
+
["authority", (0, kit_1.getAddressEncoder)()],
|
|
34
|
+
["protocolRoles", (0, types_1.getLevelRolesEncoder)()],
|
|
35
|
+
]), (value) => ({ ...value, discriminator: exports.USER_PERMISSIONS_DISCRIMINATOR }));
|
|
36
|
+
}
|
|
37
|
+
/** Gets the decoder for {@link UserPermissions} account data. */
|
|
38
|
+
function getUserPermissionsDecoder() {
|
|
39
|
+
return (0, kit_1.getStructDecoder)([
|
|
40
|
+
["discriminator", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
|
|
41
|
+
["bump", (0, kit_1.getU8Decoder)()],
|
|
42
|
+
["authority", (0, kit_1.getAddressDecoder)()],
|
|
43
|
+
["protocolRoles", (0, types_1.getLevelRolesDecoder)()],
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
/** Gets the codec for {@link UserPermissions} account data. */
|
|
47
|
+
function getUserPermissionsCodec() {
|
|
48
|
+
return (0, kit_1.combineCodec)(getUserPermissionsEncoder(), getUserPermissionsDecoder());
|
|
49
|
+
}
|
|
50
|
+
function decodeUserPermissions(encodedAccount) {
|
|
51
|
+
return (0, kit_1.decodeAccount)(encodedAccount, getUserPermissionsDecoder());
|
|
52
|
+
}
|
|
53
|
+
async function fetchUserPermissions(rpc, address, config) {
|
|
54
|
+
const maybeAccount = await fetchMaybeUserPermissions(rpc, address, config);
|
|
55
|
+
(0, kit_1.assertAccountExists)(maybeAccount);
|
|
56
|
+
return maybeAccount;
|
|
57
|
+
}
|
|
58
|
+
async function fetchMaybeUserPermissions(rpc, address, config) {
|
|
59
|
+
const maybeAccount = await (0, kit_1.fetchEncodedAccount)(rpc, address, config);
|
|
60
|
+
return decodeUserPermissions(maybeAccount);
|
|
61
|
+
}
|
|
62
|
+
async function fetchAllUserPermissions(rpc, addresses, config) {
|
|
63
|
+
const maybeAccounts = await fetchAllMaybeUserPermissions(rpc, addresses, config);
|
|
64
|
+
(0, kit_1.assertAccountsExist)(maybeAccounts);
|
|
65
|
+
return maybeAccounts;
|
|
66
|
+
}
|
|
67
|
+
async function fetchAllMaybeUserPermissions(rpc, addresses, config) {
|
|
68
|
+
const maybeAccounts = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses, config);
|
|
69
|
+
return maybeAccounts.map((maybeAccount) => decodeUserPermissions(maybeAccount));
|
|
70
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
__exportStar(require("./rlp"), exports);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from "@solana/kit";
|
|
9
|
+
/** InvalidSigner: InvalidSigner */
|
|
10
|
+
export declare const RLP_ERROR__INVALID_SIGNER = 6000;
|
|
11
|
+
/** InvalidInput: InvalidInput */
|
|
12
|
+
export declare const RLP_ERROR__INVALID_INPUT = 6001;
|
|
13
|
+
/** AssetNotWhitelisted: AssetNotWhitelisted */
|
|
14
|
+
export declare const RLP_ERROR__ASSET_NOT_WHITELISTED = 6002;
|
|
15
|
+
/** DepositTooLow: DepositTooLow */
|
|
16
|
+
export declare const RLP_ERROR__DEPOSIT_TOO_LOW = 6003;
|
|
17
|
+
/** DepositCapOverflow: DepositCapOverflow */
|
|
18
|
+
export declare const RLP_ERROR__DEPOSIT_CAP_OVERFLOW = 6004;
|
|
19
|
+
/** NotEnoughFunds: NotEnoughFunds */
|
|
20
|
+
export declare const RLP_ERROR__NOT_ENOUGH_FUNDS = 6005;
|
|
21
|
+
/** NotEnoughReceiptTokens: NotEnoughReceiptTokens */
|
|
22
|
+
export declare const RLP_ERROR__NOT_ENOUGH_RECEIPT_TOKENS = 6006;
|
|
23
|
+
/** NotEnoughFundsToSlash: NotEnoughFundsToSlash */
|
|
24
|
+
export declare const RLP_ERROR__NOT_ENOUGH_FUNDS_TO_SLASH = 6007;
|
|
25
|
+
/** DepositsLocked: DepositsLocked */
|
|
26
|
+
export declare const RLP_ERROR__DEPOSITS_LOCKED = 6008;
|
|
27
|
+
/** DepositsOpen: DepositsOpen */
|
|
28
|
+
export declare const RLP_ERROR__DEPOSITS_OPEN = 6009;
|
|
29
|
+
/** DepositsNotSlashed: DepositsNotSlashed */
|
|
30
|
+
export declare const RLP_ERROR__DEPOSITS_NOT_SLASHED = 6010;
|
|
31
|
+
/** AllDepositsSlashed: AllDepositsSlashed */
|
|
32
|
+
export declare const RLP_ERROR__ALL_DEPOSITS_SLASHED = 6011;
|
|
33
|
+
/** SlashAmountMismatch: SlashAmountMismatch */
|
|
34
|
+
export declare const RLP_ERROR__SLASH_AMOUNT_MISMATCH = 6012;
|
|
35
|
+
/** ShareConfigOverflow: ShareConfigOverflow */
|
|
36
|
+
export declare const RLP_ERROR__SHARE_CONFIG_OVERFLOW = 6013;
|
|
37
|
+
/** Frozen: Frozen */
|
|
38
|
+
export declare const RLP_ERROR__FROZEN = 6014;
|
|
39
|
+
/** InvalidOracle: InvalidOracle */
|
|
40
|
+
export declare const RLP_ERROR__INVALID_ORACLE = 6015;
|
|
41
|
+
/** MathOverflow: MathOverflow */
|
|
42
|
+
export declare const RLP_ERROR__MATH_OVERFLOW = 6016;
|
|
43
|
+
/** LockupInForce: LockupInForce */
|
|
44
|
+
export declare const RLP_ERROR__LOCKUP_IN_FORCE = 6017;
|
|
45
|
+
/** BoostNotApplied: BoostNotApplied */
|
|
46
|
+
export declare const RLP_ERROR__BOOST_NOT_APPLIED = 6018;
|
|
47
|
+
/** InvalidSigners: InvalidSigners */
|
|
48
|
+
export declare const RLP_ERROR__INVALID_SIGNERS = 6019;
|
|
49
|
+
/** TransferSignatureRequired: TransferSignatureRequired */
|
|
50
|
+
export declare const RLP_ERROR__TRANSFER_SIGNATURE_REQUIRED = 6020;
|
|
51
|
+
/** ColdWalletNotSlashed: ColdWalletNotSlashed */
|
|
52
|
+
export declare const RLP_ERROR__COLD_WALLET_NOT_SLASHED = 6021;
|
|
53
|
+
/** PermissionsTooLow: PermissionsTooLow */
|
|
54
|
+
export declare const RLP_ERROR__PERMISSIONS_TOO_LOW = 6022;
|
|
55
|
+
/** WithdrawalThresholdOverflow: WithdrawalThresholdOverflow */
|
|
56
|
+
export declare const RLP_ERROR__WITHDRAWAL_THRESHOLD_OVERFLOW = 6023;
|
|
57
|
+
/** PoolImbalance: PoolImbalance */
|
|
58
|
+
export declare const RLP_ERROR__POOL_IMBALANCE = 6024;
|
|
59
|
+
/** InvalidReceiptTokenSetup: InvalidReceiptTokenSetup */
|
|
60
|
+
export declare const RLP_ERROR__INVALID_RECEIPT_TOKEN_SETUP = 6025;
|
|
61
|
+
/** InvalidReceiptTokenDecimals: InvalidReceiptTokenDecimals */
|
|
62
|
+
export declare const RLP_ERROR__INVALID_RECEIPT_TOKEN_DECIMALS = 6026;
|
|
63
|
+
/** InvalidReceiptTokenMintAuthority: InvalidReceiptTokenMintAuthority */
|
|
64
|
+
export declare const RLP_ERROR__INVALID_RECEIPT_TOKEN_MINT_AUTHORITY = 6027;
|
|
65
|
+
/** InvalidReceiptTokenSupply: InvalidReceiptTokenSupply */
|
|
66
|
+
export declare const RLP_ERROR__INVALID_RECEIPT_TOKEN_SUPPLY = 6028;
|
|
67
|
+
/** InvalidReceiptTokenFreezeAuthority: InvalidReceiptTokenFreezeAuthority */
|
|
68
|
+
export declare const RLP_ERROR__INVALID_RECEIPT_TOKEN_FREEZE_AUTHORITY = 6029;
|
|
69
|
+
/** MinimumSuperadminsRequired: MinimumSuperadminsRequired */
|
|
70
|
+
export declare const RLP_ERROR__MINIMUM_SUPERADMINS_REQUIRED = 6030;
|
|
71
|
+
/** IntentValueTooLow: IntentValueTooLow */
|
|
72
|
+
export declare const RLP_ERROR__INTENT_VALUE_TOO_LOW = 6031;
|
|
73
|
+
/** WithdrawalNeedsIntent: WithdrawalNeedsIntent */
|
|
74
|
+
export declare const RLP_ERROR__WITHDRAWAL_NEEDS_INTENT = 6032;
|
|
75
|
+
/** PriceError: PriceError */
|
|
76
|
+
export declare const RLP_ERROR__PRICE_ERROR = 6033;
|
|
77
|
+
/** CooldownInForce: CooldownInForce */
|
|
78
|
+
export declare const RLP_ERROR__COOLDOWN_IN_FORCE = 6034;
|
|
79
|
+
/** SlippageExceeded: SlippageExceeded */
|
|
80
|
+
export declare const RLP_ERROR__SLIPPAGE_EXCEEDED = 6035;
|
|
81
|
+
/** InvalidTokenOrder: InvalidTokenOrder */
|
|
82
|
+
export declare const RLP_ERROR__INVALID_TOKEN_ORDER = 6036;
|
|
83
|
+
/** ActionFrozen: ActionFrozen */
|
|
84
|
+
export declare const RLP_ERROR__ACTION_FROZEN = 6037;
|
|
85
|
+
/** ActionNotFound: ActionNotFound */
|
|
86
|
+
export declare const RLP_ERROR__ACTION_NOT_FOUND = 6038;
|
|
87
|
+
/** NoEntriesLeft: NoEntriesLeft */
|
|
88
|
+
export declare const RLP_ERROR__NO_ENTRIES_LEFT = 6039;
|
|
89
|
+
/** RoleNotUnderAction: RoleNotUnderAction */
|
|
90
|
+
export declare const RLP_ERROR__ROLE_NOT_UNDER_ACTION = 6040;
|
|
91
|
+
/** ActionHasAssignedRole: ActionHasAssignedRole */
|
|
92
|
+
export declare const RLP_ERROR__ACTION_HAS_ASSIGNED_ROLE = 6041;
|
|
93
|
+
/** InvalidState: InvalidState */
|
|
94
|
+
export declare const RLP_ERROR__INVALID_STATE = 6042;
|
|
95
|
+
/** IncorrectAdmin: IncorrectAdmin */
|
|
96
|
+
export declare const RLP_ERROR__INCORRECT_ADMIN = 6043;
|
|
97
|
+
/** SameAdmin: SameAdmin */
|
|
98
|
+
export declare const RLP_ERROR__SAME_ADMIN = 6044;
|
|
99
|
+
/** AlreadyFrozen: AlreadyFrozen */
|
|
100
|
+
export declare const RLP_ERROR__ALREADY_FROZEN = 6045;
|
|
101
|
+
/** AlreadyUnfrozen: AlreadyUnfrozen */
|
|
102
|
+
export declare const RLP_ERROR__ALREADY_UNFROZEN = 6046;
|
|
103
|
+
/** OracleDataTooStale: OracleDataTooStale */
|
|
104
|
+
export declare const RLP_ERROR__ORACLE_DATA_TOO_STALE = 6047;
|
|
105
|
+
/** PoolAssetFrozen: PoolAssetFrozen */
|
|
106
|
+
export declare const RLP_ERROR__POOL_ASSET_FROZEN = 6048;
|
|
107
|
+
/** PoolAssetNotFrozen: PoolAssetNotFrozen */
|
|
108
|
+
export declare const RLP_ERROR__POOL_ASSET_NOT_FROZEN = 6049;
|
|
109
|
+
/** CannotRemoveLastAsset: CannotRemoveLastAsset */
|
|
110
|
+
export declare const RLP_ERROR__CANNOT_REMOVE_LAST_ASSET = 6050;
|
|
111
|
+
/** PoolHasNoProtectedVault: PoolHasNoProtectedVault */
|
|
112
|
+
export declare const RLP_ERROR__POOL_HAS_NO_PROTECTED_VAULT = 6051;
|
|
113
|
+
/** ProtectedVaultMismatch: ProtectedVaultMismatch */
|
|
114
|
+
export declare const RLP_ERROR__PROTECTED_VAULT_MISMATCH = 6052;
|
|
115
|
+
/** NoNavLossToCover: NoNavLossToCover */
|
|
116
|
+
export declare const RLP_ERROR__NO_NAV_LOSS_TO_COVER = 6053;
|
|
117
|
+
/** NavCoverageExceedsLoss: NavCoverageExceedsLoss */
|
|
118
|
+
export declare const RLP_ERROR__NAV_COVERAGE_EXCEEDS_LOSS = 6054;
|
|
119
|
+
/** ProtectedVaultMintMismatch: ProtectedVaultMintMismatch */
|
|
120
|
+
export declare const RLP_ERROR__PROTECTED_VAULT_MINT_MISMATCH = 6055;
|
|
121
|
+
export type RlpError = typeof RLP_ERROR__ACTION_FROZEN | typeof RLP_ERROR__ACTION_HAS_ASSIGNED_ROLE | typeof RLP_ERROR__ACTION_NOT_FOUND | typeof RLP_ERROR__ALL_DEPOSITS_SLASHED | typeof RLP_ERROR__ALREADY_FROZEN | typeof RLP_ERROR__ALREADY_UNFROZEN | typeof RLP_ERROR__ASSET_NOT_WHITELISTED | typeof RLP_ERROR__BOOST_NOT_APPLIED | typeof RLP_ERROR__CANNOT_REMOVE_LAST_ASSET | typeof RLP_ERROR__COLD_WALLET_NOT_SLASHED | typeof RLP_ERROR__COOLDOWN_IN_FORCE | typeof RLP_ERROR__DEPOSIT_CAP_OVERFLOW | typeof RLP_ERROR__DEPOSITS_LOCKED | typeof RLP_ERROR__DEPOSITS_NOT_SLASHED | typeof RLP_ERROR__DEPOSITS_OPEN | typeof RLP_ERROR__DEPOSIT_TOO_LOW | typeof RLP_ERROR__FROZEN | typeof RLP_ERROR__INCORRECT_ADMIN | typeof RLP_ERROR__INTENT_VALUE_TOO_LOW | typeof RLP_ERROR__INVALID_INPUT | typeof RLP_ERROR__INVALID_ORACLE | typeof RLP_ERROR__INVALID_RECEIPT_TOKEN_DECIMALS | typeof RLP_ERROR__INVALID_RECEIPT_TOKEN_FREEZE_AUTHORITY | typeof RLP_ERROR__INVALID_RECEIPT_TOKEN_MINT_AUTHORITY | typeof RLP_ERROR__INVALID_RECEIPT_TOKEN_SETUP | typeof RLP_ERROR__INVALID_RECEIPT_TOKEN_SUPPLY | typeof RLP_ERROR__INVALID_SIGNER | typeof RLP_ERROR__INVALID_SIGNERS | typeof RLP_ERROR__INVALID_STATE | typeof RLP_ERROR__INVALID_TOKEN_ORDER | typeof RLP_ERROR__LOCKUP_IN_FORCE | typeof RLP_ERROR__MATH_OVERFLOW | typeof RLP_ERROR__MINIMUM_SUPERADMINS_REQUIRED | typeof RLP_ERROR__NAV_COVERAGE_EXCEEDS_LOSS | typeof RLP_ERROR__NO_ENTRIES_LEFT | typeof RLP_ERROR__NO_NAV_LOSS_TO_COVER | typeof RLP_ERROR__NOT_ENOUGH_FUNDS | typeof RLP_ERROR__NOT_ENOUGH_FUNDS_TO_SLASH | typeof RLP_ERROR__NOT_ENOUGH_RECEIPT_TOKENS | typeof RLP_ERROR__ORACLE_DATA_TOO_STALE | typeof RLP_ERROR__PERMISSIONS_TOO_LOW | typeof RLP_ERROR__POOL_ASSET_FROZEN | typeof RLP_ERROR__POOL_ASSET_NOT_FROZEN | typeof RLP_ERROR__POOL_HAS_NO_PROTECTED_VAULT | typeof RLP_ERROR__POOL_IMBALANCE | typeof RLP_ERROR__PRICE_ERROR | typeof RLP_ERROR__PROTECTED_VAULT_MINT_MISMATCH | typeof RLP_ERROR__PROTECTED_VAULT_MISMATCH | typeof RLP_ERROR__ROLE_NOT_UNDER_ACTION | typeof RLP_ERROR__SAME_ADMIN | typeof RLP_ERROR__SHARE_CONFIG_OVERFLOW | typeof RLP_ERROR__SLASH_AMOUNT_MISMATCH | typeof RLP_ERROR__SLIPPAGE_EXCEEDED | typeof RLP_ERROR__TRANSFER_SIGNATURE_REQUIRED | typeof RLP_ERROR__WITHDRAWAL_NEEDS_INTENT | typeof RLP_ERROR__WITHDRAWAL_THRESHOLD_OVERFLOW;
|
|
122
|
+
export declare function getRlpErrorMessage(code: RlpError): string;
|
|
123
|
+
export declare function isRlpError<TProgramErrorCode extends RlpError>(error: unknown, transactionMessage: {
|
|
124
|
+
instructions: Record<number, {
|
|
125
|
+
programAddress: Address;
|
|
126
|
+
}>;
|
|
127
|
+
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
|
|
128
|
+
context: Readonly<{
|
|
129
|
+
code: TProgramErrorCode;
|
|
130
|
+
}>;
|
|
131
|
+
}>;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.RLP_ERROR__POOL_ASSET_NOT_FROZEN = exports.RLP_ERROR__POOL_ASSET_FROZEN = exports.RLP_ERROR__ORACLE_DATA_TOO_STALE = exports.RLP_ERROR__ALREADY_UNFROZEN = exports.RLP_ERROR__ALREADY_FROZEN = exports.RLP_ERROR__SAME_ADMIN = exports.RLP_ERROR__INCORRECT_ADMIN = exports.RLP_ERROR__INVALID_STATE = exports.RLP_ERROR__ACTION_HAS_ASSIGNED_ROLE = exports.RLP_ERROR__ROLE_NOT_UNDER_ACTION = exports.RLP_ERROR__NO_ENTRIES_LEFT = exports.RLP_ERROR__ACTION_NOT_FOUND = exports.RLP_ERROR__ACTION_FROZEN = exports.RLP_ERROR__INVALID_TOKEN_ORDER = exports.RLP_ERROR__SLIPPAGE_EXCEEDED = exports.RLP_ERROR__COOLDOWN_IN_FORCE = exports.RLP_ERROR__PRICE_ERROR = exports.RLP_ERROR__WITHDRAWAL_NEEDS_INTENT = exports.RLP_ERROR__INTENT_VALUE_TOO_LOW = exports.RLP_ERROR__MINIMUM_SUPERADMINS_REQUIRED = exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_FREEZE_AUTHORITY = exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_SUPPLY = exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_MINT_AUTHORITY = exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_DECIMALS = exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_SETUP = exports.RLP_ERROR__POOL_IMBALANCE = exports.RLP_ERROR__WITHDRAWAL_THRESHOLD_OVERFLOW = exports.RLP_ERROR__PERMISSIONS_TOO_LOW = exports.RLP_ERROR__COLD_WALLET_NOT_SLASHED = exports.RLP_ERROR__TRANSFER_SIGNATURE_REQUIRED = exports.RLP_ERROR__INVALID_SIGNERS = exports.RLP_ERROR__BOOST_NOT_APPLIED = exports.RLP_ERROR__LOCKUP_IN_FORCE = exports.RLP_ERROR__MATH_OVERFLOW = exports.RLP_ERROR__INVALID_ORACLE = exports.RLP_ERROR__FROZEN = exports.RLP_ERROR__SHARE_CONFIG_OVERFLOW = exports.RLP_ERROR__SLASH_AMOUNT_MISMATCH = exports.RLP_ERROR__ALL_DEPOSITS_SLASHED = exports.RLP_ERROR__DEPOSITS_NOT_SLASHED = exports.RLP_ERROR__DEPOSITS_OPEN = exports.RLP_ERROR__DEPOSITS_LOCKED = exports.RLP_ERROR__NOT_ENOUGH_FUNDS_TO_SLASH = exports.RLP_ERROR__NOT_ENOUGH_RECEIPT_TOKENS = exports.RLP_ERROR__NOT_ENOUGH_FUNDS = exports.RLP_ERROR__DEPOSIT_CAP_OVERFLOW = exports.RLP_ERROR__DEPOSIT_TOO_LOW = exports.RLP_ERROR__ASSET_NOT_WHITELISTED = exports.RLP_ERROR__INVALID_INPUT = exports.RLP_ERROR__INVALID_SIGNER = void 0;
|
|
11
|
+
exports.RLP_ERROR__PROTECTED_VAULT_MINT_MISMATCH = exports.RLP_ERROR__NAV_COVERAGE_EXCEEDS_LOSS = exports.RLP_ERROR__NO_NAV_LOSS_TO_COVER = exports.RLP_ERROR__PROTECTED_VAULT_MISMATCH = exports.RLP_ERROR__POOL_HAS_NO_PROTECTED_VAULT = exports.RLP_ERROR__CANNOT_REMOVE_LAST_ASSET = void 0;
|
|
12
|
+
exports.getRlpErrorMessage = getRlpErrorMessage;
|
|
13
|
+
exports.isRlpError = isRlpError;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
const programs_1 = require("../programs");
|
|
16
|
+
/** InvalidSigner: InvalidSigner */
|
|
17
|
+
exports.RLP_ERROR__INVALID_SIGNER = 0x1770; // 6000
|
|
18
|
+
/** InvalidInput: InvalidInput */
|
|
19
|
+
exports.RLP_ERROR__INVALID_INPUT = 0x1771; // 6001
|
|
20
|
+
/** AssetNotWhitelisted: AssetNotWhitelisted */
|
|
21
|
+
exports.RLP_ERROR__ASSET_NOT_WHITELISTED = 0x1772; // 6002
|
|
22
|
+
/** DepositTooLow: DepositTooLow */
|
|
23
|
+
exports.RLP_ERROR__DEPOSIT_TOO_LOW = 0x1773; // 6003
|
|
24
|
+
/** DepositCapOverflow: DepositCapOverflow */
|
|
25
|
+
exports.RLP_ERROR__DEPOSIT_CAP_OVERFLOW = 0x1774; // 6004
|
|
26
|
+
/** NotEnoughFunds: NotEnoughFunds */
|
|
27
|
+
exports.RLP_ERROR__NOT_ENOUGH_FUNDS = 0x1775; // 6005
|
|
28
|
+
/** NotEnoughReceiptTokens: NotEnoughReceiptTokens */
|
|
29
|
+
exports.RLP_ERROR__NOT_ENOUGH_RECEIPT_TOKENS = 0x1776; // 6006
|
|
30
|
+
/** NotEnoughFundsToSlash: NotEnoughFundsToSlash */
|
|
31
|
+
exports.RLP_ERROR__NOT_ENOUGH_FUNDS_TO_SLASH = 0x1777; // 6007
|
|
32
|
+
/** DepositsLocked: DepositsLocked */
|
|
33
|
+
exports.RLP_ERROR__DEPOSITS_LOCKED = 0x1778; // 6008
|
|
34
|
+
/** DepositsOpen: DepositsOpen */
|
|
35
|
+
exports.RLP_ERROR__DEPOSITS_OPEN = 0x1779; // 6009
|
|
36
|
+
/** DepositsNotSlashed: DepositsNotSlashed */
|
|
37
|
+
exports.RLP_ERROR__DEPOSITS_NOT_SLASHED = 0x177a; // 6010
|
|
38
|
+
/** AllDepositsSlashed: AllDepositsSlashed */
|
|
39
|
+
exports.RLP_ERROR__ALL_DEPOSITS_SLASHED = 0x177b; // 6011
|
|
40
|
+
/** SlashAmountMismatch: SlashAmountMismatch */
|
|
41
|
+
exports.RLP_ERROR__SLASH_AMOUNT_MISMATCH = 0x177c; // 6012
|
|
42
|
+
/** ShareConfigOverflow: ShareConfigOverflow */
|
|
43
|
+
exports.RLP_ERROR__SHARE_CONFIG_OVERFLOW = 0x177d; // 6013
|
|
44
|
+
/** Frozen: Frozen */
|
|
45
|
+
exports.RLP_ERROR__FROZEN = 0x177e; // 6014
|
|
46
|
+
/** InvalidOracle: InvalidOracle */
|
|
47
|
+
exports.RLP_ERROR__INVALID_ORACLE = 0x177f; // 6015
|
|
48
|
+
/** MathOverflow: MathOverflow */
|
|
49
|
+
exports.RLP_ERROR__MATH_OVERFLOW = 0x1780; // 6016
|
|
50
|
+
/** LockupInForce: LockupInForce */
|
|
51
|
+
exports.RLP_ERROR__LOCKUP_IN_FORCE = 0x1781; // 6017
|
|
52
|
+
/** BoostNotApplied: BoostNotApplied */
|
|
53
|
+
exports.RLP_ERROR__BOOST_NOT_APPLIED = 0x1782; // 6018
|
|
54
|
+
/** InvalidSigners: InvalidSigners */
|
|
55
|
+
exports.RLP_ERROR__INVALID_SIGNERS = 0x1783; // 6019
|
|
56
|
+
/** TransferSignatureRequired: TransferSignatureRequired */
|
|
57
|
+
exports.RLP_ERROR__TRANSFER_SIGNATURE_REQUIRED = 0x1784; // 6020
|
|
58
|
+
/** ColdWalletNotSlashed: ColdWalletNotSlashed */
|
|
59
|
+
exports.RLP_ERROR__COLD_WALLET_NOT_SLASHED = 0x1785; // 6021
|
|
60
|
+
/** PermissionsTooLow: PermissionsTooLow */
|
|
61
|
+
exports.RLP_ERROR__PERMISSIONS_TOO_LOW = 0x1786; // 6022
|
|
62
|
+
/** WithdrawalThresholdOverflow: WithdrawalThresholdOverflow */
|
|
63
|
+
exports.RLP_ERROR__WITHDRAWAL_THRESHOLD_OVERFLOW = 0x1787; // 6023
|
|
64
|
+
/** PoolImbalance: PoolImbalance */
|
|
65
|
+
exports.RLP_ERROR__POOL_IMBALANCE = 0x1788; // 6024
|
|
66
|
+
/** InvalidReceiptTokenSetup: InvalidReceiptTokenSetup */
|
|
67
|
+
exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_SETUP = 0x1789; // 6025
|
|
68
|
+
/** InvalidReceiptTokenDecimals: InvalidReceiptTokenDecimals */
|
|
69
|
+
exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_DECIMALS = 0x178a; // 6026
|
|
70
|
+
/** InvalidReceiptTokenMintAuthority: InvalidReceiptTokenMintAuthority */
|
|
71
|
+
exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_MINT_AUTHORITY = 0x178b; // 6027
|
|
72
|
+
/** InvalidReceiptTokenSupply: InvalidReceiptTokenSupply */
|
|
73
|
+
exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_SUPPLY = 0x178c; // 6028
|
|
74
|
+
/** InvalidReceiptTokenFreezeAuthority: InvalidReceiptTokenFreezeAuthority */
|
|
75
|
+
exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_FREEZE_AUTHORITY = 0x178d; // 6029
|
|
76
|
+
/** MinimumSuperadminsRequired: MinimumSuperadminsRequired */
|
|
77
|
+
exports.RLP_ERROR__MINIMUM_SUPERADMINS_REQUIRED = 0x178e; // 6030
|
|
78
|
+
/** IntentValueTooLow: IntentValueTooLow */
|
|
79
|
+
exports.RLP_ERROR__INTENT_VALUE_TOO_LOW = 0x178f; // 6031
|
|
80
|
+
/** WithdrawalNeedsIntent: WithdrawalNeedsIntent */
|
|
81
|
+
exports.RLP_ERROR__WITHDRAWAL_NEEDS_INTENT = 0x1790; // 6032
|
|
82
|
+
/** PriceError: PriceError */
|
|
83
|
+
exports.RLP_ERROR__PRICE_ERROR = 0x1791; // 6033
|
|
84
|
+
/** CooldownInForce: CooldownInForce */
|
|
85
|
+
exports.RLP_ERROR__COOLDOWN_IN_FORCE = 0x1792; // 6034
|
|
86
|
+
/** SlippageExceeded: SlippageExceeded */
|
|
87
|
+
exports.RLP_ERROR__SLIPPAGE_EXCEEDED = 0x1793; // 6035
|
|
88
|
+
/** InvalidTokenOrder: InvalidTokenOrder */
|
|
89
|
+
exports.RLP_ERROR__INVALID_TOKEN_ORDER = 0x1794; // 6036
|
|
90
|
+
/** ActionFrozen: ActionFrozen */
|
|
91
|
+
exports.RLP_ERROR__ACTION_FROZEN = 0x1795; // 6037
|
|
92
|
+
/** ActionNotFound: ActionNotFound */
|
|
93
|
+
exports.RLP_ERROR__ACTION_NOT_FOUND = 0x1796; // 6038
|
|
94
|
+
/** NoEntriesLeft: NoEntriesLeft */
|
|
95
|
+
exports.RLP_ERROR__NO_ENTRIES_LEFT = 0x1797; // 6039
|
|
96
|
+
/** RoleNotUnderAction: RoleNotUnderAction */
|
|
97
|
+
exports.RLP_ERROR__ROLE_NOT_UNDER_ACTION = 0x1798; // 6040
|
|
98
|
+
/** ActionHasAssignedRole: ActionHasAssignedRole */
|
|
99
|
+
exports.RLP_ERROR__ACTION_HAS_ASSIGNED_ROLE = 0x1799; // 6041
|
|
100
|
+
/** InvalidState: InvalidState */
|
|
101
|
+
exports.RLP_ERROR__INVALID_STATE = 0x179a; // 6042
|
|
102
|
+
/** IncorrectAdmin: IncorrectAdmin */
|
|
103
|
+
exports.RLP_ERROR__INCORRECT_ADMIN = 0x179b; // 6043
|
|
104
|
+
/** SameAdmin: SameAdmin */
|
|
105
|
+
exports.RLP_ERROR__SAME_ADMIN = 0x179c; // 6044
|
|
106
|
+
/** AlreadyFrozen: AlreadyFrozen */
|
|
107
|
+
exports.RLP_ERROR__ALREADY_FROZEN = 0x179d; // 6045
|
|
108
|
+
/** AlreadyUnfrozen: AlreadyUnfrozen */
|
|
109
|
+
exports.RLP_ERROR__ALREADY_UNFROZEN = 0x179e; // 6046
|
|
110
|
+
/** OracleDataTooStale: OracleDataTooStale */
|
|
111
|
+
exports.RLP_ERROR__ORACLE_DATA_TOO_STALE = 0x179f; // 6047
|
|
112
|
+
/** PoolAssetFrozen: PoolAssetFrozen */
|
|
113
|
+
exports.RLP_ERROR__POOL_ASSET_FROZEN = 0x17a0; // 6048
|
|
114
|
+
/** PoolAssetNotFrozen: PoolAssetNotFrozen */
|
|
115
|
+
exports.RLP_ERROR__POOL_ASSET_NOT_FROZEN = 0x17a1; // 6049
|
|
116
|
+
/** CannotRemoveLastAsset: CannotRemoveLastAsset */
|
|
117
|
+
exports.RLP_ERROR__CANNOT_REMOVE_LAST_ASSET = 0x17a2; // 6050
|
|
118
|
+
/** PoolHasNoProtectedVault: PoolHasNoProtectedVault */
|
|
119
|
+
exports.RLP_ERROR__POOL_HAS_NO_PROTECTED_VAULT = 0x17a3; // 6051
|
|
120
|
+
/** ProtectedVaultMismatch: ProtectedVaultMismatch */
|
|
121
|
+
exports.RLP_ERROR__PROTECTED_VAULT_MISMATCH = 0x17a4; // 6052
|
|
122
|
+
/** NoNavLossToCover: NoNavLossToCover */
|
|
123
|
+
exports.RLP_ERROR__NO_NAV_LOSS_TO_COVER = 0x17a5; // 6053
|
|
124
|
+
/** NavCoverageExceedsLoss: NavCoverageExceedsLoss */
|
|
125
|
+
exports.RLP_ERROR__NAV_COVERAGE_EXCEEDS_LOSS = 0x17a6; // 6054
|
|
126
|
+
/** ProtectedVaultMintMismatch: ProtectedVaultMintMismatch */
|
|
127
|
+
exports.RLP_ERROR__PROTECTED_VAULT_MINT_MISMATCH = 0x17a7; // 6055
|
|
128
|
+
let rlpErrorMessages;
|
|
129
|
+
if (process.env.NODE_ENV !== "production") {
|
|
130
|
+
rlpErrorMessages = {
|
|
131
|
+
[exports.RLP_ERROR__ACTION_FROZEN]: `ActionFrozen`,
|
|
132
|
+
[exports.RLP_ERROR__ACTION_HAS_ASSIGNED_ROLE]: `ActionHasAssignedRole`,
|
|
133
|
+
[exports.RLP_ERROR__ACTION_NOT_FOUND]: `ActionNotFound`,
|
|
134
|
+
[exports.RLP_ERROR__ALL_DEPOSITS_SLASHED]: `AllDepositsSlashed`,
|
|
135
|
+
[exports.RLP_ERROR__ALREADY_FROZEN]: `AlreadyFrozen`,
|
|
136
|
+
[exports.RLP_ERROR__ALREADY_UNFROZEN]: `AlreadyUnfrozen`,
|
|
137
|
+
[exports.RLP_ERROR__ASSET_NOT_WHITELISTED]: `AssetNotWhitelisted`,
|
|
138
|
+
[exports.RLP_ERROR__BOOST_NOT_APPLIED]: `BoostNotApplied`,
|
|
139
|
+
[exports.RLP_ERROR__CANNOT_REMOVE_LAST_ASSET]: `CannotRemoveLastAsset`,
|
|
140
|
+
[exports.RLP_ERROR__COLD_WALLET_NOT_SLASHED]: `ColdWalletNotSlashed`,
|
|
141
|
+
[exports.RLP_ERROR__COOLDOWN_IN_FORCE]: `CooldownInForce`,
|
|
142
|
+
[exports.RLP_ERROR__DEPOSIT_CAP_OVERFLOW]: `DepositCapOverflow`,
|
|
143
|
+
[exports.RLP_ERROR__DEPOSITS_LOCKED]: `DepositsLocked`,
|
|
144
|
+
[exports.RLP_ERROR__DEPOSITS_NOT_SLASHED]: `DepositsNotSlashed`,
|
|
145
|
+
[exports.RLP_ERROR__DEPOSITS_OPEN]: `DepositsOpen`,
|
|
146
|
+
[exports.RLP_ERROR__DEPOSIT_TOO_LOW]: `DepositTooLow`,
|
|
147
|
+
[exports.RLP_ERROR__FROZEN]: `Frozen`,
|
|
148
|
+
[exports.RLP_ERROR__INCORRECT_ADMIN]: `IncorrectAdmin`,
|
|
149
|
+
[exports.RLP_ERROR__INTENT_VALUE_TOO_LOW]: `IntentValueTooLow`,
|
|
150
|
+
[exports.RLP_ERROR__INVALID_INPUT]: `InvalidInput`,
|
|
151
|
+
[exports.RLP_ERROR__INVALID_ORACLE]: `InvalidOracle`,
|
|
152
|
+
[exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_DECIMALS]: `InvalidReceiptTokenDecimals`,
|
|
153
|
+
[exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_FREEZE_AUTHORITY]: `InvalidReceiptTokenFreezeAuthority`,
|
|
154
|
+
[exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_MINT_AUTHORITY]: `InvalidReceiptTokenMintAuthority`,
|
|
155
|
+
[exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_SETUP]: `InvalidReceiptTokenSetup`,
|
|
156
|
+
[exports.RLP_ERROR__INVALID_RECEIPT_TOKEN_SUPPLY]: `InvalidReceiptTokenSupply`,
|
|
157
|
+
[exports.RLP_ERROR__INVALID_SIGNER]: `InvalidSigner`,
|
|
158
|
+
[exports.RLP_ERROR__INVALID_SIGNERS]: `InvalidSigners`,
|
|
159
|
+
[exports.RLP_ERROR__INVALID_STATE]: `InvalidState`,
|
|
160
|
+
[exports.RLP_ERROR__INVALID_TOKEN_ORDER]: `InvalidTokenOrder`,
|
|
161
|
+
[exports.RLP_ERROR__LOCKUP_IN_FORCE]: `LockupInForce`,
|
|
162
|
+
[exports.RLP_ERROR__MATH_OVERFLOW]: `MathOverflow`,
|
|
163
|
+
[exports.RLP_ERROR__MINIMUM_SUPERADMINS_REQUIRED]: `MinimumSuperadminsRequired`,
|
|
164
|
+
[exports.RLP_ERROR__NAV_COVERAGE_EXCEEDS_LOSS]: `NavCoverageExceedsLoss`,
|
|
165
|
+
[exports.RLP_ERROR__NO_ENTRIES_LEFT]: `NoEntriesLeft`,
|
|
166
|
+
[exports.RLP_ERROR__NO_NAV_LOSS_TO_COVER]: `NoNavLossToCover`,
|
|
167
|
+
[exports.RLP_ERROR__NOT_ENOUGH_FUNDS]: `NotEnoughFunds`,
|
|
168
|
+
[exports.RLP_ERROR__NOT_ENOUGH_FUNDS_TO_SLASH]: `NotEnoughFundsToSlash`,
|
|
169
|
+
[exports.RLP_ERROR__NOT_ENOUGH_RECEIPT_TOKENS]: `NotEnoughReceiptTokens`,
|
|
170
|
+
[exports.RLP_ERROR__ORACLE_DATA_TOO_STALE]: `OracleDataTooStale`,
|
|
171
|
+
[exports.RLP_ERROR__PERMISSIONS_TOO_LOW]: `PermissionsTooLow`,
|
|
172
|
+
[exports.RLP_ERROR__POOL_ASSET_FROZEN]: `PoolAssetFrozen`,
|
|
173
|
+
[exports.RLP_ERROR__POOL_ASSET_NOT_FROZEN]: `PoolAssetNotFrozen`,
|
|
174
|
+
[exports.RLP_ERROR__POOL_HAS_NO_PROTECTED_VAULT]: `PoolHasNoProtectedVault`,
|
|
175
|
+
[exports.RLP_ERROR__POOL_IMBALANCE]: `PoolImbalance`,
|
|
176
|
+
[exports.RLP_ERROR__PRICE_ERROR]: `PriceError`,
|
|
177
|
+
[exports.RLP_ERROR__PROTECTED_VAULT_MINT_MISMATCH]: `ProtectedVaultMintMismatch`,
|
|
178
|
+
[exports.RLP_ERROR__PROTECTED_VAULT_MISMATCH]: `ProtectedVaultMismatch`,
|
|
179
|
+
[exports.RLP_ERROR__ROLE_NOT_UNDER_ACTION]: `RoleNotUnderAction`,
|
|
180
|
+
[exports.RLP_ERROR__SAME_ADMIN]: `SameAdmin`,
|
|
181
|
+
[exports.RLP_ERROR__SHARE_CONFIG_OVERFLOW]: `ShareConfigOverflow`,
|
|
182
|
+
[exports.RLP_ERROR__SLASH_AMOUNT_MISMATCH]: `SlashAmountMismatch`,
|
|
183
|
+
[exports.RLP_ERROR__SLIPPAGE_EXCEEDED]: `SlippageExceeded`,
|
|
184
|
+
[exports.RLP_ERROR__TRANSFER_SIGNATURE_REQUIRED]: `TransferSignatureRequired`,
|
|
185
|
+
[exports.RLP_ERROR__WITHDRAWAL_NEEDS_INTENT]: `WithdrawalNeedsIntent`,
|
|
186
|
+
[exports.RLP_ERROR__WITHDRAWAL_THRESHOLD_OVERFLOW]: `WithdrawalThresholdOverflow`,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function getRlpErrorMessage(code) {
|
|
190
|
+
if (process.env.NODE_ENV !== "production") {
|
|
191
|
+
return rlpErrorMessages[code];
|
|
192
|
+
}
|
|
193
|
+
return "Error message not available in production bundles.";
|
|
194
|
+
}
|
|
195
|
+
function isRlpError(error, transactionMessage, code) {
|
|
196
|
+
return (0, kit_1.isProgramError)(error, transactionMessage, programs_1.RLP_PROGRAM_ADDRESS, code);
|
|
197
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from "./accounts";
|
|
9
|
+
export * from "./errors";
|
|
10
|
+
export * from "./instructions";
|
|
11
|
+
export * from "./programs";
|
|
12
|
+
export * from "./types";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
__exportStar(require("./accounts"), exports);
|
|
25
|
+
__exportStar(require("./errors"), exports);
|
|
26
|
+
__exportStar(require("./instructions"), exports);
|
|
27
|
+
__exportStar(require("./programs"), exports);
|
|
28
|
+
__exportStar(require("./types"), exports);
|