Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions files/grest/rpc/address/address_list.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE OR REPLACE FUNCTION grest.address_list()
RETURNS TABLE (
address varchar,
address_hex text,
script_address boolean,
payment_cred text,
stake_address text
)
LANGUAGE sql STABLE
AS $$
SELECT
a.address,
ENCODE(a.raw, 'hex'),
a.has_script,
ENCODE(a.payment_cred, 'hex'),
grest.cip5_hex_to_stake_addr(sa.hash_raw)
FROM address AS a
LEFT JOIN stake_address AS sa ON sa.id = a.stake_address_id
ORDER BY a.id;
$$;

COMMENT ON FUNCTION grest.address_list IS 'Get a list of all addresses'; -- noqa: LT01
47 changes: 47 additions & 0 deletions specs/results/koiosapi-guild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,26 @@ paths:
- color: red
label: "Deprecated"

/address_list: #RPC
get:
tags:
- Address
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/address_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Address List
description: Get a list of all addresses
operationId: address_list
/address_info: #RPC
post:
tags:
Expand Down Expand Up @@ -4653,6 +4673,33 @@ components:
plutus_contracts:
$ref: "#/components/schemas/tx_info/items/properties/plutus_contracts"

address_list:
description: Array of address IDs
type: array
items:
type: object
properties:
address:
$ref: "#/components/schemas/utxo_infos/items/properties/address"
address_hex:
type: string
description: Cardano payment address in hex format
example: 018e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e8c5a8e9d1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4
script_address:
type: boolean
description: Signifies whether the address is a script address
example: false
payment_cred:
anyOf:
- type: string
- type: "null"
description: Payment credential in hex format
example: 8e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e
stake_address:
anyOf:
- $ref: "#/components/schemas/account_history/items/properties/stake_address"
- type: "null"

address_info:
description: Array of information for address(es)
type: array
Expand Down
47 changes: 47 additions & 0 deletions specs/results/koiosapi-mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,26 @@ paths:
- color: red
label: "Deprecated"

/address_list: #RPC
get:
tags:
- Address
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/address_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Address List
description: Get a list of all addresses
operationId: address_list
/address_info: #RPC
post:
tags:
Expand Down Expand Up @@ -4653,6 +4673,33 @@ components:
plutus_contracts:
$ref: "#/components/schemas/tx_info/items/properties/plutus_contracts"

address_list:
description: Array of address IDs
type: array
items:
type: object
properties:
address:
$ref: "#/components/schemas/utxo_infos/items/properties/address"
address_hex:
type: string
description: Cardano payment address in hex format
example: 018e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e8c5a8e9d1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4
script_address:
type: boolean
description: Signifies whether the address is a script address
example: false
payment_cred:
anyOf:
- type: string
- type: "null"
description: Payment credential in hex format
example: 8e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e
stake_address:
anyOf:
- $ref: "#/components/schemas/account_history/items/properties/stake_address"
- type: "null"

address_info:
description: Array of information for address(es)
type: array
Expand Down
47 changes: 47 additions & 0 deletions specs/results/koiosapi-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,26 @@ paths:
- color: red
label: "Deprecated"

/address_list: #RPC
get:
tags:
- Address
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/address_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Address List
description: Get a list of all addresses
operationId: address_list
/address_info: #RPC
post:
tags:
Expand Down Expand Up @@ -4653,6 +4673,33 @@ components:
plutus_contracts:
$ref: "#/components/schemas/tx_info/items/properties/plutus_contracts"

address_list:
description: Array of address IDs
type: array
items:
type: object
properties:
address:
$ref: "#/components/schemas/utxo_infos/items/properties/address"
address_hex:
type: string
description: Cardano payment address in hex format
example: 018e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e8c5a8e9d1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4
script_address:
type: boolean
description: Signifies whether the address is a script address
example: false
payment_cred:
anyOf:
- type: string
- type: "null"
description: Payment credential in hex format
example: 8e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e
stake_address:
anyOf:
- $ref: "#/components/schemas/account_history/items/properties/stake_address"
- type: "null"

address_info:
description: Array of information for address(es)
type: array
Expand Down
47 changes: 47 additions & 0 deletions specs/results/koiosapi-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,26 @@ paths:
- color: red
label: "Deprecated"

/address_list: #RPC
get:
tags:
- Address
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/address_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Address List
description: Get a list of all addresses
operationId: address_list
/address_info: #RPC
post:
tags:
Expand Down Expand Up @@ -4653,6 +4673,33 @@ components:
plutus_contracts:
$ref: "#/components/schemas/tx_info/items/properties/plutus_contracts"

address_list:
description: Array of address IDs
type: array
items:
type: object
properties:
address:
$ref: "#/components/schemas/utxo_infos/items/properties/address"
address_hex:
type: string
description: Cardano payment address in hex format
example: 018e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e8c5a8e9d1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4
script_address:
type: boolean
description: Signifies whether the address is a script address
example: false
payment_cred:
anyOf:
- type: string
- type: "null"
description: Payment credential in hex format
example: 8e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e
stake_address:
anyOf:
- $ref: "#/components/schemas/account_history/items/properties/stake_address"
- type: "null"

address_info:
description: Array of information for address(es)
type: array
Expand Down
27 changes: 27 additions & 0 deletions specs/templates/4-api-schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,33 @@ schemas:
plutus_contracts:
$ref: "#/components/schemas/tx_info/items/properties/plutus_contracts"

address_list:
description: Array of address IDs
type: array
items:
type: object
properties:
address:
$ref: "#/components/schemas/utxo_infos/items/properties/address"
address_hex:
type: string
description: Cardano payment address in hex format
example: 018e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e8c5a8e9d1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4
script_address:
type: boolean
description: Signifies whether the address is a script address
example: false
payment_cred:
anyOf:
- type: string
- type: "null"
description: Payment credential in hex format
example: 8e8d58579c0b26d64f0e8e93c1febbe73b8f6a5a3f1e4b4e
stake_address:
anyOf:
- $ref: "#/components/schemas/account_history/items/properties/stake_address"
- type: "null"

address_info:
description: Array of information for address(es)
type: array
Expand Down
20 changes: 20 additions & 0 deletions specs/templates/api-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,26 @@ paths:
- color: red
label: "Deprecated"

/address_list: #RPC
get:
tags:
- Address
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/address_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Address List
description: Get a list of all addresses
operationId: address_list
/address_info: #RPC
post:
tags:
Expand Down