@cosmjs/launchpad
Advanced tools
Comparing version 0.25.0-alpha.0 to 0.25.0-alpha.1
@@ -1,5 +0,2 @@ | ||
export interface Coin { | ||
readonly denom: string; | ||
readonly amount: string; | ||
} | ||
import { Coin } from "@cosmjs/amino"; | ||
/** Creates a coin */ | ||
@@ -6,0 +3,0 @@ export declare function coin(amount: number, denom: string): Coin; |
@@ -1,6 +0,5 @@ | ||
import { Coin } from "./coins"; | ||
import { Coin, Pubkey } from "@cosmjs/amino"; | ||
import { AuthExtension, BroadcastMode, LcdClient } from "./lcdapi"; | ||
import { Log } from "./logs"; | ||
import { StdTx, WrappedStdTx } from "./tx"; | ||
import { PubKey } from "./types"; | ||
export interface GetSequenceResult { | ||
@@ -14,3 +13,3 @@ readonly accountNumber: number; | ||
readonly balance: readonly Coin[]; | ||
readonly pubkey: PubKey | undefined; | ||
readonly pubkey: Pubkey | undefined; | ||
readonly accountNumber: number; | ||
@@ -17,0 +16,0 @@ readonly sequence: number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const utils_1 = require("@cosmjs/utils"); | ||
const coins_1 = require("./coins"); | ||
const cosmosclient_1 = require("./cosmosclient"); | ||
const encoding_1 = require("./encoding"); | ||
const lcdapi_1 = require("./lcdapi"); | ||
const msgs_1 = require("./msgs"); | ||
const secp256k1hdwallet_1 = require("./secp256k1hdwallet"); | ||
const signingcosmosclient_1 = require("./signingcosmosclient"); | ||
@@ -19,3 +18,3 @@ const testutils_spec_1 = require("./testutils.spec"); | ||
if (testutils_spec_1.launchpadEnabled()) { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const accounts = await wallet.getAccounts(); | ||
@@ -42,3 +41,3 @@ const [{ address: walletAddress }] = accounts; | ||
const chainId = await client.getChainId(); | ||
const signDoc = encoding_1.makeSignDoc([sendMsg], fee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc([sendMsg], fee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature } = await wallet.signAmino(walletAddress, signDoc); | ||
@@ -45,0 +44,0 @@ const tx = { |
@@ -7,8 +7,7 @@ "use strict"; | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const utils_1 = require("@cosmjs/utils"); | ||
const readonly_date_1 = require("readonly-date"); | ||
const cosmosclient_1 = require("./cosmosclient"); | ||
const encoding_1 = require("./encoding"); | ||
const logs_1 = require("./logs"); | ||
const secp256k1hdwallet_1 = require("./secp256k1hdwallet"); | ||
const cosmoshub_json_1 = __importDefault(require("./testdata/cosmoshub.json")); | ||
@@ -159,3 +158,3 @@ const testutils_spec_1 = require("./testutils.spec"); | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const accounts = await wallet.getAccounts(); | ||
@@ -189,3 +188,3 @@ const [{ address: walletAddress }] = accounts; | ||
const { accountNumber, sequence } = await client.getSequence(testutils_spec_1.faucet.address0); | ||
const signDoc = encoding_1.makeSignDoc([sendMsg], fee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc([sendMsg], fee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature } = await wallet.signAmino(walletAddress, signDoc); | ||
@@ -192,0 +191,0 @@ const signedTx = tx_1.makeStdTx(signed, signature); |
@@ -0,20 +1,14 @@ | ||
export { AccountData, Algo, AminoMsg as Msg, AminoSignResponse, Coin, KdfConfiguration, OfflineAminoSigner as OfflineSigner, Secp256k1HdWallet, Secp256k1Wallet, StdFee, StdSignDoc, StdSignature, decodeAminoPubkey, decodeBech32Pubkey, decodeSignature, encodeAminoPubkey, encodeBech32Pubkey, encodeSecp256k1Pubkey, encodeSecp256k1Signature, extractKdfConfiguration, executeKdf, makeCosmoshubPath, makeSignDoc, pubkeyToAddress, pubkeyType, serializeSignDoc, } from "@cosmjs/amino"; | ||
import { SinglePubkey } from "@cosmjs/amino"; | ||
/** @deprecated PubKey is deprecated. Use `SinglePubkey` or the more general `Pubkey` from `@cosmjs/amino`. */ | ||
export declare type PubKey = SinglePubkey; | ||
import * as logs from "./logs"; | ||
export { logs }; | ||
export { pubkeyToAddress, rawSecp256k1PubkeyToAddress } from "./address"; | ||
export { Coin, coin, coins, parseCoins } from "./coins"; | ||
export { coin, coins, parseCoins } from "./coins"; | ||
export { Account, assertIsBroadcastTxSuccess, Block, BlockHeader, CosmosClient, GetSequenceResult, IndexedTx, isBroadcastTxFailure, isBroadcastTxSuccess, BroadcastTxFailure, BroadcastTxResult, BroadcastTxSuccess, SearchByHeightQuery, SearchBySentFromOrToQuery, SearchByTagsQuery, SearchTxQuery, SearchTxFilter, isSearchByHeightQuery, isSearchBySentFromOrToQuery, isSearchByTagsQuery, } from "./cosmosclient"; | ||
export { makeSignDoc, serializeSignDoc, StdSignDoc } from "./encoding"; | ||
export { buildFeeTable, FeeTable, GasLimits, GasPrice } from "./gas"; | ||
export { buildFeeTable, FeeTable, GasLimits, GasPrice } from "./fee"; | ||
export { AuthAccountsResponse, AuthExtension, BankBalancesResponse, BankExtension, BaseAccount, BlockResponse, BroadcastMode, DistributionCommunityPoolResponse, DistributionDelegatorRewardResponse, DistributionDelegatorRewardsResponse, DistributionExtension, DistributionParametersResponse, DistributionValidatorOutstandingRewardsResponse, DistributionValidatorResponse, DistributionValidatorRewardsResponse, DistributionWithdrawAddressResponse, EncodeTxResponse, GovExtension, GovParametersResponse, GovProposalsResponse, GovProposalResponse, GovProposerResponse, GovDepositsResponse, GovDepositResponse, GovTallyResponse, GovVotesResponse, GovVoteResponse, LcdApiArray, LcdClient, MintAnnualProvisionsResponse, MintExtension, MintInflationResponse, MintParametersResponse, NodeInfoResponse, normalizeLcdApiArray, normalizePubkey, BroadcastTxsResponse, SearchTxsResponse, setupAuthExtension, setupBankExtension, setupDistributionExtension, setupGovExtension, setupMintExtension, setupSlashingExtension, setupStakingExtension, setupSupplyExtension, SlashingExtension, SlashingParametersResponse, SlashingSigningInfosResponse, StakingExtension, StakingDelegatorDelegationsResponse, StakingDelegatorUnbondingDelegationsResponse, StakingDelegatorTransactionsResponse, StakingDelegatorValidatorsResponse, StakingDelegatorValidatorResponse, StakingDelegationResponse, StakingUnbondingDelegationResponse, StakingRedelegationsResponse, StakingValidatorsResponse, StakingValidatorResponse, StakingValidatorDelegationsResponse, StakingValidatorUnbondingDelegationsResponse, StakingHistoricalInfoResponse, StakingParametersResponse, StakingPoolResponse, SupplyExtension, TxsResponse, uint64ToNumber, uint64ToString, } from "./lcdapi"; | ||
export { isMsgBeginRedelegate, isMsgCreateValidator, isMsgDelegate, isMsgEditValidator, isMsgFundCommunityPool, isMsgMultiSend, isMsgSend, isMsgSetWithdrawAddress, isMsgUndelegate, isMsgWithdrawDelegatorReward, isMsgWithdrawValidatorCommission, Msg, MsgBeginRedelegate, MsgCreateValidator, MsgDelegate, MsgEditValidator, MsgFundCommunityPool, MsgMultiSend, MsgSend, MsgSetWithdrawAddress, MsgUndelegate, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, } from "./msgs"; | ||
export { makeCosmoshubPath } from "./paths"; | ||
export { decodeAminoPubkey, decodeBech32Pubkey, encodeAminoPubkey, encodeBech32Pubkey, encodeSecp256k1Pubkey, } from "./pubkey"; | ||
export { isMsgBeginRedelegate, isMsgCreateValidator, isMsgDelegate, isMsgEditValidator, isMsgFundCommunityPool, isMsgMultiSend, isMsgSend, isMsgSetWithdrawAddress, isMsgUndelegate, isMsgWithdrawDelegatorReward, isMsgWithdrawValidatorCommission, MsgBeginRedelegate, MsgCreateValidator, MsgDelegate, MsgEditValidator, MsgFundCommunityPool, MsgMultiSend, MsgSend, MsgSetWithdrawAddress, MsgUndelegate, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, } from "./msgs"; | ||
export { findSequenceForSignedTx } from "./sequence"; | ||
export { encodeSecp256k1Signature, decodeSignature } from "./signature"; | ||
export { AccountData, Algo, AminoSignResponse, OfflineSigner } from "./signer"; | ||
export { CosmosFeeTable, SigningCosmosClient } from "./signingcosmosclient"; | ||
export { isStdTx, isWrappedStdTx, makeStdTx, CosmosSdkTx, StdTx, WrappedStdTx, WrappedTx } from "./tx"; | ||
export { pubkeyType, PubKey, StdFee, StdSignature } from "./types"; | ||
export { executeKdf, KdfConfiguration } from "./wallet"; | ||
export { extractKdfConfiguration, Secp256k1HdWallet } from "./secp256k1hdwallet"; | ||
export { Secp256k1Wallet } from "./secp256k1wallet"; |
@@ -22,8 +22,23 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Secp256k1Wallet = exports.Secp256k1HdWallet = exports.extractKdfConfiguration = exports.executeKdf = exports.pubkeyType = exports.makeStdTx = exports.isWrappedStdTx = exports.isStdTx = exports.SigningCosmosClient = exports.decodeSignature = exports.encodeSecp256k1Signature = exports.findSequenceForSignedTx = exports.encodeSecp256k1Pubkey = exports.encodeBech32Pubkey = exports.encodeAminoPubkey = exports.decodeBech32Pubkey = exports.decodeAminoPubkey = exports.makeCosmoshubPath = exports.isMsgWithdrawValidatorCommission = exports.isMsgWithdrawDelegatorReward = exports.isMsgUndelegate = exports.isMsgSetWithdrawAddress = exports.isMsgSend = exports.isMsgMultiSend = exports.isMsgFundCommunityPool = exports.isMsgEditValidator = exports.isMsgDelegate = exports.isMsgCreateValidator = exports.isMsgBeginRedelegate = exports.uint64ToString = exports.uint64ToNumber = exports.setupSupplyExtension = exports.setupStakingExtension = exports.setupSlashingExtension = exports.setupMintExtension = exports.setupGovExtension = exports.setupDistributionExtension = exports.setupBankExtension = exports.setupAuthExtension = exports.normalizePubkey = exports.normalizeLcdApiArray = exports.LcdClient = exports.BroadcastMode = exports.GasPrice = exports.buildFeeTable = exports.serializeSignDoc = exports.makeSignDoc = exports.isSearchByTagsQuery = exports.isSearchBySentFromOrToQuery = exports.isSearchByHeightQuery = exports.isBroadcastTxSuccess = exports.isBroadcastTxFailure = exports.CosmosClient = exports.assertIsBroadcastTxSuccess = exports.parseCoins = exports.coins = exports.coin = exports.rawSecp256k1PubkeyToAddress = exports.pubkeyToAddress = exports.logs = void 0; | ||
exports.makeStdTx = exports.isWrappedStdTx = exports.isStdTx = exports.SigningCosmosClient = exports.findSequenceForSignedTx = exports.isMsgWithdrawValidatorCommission = exports.isMsgWithdrawDelegatorReward = exports.isMsgUndelegate = exports.isMsgSetWithdrawAddress = exports.isMsgSend = exports.isMsgMultiSend = exports.isMsgFundCommunityPool = exports.isMsgEditValidator = exports.isMsgDelegate = exports.isMsgCreateValidator = exports.isMsgBeginRedelegate = exports.uint64ToString = exports.uint64ToNumber = exports.setupSupplyExtension = exports.setupStakingExtension = exports.setupSlashingExtension = exports.setupMintExtension = exports.setupGovExtension = exports.setupDistributionExtension = exports.setupBankExtension = exports.setupAuthExtension = exports.normalizePubkey = exports.normalizeLcdApiArray = exports.LcdClient = exports.BroadcastMode = exports.GasPrice = exports.buildFeeTable = exports.isSearchByTagsQuery = exports.isSearchBySentFromOrToQuery = exports.isSearchByHeightQuery = exports.isBroadcastTxSuccess = exports.isBroadcastTxFailure = exports.CosmosClient = exports.assertIsBroadcastTxSuccess = exports.parseCoins = exports.coins = exports.coin = exports.logs = exports.serializeSignDoc = exports.pubkeyType = exports.pubkeyToAddress = exports.makeSignDoc = exports.makeCosmoshubPath = exports.executeKdf = exports.extractKdfConfiguration = exports.encodeSecp256k1Signature = exports.encodeSecp256k1Pubkey = exports.encodeBech32Pubkey = exports.encodeAminoPubkey = exports.decodeSignature = exports.decodeBech32Pubkey = exports.decodeAminoPubkey = exports.Secp256k1Wallet = exports.Secp256k1HdWallet = void 0; | ||
// Re-exports for backwards compatibility | ||
var amino_1 = require("@cosmjs/amino"); | ||
Object.defineProperty(exports, "Secp256k1HdWallet", { enumerable: true, get: function () { return amino_1.Secp256k1HdWallet; } }); | ||
Object.defineProperty(exports, "Secp256k1Wallet", { enumerable: true, get: function () { return amino_1.Secp256k1Wallet; } }); | ||
Object.defineProperty(exports, "decodeAminoPubkey", { enumerable: true, get: function () { return amino_1.decodeAminoPubkey; } }); | ||
Object.defineProperty(exports, "decodeBech32Pubkey", { enumerable: true, get: function () { return amino_1.decodeBech32Pubkey; } }); | ||
Object.defineProperty(exports, "decodeSignature", { enumerable: true, get: function () { return amino_1.decodeSignature; } }); | ||
Object.defineProperty(exports, "encodeAminoPubkey", { enumerable: true, get: function () { return amino_1.encodeAminoPubkey; } }); | ||
Object.defineProperty(exports, "encodeBech32Pubkey", { enumerable: true, get: function () { return amino_1.encodeBech32Pubkey; } }); | ||
Object.defineProperty(exports, "encodeSecp256k1Pubkey", { enumerable: true, get: function () { return amino_1.encodeSecp256k1Pubkey; } }); | ||
Object.defineProperty(exports, "encodeSecp256k1Signature", { enumerable: true, get: function () { return amino_1.encodeSecp256k1Signature; } }); | ||
Object.defineProperty(exports, "extractKdfConfiguration", { enumerable: true, get: function () { return amino_1.extractKdfConfiguration; } }); | ||
Object.defineProperty(exports, "executeKdf", { enumerable: true, get: function () { return amino_1.executeKdf; } }); | ||
Object.defineProperty(exports, "makeCosmoshubPath", { enumerable: true, get: function () { return amino_1.makeCosmoshubPath; } }); | ||
Object.defineProperty(exports, "makeSignDoc", { enumerable: true, get: function () { return amino_1.makeSignDoc; } }); | ||
Object.defineProperty(exports, "pubkeyToAddress", { enumerable: true, get: function () { return amino_1.pubkeyToAddress; } }); | ||
Object.defineProperty(exports, "pubkeyType", { enumerable: true, get: function () { return amino_1.pubkeyType; } }); | ||
Object.defineProperty(exports, "serializeSignDoc", { enumerable: true, get: function () { return amino_1.serializeSignDoc; } }); | ||
const logs = __importStar(require("./logs")); | ||
exports.logs = logs; | ||
var address_1 = require("./address"); | ||
Object.defineProperty(exports, "pubkeyToAddress", { enumerable: true, get: function () { return address_1.pubkeyToAddress; } }); | ||
Object.defineProperty(exports, "rawSecp256k1PubkeyToAddress", { enumerable: true, get: function () { return address_1.rawSecp256k1PubkeyToAddress; } }); | ||
var coins_1 = require("./coins"); | ||
@@ -41,8 +56,5 @@ Object.defineProperty(exports, "coin", { enumerable: true, get: function () { return coins_1.coin; } }); | ||
Object.defineProperty(exports, "isSearchByTagsQuery", { enumerable: true, get: function () { return cosmosclient_1.isSearchByTagsQuery; } }); | ||
var encoding_1 = require("./encoding"); | ||
Object.defineProperty(exports, "makeSignDoc", { enumerable: true, get: function () { return encoding_1.makeSignDoc; } }); | ||
Object.defineProperty(exports, "serializeSignDoc", { enumerable: true, get: function () { return encoding_1.serializeSignDoc; } }); | ||
var gas_1 = require("./gas"); | ||
Object.defineProperty(exports, "buildFeeTable", { enumerable: true, get: function () { return gas_1.buildFeeTable; } }); | ||
Object.defineProperty(exports, "GasPrice", { enumerable: true, get: function () { return gas_1.GasPrice; } }); | ||
var fee_1 = require("./fee"); | ||
Object.defineProperty(exports, "buildFeeTable", { enumerable: true, get: function () { return fee_1.buildFeeTable; } }); | ||
Object.defineProperty(exports, "GasPrice", { enumerable: true, get: function () { return fee_1.GasPrice; } }); | ||
var lcdapi_1 = require("./lcdapi"); | ||
@@ -75,15 +87,4 @@ Object.defineProperty(exports, "BroadcastMode", { enumerable: true, get: function () { return lcdapi_1.BroadcastMode; } }); | ||
Object.defineProperty(exports, "isMsgWithdrawValidatorCommission", { enumerable: true, get: function () { return msgs_1.isMsgWithdrawValidatorCommission; } }); | ||
var paths_1 = require("./paths"); | ||
Object.defineProperty(exports, "makeCosmoshubPath", { enumerable: true, get: function () { return paths_1.makeCosmoshubPath; } }); | ||
var pubkey_1 = require("./pubkey"); | ||
Object.defineProperty(exports, "decodeAminoPubkey", { enumerable: true, get: function () { return pubkey_1.decodeAminoPubkey; } }); | ||
Object.defineProperty(exports, "decodeBech32Pubkey", { enumerable: true, get: function () { return pubkey_1.decodeBech32Pubkey; } }); | ||
Object.defineProperty(exports, "encodeAminoPubkey", { enumerable: true, get: function () { return pubkey_1.encodeAminoPubkey; } }); | ||
Object.defineProperty(exports, "encodeBech32Pubkey", { enumerable: true, get: function () { return pubkey_1.encodeBech32Pubkey; } }); | ||
Object.defineProperty(exports, "encodeSecp256k1Pubkey", { enumerable: true, get: function () { return pubkey_1.encodeSecp256k1Pubkey; } }); | ||
var sequence_1 = require("./sequence"); | ||
Object.defineProperty(exports, "findSequenceForSignedTx", { enumerable: true, get: function () { return sequence_1.findSequenceForSignedTx; } }); | ||
var signature_1 = require("./signature"); | ||
Object.defineProperty(exports, "encodeSecp256k1Signature", { enumerable: true, get: function () { return signature_1.encodeSecp256k1Signature; } }); | ||
Object.defineProperty(exports, "decodeSignature", { enumerable: true, get: function () { return signature_1.decodeSignature; } }); | ||
var signingcosmosclient_1 = require("./signingcosmosclient"); | ||
@@ -95,11 +96,2 @@ Object.defineProperty(exports, "SigningCosmosClient", { enumerable: true, get: function () { return signingcosmosclient_1.SigningCosmosClient; } }); | ||
Object.defineProperty(exports, "makeStdTx", { enumerable: true, get: function () { return tx_1.makeStdTx; } }); | ||
var types_1 = require("./types"); | ||
Object.defineProperty(exports, "pubkeyType", { enumerable: true, get: function () { return types_1.pubkeyType; } }); | ||
var wallet_1 = require("./wallet"); | ||
Object.defineProperty(exports, "executeKdf", { enumerable: true, get: function () { return wallet_1.executeKdf; } }); | ||
var secp256k1hdwallet_1 = require("./secp256k1hdwallet"); | ||
Object.defineProperty(exports, "extractKdfConfiguration", { enumerable: true, get: function () { return secp256k1hdwallet_1.extractKdfConfiguration; } }); | ||
Object.defineProperty(exports, "Secp256k1HdWallet", { enumerable: true, get: function () { return secp256k1hdwallet_1.Secp256k1HdWallet; } }); | ||
var secp256k1wallet_1 = require("./secp256k1wallet"); | ||
Object.defineProperty(exports, "Secp256k1Wallet", { enumerable: true, get: function () { return secp256k1wallet_1.Secp256k1Wallet; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,2 @@ | ||
import { Coin } from "../coins"; | ||
import { PubKey } from "../types"; | ||
import { Coin, Pubkey } from "@cosmjs/amino"; | ||
import { LcdClient } from "./lcdclient"; | ||
@@ -26,3 +25,3 @@ /** | ||
*/ | ||
readonly public_key: string | PubKey | null; | ||
readonly public_key: string | Pubkey | null; | ||
/** | ||
@@ -29,0 +28,0 @@ * The account number assigned by the blockchain. |
@@ -1,2 +0,2 @@ | ||
import { Coin } from "../coins"; | ||
import { Coin } from "@cosmjs/amino"; | ||
import { LcdClient } from "./lcdclient"; | ||
@@ -3,0 +3,0 @@ export interface BankBalancesResponse { |
@@ -1,2 +0,2 @@ | ||
import { Coin } from "../coins"; | ||
import { Coin } from "@cosmjs/amino"; | ||
import { LcdClient } from "./lcdclient"; | ||
@@ -3,0 +3,0 @@ export interface RewardContainer { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const encoding_1 = require("@cosmjs/encoding"); | ||
@@ -8,4 +9,2 @@ const utils_1 = require("@cosmjs/utils"); | ||
const cosmosclient_1 = require("../cosmosclient"); | ||
const encoding_2 = require("../encoding"); | ||
const secp256k1hdwallet_1 = require("../secp256k1hdwallet"); | ||
const signingcosmosclient_1 = require("../signingcosmosclient"); | ||
@@ -26,3 +25,3 @@ const testutils_spec_1 = require("../testutils.spec"); | ||
if (testutils_spec_1.launchpadEnabled()) { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -40,3 +39,3 @@ const chainId = await client.getChainId(); | ||
const { accountNumber, sequence } = await client.getSequence(); | ||
const signDoc = encoding_2.makeSignDoc([msg], defaultFee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc([msg], defaultFee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature } = await wallet.signAmino(testutils_spec_1.faucet.address0, signDoc); | ||
@@ -43,0 +42,0 @@ const signedTx = tx_1.makeStdTx(signed, signature); |
@@ -1,2 +0,2 @@ | ||
import { Coin } from "../coins"; | ||
import { Coin } from "@cosmjs/amino"; | ||
import { LcdClient } from "./lcdclient"; | ||
@@ -3,0 +3,0 @@ export declare enum GovParametersType { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const utils_1 = require("@cosmjs/utils"); | ||
const coins_1 = require("../coins"); | ||
const cosmosclient_1 = require("../cosmosclient"); | ||
const encoding_1 = require("../encoding"); | ||
const secp256k1hdwallet_1 = require("../secp256k1hdwallet"); | ||
const signingcosmosclient_1 = require("../signingcosmosclient"); | ||
@@ -24,3 +23,3 @@ const testutils_spec_1 = require("../testutils.spec"); | ||
if (testutils_spec_1.launchpadEnabled()) { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -44,3 +43,3 @@ const chainId = await client.getChainId(); | ||
const { accountNumber: proposalAccountNumber, sequence: proposalSequence } = await client.getSequence(); | ||
const proposalSignDoc = encoding_1.makeSignDoc([proposalMsg], defaultFee, chainId, proposalMemo, proposalAccountNumber, proposalSequence); | ||
const proposalSignDoc = amino_1.makeSignDoc([proposalMsg], defaultFee, chainId, proposalMemo, proposalAccountNumber, proposalSequence); | ||
const { signature: proposalSignature } = await wallet.signAmino(testutils_spec_1.faucet.address0, proposalSignDoc); | ||
@@ -68,3 +67,3 @@ const proposalTx = { | ||
const { accountNumber: voteAccountNumber, sequence: voteSequence } = await client.getSequence(); | ||
const voteSignDoc = encoding_1.makeSignDoc([voteMsg], defaultFee, chainId, voteMemo, voteAccountNumber, voteSequence); | ||
const voteSignDoc = amino_1.makeSignDoc([voteMsg], defaultFee, chainId, voteMemo, voteAccountNumber, voteSequence); | ||
const { signature: voteSignature } = await wallet.signAmino(testutils_spec_1.faucet.address0, voteSignDoc); | ||
@@ -71,0 +70,0 @@ const voteTx = { |
@@ -7,8 +7,6 @@ "use strict"; | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const utils_1 = require("@cosmjs/utils"); | ||
const cosmosclient_1 = require("../cosmosclient"); | ||
const encoding_1 = require("../encoding"); | ||
const logs_1 = require("../logs"); | ||
const paths_1 = require("../paths"); | ||
const secp256k1hdwallet_1 = require("../secp256k1hdwallet"); | ||
const signingcosmosclient_1 = require("../signingcosmosclient"); | ||
@@ -135,3 +133,3 @@ const cosmoshub_json_1 = __importDefault(require("../testdata/cosmoshub.json")); | ||
if (testutils_spec_1.launchpadEnabled()) { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const accounts = await wallet.getAccounts(); | ||
@@ -181,3 +179,3 @@ const [{ address: walletAddress }] = accounts; | ||
const chainId = await client.getChainId(); | ||
const signDoc = encoding_1.makeSignDoc([sendMsg], fee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc([sendMsg], fee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature } = await wallet.signAmino(walletAddress, signDoc); | ||
@@ -249,3 +247,3 @@ const signedTx = tx_1.makeStdTx(signed, signature); | ||
if (testutils_spec_1.launchpadEnabled()) { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -407,3 +405,3 @@ const recipient = testutils_spec_1.makeRandomAddress(); | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const accounts = await wallet.getAccounts(); | ||
@@ -436,3 +434,3 @@ const [{ address: walletAddress }] = accounts; | ||
const { account_number, sequence } = (await client.auth.account(testutils_spec_1.faucet.address0)).result.value; | ||
const signDoc = encoding_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, account_number, sequence); | ||
const signDoc = amino_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, account_number, sequence); | ||
const { signed, signature } = await wallet.signAmino(walletAddress, signDoc); | ||
@@ -454,5 +452,5 @@ const signedTx = tx_1.makeStdTx(signed, signature); | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const account1 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(0)); | ||
const account2 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(1)); | ||
const account3 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(2)); | ||
const account1 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(0)); | ||
const account2 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(1)); | ||
const account3 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(2)); | ||
const [address1, address2, address3] = await Promise.all([account1, account2, account3].map(async (wallet) => { | ||
@@ -488,5 +486,5 @@ return (await wallet.getAccounts())[0].address; | ||
const { account_number: an3, sequence: sequence3 } = (await client.auth.account(address3)).result.value; | ||
const signDoc1 = encoding_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = encoding_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const signDoc3 = encoding_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, an3, sequence3); | ||
const signDoc1 = amino_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = amino_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const signDoc3 = amino_1.makeSignDoc([theMsg], fee, testutils_spec_1.launchpad.chainId, memo, an3, sequence3); | ||
const { signature: signature1 } = await account1.signAmino(address1, signDoc1); | ||
@@ -507,3 +505,3 @@ const { signature: signature2 } = await account2.signAmino(address2, signDoc2); | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(0)); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(0)); | ||
const accounts = await wallet.getAccounts(); | ||
@@ -549,3 +547,3 @@ const [{ address: walletAddress }] = accounts; | ||
const { account_number, sequence } = (await client.auth.account(walletAddress)).result.value; | ||
const signDoc = encoding_1.makeSignDoc([msg1, msg2], fee, testutils_spec_1.launchpad.chainId, memo, account_number, sequence); | ||
const signDoc = amino_1.makeSignDoc([msg1, msg2], fee, testutils_spec_1.launchpad.chainId, memo, account_number, sequence); | ||
const { signed, signature } = await wallet.signAmino(walletAddress, signDoc); | ||
@@ -558,4 +556,4 @@ const signedTx = tx_1.makeStdTx(signed, signature); | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const account1 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(0)); | ||
const account2 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(1)); | ||
const account1 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(0)); | ||
const account2 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(1)); | ||
const [address1, address2] = await Promise.all([account1, account2].map(async (wallet) => { | ||
@@ -603,4 +601,4 @@ return (await wallet.getAccounts())[0].address; | ||
const { account_number: an2, sequence: sequence2 } = (await client.auth.account(address2)).result.value; | ||
const signDoc1 = encoding_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = encoding_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const signDoc1 = amino_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = amino_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const { signature: signature1 } = await account1.signAmino(address1, signDoc1); | ||
@@ -623,4 +621,4 @@ const { signature: signature2 } = await account2.signAmino(address2, signDoc2); | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const account1 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(0)); | ||
const account2 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(1)); | ||
const account1 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(0)); | ||
const account2 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(1)); | ||
const [address1, address2] = await Promise.all([account1, account2].map(async (wallet) => { | ||
@@ -668,4 +666,4 @@ return (await wallet.getAccounts())[0].address; | ||
const { account_number: an2, sequence: sequence2 } = (await client.auth.account(address2)).result.value; | ||
const signDoc1 = encoding_1.makeSignDoc([msg1, msg2], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = encoding_1.makeSignDoc([msg1, msg2], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const signDoc1 = amino_1.makeSignDoc([msg1, msg2], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = amino_1.makeSignDoc([msg1, msg2], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const { signature: signature1 } = await account1.signAmino(address1, signDoc1); | ||
@@ -684,4 +682,4 @@ const { signature: signature2 } = await account2.signAmino(address2, signDoc2); | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const account1 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(0)); | ||
const account2 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(1)); | ||
const account1 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(0)); | ||
const account2 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(1)); | ||
const [address1, address2] = await Promise.all([account1, account2].map(async (wallet) => { | ||
@@ -729,4 +727,4 @@ return (await wallet.getAccounts())[0].address; | ||
const { account_number: an2, sequence: sequence2 } = (await client.auth.account(address2)).result.value; | ||
const signDoc1 = encoding_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = encoding_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const signDoc1 = amino_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an1, sequence1); | ||
const signDoc2 = amino_1.makeSignDoc([msg2, msg1], fee, testutils_spec_1.launchpad.chainId, memo, an2, sequence2); | ||
const { signature: signature1 } = await account1.signAmino(address1, signDoc1); | ||
@@ -733,0 +731,0 @@ const { signature: signature2 } = await account2.signAmino(address2, signDoc2); |
@@ -1,2 +0,2 @@ | ||
import { Coin } from "../coins"; | ||
import { Coin } from "@cosmjs/amino"; | ||
import { BlockHeader, SearchTxsResponse } from "./base"; | ||
@@ -3,0 +3,0 @@ import { LcdClient } from "./lcdclient"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const utils_1 = require("@cosmjs/utils"); | ||
const coins_1 = require("../coins"); | ||
const cosmosclient_1 = require("../cosmosclient"); | ||
const encoding_1 = require("../encoding"); | ||
const secp256k1hdwallet_1 = require("../secp256k1hdwallet"); | ||
const signingcosmosclient_1 = require("../signingcosmosclient"); | ||
@@ -24,3 +23,3 @@ const testutils_spec_1 = require("../testutils.spec"); | ||
if (testutils_spec_1.launchpadEnabled()) { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -39,3 +38,3 @@ const chainId = await client.getChainId(); | ||
const { accountNumber, sequence } = await client.getSequence(); | ||
const signDoc = encoding_1.makeSignDoc([msg], defaultFee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc([msg], defaultFee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature } = await wallet.signAmino(testutils_spec_1.faucet.address0, signDoc); | ||
@@ -57,3 +56,3 @@ const signedTx = tx_1.makeStdTx(signed, signature); | ||
const { accountNumber, sequence } = await client.getSequence(); | ||
const signDoc = encoding_1.makeSignDoc([msg], defaultFee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc([msg], defaultFee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature } = await wallet.signAmino(testutils_spec_1.faucet.address0, signDoc); | ||
@@ -60,0 +59,0 @@ const signedTx = tx_1.makeStdTx(signed, signature); |
@@ -1,2 +0,2 @@ | ||
import { Coin } from "../coins"; | ||
import { Coin } from "@cosmjs/amino"; | ||
import { LcdApiArray, LcdClient } from "./lcdclient"; | ||
@@ -3,0 +3,0 @@ export interface TotalSupplyAllResponse { |
@@ -1,2 +0,2 @@ | ||
import { PubKey } from "../types"; | ||
import { Pubkey } from "@cosmjs/amino"; | ||
/** | ||
@@ -22,2 +22,2 @@ * Converts an integer expressed as number or string to a number. | ||
*/ | ||
export declare function normalizePubkey(input: string | PubKey | null): PubKey | null; | ||
export declare function normalizePubkey(input: string | Pubkey | null): Pubkey | null; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizePubkey = exports.uint64ToString = exports.uint64ToNumber = void 0; | ||
const amino_1 = require("@cosmjs/amino"); | ||
const math_1 = require("@cosmjs/math"); | ||
const pubkey_1 = require("../pubkey"); | ||
/** | ||
@@ -38,3 +38,3 @@ * Converts an integer expressed as number or string to a number. | ||
if (typeof input === "string") | ||
return pubkey_1.decodeBech32Pubkey(input); | ||
return amino_1.decodeBech32Pubkey(input); | ||
return input; | ||
@@ -41,0 +41,0 @@ } |
@@ -79,3 +79,3 @@ "use strict"; | ||
}; | ||
expect(original).toEqual(original); | ||
expect(utils_1.normalizePubkey(original)).toEqual(original); | ||
}); | ||
@@ -82,0 +82,0 @@ }); |
@@ -1,8 +0,4 @@ | ||
import { Coin } from "./coins"; | ||
export interface Msg { | ||
readonly type: string; | ||
readonly value: any; | ||
} | ||
import { AminoMsg, Coin } from "@cosmjs/amino"; | ||
/** A high level transaction of the coin module */ | ||
export interface MsgSend extends Msg { | ||
export interface MsgSend extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgSend"; | ||
@@ -17,3 +13,3 @@ readonly value: { | ||
} | ||
export declare function isMsgSend(msg: Msg): msg is MsgSend; | ||
export declare function isMsgSend(msg: AminoMsg): msg is MsgSend; | ||
interface Input { | ||
@@ -30,3 +26,3 @@ /** Bech32 account address */ | ||
/** A high level transaction of the coin module */ | ||
export interface MsgMultiSend extends Msg { | ||
export interface MsgMultiSend extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgMultiSend"; | ||
@@ -38,5 +34,5 @@ readonly value: { | ||
} | ||
export declare function isMsgMultiSend(msg: Msg): msg is MsgMultiSend; | ||
export declare function isMsgMultiSend(msg: AminoMsg): msg is MsgMultiSend; | ||
/** Verifies a particular invariance */ | ||
export interface MsgVerifyInvariant extends Msg { | ||
export interface MsgVerifyInvariant extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgVerifyInvariant"; | ||
@@ -50,5 +46,5 @@ readonly value: { | ||
} | ||
export declare function isMsgVerifyInvariant(msg: Msg): msg is MsgVerifyInvariant; | ||
export declare function isMsgVerifyInvariant(msg: AminoMsg): msg is MsgVerifyInvariant; | ||
/** Changes the withdraw address for a delegator (or validator self-delegation) */ | ||
export interface MsgSetWithdrawAddress extends Msg { | ||
export interface MsgSetWithdrawAddress extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgModifyWithdrawAddress"; | ||
@@ -62,5 +58,5 @@ readonly value: { | ||
} | ||
export declare function isMsgSetWithdrawAddress(msg: Msg): msg is MsgSetWithdrawAddress; | ||
export declare function isMsgSetWithdrawAddress(msg: AminoMsg): msg is MsgSetWithdrawAddress; | ||
/** Message for delegation withdraw from a single validator */ | ||
export interface MsgWithdrawDelegatorReward extends Msg { | ||
export interface MsgWithdrawDelegatorReward extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgWithdrawDelegationReward"; | ||
@@ -74,5 +70,5 @@ readonly value: { | ||
} | ||
export declare function isMsgWithdrawDelegatorReward(msg: Msg): msg is MsgWithdrawDelegatorReward; | ||
export declare function isMsgWithdrawDelegatorReward(msg: AminoMsg): msg is MsgWithdrawDelegatorReward; | ||
/** Message for validator withdraw */ | ||
export interface MsgWithdrawValidatorCommission extends Msg { | ||
export interface MsgWithdrawValidatorCommission extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgWithdrawValidatorCommission"; | ||
@@ -84,5 +80,5 @@ readonly value: { | ||
} | ||
export declare function isMsgWithdrawValidatorCommission(msg: Msg): msg is MsgWithdrawValidatorCommission; | ||
export declare function isMsgWithdrawValidatorCommission(msg: AminoMsg): msg is MsgWithdrawValidatorCommission; | ||
/** Allows an account to directly fund the community pool. */ | ||
export interface MsgFundCommunityPool extends Msg { | ||
export interface MsgFundCommunityPool extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgFundCommunityPool"; | ||
@@ -95,3 +91,3 @@ readonly value: { | ||
} | ||
export declare function isMsgFundCommunityPool(msg: Msg): msg is MsgFundCommunityPool; | ||
export declare function isMsgFundCommunityPool(msg: AminoMsg): msg is MsgFundCommunityPool; | ||
interface Any { | ||
@@ -102,3 +98,3 @@ readonly type_url: string; | ||
/** Supports submitting arbitrary evidence */ | ||
export interface MsgSubmitEvidence extends Msg { | ||
export interface MsgSubmitEvidence extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgSubmitEvidence"; | ||
@@ -111,5 +107,5 @@ readonly value: { | ||
} | ||
export declare function isMsgSubmitEvidence(msg: Msg): msg is MsgSubmitEvidence; | ||
export declare function isMsgSubmitEvidence(msg: AminoMsg): msg is MsgSubmitEvidence; | ||
/** Supports submitting arbitrary proposal content. */ | ||
export interface MsgSubmitProposal extends Msg { | ||
export interface MsgSubmitProposal extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgSubmitProposal"; | ||
@@ -123,3 +119,3 @@ readonly value: { | ||
} | ||
export declare function isMsgSubmitProposal(msg: Msg): msg is MsgSubmitProposal; | ||
export declare function isMsgSubmitProposal(msg: AminoMsg): msg is MsgSubmitProposal; | ||
declare enum VoteOption { | ||
@@ -133,3 +129,3 @@ VoteOptionUnspecified = 0, | ||
/** Casts a vote */ | ||
export interface MsgVote extends Msg { | ||
export interface MsgVote extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgVote"; | ||
@@ -143,5 +139,5 @@ readonly value: { | ||
} | ||
export declare function isMsgVote(msg: Msg): msg is MsgVote; | ||
export declare function isMsgVote(msg: AminoMsg): msg is MsgVote; | ||
/** Submits a deposit to an existing proposal */ | ||
export interface MsgDeposit extends Msg { | ||
export interface MsgDeposit extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgDeposit"; | ||
@@ -155,5 +151,5 @@ readonly value: { | ||
} | ||
export declare function isMsgDeposit(msg: Msg): msg is MsgDeposit; | ||
export declare function isMsgDeposit(msg: AminoMsg): msg is MsgDeposit; | ||
/** Unjails a jailed validator */ | ||
export interface MsgUnjail extends Msg { | ||
export interface MsgUnjail extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgUnjail"; | ||
@@ -165,3 +161,3 @@ readonly value: { | ||
} | ||
export declare function isMsgUnjail(msg: Msg): msg is MsgUnjail; | ||
export declare function isMsgUnjail(msg: AminoMsg): msg is MsgUnjail; | ||
/** The initial commission rates to be used for creating a validator */ | ||
@@ -182,3 +178,3 @@ interface CommissionRates { | ||
/** Creates a new validator. */ | ||
export interface MsgCreateValidator extends Msg { | ||
export interface MsgCreateValidator extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgCreateValidator"; | ||
@@ -198,5 +194,5 @@ readonly value: { | ||
} | ||
export declare function isMsgCreateValidator(msg: Msg): msg is MsgCreateValidator; | ||
export declare function isMsgCreateValidator(msg: AminoMsg): msg is MsgCreateValidator; | ||
/** Edits an existing validator. */ | ||
export interface MsgEditValidator extends Msg { | ||
export interface MsgEditValidator extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgEditValidator"; | ||
@@ -211,3 +207,3 @@ readonly value: { | ||
} | ||
export declare function isMsgEditValidator(msg: Msg): msg is MsgEditValidator; | ||
export declare function isMsgEditValidator(msg: AminoMsg): msg is MsgEditValidator; | ||
/** | ||
@@ -218,3 +214,3 @@ * Performs a delegation from a delegate to a validator. | ||
*/ | ||
export interface MsgDelegate extends Msg { | ||
export interface MsgDelegate extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgDelegate"; | ||
@@ -229,5 +225,5 @@ readonly value: { | ||
} | ||
export declare function isMsgDelegate(msg: Msg): msg is MsgDelegate; | ||
export declare function isMsgDelegate(msg: AminoMsg): msg is MsgDelegate; | ||
/** Performs a redelegation from a delegate and source validator to a destination validator */ | ||
export interface MsgBeginRedelegate extends Msg { | ||
export interface MsgBeginRedelegate extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgBeginRedelegate"; | ||
@@ -244,5 +240,5 @@ readonly value: { | ||
} | ||
export declare function isMsgBeginRedelegate(msg: Msg): msg is MsgBeginRedelegate; | ||
export declare function isMsgBeginRedelegate(msg: AminoMsg): msg is MsgBeginRedelegate; | ||
/** Performs an undelegation from a delegate and a validator */ | ||
export interface MsgUndelegate extends Msg { | ||
export interface MsgUndelegate extends AminoMsg { | ||
readonly type: "cosmos-sdk/MsgUndelegate"; | ||
@@ -257,3 +253,3 @@ readonly value: { | ||
} | ||
export declare function isMsgUndelegate(msg: Msg): msg is MsgUndelegate; | ||
export declare function isMsgUndelegate(msg: AminoMsg): msg is MsgUndelegate; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findSequenceForSignedTx = void 0; | ||
const amino_1 = require("@cosmjs/amino"); | ||
const crypto_1 = require("@cosmjs/crypto"); | ||
const encoding_1 = require("./encoding"); | ||
const signature_1 = require("./signature"); | ||
/** | ||
@@ -22,7 +21,7 @@ * Serach for sequence s with `min` <= `s` < `upperBound` to find the sequence that was used to sign the transaction | ||
throw new Error("Signature missing in tx"); | ||
const { pubkey, signature } = signature_1.decodeSignature(firstSignature); | ||
const { pubkey, signature } = amino_1.decodeSignature(firstSignature); | ||
const secp256keSignature = crypto_1.Secp256k1Signature.fromFixedLength(signature); | ||
for (let s = min; s < upperBound; s++) { | ||
// console.log(`Trying sequence ${s}`); | ||
const signBytes = encoding_1.serializeSignDoc(encoding_1.makeSignDoc(tx.value.msg, tx.value.fee, chainId, tx.value.memo || "", accountNumber, s)); | ||
const signBytes = amino_1.serializeSignDoc(amino_1.makeSignDoc(tx.value.msg, tx.value.fee, chainId, tx.value.memo || "", accountNumber, s)); | ||
const prehashed = crypto_1.sha256(signBytes); | ||
@@ -29,0 +28,0 @@ const valid = await crypto_1.Secp256k1.verifySignature(secp256keSignature, prehashed, pubkey); |
@@ -1,9 +0,6 @@ | ||
import { Coin } from "./coins"; | ||
import { AminoMsg, Coin, OfflineAminoSigner, StdFee } from "@cosmjs/amino"; | ||
import { Account, BroadcastTxResult, CosmosClient, GetSequenceResult } from "./cosmosclient"; | ||
import { FeeTable, GasLimits, GasPrice } from "./gas"; | ||
import { FeeTable, GasLimits, GasPrice } from "./fee"; | ||
import { BroadcastMode } from "./lcdapi"; | ||
import { Msg } from "./msgs"; | ||
import { OfflineSigner } from "./signer"; | ||
import { StdTx } from "./tx"; | ||
import { StdFee } from "./types"; | ||
/** | ||
@@ -20,5 +17,5 @@ * These fees are used by the higher level methods of SigningCosmosClient | ||
export declare class SigningCosmosClient extends CosmosClient { | ||
readonly fees: CosmosFeeTable; | ||
readonly signerAddress: string; | ||
private readonly signer; | ||
private readonly fees; | ||
/** | ||
@@ -32,3 +29,3 @@ * Creates a new client with signing capability to interact with a Cosmos SDK blockchain. This is the bigger brother of CosmosClient. | ||
* @param signerAddress The address that will sign transactions using this instance. The `signer` must be able to sign with this address. | ||
* @param signer An implementation of OfflineSigner which can provide signatures for transactions, potentially requiring user input. | ||
* @param signer An implementation of OfflineAminoSigner which can provide signatures for transactions, potentially requiring user input. | ||
* @param gasPrice The price paid per unit of gas | ||
@@ -38,3 +35,3 @@ * @param gasLimits Custom overrides for gas limits related to specific transaction types | ||
*/ | ||
constructor(apiUrl: string, signerAddress: string, signer: OfflineSigner, gasPrice?: GasPrice, gasLimits?: Partial<GasLimits<CosmosFeeTable>>, broadcastMode?: BroadcastMode); | ||
constructor(apiUrl: string, signerAddress: string, signer: OfflineAminoSigner, gasPrice?: GasPrice, gasLimits?: Partial<GasLimits<CosmosFeeTable>>, broadcastMode?: BroadcastMode); | ||
getSequence(address?: string): Promise<GetSequenceResult>; | ||
@@ -47,3 +44,3 @@ getAccount(address?: string): Promise<Account | undefined>; | ||
*/ | ||
signAndBroadcast(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise<BroadcastTxResult>; | ||
signAndBroadcast(msgs: readonly AminoMsg[], fee: StdFee, memo?: string): Promise<BroadcastTxResult>; | ||
/** | ||
@@ -53,3 +50,3 @@ * Gets account number and sequence from the API, creates a sign doc, | ||
*/ | ||
sign(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise<StdTx>; | ||
sign(msgs: readonly AminoMsg[], fee: StdFee, memo?: string): Promise<StdTx>; | ||
/** | ||
@@ -56,0 +53,0 @@ * Gets account number and sequence from the API, creates a sign doc, |
@@ -8,9 +8,9 @@ "use strict"; | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal")); | ||
const cosmosclient_1 = require("./cosmosclient"); | ||
const encoding_1 = require("./encoding"); | ||
const gas_1 = require("./gas"); | ||
const fee_1 = require("./fee"); | ||
const lcdapi_1 = require("./lcdapi"); | ||
const tx_1 = require("./tx"); | ||
const defaultGasPrice = gas_1.GasPrice.fromString("0.025ucosm"); | ||
const defaultGasPrice = fee_1.GasPrice.fromString("0.025ucosm"); | ||
const defaultGasLimits = { send: 80000 }; | ||
@@ -26,3 +26,3 @@ class SigningCosmosClient extends cosmosclient_1.CosmosClient { | ||
* @param signerAddress The address that will sign transactions using this instance. The `signer` must be able to sign with this address. | ||
* @param signer An implementation of OfflineSigner which can provide signatures for transactions, potentially requiring user input. | ||
* @param signer An implementation of OfflineAminoSigner which can provide signatures for transactions, potentially requiring user input. | ||
* @param gasPrice The price paid per unit of gas | ||
@@ -37,3 +37,3 @@ * @param gasLimits Custom overrides for gas limits related to specific transaction types | ||
this.signer = signer; | ||
this.fees = gas_1.buildFeeTable(gasPrice, defaultGasLimits, gasLimits); | ||
this.fees = fee_1.buildFeeTable(gasPrice, defaultGasLimits, gasLimits); | ||
} | ||
@@ -72,3 +72,3 @@ async getSequence(address) { | ||
const chainId = await this.getChainId(); | ||
const signDoc = encoding_1.makeSignDoc(msgs, fee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc(msgs, fee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature } = await this.signer.signAmino(this.signerAddress, signDoc); | ||
@@ -85,3 +85,3 @@ return tx_1.makeStdTx(signed, signature); | ||
const chainId = await this.getChainId(); | ||
const signDoc = encoding_1.makeSignDoc(msgs, fee, chainId, memo, accountNumber, sequence); | ||
const signDoc = amino_1.makeSignDoc(msgs, fee, chainId, memo, accountNumber, sequence); | ||
const { signed, signature: additionalSignature } = await this.signer.signAmino(this.signerAddress, signDoc); | ||
@@ -88,0 +88,0 @@ if (!fast_deep_equal_1.default(signDoc, signed)) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const amino_1 = require("@cosmjs/amino"); | ||
const utils_1 = require("@cosmjs/utils"); | ||
const coins_1 = require("./coins"); | ||
const cosmosclient_1 = require("./cosmosclient"); | ||
const gas_1 = require("./gas"); | ||
const paths_1 = require("./paths"); | ||
const secp256k1hdwallet_1 = require("./secp256k1hdwallet"); | ||
const fee_1 = require("./fee"); | ||
const signingcosmosclient_1 = require("./signingcosmosclient"); | ||
@@ -15,3 +14,3 @@ const testutils_spec_1 = require("./testutils.spec"); | ||
it("can be constructed with default fees", async () => { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -32,4 +31,4 @@ const openedClient = client; | ||
it("can be constructed with custom gas price", async () => { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const gasPrice = gas_1.GasPrice.fromString("3.14utest"); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const gasPrice = fee_1.GasPrice.fromString("3.14utest"); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet, gasPrice); | ||
@@ -50,3 +49,3 @@ const openedClient = client; | ||
it("can be constructed with custom gas limits", async () => { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const gasLimits = { | ||
@@ -70,4 +69,4 @@ send: 160000, | ||
it("can be constructed with custom gas price and gas limits", async () => { | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const gasPrice = gas_1.GasPrice.fromString("3.14utest"); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const gasPrice = fee_1.GasPrice.fromString("3.14utest"); | ||
const gasLimits = { | ||
@@ -94,3 +93,3 @@ send: 160000, | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -109,3 +108,3 @@ const openedClient = client; | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -137,3 +136,3 @@ // instantiate | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -159,3 +158,3 @@ const msg = { | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const wallet = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic); | ||
const client = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet); | ||
@@ -201,4 +200,4 @@ const msg1 = { | ||
testutils_spec_1.pendingWithoutLaunchpad(); | ||
const wallet0 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(0)); | ||
const wallet1 = await secp256k1hdwallet_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, paths_1.makeCosmoshubPath(1)); | ||
const wallet0 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(0)); | ||
const wallet1 = await amino_1.Secp256k1HdWallet.fromMnemonic(testutils_spec_1.faucet.mnemonic, amino_1.makeCosmoshubPath(1)); | ||
const client0 = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address0, wallet0); | ||
@@ -205,0 +204,0 @@ const client1 = new signingcosmosclient_1.SigningCosmosClient(testutils_spec_1.launchpad.endpoint, testutils_spec_1.faucet.address1, wallet1); |
@@ -1,4 +0,2 @@ | ||
import { StdSignDoc } from "./encoding"; | ||
import { Msg } from "./msgs"; | ||
import { StdFee, StdSignature } from "./types"; | ||
import { AminoMsg, StdFee, StdSignature, StdSignDoc } from "@cosmjs/amino"; | ||
/** | ||
@@ -10,3 +8,3 @@ * A Cosmos SDK StdTx | ||
export interface StdTx { | ||
readonly msg: readonly Msg[]; | ||
readonly msg: readonly AminoMsg[]; | ||
readonly fee: StdFee; | ||
@@ -13,0 +11,0 @@ readonly signatures: readonly StdSignature[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const signdoc_1 = require("@cosmjs/amino/build/signdoc"); | ||
const coins_1 = require("./coins"); | ||
const encoding_1 = require("./encoding"); | ||
const tx_1 = require("./tx"); | ||
@@ -11,3 +10,3 @@ describe("tx", () => { | ||
const fee = { amount: coins_1.coins(123, "ucosm"), gas: "22" }; | ||
const signDoc = encoding_1.makeSignDoc([], fee, "chain-xy", "hello", 3, 4); | ||
const signDoc = signdoc_1.makeSignDoc([], fee, "chain-xy", "hello", 3, 4); | ||
const signature = { | ||
@@ -30,3 +29,3 @@ pub_key: { | ||
const fee = { amount: coins_1.coins(123, "ucosm"), gas: "22" }; | ||
const signDoc = encoding_1.makeSignDoc([], fee, "chain-xy", "hello", 3, 4); | ||
const signDoc = signdoc_1.makeSignDoc([], fee, "chain-xy", "hello", 3, 4); | ||
const signature1 = { | ||
@@ -33,0 +32,0 @@ pub_key: { |
{ | ||
"name": "@cosmjs/launchpad", | ||
"version": "0.25.0-alpha.0", | ||
"version": "0.25.0-alpha.1", | ||
"description": "A client library for the Cosmos SDK 0.37 (cosmoshub-3), 0.38 and 0.39 (Launchpad)", | ||
@@ -42,6 +42,7 @@ "contributors": [ | ||
"dependencies": { | ||
"@cosmjs/crypto": "^0.25.0-alpha.0", | ||
"@cosmjs/encoding": "^0.25.0-alpha.0", | ||
"@cosmjs/math": "^0.25.0-alpha.0", | ||
"@cosmjs/utils": "^0.25.0-alpha.0", | ||
"@cosmjs/amino": "^0.25.0-alpha.1", | ||
"@cosmjs/crypto": "^0.25.0-alpha.1", | ||
"@cosmjs/encoding": "^0.25.0-alpha.1", | ||
"@cosmjs/math": "^0.25.0-alpha.1", | ||
"@cosmjs/utils": "^0.25.0-alpha.1", | ||
"axios": "^0.21.1", | ||
@@ -53,3 +54,3 @@ "fast-deep-equal": "^3.1.3" | ||
}, | ||
"gitHead": "171fda884c953fb06327d42535ebf6958e66e45a" | ||
"gitHead": "906b259dd0b179e7acd7b05b22f7671e87d77796" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
428422
7
123
5519
+ Added@cosmjs/amino@0.25.6(transitive)
Updated@cosmjs/math@^0.25.0-alpha.1