Skip to content

Commit

Permalink
add graphql definitions...
Browse files Browse the repository at this point in the history
  • Loading branch information
astinz committed May 26, 2024
1 parent 5b5b93e commit 457cd7e
Show file tree
Hide file tree
Showing 21 changed files with 332 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
lib/src/commonMain/resources/

### IntelliJ IDEA ###
.idea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ internal suspend fun getIndexerLastSuccessVersion(aptosConfig: AptosConfig): Opt
val statuses = getProcessorStatuses(aptosConfig)

return if (statuses is Option.Some) {
Option.Some(statuses.value.processor_status.first().last_success_version)
Option.Some(statuses.value.processor_status.first().last_success_version.toLong())
} else {
Option.None
}
Expand Down
17 changes: 17 additions & 0 deletions lib/src/commonMain/resources/TokenActivitiesFieldsFragment.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
fragment TokenActivitiesFields on token_activities_v2 {
after_value
before_value
entry_function_id_str
event_account_address
event_index
from_address
is_fungible_v2
property_version_v1
to_address
token_amount
token_data_id
token_standard
transaction_timestamp
transaction_version
type
}
9 changes: 9 additions & 0 deletions lib/src/commonMain/resources/ansTokenFragment.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fragment AnsTokenFragment on current_aptos_names {
domain
expiration_timestamp
registered_address
subdomain
token_standard
is_primary
owner_address
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
token_standard
token_properties_mutated_v1
token_data_id
table_type_v1
storage_id
property_version_v1
owner_address
last_transaction_version
last_transaction_timestamp
is_soulbound_v2
is_fungible_v2
amount
current_token_data {
collection_id
description
is_fungible_v2
largest_property_version_v1
last_transaction_timestamp
last_transaction_version
maximum
supply
token_data_id
token_name
token_properties
token_standard
token_uri
current_collection {
collection_id
collection_name
creator_address
current_supply
description
last_transaction_timestamp
last_transaction_version
max_supply
mutable_description
mutable_uri
table_handle_v1
token_standard
total_minted_v2
uri
}
}
}
7 changes: 7 additions & 0 deletions lib/src/commonMain/resources/getAccountCoinCount.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query getAccountCoinsCount($address: String) {
current_fungible_asset_balances_aggregate(where: { owner_address: { _eq: $address } }) {
aggregate {
count
}
}
}
32 changes: 32 additions & 0 deletions lib/src/commonMain/resources/getAccountCoinsData.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
query getAccountCoinsData(
$where_condition: current_fungible_asset_balances_bool_exp!
$offset: Int
$limit: Int
$order_by: [current_fungible_asset_balances_order_by!]
) {
current_fungible_asset_balances(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by) {
amount
asset_type
is_frozen
is_primary
last_transaction_timestamp
last_transaction_version
owner_address
storage_id
token_standard
metadata {
token_standard
symbol
supply_aggregator_table_key_v1
supply_aggregator_table_handle_v1
project_uri
name
last_transaction_version
last_transaction_timestamp
icon_uri
decimals
creator_address
asset_type
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
query getAccountCollectionsWithOwnedTokens(
$where_condition: current_collection_ownership_v2_view_bool_exp!
$offset: Int
$limit: Int
$order_by: [current_collection_ownership_v2_view_order_by!]
) {
current_collection_ownership_v2_view(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by) {
current_collection {
collection_id
collection_name
creator_address
current_supply
description
last_transaction_timestamp
last_transaction_version
mutable_description
max_supply
mutable_uri
table_handle_v1
token_standard
total_minted_v2
uri
}
collection_id
collection_name
collection_uri
creator_address
distinct_tokens
last_transaction_version
owner_address
single_token_uri
}
}
16 changes: 16 additions & 0 deletions lib/src/commonMain/resources/getAccountOwnedObjects.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
query getAccountOwnedObjects(
$where_condition: current_objects_bool_exp
$offset: Int
$limit: Int
$order_by: [current_objects_order_by!]
) {
current_objects(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by) {
allow_ungated_transfer
state_key_hash
owner_address
object_address
last_transaction_version
last_guid_creation_num
is_deleted
}
}
7 changes: 7 additions & 0 deletions lib/src/commonMain/resources/getAccountTokensCount.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {
current_token_ownerships_v2_aggregate(where: $where_condition, offset: $offset, limit: $limit) {
aggregate {
count
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query getAccountTransactionsCount($address: String) {
account_transactions_aggregate(where: { account_address: { _eq: $address } }) {
aggregate {
count
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
query getChainTopUserTransactions($limit: Int) {
user_transactions(limit: $limit, order_by: { version: desc }) {
version
}
}
20 changes: 20 additions & 0 deletions lib/src/commonMain/resources/getCollectionData.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
query getCollectionData(
$where_condition: current_collections_v2_bool_exp!
) {
current_collections_v2(where: $where_condition) {
collection_id
collection_name
creator_address
current_supply
description
last_transaction_timestamp
last_transaction_version
max_supply
mutable_description
mutable_uri
table_handle_v1
token_standard
total_minted_v2
uri
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
query getCurrentFungibleAssetBalances(
$where_condition: current_fungible_asset_balances_bool_exp
$offset: Int
$limit: Int
) {
current_fungible_asset_balances(where: $where_condition, offset: $offset, limit: $limit) {
amount
asset_type
is_frozen
is_primary
last_transaction_timestamp
last_transaction_version
owner_address
storage_id
token_standard
}
}
12 changes: 12 additions & 0 deletions lib/src/commonMain/resources/getDelegatedStakingActivities.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {
delegated_staking_activities(
where: { delegator_address: { _eq: $delegatorAddress }, pool_address: { _eq: $poolAddress } }
) {
amount
delegator_address
event_index
event_type
pool_address
transaction_version
}
}
13 changes: 13 additions & 0 deletions lib/src/commonMain/resources/getEvents.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {
events(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by) {
account_address
creation_number
data
event_index
sequence_number
transaction_block_height
transaction_version
type
indexed_type
}
}
20 changes: 20 additions & 0 deletions lib/src/commonMain/resources/getFungibleAssetActivities.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {
fungible_asset_activities(where: $where_condition, offset: $offset, limit: $limit) {
amount
asset_type
block_height
entry_function_id_str
event_index
gas_fee_payer_address
is_frozen
is_gas_fee
is_transaction_success
owner_address
storage_id
storage_refund_amount
token_standard
transaction_timestamp
transaction_version
type
}
}
16 changes: 16 additions & 0 deletions lib/src/commonMain/resources/getFungibleAssetMetadata.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {
fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {
icon_uri
project_uri
supply_aggregator_table_handle_v1
supply_aggregator_table_key_v1
creator_address
asset_type
decimals
last_transaction_timestamp
last_transaction_version
name
symbol
token_standard
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
query getNumberOfDelegators(
$where_condition: num_active_delegator_per_pool_bool_exp
$order_by: [num_active_delegator_per_pool_order_by!]
) {
num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {
num_active_delegator
pool_address
}
}
7 changes: 7 additions & 0 deletions lib/src/commonMain/resources/getProcessorStatus.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query getProcessorStatus($where_condition: processor_status_bool_exp) {
processor_status(where: $where_condition) {
last_success_version
processor
last_updated
}
}
39 changes: 39 additions & 0 deletions lib/src/commonMain/resources/getTokenData.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
query getTokenData(
$where_condition: current_token_datas_v2_bool_exp
$offset: Int
$limit: Int
$order_by: [current_token_datas_v2_order_by!]
) {
current_token_datas_v2(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by) {
collection_id
description
is_fungible_v2
largest_property_version_v1
last_transaction_timestamp
last_transaction_version
maximum
supply
token_data_id
token_name
token_properties
token_standard
token_uri
decimals
current_collection {
collection_id
collection_name
creator_address
current_supply
description
last_transaction_timestamp
last_transaction_version
max_supply
mutable_description
mutable_uri
table_handle_v1
token_standard
total_minted_v2
uri
}
}
}

0 comments on commit 457cd7e

Please sign in to comment.