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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
|
|
|
|
2024-01-07 19:37:21 +01:00
|
|
|
const String getHistoryByAddressRelayQ = 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
|
|
|
|
2024-01-07 19:37:21 +01:00
|
|
|
const String getHistoryByAddressQ = r'''
|
|
|
|
query ($address: String!, $number: Int!, $offset: Int!) {
|
|
|
|
transaction_aggregate(where: {_or: [{issuer_pubkey: {_eq: $address}}, {receiver_pubkey: {_eq: $address}}]}) {
|
|
|
|
aggregate {
|
|
|
|
count
|
|
|
|
}
|
|
|
|
}
|
|
|
|
transaction(where: {_or: [{issuer_pubkey: {_eq: $address}}, {receiver_pubkey: {_eq: $address}}]}, order_by: {created_at: desc}, limit: $number, offset: $offset) {
|
|
|
|
amount
|
|
|
|
comment
|
|
|
|
created_at
|
|
|
|
issuer {
|
|
|
|
pubkey
|
|
|
|
identity {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
receiver {
|
|
|
|
pubkey
|
|
|
|
identity {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
|
|
|
|
2022-12-02 03:22:53 +01:00
|
|
|
const String getCertsReceived = r'''
|
|
|
|
query ($address: String!) {
|
2024-01-07 21:14:52 +01:00
|
|
|
certification(where: {receiver: {pubkey: {_eq: $address}}}, order_by: {created_at: desc}) {
|
2022-12-02 03:22:53 +01:00
|
|
|
issuer {
|
|
|
|
pubkey
|
|
|
|
name
|
|
|
|
}
|
|
|
|
created_at
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
2022-12-02 05:57:24 +01:00
|
|
|
|
|
|
|
const String getCertsSent = r'''
|
|
|
|
query ($address: String!) {
|
2024-01-07 21:14:52 +01:00
|
|
|
certification(where: {issuer: {pubkey: {_eq: $address}}}, order_by: {created_at: desc}) {
|
2022-12-02 05:57:24 +01:00
|
|
|
receiver {
|
|
|
|
pubkey
|
|
|
|
name
|
|
|
|
}
|
|
|
|
created_at
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
2022-12-02 21:18:28 +01:00
|
|
|
|
|
|
|
const String isIdtyExistQ = r'''
|
|
|
|
query ($name: String!) {
|
|
|
|
identity(where: {name: {_eq: $name}}) {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
2022-12-03 08:44:44 +01:00
|
|
|
|
|
|
|
const String getBlockchainStartQ = r'''
|
|
|
|
query {
|
|
|
|
block(limit: 1) {
|
|
|
|
created_at
|
|
|
|
number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
2024-01-06 01:18:50 +01:00
|
|
|
|
|
|
|
const String subscribeHistoryIssuedQ = r'''
|
|
|
|
subscription ($address: String!) {
|
|
|
|
account_by_pk(pubkey: $address) {
|
|
|
|
transactions_issued(limit: 1, order_by: {created_at: desc}) {
|
|
|
|
receiver_pubkey
|
|
|
|
amount
|
|
|
|
created_at
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|