Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
build: 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bradens committed May 14, 2024
1 parent e83426a commit 368a6ab
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 20 deletions.
Binary file modified bun.lockb
Binary file not shown.
Binary file modified examples/simple/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions 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": "^0.5.1"
"@definedfi/sdk": "^0.5.3"
}
}
}
12 changes: 12 additions & 0 deletions examples/simple/tokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Defined } from "@definedfi/sdk";

const sdk = new Defined(process.env.DEFINED_API_KEY || "");

sdk.queries
.token({
input: {
address: "0xc56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8",
networkId: 1,
},
})
.then(console.log);
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@definedfi/sdk",
"version": "0.5.2",
"version": "0.5.3",
"engines": {
"node": ">=17.5.0"
},
Expand All @@ -18,7 +18,14 @@
"dist",
"src"
],
"keywords": ["crypto", "charting", "sdk", "analytics", "blockchain", "api"],
"keywords": [
"crypto",
"charting",
"sdk",
"analytics",
"blockchain",
"api"
],
"repository": "github:definedfi/sdk",
"author": "Defined.fi",
"license": "MIT",
Expand Down Expand Up @@ -50,4 +57,4 @@
"prettier": "^3.0.3",
"ts-jest": "^29.1.1"
}
}
}
9 changes: 0 additions & 9 deletions src/resources/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -885,15 +885,6 @@ type EnhancedToken {
"""The token ID on CoinMarketCap."""
cmcId: Int

"""The block height the token was created at."""
createBlockNumber: Int

"""The unix timestamp for the creation of the token."""
createdAt: Int

"""The transaction hash of the token's creation."""
createTransactionHash: String

"""
The precision to which the token can be divided. For example, the smallest unit for USDC is 0.000001 (6 decimals).
"""
Expand Down
1 change: 0 additions & 1 deletion src/sdk/generated/fragment-masking.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
import { FragmentDefinitionNode } from 'graphql';
import { Incremental } from './graphql';
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/generated/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const documents = {
"query GetTokenPrice($inputs: [GetPriceInput]) {\n getTokenPrices(inputs: $inputs) {\n address\n networkId\n priceUsd\n }\n}": types.GetTokenPriceDocument,
"query GetSparklines($input: TokenSparklineInput!) {\n tokenSparklines(input: $input) {\n attribute\n id\n sparkline {\n timestamp\n value\n }\n }\n}": types.GetSparklinesDocument,
"query GetSymbol($symbol: String!, $currencyCode: String) {\n getSymbol(symbol: $symbol, currencyCode: $currencyCode) {\n name\n description\n currency_code\n supported_resolutions\n pricescale\n ticker\n original_currency_code\n }\n}": types.GetSymbolDocument,
"query GetTokens($input: [TokenInput!]) {\n tokens(ids: $input) {\n address\n decimals\n id\n name\n networkId\n symbol\n totalSupply\n }\n}": types.GetTokensDocument,
"query GetTokens($input: [TokenInput!]) {\n tokens(ids: $input) {\n address\n decimals\n id\n name\n networkId\n symbol\n totalSupply\n createBlockNumber\n createdAt\n createTransactionHash\n }\n}": types.GetTokensDocument,
"query GetWebhooks($cursor: String, $webhookId: String, $bucketId: String, $bucketSortkey: String, $limit: Int) {\n getWebhooks(\n cursor: $cursor\n webhookId: $webhookId\n bucketId: $bucketId\n bucketSortkey: $bucketSortkey\n limit: $limit\n ) {\n cursor\n items {\n alertRecurrence\n bucketId\n bucketSortkey\n callbackUrl\n conditions {\n ... on PriceEventWebhookCondition {\n tokenAddressPriceEvent: tokenAddress {\n eq\n }\n networkIdPriceEvent: networkId {\n eq\n }\n priceUsd {\n gt\n gte\n lt\n lte\n eq\n }\n }\n ... on DecodedLogWebhookCondition {\n decodingId {\n eq\n }\n eventName {\n eq\n }\n address {\n eq\n }\n event\n }\n ... on DecodedCallWebhookCondition {\n decodingId {\n eq\n }\n methodName {\n eq\n }\n address {\n eq\n }\n from {\n eq\n }\n to {\n eq\n }\n methodId {\n eq\n }\n output\n inputJSON: input\n }\n ... on RawCallTraceWebhookCondition {\n traceType {\n eq\n }\n result {\n code {\n contains\n notContains\n }\n }\n networkId {\n oneOf\n }\n }\n ... on TokenPairEventWebhookCondition {\n tokenAddress {\n eq\n }\n networkId {\n oneOf\n }\n swapValue {\n gt\n gte\n lt\n lte\n eq\n }\n maker {\n eq\n }\n pairAddress {\n eq\n }\n exchangeAddress {\n eq\n }\n eventType {\n oneOf\n }\n }\n ... on NftEventWebhookCondition {\n networkId {\n oneOf\n }\n maker {\n eq\n }\n contractAddress {\n eq\n }\n exchangeAddress {\n eq\n }\n tokenId {\n eq\n }\n tokenAddress {\n eq\n }\n individualBaseTokenPrice {\n gt\n gte\n lt\n lte\n eq\n }\n eventType {\n eq\n }\n fillSource {\n oneOf\n }\n }\n ... on RawTransactionWebhookCondition {\n networkId {\n oneOf\n }\n to {\n eq\n }\n from {\n eq\n }\n toOrFrom {\n eq\n }\n input {\n contains\n notContains\n }\n ignoreTokenPairEvents\n ignoreNftEvents\n }\n }\n }\n }\n}": types.GetWebhooksDocument,
"query ListPairsForToken($networkId: Int!, $tokenAddress: String!, $limit: Int) {\n listPairsForToken(\n networkId: $networkId\n tokenAddress: $tokenAddress\n limit: $limit\n ) {\n address\n exchangeHash\n fee\n id\n networkId\n tickSpacing\n pooled {\n token0\n token1\n }\n token0\n token1\n createdAt\n token0Data {\n address\n cmcId\n decimals\n id\n isScam\n name\n networkId\n symbol\n exchanges {\n address\n color\n id\n name\n exchangeVersion\n iconUrl\n networkId\n tradeUrl\n }\n info {\n id\n address\n circulatingSupply\n cmcId\n isScam\n name\n networkId\n symbol\n totalSupply\n imageThumbUrl\n imageSmallUrl\n imageLargeUrl\n }\n explorerData {\n id\n blueCheckmark\n description\n divisor\n tokenPriceUSD\n tokenType\n }\n }\n token1Data {\n address\n cmcId\n decimals\n id\n isScam\n name\n networkId\n symbol\n exchanges {\n address\n color\n id\n name\n exchangeVersion\n iconUrl\n networkId\n tradeUrl\n }\n info {\n id\n address\n circulatingSupply\n cmcId\n isScam\n name\n networkId\n symbol\n totalSupply\n imageThumbUrl\n imageSmallUrl\n imageLargeUrl\n }\n explorerData {\n id\n blueCheckmark\n description\n divisor\n tokenPriceUSD\n tokenType\n }\n }\n }\n}": types.ListPairsForTokenDocument,
"query ListTopTokens($limit: Int, $networkFilter: [Int!], $resolution: String) {\n listTopTokens(\n limit: $limit\n networkFilter: $networkFilter\n resolution: $resolution\n ) {\n address\n decimals\n exchanges {\n address\n id\n name\n iconUrl\n networkId\n tradeUrl\n }\n id\n liquidity\n name\n networkId\n price\n priceChange\n isScam\n priceChange1\n priceChange4\n priceChange12\n priceChange24\n quoteToken\n marketCap\n txnCount1\n txnCount12\n txnCount24\n txnCount4\n uniqueBuys1\n uniqueBuys12\n uniqueBuys24\n uniqueBuys4\n uniqueSells1\n uniqueSells12\n uniqueSells24\n uniqueSells4\n resolution\n symbol\n topPairId\n volume\n imageThumbUrl\n imageSmallUrl\n imageLargeUrl\n createdAt\n lastTransaction\n }\n}": types.ListTopTokensDocument,
Expand Down Expand Up @@ -107,7 +107,7 @@ export function graphql(source: "query GetSymbol($symbol: String!, $currencyCode
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "query GetTokens($input: [TokenInput!]) {\n tokens(ids: $input) {\n address\n decimals\n id\n name\n networkId\n symbol\n totalSupply\n }\n}"): (typeof documents)["query GetTokens($input: [TokenInput!]) {\n tokens(ids: $input) {\n address\n decimals\n id\n name\n networkId\n symbol\n totalSupply\n }\n}"];
export function graphql(source: "query GetTokens($input: [TokenInput!]) {\n tokens(ids: $input) {\n address\n decimals\n id\n name\n networkId\n symbol\n totalSupply\n createBlockNumber\n createdAt\n createTransactionHash\n }\n}"): (typeof documents)["query GetTokens($input: [TokenInput!]) {\n tokens(ids: $input) {\n address\n decimals\n id\n name\n networkId\n symbol\n totalSupply\n createBlockNumber\n createdAt\n createTransactionHash\n }\n}"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/generated/graphql.ts

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/sdk/graphql/GetTokens.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ query GetTokens($input: [TokenInput!]) {
networkId
symbol
totalSupply
createBlockNumber
createdAt
createTransactionHash
}
}
}

0 comments on commit 368a6ab

Please sign in to comment.