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

[WIP] Update to support chain v1.4.0 #93

Closed
wants to merge 4 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://help.github.com/articles/about-codeowners

* @troykessler @christopherbrumm @mbreithecker
4 changes: 2 additions & 2 deletions common/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"@cosmjs/proto-signing": "^0.27.1",
"@cosmjs/stargate": "^0.27.1",
"@kyvejs/sdk": "1.0.5",
"@kyvejs/types": "1.2.0",
"@kyvejs/types": "1.0.3",
"@types/cli-progress": "^3.9.2",
"@types/jsonfile": "^6.0.1",
"arweave": "^1.10.17",
"axios": "^0.24.0",
"bignumber.js": "^9.1.2",
"bignumber.js": "^9.0.1",
"clone": "^2.1.2",
"commander": "^9.4.1",
"fs-extra": "^10.0.1",
Expand Down
Empty file added common/protocol/yarn.lock
Empty file.
18 changes: 9 additions & 9 deletions common/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
"lint:fix": "eslint --fix . --ignore-path ../../.eslintignore --ext ts --ext tsx --ext js --ext jsx"
},
"dependencies": {
"@cosmjs/amino": "^0.31.3",
"@cosmjs/crypto": "^0.31.3",
"@cosmjs/encoding": "^0.31.3",
"@cosmjs/proto-signing": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
"@cosmjs/tendermint-rpc": "^0.31.3",
"@cosmjs/amino": "^0.30.1",
"@cosmjs/crypto": "^0.30.1",
"@cosmjs/encoding": "^0.30.1",
"@cosmjs/proto-signing": "^0.30.1",
"@cosmjs/stargate": "^0.30.1",
"@cosmjs/tendermint-rpc": "^0.30.1",
"@cosmostation/extension-client": "^0.0.6",
"@keplr-wallet/cosmos": "^0.12.39",
"@kyvejs/types": "1.2.0",
"@keplr-wallet/cosmos": "^0.11.38",
"@kyvejs/types": "1.0.3",
"axios": "0.25.0",
"bech32": "2.0.0",
"bignumber.js": "9.1.2",
"bignumber.js": "9.0.2",
"humanize-number": "0.0.2",
"qs": "^6.10.5"
},
Expand Down
79 changes: 0 additions & 79 deletions common/sdk/src/amino/funders.amino.ts

This file was deleted.

2 changes: 1 addition & 1 deletion common/sdk/src/amino/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from "./gov.v1.amino";
export * from "./funders.amino";
export * from "./pool.amino";
export * from "./stakers.amino";
export * from "./delegation.amino";
export * from "./bundles.amino";
37 changes: 37 additions & 0 deletions common/sdk/src/amino/pool.amino.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { AminoConverters } from "@cosmjs/stargate";
import {
MsgFundPool,
MsgDefundPool,
} from "@kyvejs/types/client/kyve/pool/v1beta1/tx";
import { isNotEmpty } from "../utils";

export const createPoolAminoConverters = (): AminoConverters => {
return {
"/kyve.pool.v1beta1.MsgFundPool": {
aminoType: "kyve/pool/MsgFundPool",
toAmino: (msg: MsgFundPool) => ({
creator: msg.creator,
...(isNotEmpty(msg.id) && { id: msg.id }),
...(isNotEmpty(msg.amount) && { amount: msg.amount }),
}),
fromAmino: (msg): MsgFundPool => ({
creator: msg.creator,
id: msg.id,
amount: msg.amount,
}),
},
"/kyve.pool.v1beta1.MsgDefundPool": {
aminoType: "kyve/pool/MsgDefundPool",
toAmino: (msg: MsgDefundPool) => ({
creator: msg.creator,
...(isNotEmpty(msg.id) && { id: msg.id }),
...(isNotEmpty(msg.amount) && { amount: msg.amount }),
}),
fromAmino: (msg): MsgDefundPool => ({
creator: msg.creator,
id: msg.id,
amount: msg.amount,
}),
},
};
};
4 changes: 2 additions & 2 deletions common/sdk/src/clients/full-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import KyveClient from "./rpc-client/client";
import KyveWebClient from "./rpc-client/web.client";

