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

refactor(api): uses akash-api protobuf generated files instead of local ones (#184) #73

Merged
merged 1 commit into from
Apr 19, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ yarn-error.log

# Tests artifacts
.coverage/
coverage/

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": "^1.0.2",
"@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",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a locked version anyway

"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
Loading