Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portfolio transactions #449

Closed
rabbitz opened this issue Oct 11, 2023 · 3 comments
Closed

portfolio transactions #449

rabbitz opened this issue Oct 11, 2023 · 3 comments
Assignees

Comments

@rabbitz
Copy link

rabbitz commented Oct 11, 2023

GET /api/v2/portfolio/ckb_transactions

Request Parameters

Parameter Required Type Description
address_hash no String filter by address hash
tx_hash no String filter by transaction hash
sort no String sort transactions(default by block number desc) e.g. time.desc or time.asc
page no Integer paginate page number default is 1
page_size no Integer paginate per page size default is 10

Request Example

curl --location --request GET 'http://localhost:3000/api/v2/portfolio/ckb_transactions?page=1&page_size=25' \
--header 'Authorization: eyJhbGciOiJIUzI1NiJ9.eyJ1dWlkIjoiZWY0ZTU5ZTAtMGJiMi00N2U5LWE2ZjctOGQxYTQ1NWY3OGZhIiwiZXhwIjoxNjk5ODU4OTgwfQ.1m0Fa7c09PdUzsWKOpG2fqpzTzbD_64pKPGmK1SeaeY' \
--header 'Accept: */*' \
--header 'Host: localhost:3000' \
--header 'Connection: keep-alive'

Response Example

{
  "data": [
    {
      "id": "1682296",
      "type": "ckb_transactions",
      "attributes": {
        "is_cellbase": false,
        "transaction_hash": "0x14008e964e6a9007ace769a7185eb2535d210093360121d6e23d399e10697de7",
        "block_number": "1452597",
        "block_timestamp": "1586926257500",
        "display_inputs_count": 1,
        "display_outputs_count": 2,
        "display_inputs": [
          {
            "id": "158991",
            "from_cellbase": false,
            "capacity": "1000000000000.0",
            "occupied_capacity": "6100000000",
            "address_hash": "ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqds969pe0df6ms2e5tgx5g7d4qc700x72cs3tncd",
            "generated_tx_hash": "0xc43ed6038ab814e88d6ff5e3bfcef0f4f0cef6dfd1258f2bfd7e3a394ce0e761",
            "cell_index": "0",
            "cell_type": "normal",
            "since": {
              "raw": "0x0000000000000000",
              "median_timestamp": "1586926072580"
            }
          }
        ],
        "display_outputs": [
          {
            "id": "1918557",
            "capacity": "399900000000.0",
            "occupied_capacity": "6100000000",
            "address_hash": "ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqw9m7u3t455cvlmvdy7yxh73xks8nzan5q774mz9",
            "status": "dead",
            "consumed_tx_hash": "0x3851d2f80445c8077cddf03c067f8ba9511d70c2ffdf5544031cd8f517e7fed0",
            "cell_type": "normal"
          },
          {
            "id": "1918558",
            "capacity": "600099500000.0",
            "occupied_capacity": "6100000000",
            "address_hash": "ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqwkqeajhd7m8lcq6w54t3r5f45zet3n6xqhfkdg5",
            "status": "dead",
            "consumed_tx_hash": "0x9756c9f79b6588427fd63636fa1139522f04725cc32db60db3fceb0a4112ef46",
            "cell_type": "normal"
          }
        ],
        "income": "-1000000000000.0"
      }
    }...
  ],
  "meta": {
    "total": 4,
    "page_size": 10
  }
}
@rabbitz rabbitz self-assigned this Oct 11, 2023
@rabbitz rabbitz changed the title portfolio sync transactions portfolio transactions Oct 11, 2023
@rabbitz rabbitz moved this to 🏗 In Progress in CKB Explorer Oct 30, 2023
@rabbitz rabbitz moved this from 🏗 In Progress to 🔎 Code Review in CKB Explorer Nov 6, 2023
@zhangyouxin zhangyouxin mentioned this issue Nov 20, 2023
2 tasks
@poor-defined poor-defined moved this from 🔎 Code Review to 👀 Testing in CKB Explorer Dec 25, 2023
@FrederLu
Copy link

Image
Image

The interface returns 500.

@rabbitz
Copy link
Author

rabbitz commented Jan 30, 2024

@FrederLu
Copy link

nervosnetwork/ckb-explorer#1609

Verified.

@FrederLu FrederLu moved this from 👀 Testing to ✅ Done in CKB Explorer Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants