Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5a384b5
add getSubVaults method, add isStateUpdateRequired to vault abi
dfkadyr Jan 20, 2026
bd89745
small improves
dfkadyr Jan 20, 2026
d293448
add isClaimed to getExitQueuePositions
dfkadyr Jan 20, 2026
dff7431
add support for sub-vault management with new methods and parameters
dfkadyr Jan 30, 2026
f5adb5a
add canHarvest to getVault request
dfkadyr Jan 30, 2026
7a0692b
Create MetaVault (#341)
Cast0001 Feb 3, 2026
3c09390
Add subvault (#344)
dfkadyr Feb 17, 2026
2e92cdd
[improve-sub-vaults] change methods (#345)
Cast0001 Feb 20, 2026
661401a
[new-metavaults-addresses] set new data (#346)
Cast0001 Feb 25, 2026
39241b9
Update state (#348)
mike-diamond Mar 17, 2026
78a39c1
add replica subgraphs
Cast0001 Mar 24, 2026
94d3b4b
Abort callback (#353)
Cast0001 Mar 24, 2026
047ee99
Merge branch 'main' into sub-vaults
Cast0001 Mar 24, 2026
4abc61d
Link checker (#355)
dfkadyr Apr 7, 2026
5b52db2
refactor gas & encode in setDepositData transactions (#359)
dfkadyr Apr 8, 2026
bceb1cd
[subgraph updates] update sub vaults request (#362)
mike-diamond Apr 21, 2026
e904379
update factories addresses (#365)
dfkadyr Apr 22, 2026
e4b1cf8
Merge main sdk (#366)
dfkadyr Apr 24, 2026
42a9bd7
[expand-sub-vaults-registry] change abi (#367)
Cast0001 Apr 27, 2026
b873d54
[curator-v2] add v2 curator for vault creation (#368)
Cast0001 Apr 29, 2026
e3c6dc2
add endpoints file (#369)
dfkadyr May 4, 2026
01b26e7
Merge main (#371)
Cast0001 May 6, 2026
d9a66b5
Context7 (#374)
mike-diamond May 11, 2026
2032bee
[context7] update branch
mike-diamond May 11, 2026
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
6 changes: 3 additions & 3 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
packages: read
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
with:
version: 10.25.0

- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: '24.12.0'

Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/sync-docs.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
packages: read
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
with:
version: 10.25.0

- name: Setup Node
uses: actions/setup-node@v6
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
cache: pnpm
scope: '@stakewise'
Expand Down
2 changes: 1 addition & 1 deletion .graphqlconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"extensions": {
"endpoints": {
"Subgraph GraphQL": {
"url": "https://graphs.stakewise.io/hoodi/subgraphs/name/stakewise/prod",
"url": "https://graphs-replica.stakewise.io/hoodi/subgraphs/name/stakewise/stage",
"headers": {
"user-agent": "JS GraphQL"
},
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sh ./scripts/pre-push.sh

npm run lint
pnpm run check:docLinks
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check:docLinks fetches the live docs sitemap over the network; running this in a pre-commit hook can be slow and may fail for contributors who are offline or behind restrictive networks. Consider moving it to CI (pre-push or workflow) or adding an opt-out (e.g., env flag) so local commits don’t become flaky.

Suggested change
pnpm run check:docLinks
if [ "${SKIP_DOC_LINKS:-0}" != "1" ]; then
pnpm run check:docLinks
fi

Copilot uses AI. Check for mistakes.
pnpm run lint
23 changes: 23 additions & 0 deletions changelog/next-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Added methods

- [sdk.vault.getSubVaults](https://docs.stakewise.io/sdk/api/vault/requests/getsubvaults)
- [sdk.vault.addSubVault](https://docs.stakewise.io/sdk/api/vault/transactions/addsubvault)
- [sdk.vault.rejectSubVault](https://docs.stakewise.io/sdk/api/vault/transactions/rejectsubvault)
- [sdk.vault.ejectSubVault](https://docs.stakewise.io/sdk/api/vault/transactions/ejectsubvault)
- [sdk.vault.updateState](https://docs.stakewise.io/sdk/api/vault/transactions/updatestate)

## Modified methods

### 1. [sdk.vault.getVault](https://docs.stakewise.io/sdk/api/vault/requests/getvault)

#### Add output field:
```ts
type Output = {
canHarvest: boolean
exitingAssets: string
exitingTickets: string
ejectingSubVault: string
subVaultsRegistry: string
pendingMetaSubVault: string
}
```
4 changes: 2 additions & 2 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { CodegenConfig } from '@graphql-codegen/cli'
import { Network } from './src/helpers/enums'
import configs from './src/helpers/configs'


let network: Network = Network.Mainnet
// TODO change
let network: Network = Network.Hoodi
Comment on lines +5 to +6
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the default codegen network to Hoodi (with a TODO) makes builds/codegen sensitive to local defaults and can accidentally generate types against a staging endpoint. Prefer keeping the default as Mainnet (or requiring an explicit NETWORK env var) so generated outputs are deterministic across environments.

Suggested change
// TODO change
let network: Network = Network.Hoodi
let network: Network = Network.Mainnet

Copilot uses AI. Check for mistakes.

Comment on lines +5 to 7
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the default codegen network from Mainnet to Hoodi (and leaving a TODO) can silently generate the wrong GraphQL types/operations when NETWORK is not set (e.g., local dev, CI scripts). Consider restoring Mainnet as the default and making Hoodi opt-in via env/config, or fail fast when NETWORK is missing to avoid accidental wrong builds.

Suggested change
// TODO change
let network: Network = Network.Hoodi
let network: Network = Network.Mainnet
if (process.env.NETWORK === 'hoodi') {
network = Network.Hoodi
}

Copilot uses AI. Check for mistakes.
if (process.env.NETWORK === 'mainnet') {
network = Network.Mainnet
Expand Down
3 changes: 3 additions & 0 deletions documentation/03-quick-start/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Quick Start"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"version": "4.2.2",
"version": "4.2.4",
"sideEffects": false,
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -20,6 +20,7 @@
"graphql": "graphql-codegen && tsx ./scripts/generateGraphqlExports/index.ts",
"rollup": "rollup --config rollup.config.js",
"check:version": "node ./scripts/checkVersion.js",
"check:docLinks": "node ./scripts/checkDocLinks.js",
"lint": "eslint ./src --ext .ts,.tsx,.js,.jsx",
"release": "pnpm build && pnpm publish --tag=latest",
"sync:docs": "tsx ./scripts/syncDocs/index.ts"
Expand Down
144 changes: 144 additions & 0 deletions scripts/checkDocLinks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import path from 'path'
import https from 'https'
import { fileURLToPath } from 'url'
import { execSync } from 'child_process'


const __dirname = path.dirname(fileURLToPath(import.meta.url))

// eslint-disable-next-line no-restricted-syntax
const docsUrl = 'https://docs.stakewise.io'

const srcDir = path.resolve(__dirname, '../src')

const fetchSitemap = () => {
const sitemapUrl = `${docsUrl}/sitemap.xml`

return new Promise((resolve, reject) => {
https
.get(sitemapUrl, (res) => {
let data = ''

res.on('data', (chunk) => data += chunk)
res.on('end', () => {
const matches = data.match(/<loc>([^<]+)/g) || []

const urls = matches.map((match) => {
return match
.replace('<loc>', '')
.replace(/\/$/, '')
.toLowerCase()
})

resolve(urls)
})
})
.on('error', reject)
})
}

const getSdkApiSlugs = () => {
try {
const output = execSync(
`grep -r "^slug:" "${srcDir}" --include="*.md"`,
{ encoding: 'utf-8' }
)
Comment on lines +42 to +45
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc link checker relies on grep, which is not available by default on Windows environments. Since this script is now enforced via Husky on pre-commit, it can block contributors on non-Unix platforms. Consider rewriting the scan using Node filesystem/glob APIs (cross-platform), or run this check only in CI where the environment is controlled.

Copilot uses AI. Check for mistakes.

const slugs = output
.split('\n')
.filter(Boolean)
.map((line) => line.replace(/.*slug:\s*/, '').trim().replace(/\/$/, '').toLowerCase())

const brokenSlugs = slugs.filter((slug) => !slug.startsWith('/'))

if (brokenSlugs.length) {
console.log('🚫 Slugs must start with /:')
brokenSlugs.forEach((slug) => console.log(`${slug}`))
process.exit(1)
}

return slugs.filter((slug) => slug.startsWith('/sdk/api/'))
}
catch {
return []
}
}

const getUrls = () => {
const rootDir = path.resolve(__dirname, '..')

try {
const output = execSync(
`grep -roh "https://docs\\.stakewise\\.io/[^\\"' )\\\`>]*" "${rootDir}" `
+ '--include="*.ts" --include="*.tsx" --include="*.md" --include="*.mdx" '
+ '--exclude-dir=node_modules',
{ encoding: 'utf-8' }
)
Comment on lines +71 to +76
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc link checker relies on grep, which is not available by default on Windows environments. Since this script is now enforced via Husky on pre-commit, it can block contributors on non-Unix platforms. Consider rewriting the scan using Node filesystem/glob APIs (cross-platform), or run this check only in CI where the environment is controlled.

Copilot uses AI. Check for mistakes.

return [ ...new Set(
output
.split('\n')
.map((url) => url.replace(/[.,;)]+$/, ''))
.filter((url) => url && url !== docsUrl && url !== `${docsUrl}/`)
)]
}
catch {
return []
}
}

const checkDocLinks = async () => {
const urls = getUrls()

if (!urls.length) {
console.log('No docs links found.')

return
}

const slugs = getSdkApiSlugs()
const broken = []

let sitemap = null

for (const url of urls) {
const urlPath = url.replace(docsUrl, '').replace(/[#?].*$/, '').replace(/\/$/, '').toLowerCase()

if (slugs.includes(urlPath)) {
continue
}

// Not found in local slugs — check against live sitemap
if (!sitemap) {
sitemap = await fetchSitemap()
}

if (!sitemap.includes(`${docsUrl}${urlPath}`)) {
broken.push(url)
}
}

if (broken.length) {
broken.forEach((url) => console.log(url))
console.log(`\n🚫 Found ${broken.length} broken link(s)!`)
process.exit(1)
}

console.log('✅ All docs links are valid.')

// Warn if staged md files were changed
try {
const stagedMd = execSync('git diff --cached --name-only -- "src/**/*.md" "documentation/**/*.md"', { encoding: 'utf-8' }).trim()

if (stagedMd) {
const warn = (text) => console.log(`\x1b[33m${text}\x1b[0m`)

console.log()
warn('⚠️SDK docs were changed! ⚠️')
warn("Don't forget to run: pnpm sync:docs")
}
}
catch {}
}

checkDocLinks()
Loading
Loading