Skip to content
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

MOB-2 : iOS: Update dydxClient hook to support query for withdrawal gating #133

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions v4-client-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v4-client-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dydxprotocol/v4-client-js",
"version": "1.1.0",
"version": "1.1.1",
"description": "General client library for the new dYdX system (v4 decentralized)",
"main": "build/src/index.js",
"scripts": {
Expand Down
20 changes: 20 additions & 0 deletions v4-client-js/src/clients/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1184,3 +1184,23 @@ export async function cctpWithdraw(squidPayload: string): Promise<String> {
return wrappedError(error);
}
}

export async function getWithdrawalCapacityByDenom(denom: string): Promise<string> {
try {
const validatorClient = globalThis.client.validatorClient;
const result = await validatorClient.get.getWithdrawalCapacityByDenom(denom);
return encodeJson(result, ByteArrayEncoding.BIGINT);
} catch (e) {
return wrappedError(e);
}
}

export async function getWithdrawalAndTransferGatingStatus(): Promise<string> {
try {
const validatorClient = globalThis.client.validatorClient;
const result = await validatorClient.get.getWithdrawalAndTransferGatingStatus();
return encodeJson(result, ByteArrayEncoding.BIGINT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is BIGINT encoding necessary for withdrawalAndTransferGatingStatus? I believe this should be human readable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks to be encoded
Screenshot 2024-03-28 at 11 19 32 AM

} catch (e) {
return wrappedError(e);
}
}
Loading