Skip to content

Commit

Permalink
adding distribution support and latest protos
Browse files Browse the repository at this point in the history
  • Loading branch information
karnthis committed Oct 24, 2022
1 parent 651b4c9 commit 69c4d0a
Show file tree
Hide file tree
Showing 7 changed files with 476 additions and 221 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jackal.js-protos",
"version": "1.0.0",
"version": "1.1.0",
"description": "Package of all protos used by Jackal.js",
"keywords": [
"jackal",
Expand Down
2 changes: 2 additions & 0 deletions src/customBroadcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { types as storageTypes } from './protos/jackal-dao/canine/jackaldao.cani
* Jackal Stock CosmosSDK Protos
*/
import { types as bankTypes } from './protos/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module'
import { types as distributionTypes } from './protos/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module'
import { types as govTypes } from './protos/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module'
import { types as stakingTypes } from './protos/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module'

Expand Down Expand Up @@ -45,6 +46,7 @@ const masterTypes = [
...rnsTypes,
...storageTypes,
...bankTypes,
...distributionTypes,
...govTypes,
...stakingTypes
]
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export { Api as storageQueryApi } from './protos/jackal-dao/canine/jackaldao.can
export { txClient as cosmTxClient, queryClient as cosmQueryClient } from './protos/CosmWasm/wasmd/cosmwasm.wasm.v1/module'

export { txClient as bankTxClient, queryClient as bankQueryClient } from './protos/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module'
export { txClient as distributionTxClient, queryClient as distributionQueryClient } from './protos/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module'
export { txClient as govTxClient, queryClient as govQueryClient } from './protos/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module'
export { txClient as stakingTxClient, queryClient as stakingQueryClient } from './protos/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module'

export { Api as cosmQueryApi } from './protos/CosmWasm/wasmd/cosmwasm.wasm.v1/module/rest'

export { Api as bankQueryApi } from './protos/cosmos/cosmos-sdk/cosmos.bank.v1beta1/module/rest'
export { Api as distributionQueryApi } from './protos/cosmos/cosmos-sdk/cosmos.distribution.v1beta1/module/rest'
export { Api as govQueryApi } from './protos/cosmos/cosmos-sdk/cosmos.gov.v1beta1/module/rest'
export { Api as stakingQueryApi } from './protos/cosmos/cosmos-sdk/cosmos.staking.v1beta1/module/rest'
365 changes: 197 additions & 168 deletions src/protos/jackal-dao/canine/jackaldao.canine.storage/index.ts

Large diffs are not rendered by default.

102 changes: 51 additions & 51 deletions src/protos/jackal-dao/canine/jackaldao.canine.storage/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@ import { StdFee } from "@cosmjs/launchpad";
import { SigningStargateClient } from "@cosmjs/stargate";
import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { Api } from "./rest";
import { MsgCreateContracts } from "./types/storage/tx";
import { MsgUpdateActiveDeals } from "./types/storage/tx";
import { MsgUpdateProviders } from "./types/storage/tx";
import { MsgDeleteActiveDeals } from "./types/storage/tx";
import { MsgSetProviderTotalspace } from "./types/storage/tx";
import { MsgCreateProviders } from "./types/storage/tx";
import { MsgInitProvider } from "./types/storage/tx";
import { MsgClaimStray } from "./types/storage/tx";
import { MsgDeleteProofs } from "./types/storage/tx";
import { MsgBuyStorage } from "./types/storage/tx";
import { MsgUpdateProofs } from "./types/storage/tx";
import { MsgCreateActiveDeals } from "./types/storage/tx";
import { MsgInitProvider } from "./types/storage/tx";
import { MsgPostContract } from "./types/storage/tx";
import { MsgCreateProviders } from "./types/storage/tx";
import { MsgUpdateProviders } from "./types/storage/tx";
import { MsgItem } from "./types/storage/tx";
import { MsgPostproof } from "./types/storage/tx";
import { MsgDeleteContracts } from "./types/storage/tx";
import { MsgSetProviderIp } from "./types/storage/tx";
import { MsgSignContract } from "./types/storage/tx";
import { MsgDeleteProviders } from "./types/storage/tx";
import { MsgDeleteContracts } from "./types/storage/tx";
import { MsgUpdateActiveDeals } from "./types/storage/tx";
import { MsgBuyStorage } from "./types/storage/tx";
import { MsgUpdateContracts } from "./types/storage/tx";
import { MsgCreateProofs } from "./types/storage/tx";
import { MsgDeleteProviders } from "./types/storage/tx";
import { MsgCancelContract } from "./types/storage/tx";
import { MsgCreateActiveDeals } from "./types/storage/tx";
import { MsgItem } from "./types/storage/tx";
import { MsgPostContract } from "./types/storage/tx";
import { MsgDeleteActiveDeals } from "./types/storage/tx";
import { MsgCreateProofs } from "./types/storage/tx";
import { MsgClaimStray } from "./types/storage/tx";
import { MsgDeleteProofs } from "./types/storage/tx";
import { MsgSignContract } from "./types/storage/tx";
import { MsgSetProviderTotalspace } from "./types/storage/tx";
import { MsgCreateContracts } from "./types/storage/tx";


export const types = [
["/jackaldao.canine.storage.MsgCreateContracts", MsgCreateContracts],
["/jackaldao.canine.storage.MsgUpdateActiveDeals", MsgUpdateActiveDeals],
["/jackaldao.canine.storage.MsgUpdateProviders", MsgUpdateProviders],
["/jackaldao.canine.storage.MsgDeleteActiveDeals", MsgDeleteActiveDeals],
["/jackaldao.canine.storage.MsgSetProviderTotalspace", MsgSetProviderTotalspace],
["/jackaldao.canine.storage.MsgCreateProviders", MsgCreateProviders],
["/jackaldao.canine.storage.MsgInitProvider", MsgInitProvider],
["/jackaldao.canine.storage.MsgClaimStray", MsgClaimStray],
["/jackaldao.canine.storage.MsgDeleteProofs", MsgDeleteProofs],
["/jackaldao.canine.storage.MsgBuyStorage", MsgBuyStorage],
["/jackaldao.canine.storage.MsgUpdateProofs", MsgUpdateProofs],
["/jackaldao.canine.storage.MsgCreateActiveDeals", MsgCreateActiveDeals],
["/jackaldao.canine.storage.MsgInitProvider", MsgInitProvider],
["/jackaldao.canine.storage.MsgPostContract", MsgPostContract],
["/jackaldao.canine.storage.MsgCreateProviders", MsgCreateProviders],
["/jackaldao.canine.storage.MsgUpdateProviders", MsgUpdateProviders],
["/jackaldao.canine.storage.MsgItem", MsgItem],
["/jackaldao.canine.storage.MsgPostproof", MsgPostproof],
["/jackaldao.canine.storage.MsgDeleteContracts", MsgDeleteContracts],
["/jackaldao.canine.storage.MsgSetProviderIp", MsgSetProviderIp],
["/jackaldao.canine.storage.MsgSignContract", MsgSignContract],
["/jackaldao.canine.storage.MsgDeleteProviders", MsgDeleteProviders],
["/jackaldao.canine.storage.MsgDeleteContracts", MsgDeleteContracts],
["/jackaldao.canine.storage.MsgUpdateActiveDeals", MsgUpdateActiveDeals],
["/jackaldao.canine.storage.MsgBuyStorage", MsgBuyStorage],
["/jackaldao.canine.storage.MsgUpdateContracts", MsgUpdateContracts],
["/jackaldao.canine.storage.MsgCreateProofs", MsgCreateProofs],
["/jackaldao.canine.storage.MsgDeleteProviders", MsgDeleteProviders],
["/jackaldao.canine.storage.MsgCancelContract", MsgCancelContract],
["/jackaldao.canine.storage.MsgCreateActiveDeals", MsgCreateActiveDeals],
["/jackaldao.canine.storage.MsgItem", MsgItem],
["/jackaldao.canine.storage.MsgPostContract", MsgPostContract],
["/jackaldao.canine.storage.MsgDeleteActiveDeals", MsgDeleteActiveDeals],
["/jackaldao.canine.storage.MsgCreateProofs", MsgCreateProofs],
["/jackaldao.canine.storage.MsgClaimStray", MsgClaimStray],
["/jackaldao.canine.storage.MsgDeleteProofs", MsgDeleteProofs],
["/jackaldao.canine.storage.MsgSignContract", MsgSignContract],
["/jackaldao.canine.storage.MsgSetProviderTotalspace", MsgSetProviderTotalspace],
["/jackaldao.canine.storage.MsgCreateContracts", MsgCreateContracts],

];
export const MissingWalletError = new Error("wallet is required");
Expand Down Expand Up @@ -83,28 +83,28 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions =

return {
signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo),
msgCreateContracts: (data: MsgCreateContracts): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateContracts", value: MsgCreateContracts.fromPartial( data ) }),
msgUpdateActiveDeals: (data: MsgUpdateActiveDeals): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgUpdateActiveDeals", value: MsgUpdateActiveDeals.fromPartial( data ) }),
msgUpdateProviders: (data: MsgUpdateProviders): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgUpdateProviders", value: MsgUpdateProviders.fromPartial( data ) }),
msgDeleteActiveDeals: (data: MsgDeleteActiveDeals): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteActiveDeals", value: MsgDeleteActiveDeals.fromPartial( data ) }),
msgSetProviderTotalspace: (data: MsgSetProviderTotalspace): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgSetProviderTotalspace", value: MsgSetProviderTotalspace.fromPartial( data ) }),
msgCreateProviders: (data: MsgCreateProviders): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateProviders", value: MsgCreateProviders.fromPartial( data ) }),
msgInitProvider: (data: MsgInitProvider): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgInitProvider", value: MsgInitProvider.fromPartial( data ) }),
msgClaimStray: (data: MsgClaimStray): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgClaimStray", value: MsgClaimStray.fromPartial( data ) }),
msgDeleteProofs: (data: MsgDeleteProofs): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteProofs", value: MsgDeleteProofs.fromPartial( data ) }),
msgBuyStorage: (data: MsgBuyStorage): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgBuyStorage", value: MsgBuyStorage.fromPartial( data ) }),
msgUpdateProofs: (data: MsgUpdateProofs): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgUpdateProofs", value: MsgUpdateProofs.fromPartial( data ) }),
msgCreateActiveDeals: (data: MsgCreateActiveDeals): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateActiveDeals", value: MsgCreateActiveDeals.fromPartial( data ) }),
msgInitProvider: (data: MsgInitProvider): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgInitProvider", value: MsgInitProvider.fromPartial( data ) }),
msgPostContract: (data: MsgPostContract): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgPostContract", value: MsgPostContract.fromPartial( data ) }),
msgCreateProviders: (data: MsgCreateProviders): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateProviders", value: MsgCreateProviders.fromPartial( data ) }),
msgUpdateProviders: (data: MsgUpdateProviders): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgUpdateProviders", value: MsgUpdateProviders.fromPartial( data ) }),
msgItem: (data: MsgItem): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgItem", value: MsgItem.fromPartial( data ) }),
msgPostproof: (data: MsgPostproof): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgPostproof", value: MsgPostproof.fromPartial( data ) }),
msgDeleteContracts: (data: MsgDeleteContracts): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteContracts", value: MsgDeleteContracts.fromPartial( data ) }),
msgSetProviderIp: (data: MsgSetProviderIp): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgSetProviderIp", value: MsgSetProviderIp.fromPartial( data ) }),
msgSignContract: (data: MsgSignContract): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgSignContract", value: MsgSignContract.fromPartial( data ) }),
msgDeleteProviders: (data: MsgDeleteProviders): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteProviders", value: MsgDeleteProviders.fromPartial( data ) }),
msgDeleteContracts: (data: MsgDeleteContracts): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteContracts", value: MsgDeleteContracts.fromPartial( data ) }),
msgUpdateActiveDeals: (data: MsgUpdateActiveDeals): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgUpdateActiveDeals", value: MsgUpdateActiveDeals.fromPartial( data ) }),
msgBuyStorage: (data: MsgBuyStorage): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgBuyStorage", value: MsgBuyStorage.fromPartial( data ) }),
msgUpdateContracts: (data: MsgUpdateContracts): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgUpdateContracts", value: MsgUpdateContracts.fromPartial( data ) }),
msgCreateProofs: (data: MsgCreateProofs): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateProofs", value: MsgCreateProofs.fromPartial( data ) }),
msgDeleteProviders: (data: MsgDeleteProviders): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteProviders", value: MsgDeleteProviders.fromPartial( data ) }),
msgCancelContract: (data: MsgCancelContract): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCancelContract", value: MsgCancelContract.fromPartial( data ) }),
msgCreateActiveDeals: (data: MsgCreateActiveDeals): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateActiveDeals", value: MsgCreateActiveDeals.fromPartial( data ) }),
msgItem: (data: MsgItem): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgItem", value: MsgItem.fromPartial( data ) }),
msgPostContract: (data: MsgPostContract): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgPostContract", value: MsgPostContract.fromPartial( data ) }),
msgDeleteActiveDeals: (data: MsgDeleteActiveDeals): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteActiveDeals", value: MsgDeleteActiveDeals.fromPartial( data ) }),
msgCreateProofs: (data: MsgCreateProofs): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateProofs", value: MsgCreateProofs.fromPartial( data ) }),
msgClaimStray: (data: MsgClaimStray): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgClaimStray", value: MsgClaimStray.fromPartial( data ) }),
msgDeleteProofs: (data: MsgDeleteProofs): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgDeleteProofs", value: MsgDeleteProofs.fromPartial( data ) }),
msgSignContract: (data: MsgSignContract): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgSignContract", value: MsgSignContract.fromPartial( data ) }),
msgSetProviderTotalspace: (data: MsgSetProviderTotalspace): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgSetProviderTotalspace", value: MsgSetProviderTotalspace.fromPartial( data ) }),
msgCreateContracts: (data: MsgCreateContracts): EncodeObject => ({ typeUrl: "/jackaldao.canine.storage.MsgCreateContracts", value: MsgCreateContracts.fromPartial( data ) }),

};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ export interface StorageQueryGetPayBlocksResponse {
payBlocks?: StoragePayBlocks;
}

export interface StorageQueryGetPayDataResponse {
/** @format int64 */
blocks_remaining?: string;

/** @format int64 */
bytes?: string;
}

export interface StorageQueryGetProofsResponse {
proofs?: StorageProofs;
}
Expand Down Expand Up @@ -759,6 +767,22 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
...params,
});

/**
* No description
*
* @tags Query
* @name QueryGetPayData
* @summary Queries a list of GetPayData items.
* @request GET:/jackal-dao/canine/storage/get_pay_data/{address}
*/
queryGetPayData = (address: string, params: RequestParams = {}) =>
this.request<StorageQueryGetPayDataResponse, RpcStatus>({
path: `/jackal-dao/canine/storage/get_pay_data/${address}`,
method: "GET",
format: "json",
...params,
});

/**
* No description
*
Expand Down
Loading

0 comments on commit 69c4d0a

Please sign in to comment.