Skip to content

Commit

Permalink
⬆️ Bump cosmjs to 0.29.5
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Jun 27, 2023
1 parent 0c2320c commit 39f0095
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 160 deletions.
7 changes: 4 additions & 3 deletions app/services/cosmos/cosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import {
StargateClient,
StakingExtension,
SigningStargateClient,
BroadcastTxResponse,
DeliverTxResponse,
MsgSendEncodeObject,
MsgDelegateEncodeObject,
MsgUndelegateEncodeObject,
MsgWithdrawDelegatorRewardEncodeObject,
} from "@cosmjs/stargate";
import { BondStatusString } from "@cosmjs/stargate/build/queries/staking";
import { OfflineDirectSigner } from '@cosmjs/proto-signing';
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
import { TextDecoder } from 'text-decoding';
Expand All @@ -24,6 +23,7 @@ import {
MsgDelegate,
MsgUndelegate,
} from 'cosmjs-types/cosmos/staking/v1beta1/tx'
import { BondStatusString } from "@cosmjs/stargate/build/modules/staking/queries";
import { MsgWithdrawDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/tx";

import {
Expand All @@ -47,6 +47,7 @@ import {
} from "./cosmos.utils"
import { MintExtension, setupMintExtension } from "./mint-query-extension"


// Mitigate https://github.com/cosmos/cosmos-sdk/issues/11407
const INITIAL_PAGINATION_KEY = new Uint8Array([0x00])

Expand Down Expand Up @@ -227,7 +228,7 @@ export class CosmosAPI {
async createSigningClient(signer: OfflineDirectSigner): Promise<CosmosSigningClient> {
const signingStargateClient = await SigningStargateClient.connectWithSigner(this.restURL, signer)
return {
async signAndBroadcast(message: CosmosMessageToSign): Promise<BroadcastTxResponse> {
async signAndBroadcast(message: CosmosMessageToSign): Promise<DeliverTxResponse> {
const { signerAddress, msgs, fee, memo } = message
const result = await signingStargateClient.signAndBroadcast(signerAddress, msgs, fee, memo)
return result
Expand Down
4 changes: 2 additions & 2 deletions app/services/cosmos/cosmos.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BroadcastTxResponse } from "@cosmjs/stargate";
import { DeliverTxResponse } from "@cosmjs/stargate";

export interface CosmosCoinResult {
denom: string
Expand Down Expand Up @@ -77,7 +77,7 @@ export interface CosmosMessageToSign extends CosmosMessage {
}

export interface CosmosSigningClient {
signAndBroadcast: (message: CosmosMessageToSign) => Promise<BroadcastTxResponse>
signAndBroadcast: (message: CosmosMessageToSign) => Promise<DeliverTxResponse>
}

export interface CosmosDelegation {
Expand Down
4 changes: 2 additions & 2 deletions app/services/cosmos/cosmos.utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/camelcase */
import BigNumber from "bignumber.js"
import { DelegationDelegatorReward } from "@cosmjs/stargate/build/codec/cosmos/distribution/v1beta1/distribution";
import {
Commission,
CommissionRates,
Expand All @@ -11,7 +10,7 @@ import {
UnbondingDelegation,
UnbondingDelegationEntry,
Validator
} from "@cosmjs/stargate/build/codec/cosmos/staking/v1beta1/staking";
} from "cosmjs-types/cosmos/staking/v1beta1/staking";
import { Coin, DecCoin } from "cosmjs-types/cosmos/base/v1beta1/coin";

import {
Expand All @@ -23,6 +22,7 @@ import {
CosmosValidator,
CosmosValidatorReward,
} from "./cosmos.types"
import { DelegationDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/distribution";

/**
* Parse the given amount of given denom in number to Cosmos coin format
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"adb": "adb reverse tcp:9090 tcp:9090 && adb reverse tcp:3000 tcp:3000 && adb reverse tcp:9001 tcp:9001 && adb reverse tcp:8081 tcp:8081"
},
"dependencies": {
"@cosmjs/stargate": "^0.25.5",
"@cosmjs/stargate": "^0.29.5",
"@json-rpc-tools/utils": "1.7.6",
"@likecoin/authcore-js": "^0.3.0-like.0",
"@likecoin/secretd-js": "^0.4.3",
Expand All @@ -47,7 +47,7 @@
"apisauce": "1.0.3",
"big-integer": "^1.6.51",
"buffer": "^5.4.3",
"cosmjs-types": "^0.1.0",
"cosmjs-types": "^0.5.2",
"crypto-js": "^4.1.1",
"fast-json-stable-stringify": "^2.1.0",
"i18n-js": "^3.0.11",
Expand Down
Loading

0 comments on commit 39f0095

Please sign in to comment.