mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Replace internal usages of @iov/encoding with @cosmjs/{encoding,math}
This commit is contained in:
parent
3cfad7a541
commit
88faba8bed
@ -40,10 +40,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@cosmjs/crypto": "^0.8.0",
|
||||
"@cosmjs/encoding": "^0.8.0",
|
||||
"@cosmjs/math": "^0.8.0",
|
||||
"@cosmjs/sdk38": "^0.8.0",
|
||||
"@cosmjs/utils": "^0.8.0",
|
||||
"@iov/bcp": "^2.3.2",
|
||||
"@iov/encoding": "^2.3.2",
|
||||
"@iov/stream": "^2.3.2",
|
||||
"bn.js": "^5.1.1",
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { fromBase64, fromHex } from "@cosmjs/encoding";
|
||||
import { Algorithm, PubkeyBytes } from "@iov/bcp";
|
||||
import { fromBase64, fromHex } from "@iov/encoding";
|
||||
|
||||
import { pubkeyToAddress } from "./address";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Secp256k1 } from "@cosmjs/crypto";
|
||||
import { toBase64 } from "@cosmjs/encoding";
|
||||
import { PubKey, pubkeyToAddress as sdkPubkeyToAddress, pubkeyType } from "@cosmjs/sdk38";
|
||||
import { Address, Algorithm, PubkeyBundle } from "@iov/bcp";
|
||||
import { toBase64 } from "@iov/encoding";
|
||||
|
||||
// See https://github.com/tendermint/tendermint/blob/f2ada0a604b4c0763bda2f64fac53d506d3beca7/docs/spec/blockchain/encoding.md#public-key-cryptography
|
||||
export function pubkeyToAddress(pubkey: PubkeyBundle, prefix: string): Address {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { toHex, toUtf8 } from "@cosmjs/encoding";
|
||||
import { ChainId } from "@iov/bcp";
|
||||
import { toHex, toUtf8 } from "@iov/encoding";
|
||||
|
||||
const hashedPrefix = "hashed-";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { toUtf8 } from "@cosmjs/encoding";
|
||||
import { PostableBytes, PrehashType } from "@iov/bcp";
|
||||
import { toUtf8 } from "@iov/encoding";
|
||||
|
||||
import { CosmosCodec } from "./cosmoscodec";
|
||||
import { chainId, nonce, sendTxJson, signedTxBin, signedTxEncodedJson, signedTxJson } from "./testdata.spec";
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { Bech32, fromUtf8, toUtf8 } from "@cosmjs/encoding";
|
||||
import { isStdTx, makeSignBytes, StdTx } from "@cosmjs/sdk38";
|
||||
import {
|
||||
Address,
|
||||
@ -14,7 +15,6 @@ import {
|
||||
TxCodec,
|
||||
UnsignedTransaction,
|
||||
} from "@iov/bcp";
|
||||
import { Bech32, fromUtf8, toUtf8 } from "@iov/encoding";
|
||||
|
||||
import { pubkeyToAddress } from "./address";
|
||||
import { Caip5 } from "./caip5";
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Random, Secp256k1, Secp256k1Signature, Sha256 } from "@cosmjs/crypto";
|
||||
import { Bech32, fromBase64 } from "@cosmjs/encoding";
|
||||
import { decodeSignature } from "@cosmjs/sdk38";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import {
|
||||
@ -19,7 +20,6 @@ import {
|
||||
TransactionState,
|
||||
UnsignedTransaction,
|
||||
} from "@iov/bcp";
|
||||
import { Bech32, fromBase64 } from "@iov/encoding";
|
||||
import { HdPaths, Secp256k1HdWallet, UserProfile } from "@iov/keycontrol";
|
||||
import BN from "bn.js";
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { fromUtf8 } from "@cosmjs/encoding";
|
||||
import { Uint53 } from "@cosmjs/math";
|
||||
import {
|
||||
CosmosClient,
|
||||
findSequenceForSignedTx,
|
||||
@ -35,7 +37,6 @@ import {
|
||||
TxCodec,
|
||||
UnsignedTransaction,
|
||||
} from "@iov/bcp";
|
||||
import { fromUtf8, Uint53 } from "@iov/encoding";
|
||||
import { concat, DefaultValueProducer, ValueAndUpdates } from "@iov/stream";
|
||||
import equal from "fast-deep-equal";
|
||||
import { ReadonlyDate } from "readonly-date";
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { fromBase64, fromHex } from "@cosmjs/encoding";
|
||||
import { Coin, IndexedTx, Msg, PubKey, StdSignature } from "@cosmjs/sdk38";
|
||||
import { Address, Algorithm, SendTransaction, TokenTicker } from "@iov/bcp";
|
||||
import { fromBase64, fromHex } from "@iov/encoding";
|
||||
|
||||
import {
|
||||
decodeAmount,
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
import { Decimal } from "@cosmjs/math";
|
||||
import {
|
||||
Coin,
|
||||
IndexedTx,
|
||||
@ -29,7 +31,6 @@ import {
|
||||
TransactionId,
|
||||
UnsignedTransaction,
|
||||
} from "@iov/bcp";
|
||||
import { Decimal, fromBase64 } from "@iov/encoding";
|
||||
|
||||
import { BankToken } from "./types";
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
import {
|
||||
Address,
|
||||
Algorithm,
|
||||
@ -11,7 +12,6 @@ import {
|
||||
SignedTransaction,
|
||||
TokenTicker,
|
||||
} from "@iov/bcp";
|
||||
import { fromBase64 } from "@iov/encoding";
|
||||
|
||||
import {
|
||||
buildSignedTx,
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { Secp256k1 } from "@cosmjs/crypto";
|
||||
import { toBase64 } from "@cosmjs/encoding";
|
||||
import {
|
||||
Coin,
|
||||
CosmosSdkTx,
|
||||
@ -20,7 +21,6 @@ import {
|
||||
SignedTransaction,
|
||||
UnsignedTransaction,
|
||||
} from "@iov/bcp";
|
||||
import { toBase64 } from "@iov/encoding";
|
||||
|
||||
import { BankToken } from "./types";
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { fromBase64, toUtf8 } from "@cosmjs/encoding";
|
||||
import {
|
||||
Address,
|
||||
Algorithm,
|
||||
@ -12,7 +13,6 @@ import {
|
||||
TokenTicker,
|
||||
TransactionId,
|
||||
} from "@iov/bcp";
|
||||
import { fromBase64, toUtf8 } from "@iov/encoding";
|
||||
|
||||
import data from "./testdata/cosmoshub.json";
|
||||
|
||||
|
2
packages/bcp/types/decode.d.ts
vendored
2
packages/bcp/types/decode.d.ts
vendored
@ -1,3 +1,4 @@
|
||||
import { Decimal } from "@cosmjs/math";
|
||||
import { Coin, IndexedTx, Msg, PubKey, StdFee, StdSignature, StdTx } from "@cosmjs/sdk38";
|
||||
import {
|
||||
Amount,
|
||||
@ -12,7 +13,6 @@ import {
|
||||
SignedTransaction,
|
||||
UnsignedTransaction,
|
||||
} from "@iov/bcp";
|
||||
import { Decimal } from "@iov/encoding";
|
||||
import { BankToken } from "./types";
|
||||
export declare function decodePubkey(pubkey: PubKey): PubkeyBundle;
|
||||
export declare function decodeSignature(signature: string): SignatureBytes;
|
||||
|
@ -40,9 +40,10 @@
|
||||
"dependencies": {
|
||||
"@cosmjs/cosmwasm": "^0.8.0",
|
||||
"@cosmjs/crypto": "^0.8.0",
|
||||
"@cosmjs/encoding": "^0.8.0",
|
||||
"@cosmjs/math": "^0.8.0",
|
||||
"@cosmjs/sdk38": "^0.8.0",
|
||||
"@cosmjs/utils": "^0.8.0",
|
||||
"@iov/encoding": "^2.3.2",
|
||||
"axios": "^0.19.2",
|
||||
"babylon": "^6.18.0",
|
||||
"colors": "^1.3.3",
|
||||
|
@ -75,6 +75,11 @@ export function main(originalArgs: readonly string[]): void {
|
||||
"Slip10RawIndex",
|
||||
],
|
||||
],
|
||||
[
|
||||
"@cosmjs/encoding",
|
||||
["fromAscii", "fromBase64", "fromHex", "fromUtf8", "toAscii", "toBase64", "toHex", "toUtf8", "Bech32"],
|
||||
],
|
||||
["@cosmjs/math", ["Decimal", "Int53", "Uint32", "Uint53", "Uint64"]],
|
||||
[
|
||||
"@cosmjs/sdk38",
|
||||
[
|
||||
@ -98,26 +103,6 @@ export function main(originalArgs: readonly string[]): void {
|
||||
"StdTx",
|
||||
],
|
||||
],
|
||||
[
|
||||
"@iov/encoding",
|
||||
[
|
||||
"fromAscii",
|
||||
"fromBase64",
|
||||
"fromHex",
|
||||
"fromUtf8",
|
||||
"toAscii",
|
||||
"toBase64",
|
||||
"toHex",
|
||||
"toUtf8",
|
||||
"Bech32",
|
||||
"Decimal",
|
||||
// integers
|
||||
"Int53",
|
||||
"Uint32",
|
||||
"Uint53",
|
||||
"Uint64",
|
||||
],
|
||||
],
|
||||
["@cosmjs/utils", ["assert", "sleep"]],
|
||||
]);
|
||||
|
||||
|
@ -37,9 +37,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@cosmjs/crypto": "^0.8.0",
|
||||
"@cosmjs/encoding": "^0.8.0",
|
||||
"@cosmjs/math": "^0.8.0",
|
||||
"@cosmjs/sdk38": "^0.8.0",
|
||||
"@cosmjs/utils": "^0.8.0",
|
||||
"@iov/encoding": "^2.3.2",
|
||||
"axios": "^0.19.0",
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"pako": "^1.0.11"
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { Uint53 } from "@cosmjs/math";
|
||||
import { Coin, CosmosSdkTx, isMsgSend, makeSignBytes, MsgSend, Secp256k1Pen } from "@cosmjs/sdk38";
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
import { Uint53 } from "@iov/encoding";
|
||||
|
||||
import { CosmWasmClient } from "./cosmwasmclient";
|
||||
import { isMsgExecuteContract, isMsgInstantiateContract } from "./msgs";
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { Bech32, fromHex, fromUtf8, toAscii, toBase64 } from "@cosmjs/encoding";
|
||||
import { makeSignBytes, MsgSend, Secp256k1Pen, StdFee } from "@cosmjs/sdk38";
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
import { Bech32, fromHex, fromUtf8, toAscii, toBase64 } from "@iov/encoding";
|
||||
import { ReadonlyDate } from "readonly-date";
|
||||
|
||||
import { Code, CosmWasmClient, PrivateCosmWasmClient } from "./cosmwasmclient";
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { fromBase64, fromHex, toHex } from "@cosmjs/encoding";
|
||||
import {
|
||||
BroadcastMode,
|
||||
Coin,
|
||||
@ -8,7 +9,6 @@ import {
|
||||
PubKey,
|
||||
StdTx,
|
||||
} from "@cosmjs/sdk38";
|
||||
import { fromBase64, fromHex, toHex } from "@iov/encoding";
|
||||
|
||||
import { Log, parseLogs } from "./logs";
|
||||
import { RestClient } from "./restclient";
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { isNonNullObject } from "@iov/encoding";
|
||||
import { isNonNullObject } from "@cosmjs/utils";
|
||||
|
||||
export interface Attribute {
|
||||
readonly key: string;
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { Bech32, fromAscii, fromBase64, fromHex, toAscii, toBase64, toHex } from "@cosmjs/encoding";
|
||||
import {
|
||||
Coin,
|
||||
encodeBech32Pubkey,
|
||||
@ -16,7 +17,6 @@ import {
|
||||
StdTx,
|
||||
} from "@cosmjs/sdk38";
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
import { Bech32, fromAscii, fromBase64, fromHex, toAscii, toBase64, toHex } from "@iov/encoding";
|
||||
import { ReadonlyDate } from "readonly-date";
|
||||
|
||||
import { findAttribute, parseLogs } from "./logs";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { fromBase64, fromUtf8, toHex, toUtf8 } from "@cosmjs/encoding";
|
||||
import { BroadcastMode, CosmosSdkTx, RestClient as BaseRestClient } from "@cosmjs/sdk38";
|
||||
import { fromBase64, fromUtf8, toHex, toUtf8 } from "@iov/encoding";
|
||||
|
||||
import { JsonObject, Model, parseWasmData, WasmData } from "./types";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { toHex } from "@cosmjs/encoding";
|
||||
import { Coin, Secp256k1Pen } from "@cosmjs/sdk38";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import { toHex } from "@iov/encoding";
|
||||
|
||||
import { PrivateCosmWasmClient } from "./cosmwasmclient";
|
||||
import { RestClient } from "./restclient";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { toBase64, toHex } from "@cosmjs/encoding";
|
||||
import { BroadcastMode, Coin, coins, makeSignBytes, MsgSend, StdFee, StdSignature } from "@cosmjs/sdk38";
|
||||
import { toBase64, toHex } from "@iov/encoding";
|
||||
import pako from "pako";
|
||||
|
||||
import { isValidBuilder } from "./builder";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Random } from "@cosmjs/crypto";
|
||||
import { Bech32, fromBase64 } from "@iov/encoding";
|
||||
import { Bech32, fromBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import hackatom from "./testdata/contract.json";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromBase64, fromHex } from "@iov/encoding";
|
||||
import { fromBase64, fromHex } from "@cosmjs/encoding";
|
||||
|
||||
export interface WasmData {
|
||||
// key is hex-encoded
|
||||
|
@ -41,7 +41,9 @@
|
||||
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iov/encoding": "^2.3.2",
|
||||
"@cosmjs/encoding": "^0.8.0",
|
||||
"@cosmjs/math": "^0.8.0",
|
||||
"@cosmjs/utils": "^0.8.0",
|
||||
"bip39": "^3.0.2",
|
||||
"bn.js": "^4.11.8",
|
||||
"elliptic": "^6.4.0",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex } from "@iov/encoding";
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import { Bip39 } from "./bip39";
|
||||
import { EnglishMnemonic } from "./englishmnemonic";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex, toHex } from "@iov/encoding";
|
||||
import { fromHex, toHex } from "@cosmjs/encoding";
|
||||
import * as bip39 from "bip39";
|
||||
import { pbkdf2 } from "pbkdf2";
|
||||
import * as unorm from "unorm";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromAscii, fromBase64, fromHex } from "@iov/encoding";
|
||||
import { fromAscii, fromBase64, fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import { EnglishMnemonic } from "./englishmnemonic";
|
||||
import { Sha256 } from "./sha";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex } from "@iov/encoding";
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import { Hmac } from "./hmac";
|
||||
import { Sha1, Sha256, Sha512 } from "./sha";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex, toHex } from "@iov/encoding";
|
||||
import { fromHex, toHex } from "@cosmjs/encoding";
|
||||
|
||||
import { Keccak256 } from "./keccak";
|
||||
import keccakVectors from "./testdata/keccak.json";
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable no-bitwise */
|
||||
import { fromHex, toAscii } from "@iov/encoding";
|
||||
import { fromHex, toAscii } from "@cosmjs/encoding";
|
||||
|
||||
import {
|
||||
Argon2id,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { isUint8Array } from "@iov/encoding";
|
||||
import { isUint8Array } from "@cosmjs/utils";
|
||||
|
||||
import { Random } from "./random";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex } from "@iov/encoding";
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import { Ripemd160 } from "./ripemd";
|
||||
import ripemdVectors from "./testdata/ripemd.json";
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable no-bitwise */
|
||||
import { fromHex } from "@iov/encoding";
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import { Secp256k1 } from "./secp256k1";
|
||||
import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex, toHex } from "@iov/encoding";
|
||||
import { fromHex, toHex } from "@cosmjs/encoding";
|
||||
import BN from "bn.js";
|
||||
import elliptic from "elliptic";
|
||||
import { As } from "type-tagger";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex } from "@iov/encoding";
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex, toHex } from "@iov/encoding";
|
||||
import { fromHex, toHex } from "@cosmjs/encoding";
|
||||
|
||||
import { Sha256 } from "./sha";
|
||||
import shaVectors from "./testdata/sha.json";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex } from "@iov/encoding";
|
||||
import { fromHex } from "@cosmjs/encoding";
|
||||
|
||||
import {
|
||||
pathToString,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { fromHex, toAscii, Uint32, Uint53 } from "@iov/encoding";
|
||||
import { fromHex, toAscii } from "@cosmjs/encoding";
|
||||
import { Uint32, Uint53 } from "@cosmjs/math";
|
||||
import BN from "bn.js";
|
||||
import elliptic from "elliptic";
|
||||
|
||||
|
2
packages/crypto/types/slip10.d.ts
vendored
2
packages/crypto/types/slip10.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import { Uint32 } from "@iov/encoding";
|
||||
import { Uint32 } from "@cosmjs/math";
|
||||
export interface Slip10Result {
|
||||
readonly chainCode: Uint8Array;
|
||||
readonly privkey: Uint8Array;
|
||||
|
@ -36,9 +36,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@cosmjs/crypto": "^0.8.0",
|
||||
"@cosmjs/encoding": "^0.8.0",
|
||||
"@cosmjs/math": "^0.8.0",
|
||||
"@cosmjs/sdk38": "^0.8.0",
|
||||
"@cosmjs/utils": "^0.8.0",
|
||||
"@iov/encoding": "^2.3.2",
|
||||
"@koa/cors": "^3.0.0",
|
||||
"axios": "^0.19.0",
|
||||
"koa": "^2.11.0",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Bech32 } from "@iov/encoding";
|
||||
import { Bech32 } from "@cosmjs/encoding";
|
||||
|
||||
export function isValidAddress(input: string, requiredPrefix: string): boolean {
|
||||
try {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Decimal } from "@cosmjs/math";
|
||||
import { Coin } from "@cosmjs/sdk38";
|
||||
import { Decimal } from "@iov/encoding";
|
||||
|
||||
import { MinimalAccount, SendJob, TokenConfiguration } from "./types";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Random } from "@cosmjs/crypto";
|
||||
import { Bech32 } from "@cosmjs/encoding";
|
||||
import { CosmosClient } from "@cosmjs/sdk38";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import { Bech32 } from "@iov/encoding";
|
||||
|
||||
import { Faucet } from "./faucet";
|
||||
import { TokenConfiguration } from "./types";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Decimal, Uint53 } from "@cosmjs/math";
|
||||
import { Coin } from "@cosmjs/sdk38";
|
||||
import { Decimal, Uint53 } from "@iov/encoding";
|
||||
|
||||
import { BankTokenMeta, MinimalAccount, TokenConfiguration } from "./types";
|
||||
|
||||
|
@ -37,8 +37,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@cosmjs/crypto": "^0.8.0",
|
||||
"@cosmjs/encoding": "^0.8.0",
|
||||
"@cosmjs/math": "^0.8.0",
|
||||
"@cosmjs/utils": "^0.8.0",
|
||||
"@iov/encoding": "^2.3.2",
|
||||
"axios": "^0.19.0",
|
||||
"fast-deep-equal": "^3.1.1"
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromHex, toBase64 } from "@iov/encoding";
|
||||
import { fromHex, toBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import { pubkeyToAddress } from "./address";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Ripemd160, Sha256 } from "@cosmjs/crypto";
|
||||
import { Bech32, fromBase64 } from "@iov/encoding";
|
||||
import { Bech32, fromBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import { PubKey, pubkeyType } from "./types";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { Uint53 } from "@cosmjs/math";
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
import { Uint53 } from "@iov/encoding";
|
||||
|
||||
import { Coin } from "./coins";
|
||||
import { CosmosClient } from "./cosmosclient";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Sha256 } from "@cosmjs/crypto";
|
||||
import { fromBase64, toHex } from "@iov/encoding";
|
||||
import { fromBase64, toHex } from "@cosmjs/encoding";
|
||||
|
||||
import { Coin } from "./coins";
|
||||
import { Log, parseLogs } from "./logs";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { toUtf8 } from "@iov/encoding";
|
||||
import { toUtf8 } from "@cosmjs/encoding";
|
||||
|
||||
import { Msg, StdFee } from "./types";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { isNonNullObject } from "@iov/encoding";
|
||||
import { isNonNullObject } from "@cosmjs/utils";
|
||||
|
||||
export interface Attribute {
|
||||
readonly key: string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Secp256k1, Secp256k1Signature, Sha256 } from "@cosmjs/crypto";
|
||||
import { fromHex, toAscii } from "@iov/encoding";
|
||||
import { fromHex, toAscii } from "@cosmjs/encoding";
|
||||
|
||||
import { Secp256k1Pen } from "./pen";
|
||||
import { decodeSignature } from "./signature";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromBase64 } from "@iov/encoding";
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import { decodeBech32Pubkey, encodeBech32Pubkey, encodeSecp256k1Pubkey } from "./pubkey";
|
||||
import { PubKey } from "./types";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Bech32, fromBase64, fromHex, toBase64, toHex } from "@iov/encoding";
|
||||
import { Bech32, fromBase64, fromHex, toBase64, toHex } from "@cosmjs/encoding";
|
||||
import equal from "fast-deep-equal";
|
||||
|
||||
import { PubKey, pubkeyType } from "./types";
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
import { fromBase64 } from "@iov/encoding";
|
||||
import { ReadonlyDate } from "readonly-date";
|
||||
|
||||
import { rawSecp256k1PubkeyToAddress } from "./address";
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { fromBase64, isNonNullObject } from "@iov/encoding";
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
import { isNonNullObject } from "@cosmjs/utils";
|
||||
import axios, { AxiosError, AxiosInstance } from "axios";
|
||||
|
||||
import { Coin } from "./coins";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromBase64 } from "@iov/encoding";
|
||||
import { fromBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import { decodeSignature, encodeSecp256k1Signature } from "./signature";
|
||||
import { StdSignature } from "./types";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { fromBase64, toBase64 } from "@iov/encoding";
|
||||
import { fromBase64, toBase64 } from "@cosmjs/encoding";
|
||||
|
||||
import { encodeSecp256k1Pubkey } from "./pubkey";
|
||||
import { pubkeyType, StdSignature } from "./types";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Random } from "@cosmjs/crypto";
|
||||
import { Bech32 } from "@iov/encoding";
|
||||
import { Bech32 } from "@cosmjs/encoding";
|
||||
|
||||
export function makeRandomAddress(): string {
|
||||
return Bech32.encode("cosmos", Random.getBytes(20));
|
||||
|
1
packages/utils/types/index.d.ts
vendored
1
packages/utils/types/index.d.ts
vendored
@ -1,2 +1,3 @@
|
||||
export { assert } from "./assert";
|
||||
export { sleep } from "./sleep";
|
||||
export { isNonNullObject, isUint8Array } from "./typechecks";
|
||||
|
8
packages/utils/types/typechecks.d.ts
vendored
Normal file
8
packages/utils/types/typechecks.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Checks if data is a non-null object (i.e. matches the TypeScript object type)
|
||||
*/
|
||||
export declare function isNonNullObject(data: unknown): data is object;
|
||||
/**
|
||||
* Checks if data is an Uint8Array. Note: Buffer is treated as not a Uint8Array
|
||||
*/
|
||||
export declare function isUint8Array(data: unknown): data is Uint8Array;
|
Loading…
x
Reference in New Issue
Block a user