Skip to content

Commit

Permalink
Merge pull request #203 from osmosis-labs/feat/parse-all-http-options
Browse files Browse the repository at this point in the history
Feat/parse all http options
  • Loading branch information
pyramation authored Sep 14, 2022
2 parents 58ee1d4 + 480af81 commit 22d9a61
Show file tree
Hide file tree
Showing 87 changed files with 1,204 additions and 754 deletions.
10 changes: 5 additions & 5 deletions __fixtures__/output1/akash/audit/v1beta2/query.lcd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
import { Provider } from "./audit";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryAllProvidersAttributesRequest, QueryProvidersResponse, QueryProviderAttributesRequest, QueryProviderAuditorRequest, QueryAuditorAttributesRequest } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand Down Expand Up @@ -29,7 +29,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/audit/v1beta2/audit/attributes/list`;
return await this.request<QueryProvidersResponse>(endpoint, options);
return await this.get<QueryProvidersResponse>(endpoint, options);
}

/* ProviderAttributes queries all provider signed attributes
Expand All @@ -45,15 +45,15 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/audit/v1beta2/audit/attributes/${params.owner}/list`;
return await this.request<QueryProvidersResponse>(endpoint, options);
return await this.get<QueryProvidersResponse>(endpoint, options);
}

/* ProviderAuditorAttributes queries provider signed attributes by specific auditor
buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
buf:lint:ignore RPC_RESPONSE_STANDARD_NAME */
async providerAuditorAttributes(params: QueryProviderAuditorRequest): Promise<QueryProvidersResponse> {
const endpoint = `akash/audit/v1beta2/audit/attributes/${params.auditor}/${params.owner}`;
return await this.request<QueryProvidersResponse>(endpoint);
return await this.get<QueryProvidersResponse>(endpoint);
}

/* AuditorAttributes queries all providers signed by this auditor
Expand All @@ -69,7 +69,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/provider/v1beta2/auditor/${params.auditor}/list`;
return await this.request<QueryProvidersResponse>(endpoint, options);
return await this.get<QueryProvidersResponse>(endpoint, options);
}

}
12 changes: 6 additions & 6 deletions __fixtures__/output1/akash/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ import * as _343 from "./deployment/v1beta2/service.rpc.msg";
import * as _344 from "./market/v1beta2/service.rpc.msg";
import * as _345 from "./provider/v1beta1/provider.rpc.msg";
import * as _346 from "./provider/v1beta2/provider.rpc.msg";
import * as _514 from "./lcd";
import * as _515 from "./rpc.query";
import * as _516 from "./rpc.tx";
import * as _516 from "./lcd";
import * as _517 from "./rpc.query";
import * as _518 from "./rpc.tx";
export namespace akash {
export namespace audit {
export const v1beta1 = { ..._0,
Expand Down Expand Up @@ -213,8 +213,8 @@ export namespace akash {
..._346
};
}
export const ClientFactory = { ..._514,
..._515,
..._516
export const ClientFactory = { ..._516,
..._517,
..._518
};
}
4 changes: 2 additions & 2 deletions __fixtures__/output1/akash/cert/v1beta2/query.lcd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CertificateFilter, Certificate } from "./cert";
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryCertificatesRequest, QueryCertificatesResponse } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand Down Expand Up @@ -29,7 +29,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/cert/v1beta2/certificates/list`;
return await this.request<QueryCertificatesResponse>(endpoint, options);
return await this.get<QueryCertificatesResponse>(endpoint, options);
}

}
8 changes: 4 additions & 4 deletions __fixtures__/output1/akash/deployment/v1beta1/query.lcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { DeploymentFilters, DeploymentID, Deployment } from "./deployment";
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
import { GroupID, Group } from "./group";
import { Account } from "../../escrow/v1beta1/types";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryDeploymentsRequest, QueryDeploymentsResponse, QueryDeploymentRequest, QueryDeploymentResponse, QueryGroupRequest, QueryGroupResponse } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand Down Expand Up @@ -31,7 +31,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/deployment/v1beta1/deployments/list`;
return await this.request<QueryDeploymentsResponse>(endpoint, options);
return await this.get<QueryDeploymentsResponse>(endpoint, options);
}

/* Deployment queries deployment details */
Expand All @@ -45,7 +45,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/deployment/v1beta1/deployments/info`;
return await this.request<QueryDeploymentResponse>(endpoint, options);
return await this.get<QueryDeploymentResponse>(endpoint, options);
}

/* Group queries group details */
Expand All @@ -59,7 +59,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/deployment/v1beta1/groups/info`;
return await this.request<QueryGroupResponse>(endpoint, options);
return await this.get<QueryGroupResponse>(endpoint, options);
}

}
8 changes: 4 additions & 4 deletions __fixtures__/output1/akash/deployment/v1beta2/query.lcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pa
import { GroupID } from "./groupid";
import { Group } from "./group";
import { Account } from "../../escrow/v1beta2/types";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryDeploymentsRequest, QueryDeploymentsResponse, QueryDeploymentRequest, QueryDeploymentResponse, QueryGroupRequest, QueryGroupResponse } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand Down Expand Up @@ -32,7 +32,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/deployment/v1beta2/deployments/list`;
return await this.request<QueryDeploymentsResponse>(endpoint, options);
return await this.get<QueryDeploymentsResponse>(endpoint, options);
}

/* Deployment queries deployment details */
Expand All @@ -46,7 +46,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/deployment/v1beta2/deployments/info`;
return await this.request<QueryDeploymentResponse>(endpoint, options);
return await this.get<QueryDeploymentResponse>(endpoint, options);
}

