Browse Source

feat: add example for creating an explorer link

feat/new-clarity-onboarding
Hank Stoever 4 years ago
parent
commit
528d50bfd9
  1. 9
      src/pages/build-apps/guides/transaction-signing.md

9
src/pages/build-apps/guides/transaction-signing.md

@ -263,6 +263,15 @@ interface FinishedTxData {
The `StacksTransaction` type comes from the [`@stacks/transactions`](https://github.com/blockstack/stacks.js/tree/master/packages/transactions) library.
The `txId` property can be used to provide a link to view the transaction in the explorer.
```ts
const onFinish = data => {
const explorerTransactionUrl = 'https://explorer.stacks.co/txid/${data.txId}';
console.log('View in explorer:', explorerTransactionUrl);
};
```
## Specifying the network for a transaction {#network-option}
All of the methods included on this page accept a `network` option. By default, Connect uses a testnet network option. You can import a network configuration from the [`@stacks/network`](https://github.com/blockstack/stacks.js/tree/master/packages/network) package.

Loading…
Cancel
Save