Skip to content

Commit

Permalink
Use akash-api protobuf generated files instead of local ones (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrishajev committed Apr 12, 2024
1 parent 7f11ac8 commit 885d3b3
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 73 deletions.
Binary file added akashnetwork-akash-api-0.0.0.tgz
Binary file not shown.
19 changes: 18 additions & 1 deletion package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
]
},
"dependencies": {
"@akashnetwork/akash-api": "file:akashnetwork-akash-api-0.0.0.tgz",
"@cosmjs/launchpad": "^0.27.0",
"@cosmjs/proto-signing": "^0.28.11",
"@cosmjs/stargate": "^0.28.0",
Expand Down Expand Up @@ -83,7 +84,7 @@
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"ts-proto": "^1.104.0",
"typescript": "^4.3.4",
"typescript": "^4.7.4",
"webpack": "^5.41.1",
"webpack-cli": "^4.7.2"
},
Expand Down
4 changes: 2 additions & 2 deletions src/certificates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { SigningStargateClient } from "@cosmjs/stargate";
import { messages as stargateMessages } from "../stargate";
import { createStarGateMessage } from "../pbclient/pbclient";

import { QueryCertificatesRequest, QueryCertificatesResponse } from "../protobuf/akash/cert/v1beta3/query";
import { CertificateFilter } from "../protobuf/akash/cert/v1beta1/cert";
import { QueryCertificatesRequest, QueryCertificatesResponse, CertificateFilter } from "@akashnetwork/akash-api/akash/cert/v1beta3";

// eslint-disable-next-line @typescript-eslint/no-var-requires
const JsonRPC = require("simple-jsonrpc-js");

import { toBase64 } from "pvutils";
Expand Down
2 changes: 1 addition & 1 deletion src/keplr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getAkashTypeRegistry } from "../stargate";
import { defaultRegistryTypes, SigningStargateClient } from "@cosmjs/stargate";
import { Registry } from "@cosmjs/proto-signing";
import { AminoTypes } from "@cosmjs/stargate";
import { Certificate } from "../protobuf/akash/cert/v1beta2/cert";
import { Certificate } from "@akashnetwork/akash-api/akash/cert/v1beta2";

export function getChains() {
return {
Expand Down
1 change: 0 additions & 1 deletion src/rpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { createProtobufRpcClient, GasPrice, QueryClient, SigningStargateClient, SigningStargateClientOptions } from "@cosmjs/stargate";
import { getAkashTypeRegistry } from "../stargate";
import { OfflineSigner, Registry } from "@cosmjs/proto-signing";
import { Decimal } from "cosmwasm";

export async function getRpc(endpoint: string) {
return getQueryClient(endpoint);
Expand Down
4 changes: 3 additions & 1 deletion src/sdl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export class SDL {

if (
units > 0 &&
Object.values(gpu.attributes?.vendor || {}).some(models => models?.some(model => model.interface && !GPU_SUPPORTED_INTERFACES.includes(model.interface)))
Object.values(gpu.attributes?.vendor || {}).some(models =>
models?.some(model => model.interface && !GPU_SUPPORTED_INTERFACES.includes(model.interface))
)
) {
throw new Error(`GPU interface must be one of the supported interfaces (${GPU_SUPPORTED_INTERFACES.join(",")}).`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/stargate/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageType, messageTypeRegistry, UnknownMessage } from "../protobuf/typeRegistry";
import { MessageType, messageTypeRegistry, UnknownMessage } from "@akashnetwork/akash-api/typeRegistry";

export const getAkashTypeRegistry: () => [string, MessageType<UnknownMessage>][] = () =>
Array.from(messageTypeRegistry).map(([path, type]) => [`/${path}`, type]);
Expand Down
Loading

0 comments on commit 885d3b3

Please sign in to comment.