-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add staking types sdk #7389
Add staking types sdk #7389
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
3b190b5
to
a43e62a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! Please generate a changeset and address the comments before merging
@@ -737,4 +739,36 @@ export class JsonRpcProvider extends Provider { | |||
); | |||
} | |||
} | |||
|
|||
async getDelegatedStake(address: string): Promise<DelegatedStake[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async getDelegatedStake(address: string): Promise<DelegatedStake[]> { | |
async getDelegatedStake(address: SuiAddress): Promise<DelegatedStake[]> { |
|
||
async getDelegatedStake(address: string): Promise<DelegatedStake[]> { | ||
try { | ||
const resp = await this.client.requestWithType( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a check for the address? Example: https://github.com/MystenLabs/sui/blob/a43e62a3ca6fc46a980faee5967e6f7628a2910a/sdk/typescript/src/providers/json-rpc-provider.ts#L295
return resp; | ||
} catch (err) { | ||
throw new Error( | ||
`Error dry running transaction with request type: ${err}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`Error dry running transaction with request type: ${err}` | |
`Error in getDelegatedStake: ${err}` |
return resp; | ||
} catch (err) { | ||
throw new Error( | ||
`Error dry running transaction with request type: ${err}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`Error dry running transaction with request type: ${err}` | |
`Error in getValidators: ${err}` |
b41d0fd
to
553b3ad
Compare
Added Validator Type and RPC endpoint for getDelegatedStake and getValidators