Merge pull request #3249 from stacks-network/docs-microstacks

docs: clarify amounts in microstacks
This commit is contained in:
Jude Nelson
2022-08-25 23:38:29 +00:00
committed by GitHub

View File

@@ -1926,8 +1926,8 @@ const STX_GET_BALANCE: SimpleFunctionAPI = SimpleFunctionAPI {
signature: "(stx-get-balance owner)",
description: "`stx-get-balance` is used to query the STX balance of the `owner` principal.
This function returns the STX balance of the `owner` principal. In the event that the `owner`
principal isn't materialized, it returns 0.
This function returns the STX balance, in microstacks (1 STX = 1,000,000 microstacks), of the
`owner` principal. In the event that the `owner` principal isn't materialized, it returns 0.
",
example: "
(stx-get-balance 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR) ;; Returns u0
@@ -1942,7 +1942,7 @@ const STX_GET_ACCOUNT: SimpleFunctionAPI = SimpleFunctionAPI {
This function returns a tuple with the canonical account representation for an STX account.
This includes the current amount of unlocked STX, the current amount of locked STX, and the
unlock height for any locked STX.
unlock height for any locked STX, all denominated in microstacks.
",
example: r#"
(stx-account 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR) ;; Returns (tuple (locked u0) (unlock-height u0) (unlocked u0))
@@ -1955,7 +1955,8 @@ const STX_TRANSFER: SpecialAPI = SpecialAPI {
output_type: "(response bool uint)",
signature: "(stx-transfer? amount sender recipient)",
description: "`stx-transfer?` is used to increase the STX balance for the `recipient` principal
by debiting the `sender` principal. The `sender` principal _must_ be equal to the current context's `tx-sender`.
by debiting the `sender` principal by `amount`, specified in microstacks. The `sender` principal
_must_ be equal to the current context's `tx-sender`.
This function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns
one of the following error codes:
@@ -1992,8 +1993,9 @@ This function returns (ok true) if the transfer is successful, or, on an error,
const STX_BURN: SimpleFunctionAPI = SimpleFunctionAPI {
name: None,
signature: "(stx-burn? amount sender)",
description: "`stx-burn?` decreases the `sender` principal's STX holdings by `amount`, destroying
the STX. The `sender` principal _must_ be equal to the current context's `tx-sender`.
description: "`stx-burn?` decreases the `sender` principal's STX holdings by `amount`,
specified in microstacks, by destroying the STX. The `sender` principal _must_ be equal to the current
context's `tx-sender`.
This function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns
one of the following error codes: