@sage-protocol/sdk 0.1.18 → 0.1.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-protocol/sdk",
3
- "version": "0.1.18",
3
+ "version": "0.1.21",
4
4
  "description": "Backend-agnostic SDK for interacting with the Sage Protocol (governance, SubDAOs, tokens).",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
package/types/index.d.ts CHANGED
@@ -131,8 +131,176 @@ export interface GovernanceOperationsModule {
131
131
  }): Promise<TimelockRoleCheck[]>;
132
132
  }
133
133
 
134
+ export interface VotesTokenDescription {
135
+ votingToken: AddressLike;
136
+ baseToken: AddressLike;
137
+ isWrapper: boolean;
138
+ multiplierNFT: AddressLike | null;
139
+ basis: bigint | null;
140
+ description: string;
141
+ }
142
+
143
+ export interface VotingStatus {
144
+ subdao: AddressLike | null;
145
+ governor: AddressLike;
146
+ stakeToken: AddressLike | null;
147
+ votingToken: AddressLike;
148
+ baseToken: AddressLike;
149
+ isWrapper: boolean;
150
+ multiplierNFT: AddressLike | null;
151
+ basis: bigint | null;
152
+ threshold: bigint | null;
153
+ votingPower: bigint | null;
154
+ tokenBalance: bigint | null;
155
+ delegate: AddressLike | null;
156
+ canPropose: boolean | null;
157
+ tokenMismatch: boolean;
158
+ stakeTokenVotes: bigint | null;
159
+ stakeTokenDelegate: AddressLike | null;
160
+ stakeTokenBalance: bigint | null;
161
+ description: string;
162
+ }
163
+
164
+ export interface ProposeGatesSummary {
165
+ threshold: bigint | null;
166
+ cooldown: bigint | null;
167
+ stake: bigint | null;
168
+ allowanceOk: boolean | null;
169
+ votesOk: boolean | null;
170
+ details: {
171
+ sxxxToken: AddressLike | null;
172
+ proposer: AddressLike;
173
+ governor: AddressLike;
174
+ };
175
+ }
176
+
177
+ export interface ProposeReadiness extends ProposeGatesSummary {
178
+ executionReady: boolean | null;
179
+ executionError: string | null;
180
+ }
181
+
134
182
  export interface GovernanceModule {
135
183
  operations: GovernanceOperationsModule;
184
+ getGovernorInfo(args: { provider: ProviderLike; governor: AddressLike }): Promise<{
185
+ address: AddressLike;
186
+ name: string | null;
187
+ votingDelay: bigint | null;
188
+ votingPeriod: bigint | null;
189
+ proposalThreshold: bigint | null;
190
+ timelock: AddressLike | null;
191
+ sxxxToken: AddressLike | null;
192
+ quorumNumerator: bigint | null;
193
+ stakeAmount: bigint | null;
194
+ }>;
195
+ getProposal(args: { provider: ProviderLike; governor: AddressLike; id: bigint | number | string }): Promise<{
196
+ governor: AddressLike;
197
+ id: bigint;
198
+ state: any;
199
+ snapshot: bigint;
200
+ deadline: bigint;
201
+ votes: { against: bigint; for: bigint; abstain: bigint };
202
+ }>;
203
+ listProposals(args: { provider: ProviderLike; governor: AddressLike; fromBlock?: number | bigint | string; toBlock?: number | bigint | string }): Promise<ProposalTuple[]>;
204
+ getProposalMetadata(args: { provider: ProviderLike; governor: AddressLike; id: bigint | number | string; fromBlock?: number | bigint | string; toBlock?: number | bigint | string }): Promise<ProposalTuple & {
205
+ proposer: AddressLike;
206
+ blockNumber: number | bigint | null;
207
+ transactionHash: HashLike | null;
208
+ }>;
209
+ hashDescription(description: string): HashLike;
210
+ buildProposeTx(args: {
211
+ governor: AddressLike;
212
+ targets?: AddressLike[];
213
+ values?: bigint[] | BigNumberish[];
214
+ calldatas?: string[];
215
+ descriptionOrHash?: string;
216
+ }): TransactionPayload;
217
+ buildCastVoteTx(args: { governor: AddressLike; proposalId: bigint | number | string; support: number | string; reason?: string }): TransactionPayload;
218
+ buildQueueTx(args: {
219
+ governor: AddressLike;
220
+ targets?: AddressLike[];
221
+ values?: bigint[] | BigNumberish[];
222
+ calldatas?: string[];
223
+ descriptionOrHash?: string;
224
+ }): TransactionPayload;
225
+ buildExecuteTx(args: {
226
+ governor: AddressLike;
227
+ targets?: AddressLike[];
228
+ values?: bigint[] | BigNumberish[];
229
+ calldatas?: string[];
230
+ descriptionOrHash?: string;
231
+ }): TransactionPayload;
232
+ buildQueueByIdTx(args: { governor: AddressLike; proposalId: bigint | number | string }): TransactionPayload;
233
+ buildExecuteByIdTx(args: { governor: AddressLike; proposalId: bigint | number | string }): TransactionPayload;
234
+ decodeProposalEffects(args: {
235
+ provider: ProviderLike;
236
+ governor: AddressLike;
237
+ proposalId: bigint | number | string;
238
+ fromBlock?: number | bigint | string;
239
+ toBlock?: number | bigint | string;
240
+ }): Promise<any>;
241
+ getQuorumAt(args: { provider: ProviderLike; governor: AddressLike; blockTag?: bigint | number | string }): Promise<bigint | null>;
242
+ getQuorumLatestMinusOne(args: { provider: ProviderLike; governor: AddressLike }): Promise<bigint | null>;
243
+ getVotesLatestMinusOne(args: { provider: ProviderLike; token?: AddressLike; governor?: AddressLike; account: AddressLike }): Promise<bigint>;
244
+ simulatePropose(args: {
245
+ provider: ProviderLike;
246
+ governor: AddressLike;
247
+ targets?: AddressLike[];
248
+ values?: bigint[] | BigNumberish[];
249
+ calldatas?: string[];
250
+ description?: string;
251
+ sender?: AddressLike;
252
+ }): Promise<{ ok: boolean; error?: { type: string; message: string } }>;
253
+ resolveVotesToken(args: { provider: ProviderLike; subdao?: AddressLike; governor?: AddressLike }): Promise<AddressLike>;
254
+ resolveVotesTokenChain(args: { provider: ProviderLike; subdao?: AddressLike; governor?: AddressLike }): Promise<{
255
+ votingToken: AddressLike;
256
+ baseToken: AddressLike;
257
+ isWrapper: boolean;
258
+ }>;
259
+ describeVotesToken(args: { provider: ProviderLike; subdao?: AddressLike; governor?: AddressLike }): Promise<VotesTokenDescription>;
260
+ getVotingStatus(args: { provider: ProviderLike; subdao?: AddressLike; governor?: AddressLike; account: AddressLike }): Promise<VotingStatus>;
261
+ buildDelegateTx(args: { token: AddressLike; delegatee: AddressLike }): TransactionPayload;
262
+ buildDelegateSelfTx(args: { provider: ProviderLike; governor: AddressLike; account: AddressLike }): Promise<TransactionPayload>;
263
+ buildDelegateSelfPreferred(args: { provider: ProviderLike; subdao?: AddressLike; governor?: AddressLike; account: AddressLike }): Promise<TransactionPayload>;
264
+ delegateSelfAndVerify(args: {
265
+ provider: ProviderLike;
266
+ subdao?: AddressLike;
267
+ governor?: AddressLike;
268
+ account: AddressLike;
269
+ signer?: any;
270
+ minVotes?: bigint | number | string | null;
271
+ }): Promise<{ txHash: string | null; ok: boolean; votes: bigint; payload: TransactionPayload }>;
272
+ ensureProposeGates(args: { provider: ProviderLike; governor: AddressLike; proposer: AddressLike }): Promise<ProposeGatesSummary>;
273
+ readinessToPropose(args: {
274
+ provider: ProviderLike;
275
+ governor: AddressLike;
276
+ proposer: AddressLike;
277
+ execution?: {
278
+ provider: ProviderLike;
279
+ registry: AddressLike;
280
+ timelock: AddressLike;
281
+ subdao: AddressLike;
282
+ libraryId?: string;
283
+ manifestCID?: string;
284
+ promptCount?: bigint | number | string;
285
+ } | null;
286
+ }): Promise<ProposeReadiness>;
287
+ listActiveProposals(args: { url: string; governor: AddressLike; first?: number; skip?: number }): Promise<any>;
288
+ buildProposeTxByHash(args: {
289
+ governor: AddressLike;
290
+ targets?: AddressLike[];
291
+ values?: bigint[] | BigNumberish[];
292
+ calldatas?: string[];
293
+ descriptionHash: string;
294
+ }): TransactionPayload;
295
+ detectMode(args: { provider: ProviderLike; governor?: AddressLike; timelock?: AddressLike | null; subdao?: AddressLike | null }): Promise<{
296
+ operator: boolean;
297
+ governance: string;
298
+ governor: AddressLike | null;
299
+ timelock: AddressLike | null;
300
+ subdao: AddressLike | null;
301
+ stakeRequired: bigint | null;
302
+ depositWei: bigint | null;
303
+ }>;
136
304
  [key: string]: any;
137
305
  }
138
306
 
@@ -762,7 +930,7 @@ export interface SageSDK {
762
930
  version: string;
763
931
  getProvider: (rpcUrl: string) => any;
764
932
  abi: Record<string, any>;
765
- governance: Record<string, any>;
933
+ governance: GovernanceModule;
766
934
  subdao: Record<string, any>;
767
935
  timelock: Record<string, any>;
768
936
  factory: Record<string, any>;