@stacks/blockchain-api-client
Advanced tools
Comparing version 0.14.2 to 0.14.3
@@ -16,2 +16,4 @@ /** | ||
principal: string; | ||
limit?: number; | ||
offset?: number; | ||
} | ||
@@ -30,2 +32,4 @@ export interface GetAccountBalanceRequest { | ||
principal: string; | ||
limit?: number; | ||
offset?: number; | ||
} | ||
@@ -32,0 +36,0 @@ /** |
@@ -31,2 +31,8 @@ "use strict"; | ||
const queryParameters = {}; | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters = {}; | ||
@@ -133,2 +139,8 @@ const response = await this.request({ | ||
const queryParameters = {}; | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters = {}; | ||
@@ -135,0 +147,0 @@ const response = await this.request({ |
@@ -32,2 +32,4 @@ /** | ||
contractId: string; | ||
limit?: number; | ||
offset?: number; | ||
} | ||
@@ -34,0 +36,0 @@ export interface GetContractInterfaceRequest { |
@@ -134,2 +134,8 @@ "use strict"; | ||
const queryParameters = {}; | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters = {}; | ||
@@ -136,0 +142,0 @@ const response = await this.request({ |
@@ -14,5 +14,14 @@ /** | ||
import { MempoolTransactionListResponse, TransactionResults } from '../models'; | ||
export interface GetMempoolTransactionListRequest { | ||
limit?: number; | ||
offset?: number; | ||
} | ||
export interface GetTransactionByIdRequest { | ||
txId: string; | ||
} | ||
export interface GetTransactionListRequest { | ||
limit?: number; | ||
offset?: number; | ||
type?: Array<GetTransactionListTypeEnum>; | ||
} | ||
export interface PostCoreNodeTransactionsRequest { | ||
@@ -29,3 +38,3 @@ body?: string; | ||
*/ | ||
getMempoolTransactionListRaw(): Promise<runtime.ApiResponse<MempoolTransactionListResponse>>; | ||
getMempoolTransactionListRaw(requestParameters: GetMempoolTransactionListRequest): Promise<runtime.ApiResponse<MempoolTransactionListResponse>>; | ||
/** | ||
@@ -35,3 +44,3 @@ * Get all recently-broadcast mempool transactions | ||
*/ | ||
getMempoolTransactionList(): Promise<MempoolTransactionListResponse>; | ||
getMempoolTransactionList(requestParameters: GetMempoolTransactionListRequest): Promise<MempoolTransactionListResponse>; | ||
/** | ||
@@ -51,3 +60,3 @@ * Get a specific transaction by ID `import type { Transaction } from \'@blockstack/stacks-blockchain-api-types\';` | ||
*/ | ||
getTransactionListRaw(): Promise<runtime.ApiResponse<TransactionResults>>; | ||
getTransactionListRaw(requestParameters: GetTransactionListRequest): Promise<runtime.ApiResponse<TransactionResults>>; | ||
/** | ||
@@ -57,3 +66,3 @@ * Get all recently mined transactions If using TypeScript, import typings for this response from our types package: `import type { TransactionResults } from \'@blockstack/stacks-blockchain-api-types\';` | ||
*/ | ||
getTransactionList(): Promise<TransactionResults>; | ||
getTransactionList(requestParameters: GetTransactionListRequest): Promise<TransactionResults>; | ||
/** | ||
@@ -70,1 +79,12 @@ * Broadcast raw transactions on the network. You can use the [stacks-transactions-js](https://github.com/blockstack/stacks-transactions-js) project to generate a raw transaction payload. | ||
} | ||
/** | ||
* @export | ||
* @enum {string} | ||
*/ | ||
export declare enum GetTransactionListTypeEnum { | ||
coinbase = "coinbase", | ||
token_transfer = "token_transfer", | ||
smart_contract = "smart_contract", | ||
contract_call = "contract_call", | ||
poison_microblock = "poison_microblock" | ||
} |
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TransactionsApi = void 0; | ||
exports.GetTransactionListTypeEnum = exports.TransactionsApi = void 0; | ||
const runtime = require("../runtime"); | ||
@@ -28,4 +28,10 @@ const models_1 = require("../models"); | ||
*/ | ||
async getMempoolTransactionListRaw() { | ||
async getMempoolTransactionListRaw(requestParameters) { | ||
const queryParameters = {}; | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters = {}; | ||
@@ -44,4 +50,4 @@ const response = await this.request({ | ||
*/ | ||
async getMempoolTransactionList() { | ||
const response = await this.getMempoolTransactionListRaw(); | ||
async getMempoolTransactionList(requestParameters) { | ||
const response = await this.getMempoolTransactionListRaw(requestParameters); | ||
return await response.value(); | ||
@@ -79,4 +85,13 @@ } | ||
*/ | ||
async getTransactionListRaw() { | ||
async getTransactionListRaw(requestParameters) { | ||
const queryParameters = {}; | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
if (requestParameters.type) { | ||
queryParameters['type'] = requestParameters.type; | ||
} | ||
const headerParameters = {}; | ||
@@ -95,4 +110,4 @@ const response = await this.request({ | ||
*/ | ||
async getTransactionList() { | ||
const response = await this.getTransactionListRaw(); | ||
async getTransactionList(requestParameters) { | ||
const response = await this.getTransactionListRaw(requestParameters); | ||
return await response.value(); | ||
@@ -126,2 +141,14 @@ } | ||
exports.TransactionsApi = TransactionsApi; | ||
/** | ||
* @export | ||
* @enum {string} | ||
*/ | ||
var GetTransactionListTypeEnum; | ||
(function (GetTransactionListTypeEnum) { | ||
GetTransactionListTypeEnum["coinbase"] = "coinbase"; | ||
GetTransactionListTypeEnum["token_transfer"] = "token_transfer"; | ||
GetTransactionListTypeEnum["smart_contract"] = "smart_contract"; | ||
GetTransactionListTypeEnum["contract_call"] = "contract_call"; | ||
GetTransactionListTypeEnum["poison_microblock"] = "poison_microblock"; | ||
})(GetTransactionListTypeEnum = exports.GetTransactionListTypeEnum || (exports.GetTransactionListTypeEnum = {})); | ||
//# sourceMappingURL=TransactionsApi.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).StacksBlockchainApiClient={})}(this,function(e){function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function s(e,t,n){return(s=i()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return s(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,e)})(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function l(e,t,n){if(!e.s){if(n instanceof f){if(!n.s)return void(n.o=l.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(l.bind(null,e,t),l.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var f=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,o=this.s;if(o){var i=1&o?t:n;if(i){try{l(r,1,i(this.v))}catch(e){l(r,2,e)}return r}return this}return this.o=function(e){try{var o=e.v;1&e.s?l(r,1,t?t(o):o):n?l(r,1,n(o)):l(r,2,o)}catch(e){l(r,2,e)}},r},e}();function d(e){return e instanceof f&&1&e.s}function h(e,t,n){if("function"==typeof e[u]){var r,o,i,s=e[u]();if(function e(a){try{for(;!((r=s.next()).done||n&&n());)if((a=t(r.value))&&a.then){if(!d(a))return void a.then(e,i||(i=l.bind(null,o=new f,2)));a=a.v}o?l(o,1,a):o=a}catch(e){l(o||(o=new f),2,e)}}(),s.return){var a=function(e){try{r.done||s.return()}catch(e){}return e};if(o&&o.then)return o.then(a,function(e){throw a(e)});a()}return o}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],h=0;h<e.length;h++)c.push(e[h]);return function(e,t,n){var r,o,i=-1;return function s(a){try{for(;++i<e.length&&(!n||!n());)if((a=t(i))&&a.then){if(!d(a))return void a.then(s,o||(o=l.bind(null,r=new f,2)));a=a.v}r?l(r,1,a):r=a}catch(e){l(r||(r=new f),2,e)}}(),r}(c,function(e){return t(c[e])},n)}var p="https://stacks-node-api-latest.argon.blockstack.xyz".replace(/\/+$/,""),m=function(){function e(e){var n=this;void 0===e&&(e=new y),this.configuration=e,this.fetchApi=function(e,r){try{var o=function(){return Promise.resolve(n.configuration.fetchApi(i.url,i.init)).then(function(t){var o=h(n.middleware,function(o){var i=function(){if(o.post)return Promise.resolve(o.post({fetch:n.fetchApi,url:e,init:r,response:t.clone()})).then(function(e){t=e||t})}();if(i&&i.then)return i.then(function(){})});return o&&o.then?o.then(function(){return t}):t})},i={url:e,init:r},s=h(n.middleware,function(e){var r=function(){if(e.pre)return Promise.resolve(e.pre(t({fetch:n.fetchApi},i))).then(function(e){i=e||i})}();if(r&&r.then)return r.then(function(){})});return Promise.resolve(s&&s.then?s.then(o):o())}catch(e){return Promise.reject(e)}},this.middleware=e.middleware}var n=e.prototype;return n.withMiddleware=function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,[].slice.call(arguments)),t},n.withPreMiddleware=function(){var e=[].slice.call(arguments).map(function(e){return{pre:e}});return this.withMiddleware.apply(this,e)},n.withPostMiddleware=function(){var e=[].slice.call(arguments).map(function(e){return{post:e}});return this.withMiddleware.apply(this,e)},n.request=function(e){try{var t=this.createFetchParams(e);return Promise.resolve(this.fetchApi(t.url,t.init)).then(function(e){if(e.status>=200&&e.status<300)return e;throw e})}catch(e){return Promise.reject(e)}},n.createFetchParams=function(e){var t=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(t+="?"+this.configuration.queryParamsStringify(e.query));var n="undefined"!=typeof FormData&&e.body instanceof FormData||e.body instanceof URLSearchParams||"undefined"!=typeof Blob&&e.body instanceof Blob?e.body:JSON.stringify(e.body),r=Object.assign({},this.configuration.headers,e.headers);return{url:t,init:{method:e.method,headers:r,body:n,credentials:this.configuration.credentials}}},n.clone=function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e},e}(),v=function(e){function t(t,n){var r;return(r=e.call(this,n)||this).field=t,r.name="RequiredError",r}return n(t,e),t}(a(Error)),y=function(){function e(e){void 0===e&&(e={}),this.configuration=e}var t;return(t=[{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:p}},{key:"fetchApi",get:function(){return this.configuration.fetchApi||window.fetch.bind(window)}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||g}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this.configuration.accessToken;if(e)return"function"==typeof e?e:function(){return e}}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function w(e,t){return null!=e[t]}function g(e,t){return void 0===t&&(t=""),Object.keys(e).map(function(n){var r=t+(t.length?"["+n+"]":n),o=e[n];if(o instanceof Array){var i=o.map(function(e){return encodeURIComponent(String(e))}).join("&"+encodeURIComponent(r)+"=");return encodeURIComponent(r)+"="+i}return o instanceof Object?g(o,r):encodeURIComponent(r)+"="+encodeURIComponent(String(o))}).filter(function(e){return e.length>0}).join("&")}var _=function(){function e(e,t){void 0===t&&(t=function(e){return e}),this.raw=e,this.transformer=t}return e.prototype.value=function(){try{var e=this,t=e.transformer;return Promise.resolve(e.raw.json()).then(function(n){return t.call(e,n)})}catch(e){return Promise.reject(e)}},e}(),b=function(){function e(e){this.raw=e}return e.prototype.value=function(){return Promise.resolve(void 0)},e}(),k=function(){function e(e){this.raw=e}return e.prototype.value=function(){try{return Promise.resolve(this.raw.blob())}catch(e){return Promise.reject(e)}},e}(),P=function(){function e(e){this.raw=e}return e.prototype.value=function(){try{return Promise.resolve(this.raw.text())}catch(e){return Promise.reject(e)}},e}();function R(e){return S(e)}function S(e,t){return null==e?e:{balance:e.balance,nonce:e.nonce,balance_proof:e.balance_proof,nonce_proof:e.nonce_proof}}function T(e){return q(e)}function q(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}function N(e){return O(e)}function O(e,t){return null==e?e:{stx:A(e.stx),fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}}function A(e){return x(e)}function x(e,t){return null==e?e:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}}function j(e){if(void 0!==e)return null===e?null:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}}function C(e){return I(e)}function I(e,t){return null==e?e:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}}function B(e){return F(e)}function F(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}function E(e){return J(e)}function J(e,t){return null==e?e:{canonical:e.canonical,height:e.height,hash:e.hash,parent_block_hash:e.parent_block_hash,burn_block_time:e.burn_block_time,burn_block_time_iso:e.burn_block_time_iso,txs:e.txs}}function U(e){if(void 0!==e)return null===e?null:{canonical:e.canonical,height:e.height,hash:e.hash,parent_block_hash:e.parent_block_hash,burn_block_time:e.burn_block_time,burn_block_time_iso:e.burn_block_time_iso,txs:e.txs}}function L(e){return M(e)}function M(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results.map(E)}}function G(e){return D(e)}function D(e,t){return null==e?e:{functions:e.functions,variables:e.variables,maps:e.maps,fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}}function W(e){return H(e)}function H(e,t){return null==e?e:{source:e.source,publish_height:e.publish_height,proof:e.proof}}function V(e){return z(e)}function z(e,t){return null==e?e:{limit:w(e,"limit")?e.limit:void 0,peer_version:e.peer_version,burn_consensus:e.burn_consensus,burn_block_height:e.burn_block_height,stable_burn_consensus:e.stable_burn_consensus,stable_burn_block_height:e.stable_burn_block_height,server_version:e.server_version,network_id:e.network_id,parent_network_id:e.parent_network_id,stacks_tip_height:e.stacks_tip_height,stacks_tip:e.stacks_tip,stacks_tip_burn_block:e.stacks_tip_burn_block,exit_at_block_height:e.exit_at_block_height}}function K(e){return $(e)}function $(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}function Q(e){return X(e)}function X(e,t){return null==e?e:{target_block_time:e.target_block_time}}function Y(e){return Z(e)}function Z(e,t){return null==e?e:{mainnet:ee(e.mainnet),testnet:ee(e.testnet)}}function ee(e){return te(e)}function te(e,t){return null==e?e:{target_block_time:e.target_block_time}}function ne(e){if(void 0!==e)return null===e?null:{target_block_time:e.target_block_time}}function re(e,t){return null==e?e:{sender:e.sender,arguments:e.arguments}}function oe(e){if(void 0!==e)return null===e?null:{sender:e.sender,arguments:e.arguments}}function ie(e){return se(e)}function se(e,t){return null==e?e:{okay:e.okay,result:w(e,"result")?e.result:void 0,cause:w(e,"cause")?e.cause:void 0}}function ae(e){return ce(e)}function ce(e,t){return null==e?e:{success:e.success,txId:w(e,"txId")?e.txId:void 0,txRaw:w(e,"txRaw")?e.txRaw:void 0}}function ue(e){return le(e)}function le(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}var fe,de=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getAccountAssetsRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountAssets.");return Promise.resolve(this.request({path:"/extended/v1/address/{principal}/assets".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return T(e)})})}catch(e){return Promise.reject(e)}},r.getAccountAssets=function(e){try{return Promise.resolve(this.getAccountAssetsRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountBalanceRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountBalance.");return Promise.resolve(this.request({path:"/extended/v1/address/{principal}/balances".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return N(e)})})}catch(e){return Promise.reject(e)}},r.getAccountBalance=function(e){try{return Promise.resolve(this.getAccountBalanceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountInfoRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountInfo.");var t={};return void 0!==e.proof&&(t.proof=e.proof),Promise.resolve(this.request({path:"/v2/accounts/{principal}".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return R(e)})})}catch(e){return Promise.reject(e)}},r.getAccountInfo=function(e){try{return Promise.resolve(this.getAccountInfoRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountStxBalanceRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountStxBalance.");return Promise.resolve(this.request({path:"/extended/v1/address/{principal}/stx".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return C(e)})})}catch(e){return Promise.reject(e)}},r.getAccountStxBalance=function(e){try{return Promise.resolve(this.getAccountStxBalanceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountTransactionsRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountTransactions.");return Promise.resolve(this.request({path:"/extended/v1/address/{principal}/transactions".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return B(e)})})}catch(e){return Promise.reject(e)}},r.getAccountTransactions=function(e){try{return Promise.resolve(this.getAccountTransactionsRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),he=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getBlockByHashRaw=function(e){try{if(null==e.blockHash)throw new v("blockHash","Required parameter requestParameters.blockHash was null or undefined when calling getBlockByHash.");return Promise.resolve(this.request({path:"/extended/v1/block/{block_hash}".replace("{block_hash}",encodeURIComponent(String(e.blockHash))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return E(e)})})}catch(e){return Promise.reject(e)}},r.getBlockByHash=function(e){try{return Promise.resolve(this.getBlockByHashRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getBlockListRaw=function(e){try{var t={};return void 0!==e.limit&&(t.limit=e.limit),void 0!==e.offset&&(t.offset=e.offset),Promise.resolve(this.request({path:"/extended/v1/block",method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return L(e)})})}catch(e){return Promise.reject(e)}},r.getBlockList=function(e){try{return Promise.resolve(this.getBlockListRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),pe=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.runFaucetBtcRaw=function(e){try{if(null==e.address)throw new v("address","Required parameter requestParameters.address was null or undefined when calling runFaucetBtc.");var t={};return void 0!==e.address&&(t.address=e.address),Promise.resolve(this.request({path:"/extended/v1/faucets/btc",method:"POST",headers:{},query:t})).then(function(e){return new _(e,function(e){return ae(e)})})}catch(e){return Promise.reject(e)}},r.runFaucetBtc=function(e){try{return Promise.resolve(this.runFaucetBtcRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.runFaucetStxRaw=function(e){try{if(null==e.address)throw new v("address","Required parameter requestParameters.address was null or undefined when calling runFaucetStx.");var t={};return void 0!==e.address&&(t.address=e.address),Promise.resolve(this.request({path:"/extended/v1/faucets/stx",method:"POST",headers:{},query:t})).then(function(e){return new _(e,function(e){return ae(e)})})}catch(e){return Promise.reject(e)}},r.runFaucetStx=function(e){try{return Promise.resolve(this.runFaucetStxRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),me=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getFeeTransferRaw=function(){try{return Promise.resolve(this.request({path:"/v2/fees/transfer",method:"GET",headers:{},query:{}})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.getFeeTransfer=function(){try{return Promise.resolve(this.getFeeTransferRaw()).then(function(){})}catch(e){return Promise.reject(e)}},t}(m),ve=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getCoreApiInfoRaw=function(){try{return Promise.resolve(this.request({path:"/v2/info",method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return V(e)})})}catch(e){return Promise.reject(e)}},r.getCoreApiInfo=function(){try{return Promise.resolve(this.getCoreApiInfoRaw()).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimeByNetworkRaw=function(e){try{if(null==e.network)throw new v("network","Required parameter requestParameters.network was null or undefined when calling getNetworkBlockTimeByNetwork.");return Promise.resolve(this.request({path:"/extended/v1/info/network_block_time/{network}".replace("{network}",encodeURIComponent(String(e.network))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return Q(e)})})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimeByNetwork=function(e){try{return Promise.resolve(this.getNetworkBlockTimeByNetworkRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimesRaw=function(){try{return Promise.resolve(this.request({path:"/extended/v1/info/network_block_times",method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return Y(e)})})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimes=function(){try{return Promise.resolve(this.getNetworkBlockTimesRaw()).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getStatusRaw=function(){try{return Promise.resolve(this.request({path:"/extended/v1/status",method:"GET",headers:{},query:{}})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.getStatus=function(){try{return Promise.resolve(this.getStatusRaw()).then(function(){})}catch(e){return Promise.reject(e)}},t}(m);(fe=e.GetNetworkBlockTimeByNetworkNetworkEnum||(e.GetNetworkBlockTimeByNetworkNetworkEnum={})).testnet="testnet",fe.mainnet="mainnet";var ye=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.searchByIdRaw=function(e){try{if(null==e.id)throw new v("id","Required parameter requestParameters.id was null or undefined when calling searchById.");return Promise.resolve(this.request({path:"/extended/v1/search/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.searchById=function(e){try{return Promise.resolve(this.searchByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),we=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.callReadOnlyFunctionRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling callReadOnlyFunction.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling callReadOnlyFunction.");if(null==e.functionName)throw new v("functionName","Required parameter requestParameters.functionName was null or undefined when calling callReadOnlyFunction.");if(null==e.readOnlyFunctionArgs)throw new v("readOnlyFunctionArgs","Required parameter requestParameters.readOnlyFunctionArgs was null or undefined when calling callReadOnlyFunction.");return Promise.resolve(this.request({path:"/v2/contracts/call-read/{stacks_address}/{contract_name}/{function_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))).replace("{function_name}",encodeURIComponent(String(e.functionName))),method:"POST",headers:{"Content-Type":"application/json"},query:{},body:oe(e.readOnlyFunctionArgs)})).then(function(e){return new _(e,function(e){return ie(e)})})}catch(e){return Promise.reject(e)}},r.callReadOnlyFunction=function(e){try{return Promise.resolve(this.callReadOnlyFunctionRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractByIdRaw=function(e){try{if(null==e.contractId)throw new v("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractById.");return Promise.resolve(this.request({path:"/extended/v1/contract/{contract_id}".replace("{contract_id}",encodeURIComponent(String(e.contractId))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.getContractById=function(e){try{return Promise.resolve(this.getContractByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractDataMapEntryRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling getContractDataMapEntry.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractDataMapEntry.");if(null==e.mapName)throw new v("mapName","Required parameter requestParameters.mapName was null or undefined when calling getContractDataMapEntry.");if(null==e.key)throw new v("key","Required parameter requestParameters.key was null or undefined when calling getContractDataMapEntry.");var t={};return void 0!==e.proof&&(t.proof=e.proof),Promise.resolve(this.request({path:"/v2/map_entry/{stacks_address}/{contract_name}/{map_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))).replace("{map_name}",encodeURIComponent(String(e.mapName))),method:"POST",headers:{"Content-Type":"application/json"},query:t,body:e.key})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.getContractDataMapEntry=function(e){try{return Promise.resolve(this.getContractDataMapEntryRaw(e)).then(function(){})}catch(e){return Promise.reject(e)}},r.getContractEventsByIdRaw=function(e){try{if(null==e.contractId)throw new v("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractEventsById.");return Promise.resolve(this.request({path:"/extended/v1/contract/{contract_id}/events".replace("{contract_id}",encodeURIComponent(String(e.contractId))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.getContractEventsById=function(e){try{return Promise.resolve(this.getContractEventsByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractInterfaceRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling getContractInterface.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractInterface.");return Promise.resolve(this.request({path:"/v2/contracts/interface/{stacks_address}/{contract_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return G(e)})})}catch(e){return Promise.reject(e)}},r.getContractInterface=function(e){try{return Promise.resolve(this.getContractInterfaceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractSourceRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling getContractSource.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractSource.");var t={};return void 0!==e.proof&&(t.proof=e.proof),Promise.resolve(this.request({path:"/v2/contracts/source/{stacks_address}/{contract_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))),method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return W(e)})})}catch(e){return Promise.reject(e)}},r.getContractSource=function(e){try{return Promise.resolve(this.getContractSourceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),ge=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getMempoolTransactionListRaw=function(){try{return Promise.resolve(this.request({path:"/extended/v1/tx/mempool",method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return K(e)})})}catch(e){return Promise.reject(e)}},r.getMempoolTransactionList=function(){try{return Promise.resolve(this.getMempoolTransactionListRaw()).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getTransactionByIdRaw=function(e){try{if(null==e.txId)throw new v("txId","Required parameter requestParameters.txId was null or undefined when calling getTransactionById.");return Promise.resolve(this.request({path:"/extended/v1/tx/{tx_id}".replace("{tx_id}",encodeURIComponent(String(e.txId))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.getTransactionById=function(e){try{return Promise.resolve(this.getTransactionByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getTransactionListRaw=function(){try{return Promise.resolve(this.request({path:"/extended/v1/tx",method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return ue(e)})})}catch(e){return Promise.reject(e)}},r.getTransactionList=function(){try{return Promise.resolve(this.getTransactionListRaw()).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.postCoreNodeTransactionsRaw=function(e){try{return Promise.resolve(this.request({path:"/v2/transactions",method:"POST",headers:{"Content-Type":"text/plain"},query:{},body:e.body})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.postCoreNodeTransactions=function(e){try{return Promise.resolve(this.postCoreNodeTransactionsRaw(e)).then(function(){})}catch(e){return Promise.reject(e)}},t}(m);const _e=Object.prototype.hasOwnProperty,be="function"==typeof Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&e===Math.floor(e)&&Math.abs(e)<=9007199254740991};class ke{constructor(){this.jsonrpc="2.0"}serialize(){return JSON.stringify(this)}}ke.VERSION="2.0";class Pe extends ke{constructor(e,t,n){super(),this.id=e,this.method=t,void 0!==n&&(this.params=n)}}class Re extends ke{constructor(e,t){super(),this.method=e,void 0!==t&&(this.params=t)}}class Se extends ke{constructor(e,t){super(),this.id=e,this.result=t}}class Te extends ke{constructor(e,t){super(),this.id=e,this.error=t,this.id=e,this.error=t}}class qe{constructor(e,t){this.payload=e,this.type=t,this.payload=e,this.type=t}}class Ne{constructor(e,t,n){this.message=e,this.code=be(t)?t:0,null!=n&&(this.data=n)}}function Oe(e){let t=null,n=null,r="invalid";if(null==e||e.jsonrpc!==ke.VERSION)t=Ne.invalidRequest(e),r="invalid";else if(_e.call(e,"id")){if(_e.call(e,"method"))n=new Pe(e.id,e.method,e.params),t=Ae(n),r="request";else if(_e.call(e,"result"))n=new Se(e.id,e.result),t=Ae(n),r="success";else if(_e.call(e,"error")){const o=e;if(r="error",null==o.error)t=Ne.internalError(o);else{const e=new Ne(o.error.message,o.error.code,o.error.data);e.message!==o.error.message||e.code!==o.error.code?t=Ne.internalError(o):(n=new Te(o.id,e),t=Ae(n))}}}else n=new Re(e.method,e.params),t=Ae(n),r="notification";return null==t&&null!=n?new qe(n,r):new qe(null!=t?t:Ne.invalidRequest(e),"invalid")}function Ae(e,t){let n=null;if(e instanceof Pe?(n=xe(e.id),null==n&&(n=je(e.method)),null==n&&(n=Ce(e.params))):e instanceof Re?(n=je(e.method),null==n&&(n=Ce(e.params))):e instanceof Se?(n=xe(e.id),null==n&&(n=void 0===e.result?Ne.internalError("Result must exist for success Response objects"):null)):e instanceof Te&&(n=xe(e.id,!0),null==n&&(n=function(e){return e instanceof Ne?be(e.code)?Ie(e.message)?null:Ne.internalError("Message must exist or must be a string."):Ne.internalError("Invalid error code. It must be an integer."):Ne.internalError("Error must be an instance of JsonRpcError")}(e.error))),t&&null!=n)throw n;return n}function xe(e,t){return t&&null===e||Ie(e)||be(e)?null:Ne.internalError('"id" must be provided, a string or an integer.')}function je(e){return Ie(e)?null:Ne.invalidRequest(e)}function Ce(e){if(void 0===e)return null;if(Array.isArray(e)||null!=(t=e)&&"object"==typeof t&&!Array.isArray(t))try{return JSON.stringify(e),null}catch(t){return Ne.parseError(e)}var t;return Ne.invalidParams(e)}function Ie(e){return""!==e&&"string"==typeof e}Ne.invalidRequest=function(e){return new Ne("Invalid request",-32600,e)},Ne.methodNotFound=function(e){return new Ne("Method not found",-32601,e)},Ne.invalidParams=function(e){return new Ne("Invalid params",-32602,e)},Ne.internalError=function(e){return new Ne("Internal error",-32603,e)},Ne.parseError=function(e){return new Ne("Parse error",-32700,e)};var Be=function(e,t,n){return function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=this._events[n?n+e:e];if(!t)return[];if(t.fn)return[t.fn];for(var r=0,o=t.length,i=new Array(o);r<o;r++)i[r]=t[r].fn;return i},a.prototype.listenerCount=function(e){var t=this._events[n?n+e:e];return t?t.fn?1:t.length:0},a.prototype.emit=function(e,t,r,o,i,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,o),!0;case 5:return l.fn.call(l.context,t,r,o,i),!0;case 6:return l.fn.call(l.context,t,r,o,i,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var d,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,o);break;default:if(!c)for(d=1,c=new Array(f-1);d<f;d++)c[d-1]=arguments[d];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||r&&a.context!==r||s(this,i);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||o&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?this._events[t=n?n+e:e]&&s(this,t):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(n={path:void 0,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),n.exports}(),Fe=function(){function e(e){var t=this;this.idCursor=0,this.pendingRequests=new Map,this.eventEmitter=new Be.EventEmitter,this.webSocket=e,e.addEventListener("message",function(e){var n=function(e){if(!Ie(e))return new qe(Ne.invalidRequest(e),"invalid");let t;try{t=JSON.parse(e)}catch(t){return new qe(Ne.parseError(e),"invalid")}return function(e){if(!Array.isArray(e))return Oe(e);if(0===e.length)return new qe(Ne.invalidRequest(e),"invalid");const t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Oe(e[n]);return t}(t)}(e.data);(Array.isArray(n)?n:[n]).forEach(function(e){if("notification"===e.type)t.handleNotification(e.payload);else if("success"===e.type){var n=t.pendingRequests.get(e.payload.id);n&&(t.pendingRequests.delete(e.payload.id),n.resolve(e.payload.result))}else if("error"===e.type){var r=t.pendingRequests.get(e.payload.id);r&&(t.pendingRequests.delete(e.payload.id),r.reject(e.payload.error))}})})}e.connect=function(t){void 0===t&&(t=p);try{var n;try{n=new URL(t)}catch(e){n=new URL("ws://"+t)}return"https:"===n.protocol?n.protocol="wss:":"http:"===n.protocol&&(n.protocol="ws:"),"/"===n.pathname&&(n.pathname="/extended/v1/ws"),Promise.resolve(new Promise(function(e,t){var r=new("undefined"!=typeof WebSocket?WebSocket:"undefined"!=typeof global&&global.WebSocket?global.WebSocket:"undefined"!=typeof window&&window.WebSocket?window.WebSocket:"undefined"!=typeof self&&self.WebSocket?self.WebSocket:require("ws"))(n.toString());r.onopen=function(){return e(r)},r.onerror=function(e){return t(e)}})).then(function(t){return new e(t)})}catch(e){return Promise.reject(e)}};var t=e.prototype;return t.handleNotification=function(e){switch(e.method){case"tx_update":this.eventEmitter.emit("txUpdate",e.params);break;case"address_tx_update":this.eventEmitter.emit("addressTxUpdate",e.params);break;case"address_balance_update":this.eventEmitter.emit("addressBalanceUpdate",e.params)}},t.rpcCall=function(e,t){var n=this,r=function(e,t,n){const r=new Pe(e,t,n);return Ae(r,!0),r}(++this.idCursor,e,t);return new Promise(function(e,t){n.pendingRequests.set(r.id,{resolve:e,reject:t}),n.webSocket.send(r.serialize())})},t.subscribeTxUpdates=function(e,t){try{var n=this,r={event:"tx_update",tx_id:e};return Promise.resolve(n.rpcCall("subscribe",r)).then(function(e){var o=function(n){n.tx_id===e.tx_id&&t(n)};return n.eventEmitter.addListener("txUpdate",o),{unsubscribe:function(){return n.eventEmitter.removeListener("txUpdate",o),n.rpcCall("unsubscribe",r)}}})}catch(e){return Promise.reject(e)}},t.subscribeAddressTransactions=function(e,t){try{var n=this,r={event:"address_tx_update",address:e};return Promise.resolve(n.rpcCall("subscribe",r)).then(function(e){var o=function(n){n.address===e.address&&t(n)};return n.eventEmitter.addListener("addressTxUpdate",o),{unsubscribe:function(){return n.eventEmitter.removeListener("addressTxUpdate",o),n.rpcCall("unsubscribe",r)}}})}catch(e){return Promise.reject(e)}},t.subscribeAddressBalanceUpdates=function(e,t){try{var n=this,r={event:"address_balance_update",address:e};return Promise.resolve(n.rpcCall("subscribe",r)).then(function(e){var o=function(n){n.address===e.address&&t(n)};return n.eventEmitter.addListener("addressBalanceUpdate",o),{unsubscribe:function(){return n.eventEmitter.removeListener("addressBalanceUpdate",o),n.rpcCall("unsubscribe",r)}}})}catch(e){return Promise.reject(e)}},e}();e.AccountDataResponseFromJSON=R,e.AccountDataResponseFromJSONTyped=S,e.AccountDataResponseToJSON=function(e){if(void 0!==e)return null===e?null:{balance:e.balance,nonce:e.nonce,balance_proof:e.balance_proof,nonce_proof:e.nonce_proof}},e.AccountsApi=de,e.AddressAssetsListResponseFromJSON=T,e.AddressAssetsListResponseFromJSONTyped=q,e.AddressAssetsListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.AddressBalanceResponseFromJSON=N,e.AddressBalanceResponseFromJSONTyped=O,e.AddressBalanceResponseStxFromJSON=A,e.AddressBalanceResponseStxFromJSONTyped=x,e.AddressBalanceResponseStxToJSON=j,e.AddressBalanceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{stx:j(e.stx),fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}},e.AddressStxBalanceResponseFromJSON=C,e.AddressStxBalanceResponseFromJSONTyped=I,e.AddressStxBalanceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}},e.AddressTransactionsListResponseFromJSON=B,e.AddressTransactionsListResponseFromJSONTyped=F,e.AddressTransactionsListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.BASE_PATH=p,e.BaseAPI=m,e.BlobApiResponse=k,e.BlockFromJSON=E,e.BlockFromJSONTyped=J,e.BlockListResponseFromJSON=L,e.BlockListResponseFromJSONTyped=M,e.BlockListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results.map(U)}},e.BlockToJSON=U,e.BlocksApi=he,e.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:"\t",pipes:"|"},e.Configuration=y,e.ContractInterfaceResponseFromJSON=G,e.ContractInterfaceResponseFromJSONTyped=D,e.ContractInterfaceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{functions:e.functions,variables:e.variables,maps:e.maps,fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}},e.ContractSourceResponseFromJSON=W,e.ContractSourceResponseFromJSONTyped=H,e.ContractSourceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{source:e.source,publish_height:e.publish_height,proof:e.proof}},e.CoreNodeInfoResponseFromJSON=V,e.CoreNodeInfoResponseFromJSONTyped=z,e.CoreNodeInfoResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,peer_version:e.peer_version,burn_consensus:e.burn_consensus,burn_block_height:e.burn_block_height,stable_burn_consensus:e.stable_burn_consensus,stable_burn_block_height:e.stable_burn_block_height,server_version:e.server_version,network_id:e.network_id,parent_network_id:e.parent_network_id,stacks_tip_height:e.stacks_tip_height,stacks_tip:e.stacks_tip,stacks_tip_burn_block:e.stacks_tip_burn_block,exit_at_block_height:e.exit_at_block_height}},e.FaucetsApi=pe,e.FeesApi=me,e.InfoApi=ve,e.JSONApiResponse=_,e.MempoolTransactionListResponseFromJSON=K,e.MempoolTransactionListResponseFromJSONTyped=$,e.MempoolTransactionListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.NetworkBlockTimeResponseFromJSON=Q,e.NetworkBlockTimeResponseFromJSONTyped=X,e.NetworkBlockTimeResponseToJSON=function(e){if(void 0!==e)return null===e?null:{target_block_time:e.target_block_time}},e.NetworkBlockTimesResponseFromJSON=Y,e.NetworkBlockTimesResponseFromJSONTyped=Z,e.NetworkBlockTimesResponseMainnetFromJSON=ee,e.NetworkBlockTimesResponseMainnetFromJSONTyped=te,e.NetworkBlockTimesResponseMainnetToJSON=ne,e.NetworkBlockTimesResponseToJSON=function(e){if(void 0!==e)return null===e?null:{mainnet:ne(e.mainnet),testnet:ne(e.testnet)}},e.ReadOnlyFunctionArgsFromJSON=function(e){return re(e)},e.ReadOnlyFunctionArgsFromJSONTyped=re,e.ReadOnlyFunctionArgsToJSON=oe,e.ReadOnlyFunctionSuccessResponseFromJSON=ie,e.ReadOnlyFunctionSuccessResponseFromJSONTyped=se,e.ReadOnlyFunctionSuccessResponseToJSON=function(e){if(void 0!==e)return null===e?null:{okay:e.okay,result:e.result,cause:e.cause}},e.RequiredError=v,e.RunFaucetResponseFromJSON=ae,e.RunFaucetResponseFromJSONTyped=ce,e.RunFaucetResponseToJSON=function(e){if(void 0!==e)return null===e?null:{success:e.success,txId:e.txId,txRaw:e.txRaw}},e.SearchApi=ye,e.SmartContractsApi=we,e.StacksApiWebSocketClient=Fe,e.TextApiResponse=P,e.TransactionResultsFromJSON=ue,e.TransactionResultsFromJSONTyped=le,e.TransactionResultsToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.TransactionsApi=ge,e.VoidApiResponse=b,e.canConsumeForm=function(e){for(var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,void 0):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(t=n()).done;)if("multipart/form-data"===t.value.contentType)return!0;return!1},e.connectWebSocketClient=function(e){void 0===e&&(e=p);try{return Promise.resolve(Fe.connect(e))}catch(e){return Promise.reject(e)}},e.exists=w,e.mapValues=function(e,n){return Object.keys(e).reduce(function(r,o){var i;return t({},r,((i={})[o]=n(e[o]),i))},{})},e.querystring=g}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).StacksBlockchainApiClient={})}(this,function(e){function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function s(e,t,n){return(s=i()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return s(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,e)})(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function l(e,t,n){if(!e.s){if(n instanceof f){if(!n.s)return void(n.o=l.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(l.bind(null,e,t),l.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var f=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,o=this.s;if(o){var i=1&o?t:n;if(i){try{l(r,1,i(this.v))}catch(e){l(r,2,e)}return r}return this}return this.o=function(e){try{var o=e.v;1&e.s?l(r,1,t?t(o):o):n?l(r,1,n(o)):l(r,2,o)}catch(e){l(r,2,e)}},r},e}();function d(e){return e instanceof f&&1&e.s}function h(e,t,n){if("function"==typeof e[u]){var r,o,i,s=e[u]();if(function e(a){try{for(;!((r=s.next()).done||n&&n());)if((a=t(r.value))&&a.then){if(!d(a))return void a.then(e,i||(i=l.bind(null,o=new f,2)));a=a.v}o?l(o,1,a):o=a}catch(e){l(o||(o=new f),2,e)}}(),s.return){var a=function(e){try{r.done||s.return()}catch(e){}return e};if(o&&o.then)return o.then(a,function(e){throw a(e)});a()}return o}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],h=0;h<e.length;h++)c.push(e[h]);return function(e,t,n){var r,o,i=-1;return function s(a){try{for(;++i<e.length&&(!n||!n());)if((a=t(i))&&a.then){if(!d(a))return void a.then(s,o||(o=l.bind(null,r=new f,2)));a=a.v}r?l(r,1,a):r=a}catch(e){l(r||(r=new f),2,e)}}(),r}(c,function(e){return t(c[e])},n)}var p="https://stacks-node-api-latest.argon.blockstack.xyz".replace(/\/+$/,""),m=function(){function e(e){var n=this;void 0===e&&(e=new y),this.configuration=e,this.fetchApi=function(e,r){try{var o=function(){return Promise.resolve(n.configuration.fetchApi(i.url,i.init)).then(function(t){var o=h(n.middleware,function(o){var i=function(){if(o.post)return Promise.resolve(o.post({fetch:n.fetchApi,url:e,init:r,response:t.clone()})).then(function(e){t=e||t})}();if(i&&i.then)return i.then(function(){})});return o&&o.then?o.then(function(){return t}):t})},i={url:e,init:r},s=h(n.middleware,function(e){var r=function(){if(e.pre)return Promise.resolve(e.pre(t({fetch:n.fetchApi},i))).then(function(e){i=e||i})}();if(r&&r.then)return r.then(function(){})});return Promise.resolve(s&&s.then?s.then(o):o())}catch(e){return Promise.reject(e)}},this.middleware=e.middleware}var n=e.prototype;return n.withMiddleware=function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,[].slice.call(arguments)),t},n.withPreMiddleware=function(){var e=[].slice.call(arguments).map(function(e){return{pre:e}});return this.withMiddleware.apply(this,e)},n.withPostMiddleware=function(){var e=[].slice.call(arguments).map(function(e){return{post:e}});return this.withMiddleware.apply(this,e)},n.request=function(e){try{var t=this.createFetchParams(e);return Promise.resolve(this.fetchApi(t.url,t.init)).then(function(e){if(e.status>=200&&e.status<300)return e;throw e})}catch(e){return Promise.reject(e)}},n.createFetchParams=function(e){var t=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(t+="?"+this.configuration.queryParamsStringify(e.query));var n="undefined"!=typeof FormData&&e.body instanceof FormData||e.body instanceof URLSearchParams||"undefined"!=typeof Blob&&e.body instanceof Blob?e.body:JSON.stringify(e.body),r=Object.assign({},this.configuration.headers,e.headers);return{url:t,init:{method:e.method,headers:r,body:n,credentials:this.configuration.credentials}}},n.clone=function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e},e}(),v=function(e){function t(t,n){var r;return(r=e.call(this,n)||this).field=t,r.name="RequiredError",r}return n(t,e),t}(a(Error)),y=function(){function e(e){void 0===e&&(e={}),this.configuration=e}var t;return(t=[{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:p}},{key:"fetchApi",get:function(){return this.configuration.fetchApi||window.fetch.bind(window)}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||g}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this.configuration.accessToken;if(e)return"function"==typeof e?e:function(){return e}}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function w(e,t){return null!=e[t]}function g(e,t){return void 0===t&&(t=""),Object.keys(e).map(function(n){var r=t+(t.length?"["+n+"]":n),o=e[n];if(o instanceof Array){var i=o.map(function(e){return encodeURIComponent(String(e))}).join("&"+encodeURIComponent(r)+"=");return encodeURIComponent(r)+"="+i}return o instanceof Object?g(o,r):encodeURIComponent(r)+"="+encodeURIComponent(String(o))}).filter(function(e){return e.length>0}).join("&")}var _=function(){function e(e,t){void 0===t&&(t=function(e){return e}),this.raw=e,this.transformer=t}return e.prototype.value=function(){try{var e=this,t=e.transformer;return Promise.resolve(e.raw.json()).then(function(n){return t.call(e,n)})}catch(e){return Promise.reject(e)}},e}(),b=function(){function e(e){this.raw=e}return e.prototype.value=function(){return Promise.resolve(void 0)},e}(),k=function(){function e(e){this.raw=e}return e.prototype.value=function(){try{return Promise.resolve(this.raw.blob())}catch(e){return Promise.reject(e)}},e}(),P=function(){function e(e){this.raw=e}return e.prototype.value=function(){try{return Promise.resolve(this.raw.text())}catch(e){return Promise.reject(e)}},e}();function R(e){return S(e)}function S(e,t){return null==e?e:{balance:e.balance,nonce:e.nonce,balance_proof:e.balance_proof,nonce_proof:e.nonce_proof}}function T(e){return q(e)}function q(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}function N(e){return O(e)}function O(e,t){return null==e?e:{stx:A(e.stx),fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}}function A(e){return x(e)}function x(e,t){return null==e?e:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}}function j(e){if(void 0!==e)return null===e?null:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}}function C(e){return I(e)}function I(e,t){return null==e?e:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}}function B(e){return F(e)}function F(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}function E(e){return J(e)}function J(e,t){return null==e?e:{canonical:e.canonical,height:e.height,hash:e.hash,parent_block_hash:e.parent_block_hash,burn_block_time:e.burn_block_time,burn_block_time_iso:e.burn_block_time_iso,txs:e.txs}}function L(e){if(void 0!==e)return null===e?null:{canonical:e.canonical,height:e.height,hash:e.hash,parent_block_hash:e.parent_block_hash,burn_block_time:e.burn_block_time,burn_block_time_iso:e.burn_block_time_iso,txs:e.txs}}function U(e){return M(e)}function M(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results.map(E)}}function G(e){return D(e)}function D(e,t){return null==e?e:{functions:e.functions,variables:e.variables,maps:e.maps,fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}}function W(e){return H(e)}function H(e,t){return null==e?e:{source:e.source,publish_height:e.publish_height,proof:e.proof}}function V(e){return z(e)}function z(e,t){return null==e?e:{limit:w(e,"limit")?e.limit:void 0,peer_version:e.peer_version,burn_consensus:e.burn_consensus,burn_block_height:e.burn_block_height,stable_burn_consensus:e.stable_burn_consensus,stable_burn_block_height:e.stable_burn_block_height,server_version:e.server_version,network_id:e.network_id,parent_network_id:e.parent_network_id,stacks_tip_height:e.stacks_tip_height,stacks_tip:e.stacks_tip,stacks_tip_burn_block:e.stacks_tip_burn_block,exit_at_block_height:e.exit_at_block_height}}function K(e){return $(e)}function $(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}function Q(e){return X(e)}function X(e,t){return null==e?e:{target_block_time:e.target_block_time}}function Y(e){return Z(e)}function Z(e,t){return null==e?e:{mainnet:ee(e.mainnet),testnet:ee(e.testnet)}}function ee(e){return te(e)}function te(e,t){return null==e?e:{target_block_time:e.target_block_time}}function ne(e){if(void 0!==e)return null===e?null:{target_block_time:e.target_block_time}}function re(e,t){return null==e?e:{sender:e.sender,arguments:e.arguments}}function oe(e){if(void 0!==e)return null===e?null:{sender:e.sender,arguments:e.arguments}}function ie(e){return se(e)}function se(e,t){return null==e?e:{okay:e.okay,result:w(e,"result")?e.result:void 0,cause:w(e,"cause")?e.cause:void 0}}function ae(e){return ce(e)}function ce(e,t){return null==e?e:{success:e.success,txId:w(e,"txId")?e.txId:void 0,txRaw:w(e,"txRaw")?e.txRaw:void 0}}function ue(e){return le(e)}function le(e,t){return null==e?e:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}}var fe,de=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getAccountAssetsRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountAssets.");var t={};return void 0!==e.limit&&(t.limit=e.limit),void 0!==e.offset&&(t.offset=e.offset),Promise.resolve(this.request({path:"/extended/v1/address/{principal}/assets".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return T(e)})})}catch(e){return Promise.reject(e)}},r.getAccountAssets=function(e){try{return Promise.resolve(this.getAccountAssetsRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountBalanceRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountBalance.");return Promise.resolve(this.request({path:"/extended/v1/address/{principal}/balances".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return N(e)})})}catch(e){return Promise.reject(e)}},r.getAccountBalance=function(e){try{return Promise.resolve(this.getAccountBalanceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountInfoRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountInfo.");var t={};return void 0!==e.proof&&(t.proof=e.proof),Promise.resolve(this.request({path:"/v2/accounts/{principal}".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return R(e)})})}catch(e){return Promise.reject(e)}},r.getAccountInfo=function(e){try{return Promise.resolve(this.getAccountInfoRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountStxBalanceRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountStxBalance.");return Promise.resolve(this.request({path:"/extended/v1/address/{principal}/stx".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return C(e)})})}catch(e){return Promise.reject(e)}},r.getAccountStxBalance=function(e){try{return Promise.resolve(this.getAccountStxBalanceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getAccountTransactionsRaw=function(e){try{if(null==e.principal)throw new v("principal","Required parameter requestParameters.principal was null or undefined when calling getAccountTransactions.");var t={};return void 0!==e.limit&&(t.limit=e.limit),void 0!==e.offset&&(t.offset=e.offset),Promise.resolve(this.request({path:"/extended/v1/address/{principal}/transactions".replace("{principal}",encodeURIComponent(String(e.principal))),method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return B(e)})})}catch(e){return Promise.reject(e)}},r.getAccountTransactions=function(e){try{return Promise.resolve(this.getAccountTransactionsRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),he=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getBlockByHashRaw=function(e){try{if(null==e.blockHash)throw new v("blockHash","Required parameter requestParameters.blockHash was null or undefined when calling getBlockByHash.");return Promise.resolve(this.request({path:"/extended/v1/block/{block_hash}".replace("{block_hash}",encodeURIComponent(String(e.blockHash))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return E(e)})})}catch(e){return Promise.reject(e)}},r.getBlockByHash=function(e){try{return Promise.resolve(this.getBlockByHashRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getBlockListRaw=function(e){try{var t={};return void 0!==e.limit&&(t.limit=e.limit),void 0!==e.offset&&(t.offset=e.offset),Promise.resolve(this.request({path:"/extended/v1/block",method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return U(e)})})}catch(e){return Promise.reject(e)}},r.getBlockList=function(e){try{return Promise.resolve(this.getBlockListRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),pe=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.runFaucetBtcRaw=function(e){try{if(null==e.address)throw new v("address","Required parameter requestParameters.address was null or undefined when calling runFaucetBtc.");var t={};return void 0!==e.address&&(t.address=e.address),Promise.resolve(this.request({path:"/extended/v1/faucets/btc",method:"POST",headers:{},query:t})).then(function(e){return new _(e,function(e){return ae(e)})})}catch(e){return Promise.reject(e)}},r.runFaucetBtc=function(e){try{return Promise.resolve(this.runFaucetBtcRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.runFaucetStxRaw=function(e){try{if(null==e.address)throw new v("address","Required parameter requestParameters.address was null or undefined when calling runFaucetStx.");var t={};return void 0!==e.address&&(t.address=e.address),Promise.resolve(this.request({path:"/extended/v1/faucets/stx",method:"POST",headers:{},query:t})).then(function(e){return new _(e,function(e){return ae(e)})})}catch(e){return Promise.reject(e)}},r.runFaucetStx=function(e){try{return Promise.resolve(this.runFaucetStxRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),me=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getFeeTransferRaw=function(){try{return Promise.resolve(this.request({path:"/v2/fees/transfer",method:"GET",headers:{},query:{}})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.getFeeTransfer=function(){try{return Promise.resolve(this.getFeeTransferRaw()).then(function(){})}catch(e){return Promise.reject(e)}},t}(m),ve=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getCoreApiInfoRaw=function(){try{return Promise.resolve(this.request({path:"/v2/info",method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return V(e)})})}catch(e){return Promise.reject(e)}},r.getCoreApiInfo=function(){try{return Promise.resolve(this.getCoreApiInfoRaw()).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimeByNetworkRaw=function(e){try{if(null==e.network)throw new v("network","Required parameter requestParameters.network was null or undefined when calling getNetworkBlockTimeByNetwork.");return Promise.resolve(this.request({path:"/extended/v1/info/network_block_time/{network}".replace("{network}",encodeURIComponent(String(e.network))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return Q(e)})})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimeByNetwork=function(e){try{return Promise.resolve(this.getNetworkBlockTimeByNetworkRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimesRaw=function(){try{return Promise.resolve(this.request({path:"/extended/v1/info/network_block_times",method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return Y(e)})})}catch(e){return Promise.reject(e)}},r.getNetworkBlockTimes=function(){try{return Promise.resolve(this.getNetworkBlockTimesRaw()).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getStatusRaw=function(){try{return Promise.resolve(this.request({path:"/extended/v1/status",method:"GET",headers:{},query:{}})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.getStatus=function(){try{return Promise.resolve(this.getStatusRaw()).then(function(){})}catch(e){return Promise.reject(e)}},t}(m);(fe=e.GetNetworkBlockTimeByNetworkNetworkEnum||(e.GetNetworkBlockTimeByNetworkNetworkEnum={})).testnet="testnet",fe.mainnet="mainnet";var ye,we=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.searchByIdRaw=function(e){try{if(null==e.id)throw new v("id","Required parameter requestParameters.id was null or undefined when calling searchById.");return Promise.resolve(this.request({path:"/extended/v1/search/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.searchById=function(e){try{return Promise.resolve(this.searchByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),ge=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.callReadOnlyFunctionRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling callReadOnlyFunction.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling callReadOnlyFunction.");if(null==e.functionName)throw new v("functionName","Required parameter requestParameters.functionName was null or undefined when calling callReadOnlyFunction.");if(null==e.readOnlyFunctionArgs)throw new v("readOnlyFunctionArgs","Required parameter requestParameters.readOnlyFunctionArgs was null or undefined when calling callReadOnlyFunction.");return Promise.resolve(this.request({path:"/v2/contracts/call-read/{stacks_address}/{contract_name}/{function_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))).replace("{function_name}",encodeURIComponent(String(e.functionName))),method:"POST",headers:{"Content-Type":"application/json"},query:{},body:oe(e.readOnlyFunctionArgs)})).then(function(e){return new _(e,function(e){return ie(e)})})}catch(e){return Promise.reject(e)}},r.callReadOnlyFunction=function(e){try{return Promise.resolve(this.callReadOnlyFunctionRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractByIdRaw=function(e){try{if(null==e.contractId)throw new v("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractById.");return Promise.resolve(this.request({path:"/extended/v1/contract/{contract_id}".replace("{contract_id}",encodeURIComponent(String(e.contractId))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.getContractById=function(e){try{return Promise.resolve(this.getContractByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractDataMapEntryRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling getContractDataMapEntry.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractDataMapEntry.");if(null==e.mapName)throw new v("mapName","Required parameter requestParameters.mapName was null or undefined when calling getContractDataMapEntry.");if(null==e.key)throw new v("key","Required parameter requestParameters.key was null or undefined when calling getContractDataMapEntry.");var t={};return void 0!==e.proof&&(t.proof=e.proof),Promise.resolve(this.request({path:"/v2/map_entry/{stacks_address}/{contract_name}/{map_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))).replace("{map_name}",encodeURIComponent(String(e.mapName))),method:"POST",headers:{"Content-Type":"application/json"},query:t,body:e.key})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.getContractDataMapEntry=function(e){try{return Promise.resolve(this.getContractDataMapEntryRaw(e)).then(function(){})}catch(e){return Promise.reject(e)}},r.getContractEventsByIdRaw=function(e){try{if(null==e.contractId)throw new v("contractId","Required parameter requestParameters.contractId was null or undefined when calling getContractEventsById.");var t={};return void 0!==e.limit&&(t.limit=e.limit),void 0!==e.offset&&(t.offset=e.offset),Promise.resolve(this.request({path:"/extended/v1/contract/{contract_id}/events".replace("{contract_id}",encodeURIComponent(String(e.contractId))),method:"GET",headers:{},query:t})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.getContractEventsById=function(e){try{return Promise.resolve(this.getContractEventsByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractInterfaceRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling getContractInterface.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractInterface.");return Promise.resolve(this.request({path:"/v2/contracts/interface/{stacks_address}/{contract_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e,function(e){return G(e)})})}catch(e){return Promise.reject(e)}},r.getContractInterface=function(e){try{return Promise.resolve(this.getContractInterfaceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getContractSourceRaw=function(e){try{if(null==e.stacksAddress)throw new v("stacksAddress","Required parameter requestParameters.stacksAddress was null or undefined when calling getContractSource.");if(null==e.contractName)throw new v("contractName","Required parameter requestParameters.contractName was null or undefined when calling getContractSource.");var t={};return void 0!==e.proof&&(t.proof=e.proof),Promise.resolve(this.request({path:"/v2/contracts/source/{stacks_address}/{contract_name}".replace("{stacks_address}",encodeURIComponent(String(e.stacksAddress))).replace("{contract_name}",encodeURIComponent(String(e.contractName))),method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return W(e)})})}catch(e){return Promise.reject(e)}},r.getContractSource=function(e){try{return Promise.resolve(this.getContractSourceRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},t}(m),_e=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getMempoolTransactionListRaw=function(e){try{var t={};return void 0!==e.limit&&(t.limit=e.limit),void 0!==e.offset&&(t.offset=e.offset),Promise.resolve(this.request({path:"/extended/v1/tx/mempool",method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return K(e)})})}catch(e){return Promise.reject(e)}},r.getMempoolTransactionList=function(e){try{return Promise.resolve(this.getMempoolTransactionListRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getTransactionByIdRaw=function(e){try{if(null==e.txId)throw new v("txId","Required parameter requestParameters.txId was null or undefined when calling getTransactionById.");return Promise.resolve(this.request({path:"/extended/v1/tx/{tx_id}".replace("{tx_id}",encodeURIComponent(String(e.txId))),method:"GET",headers:{},query:{}})).then(function(e){return new _(e)})}catch(e){return Promise.reject(e)}},r.getTransactionById=function(e){try{return Promise.resolve(this.getTransactionByIdRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.getTransactionListRaw=function(e){try{var t={};return void 0!==e.limit&&(t.limit=e.limit),void 0!==e.offset&&(t.offset=e.offset),e.type&&(t.type=e.type),Promise.resolve(this.request({path:"/extended/v1/tx",method:"GET",headers:{},query:t})).then(function(e){return new _(e,function(e){return ue(e)})})}catch(e){return Promise.reject(e)}},r.getTransactionList=function(e){try{return Promise.resolve(this.getTransactionListRaw(e)).then(function(e){return Promise.resolve(e.value())})}catch(e){return Promise.reject(e)}},r.postCoreNodeTransactionsRaw=function(e){try{return Promise.resolve(this.request({path:"/v2/transactions",method:"POST",headers:{"Content-Type":"text/plain"},query:{},body:e.body})).then(function(e){return new b(e)})}catch(e){return Promise.reject(e)}},r.postCoreNodeTransactions=function(e){try{return Promise.resolve(this.postCoreNodeTransactionsRaw(e)).then(function(){})}catch(e){return Promise.reject(e)}},t}(m);(ye=e.GetTransactionListTypeEnum||(e.GetTransactionListTypeEnum={})).coinbase="coinbase",ye.token_transfer="token_transfer",ye.smart_contract="smart_contract",ye.contract_call="contract_call",ye.poison_microblock="poison_microblock";const be=Object.prototype.hasOwnProperty,ke="function"==typeof Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&e===Math.floor(e)&&Math.abs(e)<=9007199254740991};class Pe{constructor(){this.jsonrpc="2.0"}serialize(){return JSON.stringify(this)}}Pe.VERSION="2.0";class Re extends Pe{constructor(e,t,n){super(),this.id=e,this.method=t,void 0!==n&&(this.params=n)}}class Se extends Pe{constructor(e,t){super(),this.method=e,void 0!==t&&(this.params=t)}}class Te extends Pe{constructor(e,t){super(),this.id=e,this.result=t}}class qe extends Pe{constructor(e,t){super(),this.id=e,this.error=t,this.id=e,this.error=t}}class Ne{constructor(e,t){this.payload=e,this.type=t,this.payload=e,this.type=t}}class Oe{constructor(e,t,n){this.message=e,this.code=ke(t)?t:0,null!=n&&(this.data=n)}}function Ae(e){let t=null,n=null,r="invalid";if(null==e||e.jsonrpc!==Pe.VERSION)t=Oe.invalidRequest(e),r="invalid";else if(be.call(e,"id")){if(be.call(e,"method"))n=new Re(e.id,e.method,e.params),t=xe(n),r="request";else if(be.call(e,"result"))n=new Te(e.id,e.result),t=xe(n),r="success";else if(be.call(e,"error")){const o=e;if(r="error",null==o.error)t=Oe.internalError(o);else{const e=new Oe(o.error.message,o.error.code,o.error.data);e.message!==o.error.message||e.code!==o.error.code?t=Oe.internalError(o):(n=new qe(o.id,e),t=xe(n))}}}else n=new Se(e.method,e.params),t=xe(n),r="notification";return null==t&&null!=n?new Ne(n,r):new Ne(null!=t?t:Oe.invalidRequest(e),"invalid")}function xe(e,t){let n=null;if(e instanceof Re?(n=je(e.id),null==n&&(n=Ce(e.method)),null==n&&(n=Ie(e.params))):e instanceof Se?(n=Ce(e.method),null==n&&(n=Ie(e.params))):e instanceof Te?(n=je(e.id),null==n&&(n=void 0===e.result?Oe.internalError("Result must exist for success Response objects"):null)):e instanceof qe&&(n=je(e.id,!0),null==n&&(n=function(e){return e instanceof Oe?ke(e.code)?Be(e.message)?null:Oe.internalError("Message must exist or must be a string."):Oe.internalError("Invalid error code. It must be an integer."):Oe.internalError("Error must be an instance of JsonRpcError")}(e.error))),t&&null!=n)throw n;return n}function je(e,t){return t&&null===e||Be(e)||ke(e)?null:Oe.internalError('"id" must be provided, a string or an integer.')}function Ce(e){return Be(e)?null:Oe.invalidRequest(e)}function Ie(e){if(void 0===e)return null;if(Array.isArray(e)||null!=(t=e)&&"object"==typeof t&&!Array.isArray(t))try{return JSON.stringify(e),null}catch(t){return Oe.parseError(e)}var t;return Oe.invalidParams(e)}function Be(e){return""!==e&&"string"==typeof e}Oe.invalidRequest=function(e){return new Oe("Invalid request",-32600,e)},Oe.methodNotFound=function(e){return new Oe("Method not found",-32601,e)},Oe.invalidParams=function(e){return new Oe("Invalid params",-32602,e)},Oe.internalError=function(e){return new Oe("Internal error",-32603,e)},Oe.parseError=function(e){return new Oe("Parse error",-32700,e)};var Fe=function(e,t,n){return function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=this._events[n?n+e:e];if(!t)return[];if(t.fn)return[t.fn];for(var r=0,o=t.length,i=new Array(o);r<o;r++)i[r]=t[r].fn;return i},a.prototype.listenerCount=function(e){var t=this._events[n?n+e:e];return t?t.fn?1:t.length:0},a.prototype.emit=function(e,t,r,o,i,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,o),!0;case 5:return l.fn.call(l.context,t,r,o,i),!0;case 6:return l.fn.call(l.context,t,r,o,i,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var d,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,o);break;default:if(!c)for(d=1,c=new Array(f-1);d<f;d++)c[d-1]=arguments[d];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||r&&a.context!==r||s(this,i);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||o&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?this._events[t=n?n+e:e]&&s(this,t):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(n={path:void 0,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),n.exports}(),Ee=function(){function e(e){var t=this;this.idCursor=0,this.pendingRequests=new Map,this.eventEmitter=new Fe.EventEmitter,this.webSocket=e,e.addEventListener("message",function(e){var n=function(e){if(!Be(e))return new Ne(Oe.invalidRequest(e),"invalid");let t;try{t=JSON.parse(e)}catch(t){return new Ne(Oe.parseError(e),"invalid")}return function(e){if(!Array.isArray(e))return Ae(e);if(0===e.length)return new Ne(Oe.invalidRequest(e),"invalid");const t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ae(e[n]);return t}(t)}(e.data);(Array.isArray(n)?n:[n]).forEach(function(e){if("notification"===e.type)t.handleNotification(e.payload);else if("success"===e.type){var n=t.pendingRequests.get(e.payload.id);n&&(t.pendingRequests.delete(e.payload.id),n.resolve(e.payload.result))}else if("error"===e.type){var r=t.pendingRequests.get(e.payload.id);r&&(t.pendingRequests.delete(e.payload.id),r.reject(e.payload.error))}})})}e.connect=function(t){void 0===t&&(t=p);try{var n;try{n=new URL(t)}catch(e){n=new URL("ws://"+t)}return"https:"===n.protocol?n.protocol="wss:":"http:"===n.protocol&&(n.protocol="ws:"),"/"===n.pathname&&(n.pathname="/extended/v1/ws"),Promise.resolve(new Promise(function(e,t){var r=new("undefined"!=typeof WebSocket?WebSocket:"undefined"!=typeof global&&global.WebSocket?global.WebSocket:"undefined"!=typeof window&&window.WebSocket?window.WebSocket:"undefined"!=typeof self&&self.WebSocket?self.WebSocket:require("ws"))(n.toString());r.onopen=function(){return e(r)},r.onerror=function(e){return t(e)}})).then(function(t){return new e(t)})}catch(e){return Promise.reject(e)}};var t=e.prototype;return t.handleNotification=function(e){switch(e.method){case"tx_update":this.eventEmitter.emit("txUpdate",e.params);break;case"address_tx_update":this.eventEmitter.emit("addressTxUpdate",e.params);break;case"address_balance_update":this.eventEmitter.emit("addressBalanceUpdate",e.params)}},t.rpcCall=function(e,t){var n=this,r=function(e,t,n){const r=new Re(e,t,n);return xe(r,!0),r}(++this.idCursor,e,t);return new Promise(function(e,t){n.pendingRequests.set(r.id,{resolve:e,reject:t}),n.webSocket.send(r.serialize())})},t.subscribeTxUpdates=function(e,t){try{var n=this,r={event:"tx_update",tx_id:e};return Promise.resolve(n.rpcCall("subscribe",r)).then(function(e){var o=function(n){n.tx_id===e.tx_id&&t(n)};return n.eventEmitter.addListener("txUpdate",o),{unsubscribe:function(){return n.eventEmitter.removeListener("txUpdate",o),n.rpcCall("unsubscribe",r)}}})}catch(e){return Promise.reject(e)}},t.subscribeAddressTransactions=function(e,t){try{var n=this,r={event:"address_tx_update",address:e};return Promise.resolve(n.rpcCall("subscribe",r)).then(function(e){var o=function(n){n.address===e.address&&t(n)};return n.eventEmitter.addListener("addressTxUpdate",o),{unsubscribe:function(){return n.eventEmitter.removeListener("addressTxUpdate",o),n.rpcCall("unsubscribe",r)}}})}catch(e){return Promise.reject(e)}},t.subscribeAddressBalanceUpdates=function(e,t){try{var n=this,r={event:"address_balance_update",address:e};return Promise.resolve(n.rpcCall("subscribe",r)).then(function(e){var o=function(n){n.address===e.address&&t(n)};return n.eventEmitter.addListener("addressBalanceUpdate",o),{unsubscribe:function(){return n.eventEmitter.removeListener("addressBalanceUpdate",o),n.rpcCall("unsubscribe",r)}}})}catch(e){return Promise.reject(e)}},e}();e.AccountDataResponseFromJSON=R,e.AccountDataResponseFromJSONTyped=S,e.AccountDataResponseToJSON=function(e){if(void 0!==e)return null===e?null:{balance:e.balance,nonce:e.nonce,balance_proof:e.balance_proof,nonce_proof:e.nonce_proof}},e.AccountsApi=de,e.AddressAssetsListResponseFromJSON=T,e.AddressAssetsListResponseFromJSONTyped=q,e.AddressAssetsListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.AddressBalanceResponseFromJSON=N,e.AddressBalanceResponseFromJSONTyped=O,e.AddressBalanceResponseStxFromJSON=A,e.AddressBalanceResponseStxFromJSONTyped=x,e.AddressBalanceResponseStxToJSON=j,e.AddressBalanceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{stx:j(e.stx),fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}},e.AddressStxBalanceResponseFromJSON=C,e.AddressStxBalanceResponseFromJSONTyped=I,e.AddressStxBalanceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{balance:e.balance,total_sent:e.total_sent,total_received:e.total_received}},e.AddressTransactionsListResponseFromJSON=B,e.AddressTransactionsListResponseFromJSONTyped=F,e.AddressTransactionsListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.BASE_PATH=p,e.BaseAPI=m,e.BlobApiResponse=k,e.BlockFromJSON=E,e.BlockFromJSONTyped=J,e.BlockListResponseFromJSON=U,e.BlockListResponseFromJSONTyped=M,e.BlockListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results.map(L)}},e.BlockToJSON=L,e.BlocksApi=he,e.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:"\t",pipes:"|"},e.Configuration=y,e.ContractInterfaceResponseFromJSON=G,e.ContractInterfaceResponseFromJSONTyped=D,e.ContractInterfaceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{functions:e.functions,variables:e.variables,maps:e.maps,fungible_tokens:e.fungible_tokens,non_fungible_tokens:e.non_fungible_tokens}},e.ContractSourceResponseFromJSON=W,e.ContractSourceResponseFromJSONTyped=H,e.ContractSourceResponseToJSON=function(e){if(void 0!==e)return null===e?null:{source:e.source,publish_height:e.publish_height,proof:e.proof}},e.CoreNodeInfoResponseFromJSON=V,e.CoreNodeInfoResponseFromJSONTyped=z,e.CoreNodeInfoResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,peer_version:e.peer_version,burn_consensus:e.burn_consensus,burn_block_height:e.burn_block_height,stable_burn_consensus:e.stable_burn_consensus,stable_burn_block_height:e.stable_burn_block_height,server_version:e.server_version,network_id:e.network_id,parent_network_id:e.parent_network_id,stacks_tip_height:e.stacks_tip_height,stacks_tip:e.stacks_tip,stacks_tip_burn_block:e.stacks_tip_burn_block,exit_at_block_height:e.exit_at_block_height}},e.FaucetsApi=pe,e.FeesApi=me,e.InfoApi=ve,e.JSONApiResponse=_,e.MempoolTransactionListResponseFromJSON=K,e.MempoolTransactionListResponseFromJSONTyped=$,e.MempoolTransactionListResponseToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.NetworkBlockTimeResponseFromJSON=Q,e.NetworkBlockTimeResponseFromJSONTyped=X,e.NetworkBlockTimeResponseToJSON=function(e){if(void 0!==e)return null===e?null:{target_block_time:e.target_block_time}},e.NetworkBlockTimesResponseFromJSON=Y,e.NetworkBlockTimesResponseFromJSONTyped=Z,e.NetworkBlockTimesResponseMainnetFromJSON=ee,e.NetworkBlockTimesResponseMainnetFromJSONTyped=te,e.NetworkBlockTimesResponseMainnetToJSON=ne,e.NetworkBlockTimesResponseToJSON=function(e){if(void 0!==e)return null===e?null:{mainnet:ne(e.mainnet),testnet:ne(e.testnet)}},e.ReadOnlyFunctionArgsFromJSON=function(e){return re(e)},e.ReadOnlyFunctionArgsFromJSONTyped=re,e.ReadOnlyFunctionArgsToJSON=oe,e.ReadOnlyFunctionSuccessResponseFromJSON=ie,e.ReadOnlyFunctionSuccessResponseFromJSONTyped=se,e.ReadOnlyFunctionSuccessResponseToJSON=function(e){if(void 0!==e)return null===e?null:{okay:e.okay,result:e.result,cause:e.cause}},e.RequiredError=v,e.RunFaucetResponseFromJSON=ae,e.RunFaucetResponseFromJSONTyped=ce,e.RunFaucetResponseToJSON=function(e){if(void 0!==e)return null===e?null:{success:e.success,txId:e.txId,txRaw:e.txRaw}},e.SearchApi=we,e.SmartContractsApi=ge,e.StacksApiWebSocketClient=Ee,e.TextApiResponse=P,e.TransactionResultsFromJSON=ue,e.TransactionResultsFromJSONTyped=le,e.TransactionResultsToJSON=function(e){if(void 0!==e)return null===e?null:{limit:e.limit,offset:e.offset,total:e.total,results:e.results}},e.TransactionsApi=_e,e.VoidApiResponse=b,e.canConsumeForm=function(e){for(var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,void 0):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(t=n()).done;)if("multipart/form-data"===t.value.contentType)return!0;return!1},e.connectWebSocketClient=function(e){void 0===e&&(e=p);try{return Promise.resolve(Ee.connect(e))}catch(e){return Promise.reject(e)}},e.exists=w,e.mapValues=function(e,n){return Object.keys(e).reduce(function(r,o){var i;return t({},r,((i={})[o]=n(e[o]),i))},{})},e.querystring=g}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@stacks/blockchain-api-client", | ||
"version": "0.14.2", | ||
"version": "0.14.3", | ||
"access": "public", | ||
@@ -5,0 +5,0 @@ "description": "Client for the Stacks Blockchain API", |
@@ -37,2 +37,4 @@ /* tslint:disable */ | ||
principal: string; | ||
limit?: number; | ||
offset?: number; | ||
} | ||
@@ -55,2 +57,4 @@ | ||
principal: string; | ||
limit?: number; | ||
offset?: number; | ||
} | ||
@@ -73,2 +77,10 @@ | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
@@ -200,2 +212,10 @@ | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
@@ -202,0 +222,0 @@ |
@@ -53,2 +53,4 @@ /* tslint:disable */ | ||
contractId: string; | ||
limit?: number; | ||
offset?: number; | ||
} | ||
@@ -212,2 +214,10 @@ | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
@@ -214,0 +224,0 @@ |
@@ -26,2 +26,7 @@ /* tslint:disable */ | ||
export interface GetMempoolTransactionListRequest { | ||
limit?: number; | ||
offset?: number; | ||
} | ||
export interface GetTransactionByIdRequest { | ||
@@ -31,2 +36,8 @@ txId: string; | ||
export interface GetTransactionListRequest { | ||
limit?: number; | ||
offset?: number; | ||
type?: Array<GetTransactionListTypeEnum>; | ||
} | ||
export interface PostCoreNodeTransactionsRequest { | ||
@@ -45,5 +56,13 @@ body?: string; | ||
*/ | ||
async getMempoolTransactionListRaw(): Promise<runtime.ApiResponse<MempoolTransactionListResponse>> { | ||
async getMempoolTransactionListRaw(requestParameters: GetMempoolTransactionListRequest): Promise<runtime.ApiResponse<MempoolTransactionListResponse>> { | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
@@ -65,4 +84,4 @@ | ||
*/ | ||
async getMempoolTransactionList(): Promise<MempoolTransactionListResponse> { | ||
const response = await this.getMempoolTransactionListRaw(); | ||
async getMempoolTransactionList(requestParameters: GetMempoolTransactionListRequest): Promise<MempoolTransactionListResponse> { | ||
const response = await this.getMempoolTransactionListRaw(requestParameters); | ||
return await response.value(); | ||
@@ -107,5 +126,17 @@ } | ||
*/ | ||
async getTransactionListRaw(): Promise<runtime.ApiResponse<TransactionResults>> { | ||
async getTransactionListRaw(requestParameters: GetTransactionListRequest): Promise<runtime.ApiResponse<TransactionResults>> { | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
if (requestParameters.limit !== undefined) { | ||
queryParameters['limit'] = requestParameters.limit; | ||
} | ||
if (requestParameters.offset !== undefined) { | ||
queryParameters['offset'] = requestParameters.offset; | ||
} | ||
if (requestParameters.type) { | ||
queryParameters['type'] = requestParameters.type; | ||
} | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
@@ -127,4 +158,4 @@ | ||
*/ | ||
async getTransactionList(): Promise<TransactionResults> { | ||
const response = await this.getTransactionListRaw(); | ||
async getTransactionList(requestParameters: GetTransactionListRequest): Promise<TransactionResults> { | ||
const response = await this.getTransactionListRaw(requestParameters); | ||
return await response.value(); | ||
@@ -164,1 +195,13 @@ } | ||
} | ||
/** | ||
* @export | ||
* @enum {string} | ||
*/ | ||
export enum GetTransactionListTypeEnum { | ||
coinbase = 'coinbase', | ||
token_transfer = 'token_transfer', | ||
smart_contract = 'smart_contract', | ||
contract_call = 'contract_call', | ||
poison_microblock = 'poison_microblock' | ||
} |
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
820959
7695