Skip to content

Commit 2388690

Browse files
Merge pull request #91 from MarryamZulfiqar/main
Added get-token-holder-count-by-contract-address API endpoint
2 parents 3052922 + 91e45e3 commit 2388690

6 files changed

Lines changed: 269 additions & 0 deletions

File tree

docs/api/mainnet.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,56 @@ servers:
1111
- url: https://openapi.coredao.org/
1212

1313
paths:
14+
/api/token/token_holder_count:
15+
get:
16+
summary: Get Token Holder Count by Contract Address
17+
description: Returns the number of token holders for a given contract address.
18+
parameters:
19+
- name: contractaddress
20+
in: query
21+
required: true
22+
description: The contract address of the token to retrieve holder count for.
23+
schema:
24+
type: string
25+
example: "0x81bcea03678d1cef4830942227720d542aa15817"
26+
- name: apikey
27+
in: query
28+
required: true
29+
description: API key for authentication.
30+
schema:
31+
type: string
32+
example: ""
33+
responses:
34+
'200':
35+
description: Token holder count retrieved successfully.
36+
content:
37+
application/json:
38+
schema:
39+
type: object
40+
properties:
41+
status:
42+
type: string
43+
description: Status code of the response.
44+
result:
45+
type: integer
46+
description: The number of token holders for the given contract address.
47+
message:
48+
type: string
49+
description: Additional information or message about the response.
50+
'400':
51+
description: Invalid contract address or API key supplied.
52+
content:
53+
application/json:
54+
schema:
55+
type: object
56+
properties:
57+
status:
58+
type: string
59+
description: Status code of the error response.
60+
message:
61+
type: string
62+
description: Error message explaining the issue.
63+
1464
/api/accounts/core_balance_by_address/{address}:
1565
get:
1666
tags:
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
id: get-token-holder-count-by-contract-address
3+
title: "Get Token Holder Count by Contract Address"
4+
description: "Returns the number of token holders for a given contract address."
5+
sidebar_label: "Get Token Holder Count by Contract Address"
6+
hide_title: true
7+
hide_table_of_contents: true
8+
api: eJzNVU1v2zgQ/SsETy2gWrabNqluRjZoAxTdRZOegqCgqbHFRiLZ4dCJYei/F0NJrmO7SffjsD5YNjUzfPPefGxkCUGj8WSclYX8DBTRBkEVCBubOaBwC0HuDqyoXF0CBrFwKJRYmhVYoZ0lVJqEKkuEEEYyk16haoAAgyxuNtKqBmQhB8veUGbS8IXfI+BaZhLhezQIpSwII2R7sK4rOLgqAaugB0dOIBAaWEEPVGgXLTFaBhV0BY2SxUbS2jOeQGjsUraZhAfV+JrPxg9nk7kGNX799vSsnGhYnJy9Hr87mU6np6fTcfnmZKrU5M3Z5FS22TYz5c0drP9eQrO/LsUdrDsuI1VgyWjFL38brGxv+ZbgnQ0Q2Hg6HvNjj7od7XpKBqJKEaLWEMIi1vWaL2aOwRJHUd7XPaT8W+BQm0Ncbv4NNLHm6DwgmQ5IIEUxHOLfZ+Eq2QntShjUHBIacbIIIda0E8dYgiXgQaDrZ8qVI/+qYNtMNhCCWsLzgGdlafinqoWxC4dN4kc4FH0IoeYu0n4m6ZPJk2P6XNqVqk15pLxRDFUSIosB5f9DIkB0+Fio3ybwIvkOZMGDr5Wxxi5TYBNC3NKVolLlSlnIJaQEFFWykLnyJk8Sd99fO6G/ptrm5gFcDbMnYi0LWRH5UOS582CVNyPtEErlRg6Xeeoi1jJhN5Raa+aN+MPp2IClRO9hIRyxIMAm/Lm4AlwZzWEi2oIcj7raaLAh8dMPjZlXugIxHY1ltgOzyPP7+/uRSm8TwN415B8vzy8+XV28Ypc2k5xjh2XSHXgXqFF25473QKJr/w9d+5+n9p+vxflQbLPtNH6U3+Znmf0nK6EvCoIHypPkDDhlvellveExypYcd3g+lvY2k5ULxLabzVwF+IJ12/JxN3NZ8NIENa956i5UHfbH7m5aLz73A/ql+Pfb5Wh+vBSO7b2VqmM3wLN/CPjp7fEEmO2q+onhlv+gYRCyuLltM1mBKgETnZ3XTGvwtON1MHg4yrZb319cy7b9AdKV5qI=
9+
sidebar_class_name: "get api-method"
10+
info_path: docs/api/mainnet/api-documentation
11+
custom_edit_url: null
12+
---
13+
14+
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
15+
import ParamsDetails from "@theme/ParamsDetails";
16+
import RequestSchema from "@theme/RequestSchema";
17+
import StatusCodes from "@theme/StatusCodes";
18+
import OperationTabs from "@theme/OperationTabs";
19+
import TabItem from "@theme/TabItem";
20+
import Heading from "@theme/Heading";
21+
22+
<Heading
23+
as={"h1"}
24+
className={"openapi__heading"}
25+
children={"Get Token Holder Count by Contract Address"}
26+
>
27+
</Heading>
28+
29+
<MethodEndpoint
30+
method={"get"}
31+
path={"/api/token/token_holder_count"}
32+
context={"endpoint"}
33+
>
34+
35+
</MethodEndpoint>
36+
37+
38+
39+
Returns the number of token holders for a given contract address.
40+
41+
<Heading
42+
id={"request"}
43+
as={"h2"}
44+
className={"openapi-tabs__heading"}
45+
children={"Request"}
46+
>
47+
</Heading>
48+
49+
<ParamsDetails
50+
parameters={[{"name":"contractaddress","in":"query","required":true,"description":"The contract address of the token to retrieve holder count for.","schema":{"type":"string"},"example":"0x81bcea03678d1cef4830942227720d542aa15817"},{"name":"apikey","in":"query","required":true,"description":"API key for authentication.","schema":{"type":"string"},"example":""}]}
51+
>
52+
53+
</ParamsDetails>
54+
55+
<RequestSchema
56+
title={"Body"}
57+
body={undefined}
58+
>
59+
60+
</RequestSchema>
61+
62+
<StatusCodes
63+
id={undefined}
64+
label={undefined}
65+
responses={{"200":{"description":"Token holder count retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Status code of the response."},"result":{"type":"integer","description":"The number of token holders for the given contract address."},"message":{"type":"string","description":"Additional information or message about the response."}}}}}},"400":{"description":"Invalid contract address or API key supplied.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Status code of the error response."},"message":{"type":"string","description":"Error message explaining the issue."}}}}}}}}
66+
>
67+
68+
</StatusCodes>
69+
70+
71+

