Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove exodvs and deploy mainnet #7

Merged
merged 8 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion .project-cid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
QmdKg5RktekMJbH1RjoTSfc8Uji9y4HVHpVVHBQW2z29qR
QmVWdJJxQwmYmzGgjfGC3cXuUAe1BuahxxkAP9jyTGq2jD
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This project is a working example of a SubQuery project that indexes data from t

Currently, this project indexes the following contracts:
- [Smart Accounts](https://github.com/burnt-labs/contracts)
- [Hubs and seats](https://github.com/burnt-labs/burnt-cw-hubs)

## Start

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
retries: 5

subquery-node:
image: subquerynetwork/subql-node-cosmos:v3.2.0
image: subquerynetwork/subql-node-cosmos:v3.11.2
depends_on:
"postgres":
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"license": "MIT",
"devDependencies": {
"@cosmjs/stargate": "^0.28.9",
"@subql/cli": "^4.0.5",
"@subql/cli": "^4.13.1",
"@subql/node-cosmos": "latest",
"@subql/testing": "latest",
"@types/uuid": "^9.0.5",
Expand Down
58 changes: 1 addition & 57 deletions project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import {
} from "@subql/types-cosmos";

// These defaults are the testnet values
const HUB_CONTRACT_CODE_ID = process.env.HUB_CONTRACT_CODE_ID || "7";
const SMART_ACCOUNT_CONTRACT_CODE_ID =
process.env.SMART_ACCOUNT_CONTRACT_CODE_ID || "793";

const CHAIN_ID = process.env.CHAIN_ID || "xion-testnet-1";
const ENDPOINT_URL =
process.env.ENDPOINT_URL || "https://rpc.xion-testnet-1.burnt.com:443";
const START_BLOCK = Number(process.env.START_BLOCK || "9238800");
const START_BLOCK = Number(process.env.START_BLOCK || "3371922");

const project: CosmosProject = {
specVersion: "1.0.0",
Expand Down Expand Up @@ -69,61 +68,6 @@ const project: CosmosProject = {
mapping: {
file: "./dist/index.js",
handlers: [
// Hub contract handlers
{
handler: "handleHubContractInstantiate",
kind: CosmosHandlerKind.Event,
filter: {
type: "instantiate",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgInstantiateContract",
values: {
codeId: HUB_CONTRACT_CODE_ID,
},
},
},
},
{
handler: "handleHubContractInstantiateMetadata",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-metadata-instantiate",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgInstantiateContract",
},
},
},
// Seat contract handlers
{
handler: "handleSeatContractInstantiateMetadata",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-metadata-instantiate",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgInstantiateContract",
},
},
},
{
handler: "handleSeatContractPrimarySaleCreated",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-sales-add_primary_sale",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgExecuteContract",
},
},
},
{
handler: "handleSeatContractPrimarySaleHalted",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-sales-halt_sale",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgExecuteContract",
},
},
},
{
handler: "handleSmartAccountContractInstantiateMetadata",
kind: CosmosHandlerKind.Event,
Expand Down
71 changes: 0 additions & 71 deletions schema.graphql
Original file line number Diff line number Diff line change
@@ -1,77 +1,6 @@
# To improve query performance, we strongly suggest adding indexes to any field that you plan to filter or sort by
# Add the `@index` or `@index(unique: true)` annotation after any non-key field
# https://academy.subquery.network/build/graphql.html#indexing-by-non-primary-key-field

type AllHub @entity {
id: ID! # The block height
hub: Hub @derivedFrom(field: "allHub") # This is a lookup for the hub contract deployed by hub
}

# This entity stores hub's seat details
type HubSeat @entity {
id: ID! # The hub contract address
seatContracts: [String]! # Array of seat contract addresses for this hub
latestSeat: Seat @derivedFrom(field: "hubSeat") # This is a lookup for the latest seat contract deployed by hub
}

type Hub @entity {
id: ID! # The hub contract address
allHub: AllHub! # This id is always pointing to the "hubs" key
name: String!
hub_url: String!
description: String!
tags: [String]!
social_links: [SocialLink]! @derivedFrom(field: "hub")
creator: String!
owner: String! # The owner of the hub can change e.g. when the hub is transferred
thumbnail_image_url: String!
banner_image_url: String!
seat_contracts: [Seat] @derivedFrom(field: "hub")
}

type SocialLink @entity {
id: ID!
hub: Hub! # The hub contract address
name: String!
url: String!
}

type Seat @entity {
id: ID! # The seat contract address
hub: Hub! # Hub this Seat belongs to
hubSeat: HubSeat! # HubSeat container this seat belongs to
name: String!
image_uri: String!
description: String!
benefits: [SeatBenefit!]! @derivedFrom(field: "benefitSeat")
saleDetail: Sale! @derivedFrom(field: "saleSeat") # Lookup for the sale details of this seat
}

type SeatBenefit @entity {
id: ID! # The seat contract address
benefitSeat: Seat!
name: String!
status: String!
}

type Sale @entity {
id: ID! # The seat contract address
saleSeat: Seat! # The seat contract address this sale belongs to
totalSupply: BigInt!
tokensMinted: BigInt!
startTime: BigInt!
endTime: BigInt!
price: [Coin]! @derivedFrom(field: "sale")
disabled: Boolean!
}

type Coin @entity {
id: ID! # The seat contract address
sale: Sale! # The seat address + sale time to make this unique
denom: String!
amount: BigInt!
}

type SmartAccount @entity {
id: ID! # The smart wallet contract address
latestAuthenticatorId: Int! # The id of the latest authenticator
Expand Down
81 changes: 0 additions & 81 deletions src/hubs/index.ts

This file was deleted.

44 changes: 0 additions & 44 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
export interface HubMetadata {
name: string;
hub_url: string;
description: string;
tags: Array<string>;
social_links: Array<SocialLink>;
creator: string;
thumbnail_image_url: string;
banner_image_url: string;
seat_contract?: string;
}

export interface SeatMetadata {
name: string;
image_uri: string;
description: string;
benefits: Array<SeatBenefit>;
hub_contract: string;
}

type SocialLink = {
name: string;
url: string;
};

type SeatBenefit = {
name: string;
status: string;
};

export type ISale = {
total_supply: string;
tokens_minted: string;
start_time: string;
end_time: string;
price: Array<ICoin>;
disabled: boolean;
};

export type ICoin = {
denom: string;
amount: string;
};

export type IAuthenticator = {
Secp256K1?: { pubkey: string };
Ed25519?: { pubkey: string };
Expand Down
34 changes: 0 additions & 34 deletions src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
import { CosmosEvent } from "@subql/types-cosmos";
import {
handleHubContractInstantiateHelper,
handleHubContractInstantiateMetadataHelper,
} from "../hubs";
import { handleSeatContractInstantiateMetadataHelper } from "../seat";
import { handleSeatContractPrimarySaleCreatedHelper } from "../sale";
import {
handleSmartAccountContractAddAuthenticatorHelper,
handleSmartAccountContractInstantiateMetadataHelper,
handleSmartAccountContractRemoveAuthenticatorHelper,
} from "../smartContract";

export async function handleHubContractInstantiate(
event: CosmosEvent,
): Promise<void> {
await handleHubContractInstantiateHelper(event);
}

export async function handleHubContractInstantiateMetadata(
event: CosmosEvent,
): Promise<void> {
await handleHubContractInstantiateMetadataHelper(event);
}

export async function handleSeatContractInstantiateMetadata(
event: CosmosEvent,
): Promise<void> {
await handleSeatContractInstantiateMetadataHelper(event);
}

export async function handleSeatContractPrimarySaleCreated(
event: CosmosEvent,
): Promise<void> {
await handleSeatContractPrimarySaleCreatedHelper(event);
}

export async function handleSeatContractPrimarySaleHalted(): Promise<void> {
await handleSeatContractPrimarySaleHalted();
}

export async function handleSmartAccountContractInstantiateMetadata(
event: CosmosEvent,
): Promise<void> {
Expand Down
Loading
Loading