@stacks/network
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -11,2 +11,3 @@ import { inheritsLoose as _inheritsLoose } from './_virtual/_rollupPluginBabelHelpers.js'; | ||
this.coreApiUrl = 'https://stacks-node-api.mainnet.stacks.co'; | ||
this.bnsLookupUrl = 'https://core.blockstack.org'; | ||
this.broadcastEndpoint = '/v2/transactions'; | ||
@@ -62,3 +63,3 @@ this.transferFeeEstimateEndpoint = '/v2/fees/transfer'; | ||
_proto.getNameInfo = function getNameInfo(fullyQualifiedName) { | ||
var nameLookupURL = this.coreApiUrl + "/v1/names/" + fullyQualifiedName; | ||
var nameLookupURL = this.bnsLookupUrl + "/v1/names/" + fullyQualifiedName; | ||
return fetchPrivate(nameLookupURL).then(function (resp) { | ||
@@ -65,0 +66,0 @@ if (resp.status === 404) { |
@@ -20,2 +20,3 @@ 'use strict'; | ||
this.coreApiUrl = 'https://stacks-node-api.mainnet.stacks.co'; | ||
this.bnsLookupUrl = 'https://core.blockstack.org'; | ||
this.broadcastEndpoint = '/v2/transactions'; | ||
@@ -71,3 +72,3 @@ this.transferFeeEstimateEndpoint = '/v2/fees/transfer'; | ||
_proto.getNameInfo = function getNameInfo(fullyQualifiedName) { | ||
var nameLookupURL = this.coreApiUrl + "/v1/names/" + fullyQualifiedName; | ||
var nameLookupURL = this.bnsLookupUrl + "/v1/names/" + fullyQualifiedName; | ||
return common.fetchPrivate(nameLookupURL).then(function (resp) { | ||
@@ -74,0 +75,0 @@ if (resp.status === 404) { |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@stacks/common");function n(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var r=function(){function n(){var n=this;this.version=t.TransactionVersion.Mainnet,this.chainId=t.ChainID.Mainnet,this.coreApiUrl="https://stacks-node-api.mainnet.stacks.co",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=function(){return n.version===t.TransactionVersion.Mainnet},this.getBroadcastApiUrl=function(){return""+n.coreApiUrl+n.broadcastEndpoint},this.getTransferFeeEstimateApiUrl=function(){return""+n.coreApiUrl+n.transferFeeEstimateEndpoint},this.getAccountApiUrl=function(t){return""+n.coreApiUrl+n.accountEndpoint+"/"+t+"?proof=0"},this.getAbiApiUrl=function(t,r){return""+n.coreApiUrl+n.contractAbiEndpoint+"/"+t+"/"+r},this.getReadOnlyFunctionCallApiUrl=function(t,r,e){return""+n.coreApiUrl+n.readOnlyFunctionCallEndpoint+"/"+t+"/"+r+"/"+encodeURIComponent(e)},this.getInfoUrl=function(){return n.coreApiUrl+"/v2/info"},this.getBlockTimeInfoUrl=function(){return n.coreApiUrl+"/extended/v1/info/network_block_times"},this.getPoxInfoUrl=function(){return n.coreApiUrl+"/v2/pox"},this.getStackerInfoUrl=function(t,r){return""+n.coreApiUrl+n.readOnlyFunctionCallEndpoint+"\n "+t+"/"+r+"/get-stacker-info"}}return n.prototype.getNameInfo=function(n){return t.fetchPrivate(this.coreApiUrl+"/v1/names/"+n).then((function(t){if(404===t.status)throw new Error("Name not found");if(200!==t.status)throw new Error("Bad response status: "+t.status);return t.json()})).then((function(t){return t.address?Object.assign({},t,{address:t.address}):t}))},n}(),e=function(r){function e(){var n;return(n=r.apply(this,arguments)||this).version=t.TransactionVersion.Testnet,n.chainId=t.ChainID.Testnet,n.coreApiUrl="https://stacks-node-api.testnet.stacks.co",n}return n(e,r),e}(r),o=function(r){function e(){var n;return(n=r.apply(this,arguments)||this).version=t.TransactionVersion.Testnet,n.chainId=t.ChainID.Testnet,n.coreApiUrl="http://localhost:3999",n}return n(e,r),e}(r);exports.StacksMainnet=r,exports.StacksMocknet=o,exports.StacksTestnet=e; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@stacks/common");function n(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var r=function(){function n(){var n=this;this.version=t.TransactionVersion.Mainnet,this.chainId=t.ChainID.Mainnet,this.coreApiUrl="https://stacks-node-api.mainnet.stacks.co",this.bnsLookupUrl="https://core.blockstack.org",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=function(){return n.version===t.TransactionVersion.Mainnet},this.getBroadcastApiUrl=function(){return""+n.coreApiUrl+n.broadcastEndpoint},this.getTransferFeeEstimateApiUrl=function(){return""+n.coreApiUrl+n.transferFeeEstimateEndpoint},this.getAccountApiUrl=function(t){return""+n.coreApiUrl+n.accountEndpoint+"/"+t+"?proof=0"},this.getAbiApiUrl=function(t,r){return""+n.coreApiUrl+n.contractAbiEndpoint+"/"+t+"/"+r},this.getReadOnlyFunctionCallApiUrl=function(t,r,e){return""+n.coreApiUrl+n.readOnlyFunctionCallEndpoint+"/"+t+"/"+r+"/"+encodeURIComponent(e)},this.getInfoUrl=function(){return n.coreApiUrl+"/v2/info"},this.getBlockTimeInfoUrl=function(){return n.coreApiUrl+"/extended/v1/info/network_block_times"},this.getPoxInfoUrl=function(){return n.coreApiUrl+"/v2/pox"},this.getStackerInfoUrl=function(t,r){return""+n.coreApiUrl+n.readOnlyFunctionCallEndpoint+"\n "+t+"/"+r+"/get-stacker-info"}}return n.prototype.getNameInfo=function(n){return t.fetchPrivate(this.bnsLookupUrl+"/v1/names/"+n).then((function(t){if(404===t.status)throw new Error("Name not found");if(200!==t.status)throw new Error("Bad response status: "+t.status);return t.json()})).then((function(t){return t.address?Object.assign({},t,{address:t.address}):t}))},n}(),e=function(r){function e(){var n;return(n=r.apply(this,arguments)||this).version=t.TransactionVersion.Testnet,n.chainId=t.ChainID.Testnet,n.coreApiUrl="https://stacks-node-api.testnet.stacks.co",n}return n(e,r),e}(r),o=function(r){function e(){var n;return(n=r.apply(this,arguments)||this).version=t.TransactionVersion.Testnet,n.chainId=t.ChainID.Testnet,n.coreApiUrl="http://localhost:3999",n}return n(e,r),e}(r);exports.StacksMainnet=r,exports.StacksMocknet=o,exports.StacksTestnet=e; | ||
//# sourceMappingURL=network.cjs.production.min.js.map |
@@ -20,2 +20,3 @@ (function (global, factory) { | ||
this.coreApiUrl = 'https://stacks-node-api.mainnet.stacks.co'; | ||
this.bnsLookupUrl = 'https://core.blockstack.org'; | ||
this.broadcastEndpoint = '/v2/transactions'; | ||
@@ -71,3 +72,3 @@ this.transferFeeEstimateEndpoint = '/v2/fees/transfer'; | ||
_proto.getNameInfo = function getNameInfo(fullyQualifiedName) { | ||
var nameLookupURL = this.coreApiUrl + "/v1/names/" + fullyQualifiedName; | ||
var nameLookupURL = this.bnsLookupUrl + "/v1/names/" + fullyQualifiedName; | ||
return common.fetchPrivate(nameLookupURL).then(function (resp) { | ||
@@ -74,0 +75,0 @@ if (resp.status === 404) { |
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@stacks/common")):"function"==typeof define&&define.amd?define(["exports","@stacks/common"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self)["@stacks/network"]={},t.common)}(this,(function(t,n){"use strict";function e(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var r=function(){function t(){var t=this;this.version=n.TransactionVersion.Mainnet,this.chainId=n.ChainID.Mainnet,this.coreApiUrl="https://stacks-node-api.mainnet.stacks.co",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=function(){return t.version===n.TransactionVersion.Mainnet},this.getBroadcastApiUrl=function(){return""+t.coreApiUrl+t.broadcastEndpoint},this.getTransferFeeEstimateApiUrl=function(){return""+t.coreApiUrl+t.transferFeeEstimateEndpoint},this.getAccountApiUrl=function(n){return""+t.coreApiUrl+t.accountEndpoint+"/"+n+"?proof=0"},this.getAbiApiUrl=function(n,e){return""+t.coreApiUrl+t.contractAbiEndpoint+"/"+n+"/"+e},this.getReadOnlyFunctionCallApiUrl=function(n,e,r){return""+t.coreApiUrl+t.readOnlyFunctionCallEndpoint+"/"+n+"/"+e+"/"+encodeURIComponent(r)},this.getInfoUrl=function(){return t.coreApiUrl+"/v2/info"},this.getBlockTimeInfoUrl=function(){return t.coreApiUrl+"/extended/v1/info/network_block_times"},this.getPoxInfoUrl=function(){return t.coreApiUrl+"/v2/pox"},this.getStackerInfoUrl=function(n,e){return""+t.coreApiUrl+t.readOnlyFunctionCallEndpoint+"\n "+n+"/"+e+"/get-stacker-info"}}return t.prototype.getNameInfo=function(t){return n.fetchPrivate(this.coreApiUrl+"/v1/names/"+t).then((function(t){if(404===t.status)throw new Error("Name not found");if(200!==t.status)throw new Error("Bad response status: "+t.status);return t.json()})).then((function(t){return t.address?Object.assign({},t,{address:t.address}):t}))},t}(),o=function(t){function r(){var e;return(e=t.apply(this,arguments)||this).version=n.TransactionVersion.Testnet,e.chainId=n.ChainID.Testnet,e.coreApiUrl="https://stacks-node-api.testnet.stacks.co",e}return e(r,t),r}(r),i=function(t){function r(){var e;return(e=t.apply(this,arguments)||this).version=n.TransactionVersion.Testnet,e.chainId=n.ChainID.Testnet,e.coreApiUrl="http://localhost:3999",e}return e(r,t),r}(r);t.StacksMainnet=r,t.StacksMocknet=i,t.StacksTestnet=o,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@stacks/common")):"function"==typeof define&&define.amd?define(["exports","@stacks/common"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self)["@stacks/network"]={},t.common)}(this,(function(t,n){"use strict";function e(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var o=function(){function t(){var t=this;this.version=n.TransactionVersion.Mainnet,this.chainId=n.ChainID.Mainnet,this.coreApiUrl="https://stacks-node-api.mainnet.stacks.co",this.bnsLookupUrl="https://core.blockstack.org",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=function(){return t.version===n.TransactionVersion.Mainnet},this.getBroadcastApiUrl=function(){return""+t.coreApiUrl+t.broadcastEndpoint},this.getTransferFeeEstimateApiUrl=function(){return""+t.coreApiUrl+t.transferFeeEstimateEndpoint},this.getAccountApiUrl=function(n){return""+t.coreApiUrl+t.accountEndpoint+"/"+n+"?proof=0"},this.getAbiApiUrl=function(n,e){return""+t.coreApiUrl+t.contractAbiEndpoint+"/"+n+"/"+e},this.getReadOnlyFunctionCallApiUrl=function(n,e,o){return""+t.coreApiUrl+t.readOnlyFunctionCallEndpoint+"/"+n+"/"+e+"/"+encodeURIComponent(o)},this.getInfoUrl=function(){return t.coreApiUrl+"/v2/info"},this.getBlockTimeInfoUrl=function(){return t.coreApiUrl+"/extended/v1/info/network_block_times"},this.getPoxInfoUrl=function(){return t.coreApiUrl+"/v2/pox"},this.getStackerInfoUrl=function(n,e){return""+t.coreApiUrl+t.readOnlyFunctionCallEndpoint+"\n "+n+"/"+e+"/get-stacker-info"}}return t.prototype.getNameInfo=function(t){return n.fetchPrivate(this.bnsLookupUrl+"/v1/names/"+t).then((function(t){if(404===t.status)throw new Error("Name not found");if(200!==t.status)throw new Error("Bad response status: "+t.status);return t.json()})).then((function(t){return t.address?Object.assign({},t,{address:t.address}):t}))},t}(),r=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).version=n.TransactionVersion.Testnet,e.chainId=n.ChainID.Testnet,e.coreApiUrl="https://stacks-node-api.testnet.stacks.co",e}return e(o,t),o}(o),i=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).version=n.TransactionVersion.Testnet,e.chainId=n.ChainID.Testnet,e.coreApiUrl="http://localhost:3999",e}return e(o,t),o}(o);t.StacksMainnet=o,t.StacksMocknet=i,t.StacksTestnet=r,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=network.umd.production.min.js.map |
@@ -6,2 +6,3 @@ import { TransactionVersion, ChainID } from '@stacks/common'; | ||
coreApiUrl: string; | ||
bnsLookupUrl: string; | ||
broadcastEndpoint: string; | ||
@@ -28,2 +29,3 @@ transferFeeEstimateEndpoint: string; | ||
coreApiUrl: string; | ||
bnsLookupUrl: string; | ||
broadcastEndpoint: string; | ||
@@ -30,0 +32,0 @@ transferFeeEstimateEndpoint: string; |
{ | ||
"name": "@stacks/network", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Library for Stacks network operations", | ||
@@ -64,3 +64,3 @@ "keywords": [ | ||
"unpkg": "dist/network.cjs.production.min.js", | ||
"gitHead": "788006ea42257fc515c0678dd276ddd6dbdc2b9c" | ||
"gitHead": "2cf05938c1364dbfe45445f0297b64567ef91bc4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
59232
393
0