@@ -6,16 +6,16 @@ It provides the public schema SDL for you to use. You can use graphql-codegen to
66
77> [ !NOTE]
88> We've changed our name from Defined to Codex.
9- >
9+ >
1010> You will see references to our previous company name, Defined, while we make the switch to Codex.
1111
1212## Installation
1313
1414| packager | command |
1515| ----------------------------- | ------------------------- |
16- | [ npm] ( https://www.npmjs.com/ ) | ` npm add @definedfi /sdk ` |
17- | [ yarn] ( https://yarnpkg.com/ ) | ` yarn add @definedfi /sdk ` |
18- | [ bun] ( https://bun.sh/ ) | ` bun add @definedfi /sdk ` |
16+ | [ npm] ( https://www.npmjs.com/ ) | ` npm add @codex-data /sdk ` |
17+ | [ yarn] ( https://yarnpkg.com/ ) | ` yarn add @codex-data /sdk ` |
18+ | [ bun] ( https://bun.sh/ ) | ` bun add @codex-data /sdk ` |
1919
2020## Usage
2121
@@ -24,9 +24,9 @@ Follow one of the examples in the [examples](/examples) directory, or simply run
2424Fetch a token.
2525
2626``` typescript
27- import { Defined } from " @definedfi /sdk" ;
27+ import { Codex } from " @codex-data /sdk" ;
2828
29- const sdk = new Defined (MY_API_KEY );
29+ const sdk = new Codex (MY_API_KEY );
3030
3131sdk .queries
3232 .token ({
@@ -42,9 +42,9 @@ Use your own GraphQL selections
4242
4343``` typescript
4444import { Network } from " ../../src/resources/graphql" ;
45- import { Defined } from " @definedfi /sdk/dist/sdk" ;
45+ import { Codex } from " @codex-data /sdk/dist/sdk" ;
4646
47- const sdk = new Defined (process .env .DEFINED_API_KEY || " " );
47+ const sdk = new Codex (process .env .CODEX_API_KEY || " " );
4848
4949sdk
5050 .send <{ getNetworks: Network [] }>(
6262
6363## Running the examples
6464
65- You'll need to have [ ` curl ` ] ( https://curl.se/ ) installed in order to build this locally, as it fetches the schema from the Defined API.
65+ You'll need to have [ ` curl ` ] ( https://curl.se/ ) installed in order to build this locally, as it fetches the schema from the Codex API.
6666
6767You need to provide an API key in order for the examples to work. We have [ bun] ( https://bun.sh ) in use for development here.
6868
@@ -77,7 +77,7 @@ This performs a simple inline graphql request, and uses a user-provided query an
7777
7878- ` cd examples/simple `
7979- ` bun i `
80- - ` DEFINED_API_KEY =xyz bun run index.ts`
80+ - ` CODEX_API_KEY =xyz bun run index.ts`
8181
8282You can define your own GraphQL queries and use those with codegen (see next section). The pre-defined queries we provide in the
8383examples do not include all of the fields for every query.
@@ -89,15 +89,15 @@ This shows how to use graphql-codegen to generate query types and get a fully ty
8989- ` cd examples/codegen `
9090- ` bun i `
9191- ` bun run codegen `
92- - ` DEFINED_API_KEY =xyz bun run src/index.ts`
92+ - ` CODEX_API_KEY =xyz bun run src/index.ts`
9393
9494### Next
9595
9696This shows how you could use it in a NextJS project.
9797
9898- ` cd examples/next `
9999- ` bun i `
100- - ` NEXT_PUBLIC_DEFINED_API_KEY =xyz bun run dev`
100+ - ` NEXT_PUBLIC_CODEX_API_KEY =xyz bun run dev`
101101
102102## Contributing
103103
0 commit comments