@stacks/network
Advanced tools
Comparing version 1.0.0-beta.7 to 1.0.0-beta.8
@@ -78,4 +78,19 @@ import { inheritsLoose as _inheritsLoose } from './_virtual/_rollupPluginBabelHelpers.js'; | ||
}(StacksMainnet); | ||
var StacksMocknet = /*#__PURE__*/function (_StacksMainnet2) { | ||
_inheritsLoose(StacksMocknet, _StacksMainnet2); | ||
export { StacksMainnet, StacksTestnet }; | ||
function StacksMocknet() { | ||
var _this3; | ||
_this3 = _StacksMainnet2.apply(this, arguments) || this; | ||
_this3.version = TransactionVersion.Testnet; | ||
_this3.chainId = ChainID.Testnet; | ||
_this3.coreApiUrl = 'http://localhost:3999'; | ||
return _this3; | ||
} | ||
return StacksMocknet; | ||
}(StacksMainnet); | ||
export { StacksMainnet, StacksMocknet, StacksTestnet }; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -87,5 +87,21 @@ 'use strict'; | ||
}(StacksMainnet); | ||
var StacksMocknet = /*#__PURE__*/function (_StacksMainnet2) { | ||
_inheritsLoose(StacksMocknet, _StacksMainnet2); | ||
function StacksMocknet() { | ||
var _this3; | ||
_this3 = _StacksMainnet2.apply(this, arguments) || this; | ||
_this3.version = common.TransactionVersion.Testnet; | ||
_this3.chainId = common.ChainID.Testnet; | ||
_this3.coreApiUrl = 'http://localhost:3999'; | ||
return _this3; | ||
} | ||
return StacksMocknet; | ||
}(StacksMainnet); | ||
exports.StacksMainnet = StacksMainnet; | ||
exports.StacksMocknet = StacksMocknet; | ||
exports.StacksTestnet = StacksTestnet; | ||
//# sourceMappingURL=network.cjs.development.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@stacks/common"),n=function(){function n(){var n=this;this.version=t.TransactionVersion.Mainnet,this.chainId=t.ChainID.Mainnet,this.coreApiUrl="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.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)}}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}(),r=function(n){var r,e;function o(){var r;return(r=n.apply(this,arguments)||this).version=t.TransactionVersion.Testnet,r.chainId=t.ChainID.Testnet,r.coreApiUrl="http://testnet-master.blockstack.org:20443",r}return e=n,(r=o).prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e,o}(n);exports.StacksMainnet=n,exports.StacksTestnet=r; | ||
"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://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.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)}}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="http://testnet-master.blockstack.org:20443",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 |
@@ -87,4 +87,20 @@ (function (global, factory) { | ||
}(StacksMainnet); | ||
var StacksMocknet = /*#__PURE__*/function (_StacksMainnet2) { | ||
_inheritsLoose(StacksMocknet, _StacksMainnet2); | ||
function StacksMocknet() { | ||
var _this3; | ||
_this3 = _StacksMainnet2.apply(this, arguments) || this; | ||
_this3.version = common.TransactionVersion.Testnet; | ||
_this3.chainId = common.ChainID.Testnet; | ||
_this3.coreApiUrl = 'http://localhost:3999'; | ||
return _this3; | ||
} | ||
return StacksMocknet; | ||
}(StacksMainnet); | ||
exports.StacksMainnet = StacksMainnet; | ||
exports.StacksMocknet = StacksMocknet; | ||
exports.StacksTestnet = StacksTestnet; | ||
@@ -91,0 +107,0 @@ |
@@ -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";var e=function(){function t(){var t=this;this.version=n.TransactionVersion.Mainnet,this.chainId=n.ChainID.Mainnet,this.coreApiUrl="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.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)}}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}(),r=function(t){var e,r;function o(){var e;return(e=t.apply(this,arguments)||this).version=n.TransactionVersion.Testnet,e.chainId=n.ChainID.Testnet,e.coreApiUrl="http://testnet-master.blockstack.org:20443",e}return r=t,(e=o).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,o}(e);t.StacksMainnet=e,t.StacksTestnet=r,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 r=function(){function t(){var t=this;this.version=n.TransactionVersion.Mainnet,this.chainId=n.ChainID.Mainnet,this.coreApiUrl="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.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)}}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="http://testnet-master.blockstack.org:20443",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})})); | ||
//# sourceMappingURL=network.umd.production.min.js.map |
@@ -39,1 +39,6 @@ import { TransactionVersion, ChainID } from '@stacks/common'; | ||
} | ||
export declare class StacksMocknet extends StacksMainnet implements StacksNetwork { | ||
version: TransactionVersion; | ||
chainId: ChainID; | ||
coreApiUrl: string; | ||
} |
{ | ||
"name": "@stacks/network", | ||
"version": "1.0.0-beta.7", | ||
"version": "1.0.0-beta.8", | ||
"description": "Library for Stacks network operations", | ||
@@ -47,3 +47,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@stacks/common": "^1.0.0-beta.7" | ||
"@stacks/common": "^1.0.0-beta.8" | ||
}, | ||
@@ -65,3 +65,3 @@ "devDependencies": { | ||
"unpkg": "dist/network.cjs.production.min.js", | ||
"gitHead": "ce733d62f720db6d59247453bf3bb2942bcb7446" | ||
"gitHead": "77b4d6d531b74996e4b7a0cbd1cf5b8358a690ce" | ||
} |
@@ -1,11 +0,9 @@ | ||
# `network` | ||
# @stacks/network | ||
> TODO: description | ||
Network and API library for working with Stacks blockchain nodes. | ||
## Usage | ||
## Installation | ||
``` | ||
const network = require('network'); | ||
// TODO: DEMONSTRATE API | ||
npm install @stacks/network | ||
``` |
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
48357
329
10
Updated@stacks/common@^1.0.0-beta.8