diff --git a/package.json b/package.json index 0510bb8..4852723 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,6 @@ }, "dependencies": { "decimal.js": "10.2.1", - "secretjs": "0.17.5" + "secretjs": "^1.2.0-beta.56" } } diff --git a/src/bootstrap.ts b/src/bootstrap.ts index c78bf2c..ad31480 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -1,11 +1,13 @@ import { getKeplr } from './wallet'; -import { Coin, StdFee } from 'secretjs/types/types.js'; import { - CosmWasmClient, - SigningCosmWasmClient, - ExecuteResult, - FeeTable, + SecretNetworkClient, + Tx, + Coin, + MsgExecuteContractParams, BroadcastMode, + MsgInstantiateContractParams, + QueryContractsByCodeResponse, + TxOptions, } from 'secretjs'; import { KeplrViewingKeyManager, @@ -14,19 +16,8 @@ import { } from './auth/index'; import { emitEvent } from './events'; import { getWindow } from './utils'; -import { getFeeForExecute } from './contracts/utils'; - -const defaultFee: StdFee = { - amount: [{ amount: '500000', denom: 'uscrt' }], - gas: '500000', -}; - -const systemDefaultFees: FeeTable = { - upload: getFeeForExecute(3_000_000) || defaultFee, - init: getFeeForExecute(2_000_000) || defaultFee, - exec: getFeeForExecute(100_000) || defaultFee, - send: getFeeForExecute(90_000) || defaultFee, -}; +import { QueryBalanceResponse } from 'secretjs/dist/protobuf_stuff/cosmos/bank/v1beta1/query'; +import { StdFee } from 'secretjs/dist/wallet_amino'; export { BroadcastMode }; @@ -60,8 +51,8 @@ export type AccountProviderGetter = ( ) => Promise; let config: Config | undefined; -let client: CosmWasmClient | undefined; -let signingClient: SigningCosmWasmClient | undefined; +let client: SecretNetworkClient | undefined; +let signingClient: SecretNetworkClient | undefined; let accountAvailable = false; let getProvider: AccountProviderGetter | undefined; @@ -132,7 +123,6 @@ export async function gripApp( } provider = await getProvider(chainId); - accountAvailable = true; // At this point we have an account available... @@ -146,7 +136,7 @@ export async function gripApp( async function initClient(): Promise { if (client) return; if (!config) throw new Error('No configuration was set'); - client = new CosmWasmClient(config.restUrl); + client = await SecretNetworkClient.create({ grpcWebUrl: config.restUrl }); } async function initSigningClient(): Promise { @@ -161,29 +151,15 @@ async function initSigningClient(): Promise { const address = provider.getAddress(); const signer = provider.getSigner(); const seed = provider.getSeed(); - const broadcastMode = config.broadcastMode; - - let fees: FeeTable = systemDefaultFees; - - if (config.defaultFees) { - fees = { - upload: - getFeeForExecute(config.defaultFees.upload) || systemDefaultFees.upload, - init: getFeeForExecute(config.defaultFees.init) || systemDefaultFees.init, - exec: getFeeForExecute(config.defaultFees.exec) || systemDefaultFees.exec, - send: getFeeForExecute(config.defaultFees.send) || systemDefaultFees.send, - }; - } + const chainId = await getChainId(); - signingClient = new SigningCosmWasmClient( - // @ts-ignore - restUrl, - address, - signer, - seed, - fees, - broadcastMode - ); + signingClient = await SecretNetworkClient.create({ + grpcWebUrl: restUrl, + wallet: signer, + walletAddress: address, + chainId: chainId, + encryptionUtils: seed, + }); } export async function bootstrap(): Promise { @@ -215,35 +191,52 @@ export function shutdown() { } // TODO Move this to `contracts.ts` -export function queryContract( +export async function queryContract( address: string, - queryMsg: Record, - addedParams?: Record, + query: Record, + _addedParams?: Record, codeHash?: string ): Promise> { if (!client) throw new Error('No client available'); - return client.queryContractSmart(address, queryMsg, addedParams, codeHash); + return await client.query.compute.queryContract({ + address, + query, + codeHash, + }); } // TODO Move this to `contracts.ts` export async function executeContract( - contractAddress: string, - handleMsg: Record, + contract: string, + msg: Record, memo?: string, - transferAmount?: readonly Coin[], + sentFunds?: Coin[], fee?: StdFee, codeHash?: string -): Promise { +): Promise { if (!signingClient) throw new Error('No signing client available'); - return signingClient.execute( - contractAddress, - handleMsg, + + const executeContract: MsgExecuteContractParams = { + sender: signingClient.address, + contract, + msg, + sentFunds: sentFunds || [], + codeHash, + }; + const txOptions: TxOptions = { memo, - transferAmount, - fee, - codeHash + gasLimit: parseInt( + fee?.gas || config?.defaultFees?.exec?.toString() || '30000' + ), + broadcastMode: config?.broadcastMode || BroadcastMode.Sync, + }; + + return await signingClient.tx.compute.executeContract( + executeContract, + txOptions ); } + export let accountChangedCallback: () => void; // So this is a very rough implementation of an Account provider. @@ -255,7 +248,7 @@ async function getKeplrAccountProviderInternal( ): Promise { const keplr = await getKeplr(); - if (!keplr || !getWindow()?.getOfflineSigner) + if (!keplr || !getWindow()?.getOfflineSignerOnlyAmino) throw new Error('Install keplr extension'); try { @@ -265,7 +258,7 @@ async function getKeplrAccountProviderInternal( return; } - const offlineSigner = getWindow()?.getOfflineSigner!(chainId); + const offlineSigner = getWindow()?.getOfflineSignerOnlyAmino!(chainId); if (!offlineSigner) throw new Error('No offline signer'); const [{ address }] = await offlineSigner.getAccounts(); const enigmaUtils = keplr.getEnigmaUtils(chainId); @@ -297,29 +290,41 @@ export function getKeplrAccountProvider(): AccountProviderGetter { export function getChainId(): Promise { if (!client) throw new Error('No client available'); - return client.getChainId(); + return client.query.tendermint.getLatestBlock({}).then(block => { + if (!block.block?.header?.chainId) return ''; + else return block.block?.header?.chainId; + }); } export function getHeight(): Promise { if (!client) throw new Error('No client available'); - return client.getHeight(); + return client.query.tendermint.getLatestBlock({}).then(block => { + if (!block.block?.header?.height) return 1; + else return parseInt(block.block?.header?.height); + }); } export function instantiate(codeId: number, initMsg: object, label: string) { if (!signingClient) throw new Error('No signing client available'); - return signingClient.instantiate(codeId, initMsg, label); + const sender = client?.address || ''; + const params: MsgInstantiateContractParams = { + sender, + codeId, + initMsg, + label, + }; + const txOptions: TxOptions = { + gasLimit: parseInt(config?.defaultFees?.init?.toString() || '150000'), + broadcastMode: config?.broadcastMode || BroadcastMode.Sync, + }; + return signingClient.tx.compute.instantiateContract(params, txOptions); } -export function getContracts(codeId: number): Promise< - readonly { - readonly address: string; - readonly codeId: number; - readonly creator: string; - readonly label: string; - }[] -> { +export function getContracts( + codeId: number +): Promise { if (!client) throw new Error('No client available'); - return client?.getContracts(codeId); + return client.query.compute.contractsByCode(codeId); } export function getClient() { @@ -336,10 +341,12 @@ export async function getNativeCoinBalance(): Promise { if (!client) throw new Error('No client available'); const address = getAddress(); if (!address) throw new Error('No address available'); - const account = await client.getAccount(address); - if (!account) throw new Error('No account exists on chain'); - if (account.balance.length == 0) return '0'; - const balance = account.balance.find(it => it.denom === 'uscrt'); - if (!balance) throw new Error('No balance available'); - return balance.amount; + const { balance }: QueryBalanceResponse = await client.query.bank.balance({ + address, + denom: 'uscrt', + }); + + if (!balance) throw new Error('No account exists on chain'); + if (!balance?.amount) return '0'; + return balance?.amount; } diff --git a/src/contracts/definitions/snip-20-def.ts b/src/contracts/definitions/snip-20-def.ts index 26850cb..b946312 100644 --- a/src/contracts/definitions/snip-20-def.ts +++ b/src/contracts/definitions/snip-20-def.ts @@ -1,4 +1,4 @@ -import { Coin } from 'secretjs/types/types'; +import { Coin } from 'secretjs'; import { extendContract } from '..'; import { BaseContract, diff --git a/src/contracts/index.ts b/src/contracts/index.ts index 176017d..fa1e67a 100644 --- a/src/contracts/index.ts +++ b/src/contracts/index.ts @@ -1,4 +1,12 @@ -import { ExecuteResult, BroadcastMode, TxsResponse } from 'secretjs'; +import { + BroadcastMode, + IMsg, + Msg, + MsgExecuteContractParams, + MsgParams, + Tx, + TxOptions, +} from 'secretjs'; import { queryContract, executeContract, @@ -16,7 +24,6 @@ import { ContractSpecification, ContractMessageResponse, ContractInstantiationRequest, - MessageEntry, MessageGetter, MultiMessageInfo, BaseContract, @@ -28,8 +35,7 @@ import { getFeeForExecute, sleep, } from './utils'; -import { Coin } from 'secretjs/types/types'; -import { Encoding } from '@iov/encoding'; +import { Coin } from 'secretjs'; import { getWindow } from '../utils'; import { permitManager } from '../bootstrap'; @@ -43,17 +49,17 @@ const contractRegistry: any[] = []; export class ContractTxResponseHandler implements ContractMessageResponse { - private readonly response: ExecuteResult | TxsResponse; + private readonly response: Tx; - private constructor(response: ExecuteResult | TxsResponse) { + private constructor(response: Tx) { this.response = response; } parse(): any { - return JSON.parse(decoder.decode(this.response.data)); + return JSON.parse(decoder.decode(this.response.data[0])); } - getRaw(): ExecuteResult | TxsResponse { + getRaw(): Tx { return this.response; } @@ -61,9 +67,7 @@ export class ContractTxResponseHandler return typeof this.response === 'undefined'; } - static of( - response: ExecuteResult | TxsResponse - ): ContractMessageResponse { + static of(response: Tx): ContractMessageResponse { return new ContractTxResponseHandler(response); } } @@ -89,21 +93,22 @@ async function getContext(contractAddress: string): Promise { interface TxHandlerResponse { found: boolean; - response: TxsResponse | undefined; + response: Tx | null; } async function handleResponse(txHash: string): Promise { let result = false; - let tx; + let tx = null; while (true) { try { - tx = await getSigningClient().restClient.txById(txHash, true); - - if (!tx.raw_log.startsWith('[')) { - result = false; - } else { - result = true; + tx = await getSigningClient().query.getTx(txHash); + if (tx) { + if (!tx.rawLog.startsWith('[')) { + result = false; + } else { + result = true; + } } break; @@ -242,9 +247,9 @@ export function createContract(contract: ContractSpecification): T { return result; } -function subtractErrorFromResponse(response: TxsResponse | undefined): string { - if (!response || !response.raw_log) return 'Empty response or unknown error'; - const raw = response.raw_log; +function subtractErrorFromResponse(response: Tx | null): string { + if (!response || !response.rawLog) return 'Empty response or unknown error'; + const raw = response.rawLog; // Generic Errors are return as JSON stringified // Exam. '{"generic_error": { "msg":"" } }' const jsonStart = raw.indexOf('{'); @@ -329,7 +334,7 @@ export async function instantiateContract( req: ContractInstantiationRequest ): Promise { const { id, definition, codeId, label, initMsg } = req; - const { contractAddress: at } = await instantiate(codeId, initMsg, label); + const { rawLog: at } = await instantiate(codeId, initMsg, label); const spec: ContractSpecification = { id, at, @@ -342,13 +347,14 @@ export async function instantiateContract( * Execute multiple messages from multiple contracts. * @param infos An object provided by {@link message} call. * @param memo An optional memo for this message execution. - * @returns Contract message responses. + * @returns Contract message responses + * TODO: Fix this in a later version */ export async function executeMultiMessage( infos: MultiMessageInfo[], memo?: string ): Promise> { - const messages: MessageEntry[] = []; + const messages: MsgExecuteContractParams[] = []; let fees = 0; for (const info of infos) { @@ -358,20 +364,22 @@ export async function executeMultiMessage( const transferAmount = message.transferAmount ? ([message.transferAmount] as Coin[]) : []; - const entry = { - contractAddress: contractAddress, - handleMsg: message.handleMsg, - transferAmount: transferAmount, + + const entry: MsgExecuteContractParams = { + sender: getSigningClient().address, + contract: contractAddress, + msg: message.handleMsg, + sentFunds: transferAmount, }; messages.push(entry); fees += message.fees ? message.fees : 0; } - - const response = await getSigningClient().multiExecute( - messages, + const txOptions: TxOptions = { memo, - getFeeForExecute(fees) - ); + gasLimit: fees, + }; + //@ts-ignore + const response = await getSigningClient().tx.broadcast(messages, txOptions); return ContractTxResponseHandler.of(response); } diff --git a/src/contracts/types.ts b/src/contracts/types.ts index 84f6c80..8f34523 100644 --- a/src/contracts/types.ts +++ b/src/contracts/types.ts @@ -1,5 +1,4 @@ -import { ExecuteResult, TxsResponse } from 'secretjs'; -import { Coin } from 'secretjs/types/types.js'; +import { Coin, Tx } from 'secretjs'; export interface Context { address?: string; @@ -14,7 +13,7 @@ export interface Context { export interface ContractMessageResponse { parse(): T; - getRaw(): ExecuteResult | TxsResponse; + getRaw(): Tx; isEmpty(): boolean; } diff --git a/src/contracts/utils.ts b/src/contracts/utils.ts index 0fbdada..d56924c 100644 --- a/src/contracts/utils.ts +++ b/src/contracts/utils.ts @@ -1,4 +1,4 @@ -import { StdFee } from 'secretjs/types/types'; +import { StdFee } from 'secretjs/dist/wallet_amino'; export function getValue(object: any, key: string): any { let value; diff --git a/yarn.lock b/yarn.lock index 76a03a1..75bbbed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -942,6 +942,15 @@ sha.js "^2.4.11" unorm "^1.5.0" +"@cosmjs/encoding@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.27.1.tgz#3cd5bc0af743485eb2578cdb08cfa84c86d610e1" + integrity sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/encoding@^0.20.0": version "0.20.1" resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.20.1.tgz" @@ -972,6 +981,13 @@ axios "^0.21.1" fast-deep-equal "^3.1.3" +"@cosmjs/math@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.27.1.tgz#be78857b008ffc6b1ed6fecaa1c4cd5bc38c07d7" + integrity sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ== + dependencies: + bn.js "^5.2.0" + "@cosmjs/math@^0.20.0": version "0.20.1" resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.20.1.tgz" @@ -1034,6 +1050,18 @@ resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz" integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== +"@improbable-eng/grpc-web-node-http-transport@0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@improbable-eng/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.15.0.tgz#5a064472ef43489cbd075a91fb831c2abeb09d68" + integrity sha512-HLgJfVolGGpjc9DWPhmMmXJx8YGzkek7jcCFO1YYkSOoO81MWRZentPOd/JiKiZuU08wtc4BG+WNuGzsQB5jZA== + +"@improbable-eng/grpc-web@0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@improbable-eng/grpc-web/-/grpc-web-0.15.0.tgz#3e47e9fdd90381a74abd4b7d26e67422a2a04bef" + integrity sha512-ERft9/0/8CmYalqOVnJnpdDry28q+j+nAlFFARdjyxXDJ+Mhgv9+F600QC8BR9ygOfrXRlAk6CvST2j+JCpQPg== + dependencies: + browser-headers "^0.4.1" + "@iov/crypto@2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@iov/crypto/-/crypto-2.1.0.tgz#10e91b6692e154958c11626dfd096a80e8a481a4" @@ -1271,6 +1299,16 @@ long "^4.0.0" secretjs "^0.17.0" +"@noble/hashes@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae" + integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg== + +"@noble/secp256k1@1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.5.2.tgz#40399e4fba54f588fda14fc03a4499044fdcab24" + integrity sha512-5mzA40W2q55VCRuC9XzmkiEnODdY0c5a7qsK2QcOfI5/MuVQyBaWGQyE6YOEF7kDwp+tDVWGsCDVJUME+wsWWw== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" @@ -1446,6 +1484,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + "@types/node@11.11.6": version "11.11.6" resolved "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz" @@ -1787,17 +1830,54 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +bech32@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-2.0.0.tgz#078d3686535075c8c79709f054b1b226a133b355" + integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== + bech32@^1.1.3, bech32@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -bip39@^3.0.2: +bignumber.js@9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" + integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== + +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bip32@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" + integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== + dependencies: + "@types/node" "10.12.18" + bs58check "^2.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + tiny-secp256k1 "^1.1.3" + typeforce "^1.11.5" + wif "^2.0.6" + +bip39@3.0.4, bip39@^3.0.2: version "3.0.4" resolved "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz" integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== @@ -1812,6 +1892,11 @@ bn.js@^4.11.8, bn.js@^4.11.9: resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== +bn.js@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" @@ -1832,6 +1917,11 @@ brorand@^1.1.0: resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= +browser-headers@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/browser-headers/-/browser-headers-0.4.1.tgz#4308a7ad3b240f4203dbb45acedb38dc2d65dd02" + integrity sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg== + browser-process-hrtime@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" @@ -1848,6 +1938,22 @@ browserslist@^4.16.6, browserslist@^4.17.1: nanocolors "^0.2.12" node-releases "^1.1.76" +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + +bs58check@<3.0.0, bs58check@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -2019,7 +2125,7 @@ core-js-compat@^3.16.0, core-js-compat@^3.16.2: browserslist "^4.17.1" semver "7.0.0" -create-hash@^1.1.0, create-hash@^1.1.2: +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== @@ -2030,7 +2136,7 @@ create-hash@^1.1.0, create-hash@^1.1.2: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@^1.1.4: +create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== @@ -2451,6 +2557,11 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" @@ -2781,6 +2892,11 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" +is-gzip@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-gzip/-/is-gzip-2.0.0.tgz#f4fed2bbd9f96bf2cb39e19262797fdb15aad933" + integrity sha512-jtO4Njg6q58zDo/Pu4027beSZ0VdsZlt8/5Moco6yAg+DIxb5BK/xUYqYG2+MD4+piKldXJNHxRkhEYI2fvrxA== + is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" @@ -3568,6 +3684,11 @@ ms@2.1.2: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +nan@^2.13.2: + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== + nanocolors@^0.2.12: version "0.2.12" resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.12.tgz#4d05932e70116078673ea4cc6699a1c56cc77777" @@ -3687,6 +3808,11 @@ pako@1.0.11: resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== +pako@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" + integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" @@ -3799,7 +3925,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -protobufjs@^6.11.2: +protobufjs@6.11.2, protobufjs@^6.11.2: version "6.11.2" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== @@ -4015,7 +4141,7 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -secretjs@0.17.5, secretjs@^0.17.0: +secretjs@^0.17.0: version "0.17.5" resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-0.17.5.tgz#5b55e46cfa2719714831fc2019e21c21959fe587" integrity sha512-sf0+Je9KIEMQr/wJOgeqyBOV0ruiMNHSwP4L2vXiJbtzJWQqyVHyPkpavAhruNZ+91XlSzAFP2X5MPxqPBC9fQ== @@ -4032,6 +4158,28 @@ secretjs@0.17.5, secretjs@^0.17.0: protobufjs "^6.11.2" secure-random "1.1.2" +secretjs@^1.2.0-beta.56: + version "1.2.0-beta.56" + resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-1.2.0-beta.56.tgz#96d5562fc5ab63857ab20ee9bdd36dbd2b58950c" + integrity sha512-zxL/rggO8xBKXb/rGv7/5E4o8TMSIphkGaxKKu3I2+ncv5UOuBWCoXumBx7ecozUWi7QrucboxsbHeTQINpYpA== + dependencies: + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@improbable-eng/grpc-web" "0.15.0" + "@improbable-eng/grpc-web-node-http-transport" "0.15.0" + "@noble/hashes" "1.0.0" + "@noble/secp256k1" "1.5.2" + bech32 "2.0.0" + bignumber.js "9.0.2" + bip32 "2.0.6" + bip39 "3.0.4" + curve25519-js "0.0.4" + is-gzip "2.0.0" + miscreant "0.3.2" + pako "2.0.4" + protobufjs "6.11.2" + secure-random "1.1.2" + secure-random@1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/secure-random/-/secure-random-1.1.2.tgz" @@ -4275,6 +4423,17 @@ throat@^6.0.1: resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== +tiny-secp256k1@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" + integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== + dependencies: + bindings "^1.3.0" + bn.js "^4.11.8" + create-hmac "^1.1.7" + elliptic "^6.4.0" + nan "^2.13.2" + tmpl@1.0.x: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -4361,6 +4520,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typeforce@^1.11.5: + version "1.18.0" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" + integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== + typescript@^4.3.2: version "4.3.2" resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz" @@ -4484,6 +4648,13 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wif@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" + integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= + dependencies: + bs58check "<3.0.0" + word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz"