2022-06-13 21:58:57 +02:00
|
|
|
const String getNameByAddressQ = r'''
|
|
|
|
query ($address: String!) {
|
2022-11-27 01:59:58 +01:00
|
|
|
account_by_pk(pubkey: $address) {
|
2022-06-13 21:58:57 +02:00
|
|
|
identity {
|
|
|
|
name
|
|
|
|
}
|
2022-11-27 01:59:58 +01:00
|
|
|
pubkey
|
2022-06-13 21:58:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
2022-06-14 01:23:53 +02:00
|
|
|
|
|
|
|
const String searchAddressByNameQ = r'''
|
|
|
|
query ($name: String!) {
|
|
|
|
search_identity(args: {name: $name}) {
|
2022-11-27 01:59:58 +01:00
|
|
|
pubkey
|
2022-06-14 01:23:53 +02:00
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
|
|
|
|
|
|
|
const String getHistoryByAddressQ = 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: [
|
2022-11-27 01:59:58 +01:00
|
|
|
{issuer_pubkey: {_eq: $address}},
|
|
|
|
{receiver_pubkey: {_eq: $address}}
|
2022-06-14 01:23:53 +02:00
|
|
|
]},
|
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
|
2022-11-27 01:59:58 +01:00
|
|
|
issuer_pubkey
|
|
|
|
receiver_pubkey
|
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());
|