Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 4 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
Binary file modified bun.lockb
Binary file not shown.
Binary file modified examples/simple/bun.lockb
Binary file not shown.
6 changes: 6 additions & 0 deletions examples/simple/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ sdk.queries
pairAddress: "0x34b1e73807cfac2bf77eae6d8630797dd8f924bf",
})
.then(console.log);

sdk.queries
.getWebhooks({
webhookId: "1",
})
.then(console.log);
2 changes: 1 addition & 1 deletion examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"license": "ISC",
"description": "",
"dependencies": {
"@definedfi/sdk": "../../"
"@definedfi/sdk": "^0.3.0"
}
}
103 changes: 103 additions & 0 deletions src/resources/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6809,6 +6809,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "filtered",
"description": "docs: hide",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "networkId",
"description": "The network ID the pair is deployed on.",
Expand Down Expand Up @@ -31879,6 +31891,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "filtered",
"description": "docs: hide",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "from",
"description": "The unix timestamp for the start of the requested range.",
Expand Down Expand Up @@ -32105,6 +32129,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "filtered",
"description": "docs: hide",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "networkId",
"description": "The network ID the pair is deployed on.",
Expand Down Expand Up @@ -33812,6 +33848,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "getTokenCount",
"description": "Returns the total count of tokens on Defined. This value is updated approximately every 6 hours.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "getTokenEvents",
"description": "Returns transactions for a pair.",
Expand Down Expand Up @@ -34346,6 +34398,18 @@
"name": "listTopTokens",
"description": "Returns a list of trending tokens across any given network(s).",
"args": [
{
"name": "filtered",
"description": "docs: hide",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "limit",
"description": "The maximum number of tokens to return. Max is `50`.",
Expand Down Expand Up @@ -35649,6 +35713,45 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "SimulateTokenContractResult",
"description": null,
"fields": [
{
"name": "error",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "result",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "SocialLinks",
Expand Down
13 changes: 13 additions & 0 deletions src/resources/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,8 @@ export type GetDetailedPairsStatsInput = {
bucketCount?: InputMaybe<Scalars['Int']['input']>;
/** The list of durations to get detailed pair stats for. */
durations?: InputMaybe<Array<InputMaybe<DetailedPairStatsDuration>>>;
/** docs: hide */
filtered?: InputMaybe<Scalars['Boolean']['input']>;
/** The network ID the pair is deployed on. */
networkId: Scalars['Int']['input'];
/** The contract address of the pair. */
Expand Down Expand Up @@ -5311,6 +5313,8 @@ export type Query = {
getPrimePools?: Maybe<PrimePoolConnection>;
/** Returns metadata for a given pair. */
getSymbol?: Maybe<SymbolResponse>;
/** Returns the total count of tokens on Defined. This value is updated approximately every 6 hours. */
getTokenCount: Scalars['String']['output'];
/** Returns transactions for a pair. */
getTokenEvents?: Maybe<EventConnection>;
/** Returns metadata for a given token. */
Expand Down Expand Up @@ -5427,6 +5431,7 @@ export type QueryFilterTokensArgs = {

export type QueryGetBarsArgs = {
currencyCode?: InputMaybe<Scalars['String']['input']>;
filtered?: InputMaybe<Scalars['Boolean']['input']>;
from: Scalars['Int']['input'];
quoteToken?: InputMaybe<QuoteToken>;
removeLeadingNullValues?: InputMaybe<Scalars['Boolean']['input']>;
Expand All @@ -5449,6 +5454,7 @@ export type QueryGetDetailedNftStatsArgs = {
export type QueryGetDetailedPairStatsArgs = {
bucketCount?: InputMaybe<Scalars['Int']['input']>;
durations?: InputMaybe<Array<InputMaybe<DetailedPairStatsDuration>>>;
filtered?: InputMaybe<Scalars['Boolean']['input']>;
networkId: Scalars['Int']['input'];
pairAddress: Scalars['String']['input'];
timestamp?: InputMaybe<Scalars['Int']['input']>;
Expand Down Expand Up @@ -5701,6 +5707,7 @@ export type QueryListPairsWithMetadataForTokenArgs = {


export type QueryListTopTokensArgs = {
filtered?: InputMaybe<Scalars['Boolean']['input']>;
limit?: InputMaybe<Scalars['Int']['input']>;
networkFilter?: InputMaybe<Array<Scalars['Int']['input']>>;
resolution?: InputMaybe<Scalars['String']['input']>;
Expand Down Expand Up @@ -5892,6 +5899,12 @@ export type SandwichedLabelData = {
token1DrainedAmount?: Maybe<Scalars['String']['output']>;
};

export type SimulateTokenContractResult = {
__typename?: 'SimulateTokenContractResult';
error?: Maybe<Scalars['String']['output']>;
result: Scalars['Boolean']['output'];
};

/** Community gathered social links of tokens/NFTs. */
export type SocialLinks = {
__typename?: 'SocialLinks';
Expand Down
22 changes: 22 additions & 0 deletions src/resources/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,9 @@ input GetDetailedPairsStatsInput {
The number of aggregated values to receive. Note: Each duration has predetermined bucket sizes.<br> The first n-1 buckets are historical. The last bucket is a snapshot of current data.<br> duration `day1`: 6 buckets (4 hours each) plus 1 partial bucket<br> duration `hour12`: 12 buckets (1 hour each) plus 1 partial bucket<br> duration `hour4`: 8 buckets (30 min each) plus 1 partial bucket<br> duration `hour1`: 12 buckets (5 min each) plus 1 partial bucket<br> duration `min5`: 5 buckets (1 min each) plus 1 partial bucket<br> For example, requesting 11 buckets for a `min5` duration will return the last 10 minutes worth of data plus a snapshot for the current minute.
"""
bucketCount: Int

"""docs: hide"""
filtered: Boolean
}

"""Response returned by `getNftPoolCollectionsByExchange`."""
Expand Down Expand Up @@ -7355,6 +7358,11 @@ type Query {
networkId: Int!
): TokenInfo

"""
Returns the total count of tokens on Defined. This value is updated approximately every 6 hours.
"""
getTokenCount: String!

"""Returns metadata for a list of given tokens."""
getTokensInfo(
"""
Expand Down Expand Up @@ -7408,6 +7416,9 @@ type Query {
The number of aggregated values to receive. Note: Each duration has predetermined bucket sizes.<br> The first n-1 buckets are historical. The last bucket is a snapshot of current data.<br> duration `day1`: 6 buckets (4 hours each) plus 1 partial bucket<br> duration `hour12`: 12 buckets (1 hour each) plus 1 partial bucket<br> duration `hour4`: 8 buckets (30 min each) plus 1 partial bucket<br> duration `hour1`: 12 buckets (5 min each) plus 1 partial bucket<br> duration `min5`: 5 buckets (1 min each) plus 1 partial bucket<br> For example, requesting 11 buckets for a `min5` duration will return the last 10 minutes worth of data plus a snapshot for the current minute.
"""
bucketCount: Int

"""docs: hide"""
filtered: Boolean
): DetailedPairStats

"""Returns bucketed stats for a given token within a list of pairs."""
Expand All @@ -7425,6 +7436,9 @@ type Query {
The time frame for trending results. Can be `1`, `5`, `15`, `30`, `60`, `240`, `720`, or `1D`.
"""
resolution: String

"""docs: hide"""
filtered: Boolean
): [TokenWithMetadata!]

"""Returns metadata for a given pair."""
Expand Down Expand Up @@ -7497,6 +7511,9 @@ type Query {
The token of interest within the token's top pair. Can be `token0` or `token1`.
"""
quoteToken: QuoteToken

"""docs: hide"""
filtered: Boolean
): BarsResponse

"""Returns a list of tokens matching a given query string."""
Expand Down Expand Up @@ -7798,6 +7815,11 @@ enum SandwichLabelForEventType {
backrun
}

type SimulateTokenContractResult {
result: Boolean!
error: String
}

"""Community gathered social links of tokens/NFTs."""
type SocialLinks {
bitcointalk: String
Expand Down
4 changes: 4 additions & 0 deletions src/sdk/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
GetSymbolQueryVariables,
GetTokenPriceDocument,
GetTokensDocument,
GetWebhooksDocument,
ListPairsForTokenDocument,
ListPairsForTokenQueryVariables,
ListTopTokensDocument,
Expand All @@ -24,6 +25,7 @@ import {
QueryGetDetailedPairStatsArgs,
QueryGetNetworkStatusArgs,
QueryGetTokenPricesArgs,
QueryGetWebhooksArgs,
QueryListTopTokensArgs,
QueryTokenArgs,
} from "./generated/graphql";
Expand Down Expand Up @@ -58,4 +60,6 @@ export class Query {
networks = async () => this.sdk.query(GetNetworksDocument);
networkStatus = async (vars: QueryGetNetworkStatusArgs) =>
this.sdk.query(GetNetworkStatusDocument, vars);
getWebhooks = async (vars: QueryGetWebhooksArgs) =>
this.sdk.query(GetWebhooksDocument, vars);
}
Loading