Browse Source

auto: update Clarity references JSONs from stacks-blockchain@67dccdf6d1c28e482d3d71eb616cf8682dac863d

fix/wrong-prop-name
PR Robot 4 years ago
committed by pgray-hiro
parent
commit
d3c9af2ac0
  1. 6
      src/_data/boot-contracts-reference.json
  2. 12
      src/_data/clarity-reference.json

6
src/_data/boot-contracts-reference.json

@ -69,7 +69,7 @@
"input_type": "(buff 20), (buff 20), uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, principal",
"output_type": "(response bool int)",
"signature": "(namespace-reveal namespace namespace-salt p-func-base p-func-coeff p-func-b1 p-func-b2 p-func-b3 p-func-b4 p-func-b5 p-func-b6 p-func-b7 p-func-b8 p-func-b9 p-func-b10 p-func-b11 p-func-b12 p-func-b13 p-func-b14 p-func-b15 p-func-b16 p-func-non-alpha-discount p-func-no-vowel-discount lifetime namespace-import)",
"description": "Reveals the salt and the namespace ID (after a namespace preorder). It reveals how long names last in this namespace before they expire or must be renewed, and it sets a price function for the namespace that determines how cheap or expensive names its will be."
"description": "Reveals the salt and the namespace ID (after a namespace preorder). It reveals how long names last in this namespace before they expire or must be renewed, and it sets a price function for the namespace that determines how cheap or expensive names its will be.All of the parameters prefixed by `p` make up the `price function`. These parameters govern the pricing and lifetime of names in the namespace.\n\nThe rules for a namespace are as follows:\n* a name can fall into one of 16 buckets, measured by length. Bucket 16 incorporates all names at least 16 characters long.\n* the pricing structure applies a multiplicative penalty for having numeric characters, or punctuation characters.\n* the price of a name in a bucket is `((coeff) * (base) ^ (bucket exponent)) / ((numeric discount multiplier) * (punctuation discount multiplier))`\n\nExample:\n\n* base = 10\n* coeff = 2\n* nonalpha discount: 10\n* no-vowel discount: 10\n* buckets 1, 2: 9\n* buckets 3, 4, 5, 6: 8\n* buckets 7, 8, 9, 10, 11, 12, 13, 14: 7\n* buckets 15, 16+:"
}
],
"read_only_functions": [
@ -361,7 +361,7 @@
"input_type": "uint, principal, (optional uint), (optional (tuple (hashbytes (buff 20)) (version (buff 1))))",
"output_type": "(response bool int)",
"signature": "(delegate-stx amount-ustx delegate-to until-burn-ht pox-addr)",
"description": "Delegate to `delegate-to` the ability to stack from a given address.\nThis method _does not_ lock the funds, rather, it allows the delegate to issue the stacking lock.\n\nThe caller specifies:\n * amount-ustx: the total amount of ustx the delegate may be allowed to lock\n * until-burn-ht: an optional burn height at which this delegation expiration\n * pox-addr: an optional address to which any rewards *must* be sent"
"description": "Delegate to `delegate-to` the ability to stack from a given address.\nThis method _does not_ lock the funds, rather, it allows the delegate to issue the stacking lock.\n\nThe caller specifies:\n * amount-ustx: the total amount of ustx the delegate may be allowed to lock\n * until-burn-ht: an optional burn height at which this delegation expiration\n * pox-addr: an optional p2pkh or p2sh address to which any rewards *must* be sent"
},
{
"name": "disallow-contract-caller",
@ -396,7 +396,7 @@
"input_type": "uint, (tuple (hashbytes (buff 20)) (version (buff 1))), uint, uint",
"output_type": "(response (tuple (lock-amount uint) (stacker principal) (unlock-burn-height uint)) int)",
"signature": "(stack-stx amount-ustx pox-addr start-burn-ht lock-period)",
"description": "Lock up some uSTX for stacking! Note that the given amount here is in micro-STX (uSTX).\nThe STX will be locked for the given number of reward cycles (lock-period).\nThis is the self-service interface. tx-sender will be the Stacker.\n\n* The given stacker cannot currently be stacking.\n* You will need the minimum uSTX threshold. This isn't determined until the reward cycle begins, but this\n method still requires stacking over the _absolute minimum_ amount, which can be obtained by calling `get-stacking-minimum`.\n\nThe tokens will unlock and be returned to the Stacker (tx-sender) automatically."
"description": "Lock up some uSTX for stacking! Note that the given amount here is in micro-STX (uSTX).\nThe STX will be locked for the given number of reward cycles (lock-period).\nThis is the self-service interface. tx-sender will be the Stacker.\n\n* The given stacker cannot currently be stacking.\n* You will need the minimum uSTX threshold. This isn't determined until the reward cycle begins, but this\n method still requires stacking over the _absolute minimum_ amount, which can be obtained by calling `get-stacking-minimum`.\n* The pox-addr argument must represent a valid reward address. Right now, this must be a Bitcoin\np2pkh or p2sh address. It cannot be a native Segwit address, but it may be a p2wpkh-p2sh or p2wsh-p2sh address.\n\nThe tokens will unlock and be returned to the Stacker (tx-sender) automatically."
}
],
"read_only_functions": [

12
src/_data/clarity-reference.json

@ -182,7 +182,7 @@
"output_type": "B",
"signature": "(fold func list initial-value)",
"description": "The `fold` special form applies the input function `func` to each element of the\ninput list _and_ the output of the previous application of the `fold` function. When invoked on\nthe first list element, it uses the `initial-value` as the second input. `fold` returns the last\nvalue returned by the successive applications. Note that the first argument is not evaluated thus\nhas to be a literal function name.",
"example": "(fold * (list 2 2 2) 1) ;; Returns 8\n(fold * (list 2 2 2) 0) ;; Returns 0\n;; calculates (- 11 (- 7 (- 3 2)))\n(fold - (list 3 7 11) 2) ;; Returns 5 \n(fold concat \"cdef\" \"ab\") ;; Returns \"fedcab\"\n(fold concat (list \"cd\" \"ef\") \"ab\") ;; Returns \"efcdab\""
"example": "(fold * (list 2 2 2) 1) ;; Returns 8\n(fold * (list 2 2 2) 0) ;; Returns 0\n;; calculates (- 11 (- 7 (- 3 2)))\n(fold - (list 3 7 11) 2) ;; Returns 5 \n(define-private (concat-string (a (string-ascii 20)) (b (string-ascii 20))) (unwrap-panic (as-max-len? (concat a b) u20)))\n(fold concat-string \"cdef\" \"ab\") ;; Returns \"fedcab\"\n(fold concat-string (list \"cd\" \"ef\") \"ab\") ;; Returns \"efcdab\""
},
{
"name": "append",
@ -510,7 +510,7 @@
"output_type": "C",
"signature": "(match opt-input some-binding-name some-branch none-branch) |\n(match-resp input ok-binding-name ok-branch err-binding-name err-branch)",
"description": "The `match` function is used to test and destructure optional and response types.\n\nIf the `input` is an optional, it tests whether the provided\n`input` is a `some` or `none` option, and evaluates `some-branch` or\n`none-branch` in each respective case.\n\nWithin the `some-branch`, the _contained value_ of the `input`\nargument is bound to the provided `some-binding-name` name.\n\nOnly _one_ of the branches will be evaluated (similar to `if` statements).\n\nIf the `input` is a response, it tests whether the provided `input` is\nan `ok` or `err` response type, and evaluates `ok-branch` or\n`err-branch` in each respective case.\n\nWithin the `ok-branch`, the _contained ok value_ of the `input`\nargument is bound to the provided `ok-binding-name` name.\n\nWithin the `err-branch`, the _contained err value_ of the `input`\nargument is bound to the provided `err-binding-name` name.\n\nOnly _one_ of the branches will be evaluated (similar to `if` statements).\n\nNote: Type checking requires that the type of both the ok and err parts of the\nresponse object be determinable. For situations in which one of the parts of a response\nis untyped, you should use `unwrap-panic` or `unwrap-err-panic` instead of `match`.",
"example": "\n(define-private (add-10 (x (optional int)))\n (match x\n value (+ 10 value)\n 10))\n(add-10 (some 5)) ;; Returns 15\n(add-10 none) ;; Returns 10\n\n(define-private (add-or-pass-err (x (response int (string-ascii 10))) (to-add int))\n (match x\n value (+ to-add value)\n err-value (err err-value)))\n(add-or-pass-err (ok 5) 20) ;; Returns 25\n(add-or-pass-err (err \"ERROR\") 20) ;; Returns (err \"ERROR\")\n"
"example": "\n(define-private (add-10 (x (optional int)))\n (match x\n value (+ 10 value)\n 10))\n(add-10 (some 5)) ;; Returns 15\n(add-10 none) ;; Returns 10\n\n(define-private (add-or-pass-err (x (response int (string-ascii 10))) (to-add int))\n (match x\n value (ok (+ to-add value))\n err-value (err err-value)))\n(add-or-pass-err (ok 5) 20) ;; Returns (ok 25)\n(add-or-pass-err (err \"ERROR\") 20) ;; Returns (err \"ERROR\")\n"
},
{
"name": "try!",
@ -690,10 +690,10 @@
},
{
"name": "define-map",
"input_type": "MapName, KeyTupleDefinition, MapTupleDefinition",
"input_type": "MapName, TypeDefinition, TypeDefinition",
"output_type": "Not Applicable",
"signature": "(define-map map-name ((key-name-0 key-type-0) ...) ((val-name-0 val-type-0) ...))",
"description": "`define-map` is used to define a new datamap for use in a smart contract. Such\nmaps are only modifiable by the current smart contract.\n\nMaps are defined with a key tuple type and value tuple type. These are defined using a list\nof name and type pairs, e.g., a key type might be `((id int))`, which is a tuple with a single \"id\"\nfield of type `int`.\n\nLike other kinds of definition statements, `define-map` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).",
"signature": "(define-map map-name key-type value-type)",
"description": "`define-map` is used to define a new datamap for use in a smart contract. Such\nmaps are only modifiable by the current smart contract.\n\nMaps are defined with a key type and value type, often these types are tuple types.\n\nLike other kinds of definition statements, `define-map` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).",
"example": "\n(define-map squares { x: int } { square: int })\n(define-private (add-entry (x int))\n (map-insert squares { x: 2 } { square: (* x x) }))\n(add-entry 1)\n(add-entry 2)\n(add-entry 3)\n(add-entry 4)\n(add-entry 5)\n"
},
{
@ -742,7 +742,7 @@
"output_type": "Not Applicable",
"signature": "(impl-trait trait-identifier)",
"description": "`impl-trait` can be use for asserting that a contract is fully implementing a given trait.\nAdditional checks are being performed when the contract is being published, rejecting the deployment if the\ncontract is violating the trait specification.\n\nTrait identifiers can either be using the sugared syntax (.token-a.token-trait), or be fully qualified\n('SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait).\n\nLike other kinds of definition statements, `impl-trait` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put such a statement in the middle of a function body).\n",
"example": "\n(impl-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n"
"example": "\n(impl-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n(define-public (get-balance (account principal))\n (ok u0))\n(define-public (transfer? (from principal) (to principal) (amount uint))\n (ok u0))\n"
}
],
"keywords": [

Loading…
Cancel
Save