import {
createFundersAminoConverters,
createPoolAminoConverters,
createStakersAminoConverters,
createDelegationAminoConverters,
createBundlesAminoConverters,
Expand Down Expand Up @@ -48,7 +48,7 @@ export async function getSigningKyveClient(
aminoTypes: new AminoTypes({
...createDefaultAminoConverters(),
...createGovV1AminoConverters(),
...createFundersAminoConverters(),
...createPoolAminoConverters(),
...createStakersAminoConverters(),
...createDelegationAminoConverters(),
...createBundlesAminoConverters(),
Expand Down
47 changes: 1 addition & 46 deletions common/sdk/src/clients/lcd-client/query/v1beta1/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import kyveQueryBundlesRes from "@kyvejs/types/lcd/kyve/query/v1beta1/bundles";
import kyveQueryDelegationRes from "@kyvejs/types/lcd/kyve/query/v1beta1/delegation";
import kyveQueryPoolsRes from "@kyvejs/types/lcd/kyve/query/v1beta1/pools";
import kyveQueryStakersRes from "@kyvejs/types/lcd/kyve/query/v1beta1/stakers";
import kyveQueryFunders from "@kyvejs/types/client/kyve/query/v1beta1/funders";
import kyveQueryFundersRes from "@kyvejs/types/lcd/kyve/query/v1beta1/funders";

import {AbstractKyveLCDClient} from "../../lcd-client.abstract";
import { AbstractKyveLCDClient } from "../../lcd-client.abstract";

type NestedPartial<T> = {
[K in keyof T]?: T[K] extends Array<infer R>
Expand Down Expand Up @@ -251,47 +249,4 @@ export class KyveRegistryLCDClient extends AbstractKyveLCDClient {
return await this.request(endpoint);
}
/** End Account **/

/** Funders **/
async funder(
params: kyveQueryFunders.QueryFunderRequest
): Promise<kyveQueryFundersRes.QueryFunderResponse> {
const endpoint = `/kyve/query/v1beta1/funder/${params.address}`;
return await this.request(endpoint);
}

async funders(
params?: PaginationAllPartialRequestUtilType<kyveQueryFunders.QueryFundersRequest>
): Promise<PaginationResponseTypeUtil<kyveQueryFundersRes.QueryFundersResponse>> {
const parameters: Record<string, any> = {};
if (typeof params?.pagination !== "undefined") {
parameters.pagination = params.pagination;
}

if (typeof params?.search !== "undefined") {
parameters.search = params.search;
}

const endpoint = `/kyve/query/v1beta1/funders`;
return await this.request(endpoint, parameters);
}

async fundings_by_funder(
params: PaginationPartialRequestUtilType<kyveQueryFunders.QueryFundingsByFunderRequest>
): Promise<
PaginationResponseTypeUtil<kyveQueryFundersRes.QueryFundingsByFunderResponse>
> {
const endpoint = `/kyve/query/v1beta1/fundings_by_funder/${params.address}`;
return await this.request(endpoint, params);
}

async fundings_by_pool(
params: PaginationPartialRequestUtilType<kyveQueryFunders.QueryFundingsByPoolRequest>
): Promise<
PaginationResponseTypeUtil<kyveQueryFundersRes.QueryFundingsByPoolResponse>
> {
const endpoint = `/kyve/query/v1beta1/fundings_by_pool/${params.pool_id}`;
return await this.request(endpoint, params);
}
/** EndFunders **/
}
10 changes: 5 additions & 5 deletions common/sdk/src/clients/rpc-client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import KyveBaseMethods from "./kyve/base/v1beta1/base";
import KyveBundlesMethods from "./kyve/bundles/v1beta1/bundles";
import KyveDelegationMethods from "./kyve/delegation/v1beta1/delegation";
import KyveGovMethodsV1 from "./kyve/gov/v1/gov";
import KyveFundersMethods from "./kyve/funders/v1beta1/funders";
import KyvePoolMethods from "./kyve/pool/v1beta1/pool";
import KyveStakersMethods from "./kyve/stakers/v1beta1/stakers";

export default class KyveClient {
Expand All @@ -28,8 +28,8 @@ export default class KyveClient {
delegation: {
v1beta1: KyveDelegationMethods;
};
funders: {
v1beta1: KyveFundersMethods;
pool: {
v1beta1: KyvePoolMethods;
};
stakers: {
v1beta1: KyveStakersMethods;
Expand Down Expand Up @@ -68,8 +68,8 @@ export default class KyveClient {
gov: {
v1: new KyveGovMethodsV1(this.nativeClient, this.account, config),
},
funders: {
v1beta1: new KyveFundersMethods(this.nativeClient, this.account, config),
pool: {
v1beta1: new KyvePoolMethods(this.nativeClient, this.account, config),
},
stakers: {
v1beta1: new KyveStakersMethods(
Expand Down
79 changes: 0 additions & 79 deletions common/sdk/src/clients/rpc-client/kyve/funders/v1beta1/funders.ts

This file was deleted.

Loading