@berachain/berajs 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/BeraError-CfcNTfpH.d.ts +69 -0
- package/dist/BexStatusProvider-nS3NcdxI.d.ts +70 -0
- package/dist/RequestError-CtJLUaAc.d.ts +57 -0
- package/dist/abi/index.d.ts +26765 -0
- package/dist/abi/index.mjs +1 -0
- package/dist/actions/index.d.ts +1649 -0
- package/dist/actions/index.mjs +1 -0
- package/dist/aggregatorsRouter-Cny4B_MB.d.ts +593 -0
- package/dist/chunk-4IBBLGNS.mjs +1 -0
- package/dist/chunk-5GPS724E.mjs +1 -0
- package/dist/chunk-5UFI7X4U.mjs +1 -0
- package/dist/chunk-AHAZC5K3.mjs +1 -0
- package/dist/chunk-JQDPAEK2.mjs +2 -0
- package/dist/chunk-K4NZIO2Z.mjs +1 -0
- package/dist/chunk-MTBICGRP.mjs +1 -0
- package/dist/chunk-RNESAHY2.mjs +3 -0
- package/dist/chunk-SMZ3PG6A.mjs +1 -0
- package/dist/chunk-XX77QPIR.mjs +1 -0
- package/dist/chunk-YKNKCICU.mjs +1 -0
- package/dist/contexts/index.d.ts +81 -0
- package/dist/contexts/index.mjs +1 -0
- package/dist/defaultFlags-V-tJs2K8.d.ts +10 -0
- package/dist/dex-BD7Bq3pJ.d.ts +562 -0
- package/dist/dex-DreiokgL.d.ts +562 -0
- package/dist/enum/index.d.ts +31 -0
- package/dist/enum/index.mjs +1 -0
- package/dist/errors/index.d.ts +204 -0
- package/dist/errors/index.mjs +1 -0
- package/dist/getValidatorQueuedOperatorAddress--AXNo9IY.d.ts +440 -0
- package/dist/getValidatorQueuedOperatorAddress-DK2Xv19c.d.ts +440 -0
- package/dist/hooks/index.d.ts +1703 -0
- package/dist/hooks/index.mjs +3 -0
- package/dist/polling-BKnyavLI.d.ts +8 -0
- package/dist/pythWrapper-CBjsmmsK.d.ts +1958 -0
- package/dist/staking-Cggi38So.d.ts +246 -0
- package/dist/staking-DYbVFigB.d.ts +246 -0
- package/dist/txnEnum-BQKDfaeH.d.ts +81 -0
- package/dist/txnEnum-Diichv9Z.d.ts +80 -0
- package/dist/types/index.d.ts +56 -0
- package/dist/types/index.mjs +1 -0
- package/dist/useHoneySwapState-CW49RVci.d.ts +32 -0
- package/dist/useHoneySwapState-Ci8_c2bT.d.ts +32 -0
- package/dist/utils/index.d.ts +349 -0
- package/dist/utils/index.mjs +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { Address, Hex, AbiFunction } from 'viem';
|
|
2
|
+
import { ProposalWithVotesFragment, ProposalVoteFragment } from '@berachain/graphql/governance';
|
|
3
|
+
import { ApiValidatorFragment } from '@berachain/graphql/pol/api';
|
|
4
|
+
import { a as Token } from './dex-DreiokgL.js';
|
|
5
|
+
|
|
6
|
+
interface BribeBoostReward {
|
|
7
|
+
token: string;
|
|
8
|
+
total_unclaimed: string;
|
|
9
|
+
}
|
|
10
|
+
interface BribeBoostRewardItem {
|
|
11
|
+
rewards: BribeBoostReward[];
|
|
12
|
+
validator: string;
|
|
13
|
+
}
|
|
14
|
+
interface BribeBoostRewardProof {
|
|
15
|
+
validator?: string;
|
|
16
|
+
pagination: {
|
|
17
|
+
next: number;
|
|
18
|
+
previous: number;
|
|
19
|
+
record_per_page: number;
|
|
20
|
+
current_page: number;
|
|
21
|
+
total_page: number;
|
|
22
|
+
};
|
|
23
|
+
rewards: {
|
|
24
|
+
id: string;
|
|
25
|
+
dist_id: string;
|
|
26
|
+
token: Address;
|
|
27
|
+
recipient: string;
|
|
28
|
+
amount: string;
|
|
29
|
+
merkle_proof: string[];
|
|
30
|
+
available_at: number;
|
|
31
|
+
}[] | null;
|
|
32
|
+
}
|
|
33
|
+
interface BribeBoostValidatorApr {
|
|
34
|
+
id: string;
|
|
35
|
+
boost_total_bgt: string;
|
|
36
|
+
rewards_total_usd: string;
|
|
37
|
+
daily_rate: string;
|
|
38
|
+
apr: string;
|
|
39
|
+
apy: string;
|
|
40
|
+
tokens: Address[];
|
|
41
|
+
validator: string;
|
|
42
|
+
start_block: number;
|
|
43
|
+
end_block: number;
|
|
44
|
+
start_timestamp: number;
|
|
45
|
+
end_timestamp: number;
|
|
46
|
+
created_at: string;
|
|
47
|
+
updated_at: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type Proposal = ProposalWithVotesFragment;
|
|
51
|
+
type Vote = ProposalVoteFragment;
|
|
52
|
+
type Voter = Address;
|
|
53
|
+
/**
|
|
54
|
+
* Maps the proposal state from the governor contract to a more human-readable format.
|
|
55
|
+
* Don't edit this enum manually, it's synced with the governor contract.
|
|
56
|
+
*
|
|
57
|
+
* @see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/IGovernor.sol
|
|
58
|
+
*/
|
|
59
|
+
declare enum ProposalState {
|
|
60
|
+
Pending = 0,
|
|
61
|
+
Active = 1,
|
|
62
|
+
Canceled = 2,
|
|
63
|
+
Defeated = 3,
|
|
64
|
+
Succeeded = 4,
|
|
65
|
+
Queued = 5,
|
|
66
|
+
Expired = 6,
|
|
67
|
+
Executed = 7
|
|
68
|
+
}
|
|
69
|
+
type ProposalVotes = {
|
|
70
|
+
yes: number;
|
|
71
|
+
no: number;
|
|
72
|
+
abstain: number;
|
|
73
|
+
};
|
|
74
|
+
declare const VoteColorMap: {
|
|
75
|
+
yes: string;
|
|
76
|
+
1: string;
|
|
77
|
+
no: string;
|
|
78
|
+
2: string;
|
|
79
|
+
veto: string;
|
|
80
|
+
4: string;
|
|
81
|
+
abstain: string;
|
|
82
|
+
3: string;
|
|
83
|
+
yes_secondary: string;
|
|
84
|
+
no_secondary: string;
|
|
85
|
+
veto_secondary: string;
|
|
86
|
+
abstain_secondary: string;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
declare enum VoteEnum {
|
|
90
|
+
AGAINST = "no",
|
|
91
|
+
FOR = "yes",
|
|
92
|
+
ABSTAIN = "abstain"
|
|
93
|
+
}
|
|
94
|
+
type PROPOSAL_GENRE = "berahub" | "honey" | "bend" | "berps" | "general";
|
|
95
|
+
type CustomProposalActionErrors = {
|
|
96
|
+
type?: null | ProposalErrorCodes;
|
|
97
|
+
target?: null | ProposalErrorCodes;
|
|
98
|
+
value?: null | ProposalErrorCodes;
|
|
99
|
+
ABI?: null | ProposalErrorCodes;
|
|
100
|
+
functionSignature?: null | ProposalErrorCodes;
|
|
101
|
+
args?: (null | ProposalErrorCodes)[];
|
|
102
|
+
vault?: null | ProposalErrorCodes;
|
|
103
|
+
isFriend?: null | ProposalErrorCodes;
|
|
104
|
+
to?: null | ProposalErrorCodes;
|
|
105
|
+
amount?: null | ProposalErrorCodes;
|
|
106
|
+
minIncentiveRate?: null | ProposalErrorCodes;
|
|
107
|
+
managerAddress?: null | ProposalErrorCodes;
|
|
108
|
+
input?: null | ProposalErrorCodes;
|
|
109
|
+
token?: null | ProposalErrorCodes;
|
|
110
|
+
rawCalldata?: null | ProposalErrorCodes;
|
|
111
|
+
message?: null | ProposalErrorCodes;
|
|
112
|
+
} | null;
|
|
113
|
+
type CustomProposalErrors = {
|
|
114
|
+
title?: null | ProposalErrorCodes;
|
|
115
|
+
description?: null | ProposalErrorCodes;
|
|
116
|
+
forumLink?: null | ProposalErrorCodes;
|
|
117
|
+
actions?: CustomProposalActionErrors[];
|
|
118
|
+
};
|
|
119
|
+
declare enum ProposalErrorCodes {
|
|
120
|
+
REQUIRED = "Required",
|
|
121
|
+
INVALID_AMOUNT = "Invalid amount",
|
|
122
|
+
NEGATIVE_AMOUNT = "Negative amount",
|
|
123
|
+
INVALID_ADDRESS = "Invalid address",
|
|
124
|
+
INVALID_ACTION = "Invalid action",
|
|
125
|
+
INVALID_ABI = "Invalid ABI",
|
|
126
|
+
MUST_BE_HTTPS = "Must be HTTPS",
|
|
127
|
+
MUST_BE_HTTPS_OR_IPFS = "Must be HTTPS or IPFS",
|
|
128
|
+
INVALID_BASEPATH = "Must be a berachain forum link",
|
|
129
|
+
/**
|
|
130
|
+
* Mainly used when it's not a reward vault
|
|
131
|
+
*/
|
|
132
|
+
INVALID_CONTRACT = "This is not a valid contract"
|
|
133
|
+
}
|
|
134
|
+
type GovernanceTopic = {
|
|
135
|
+
id: PROPOSAL_GENRE;
|
|
136
|
+
color: string;
|
|
137
|
+
icon: React.ReactNode;
|
|
138
|
+
iconBackground?: string;
|
|
139
|
+
name: string;
|
|
140
|
+
slug: string;
|
|
141
|
+
forumLink: string;
|
|
142
|
+
description?: string;
|
|
143
|
+
comingSoon?: boolean;
|
|
144
|
+
};
|
|
145
|
+
declare enum ProposalTypeEnum {
|
|
146
|
+
CUSTOM_PROPOSAL = "custom-action",
|
|
147
|
+
WHITELIST_REWARD_VAULT = "whitelist-reward-vault",
|
|
148
|
+
BLACKLIST_REWARD_VAULT = "blacklist-reward-vault",
|
|
149
|
+
ERC20_TRANSFER = "erc20-transfer",
|
|
150
|
+
WHITELIST_REWARD_VAULT_INCENTIVE = "whitelist-reward-vault-incentive"
|
|
151
|
+
}
|
|
152
|
+
type CustomProposal = {
|
|
153
|
+
title: string;
|
|
154
|
+
description: any;
|
|
155
|
+
actions: ProposalAction[];
|
|
156
|
+
forumLink: string;
|
|
157
|
+
topic: Set<PROPOSAL_GENRE>;
|
|
158
|
+
};
|
|
159
|
+
type SafeProposalAction = {
|
|
160
|
+
value: bigint;
|
|
161
|
+
target: "" | Address;
|
|
162
|
+
} & ({
|
|
163
|
+
type: ProposalTypeEnum.CUSTOM_PROPOSAL;
|
|
164
|
+
input: "ABI" | "rawCalldata" | "message";
|
|
165
|
+
ABI: string;
|
|
166
|
+
_isVerifiedAbi?: boolean;
|
|
167
|
+
functionSignature: string;
|
|
168
|
+
args: string[];
|
|
169
|
+
rawCalldata: Hex;
|
|
170
|
+
message: string;
|
|
171
|
+
} | {
|
|
172
|
+
type: ProposalTypeEnum.WHITELIST_REWARD_VAULT | ProposalTypeEnum.BLACKLIST_REWARD_VAULT;
|
|
173
|
+
vault: Address;
|
|
174
|
+
} | {
|
|
175
|
+
type: ProposalTypeEnum.ERC20_TRANSFER;
|
|
176
|
+
to: Address;
|
|
177
|
+
amount: string;
|
|
178
|
+
} | {
|
|
179
|
+
type: ProposalTypeEnum.WHITELIST_REWARD_VAULT_INCENTIVE;
|
|
180
|
+
vault: Address;
|
|
181
|
+
token: Address;
|
|
182
|
+
minIncentiveRate: string;
|
|
183
|
+
managerAddress: Address;
|
|
184
|
+
});
|
|
185
|
+
type ProposalAction = Partial<SafeProposalAction> & {
|
|
186
|
+
type: SafeProposalAction["type"];
|
|
187
|
+
};
|
|
188
|
+
type VerifiedAbi = {
|
|
189
|
+
abiItem?: AbiFunction;
|
|
190
|
+
functionName?: string;
|
|
191
|
+
args: readonly unknown[];
|
|
192
|
+
functionSignature?: string;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
type IncentiveReward = {
|
|
196
|
+
tokenMetadata: Token | undefined;
|
|
197
|
+
tokenPrice: number;
|
|
198
|
+
tokenValue: number;
|
|
199
|
+
id: string;
|
|
200
|
+
dist_id: string;
|
|
201
|
+
token: string;
|
|
202
|
+
recipient: string;
|
|
203
|
+
formattedAmount: string;
|
|
204
|
+
amount: string;
|
|
205
|
+
merkle_proof: string[];
|
|
206
|
+
available_at: number;
|
|
207
|
+
};
|
|
208
|
+
interface IncentiveRewardChunksWithValidatorData {
|
|
209
|
+
validator: ApiValidatorFragment | undefined;
|
|
210
|
+
maxTimestamp: number | undefined;
|
|
211
|
+
minTimestamp: number | undefined;
|
|
212
|
+
totalValue: number;
|
|
213
|
+
tokenTotals: {
|
|
214
|
+
address: Address;
|
|
215
|
+
amount: number;
|
|
216
|
+
value: number;
|
|
217
|
+
metadata: Token | undefined;
|
|
218
|
+
}[];
|
|
219
|
+
rewards: IncentiveReward[];
|
|
220
|
+
isCurrent: boolean;
|
|
221
|
+
}
|
|
222
|
+
interface AggregatedTokenTotals {
|
|
223
|
+
address: Address;
|
|
224
|
+
amount: number;
|
|
225
|
+
value: number;
|
|
226
|
+
metadata: Token | undefined;
|
|
227
|
+
}
|
|
228
|
+
type ClaimedIncentives = Record<string, string>;
|
|
229
|
+
type ClaimedIncentivesLocalState = Record<string, ClaimedIncentives>;
|
|
230
|
+
interface UserVaultInfo {
|
|
231
|
+
balance: bigint;
|
|
232
|
+
delegatedBalance: bigint;
|
|
233
|
+
withdrawableBalance: bigint;
|
|
234
|
+
rewards: string;
|
|
235
|
+
percentage: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface ProtocolMetadata {
|
|
239
|
+
name: string;
|
|
240
|
+
logoURI: string;
|
|
241
|
+
url: string;
|
|
242
|
+
description: string;
|
|
243
|
+
tags?: string[];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { type AggregatedTokenTotals as A, type BribeBoostRewardProof as B, type CustomProposal as C, type GovernanceTopic as G, type IncentiveReward as I, type ProtocolMetadata as P, type SafeProposalAction as S, type UserVaultInfo as U, type Vote as V, ProposalErrorCodes as a, ProposalState as b, type CustomProposalErrors as c, type BribeBoostRewardItem as d, type BribeBoostReward as e, type BribeBoostValidatorApr as f, type Proposal as g, type Voter as h, type ProposalVotes as i, VoteColorMap as j, VoteEnum as k, type PROPOSAL_GENRE as l, type CustomProposalActionErrors as m, ProposalTypeEnum as n, type ProposalAction as o, type VerifiedAbi as p, type IncentiveRewardChunksWithValidatorData as q, type ClaimedIncentives as r, type ClaimedIncentivesLocalState as s };
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { Address, Hex, AbiFunction } from 'viem';
|
|
2
|
+
import { ProposalWithVotesFragment, ProposalVoteFragment } from '@berachain/graphql/governance';
|
|
3
|
+
import { ApiValidatorFragment } from '@berachain/graphql/pol/api';
|
|
4
|
+
import { a as Token } from './dex-BD7Bq3pJ.js';
|
|
5
|
+
|
|
6
|
+
interface BribeBoostReward {
|
|
7
|
+
token: string;
|
|
8
|
+
total_unclaimed: string;
|
|
9
|
+
}
|
|
10
|
+
interface BribeBoostRewardItem {
|
|
11
|
+
rewards: BribeBoostReward[];
|
|
12
|
+
validator: string;
|
|
13
|
+
}
|
|
14
|
+
interface BribeBoostRewardProof {
|
|
15
|
+
validator?: string;
|
|
16
|
+
pagination: {
|
|
17
|
+
next: number;
|
|
18
|
+
previous: number;
|
|
19
|
+
record_per_page: number;
|
|
20
|
+
current_page: number;
|
|
21
|
+
total_page: number;
|
|
22
|
+
};
|
|
23
|
+
rewards: {
|
|
24
|
+
id: string;
|
|
25
|
+
dist_id: string;
|
|
26
|
+
token: Address;
|
|
27
|
+
recipient: string;
|
|
28
|
+
amount: string;
|
|
29
|
+
merkle_proof: string[];
|
|
30
|
+
available_at: number;
|
|
31
|
+
}[] | null;
|
|
32
|
+
}
|
|
33
|
+
interface BribeBoostValidatorApr {
|
|
34
|
+
id: string;
|
|
35
|
+
boost_total_bgt: string;
|
|
36
|
+
rewards_total_usd: string;
|
|
37
|
+
daily_rate: string;
|
|
38
|
+
apr: string;
|
|
39
|
+
apy: string;
|
|
40
|
+
tokens: Address[];
|
|
41
|
+
validator: string;
|
|
42
|
+
start_block: number;
|
|
43
|
+
end_block: number;
|
|
44
|
+
start_timestamp: number;
|
|
45
|
+
end_timestamp: number;
|
|
46
|
+
created_at: string;
|
|
47
|
+
updated_at: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type Proposal = ProposalWithVotesFragment;
|
|
51
|
+
type Vote = ProposalVoteFragment;
|
|
52
|
+
type Voter = Address;
|
|
53
|
+
/**
|
|
54
|
+
* Maps the proposal state from the governor contract to a more human-readable format.
|
|
55
|
+
* Don't edit this enum manually, it's synced with the governor contract.
|
|
56
|
+
*
|
|
57
|
+
* @see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/IGovernor.sol
|
|
58
|
+
*/
|
|
59
|
+
declare enum ProposalState {
|
|
60
|
+
Pending = 0,
|
|
61
|
+
Active = 1,
|
|
62
|
+
Canceled = 2,
|
|
63
|
+
Defeated = 3,
|
|
64
|
+
Succeeded = 4,
|
|
65
|
+
Queued = 5,
|
|
66
|
+
Expired = 6,
|
|
67
|
+
Executed = 7
|
|
68
|
+
}
|
|
69
|
+
type ProposalVotes = {
|
|
70
|
+
yes: number;
|
|
71
|
+
no: number;
|
|
72
|
+
abstain: number;
|
|
73
|
+
};
|
|
74
|
+
declare const VoteColorMap: {
|
|
75
|
+
yes: string;
|
|
76
|
+
1: string;
|
|
77
|
+
no: string;
|
|
78
|
+
2: string;
|
|
79
|
+
veto: string;
|
|
80
|
+
4: string;
|
|
81
|
+
abstain: string;
|
|
82
|
+
3: string;
|
|
83
|
+
yes_secondary: string;
|
|
84
|
+
no_secondary: string;
|
|
85
|
+
veto_secondary: string;
|
|
86
|
+
abstain_secondary: string;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
declare enum VoteEnum {
|
|
90
|
+
AGAINST = "no",
|
|
91
|
+
FOR = "yes",
|
|
92
|
+
ABSTAIN = "abstain"
|
|
93
|
+
}
|
|
94
|
+
type PROPOSAL_GENRE = "berahub" | "honey" | "bend" | "berps" | "general";
|
|
95
|
+
type CustomProposalActionErrors = {
|
|
96
|
+
type?: null | ProposalErrorCodes;
|
|
97
|
+
target?: null | ProposalErrorCodes;
|
|
98
|
+
value?: null | ProposalErrorCodes;
|
|
99
|
+
ABI?: null | ProposalErrorCodes;
|
|
100
|
+
functionSignature?: null | ProposalErrorCodes;
|
|
101
|
+
args?: (null | ProposalErrorCodes)[];
|
|
102
|
+
vault?: null | ProposalErrorCodes;
|
|
103
|
+
isFriend?: null | ProposalErrorCodes;
|
|
104
|
+
to?: null | ProposalErrorCodes;
|
|
105
|
+
amount?: null | ProposalErrorCodes;
|
|
106
|
+
minIncentiveRate?: null | ProposalErrorCodes;
|
|
107
|
+
managerAddress?: null | ProposalErrorCodes;
|
|
108
|
+
input?: null | ProposalErrorCodes;
|
|
109
|
+
token?: null | ProposalErrorCodes;
|
|
110
|
+
rawCalldata?: null | ProposalErrorCodes;
|
|
111
|
+
message?: null | ProposalErrorCodes;
|
|
112
|
+
} | null;
|
|
113
|
+
type CustomProposalErrors = {
|
|
114
|
+
title?: null | ProposalErrorCodes;
|
|
115
|
+
description?: null | ProposalErrorCodes;
|
|
116
|
+
forumLink?: null | ProposalErrorCodes;
|
|
117
|
+
actions?: CustomProposalActionErrors[];
|
|
118
|
+
};
|
|
119
|
+
declare enum ProposalErrorCodes {
|
|
120
|
+
REQUIRED = "Required",
|
|
121
|
+
INVALID_AMOUNT = "Invalid amount",
|
|
122
|
+
NEGATIVE_AMOUNT = "Negative amount",
|
|
123
|
+
INVALID_ADDRESS = "Invalid address",
|
|
124
|
+
INVALID_ACTION = "Invalid action",
|
|
125
|
+
INVALID_ABI = "Invalid ABI",
|
|
126
|
+
MUST_BE_HTTPS = "Must be HTTPS",
|
|
127
|
+
MUST_BE_HTTPS_OR_IPFS = "Must be HTTPS or IPFS",
|
|
128
|
+
INVALID_BASEPATH = "Must be a berachain forum link",
|
|
129
|
+
/**
|
|
130
|
+
* Mainly used when it's not a reward vault
|
|
131
|
+
*/
|
|
132
|
+
INVALID_CONTRACT = "This is not a valid contract"
|
|
133
|
+
}
|
|
134
|
+
type GovernanceTopic = {
|
|
135
|
+
id: PROPOSAL_GENRE;
|
|
136
|
+
color: string;
|
|
137
|
+
icon: React.ReactNode;
|
|
138
|
+
iconBackground?: string;
|
|
139
|
+
name: string;
|
|
140
|
+
slug: string;
|
|
141
|
+
forumLink: string;
|
|
142
|
+
description?: string;
|
|
143
|
+
comingSoon?: boolean;
|
|
144
|
+
};
|
|
145
|
+
declare enum ProposalTypeEnum {
|
|
146
|
+
CUSTOM_PROPOSAL = "custom-action",
|
|
147
|
+
WHITELIST_REWARD_VAULT = "whitelist-reward-vault",
|
|
148
|
+
BLACKLIST_REWARD_VAULT = "blacklist-reward-vault",
|
|
149
|
+
ERC20_TRANSFER = "erc20-transfer",
|
|
150
|
+
WHITELIST_REWARD_VAULT_INCENTIVE = "whitelist-reward-vault-incentive"
|
|
151
|
+
}
|
|
152
|
+
type CustomProposal = {
|
|
153
|
+
title: string;
|
|
154
|
+
description: any;
|
|
155
|
+
actions: ProposalAction[];
|
|
156
|
+
forumLink: string;
|
|
157
|
+
topic: Set<PROPOSAL_GENRE>;
|
|
158
|
+
};
|
|
159
|
+
type SafeProposalAction = {
|
|
160
|
+
value: bigint;
|
|
161
|
+
target: "" | Address;
|
|
162
|
+
} & ({
|
|
163
|
+
type: ProposalTypeEnum.CUSTOM_PROPOSAL;
|
|
164
|
+
input: "ABI" | "rawCalldata" | "message";
|
|
165
|
+
ABI: string;
|
|
166
|
+
_isVerifiedAbi?: boolean;
|
|
167
|
+
functionSignature: string;
|
|
168
|
+
args: string[];
|
|
169
|
+
rawCalldata: Hex;
|
|
170
|
+
message: string;
|
|
171
|
+
} | {
|
|
172
|
+
type: ProposalTypeEnum.WHITELIST_REWARD_VAULT | ProposalTypeEnum.BLACKLIST_REWARD_VAULT;
|
|
173
|
+
vault: Address;
|
|
174
|
+
} | {
|
|
175
|
+
type: ProposalTypeEnum.ERC20_TRANSFER;
|
|
176
|
+
to: Address;
|
|
177
|
+
amount: string;
|
|
178
|
+
} | {
|
|
179
|
+
type: ProposalTypeEnum.WHITELIST_REWARD_VAULT_INCENTIVE;
|
|
180
|
+
vault: Address;
|
|
181
|
+
token: Address;
|
|
182
|
+
minIncentiveRate: string;
|
|
183
|
+
managerAddress: Address;
|
|
184
|
+
});
|
|
185
|
+
type ProposalAction = Partial<SafeProposalAction> & {
|
|
186
|
+
type: SafeProposalAction["type"];
|
|
187
|
+
};
|
|
188
|
+
type VerifiedAbi = {
|
|
189
|
+
abiItem?: AbiFunction;
|
|
190
|
+
functionName?: string;
|
|
191
|
+
args: readonly unknown[];
|
|
192
|
+
functionSignature?: string;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
type IncentiveReward = {
|
|
196
|
+
tokenMetadata: Token | undefined;
|
|
197
|
+
tokenPrice: number;
|
|
198
|
+
tokenValue: number;
|
|
199
|
+
id: string;
|
|
200
|
+
dist_id: string;
|
|
201
|
+
token: string;
|
|
202
|
+
recipient: string;
|
|
203
|
+
formattedAmount: string;
|
|
204
|
+
amount: string;
|
|
205
|
+
merkle_proof: string[];
|
|
206
|
+
available_at: number;
|
|
207
|
+
};
|
|
208
|
+
interface IncentiveRewardChunksWithValidatorData {
|
|
209
|
+
validator: ApiValidatorFragment | undefined;
|
|
210
|
+
maxTimestamp: number | undefined;
|
|
211
|
+
minTimestamp: number | undefined;
|
|
212
|
+
totalValue: number;
|
|
213
|
+
tokenTotals: {
|
|
214
|
+
address: Address;
|
|
215
|
+
amount: number;
|
|
216
|
+
value: number;
|
|
217
|
+
metadata: Token | undefined;
|
|
218
|
+
}[];
|
|
219
|
+
rewards: IncentiveReward[];
|
|
220
|
+
isCurrent: boolean;
|
|
221
|
+
}
|
|
222
|
+
interface AggregatedTokenTotals {
|
|
223
|
+
address: Address;
|
|
224
|
+
amount: number;
|
|
225
|
+
value: number;
|
|
226
|
+
metadata: Token | undefined;
|
|
227
|
+
}
|
|
228
|
+
type ClaimedIncentives = Record<string, string>;
|
|
229
|
+
type ClaimedIncentivesLocalState = Record<string, ClaimedIncentives>;
|
|
230
|
+
interface UserVaultInfo {
|
|
231
|
+
balance: bigint;
|
|
232
|
+
delegatedBalance: bigint;
|
|
233
|
+
withdrawableBalance: bigint;
|
|
234
|
+
rewards: string;
|
|
235
|
+
percentage: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface ProtocolMetadata {
|
|
239
|
+
name: string;
|
|
240
|
+
logoURI: string;
|
|
241
|
+
url: string;
|
|
242
|
+
description: string;
|
|
243
|
+
tags?: string[];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { type AggregatedTokenTotals as A, type BribeBoostRewardProof as B, type CustomProposal as C, type GovernanceTopic as G, type IncentiveReward as I, type ProtocolMetadata as P, type SafeProposalAction as S, type UserVaultInfo as U, type Vote as V, ProposalErrorCodes as a, ProposalState as b, type CustomProposalErrors as c, type BribeBoostRewardItem as d, type BribeBoostReward as e, type BribeBoostValidatorApr as f, type Proposal as g, type Voter as h, type ProposalVotes as i, VoteColorMap as j, VoteEnum as k, type PROPOSAL_GENRE as l, type CustomProposalActionErrors as m, ProposalTypeEnum as n, type ProposalAction as o, type VerifiedAbi as p, type IncentiveRewardChunksWithValidatorData as q, type ClaimedIncentives as r, type ClaimedIncentivesLocalState as s };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
declare enum TransactionActionType {
|
|
2
|
+
/**
|
|
3
|
+
* Used for testing purposes.
|
|
4
|
+
*/
|
|
5
|
+
TEST = "Test",
|
|
6
|
+
SEND = "Send tokens",
|
|
7
|
+
APPROVAL = "Approval",
|
|
8
|
+
SWAP = "Swap",
|
|
9
|
+
WRAP = "Wrap",
|
|
10
|
+
UNWRAP = "Unwrap",
|
|
11
|
+
CREATE_POOL = "Create Pool",
|
|
12
|
+
ADD_LIQUIDITY = "Add Liquidity",
|
|
13
|
+
WITHDRAW_LIQUIDITY = "Withdraw Liquidity",
|
|
14
|
+
DELEGATE = "Delegate",
|
|
15
|
+
REDELEGATE = "Redelegate",
|
|
16
|
+
UNBONDING = "Unbonding",
|
|
17
|
+
CANCEL_UNBONDING = "Cancel Unbonding",
|
|
18
|
+
SUBMIT_PROPOSAL = "Submit Proposal",
|
|
19
|
+
CANCEL_PROPOSAL = "Cancel Proposal",
|
|
20
|
+
EXECUTE_PROPOSAL = "Execute Proposal",
|
|
21
|
+
QUEUE_PROPOSAL = "Queue Proposal",
|
|
22
|
+
VOTE = "Vote",
|
|
23
|
+
MODIFY_REWARD_DURATION = "Change Reward Duration",
|
|
24
|
+
MODIFY_REWARD_RATE = "Change Reward Rate",
|
|
25
|
+
RESET_REWARD_MODE = "Reset Reward Mode",
|
|
26
|
+
CREATE_BRIBE = "Add Incentives",
|
|
27
|
+
CLAIMING_BRIBES = "Claiming Incentives",// claiming others
|
|
28
|
+
CLAIMING_REWARDS = "Claiming BGT",
|
|
29
|
+
CLAIM_ALL_REWARDS = "Claim All Rewards",
|
|
30
|
+
RECOVER_FUNDS = "Recover Bex Funds",
|
|
31
|
+
REDEEM_BGT = "Redeem BGT",
|
|
32
|
+
MINT_HONEY = "Mint Honey",
|
|
33
|
+
REDEEM_HONEY = "Redeem Honey",
|
|
34
|
+
SUPPLY = "Supply",
|
|
35
|
+
WITHDRAW = "Withdraw",
|
|
36
|
+
BORROW = "Borrow",
|
|
37
|
+
REPAY = "Repay",
|
|
38
|
+
STAKE = "Stake",
|
|
39
|
+
UNSTAKE = "Unstake",
|
|
40
|
+
ENSO_ROUTE = "Enso Route",
|
|
41
|
+
MARKET_LONG = "Market Long",
|
|
42
|
+
MARKET_SHORT = "Market Short",
|
|
43
|
+
LIMIT_LONG = "Limit Long",
|
|
44
|
+
LIMIT_SHORT = "Limit Short",
|
|
45
|
+
CANCEL_ORDER = "Cancel Order",
|
|
46
|
+
CANCEL_ALL_ORDERS = "Cancel All Orders",
|
|
47
|
+
EDIT_PERPS_ORDER = "Edit Perps Order",
|
|
48
|
+
DEPOSIT_HONEY = "Deposit Honey",
|
|
49
|
+
START_WITHDRAW_REQUEST = "Start Withdraw Request",
|
|
50
|
+
CANCEL_WITHDRAW_REQUEST = "Cancel Withdraw Request",
|
|
51
|
+
WITHDRAW_HONEY = "Withdraw Honey",
|
|
52
|
+
DELEGATE_OCT = "Delegate",
|
|
53
|
+
REVOKE_OCT = "Revoke",
|
|
54
|
+
REFER = "Refer",
|
|
55
|
+
CREATE_REWARDS_VAULT = "Create Reward Vault",
|
|
56
|
+
APPLYING_REWARD_ALLOCATION = "Apply Reward Allocation",
|
|
57
|
+
APPLYING_OPERATOR_CHANGE = "Apply Operator Change",
|
|
58
|
+
CANCELING_OPERATOR_CHANGE = "Cancel Operator Change",
|
|
59
|
+
REQUEST_OPERATOR_CHANGE = "Request Operator Change",
|
|
60
|
+
APPLYING_REWARD_ALLOCATOR_CHANGE = "Apply Reward Allocator Change",
|
|
61
|
+
APPLYING_COMMISSION_CHANGE = "Apply Commission Change",
|
|
62
|
+
BONDING_BERA = "Stake BERA",
|
|
63
|
+
UNBONDING_BERA = "Unstake BERA",
|
|
64
|
+
QUEUE_UNBONDING_BERA = "Queue Unstake BERA",
|
|
65
|
+
BEND_MARKET_REPAY_AND_WITHDRAW_COLLATERAL = "Bend Market Repay and Withdraw Collateral",
|
|
66
|
+
BEND_MARKET_SUPPLY_COLLATERAL_AND_BORROW = "Bend Market Supply Collateral and Borrow",
|
|
67
|
+
BEND_VAULT_SUPPLY = "Bend Vault Supply",
|
|
68
|
+
BEND_VAULT_WITHDRAW = "Bend Vault Withdraw",
|
|
69
|
+
BEND_CURATOR_REALLOCATE = "Bend Curator Reallocate",
|
|
70
|
+
BEND_CURATOR_UPDATE_MARKET_SUPPLY_CAP = "Bend Curator Update Market Supply Cap",
|
|
71
|
+
BEND_CURATOR_REVOKE_PENDING_SUPPLY_CAP = "Bend Curator Revoke Pending Supply Cap",
|
|
72
|
+
BEND_CURATOR_ACCEPT_PENDING_SUPPLY_CAP = "Bend Curator Accept Pending Supply Cap",
|
|
73
|
+
BEND_CURATOR_UPDATE_SUPPLY_QUEUE = "Bend Curator Update Supply Queue",
|
|
74
|
+
BEND_CURATOR_UPDATE_WITHDRAW_QUEUE = "Bend Curator Update Withdraw Queue",
|
|
75
|
+
BEND_CURATOR_TRANSFER_OWNER = "Bend Curator Transfer Owner",
|
|
76
|
+
BEND_CURATOR_CHANGE_GUARDIAN = "Bend Curator Change Guardian",
|
|
77
|
+
BEND_CURATOR_SET_CURATOR = "Bend Curator Set Curator",
|
|
78
|
+
BEND_CURATOR_SET_ALLOCATOR = "Bend Curator Set Allocator"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { TransactionActionType as T };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare enum TransactionActionType {
|
|
2
|
+
/**
|
|
3
|
+
* Used for testing purposes.
|
|
4
|
+
*/
|
|
5
|
+
TEST = "Test",
|
|
6
|
+
APPROVAL = "Approval",
|
|
7
|
+
SWAP = "Swap",
|
|
8
|
+
WRAP = "Wrap",
|
|
9
|
+
UNWRAP = "Unwrap",
|
|
10
|
+
CREATE_POOL = "Create Pool",
|
|
11
|
+
ADD_LIQUIDITY = "Add Liquidity",
|
|
12
|
+
WITHDRAW_LIQUIDITY = "Withdraw Liquidity",
|
|
13
|
+
DELEGATE = "Delegate",
|
|
14
|
+
REDELEGATE = "Redelegate",
|
|
15
|
+
UNBONDING = "Unbonding",
|
|
16
|
+
CANCEL_UNBONDING = "Cancel Unbonding",
|
|
17
|
+
SUBMIT_PROPOSAL = "Submit Proposal",
|
|
18
|
+
CANCEL_PROPOSAL = "Cancel Proposal",
|
|
19
|
+
EXECUTE_PROPOSAL = "Execute Proposal",
|
|
20
|
+
QUEUE_PROPOSAL = "Queue Proposal",
|
|
21
|
+
VOTE = "Vote",
|
|
22
|
+
MODIFY_REWARD_DURATION = "Change Reward Duration",
|
|
23
|
+
MODIFY_REWARD_RATE = "Change Reward Rate",
|
|
24
|
+
RESET_REWARD_MODE = "Reset Reward Mode",
|
|
25
|
+
CREATE_BRIBE = "Add Incentives",
|
|
26
|
+
CLAIMING_BRIBES = "Claiming Incentives",// claiming others
|
|
27
|
+
CLAIMING_REWARDS = "Claiming BGT",
|
|
28
|
+
CLAIM_ALL_REWARDS = "Claim All Rewards",
|
|
29
|
+
RECOVER_FUNDS = "Recover Bex Funds",
|
|
30
|
+
REDEEM_BGT = "Redeem BGT",
|
|
31
|
+
MINT_HONEY = "Mint Honey",
|
|
32
|
+
REDEEM_HONEY = "Redeem Honey",
|
|
33
|
+
SUPPLY = "Supply",
|
|
34
|
+
WITHDRAW = "Withdraw",
|
|
35
|
+
BORROW = "Borrow",
|
|
36
|
+
REPAY = "Repay",
|
|
37
|
+
STAKE = "Stake",
|
|
38
|
+
UNSTAKE = "Unstake",
|
|
39
|
+
ENSO_ROUTE = "Enso Route",
|
|
40
|
+
MARKET_LONG = "Market Long",
|
|
41
|
+
MARKET_SHORT = "Market Short",
|
|
42
|
+
LIMIT_LONG = "Limit Long",
|
|
43
|
+
LIMIT_SHORT = "Limit Short",
|
|
44
|
+
CANCEL_ORDER = "Cancel Order",
|
|
45
|
+
CANCEL_ALL_ORDERS = "Cancel All Orders",
|
|
46
|
+
EDIT_PERPS_ORDER = "Edit Perps Order",
|
|
47
|
+
DEPOSIT_HONEY = "Deposit Honey",
|
|
48
|
+
START_WITHDRAW_REQUEST = "Start Withdraw Request",
|
|
49
|
+
CANCEL_WITHDRAW_REQUEST = "Cancel Withdraw Request",
|
|
50
|
+
WITHDRAW_HONEY = "Withdraw Honey",
|
|
51
|
+
DELEGATE_OCT = "Delegate",
|
|
52
|
+
REVOKE_OCT = "Revoke",
|
|
53
|
+
REFER = "Refer",
|
|
54
|
+
CREATE_REWARDS_VAULT = "Create Reward Vault",
|
|
55
|
+
APPLYING_REWARD_ALLOCATION = "Apply Reward Allocation",
|
|
56
|
+
APPLYING_OPERATOR_CHANGE = "Apply Operator Change",
|
|
57
|
+
CANCELING_OPERATOR_CHANGE = "Cancel Operator Change",
|
|
58
|
+
REQUEST_OPERATOR_CHANGE = "Request Operator Change",
|
|
59
|
+
APPLYING_REWARD_ALLOCATOR_CHANGE = "Apply Reward Allocator Change",
|
|
60
|
+
APPLYING_COMMISSION_CHANGE = "Apply Commission Change",
|
|
61
|
+
BONDING_BERA = "Stake BERA",
|
|
62
|
+
UNBONDING_BERA = "Unstake BERA",
|
|
63
|
+
QUEUE_UNBONDING_BERA = "Queue Unstake BERA",
|
|
64
|
+
BEND_MARKET_REPAY_AND_WITHDRAW_COLLATERAL = "Bend Market Repay and Withdraw Collateral",
|
|
65
|
+
BEND_MARKET_SUPPLY_COLLATERAL_AND_BORROW = "Bend Market Supply Collateral and Borrow",
|
|
66
|
+
BEND_VAULT_SUPPLY = "Bend Vault Supply",
|
|
67
|
+
BEND_VAULT_WITHDRAW = "Bend Vault Withdraw",
|
|
68
|
+
BEND_CURATOR_REALLOCATE = "Bend Curator Reallocate",
|
|
69
|
+
BEND_CURATOR_UPDATE_MARKET_SUPPLY_CAP = "Bend Curator Update Market Supply Cap",
|
|
70
|
+
BEND_CURATOR_REVOKE_PENDING_SUPPLY_CAP = "Bend Curator Revoke Pending Supply Cap",
|
|
71
|
+
BEND_CURATOR_ACCEPT_PENDING_SUPPLY_CAP = "Bend Curator Accept Pending Supply Cap",
|
|
72
|
+
BEND_CURATOR_UPDATE_SUPPLY_QUEUE = "Bend Curator Update Supply Queue",
|
|
73
|
+
BEND_CURATOR_UPDATE_WITHDRAW_QUEUE = "Bend Curator Update Withdraw Queue",
|
|
74
|
+
BEND_CURATOR_TRANSFER_OWNER = "Bend Curator Transfer Owner",
|
|
75
|
+
BEND_CURATOR_CHANGE_GUARDIAN = "Bend Curator Change Guardian",
|
|
76
|
+
BEND_CURATOR_SET_CURATOR = "Bend Curator Set Curator",
|
|
77
|
+
BEND_CURATOR_SET_ALLOCATOR = "Bend Curator Set Allocator"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { TransactionActionType as T };
|