From dec9d41a00695cb3e4f724808422dd9ec78270e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Thu, 19 Nov 2020 09:33:08 +0100 Subject: [PATCH] fix: use stacks/network for Testnet --- src/pages/stacks-blockchain/integrate-stacking.md | 6 +++--- src/pages/stacks-blockchain/sending-tokens.md | 4 +++- src/pages/stacks-blockchain/transactions.md | 11 ++++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/pages/stacks-blockchain/integrate-stacking.md b/src/pages/stacks-blockchain/integrate-stacking.md index 5d17b7c1..c6489656 100644 --- a/src/pages/stacks-blockchain/integrate-stacking.md +++ b/src/pages/stacks-blockchain/integrate-stacking.md @@ -48,7 +48,7 @@ In this tutorial, we'll implement the Stacking flow laid out in the [Stacking gu Install the stacks transactions library and an API client for the [Stacks 2.0 Blockchain API](/references/stacks-blockchain): ```shell -npm install --save @blockstack/stacks-transactions @stacks/blockchain-api-client c32check cross-fetch bn.js +npm install --save @stacks/transactions @stacks/network @stacks/blockchain-api-client c32check cross-fetch bn.js ``` -> The API client is generated from the [OpenAPI specification](https://github.com/blockstack/stacks-blockchain-api/blob/master/docs/openapi.yaml) ([openapi-generator](https://github.com/OpenAPITools/openapi-generator)). Many other languages and frameworks are supported by the generator. @@ -65,7 +65,6 @@ const { privateKeyToString, getAddressFromPrivateKey, TransactionVersion, - StacksTestnet, uintCV, tupleCV, makeContractCall, @@ -76,7 +75,8 @@ const { connectWebSocketClient, broadcastTransaction, standardPrincipalCV, -} = require('@blockstack/stacks-transactions'); +} = require('@stacks/transactions'); +const { StacksTestnet } = require('@stacks/network'); const { InfoApi, AccountsApi, diff --git a/src/pages/stacks-blockchain/sending-tokens.md b/src/pages/stacks-blockchain/sending-tokens.md index 109f575f..75008f2c 100644 --- a/src/pages/stacks-blockchain/sending-tokens.md +++ b/src/pages/stacks-blockchain/sending-tokens.md @@ -58,9 +58,11 @@ const { broadcastTransaction, estimateTransfer, getNonce, - StacksTestnet, privateKeyToString, } = require('@stacks/transactions'); +const { + StacksTestnet, +} = require ('@stacks/network); const { TransactionsApi, Configuration } = require('@stacks/blockchain-api-client'); const apiConfig = new Configuration({ diff --git a/src/pages/stacks-blockchain/transactions.md b/src/pages/stacks-blockchain/transactions.md index c5ff03c9..bbd823c3 100644 --- a/src/pages/stacks-blockchain/transactions.md +++ b/src/pages/stacks-blockchain/transactions.md @@ -106,7 +106,9 @@ When constructing transactions, it is required to set the network the transactio ### Stacks Token transfer ```js -import { makeSTXTokenTransfer, StacksTestnet } from '@stacks/transactions'; +import { makeSTXTokenTransfer } from '@stacks/transactions'; +import { StacksTestnet } from '@stacks/network'; + const BigNum = require('bn.js'); const txOptions = { @@ -127,7 +129,8 @@ const transaction = await makeSTXTokenTransfer(txOptions); ### Smart contract deployment ```js -import { makeContractDeploy, StacksTestnet } from '@stacks/transactions'; +import { makeContractDeploy } from '@stacks/transactions'; +import { StacksTestnet } from '@stacks/network'; const BigNum = require('bn.js'); const txOptions = { @@ -143,7 +146,9 @@ const transaction = await makeContractDeploy(txOptions); ### Smart contract function call ```js -import { makeContractCall, BufferCV, StacksTestnet } from '@stacks/transactions'; +import { makeContractCall, BufferCV } from '@stacks/transactions'; +import { StacksTestnet } from '@stacks/network'; + const BigNum = require('bn.js'); const txOptions = {