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

pass shares to withdraw in megavault withdrawal query rest endpoint #2550

Merged
merged 1 commit into from
Oct 31, 2024
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { setPaginationParams } from "../../helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryParamsRequest, QueryParamsResponseSDKType, QueryVaultRequest, QueryVaultResponseSDKType, QueryAllVaultsRequest, QueryAllVaultsResponseSDKType, QueryMegavaultTotalSharesRequest, QueryMegavaultTotalSharesResponseSDKType, QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponseSDKType, QueryMegavaultAllOwnerSharesRequest, QueryMegavaultAllOwnerSharesResponseSDKType, QueryVaultParamsRequest, QueryVaultParamsResponseSDKType, QueryMegavaultWithdrawalInfoRequest, QueryMegavaultWithdrawalInfoResponseSDKType } from "./query";
import { QueryParamsRequest, QueryParamsResponseSDKType, QueryVaultRequest, QueryVaultResponseSDKType, QueryAllVaultsRequest, QueryAllVaultsResponseSDKType, QueryMegavaultTotalSharesRequest, QueryMegavaultTotalSharesResponseSDKType, QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponseSDKType, QueryMegavaultAllOwnerSharesRequest, QueryMegavaultAllOwnerSharesResponseSDKType, QueryVaultParamsRequest, QueryVaultParamsResponseSDKType } from "./query";
export class LCDQueryClient {
req: LCDClient;

Expand All @@ -17,7 +17,6 @@ export class LCDQueryClient {
this.megavaultOwnerShares = this.megavaultOwnerShares.bind(this);
this.megavaultAllOwnerShares = this.megavaultAllOwnerShares.bind(this);
this.vaultParams = this.vaultParams.bind(this);
this.megavaultWithdrawalInfo = this.megavaultWithdrawalInfo.bind(this);
}
/* Queries the Params. */

Expand Down Expand Up @@ -88,20 +87,5 @@ export class LCDQueryClient {
const endpoint = `dydxprotocol/vault/params/${params.type}/${params.number}`;
return await this.req.get<QueryVaultParamsResponseSDKType>(endpoint);
}
/* Queries withdrawal info for megavault. */


async megavaultWithdrawalInfo(params: QueryMegavaultWithdrawalInfoRequest): Promise<QueryMegavaultWithdrawalInfoResponseSDKType> {
const options: any = {
params: {}
};

if (typeof params?.sharesToWithdraw !== "undefined") {
options.params.shares_to_withdraw = params.sharesToWithdraw;
}

const endpoint = `dydxprotocol/vault/megavault/withdrawal_info`;
return await this.req.get<QueryMegavaultWithdrawalInfoResponseSDKType>(endpoint, options);
}

}
6 changes: 4 additions & 2 deletions proto/dydxprotocol/vault/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ service Query {
// Queries withdrawal info for megavault.
rpc MegavaultWithdrawalInfo(QueryMegavaultWithdrawalInfoRequest)
returns (QueryMegavaultWithdrawalInfoResponse) {
option (google.api.http).get =
"/dydxprotocol/vault/megavault/withdrawal_info";
option (google.api.http) = {
post : "/dydxprotocol/vault/megavault/withdrawal_info"
body : "*"
};
}
}

Expand Down
164 changes: 82 additions & 82 deletions protocol/x/vault/types/query.pb.go

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

Loading
Loading