/* Group queries group details */
Expand All @@ -60,7 +60,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/deployment/v1beta2/groups/info`;
return await this.request<QueryGroupResponse>(endpoint, options);
return await this.get<QueryGroupResponse>(endpoint, options);
}

}
6 changes: 3 additions & 3 deletions __fixtures__/output1/akash/escrow/v1beta1/query.lcd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
import { Account, Payment } from "./types";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryAccountsRequest, QueryAccountsResponse, QueryPaymentsRequest, QueryPaymentsResponse } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand Down Expand Up @@ -43,7 +43,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/escrow/v1beta1/types/accounts/list`;
return await this.request<QueryAccountsResponse>(endpoint, options);
return await this.get<QueryAccountsResponse>(endpoint, options);
}

/* buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
Expand Down Expand Up @@ -79,7 +79,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/escrow/v1beta1/types/payments/list`;
return await this.request<QueryPaymentsResponse>(endpoint, options);
return await this.get<QueryPaymentsResponse>(endpoint, options);
}

}
6 changes: 3 additions & 3 deletions __fixtures__/output1/akash/escrow/v1beta2/query.lcd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
import { Account, FractionalPayment } from "./types";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryAccountsRequest, QueryAccountsResponse, QueryPaymentsRequest, QueryPaymentsResponse } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand Down Expand Up @@ -43,7 +43,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/escrow/v1beta2/types/accounts/list`;
return await this.request<QueryAccountsResponse>(endpoint, options);
return await this.get<QueryAccountsResponse>(endpoint, options);
}

/* buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
Expand Down Expand Up @@ -79,7 +79,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/escrow/v1beta2/types/payments/list`;
return await this.request<QueryPaymentsResponse>(endpoint, options);
return await this.get<QueryPaymentsResponse>(endpoint, options);
}

}
12 changes: 12 additions & 0 deletions __fixtures__/output1/akash/lcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ export const createLCDClient = async ({
restEndpoint
})
},
base: {
tendermint: {
v1beta1: new (await import("../cosmos/base/tendermint/v1beta1/query.lcd")).LCDQueryClient({
restEndpoint
})
}
},
distribution: {
v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({
restEndpoint
Expand Down Expand Up @@ -110,6 +117,11 @@ export const createLCDClient = async ({
restEndpoint
})
},
tx: {
v1beta1: new (await import("../cosmos/tx/v1beta1/service.lcd")).LCDQueryClient({
restEndpoint
})
},
upgrade: {
v1beta1: new (await import("../cosmos/upgrade/v1beta1/query.lcd")).LCDQueryClient({
restEndpoint
Expand Down
14 changes: 7 additions & 7 deletions __fixtures__/output1/akash/market/v1beta2/query.lcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pa
import { BidFilters, BidID, Bid } from "./bid";
import { LeaseFilters, LeaseID, Lease } from "./lease";
import { Account, FractionalPayment } from "../../escrow/v1beta2/types";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryOrdersRequest, QueryOrdersResponse, QueryOrderRequest, QueryOrderResponse, QueryBidsRequest, QueryBidsResponse, QueryBidRequest, QueryBidResponse, QueryLeasesRequest, QueryLeasesResponse, QueryLeaseRequest, QueryLeaseResponse } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand Down Expand Up @@ -32,7 +32,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/market/v1beta2/orders/list`;
return await this.request<QueryOrdersResponse>(endpoint, options);
return await this.get<QueryOrdersResponse>(endpoint, options);
}

/* Order queries order details */
Expand All @@ -46,7 +46,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/market/v1beta2/orders/info`;
return await this.request<QueryOrderResponse>(endpoint, options);
return await this.get<QueryOrderResponse>(endpoint, options);
}

/* Bids queries bids with filters */
Expand All @@ -64,7 +64,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/market/v1beta2/bids/list`;
return await this.request<QueryBidsResponse>(endpoint, options);
return await this.get<QueryBidsResponse>(endpoint, options);
}