docs/api/mainnet/sidebar.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
22

33
const sidebar: SidebarsConfig = {
44
apisidebar: [
5+
{
6+
7+
type: "category",
8+
label: "Tokens",
9+
items: [
10+
{
11+
type: "doc",
12+
id: "api/mainnet/get-token-holder-count-by-contract-address",
13+
label: "Get Token Holder Count by Contract Address",
14+
className: "api-method get",
15+
},
16+
]
17+
},
518
{
619
type: "category",
720
label: "Accounts",

docs/api/testnet.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,57 @@ servers:
1111
- url: https://api.test2.btcs.network/
1212

1313
paths:
14+
15+
/api/token/token_holder_count:
16+
get:
17+
summary: Get Token Holder Count by Contract Address
18+
description: Returns the number of token holders for a given contract address.
19+
parameters:
20+
- name: contractaddress
21+
in: query
22+
required: true
23+
description: The contract address of the token to retrieve holder count for.
24+
schema:
25+
type: string
26+
example: "0x81bcea03678d1cef4830942227720d542aa15817"
27+
- name: apikey
28+
in: query
29+
required: true
30+
description: API key for authentication.
31+
schema:
32+
type: string
33+
example: ""
34+
responses:
35+
'200':
36+
description: Token holder count retrieved successfully.
37+
content:
38+
application/json:
39+
schema:
40+
type: object
41+
properties:
42+
status:
43+
type: string
44+
description: Status code of the response.
45+
result:
46+
type: integer
47+
description: The number of token holders for the given contract address.
48+
message:
49+
type: string
50+
description: Additional information or message about the response.
51+
'400':
52+
description: Invalid contract address or API key supplied.
53+
content:
54+
application/json:
55+
schema:
56+
type: object
57+
properties:
58+
status:
59+
type: string
60+
description: Status code of the error response.
61+
message:
62+
type: string
63+
description: Error message explaining the issue.
64+
1465
/api/accounts/core_balance_by_address/{address}:
1566
get:
1667
tags:
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
id: get-token-holder-count-by-contract-address
3+
title: "Get Token Holder Count by Contract Address"
4+
description: "Returns the number of token holders for a given contract address."
5+
sidebar_label: "Get Token Holder Count by Contract Address"
6+
hide_title: true
7+
hide_table_of_contents: true
8+
api: eJzNVU1v2zgQ/SsET1tAa9luukl1M7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url: null
12+
---
13+
14+
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
15+
import ParamsDetails from "@theme/ParamsDetails";
16+
import RequestSchema from "@theme/RequestSchema";
17+
import StatusCodes from "@theme/StatusCodes";
18+
import OperationTabs from "@theme/OperationTabs";
19+
import TabItem from "@theme/TabItem";
20+
import Heading from "@theme/Heading";
21+
22+
<Heading
23+
as={"h1"}
24+
className={"openapi__heading"}
25+
children={"Get Token Holder Count by Contract Address"}
26+
>
27+
</Heading>
28+
29+
<MethodEndpoint
30+
method={"get"}
31+
path={"/api/token/token_holder_count"}
32+
context={"endpoint"}
33+
>
34+
35+
</MethodEndpoint>
36+
37+
38+
39+
Returns the number of token holders for a given contract address.
40+
41+
<Heading
42+
id={"request"}
43+
as={"h2"}
44+
className={"openapi-tabs__heading"}
45+
children={"Request"}
46+
>
47+
</Heading>
48+
49+
<ParamsDetails
50+
parameters={[{"name":"contractaddress","in":"query","required":true,"description":"The contract address of the token to retrieve holder count for.","schema":{"type":"string"},"example":"0x81bcea03678d1cef4830942227720d542aa15817"},{"name":"apikey","in":"query","required":true,"description":"API key for authentication.","schema":{"type":"string"},"example":""}]}
51+
>
52+
53+
</ParamsDetails>
54+
55+
<RequestSchema
56+
title={"Body"}
57+
body={undefined}
58+
>
59+
60+
</RequestSchema>
61+
62+
<StatusCodes
63+
id={undefined}
64+
label={undefined}
65+
responses={{"200":{"description":"Token holder count retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Status code of the response."},"result":{"type":"integer","description":"The number of token holders for the given contract address."},"message":{"type":"string","description":"Additional information or message about the response."}}}}}},"400":{"description":"Invalid contract address or API key supplied.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Status code of the error response."},"message":{"type":"string","description":"Error message explaining the issue."}}}}}}}}
66+
>
67+
68+
</StatusCodes>
69+
70+
71+

docs/api/testnet/sidebar.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
22

33
const sidebar: SidebarsConfig = {
44
apisidebar: [
5+
{
6+
7+
type: "category",
8+
label: "Tokens",
9+
items: [
10+
{
11+
type: "doc",
12+
id: "api/testnet/get-token-holder-count-by-contract-address",
13+
label: "Get Token Holder Count by Contract Address",
14+
className: "api-method get",
15+
},
16+
]
17+
},
518
{
619
type: "category",
720
label: "Accounts",

0 commit comments

Comments
 (0)