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 all 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 examples/simple/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Network } from '../../src/resources/graphql'
import { Defined } from '@definedfi/sdk/dist/sdk'
import { Defined } from '@definedfi/sdk'

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

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
"name": "@definedfi/sdk",
"version": "0.2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "bun run fetch:schema && bun run codegen && bun run tsc",
"fetch:schema": "curl -s https://graph.defined.fi/schema/latest.graphql --output src/resources/schema.graphql",
"codegen": "graphql-codegen --config codegen.ts",
"prepack": "cp src/resources/* dist/resources/",
"test": "jest"
},
"files": [
"dist",
"src"
],
"keywords": ["crypto", "charting", "sdk", "analytics", "blockchain", "api"],
"repository": "github:definedfi/sdk",
"author": "Defined.fi",
Expand Down
4 changes: 2 additions & 2 deletions src/resources/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -40707,7 +40707,7 @@
"fields": [
{
"name": "averageEntry",
"description": "These are only valid if they had an entry buy record",
"description": "The average buy price for the token",
"args": [],
"type": {
"kind": "SCALAR",
Expand Down Expand Up @@ -40735,7 +40735,7 @@
},
{
"name": "percentChange",
"description": null,
"description": "How much your investment has gained or lost in a percentage",
"args": [],
"type": {
"kind": "SCALAR",
Expand Down
3 changes: 2 additions & 1 deletion src/resources/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6699,9 +6699,10 @@ export type WalletPnl = {

export type WalletTokenPnl = {
__typename?: 'WalletTokenPnl';
/** These are only valid if they had an entry buy record */
/** The average buy price for the token */
averageEntry?: Maybe<Scalars['Float']['output']>;
id: Scalars['String']['output'];
/** How much your investment has gained or lost in a percentage */
percentChange?: Maybe<Scalars['Float']['output']>;
pnl: Pnl;
tokenAddress: Scalars['String']['output'];
Expand Down
4 changes: 3 additions & 1 deletion src/resources/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8951,8 +8951,10 @@ type WalletTokenPnl {
tokenAddress: String!
pnl: Pnl!

"""These are only valid if they had an entry buy record"""
"""The average buy price for the token"""
averageEntry: Float

"""How much your investment has gained or lost in a percentage"""
percentChange: Float
}

Expand Down
3 changes: 2 additions & 1 deletion src/sdk/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6701,9 +6701,10 @@ export type WalletPnl = {

export type WalletTokenPnl = {
__typename?: 'WalletTokenPnl';
/** These are only valid if they had an entry buy record */
/** The average buy price for the token */
averageEntry?: Maybe<Scalars['Float']['output']>;
id: Scalars['String']['output'];
/** How much your investment has gained or lost in a percentage */
percentChange?: Maybe<Scalars['Float']['output']>;
pnl: Pnl;
tokenAddress: Scalars['String']['output'];
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": true,
"sourceMap": true,
"declarationMap": true,
"experimentalDecorators": true,
"types": ["node", "jest"],
"rootDirs": ["src"],
"outDir": "dist",
"lib": ["es2020", "DOM"],
"target": "ES2020",
"target": "es2015",
"module": "CommonJS",
"esModuleInterop": true,
"resolveJsonModule": true,
Expand Down