/* Bid queries bid details */
Expand All @@ -78,7 +78,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/market/v1beta2/bids/info`;
return await this.request<QueryBidResponse>(endpoint, options);
return await this.get<QueryBidResponse>(endpoint, options);
}

/* Leases queries leases with filters */
Expand All @@ -96,7 +96,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/market/v1beta2/leases/list`;
return await this.request<QueryLeasesResponse>(endpoint, options);
return await this.get<QueryLeasesResponse>(endpoint, options);
}

/* Lease queries lease details */
Expand All @@ -110,7 +110,7 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/market/v1beta2/leases/info`;
return await this.request<QueryLeaseResponse>(endpoint, options);
return await this.get<QueryLeaseResponse>(endpoint, options);
}

}
6 changes: 3 additions & 3 deletions __fixtures__/output1/akash/provider/v1beta2/query.lcd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
import { Provider } from "./provider";
import { LCDClient } from "@osmonauts/lcd";
import { setPaginationParams } from "@osmonauts/helpers";
import { LCDClient } from "@osmonauts/lcd";
import { QueryProvidersRequest, QueryProvidersResponse, QueryProviderRequest, QueryProviderResponse } from "./query";
export class LCDQueryClient extends LCDClient {
constructor({
Expand All @@ -27,13 +27,13 @@ export class LCDQueryClient extends LCDClient {
}

const endpoint = `akash/provider/v1beta2/providers`;
return await this.request<QueryProvidersResponse>(endpoint, options);
return await this.get<QueryProvidersResponse>(endpoint, options);
}

/* Provider queries provider details */
async provider(params: QueryProviderRequest): Promise<QueryProviderResponse> {
const endpoint = `akash/provider/v1beta2/providers/${params.owner}`;
return await this.request<QueryProviderResponse>(endpoint);
return await this.get<QueryProviderResponse>(endpoint);
}

}
8 changes: 8 additions & 0 deletions __fixtures__/output1/akash/rpc.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export const createRPCQueryClient = async ({
bank: {
v1beta1: new (await import("../cosmos/bank/v1beta1/query.rpc.query")).QueryClientImpl(rpc)
},
base: {
tendermint: {
v1beta1: new (await import("../cosmos/base/tendermint/v1beta1/query.rpc.svc")).QueryClientImpl(rpc)
}
},
distribution: {
v1beta1: new (await import("../cosmos/distribution/v1beta1/query.rpc.query")).QueryClientImpl(rpc)
},
Expand Down Expand Up @@ -70,6 +75,9 @@ export const createRPCQueryClient = async ({
staking: {
v1beta1: new (await import("../cosmos/staking/v1beta1/query.rpc.query")).QueryClientImpl(rpc)
},
tx: {
v1beta1: new (await import("../cosmos/tx/v1beta1/service.rpc.svc")).QueryClientImpl(rpc)
},
upgrade: {
v1beta1: new (await import("../cosmos/upgrade/v1beta1/query.rpc.query")).QueryClientImpl(rpc)
}
Expand Down
Loading

0 comments on commit 22d9a61

Please sign in to comment.