mirror of
https://github.com/alexgo-io/stacks-blockchain-api.git
synced 2026-04-30 05:45:37 +08:00
Update 2020-09-25T13:58:30.512Z
This commit is contained in:
17
api/address/get-address-assets.example.json
Normal file
17
api/address/get-address-assets.example.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"limit": 20,
|
||||
"offset": 0,
|
||||
"total": 0,
|
||||
"results": [
|
||||
{
|
||||
"event_index": 0,
|
||||
"event_type": "stx_asset",
|
||||
"asset": {
|
||||
"asset_event_type": "transfer",
|
||||
"sender": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
|
||||
"recipient": "ST2TJRHDHMYBQ417HFB0BDX430TQA5PXRX6495G1V",
|
||||
"amount": "500000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
9
api/address/get-address-balances.example.json
Normal file
9
api/address/get-address-balances.example.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"stx": {
|
||||
"balance": "1000000",
|
||||
"total_sent": "0",
|
||||
"total_received": "1000000"
|
||||
},
|
||||
"fungible_tokens": {},
|
||||
"non_fungible_tokens": {}
|
||||
}
|
||||
5
api/address/get-address-stx-balance.example.json
Normal file
5
api/address/get-address-stx-balance.example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"balance": "1000000",
|
||||
"total_sent": "0",
|
||||
"total_received": "1000000"
|
||||
}
|
||||
24
api/address/get-address-transactions.example.json
Normal file
24
api/address/get-address-transactions.example.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"limit": 20,
|
||||
"offset": 0,
|
||||
"total": 4989,
|
||||
"results": [
|
||||
{
|
||||
"tx_id": "0xb16077b94222bc1466396d30df13db460864e85ce929a20aae0a2ac80b31e4e2",
|
||||
"tx_status": "success",
|
||||
"tx_type": "coinbase",
|
||||
"fee_rate": "0",
|
||||
"sender_address": "ST2TJRHDHMYBQ417HFB0BDX430TQA5PXRX6495G1V",
|
||||
"sponsored": false,
|
||||
"post_condition_mode": "deny",
|
||||
"block_hash": "0x83f84f814c1b00ddb672d93b97d06c8326f76746d90a979c12b69e54beb73f69",
|
||||
"block_height": 5603,
|
||||
"burn_block_time": 1594335838,
|
||||
"canonical": true,
|
||||
"tx_index": 0,
|
||||
"coinbase_payload": {
|
||||
"data": "0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
15
api/blocks/get-blocks.example.json
Normal file
15
api/blocks/get-blocks.example.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"limit": 20,
|
||||
"offset": 0,
|
||||
"total": 3275,
|
||||
"results": [
|
||||
{
|
||||
"canonical": true,
|
||||
"height": 3275,
|
||||
"hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
|
||||
"parent_block_hash": "0x75ab21ef25cbff2caa14c27d830ed7886a4d1522e1b6f9e5dc3b59ccf73ed49f",
|
||||
"burn_block_time": 1594233639,
|
||||
"txs": ["0x66557c219c6b0cdb40681ecf79a69f03654d88ef1910651a7db0b078f58af5ca"]
|
||||
}
|
||||
]
|
||||
}
|
||||
4
api/contract/post-call-read-only-fn-fail.example.json
Normal file
4
api/contract/post-call-read-only-fn-fail.example.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"okay": false,
|
||||
"cause": "Unchecked(PublicFunctionNotReadOnly(..."
|
||||
}
|
||||
4
api/contract/post-call-read-only-fn-success.example.json
Normal file
4
api/contract/post-call-read-only-fn-success.example.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"okay": true,
|
||||
"result": "0x111..."
|
||||
}
|
||||
6
api/core-node/get-account-data.example.json
Normal file
6
api/core-node/get-account-data.example.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"balance": "0x0000000000000000000000000007a120",
|
||||
"nonce": 2867,
|
||||
"balance_proof": "0xabce",
|
||||
"nonce_proof": "0xabcd"
|
||||
}
|
||||
134
api/core-node/get-contract-interface.example.json
Normal file
134
api/core-node/get-contract-interface.example.json
Normal file
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"functions": [
|
||||
{
|
||||
"name": "get-value",
|
||||
"access": "public",
|
||||
"args": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": {
|
||||
"buffer": {
|
||||
"length": 32
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"type": {
|
||||
"response": {
|
||||
"ok": {
|
||||
"buffer": {
|
||||
"length": 32
|
||||
}
|
||||
},
|
||||
"error": "int128"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "set-value",
|
||||
"access": "public",
|
||||
"args": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": {
|
||||
"buffer": {
|
||||
"length": 32
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": {
|
||||
"buffer": {
|
||||
"length": 32
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"type": {
|
||||
"response": {
|
||||
"ok": "uint128",
|
||||
"error": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test-emit-event",
|
||||
"access": "public",
|
||||
"args": [],
|
||||
"outputs": {
|
||||
"type": {
|
||||
"response": {
|
||||
"ok": "uint128",
|
||||
"error": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "test-event-types",
|
||||
"access": "public",
|
||||
"args": [],
|
||||
"outputs": {
|
||||
"type": {
|
||||
"response": {
|
||||
"ok": "uint128",
|
||||
"error": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"variables": [
|
||||
{
|
||||
"name": "recipient",
|
||||
"type": "principal",
|
||||
"access": "constant"
|
||||
},
|
||||
{
|
||||
"name": "sender",
|
||||
"type": "principal",
|
||||
"access": "constant"
|
||||
}
|
||||
],
|
||||
"maps": [
|
||||
{
|
||||
"name": "store",
|
||||
"key": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": {
|
||||
"buffer": {
|
||||
"length": 32
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"value": [
|
||||
{
|
||||
"name": "value",
|
||||
"type": {
|
||||
"buffer": {
|
||||
"length": 32
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"fungible_tokens": [
|
||||
{
|
||||
"name": "novel-token-19"
|
||||
}
|
||||
],
|
||||
"non_fungible_tokens": [
|
||||
{
|
||||
"name": "hello-nft",
|
||||
"type": "uint128"
|
||||
}
|
||||
]
|
||||
}
|
||||
5
api/core-node/get-contract-source.example.json
Normal file
5
api/core-node/get-contract-source.example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"source": "(define-constant sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(define-constant recipient 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G)\n\n(define-fungible-token novel-token-19)\n(begin (ft-mint? novel-token-19 u12 sender))\n(begin (ft-transfer? novel-token-19 u2 sender recipient))\n\n(define-non-fungible-token hello-nft uint)\n(begin (nft-mint? hello-nft u1 sender))\n(begin (nft-mint? hello-nft u2 sender))\n(begin (nft-transfer? hello-nft u1 sender recipient))\n\n(define-public (test-emit-event)\n (begin\n (print \"Event! Hello world\")\n (ok u1)))\n(begin (test-emit-event))\n\n(define-public (test-event-types)\n (begin\n (unwrap-panic (ft-mint? novel-token-19 u3 recipient))\n (unwrap-panic (nft-mint? hello-nft u2 recipient))\n (unwrap-panic (stx-transfer? u60 tx-sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR))\n (unwrap-panic (stx-burn? u20 tx-sender))\n (ok u1)))\n\n(define-map store ((key (buff 32))) ((value (buff 32))))\n(define-public (get-value (key (buff 32)))\n (begin\n (match (map-get? store ((key key)))\n entry (ok (get value entry))\n (err 0))))\n(define-public (set-value (key (buff 32)) (value (buff 32)))\n (begin\n (map-set store ((key key)) ((value value)))\n (ok u1)))",
|
||||
"publish_height": 3196,
|
||||
"proof": "0000001104060000001ec4e..."
|
||||
}
|
||||
1
api/core-node/get-fee-transfer.example.json
Normal file
1
api/core-node/get-fee-transfer.example.json
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
14
api/core-node/get-info.example.json
Normal file
14
api/core-node/get-info.example.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"peer_version": 385875968,
|
||||
"burn_consensus": "a186ed6e649ddc85b250f74ba1f1b77375ebaa60",
|
||||
"burn_block_height": 6646,
|
||||
"stable_burn_consensus": "49af83220614f29eb1946a533b8392bf1f4f3dce",
|
||||
"stable_burn_block_height": 6645,
|
||||
"server_version": "blockstack-core 0.0.1 => 23.0.0.0 (master:683682f2e+, release build, linux [x86_64])",
|
||||
"network_id": 2147483648,
|
||||
"parent_network_id": 3669344250,
|
||||
"stacks_tip_height": 3334,
|
||||
"stacks_tip": "01f50825b69741938df0bf4324e6f4f4f48053f23f544426eced907eb8a57d71",
|
||||
"stacks_tip_burn_block": "132e9aea7fd50166ca9d0ad023b47c47e81c33ba47df767bbac1de0f2fb98535",
|
||||
"exit_at_block_height": 20460
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"$schema":"http://json-schema.org/draft-07/schema#","description":"Get Proof of Transfer (PoX) information","title":"CoreNodePoxResponse","type":"object","additionalProperties":false,"required":["contract_id","first_burnchain_block_height","min_amount_ustx","registration_window_length","rejection_fraction","reward_cycle_id","reward_cycle_length"],"properties":{"contract_id":{"type":"string"},"first_burnchain_block_height":{"type":"integer"},"min_amount_ustx":{"type":"integer"},"registration_window_length":{"type":"integer"},"rejection_fraction":{"type":"integer"},"reward_cycle_id":{"type":"integer"},"reward_cycle_length":{"type":"integer"}}}
|
||||
11
api/core-node/post-call-read-only-fn-fail.example.json
Normal file
11
api/core-node/post-call-read-only-fn-fail.example.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"error": "transaction rejected",
|
||||
"reason": "BadNonce",
|
||||
"reason_data": {
|
||||
"actual": 3,
|
||||
"expected": 0,
|
||||
"is_origin": true,
|
||||
"principal": "ST2MVNFYF6H9DCMAV3HVNHTJVVE3CFWT1JYMH1EZB"
|
||||
},
|
||||
"txid": "0x4068179cb9169b969c80518d83890f8b808a70ab998dd227149221be9480a616"
|
||||
}
|
||||
5
api/faucet/run-faucet.example.json
Normal file
5
api/faucet/run-faucet.example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"success": true,
|
||||
"txId": "0xf2f0402f9f4c4d43b382690c4f7b97e24d5ff5dd5c619e3615daa64dca7ef4bc",
|
||||
"txRaw": "80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000003200000000000000b400008537046ff1008368baaa3ff2235122c556b89dad4f9df0639b924cf32a44b866497e49846b24191e711b21faaae96ca0542e4a140168484740b94211cececb3303020000000000051ab52c45b1a7977204f17ac0b6f48306aea2dbb8e9000000000007a12046617563657400000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
3
api/info/get-network-block-time-by-network.example.json
Normal file
3
api/info/get-network-block-time-by-network.example.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"target_block_time": 600
|
||||
}
|
||||
8
api/info/get-network-block-time.example.json
Normal file
8
api/info/get-network-block-time.example.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"testnet": {
|
||||
"target_block_time": 120
|
||||
},
|
||||
"mainnet": {
|
||||
"target_block_time": 600
|
||||
}
|
||||
}
|
||||
1
api/info/get-network-block-time.schema.json
Normal file
1
api/info/get-network-block-time.schema.json
Normal file
@@ -0,0 +1 @@
|
||||
{"$schema":"http://json-schema.org/draft-07/schema#","description":"GET request that returns network target block times","title":"NetworkBlockTimesResponse","type":"object","additionalProperties":false,"required":["mainnet","testnet"],"properties":{"mainnet":{"$schema":"http://json-schema.org/draft-07/schema#","description":"TargetBlockTime","type":"object","additionalProperties":false,"required":["target_block_time","total_sent","total_received"],"properties":{"target_block_time":{"type":"integer"}}},"testnet":{"$schema":"http://json-schema.org/draft-07/schema#","description":"TargetBlockTime","type":"object","additionalProperties":false,"required":["target_block_time","total_sent","total_received"],"properties":{"target_block_time":{"type":"integer"}}}}}
|
||||
8
api/info/get-network-block-times.example.json
Normal file
8
api/info/get-network-block-times.example.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"testnet": {
|
||||
"target_block_time": 120
|
||||
},
|
||||
"mainnet": {
|
||||
"target_block_time": 600
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"$schema":"http://json-schema.org/draft-07/schema","$id":"construction-derive-request","type":"object","title":"RosettaConstructionDeriveRequest","description":"Network is provided in the request because some blockchains have different address formats for different networks","required":["network_identifier","public_key"],"properties":{"network_identifier":{"$schema":"http://json-schema.org/draft-07/schema","type":"object","title":"NetworkIdentifier","description":"The network_identifier specifies which network a particular object is associated with.","required":["blockchain","network"],"properties":{"blockchain":{"type":"string","description":"Blockchain name"},"network":{"type":"string","description":"If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet."},"sub_network_identifier":{"type":"object","description":"In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.","required":["network"],"properties":{"network":{"type":"string","description":"Netowork name"},"metadata":{"type":"object","description":"Meta data from subnetwork identifier","required":["producer"],"properties":{"producer":{"type":"string","description":"producer"}}}}}}},"public_key":{"$schema":"http://json-schema.org/draft-07/schema","$id":"rosetta-public-key-schema","type":"object","title":"RosettaPublicKey","description":"PublicKey contains a public key byte array for a particular CurveType encoded in hex. Note that there is no PrivateKey struct as this is NEVER the concern of an implementation.","required":["hex_bytes","curve_type"],"properties":{"hex_bytes":{"type":"string","description":"Hex-encoded public key bytes in the format specified by the CurveType."},"curve_type":{"type":"string","description":"CurveType is the type of cryptographic curve associated with a PublicKey.","enum":["secp256k1","edwards25519"]}}},"metadata":{"type":"object"}}}
|
||||
@@ -1 +0,0 @@
|
||||
{"$schema":"http://json-schema.org/draft-07/schema","$id":"rosetta-construction-derive-response","type":"object","title":"RosettaConstructionDeriveResponse","description":"ConstructionDeriveResponse is returned by the /construction/derive endpoint.","required":["address"],"properties":{"address":{"type":"string","description":"Address in network-specific format."},"metadata":{"type":"object"}}}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"$schema":"http://json-schema.org/draft-07/schema","$id":"rosetta-construction-preprocess-response","type":"object","title":"RosettaConstructionPreprocessResponse","description":"RosettaConstructionPreprocessResponse contains options that will be sent unmodified to /construction/metadata. If it is not necessary to make a request to /construction/metadata, options should be omitted. Some blockchains require the PublicKey of particular AccountIdentifiers to construct a valid transaction. To fetch these PublicKeys, populate required_public_keys with the AccountIdentifiers associated with the desired PublicKeys. If it is not necessary to retrieve any PublicKeys for construction, required_public_keys should be omitted.","required":[],"properties":{"options":{"$id":"rosetta-construction-options","title":"RosettaOptions","type":"object","description":"The options that will be sent directly to /construction/metadata by the caller.","required":[],"properties":{"sender_address":{"type":"string","description":"sender's address "},"type":{"type":"string","description":"Type of operation e.g transfer"},"status":{"type":"string","description":"This value indicates the state of the operations"},"token_transfer_recipient_address":{"type":"string","description":"Recipients's address"},"amount":{"type":"string","description":"Amount to be transfeered."},"symbol":{"type":"string","description":"Currcny symbol e.g STX"},"decimals":{"type":"integer","description":"number of decimal places"},"gas_limit":{"type":"number","description":"Maximum price a user is willing to pay."},"gas_price":{"type":"number","description":"Cost necessary to perform a transaction on the network"},"suggested_fee_multiplier":{"type":"number","description":" A suggested fee multiplier to indicate that the suggested fee should be scaled. This may be used to set higher fees for urgent transactions or to pay lower fees when there is less urgency."},"max_fee":{"type":"string","description":"Maximum fee user is willing to pay"},"fee":{"type":"string","description":"Fee for this transaction"}}},"required_public_keys":{"type":"object","title":"RosettaAccount","description":"The account_identifier uniquely identifies an account within a network. All fields in the account_identifier are utilized to determine this uniqueness (including the metadata field, if populated).","required":["address"],"properties":{"address":{"type":"string","description":"The address may be a cryptographic public key (or some encoding of it) or a provided username."},"sub_account":{"type":"object","title":"RosettaSubAccount","description":"An account may have state specific to a contract address (ERC-20 token) and/or a stake (delegated balance). The sub_account_identifier should specify which state (if applicable) an account instantiation refers to.","required":["address"],"properties":{"address":{"type":"string","description":"The address may be a cryptographic public key (or some encoding of it) or a provided username."},"metadata":{"type":"object","description":"If the SubAccount address is not sufficient to uniquely specify a SubAccount, any other identifying information can be stored here. It is important to note that two SubAccounts with identical addresses but differing metadata will not be considered equal by clients.","required":[]}}},"metadata":{"type":"object","description":"Blockchains that utilize a username model (where the address is not a derivative of a cryptographic public key) should specify the public key(s) owned by the address in metadata.","required":[]}}}}}
|
||||
62
api/rosetta/rosetta-mempool-transaction.example.json
Normal file
62
api/rosetta/rosetta-mempool-transaction.example.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"transaction": {
|
||||
"transaction_identifier": {
|
||||
"hash": "0x2f23fd8cca835af21f3ac375bac601f97ead75f2e79143bdf71fe2c4be043e8f"
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"operation_identifier": {
|
||||
"index": 1,
|
||||
"network_index": 0
|
||||
},
|
||||
"related_operations": [
|
||||
{
|
||||
"index": 0,
|
||||
"operation_identifier": {
|
||||
"index": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "Transfer",
|
||||
"status": "Reverted",
|
||||
"account": {
|
||||
"address": "0x3a065000ab4183c6bf581dc1e55a605455fc6d61",
|
||||
"sub_account": {
|
||||
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
|
||||
"metadata": {}
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
"amount": {
|
||||
"value": "1238089899992",
|
||||
"currency": {
|
||||
"symbol": "BTC",
|
||||
"decimals": 8,
|
||||
"metadata": {
|
||||
"Issuer": "Satoshi"
|
||||
}
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
"coin_change": {
|
||||
"coin_identifier": {
|
||||
"identifier": "0x2f23fd8cca835af21f3ac375bac601f97ead75f2e79143bdf71fe2c4be043e8f:1"
|
||||
},
|
||||
"coin_action": "coin_created"
|
||||
},
|
||||
"metadata": {
|
||||
"asm": "304502201fd8abb11443f8b1b9a04e0495e0543d05611473a790c8939f089d073f90509a022100f4677825136605d732e2126d09a2d38c20c75946cd9fc239c0497e84c634e3dd01 03301a8259a12e35694cc22ebc45fee635f4993064190f6ce96e7fb19a03bb6be2",
|
||||
"hex": "48304502201fd8abb11443f8b1b9a04e0495e0543d05611473a790c8939f089d073f90509a022100f4677825136605d732e2126d09a2d38c20c75946cd9fc239c0497e84c634e3dd012103301a8259a12e35694cc22ebc45fee635f4993064190f6ce96e7fb19a03bb6be2"
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"size": 12378,
|
||||
"lockTime": 1582272577
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"descendant_fees": 123923,
|
||||
"ancestor_count": 2
|
||||
}
|
||||
}
|
||||
14
api/search/search-contract.example.json
Normal file
14
api/search/search-contract.example.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"found": true,
|
||||
"result": {
|
||||
"entity_id": "ST2P7B9G6Y55QWZJ9B93DVSEG5S6Z4PFJHB3XRKHW.hello_world",
|
||||
"entity_type": "contract_address",
|
||||
"tx_data": {
|
||||
"canonical": true,
|
||||
"block_hash": "0xb076fd3983e63bbf28ae615daa31c5b6084d23ceeb920c54f1ea666244415457",
|
||||
"burn_block_time": 1595229199,
|
||||
"block_height": 648,
|
||||
"tx_type": "smart_contract"
|
||||
}
|
||||
}
|
||||
}
|
||||
87
api/transaction/get-mempool-transactions.example.json
Normal file
87
api/transaction/get-mempool-transactions.example.json
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"limit": 96,
|
||||
"offset": 0,
|
||||
"total": 5,
|
||||
"results": [
|
||||
{
|
||||
"tx_id": "0xb31df5a363dad31723324cb5e0eefa04d491519fd30827a521cbc830114aa50c",
|
||||
"tx_status": "pending",
|
||||
"tx_type": "token_transfer",
|
||||
"receipt_time": 1598288370,
|
||||
"receipt_time_iso": "2020-08-24T16:59:30.000Z",
|
||||
"fee_rate": "180",
|
||||
"sender_address": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
|
||||
"sponsored": false,
|
||||
"post_condition_mode": "deny",
|
||||
"token_transfer": {
|
||||
"recipient_address": "ST1GY25DM8RZV4X15X07THRZ2C5NMWPGQWKFGV87F",
|
||||
"amount": "500000",
|
||||
"memo": "0x46617563657400000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tx_id": "0x5bed8e3f801cb4e2c74d2815a092f7c1c6a35f2fce4a80c80ca70848d34cb395",
|
||||
"tx_status": "pending",
|
||||
"tx_type": "token_transfer",
|
||||
"receipt_time": 1598282326,
|
||||
"receipt_time_iso": "2020-08-24T15:18:46.000Z",
|
||||
"fee_rate": "180",
|
||||
"sender_address": "ST1PS1KF93VBY5A1JV7TM66KN046KP3E3761DBSAG",
|
||||
"sponsored": false,
|
||||
"post_condition_mode": "deny",
|
||||
"token_transfer": {
|
||||
"recipient_address": "ST2H33S8SEY27QKEKQKR6S5PECYPKY45CQYGGQR8X",
|
||||
"amount": "1000",
|
||||
"memo": "0x00000000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tx_id": "0x9916036fde08a207e581cdcabc18ff55469861cb81194ab0e3e7c9a02cd5a17c",
|
||||
"tx_status": "pending",
|
||||
"tx_type": "smart_contract",
|
||||
"receipt_time": 1598258958,
|
||||
"receipt_time_iso": "2020-08-24T08:49:18.000Z",
|
||||
"fee_rate": "2000",
|
||||
"sender_address": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8",
|
||||
"sponsored": false,
|
||||
"post_condition_mode": "deny",
|
||||
"post_conditions": [],
|
||||
"smart_contract": {
|
||||
"contract_id": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8.test-loans-1",
|
||||
"source_code": "(define-data-var stx-loaned int 0)\n(define-data-var lockup-period int 0)\n(define-data-var stx-return int 0)\n(define-public (get-stx-return (stx uint) (months uint))\n (ok\n (begin\n (var-set stx-loaned (to-int(stx))\n (var-set lockup-period (to-int(months))\n (calculate-stx-return)\n (print (var-get stx-return))\n (transfer-to-server)\n )\n )\n)\n(define-private (calculate-stx-return)\n (ok\n (begin\n (var-set stx-return (- (+ (* (/ (* (var-get stx-loaned) 5) 100) (var-get lockup-period)) (var-get stx-loaned)) 5))\n )\n )\n)\n(define-private (transfer-to-server)\n (begin\n (unwrap-panic (stx-transfer? (to-uint (var-get stx-loaned)) tx-sender 'ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8))\n (ok (to-uint (var-get stx-loaned)))\n )\n)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tx_id": "0x871fb186c8d6ac6ede2822c71074d9884b593c0d7f2d0d6e8516e615484d7501",
|
||||
"tx_status": "pending",
|
||||
"tx_type": "smart_contract",
|
||||
"receipt_time": 1598230365,
|
||||
"receipt_time_iso": "2020-08-24T00:52:45.000Z",
|
||||
"fee_rate": "2000",
|
||||
"sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
|
||||
"sponsored": false,
|
||||
"post_condition_mode": "deny",
|
||||
"post_conditions": [],
|
||||
"smart_contract": {
|
||||
"contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230358601",
|
||||
"source_code": ";; ## CUSTOM FUNCTION TO EXTRACT A SUBSTRING\n\n(define-read-only (subs (source (buff 10)) \n (start int) \n (end int))\n (begin\n (unwrap-panic (if (and (<= 0 start) (<= start 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 0 end) (<= end 10)) (ok 1) (err \"Out of bounds: end\")))\n (let ((temp1 (fold subs1 source \n {start: start, end: end, cursor: 1, data: \"\"})))\n (let ((data (get data temp1))) \n data))))\n \n;; Call the function to extract the substring between the bounds:\n\n;; (subs \"123456789\" 2 5)\n\n(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int})) \n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp2 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp3 start)\n (temp4 cursor)\n (temp5 end))\n (and (<= temp3 temp4)\n (<= temp4 temp5)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp2),\n data: (get data temp2)})))\n"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tx_id": "0x66df10d99d3a26018f521d60e9f744b083386c73e47ad39c394d570abee55f1f",
|
||||
"tx_status": "pending",
|
||||
"tx_type": "smart_contract",
|
||||
"receipt_time": 1598230066,
|
||||
"receipt_time_iso": "2020-08-24T00:47:46.000Z",
|
||||
"fee_rate": "2000",
|
||||
"sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
|
||||
"sponsored": false,
|
||||
"post_condition_mode": "deny",
|
||||
"post_conditions": [],
|
||||
"smart_contract": {
|
||||
"contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230054238",
|
||||
"source_code": "(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int}))\n (begin\n (unwrap-panic (if (and (<= 1 (get start acc)) (<= (get start acc) 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 1 (get end acc)) (<= (get end acc) 10)) (ok 1) (err \"Out of bounds: end\")))\n (unwrap-panic (if (and (<= 1 (get cursor acc)) (<= (get cursor acc) 10)) (ok 1) (err \"Out of bounds: cursor\")))\n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp1 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp2 start)\n (temp3 cursor)\n (temp4 end))\n (and (<= temp2 temp3)\n (<= temp3 temp4)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp1),\n data: (get data temp1)}))))\n"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
24
api/transaction/get-transactions.example.json
Normal file
24
api/transaction/get-transactions.example.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"limit": 10,
|
||||
"offset": 0,
|
||||
"total": 101922,
|
||||
"results": [
|
||||
{
|
||||
"tx_id": "0x5e9f3933e358df6a73fec0d47ce3e1062c20812c129f5294e6f37a8d27c051d9",
|
||||
"tx_status": "success",
|
||||
"tx_type": "coinbase",
|
||||
"fee_rate": "0",
|
||||
"sender_address": "ST3WCQ6S0DFT7YHF53M8JPKGDS1N1GSSR91677XF1",
|
||||
"sponsored": false,
|
||||
"post_condition_mode": "deny",
|
||||
"block_hash": "0x58412b50266debd0c35b1a20348ad9c0f17e5525fb155a97033256c83c9e2491",
|
||||
"block_height": 3231,
|
||||
"burn_block_time": 1594230455,
|
||||
"canonical": true,
|
||||
"tx_index": 0,
|
||||
"coinbase_payload": {
|
||||
"data": "0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user