2022-06-13 21:58:57 +02:00
|
|
|
const String getNameByAddressQ = r'''
|
|
|
|
query ($address: String!) {
|
|
|
|
account_by_pk(id: $address) {
|
|
|
|
identity {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
2022-06-14 01:23:53 +02:00
|
|
|
|
|
|
|
const String searchAddressByNameQ = r'''
|
|
|
|
query ($name: String!) {
|
|
|
|
search_identity(args: {name: $name}) {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
|
|
|
|
|
|
|
const String getHistoryByAddressQ = r'''
|
|
|
|
query ($address: String!) {
|
|
|
|
account_by_pk(id: "5CQ8T4qpbYJq7uVsxGPQ5q2df7x3Wa4aRY6HUWMBYjfLZhnn") {
|
|
|
|
transactions_issued {
|
|
|
|
receiver_id
|
|
|
|
amount
|
|
|
|
created_at
|
|
|
|
created_on
|
|
|
|
}
|
|
|
|
transactions_received {
|
|
|
|
issuer_id
|
|
|
|
amount
|
|
|
|
created_at
|
|
|
|
created_on
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
|
|
|
|
|
|
|
const String getHistoryByAddressQ2 = r'''
|
|
|
|
query ($address: String!) {
|
|
|
|
{
|
|
|
|
transaction(where: {_or: [{issuer_id: {_eq: $address}},
|
|
|
|
{receiver_id: {_eq: $address}}]}, order_by: {created_at: desc})
|
|
|
|
{
|
|
|
|
amount
|
|
|
|
created_at
|
|
|
|
issuer_id
|
|
|
|
receiver_id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
|
|
|
|
|
|
|
const String getHistoryByAddressQ3 = r'''
|
2022-06-16 19:45:34 +02:00
|
|
|
query ($address: String!, $number: Int!, $cursor: String) {
|
2022-06-14 01:23:53 +02:00
|
|
|
transaction_connection(where:
|
|
|
|
{_or: [
|
|
|
|
{issuer_id: {_eq: $address}},
|
|
|
|
{receiver_id: {_eq: $address}}
|
|
|
|
]},
|
2022-06-16 19:45:34 +02:00
|
|
|
order_by: {created_at: desc},
|
|
|
|
first: $number,
|
|
|
|
after: $cursor) {
|
2022-06-14 01:23:53 +02:00
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
amount
|
|
|
|
created_at
|
|
|
|
issuer_id
|
|
|
|
receiver_id
|
2022-06-16 19:45:34 +02:00
|
|
|
issuer {
|
|
|
|
identity {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
receiver {
|
|
|
|
identity {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
2022-06-14 01:23:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
pageInfo {
|
|
|
|
endCursor
|
|
|
|
hasNextPage
|
|
|
|
hasPreviousPage
|
|
|
|
startCursor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
2022-06-14 01:24:11 +02:00
|
|
|
|
|
|
|
// To parse indexer date format
|
|
|
|
// log.d(DateTime.parse("2022-06-13T16:51:24.001+00:00").toString());
|