diff --git a/docs/cancel_http_requests.md b/docs/cancel_http_requests.md new file mode 100644 index 0000000000..39ebf0e6cb --- /dev/null +++ b/docs/cancel_http_requests.md @@ -0,0 +1,125 @@ +--- +title: Cancel HTTP requests +author: Roxane Letourneau +--- + +Having Taquito implemented in composable modules is a design choice to allow users to customize the modules to meet some of their specific needs. + +One of these needs might be the ability to cancel HTTP requests to optimize the network. Indeed, Taquito has heavy methods that make a lot of requests to the RPC. For example, in some cases, users might want to cancel almost immediately a call when using it in user interfaces. It is possible to incorporate some logic into the `HttpBackend` and `RpcClient` classes to fulfill this need. + +Here is an example in which we can click the `cancel` button during an estimation call to abort all requests. It will throw an exception. + +```js live noInline abort +const amount = 2; +const address = 'tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY'; + +println(`Estimating the transfer of ${amount} ęś© to ${address} : `); +Tezos.estimate + .transfer({ to: address, amount: amount }) + .then((est) => { + println(`burnFeeMutez : ${est.burnFeeMutez}, + gasLimit : ${est.gasLimit}, + minimalFeeMutez : ${est.minimalFeeMutez}, + storageLimit : ${est.storageLimit}, + suggestedFeeMutez : ${est.suggestedFeeMutez}, + totalCost : ${est.totalCost}, + usingBaseFeeMutez : ${est.usingBaseFeeMutez}`); + }) + .catch((error) => println(`Error: ${JSON.stringify(error, null, 2)}`)); +``` + +Here are the steps that we implemented to built the precedent example: + +1. Create a custom `HttpBackend` +We created a class called `CancellableHttpBackend` which extended the `HttpBackend` class, and we overrode the `createRequest` method. We used the [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to help to abort the fetch requests. We added logic to the `createRequest` method to handle the abort signal. + +``` ts +import { HttpBackend, HttpRequestFailed, HttpResponseError, STATUS_CODE, HttpRequestOptions } from '@taquito/http-utils'; +import AbortController from "abort-controller"; + +class CancellableHttpBackend extends HttpBackend { + private abortCtrl: AbortController; + constructor(){ + super(); + this.abortCtrl = new AbortController(); + } + + cancelRequest(){ + this.abortCtrl.abort(); + }; + + createRequest( + { url, method, timeout, query, headers = {}, json = true, mimeType = undefined }: HttpRequestOptions, + data?: {} + ) { + return new Promise((resolve, reject) => { + + [...] + + request.onabort = function () { + reject( + new HttpResponseError( + `Request canceled`, + this.status as STATUS_CODE, + request.statusText, + request.response, + url + ) + ); + }; + + const abort = () => { + request.abort(); + } + + this.abortCtrl.signal.addEventListener("abort", abort); + + [...] + }); + } +} +``` + +2. Create a custom `RpcClient` +We created a class called `CancellableRpcClient` which extends the `RpcClient` class. We passed to its constructor an instance of our `CancellableHttpBackend` class. We also added a `cancelRequest` method which is used to trigger the abort signal. + +``` ts +import { RpcClient } from '@taquito/rpc'; + +class CancellableRpcClient extends RpcClient { + httpBackend: CancellableHttpBackend; + + constructor( + url: string, + chain: string = 'main', + customHttpBackend: CancellableHttpBackend = new CancellableHttpBackend() + ) { + super(url, chain, customHttpBackend), + this.httpBackend = customHttpBackend; + } + + cancelRequest(){ + this.httpBackend.cancelRequest(); + } +} +``` +3. Set the RpcProvider +Then, we set our `CancellableRpcClient` on our `TezosToolkit` instance instead of using the default `RpcClient` class: + +``` ts +import { TezosToolkit } from '@taquito/taquito'; +import { InMemorySigner } from '@taquito/signer'; + +const signer: any = new InMemorySigner('your_key'); +const customRpcClient = new CancellableRpcClient('your_RPC_URL') +const tezos = new TezosToolkit(customRpcClient); +tezos.setSignerProvider(signer); +``` + +4. Trigger the abort signal +We linked the `cancelRequest` method of the `CancellableRpcClient` class to a `cancel` button. The initiator of the abort signal might be different based on your use cases. Note that the cancelation action is not specific to a method in the example, meaning that all RPC calls will be aborted. + +``` ts +Tezos.rpc.cancelRequest(); +``` + diff --git a/packages/taquito-http-utils/src/taquito-http-utils.ts b/packages/taquito-http-utils/src/taquito-http-utils.ts index cb6b962679..6a491678ed 100644 --- a/packages/taquito-http-utils/src/taquito-http-utils.ts +++ b/packages/taquito-http-utils/src/taquito-http-utils.ts @@ -17,7 +17,7 @@ export { VERSION } from './version'; const defaultTimeout = 30000; -interface HttpRequestOptions { +export interface HttpRequestOptions { url: string; method?: 'GET' | 'POST'; timeout?: number; @@ -49,7 +49,7 @@ export class HttpRequestFailed implements Error { } export class HttpBackend { - private serialize(obj?: { [key: string]: any }) { + protected serialize(obj?: { [key: string]: any }) { if (!obj) { return ''; } @@ -67,7 +67,7 @@ export class HttpBackend { // another use case is multiple arguments with the same name // they are passed as array if (Array.isArray(prop)) { - prop.forEach(item => { + prop.forEach((item) => { str.push(encodeURIComponent(p) + '=' + encodeURIComponent(item)); }); continue; @@ -83,7 +83,7 @@ export class HttpBackend { } } - private createXHR(): XMLHttpRequest { + protected createXHR(): XMLHttpRequest { return new XMLHttpRequestCTOR(); } @@ -92,7 +92,15 @@ export class HttpBackend { * @param options contains options to be passed for the HTTP request (url, method and timeout) */ createRequest( - { url, method, timeout, query, headers = {}, json = true, mimeType = undefined}: HttpRequestOptions, + { + url, + method, + timeout, + query, + headers = {}, + json = true, + mimeType = undefined, + }: HttpRequestOptions, data?: {} ) { return new Promise((resolve, reject) => { @@ -101,14 +109,14 @@ export class HttpBackend { if (!headers['Content-Type']) { request.setRequestHeader('Content-Type', 'application/json'); } - if (mimeType){ + if (mimeType) { request.overrideMimeType(`${mimeType}`); } for (const k in headers) { request.setRequestHeader(k, headers[k]); } request.timeout = timeout || defaultTimeout; - request.onload = function() { + request.onload = function () { if (this.status >= 200 && this.status < 300) { if (json) { try { @@ -132,11 +140,11 @@ export class HttpBackend { } }; - request.ontimeout = function() { + request.ontimeout = function () { reject(new Error(`Request timed out after: ${request.timeout}ms`)); }; - request.onerror = function(err) { + request.onerror = function (err) { reject(new HttpRequestFailed(url, err)); }; diff --git a/packages/taquito-rpc/src/taquito-rpc.ts b/packages/taquito-rpc/src/taquito-rpc.ts index d450c185fd..f29f9b5120 100644 --- a/packages/taquito-rpc/src/taquito-rpc.ts +++ b/packages/taquito-rpc/src/taquito-rpc.ts @@ -73,10 +73,10 @@ export class RpcClient { * @example new RpcClient('https://api.tez.ie/rpc/mainnet', 'main') this will use https://api.tez.ie/rpc/mainnet/chains/main */ constructor( - private url: string, - private chain: string = defaultChain, - private httpBackend: HttpBackend = new HttpBackend() - ) { } + protected url: string, + protected chain: string = defaultChain, + protected httpBackend: HttpBackend = new HttpBackend() + ) {} private createURL(path: string) { // Trim trailing slashes because it is assumed to be included in path @@ -237,22 +237,22 @@ export class RpcClient { { block }: { block: string } = defaultRPCOptions ): Promise { let delegate: DelegateResponse; - try { + try { delegate = await this.httpBackend.createRequest({ url: this.createURL( `/chains/${this.chain}/blocks/${block}/context/contracts/${address}/delegate` ), method: 'GET', }); - } catch(ex) { + } catch (ex) { if (ex instanceof HttpResponseError && ex.status === STATUS_CODE.NOT_FOUND) { delegate = null; - } else { - throw ex; + } else { + throw ex; + } } + return delegate; } - return delegate -} /** * @@ -363,12 +363,12 @@ export class RpcClient { 'block_security_deposit', 'endorsement_security_deposit', 'block_reward', - 'endorsement_reward', + 'endorsement_reward', 'cost_per_byte', 'hard_storage_limit_per_operation', 'test_chain_duration', - 'baking_reward_per_endorsement', - 'delay_per_missing_endorsement' + 'baking_reward_per_endorsement', + 'delay_per_missing_endorsement', ]); return { @@ -513,14 +513,14 @@ export class RpcClient { * @param options contains generic configuration for rpc calls * * @description Current period kind. - * + * * @deprecated Deprecated in favor of getCurrentPeriod * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-period-kind */ - async getCurrentPeriodKind({ block }: RPCOptions = defaultRPCOptions): Promise< - PeriodKindResponse - > { + async getCurrentPeriodKind({ + block, + }: RPCOptions = defaultRPCOptions): Promise { const response = await this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_period_kind`), method: 'GET', @@ -537,9 +537,9 @@ export class RpcClient { * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-proposal */ - async getCurrentProposal({ block }: RPCOptions = defaultRPCOptions): Promise< - CurrentProposalResponse - > { + async getCurrentProposal({ + block, + }: RPCOptions = defaultRPCOptions): Promise { const response = await this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_proposal`), method: 'GET', @@ -556,9 +556,9 @@ export class RpcClient { * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-quorum */ - async getCurrentQuorum({ block }: RPCOptions = defaultRPCOptions): Promise< - CurrentQuorumResponse - > { + async getCurrentQuorum({ + block, + }: RPCOptions = defaultRPCOptions): Promise { const response = await this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_quorum`), method: 'GET', @@ -575,9 +575,9 @@ export class RpcClient { * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-listings */ - async getVotesListings({ block }: RPCOptions = defaultRPCOptions): Promise< - VotesListingsResponse - > { + async getVotesListings({ + block, + }: RPCOptions = defaultRPCOptions): Promise { const response = await this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/listings`), method: 'GET', @@ -781,7 +781,7 @@ export class RpcClient { */ getRpcUrl() { - return this.url + return this.url; } /** @@ -789,40 +789,40 @@ export class RpcClient { * @param options contains generic configuration for rpc calls * * @description Voting period of current block. - * + * * @example getCurrentPeriod() will default to current voting period for /main/chains/block/head. * * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-period */ - async getCurrentPeriod({ block }: RPCOptions = defaultRPCOptions): Promise< - VotingPeriodBlockResult - > { - const response = await this.httpBackend.createRequest({ - url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_period`), - method: 'GET', - }); - - return response; - } - - /** - * - * @param options contains generic configuration for rpc calls - * - * @description Voting period of next block. - * - * @example getSuccessorPeriod() will default to successor voting period for /main/chains/block/head. - * - * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-successor-period - */ - async getSuccessorPeriod({ block }: RPCOptions = defaultRPCOptions): Promise< - VotingPeriodBlockResult - > { + async getCurrentPeriod({ + block, + }: RPCOptions = defaultRPCOptions): Promise { + const response = await this.httpBackend.createRequest({ + url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/current_period`), + method: 'GET', + }); + + return response; + } + + /** + * + * @param options contains generic configuration for rpc calls + * + * @description Voting period of next block. + * + * @example getSuccessorPeriod() will default to successor voting period for /main/chains/block/head. + * + * @see https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-successor-period + */ + async getSuccessorPeriod({ + block, + }: RPCOptions = defaultRPCOptions): Promise { const response = await this.httpBackend.createRequest({ url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/successor_period`), method: 'GET', }); - + return response; } } diff --git a/website/package-lock.json b/website/package-lock.json index 395a9d6cd1..701e5df278 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -2888,6 +2888,14 @@ "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -5604,6 +5612,11 @@ "require-like": ">= 0.1.1" } }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", diff --git a/website/package.json b/website/package.json index 0e1825ae4f..fa391468b4 100644 --- a/website/package.json +++ b/website/package.json @@ -19,14 +19,17 @@ "@ledgerhq/hw-transport-u2f": "^5.28.0", "@taquito/beacon-wallet": "^9.1.1", "@taquito/ledger-signer": "^9.1.1", + "@taquito/michelson-encoder": "^9.1.1", "@taquito/signer": "^9.1.1", "@taquito/taquito": "^9.1.1", "@taquito/tezbridge-wallet": "^9.1.1", "@taquito/tzip12": "^9.1.1", "@taquito/tzip16": "^9.1.1", "@taquito/utils": "^9.1.1", - "@taquito/michelson-encoder": "^9.1.1", + "@taquito/http-utils": "^9.1.1", + "@taquito/rpc": "^9.1.1", "@thanos-wallet/dapp": "^2.2.1", + "abort-controller": "^3.0.0", "classnames": "^2.2.6", "react": "^17.0.1", "react-dom": "^17.0.1" diff --git a/website/sidebars.json b/website/sidebars.json index a82b594b9f..c499852437 100755 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -42,6 +42,11 @@ "label": "Advanced", "items": ["complex_parameters", "storage_annotations", "drain_account"] }, + { + "type": "category", + "label": "Modules customization", + "items": ["cancel_http_requests"] + }, { "type": "category", "label": "Running integration tests", diff --git a/website/src/theme/CodeBlock/customHttpBackendAndRpcClient.ts b/website/src/theme/CodeBlock/customHttpBackendAndRpcClient.ts new file mode 100644 index 0000000000..dd62e2e411 --- /dev/null +++ b/website/src/theme/CodeBlock/customHttpBackendAndRpcClient.ts @@ -0,0 +1,115 @@ +import { HttpBackend, HttpRequestFailed, HttpResponseError, STATUS_CODE, HttpRequestOptions } from '@taquito/http-utils'; +import { RpcClient } from '@taquito/rpc'; +import AbortController from "abort-controller"; + +const defaultTimeout = 30000; + +class CancellableHttpBackend extends HttpBackend { + private abortCtrl: AbortController; + constructor() { + super(); + this.abortCtrl = new AbortController(); + } + + resetAbortCtrl() { + this.abortCtrl = new AbortController(); + } + + cancelRequest() { + this.abortCtrl.abort(); + }; + + createRequest( + { url, method, timeout, query, headers = {}, json = true, mimeType = undefined }: HttpRequestOptions, + data?: {} + ) { + return new Promise((resolve, reject) => { + const request = this.createXHR(); + request.open(method || 'GET', `${url}${this.serialize(query)}`); + if (!headers['Content-Type']) { + request.setRequestHeader('Content-Type', 'application/json'); + } + if (mimeType) { + request.overrideMimeType(`${mimeType}`); + } + for (const k in headers) { + request.setRequestHeader(k, headers[k]); + } + request.timeout = timeout || defaultTimeout; + request.onload = function () { + if (this.status >= 200 && this.status < 300) { + if (json) { + try { + resolve(JSON.parse(request.response)); + } catch (ex) { + reject(new Error(`Unable to parse response: ${request.response}`)); + } + } else { + resolve(request.response); + } + } else { + reject( + new HttpResponseError( + `Http error response: (${this.status}) ${request.response}`, + this.status as STATUS_CODE, + request.statusText, + request.response, + url + ) + ); + } + }; + + request.ontimeout = function () { + reject(new Error(`Request timed out after: ${request.timeout}ms`)); + }; + + request.onerror = function (err) { + reject(new HttpRequestFailed(url, err)); + }; + + request.onabort = function () { + reject( + new HttpResponseError( + `Request canceled`, + this.status as STATUS_CODE, + request.statusText, + request.response, + url + ) + ); + }; + + const abort = () => { + request.abort(); + this.resetAbortCtrl(); + } + + this.abortCtrl.signal.addEventListener("abort", abort); + + if (data) { + const dataStr = JSON.stringify(data); + request.send(dataStr); + } else { + request.send(); + } + }); + } +} + +export class CancellableRpcClient extends RpcClient { + httpBackend: CancellableHttpBackend; + + constructor( + url: string, + chain: string = 'main', + cancellableHttpBackend: CancellableHttpBackend = new CancellableHttpBackend() + ) { + super(url, chain, cancellableHttpBackend); + this.httpBackend = cancellableHttpBackend; + } + + cancelRequest() { + this.httpBackend.cancelRequest(); + } +} diff --git a/website/src/theme/CodeBlock/index.js b/website/src/theme/CodeBlock/index.js index 3241e370a6..51175b6d87 100755 --- a/website/src/theme/CodeBlock/index.js +++ b/website/src/theme/CodeBlock/index.js @@ -34,6 +34,7 @@ import rangeParser from 'parse-numeric-range'; import Highlight, { defaultProps } from 'prism-react-renderer'; import defaultTheme from 'prism-react-renderer/themes/palenight'; import React, { useEffect, useRef, useState } from 'react'; +import { CancellableRpcClient } from './customHttpBackendAndRpcClient'; import styles from './styles.module.css'; @@ -79,7 +80,8 @@ export default ({ }, [button.current, target.current]); if (live) { - const Tezos = new TezosToolkit('https://api.tez.ie/rpc/florencenet'); + const customRpcClient = new CancellableRpcClient('https://api.tez.ie/rpc/florencenet') + const Tezos = new TezosToolkit(customRpcClient); const wallet = new BeaconWallet({name:"exampleWallet"}); return ( diff --git a/website/src/theme/Playground/index.js b/website/src/theme/Playground/index.js index 4264e219f1..2042b03e26 100755 --- a/website/src/theme/Playground/index.js +++ b/website/src/theme/Playground/index.js @@ -46,8 +46,6 @@ function println(value) { render(_printlnBuffer); } -Tezos.setProvider({ rpc: 'https://api.tez.ie/rpc/florencenet' }); - ${this.props.wallet ? `const network = {type:"florencenet"}; wallet.requestPermissions({network}) @@ -158,6 +156,22 @@ const managerCode = [{"prim": "parameter","args":[{"prim": "or","args":[{"prim": this.transpile({ code, scope, transformCode, noInline }); } + + cancel() { + const { scope, transformCode, noInline } = this.props; + const code =` + let _printlnBuffer = ""; + + function println(value) { + _printlnBuffer += value + "\\n"; + + render(_printlnBuffer); + } + Tezos.rpc.cancelRequest(); + ` + this.transpile({ code, scope, transformCode, noInline }); + + } } function Playground({ children, theme, transformCode, ...props }) { @@ -185,6 +199,10 @@ function Playground({ children, theme, transformCode, ...props }) { live.current && live.current.run(); }; + const cancelRunCode = () => { + live.current && live.current.cancel(); + }; + const handleCopyCode = () => { window.getSelection().empty(); setShowCopied(true); @@ -237,6 +255,17 @@ function Playground({ children, theme, transformCode, ...props }) { onClick={handleRunCode}> Run code + {props.abort ? + :""}
diff --git a/website/yarn.lock b/website/yarn.lock index 4390c9ae1a..4f7cc52987 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@airgap/beacon-sdk@2.2.9-beta.3": - version "2.2.9-beta.3" - resolved "https://registry.yarnpkg.com/@airgap/beacon-sdk/-/beacon-sdk-2.2.9-beta.3.tgz#066f6372270af7cd39f89bdcbea2fd9576232f25" - integrity sha512-qN/KlIZMkHU0mKTRpaScwnzBSriXuF0W5FCU0yFyvFggZsMKsqC9ATNuamy9o7GQ92Ohy4i/ERsw9KVCTFevew== +"@airgap/beacon-sdk@^2.2.9": + version "2.2.9" + resolved "https://registry.yarnpkg.com/@airgap/beacon-sdk/-/beacon-sdk-2.2.9.tgz#44e0b87e871123a1f80da069beeab2603d80689f" + integrity sha512-ZqwOMC2ZpSoGTsu0wItR27baeNtWZu6dDGsfhVpsdWPTZmOSk6rsSMz5g+uh4gBCX2UDwDZiBg9FQj9maj5Z8w== dependencies: "@types/chrome" "0.0.115" "@types/libsodium-wrappers" "0.7.7" @@ -1791,65 +1791,65 @@ dependencies: defer-to-connect "^1.0.1" -"@taquito/beacon-wallet@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/beacon-wallet/-/beacon-wallet-9.1.1-beta-RC.0.tgz#783e83271b6e90d887d0ef5797c445d5a45db2b9" - integrity sha512-vqsDQKnRFY41ZNFt8LDAPSbwCKKnqvfZEW8/6Xfy/IqF8MuFfI5XO+tgCJrTWlaiX85s+zQMkXO/5NV3+DY0oQ== +"@taquito/beacon-wallet@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/beacon-wallet/-/beacon-wallet-9.1.1.tgz#2b56793c0a3a895227f444b3eab82fc43d2c88d6" + integrity sha512-qQ5A+b79yMG2BRV2udpO5BlbDPGa+Gh4y46757CrKKhvSsyPou8uU7EW2/jBUuI1BfaY42mNrQ3kAa7+9adRyw== dependencies: - "@airgap/beacon-sdk" "2.2.9-beta.3" - "@taquito/taquito" "^9.1.1-beta-RC.0" - "@taquito/utils" "^9.1.1-beta-RC.0" + "@airgap/beacon-sdk" "^2.2.9" + "@taquito/taquito" "^9.1.1" + "@taquito/utils" "^9.1.1" -"@taquito/http-utils@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/http-utils/-/http-utils-9.1.1-beta-RC.0.tgz#f16f14c99a7d80bb1dcdc0341ac2cc43ae40f0eb" - integrity sha512-LOmIdsX/wLUkgTPvMJ+6YrAmxEMQ3Xu5/gwp/YVdBp8X8VNK5nWuWIJ54cf1Gf97ReVcnq2/OWa3UEqfsnijcw== +"@taquito/http-utils@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/http-utils/-/http-utils-9.1.1.tgz#ebfe6984ff234266ab683ab269f9fb18a54f019b" + integrity sha512-d/E3eSk+OI+esybHaFhY3M13XHSf/SAgdQS62WQZuaDBvMSwLV7fnwVJryMmrXeIA9jc/arI5dJQ0egEMaR16A== dependencies: xhr2-cookies "^1.1.0" -"@taquito/ledger-signer@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/ledger-signer/-/ledger-signer-9.1.1-beta-RC.0.tgz#7e6b6061a698173982542ce3e4340180bdf5a5a9" - integrity sha512-jgYpiEWbSzJW4DM/m2gUnx08iI8yfE/JBzh7A46PHR+WC6jlhS0FlOqiBFaRAuKN+chsj8UJKFJEIkFsF8ImYA== +"@taquito/ledger-signer@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/ledger-signer/-/ledger-signer-9.1.1.tgz#6f771e4a80984dcd46e5b76002dd3c7366dda182" + integrity sha512-HRTc5kvnVhI5F0xC94BSwN56b0jIovYMZes43GL4UNqUYYQj6x2LlUmH7TTFzLH/uFT53Zg6DXzTx0JfqNSPnw== dependencies: "@ledgerhq/hw-transport" "^5.41.0" - "@taquito/taquito" "^9.1.1-beta-RC.0" - "@taquito/utils" "^9.1.1-beta-RC.0" + "@taquito/taquito" "^9.1.1" + "@taquito/utils" "^9.1.1" "@types/jest" "^26.0.16" buffer "^5.6.0" libsodium-wrappers "^0.7.8" -"@taquito/michel-codec@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/michel-codec/-/michel-codec-9.1.1-beta-RC.0.tgz#f054921fc18aca9b5a8886eeb50f95f57c3cef82" - integrity sha512-6GEjrruo9N6EF48XsBK7Bp+HQYsKD6zdFdKRzhh+KXVrUfHCc1QP9DkK7ki0B09xkz/yoYQ13zGeFFDDdiubNQ== +"@taquito/michel-codec@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/michel-codec/-/michel-codec-9.1.1.tgz#a6cb31845caaffe7e7acdc2c1ea86ef561515fcd" + integrity sha512-aeXl5LORcEapoRH+3CzCIruo8P38uvyj/+/ApzkOX0ogh0sRuYxMKkNMUgcgAatduHCrNBwh665By/pYQ5BxzQ== -"@taquito/michelson-encoder@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/michelson-encoder/-/michelson-encoder-9.1.1-beta-RC.0.tgz#2793d0c345c575ca2d4069e477c738d5d5480454" - integrity sha512-gMW4kv8ad0gPhoJrMFcYh7jAof0iq1d0khaYwxlFRup4IkPkdC3KxRd3pEKAJDGJwd7Rmckh2gE8/VnuiZdPnQ== +"@taquito/michelson-encoder@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/michelson-encoder/-/michelson-encoder-9.1.1.tgz#abca32547d1187ba4d5a96c2cf86d32ddf5639d0" + integrity sha512-Y7vRgNyyqR6caq3jGbNdhr6ZhOBLxLxpesTQk5an/axNk8HJplNM64e2wbU9syNjjYI63xMyIi+gu2danwbHMQ== dependencies: - "@taquito/rpc" "^9.1.1-beta-RC.0" - "@taquito/utils" "^9.1.1-beta-RC.0" + "@taquito/rpc" "^9.1.1" + "@taquito/utils" "^9.1.1" bignumber.js "^9.0.1" fast-json-stable-stringify "^2.1.0" -"@taquito/rpc@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/rpc/-/rpc-9.1.1-beta-RC.0.tgz#ebf7f16e9b77abb39bafa29681d35672f995a1c5" - integrity sha512-UD2fw/MsKM6ziSmqa5/etzwFn4uvTPq5/gD36SB/9ct5+q5hpygmtGYXwiSWH8g/Y8I0Tra5Q02TlISigrUFUg== +"@taquito/rpc@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/rpc/-/rpc-9.1.1.tgz#a0cd55e92189bccb23105f13de328a576ee44c01" + integrity sha512-fjHirJNuuHMjSef/1iFrIbRjCAihJbliR0kK5RZXikBqlIzSTVHYNBbzJ+AgyEdOFQasDNVLGR1vcDkEr49gyg== dependencies: - "@taquito/http-utils" "^9.1.1-beta-RC.0" + "@taquito/http-utils" "^9.1.1" bignumber.js "^9.0.1" lodash "^4.17.20" -"@taquito/signer@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/signer/-/signer-9.1.1-beta-RC.0.tgz#19ead600929eac9c148a17d38acfc635c97f3b60" - integrity sha512-u2KX2qgw4GMIXbM384Sb+tfRPJ7w1GBgdyeF+orFGH1GGPkbDc6j0cCqGLWsiNyos6nArbw+B0BUItA66W1r2A== +"@taquito/signer@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/signer/-/signer-9.1.1.tgz#1a0ef3cd059b8111ccae9561fc7a275e9d09c134" + integrity sha512-W0U28HaM/OzVVFAaDM9GjY+TYd7Z2WOT6SgY2885ic8bt6g/L9EZU7SMSCUaVw4h+eijJHRAzeXWh9WfS2pSlw== dependencies: - "@taquito/taquito" "^9.1.1-beta-RC.0" - "@taquito/utils" "^9.1.1-beta-RC.0" + "@taquito/taquito" "^9.1.1" + "@taquito/utils" "^9.1.1" bignumber.js "^9.0.1" bip39 "^3.0.2" elliptic "^6.5.4" @@ -1857,54 +1857,54 @@ pbkdf2 "^3.1.1" typedarray-to-buffer "^3.1.5" -"@taquito/taquito@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/taquito/-/taquito-9.1.1-beta-RC.0.tgz#38bf601e7c50f646ba13b47210366f5c540c670c" - integrity sha512-2aXd5I4cHj44Y7Rtl0+N2AplU072pbqNRUcorziIW5fWZtE+X71m3XbNLSqzSFT/WktHSqUTxuI6sh5Cu5XnGQ== - dependencies: - "@taquito/http-utils" "^9.1.1-beta-RC.0" - "@taquito/michel-codec" "^9.1.1-beta-RC.0" - "@taquito/michelson-encoder" "^9.1.1-beta-RC.0" - "@taquito/rpc" "^9.1.1-beta-RC.0" - "@taquito/utils" "^9.1.1-beta-RC.0" +"@taquito/taquito@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/taquito/-/taquito-9.1.1.tgz#04bb632e8eea8dad952896f4cf1f72211ed92e55" + integrity sha512-A89bXRPgYKYNMXa6PBxMrkmdtkxjM0bnBpW62Dz0gHVKdxj1fXLD/rPZFCwkm9soOVSfzIqJoKWDZ37NBTzc2g== + dependencies: + "@taquito/http-utils" "^9.1.1" + "@taquito/michel-codec" "^9.1.1" + "@taquito/michelson-encoder" "^9.1.1" + "@taquito/rpc" "^9.1.1" + "@taquito/utils" "^9.1.1" bignumber.js "^9.0.1" rx-sandbox "^1.0.3" rxjs "^6.6.3" -"@taquito/tezbridge-wallet@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/tezbridge-wallet/-/tezbridge-wallet-9.1.1-beta-RC.0.tgz#3135d4d60bdfb1ccb9babedd74d132bca6905945" - integrity sha512-e8rom0q9l+/P+cb0kcOn2Muw3vQGKqezZmW/miVfjglwjqlekKKPBX2kkqNZ3QsAb9ljtEpGeP5e9QPqS7/F8A== +"@taquito/tezbridge-wallet@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/tezbridge-wallet/-/tezbridge-wallet-9.1.1.tgz#fa31116a7888f6f92024306bb732aa3203d5b659" + integrity sha512-LgV/FZwHufdX+s17qjcPML/4t4XU+8+KhE/DZvA9hQyh5jnjNdV2daTgFHi6jWrOkUqhLoTGhuJFDGnmORdHkw== dependencies: - "@taquito/taquito" "^9.1.1-beta-RC.0" + "@taquito/taquito" "^9.1.1" -"@taquito/tzip12@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/tzip12/-/tzip12-9.1.1-beta-RC.0.tgz#ee2208a4a68fa93e38b1aaccd1b318aced0da2aa" - integrity sha512-GCn9Xngg+2AMfieR8fex24xq1sXcU0vJVHGw0bKvopQrJft0koo37tG8FUaLlY4G36ERkk9GAX5V2u1wH6pT2g== +"@taquito/tzip12@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/tzip12/-/tzip12-9.1.1.tgz#277a1e94633edec007e181c50953539f0dcc89cf" + integrity sha512-Sn8k9QsNTqXwMX/XsiOfPwOJ95Dt+TP0EdzzkXxXr8eiZjFhr2bOLEXnoKJpDVkzBagmZV1LKhNm263aXDaboQ== dependencies: - "@taquito/michelson-encoder" "^9.1.1-beta-RC.0" - "@taquito/taquito" "^9.1.1-beta-RC.0" - "@taquito/tzip16" "^9.1.1-beta-RC.0" + "@taquito/michelson-encoder" "^9.1.1" + "@taquito/taquito" "^9.1.1" + "@taquito/tzip16" "^9.1.1" bignumber.js "^9.0.1" -"@taquito/tzip16@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/tzip16/-/tzip16-9.1.1-beta-RC.0.tgz#74bb005985517196b1c2a2e62992d53c4caa6347" - integrity sha512-OayM/qbXIiyzSZN7+r3WrpoQVxNDNsXbb77X2BI5BHalPilHcTu0IL67TUHlmLO0Mgt4Moyk1Gy3WbLB1xqu7Q== - dependencies: - "@taquito/http-utils" "^9.1.1-beta-RC.0" - "@taquito/michelson-encoder" "^9.1.1-beta-RC.0" - "@taquito/rpc" "^9.1.1-beta-RC.0" - "@taquito/taquito" "^9.1.1-beta-RC.0" - "@taquito/utils" "^9.1.1-beta-RC.0" +"@taquito/tzip16@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/tzip16/-/tzip16-9.1.1.tgz#d6c12b61c8f526b20fe7ec6142b2e8652fc2d459" + integrity sha512-fRygZjjSidJ0R5z6uGJHJReA1/GyBon1wLCL3scHn5tYTsdXCm/45UgjFcU9wic1JQ1PkWGkdZnQllbp1sOiOw== + dependencies: + "@taquito/http-utils" "^9.1.1" + "@taquito/michelson-encoder" "^9.1.1" + "@taquito/rpc" "^9.1.1" + "@taquito/taquito" "^9.1.1" + "@taquito/utils" "^9.1.1" bignumber.js "^9.0.1" crypto-js "^4.0.0" -"@taquito/utils@^9.1.1-beta-RC.0": - version "9.1.1-beta-RC.0" - resolved "https://registry.yarnpkg.com/@taquito/utils/-/utils-9.1.1-beta-RC.0.tgz#5f55ae864686c0618bf1f55d7abf1c7dd9a59486" - integrity sha512-hcouJr5YI3XeklYavD0L08+zNX8TipCxAk0KSZXxNmqu21aF0OlTesqUO3JZfJ39GhyWihx2b6KlkbBYc88EZA== +"@taquito/utils@^9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@taquito/utils/-/utils-9.1.1.tgz#1dadb0446a2a9c4f79a34b70c34951b0466b2b84" + integrity sha512-gScwhOEbgiQfTS9UibIzmWoGirb1dwBoqjgNIjvbPHc/k/uXu2ftVj3HTZPLe280j7VBxgbSRGz+fECjDkWNJA== dependencies: blakejs "^1.1.0" bs58check "^2.1.2" @@ -2276,6 +2276,13 @@ resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz" @@ -4567,6 +4574,11 @@ eval@^0.1.4: dependencies: require-like ">= 0.1.1" +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz"