Skip to content

Commit

Permalink
feat(api): uses akash-api protobuf generated files instead of local o…
Browse files Browse the repository at this point in the history
…nes (#184)
  • Loading branch information
ygrishajev committed Apr 22, 2024
1 parent 7f11ac8 commit aca6673
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 76 deletions.
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/

23 changes: 20 additions & 3 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@akashnetwork/akashjs",
"version": "0.5.11",
"version": "0.5.12",
"description": "Akash Network JS SDK",
"repository": {
"url": "https://github.com/ovrclk/akashjs"
Expand Down 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",
"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 aca6673

Please sign in to comment.