feat(stacking): add getSecondsUntilStackingDeadline helper method (#1528)

* fix: add getSecondsUntilStackingDeadline in addition to getSecondsUntilNextCycle

* docs: update docs

* chore: add negative case

* docs: udpate links

---------

Co-authored-by: janniks <janniks@users.noreply.github.com>
This commit is contained in:
janniks
2023-07-24 20:17:09 +02:00
committed by GitHub
parent 957790b7f4
commit 3c819c28eb
8 changed files with 86 additions and 47 deletions

View File

@@ -2,9 +2,9 @@
title: Getting Started
---
:::info Connect 🌐
[Stacks.js starters](https://docs.hiro.so/stacksjs-starters) offer working templates with Stacks Connect pre-installed for a quick and easy way to get started with building Stacks enabled web apps.
:::
import StacksjsStartersNote from './includes/\_stacks.js-starters-note.mdx';
<StacksjsStartersNote/>
---
@@ -16,7 +16,9 @@ Typically we speak of "mainnet" and "testnet" as the networks of Stacks. Most wa
As the name suggests, "testnet" is a network for testing.
It's a separate blockchain state that holds test tokens, which have no value.
Developers are encouraged to use testnet for testing and development, before rolling out applications and contracts to mainnet. Stacks.js functions can be configured to use wichever network you want.
Developers are encouraged to use testnet for testing, before rolling out applications and contracts to mainnet.
For development, there is even Devnet/Mocknet for working in a local development environment.
Stacks.js functions can be configured to use wichever network you want.
```js
import { StacksMainnet, StacksTestnet } from '@stacks/network';
@@ -152,16 +154,18 @@ The mode can be either `Allow` or `Deny`.
- `Deny` means the transaction will fail if any asset transfers (not specified in the post conditions) are attempted.
:::note
In either case, all post conditions will still be checked. By default, transactions are set to `Deny` mode, for additional security.
In either case, all post conditions will still be checked.
By default, transactions are set to `Deny` mode, for additional security.
:::
## Broadcasting
:::info Connect 🌐
For web apps via Stacks Connect, the users' wallet will broadcast the transaction and return a txid. [Read more](https://connect.stacks.js.org/modules/_stacks_connect)
For web apps via Stacks Connect, the users' wallet will broadcast the transaction and return a txid.
[Read more](https://connect.stacks.js.org/modules/_stacks_connect)
:::
A finalized transaction can be broadcasted to the network or serialized (to bytes representation) using Stacks.js.
A finalized transaction can be broadcasted to the network or serialized (to a byte representation) using Stacks.js.
```js
import { bytesToHex } from '@stacks/common';

View File

@@ -1,3 +1,3 @@
:::info Connect 🌐
Use our prebuilt [Stacks.js starter templates](/stacksjs-starters) to kickstart your frontend web application development with your preferred JavaScript framework.
[Stacks.js starters](https://docs.hiro.so/stacksjs-starters) offer working templates with Stacks Connect pre-installed for a quick and easy way to get started with building Stacks enabled web apps.
:::

View File

@@ -11,7 +11,7 @@ It's a collection of various JavaScript libraries allowing developers to interac
There are two main ways developers build applications on the Stacks blockchain:
- 🔒 **Without Direct Private Key Access**: For example a web app that allows users to interact with the Stacks blockchain using their Stacks wallet (browser extension or mobile). Read More in the Connect Guide
- 🔒 **Without Direct Private Key Access**: For example, a web app that allows users to interact with the Stacks blockchain using their Stacks wallet (browser extension or mobile). Read More in the Connect Guide
- 🔑 **With Private Key Access**: For example, managing funds with the Stacks.js CLI, building a backend (which can sign transactions directly).
Most users interact via their favorite Stacks wallet.
@@ -28,7 +28,7 @@ In these cases, developers can use the same libraries used by Stacks wallets for
There are three main integrations used by Stacks enabled applications:
<!-- todo: add a card and better how-to-guid for each, (eg add message signing backend checking) -->
<!-- todo: add a card and better how-to-guide for each, (eg add message signing backend checking) -->
- **Authentication**: Register and sign users in with identities on the Stacks blockchain
- **Transaction signing**: Prompt users to sign and broadcast transactions to the Stacks blockchain