Browse Source

fix: use stacks/network for Testnet

fix/gh-action
Friedger Müffke 4 years ago
committed by Alexander Graebe
parent
commit
dec9d41a00
  1. 6
      src/pages/stacks-blockchain/integrate-stacking.md
  2. 4
      src/pages/stacks-blockchain/sending-tokens.md
  3. 11
      src/pages/stacks-blockchain/transactions.md

6
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): Install the stacks transactions library and an API client for the [Stacks 2.0 Blockchain API](/references/stacks-blockchain):
```shell ```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. -> 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, privateKeyToString,
getAddressFromPrivateKey, getAddressFromPrivateKey,
TransactionVersion, TransactionVersion,
StacksTestnet,
uintCV, uintCV,
tupleCV, tupleCV,
makeContractCall, makeContractCall,
@ -76,7 +75,8 @@ const {
connectWebSocketClient, connectWebSocketClient,
broadcastTransaction, broadcastTransaction,
standardPrincipalCV, standardPrincipalCV,
} = require('@blockstack/stacks-transactions'); } = require('@stacks/transactions');
const { StacksTestnet } = require('@stacks/network');
const { const {
InfoApi, InfoApi,
AccountsApi, AccountsApi,

4
src/pages/stacks-blockchain/sending-tokens.md

@ -58,9 +58,11 @@ const {
broadcastTransaction, broadcastTransaction,
estimateTransfer, estimateTransfer,
getNonce, getNonce,
StacksTestnet,
privateKeyToString, privateKeyToString,
} = require('@stacks/transactions'); } = require('@stacks/transactions');
const {
StacksTestnet,
} = require ('@stacks/network);
const { TransactionsApi, Configuration } = require('@stacks/blockchain-api-client'); const { TransactionsApi, Configuration } = require('@stacks/blockchain-api-client');
const apiConfig = new Configuration({ const apiConfig = new Configuration({

11
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 ### Stacks Token transfer
```js ```js
import { makeSTXTokenTransfer, StacksTestnet } from '@stacks/transactions'; import { makeSTXTokenTransfer } from '@stacks/transactions';
import { StacksTestnet } from '@stacks/network';
const BigNum = require('bn.js'); const BigNum = require('bn.js');
const txOptions = { const txOptions = {
@ -127,7 +129,8 @@ const transaction = await makeSTXTokenTransfer(txOptions);
### Smart contract deployment ### Smart contract deployment
```js ```js
import { makeContractDeploy, StacksTestnet } from '@stacks/transactions'; import { makeContractDeploy } from '@stacks/transactions';
import { StacksTestnet } from '@stacks/network';
const BigNum = require('bn.js'); const BigNum = require('bn.js');
const txOptions = { const txOptions = {
@ -143,7 +146,9 @@ const transaction = await makeContractDeploy(txOptions);
### Smart contract function call ### Smart contract function call
```js ```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 BigNum = require('bn.js');
const txOptions = { const txOptions = {

Loading…
Cancel
Save