Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
e7c008c
feat: integrate The Graph support into EAS client
robbeverhelst Aug 11, 2025
f21cf2c
Merge branch 'main' into fix/eas-thegraph
roderik Aug 17, 2025
49ebfe3
feat(workflows): enable environment variable export for secrets loading
roderik Aug 17, 2025
2d82eb0
chore: update docs [skip ci]
roderik Aug 17, 2025
a349fb7
feat(qa): add slug/short variable injection step to workflow
roderik Aug 17, 2025
9e521cb
chore(deps): pin rlespinasse/github-slug-action action to c33ff65 (#1…
renovate[bot] Aug 17, 2025
64c80fb
refactor: reorganize imports and update transport configuration for w…
roderik Aug 18, 2025
cba36d8
chore: update package versions [skip ci]
roderik Aug 18, 2025
3672801
feat: support HA Hasura (#1120)
snigdha920 Aug 18, 2025
02b0ceb
chore: update package versions [skip ci]
snigdha920 Aug 18, 2025
a206d06
chore(deps): update dependency viem to v2.34.0 (#1256)
renovate[bot] Aug 19, 2025
3c0ebe9
fix: update viem to use latest signer json rpc endpoints (#1257)
janb87 Aug 19, 2025
491b624
chore: update docs [skip ci]
janb87 Aug 19, 2025
01aa92e
feat(cli): add Bun SQL support and environment variable validation to…
roderik Aug 19, 2025
d101259
chore: update docs [skip ci]
roderik Aug 19, 2025
d4098aa
chore: update package versions [skip ci]
roderik Aug 19, 2025
f13b6a7
chore(deps): update dependency yoctocolors to v2.1.2 (#1259)
renovate[bot] Aug 20, 2025
3386506
fix: wallet verification types (#1260)
janb87 Aug 20, 2025
ad111ca
chore: update docs [skip ci]
janb87 Aug 20, 2025
12b6d26
chore: update package versions [skip ci]
janb87 Aug 20, 2025
3845d8a
chore(deps): update dependency knip to v5.63.0 (#1262)
renovate[bot] Aug 22, 2025
81f7463
fix: update portal utils to use challenge id for wallet verification …
janb87 Aug 22, 2025
e604503
fix: docs generation
janb87 Aug 22, 2025
726bed4
chore: update package versions [skip ci]
janb87 Aug 22, 2025
392afe4
chore(deps): update dependency @modelcontextprotocol/sdk to v1.17.4 (…
renovate[bot] Aug 23, 2025
0171839
chore(deps): update dependency undici to v7.15.0 (#1264)
renovate[bot] Aug 23, 2025
897d246
chore(deps): update dependency @biomejs/biome to v2.2.2 (#1244)
renovate[bot] Aug 23, 2025
3237aba
chore(deps): update dependency @inquirer/input to v4.2.2 (#1266)
renovate[bot] Aug 25, 2025
c068ec2
chore(deps): update dependency viem to v2.35.1 (#1270)
renovate[bot] Aug 25, 2025
d7d769b
chore(deps): update dependency @inquirer/password to v4.0.18 (#1267)
renovate[bot] Aug 25, 2025
072d6e1
chore(deps): update dependency @inquirer/confirm to v5.1.16 (#1265)
renovate[bot] Aug 25, 2025
e4798ad
chore(deps): update dependency @inquirer/core to v10.2.0 (#1269)
renovate[bot] Aug 25, 2025
c07c52c
chore(deps): update dependency @inquirer/select to v4.3.2 (#1268)
renovate[bot] Aug 25, 2025
6acb92e
chore(deps): update dependency @types/bun to v1.2.21 (#1271)
renovate[bot] Aug 26, 2025
3e80644
chore(deps): update dependency typedoc to v0.28.11 (#1272)
renovate[bot] Aug 26, 2025
b873421
chore: update docs [skip ci]
renovate[bot] Aug 26, 2025
a397b1d
chore(deps): update dependency viem to v2.36.0 (#1273)
renovate[bot] Aug 28, 2025
90af661
chore(deps): update node.js to v24.7.0 (#1274)
renovate[bot] Aug 28, 2025
7e21d52
chore(deps): update namespacelabs/nscloud-cache-action digest to a289…
renovate[bot] Aug 31, 2025
2aa8063
chore(deps): update dependency @npmcli/package-json to v7 (#1276)
renovate[bot] Aug 31, 2025
683f19f
chore: update package versions [skip ci]
roderik Aug 31, 2025
3b8b564
chore(deps): update dependency typedoc to v0.28.12 (#1277)
renovate[bot] Sep 2, 2025
01e81cd
chore(deps): update dependency viem to v2.37.0 (#1278)
renovate[bot] Sep 2, 2025
f23b11d
chore(deps): update dependency @modelcontextprotocol/sdk to v1.17.5 (…
renovate[bot] Sep 3, 2025
f5b243f
chore(deps): update dependency viem to v2.37.2 (#1280)
renovate[bot] Sep 3, 2025
039dc56
feat: enhance EAS SDK with subgraph deployment capabilities
robbeverhelst Sep 10, 2025
ce88136
feat: add eth_sign rpc method to viem client (#1281)
janb87 Sep 3, 2025
3b46e8c
chore: update docs [skip ci]
janb87 Sep 3, 2025
f3212b5
chore: update package versions [skip ci]
janb87 Sep 3, 2025
ed5daff
fix: e2e tests
janb87 Sep 3, 2025
a1956e3
chore(deps): update dependency @types/semver to v7.7.1 (#1282)
renovate[bot] Sep 4, 2025
536f1ff
chore(deps): update dependency knip to v5.63.1 (#1283)
renovate[bot] Sep 4, 2025
dffd89d
chore(deps): update dependency viem to v2.37.3 (#1286)
renovate[bot] Sep 4, 2025
be41a39
chore(deps): update dependency @types/node to v24.3.1 (#1285)
renovate[bot] Sep 4, 2025
bf5b47a
chore(deps): update actions/setup-node action to v5 (#1287)
renovate[bot] Sep 4, 2025
7887161
chore(deps): update dependency @biomejs/biome to v2.2.3 (#1288)
renovate[bot] Sep 5, 2025
fbc830f
chore(deps): update dependency viem to v2.37.4 (#1290)
renovate[bot] Sep 7, 2025
f5c640f
chore(deps): update dependency @graphql-tools/url-loader to v9 (#1289)
renovate[bot] Sep 9, 2025
de359a4
chore(deps): update dependency viem to v2.37.5 (#1291)
renovate[bot] Sep 9, 2025
2cf73de
chore(deps): update dependency tsdown to ^0.15.0 (#1292)
renovate[bot] Sep 9, 2025
75464f3
chore(deps): update dependency undici to v7.16.0 (#1293)
renovate[bot] Sep 9, 2025
aac4392
fix: add includePredeployedContracts option for deploying a new netwo…
janb87 Sep 10, 2025
1aebb7d
fix: hasura e2e test (#1294)
janb87 Sep 10, 2025
a1816f0
chore(deps): update dependency @biomejs/biome to v2.2.4 (#1295)
renovate[bot] Sep 10, 2025
4efab84
chore(deps): update node.js to v24.8.0 (#1296)
renovate[bot] Sep 10, 2025
7e2352c
fix: test hangs on bun install step
janb87 Sep 11, 2025
2957a77
chore(deps): update dependency @modelcontextprotocol/sdk to v1.18.0 (…
renovate[bot] Sep 11, 2025
3ae1093
chore(deps): update dependency @types/node to v24.3.3 (#1298)
renovate[bot] Sep 13, 2025
7a6a712
chore(deps): update dependency commander to v14.0.1 (#1299)
renovate[bot] Sep 13, 2025
5abdb50
chore(deps): update dependency @types/node to v24.4.0 (#1300)
renovate[bot] Sep 14, 2025
f0165b5
chore(deps): update dependency @inquirer/confirm to v5.1.17 (#1301)
renovate[bot] Sep 14, 2025
4a058b2
chore(deps): update dependency bun to v1.2.22 (#1306)
renovate[bot] Sep 14, 2025
a560d1b
chore(deps): update dependency @inquirer/core to v10.2.2 (#1302)
renovate[bot] Sep 14, 2025
94771a0
chore(deps): update dependency @inquirer/confirm to v5.1.18 (#1307)
renovate[bot] Sep 14, 2025
3eeeb90
chore(deps): update dependency @inquirer/select to v4.3.4 (#1305)
renovate[bot] Sep 14, 2025
9dac83d
chore(deps): update dependency @inquirer/password to v4.0.20 (#1304)
renovate[bot] Sep 15, 2025
ab871b2
chore(deps): update dependency typedoc to v0.28.13 (#1309)
renovate[bot] Sep 15, 2025
ef5913c
chore(deps): update dependency @inquirer/input to v4.2.4 (#1303)
renovate[bot] Sep 15, 2025
27665ac
chore(deps): update dependency viem to v2.37.6 (#1310)
renovate[bot] Sep 16, 2025
07f1627
chore(deps): update dependency @types/node to v24.5.0 (#1311)
renovate[bot] Sep 16, 2025
14c645b
chore(deps): update dependency @types/node to v24.5.2 (#1312)
renovate[bot] Sep 18, 2025
2d2b6fc
feat: enhance EAS SDK with subgraph deployment capabilities
robbeverhelst Sep 10, 2025
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 .bun-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.20
1.2.22
2 changes: 2 additions & 0 deletions .github/workflows/e2e-reset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:

- name: Load secrets
uses: 1password/load-secrets-action@13f58eec611f8e5db52ec16247f58c508398f3e6 # v3
with:
export-env: true
env:
E2E_GITHUB_TOKEN: "op://platform/SDK E2E/github-token"
SETTLEMINT_ACCESS_TOKEN_E2E_TESTS: "op://platform/SDK E2E/pat-token"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:

- name: Load secrets
uses: 1password/load-secrets-action@13f58eec611f8e5db52ec16247f58c508398f3e6 # v3
with:
export-env: true
env:
E2E_GITHUB_TOKEN: "op://platform/SDK E2E/github-token"
SETTLEMINT_ACCESS_TOKEN_E2E_TESTS: "op://platform/SDK E2E/pat-token"
Expand All @@ -39,7 +41,7 @@ jobs:
uses: namespacelabs/nscloud-checkout-action@953fed31a6113cc2347ca69c9d823743c65bc84b # v7

- name: Setup caches
uses: namespacelabs/nscloud-cache-action@305bfa7ea980a858d511af4899414a84847c7991 # v1
uses: namespacelabs/nscloud-cache-action@a289cf5d2fcd6874376aa92f0ef7f99dc923592a # v1
with:
path: |
./.turbo
Expand All @@ -51,7 +53,7 @@ jobs:
bun-version-file: .bun-version

- name: Install Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version-file: package.json
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
- name: Load all secrets
id: secrets
uses: 1password/load-secrets-action@13f58eec611f8e5db52ec16247f58c508398f3e6 # v3
with:
export-env: true
env:
SLACK_BOT_TOKEN: op://platform/slack-bot/SLACK_BOT_TOKEN
SLACK_CHANNEL_ID: op://platform/slack-bot/SLACK_CHANNEL_ID
Expand Down Expand Up @@ -118,6 +120,10 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
npm_token: ${{ env.NPM_TOKEN }}
disable_node: "true"

- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@c33ff65466c58d57e4d796f88bb1ae0ff26ee453 # v5

- name: Update package versions
if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'release'
id: package-version
Expand Down Expand Up @@ -231,6 +237,8 @@ jobs:
| SDK IPFS | `@settlemint/sdk-ipfs@${{ env.VERSION }}` | |
| SDK Blockscout | `@settlemint/sdk-blockscout@${{ env.VERSION }}` | |
| SDK MCP | `@settlemint/sdk-mcp@${{ env.VERSION }}` | |
| SDK Viem | `@settlemint/sdk-viem@${{ env.VERSION }}` | |
| SDK EAS | `@settlemint/sdk-eas@${{ env.VERSION }}` | |

- name: Auto-commit updated package versions
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6
Expand Down Expand Up @@ -380,6 +388,8 @@ jobs:

- name: Load Slack secrets
uses: 1password/load-secrets-action@13f58eec611f8e5db52ec16247f58c508398f3e6 # v3
with:
export-env: true
env:
SLACK_BOT_TOKEN: op://platform/slack-bot/SLACK_BOT_TOKEN
SLACK_CHANNEL_ID: op://platform/slack-bot/SLACK_CHANNEL_ID
Expand Down Expand Up @@ -432,6 +442,8 @@ jobs:

- name: Load Slack secrets
uses: 1password/load-secrets-action@13f58eec611f8e5db52ec16247f58c508398f3e6 # v3
with:
export-env: true
env:
SLACK_BOT_TOKEN: op://platform/slack-bot/SLACK_BOT_TOKEN
SLACK_CHANNEL_ID: op://platform/slack-bot/SLACK_CHANNEL_ID
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.6.0
24.8.0
12 changes: 11 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@
"!contracts/artifacts",
"!**/graphql-env.d.ts",
"!**/graphql-cache.d.ts",
"!**/sdk/js/schema.graphql"
"!**/sdk/js/schema.graphql",
"!sdk/eas/subgraph/generated",
"!sdk/eas/subgraph/build",
"!sdk/eas/subgraph/abis",
"!sdk/portal/src/examples/schemas/portal-schema.graphql"
],
"experimentalScannerIgnores": [
"sdk/eas/subgraph/generated/**",
"sdk/eas/subgraph/build/**",
"sdk/eas/subgraph/abis/**",
"sdk/portal/src/examples/schemas/portal-schema.graphql"
]
},
"linter": {
Expand Down
1,066 changes: 911 additions & 155 deletions bun.lock

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sdk",
"version": "2.5.7",
"version": "2.6.2",
"private": true,
"license": "FSL-1.1-MIT",
"author": {
Expand Down Expand Up @@ -42,15 +42,16 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "0.18.2",
"@biomejs/biome": "2.2.0",
"@types/bun": "1.2.20",
"@biomejs/biome": "2.2.4",
"@types/bun": "1.2.21",
"@types/mustache": "4.2.6",
"knip": "5.62.0",
"bun-types": "1.2.22-canary.20250910T140559",
"knip": "5.63.1",
"mustache": "4.2.0",
"publint": "0.3.12",
"tsdown": "^0.14.0",
"tsdown": "^0.15.0",
"turbo": "2.5.6",
"typedoc": "0.28.10",
"typedoc": "0.28.13",
"typedoc-plugin-markdown": "4.8.1",
"typedoc-plugin-merge-modules": "7.0.0",
"typedoc-plugin-zod": "1.4.2",
Expand Down Expand Up @@ -80,7 +81,9 @@
"ws": "8.18.3",
"adm-zip": "0.5.16",
"react-is": "19.1.1",
"undici": "7.14.0"
"undici": "7.16.0"
},
"dependencies": {}
"dependencies": {
"@graphprotocol/graph-cli": "0.97.1"
}
}
6 changes: 5 additions & 1 deletion scripts/generate-readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ async function generateReadme() {
const sdkDir = join(__dirname, "..", "sdk");
console.log(`Scanning SDK directory: ${sdkDir}`);
const sdkDirEntries = await readdir(sdkDir, { withFileTypes: true });
const packages = sdkDirEntries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
const packages = sdkDirEntries
.filter((entry) => entry.isDirectory())
.map((entry) => entry.name)
.filter((entry) => entry !== "test")
.sort();
console.log(`Found ${packages.length} packages`);

// Generate README for each package
Expand Down
18 changes: 9 additions & 9 deletions sdk/blockscout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The SettleMint Blockscout SDK provides a seamless way to interact with Blockscou

> **createBlockscoutClient**\<`Setup`\>(`options`, `clientOptions?`): `object`

Defined in: [sdk/blockscout/src/blockscout.ts:76](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L76)
Defined in: [sdk/blockscout/src/blockscout.ts:76](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L76)

Creates a Blockscout GraphQL client with proper type safety using gql.tada

Expand All @@ -77,8 +77,8 @@ An object containing the GraphQL client and initialized gql.tada function

| Name | Type | Defined in |
| ------ | ------ | ------ |
| `client` | `GraphQLClient` | [sdk/blockscout/src/blockscout.ts:80](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L80) |
| `graphql` | `initGraphQLTada`\<`Setup`\> | [sdk/blockscout/src/blockscout.ts:81](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L81) |
| `client` | `GraphQLClient` | [sdk/blockscout/src/blockscout.ts:80](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L80) |
| `graphql` | `initGraphQLTada`\<`Setup`\> | [sdk/blockscout/src/blockscout.ts:81](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L81) |

##### Throws

Expand Down Expand Up @@ -136,24 +136,24 @@ const result = await client.request(query, {

> **ClientOptions** = `object`

Defined in: [sdk/blockscout/src/blockscout.ts:24](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L24)
Defined in: [sdk/blockscout/src/blockscout.ts:24](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L24)

Type definition for client options derived from the ClientOptionsSchema

##### Type declaration
##### Type Declaration

| Name | Type | Default value | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="accesstoken"></a> `accessToken?` | `string` | - | [sdk/blockscout/src/blockscout.ts:18](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L18) |
| <a id="instance"></a> `instance` | `string` | `UrlOrPathSchema` | [sdk/blockscout/src/blockscout.ts:17](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L17) |
| <a id="accesstoken"></a> `accessToken?` | `string` | - | [sdk/blockscout/src/blockscout.ts:18](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L18) |
| <a id="instance"></a> `instance` | `string` | `UrlOrPathSchema` | [sdk/blockscout/src/blockscout.ts:17](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L17) |

***

#### RequestConfig

> **RequestConfig** = `ConstructorParameters`\<*typeof* `GraphQLClient`\>\[`1`\]

Defined in: [sdk/blockscout/src/blockscout.ts:11](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L11)
Defined in: [sdk/blockscout/src/blockscout.ts:11](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L11)

Type definition for GraphQL client configuration options

Expand All @@ -163,7 +163,7 @@ Type definition for GraphQL client configuration options

> `const` **ClientOptionsSchema**: `ZodObject`\<[`ClientOptions`](#clientoptions)\>

Defined in: [sdk/blockscout/src/blockscout.ts:16](https://github.com/settlemint/sdk/blob/v2.5.7/sdk/blockscout/src/blockscout.ts#L16)
Defined in: [sdk/blockscout/src/blockscout.ts:16](https://github.com/settlemint/sdk/blob/v2.6.2/sdk/blockscout/src/blockscout.ts#L16)

Schema for validating client options for the Blockscout client.

Expand Down
2 changes: 1 addition & 1 deletion sdk/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ settlemint scs subgraph deploy --accept-defaults <subgraph-name>

## API Reference

See the [documentation](https://github.com/settlemint/sdk/tree/v2.5.7/sdk/cli/docs/settlemint.md) for available commands.
See the [documentation](https://github.com/settlemint/sdk/tree/v2.6.2/sdk/cli/docs/settlemint.md) for available commands.

## Contributing

Expand Down
1 change: 1 addition & 0 deletions sdk/cli/docs/settlemint/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Options:
--prod Connect to your production environment
--thegraph-subgraph-names &lt;subgraph-names...&gt; The name(s) of the TheGraph subgraph(s) to generate (skip if you want to generate all)
--generate-viem Generate Viem resources
--bun Generate Bun SQL code instead of PostgreSQL pool for Hasura
-h, --help display help for command
</pre>

20 changes: 10 additions & 10 deletions sdk/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@
},
"dependencies": {
"@gql.tada/cli-utils": "1.7.1",
"@inquirer/core": "10.1.15",
"@inquirer/core": "10.2.2",
"node-fetch-native": "1.6.7",
"zod": "^4"
},
"devDependencies": {
"@commander-js/extra-typings": "14.0.0",
"commander": "14.0.0",
"@inquirer/confirm": "5.1.15",
"@inquirer/input": "4.2.1",
"@inquirer/password": "4.0.17",
"@inquirer/select": "4.3.1",
"commander": "14.0.1",
"@inquirer/confirm": "5.1.18",
"@inquirer/input": "4.2.4",
"@inquirer/password": "4.0.20",
"@inquirer/select": "4.3.4",
"@settlemint/sdk-hasura": "workspace:*",
"@settlemint/sdk-js": "workspace:*",
"@settlemint/sdk-utils": "workspace:*",
"@settlemint/sdk-viem": "workspace:*",
"@types/node": "24.3.0",
"@types/semver": "7.7.0",
"@types/node": "24.5.2",
"@types/semver": "7.7.1",
"@types/which": "3.0.4",
"get-tsconfig": "4.10.1",
"giget": "2.0.0",
"is-in-ci": "2.0.0",
"semver": "7.7.2",
"slugify": "1.6.6",
"viem": "2.33.3",
"viem": "2.37.6",
"which": "5.0.0",
"yaml": "2.8.1",
"yoctocolors": "2.1.1",
"yoctocolors": "2.1.2",
"yocto-spinner": "^1.0.0"
},
"peerDependencies": {
Expand Down
15 changes: 8 additions & 7 deletions sdk/cli/src/commands/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Command } from "@commander-js/extra-typings";
import { generateOutput } from "@gql.tada/cli-utils";
import { loadEnv } from "@settlemint/sdk-utils/environment";
import { intro, note, outro, spinner } from "@settlemint/sdk-utils/terminal";
import type { DotEnv } from "@settlemint/sdk-utils/validation";
import { codegenHasura } from "@/commands/codegen/codegen-hasura";
import { codegenPortal } from "@/commands/codegen/codegen-portal";
import { codegenTheGraph } from "@/commands/codegen/codegen-the-graph";
import { codegenTsconfig } from "@/commands/codegen/codegen-tsconfig";
import { subgraphPrompt } from "@/prompts/smart-contract-set/subgraph.prompt";
import { createExamples } from "@/utils/commands/create-examples";
import { Command } from "@commander-js/extra-typings";
import { generateOutput } from "@gql.tada/cli-utils";
import { loadEnv } from "@settlemint/sdk-utils/environment";
import { intro, note, outro, spinner } from "@settlemint/sdk-utils/terminal";
import type { DotEnv } from "@settlemint/sdk-utils/validation";
import { codegenBlockscout } from "./codegen/codegen-blockscout";
import { codegenIpfs, shouldCodegenIpfs } from "./codegen/codegen-ipfs";
import { codegenMinio, shouldCodegenMinio } from "./codegen/codegen-minio";
Expand All @@ -31,6 +31,7 @@ export function codegenCommand(): Command {
"The name(s) of the TheGraph subgraph(s) to generate (skip if you want to generate all)",
)
.option("--generate-viem", "Generate Viem resources")
.option("--bun", "Generate Bun SQL code instead of PostgreSQL pool for Hasura")
// Set the command description
.description("Generate GraphQL and REST types and queries")
.usage(
Expand All @@ -50,7 +51,7 @@ export function codegenCommand(): Command {
]),
)
// Define the action to be executed when the command is run
.action(async ({ prod, thegraphSubgraphNames, generateViem }) => {
.action(async ({ prod, thegraphSubgraphNames, generateViem, bun }) => {
intro("Generating GraphQL types and queries for your dApp");
const env: DotEnv = await loadEnv(true, !!prod);

Expand Down Expand Up @@ -78,7 +79,7 @@ export function codegenCommand(): Command {

if (hasura) {
note("Generating Hasura resources");
await codegenHasura(env);
await codegenHasura(env, bun);
}
if (portal) {
note("Generating Portal resources");
Expand Down
20 changes: 16 additions & 4 deletions sdk/cli/src/commands/codegen/codegen-blockscout.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { rm, writeFile } from "node:fs/promises";
import { basename, resolve } from "node:path";
import { writeTemplate } from "@/commands/codegen/utils/write-template";
import { getApplicationOrPersonalAccessToken } from "@/utils/get-app-or-personal-token";
import { generateSchema } from "@gql.tada/cli-utils";
import { projectRoot } from "@settlemint/sdk-utils/filesystem";
import { appendHeaders, graphqlFetchWithRetry } from "@settlemint/sdk-utils/http";
import { installDependencies, isPackageInstalled } from "@settlemint/sdk-utils/package-manager";
import { note } from "@settlemint/sdk-utils/terminal";
import { type DotEnv, LOCAL_INSTANCE, STANDALONE_INSTANCE } from "@settlemint/sdk-utils/validation";
import { writeTemplate } from "@/commands/codegen/utils/write-template";
import { getApplicationOrPersonalAccessToken } from "@/utils/get-app-or-personal-token";

const PACKAGE_NAME = "@settlemint/sdk-blockscout";

Expand Down Expand Up @@ -167,6 +167,18 @@ import { createLogger, requestLogger, type LogLevel } from '@settlemint/sdk-util

const logger = createLogger({ level: process.env.SETTLEMINT_LOG_LEVEL as LogLevel });

// Validate required environment variables
const blockscoutEndpoint = process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT;
const blockscoutUiEndpointVar = process.env.SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT;

if (!blockscoutEndpoint) {
throw new Error('SETTLEMINT_BLOCKSCOUT_ENDPOINT environment variable is required');
}

if (!blockscoutUiEndpointVar) {
throw new Error('SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT environment variable is required');
}

export const { client: blockscoutClient, graphql: blockscoutGraphql } = createBlockscoutClient<{
introspection: introspection;
disableMasking: true;
Expand All @@ -189,13 +201,13 @@ export const { client: blockscoutClient, graphql: blockscoutGraphql } = createBl
Wei: string;
};
}>({
instance: process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT!,
instance: blockscoutEndpoint,
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
}, {
fetch: requestLogger(logger, "blockscout", fetch) as typeof fetch,
});

export const blockscoutUiEndpoint = process.env.SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT!;`;
export const blockscoutUiEndpoint = blockscoutUiEndpointVar;`;

await writeTemplate(template, "/lib/settlemint", "blockscout.ts");

Expand Down
Loading