Skip to content
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: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- uses: ./.github/actions/install-dependencies
- run: pnpm clean
- run: pnpm build
- run: pnpm typecheck
- run: pnpm lint

tests:
name: Run all tests
Expand Down
4 changes: 4 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ pre-commit:
prettier:
glob: '**/*.{js,jsx,ts,tsx,json,md,yml,yaml}'
run: pnpm prettier --write {staged_files} && git add {staged_files}
lint:
run: pnpm lint
typecheck:
run: pnpm typecheck
syncpack:
glob:
- "package.json"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "pnpm build:packages",
"dev": "turbo dev",
"test": "turbo test --concurrency=1",
"lint": "turbo lint",
"lint": "turbo lint --continue",
"format": "prettier --list-different --write \"**/*.{ts,tsx,md}\"",
"typecheck": "turbo typecheck",
"postinstall": "lefthook install",
Expand Down
5 changes: 4 additions & 1 deletion packages/services/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"publishConfig": {
"access": "public"
},
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "echo",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings 0"
},
"exports": {
".": {
Expand All @@ -23,6 +25,7 @@
"devDependencies": {
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"@repo/eslint-config": "workspace:^",
"typescript": "^5.9.3"
}
}
6 changes: 3 additions & 3 deletions packages/services/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './api.gen'
export * from './api.gen.js'

import { API as ApiRpc } from './api.gen'
import { API as ApiRpc } from './api.gen.js'

export class SequenceAPIClient extends ApiRpc {
constructor(
Expand All @@ -15,7 +15,7 @@ export class SequenceAPIClient extends ApiRpc {
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
// automatically include jwt and access key auth header to requests
// if its been set on the api client
const headers: { [key: string]: any } = {}
const headers: Record<string, string> = {}

const jwtAuth = this.jwtAuth
const projectAccessKey = this.projectAccessKey
Expand Down
5 changes: 4 additions & 1 deletion packages/services/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"publishConfig": {
"access": "public"
},
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "echo",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings 0"
},
"exports": {
".": {
Expand All @@ -21,6 +23,7 @@
}
},
"devDependencies": {
"@repo/eslint-config": "workspace:^",
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"typescript": "^5.9.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/services/builder/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './builder.gen'
export * from './builder.gen.js'

import { Builder as BuilderRpc } from './builder.gen'
import { Builder as BuilderRpc } from './builder.gen.js'

export class SequenceBuilderClient extends BuilderRpc {
constructor(
Expand All @@ -15,7 +15,7 @@ export class SequenceBuilderClient extends BuilderRpc {
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
// automatically include access key auth header to requests
// if its been set on the api client
const headers: { [key: string]: any } = {}
const headers: Record<string, string> = {}

const projectAccessKey = this.projectAccessKey
if (projectAccessKey && projectAccessKey.length > 0) {
Expand Down
4 changes: 3 additions & 1 deletion packages/services/guard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"dev": "tsc --watch",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings 0"
},
"exports": {
".": {
Expand All @@ -24,6 +25,7 @@
}
},
"devDependencies": {
"@repo/eslint-config": "workspace:^",
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"typescript": "^5.9.3",
Expand Down
13 changes: 7 additions & 6 deletions packages/services/guard/src/local.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Address, Hex, Bytes, Secp256k1, Hash } from 'ox'
import { Address, Hex, Bytes, Secp256k1 } from 'ox'
import * as Client from './client/guard.gen.js'
import * as Types from './types.js'

Expand All @@ -11,12 +11,13 @@ export class Guard implements Types.Guard {
}

async signPayload(
wallet: Address.Address,
chainId: number,
type: Client.PayloadType,
_wallet: Address.Address,
_chainId: number,
_type: Client.PayloadType,
digest: Bytes.Bytes,
message: Bytes.Bytes,
signatures?: Client.Signature[],
_message: Bytes.Bytes,
_signatures?: Client.Signature[],
_token?: Client.AuthToken,
) {
return Secp256k1.sign({ privateKey: this.privateKey, payload: digest })
}
Expand Down
2 changes: 1 addition & 1 deletion packages/services/guard/src/sequence.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Address, Hex, Signature, Bytes, Hash } from 'ox'
import { Address, Hex, Signature, Bytes } from 'ox'
import * as Client from './client/guard.gen.js'
import * as Types from './types.js'

Expand Down
8 changes: 4 additions & 4 deletions packages/services/guard/test/sequence.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { Guard } from '../src/sequence'
import { PayloadType } from '../src/client/guard.gen'
import { Guard } from '../src/sequence.js'
import { PayloadType } from '../src/client/guard.gen.js'
import { Address, Bytes, Hex } from 'ox'

// Mock fetch globally for guard API calls
const mockFetch = vi.fn()
global.fetch = mockFetch
globalThis.fetch = mockFetch

describe('Sequence', () => {
describe('GuardSigner', () => {
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('Sequence', () => {
ok: true,
})

await guard.signPayload(testWallet, 1, PayloadType.ConfigUpdate, testMessageDigest, testMessage)
await guard.signPayload(testWallet, customChainId, PayloadType.ConfigUpdate, testMessageDigest, testMessage)

const requestBody = JSON.parse(mockFetch.mock.calls[0][1].body)
expect(requestBody.request.chainId).toBe(1)
Expand Down
4 changes: 4 additions & 0 deletions packages/services/identity-instrument/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { config as baseConfig } from "@repo/eslint-config/base"

/** @type {import("eslint").Linter.Config} */
export default baseConfig
5 changes: 4 additions & 1 deletion packages/services/identity-instrument/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "vitest run"
"test": "vitest run",
"lint": "eslint . --max-warnings 0",
"typecheck": "tsc --noEmit"
},
"exports": {
".": {
Expand All @@ -19,6 +21,7 @@
}
},
"devDependencies": {
"@repo/eslint-config": "workspace:^",
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"typescript": "^5.9.3",
Expand Down
4 changes: 4 additions & 0 deletions packages/services/indexer/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { config as baseConfig } from "@repo/eslint-config/base"

/** @type {import("eslint").Linter.Config} */
export default baseConfig
5 changes: 4 additions & 1 deletion packages/services/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"publishConfig": {
"access": "public"
},
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "echo",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings 0"
},
"exports": {
".": {
Expand All @@ -21,6 +23,7 @@
}
},
"devDependencies": {
"@repo/eslint-config": "workspace:^",
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"typescript": "^5.9.3"
Expand Down
12 changes: 6 additions & 6 deletions packages/services/indexer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export * from './indexer.gen'
export * as IndexerGateway from './indexergw.gen'
export * from './indexer.gen.js'
export * as IndexerGateway from './indexergw.gen.js'

import { Indexer as IndexerRpc } from './indexer.gen'
import { IndexerGateway as IndexerGatewayRpc } from './indexergw.gen'
import { Indexer as IndexerRpc } from './indexer.gen.js'
import { IndexerGateway as IndexerGatewayRpc } from './indexergw.gen.js'

export class SequenceIndexer extends IndexerRpc {
constructor(
Expand All @@ -17,7 +17,7 @@ export class SequenceIndexer extends IndexerRpc {
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
// automatically include jwt and access key auth header to requests
// if its been set on the api client
const headers: { [key: string]: any } = {}
const headers: Record<string, string> = {}

const jwtAuth = this.jwtAuth
const projectAccessKey = this.projectAccessKey
Expand Down Expand Up @@ -50,7 +50,7 @@ export class SequenceIndexerGateway extends IndexerGatewayRpc {
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
// automatically include jwt and access key auth header to requests
// if its been set on the api client
const headers: { [key: string]: any } = {}
const headers: Record<string, string> = {}

const jwtAuth = this.jwtAuth
const projectAccessKey = this.projectAccessKey
Expand Down
4 changes: 4 additions & 0 deletions packages/services/marketplace/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { config as baseConfig } from "@repo/eslint-config/base"

/** @type {import("eslint").Linter.Config} */
export default baseConfig
5 changes: 4 additions & 1 deletion packages/services/marketplace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"publishConfig": {
"access": "public"
},
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "echo",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings 0"
},
"exports": {
".": {
Expand All @@ -21,6 +23,7 @@
}
},
"devDependencies": {
"@repo/eslint-config": "workspace:^",
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"typescript": "^5.9.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/services/marketplace/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './marketplace.gen'
export * from './marketplace.gen.js'

import { Marketplace as MarketplaceRpc } from './marketplace.gen'
import { Marketplace as MarketplaceRpc } from './marketplace.gen.js'

export class MarketplaceIndexer extends MarketplaceRpc {
constructor(
Expand All @@ -15,7 +15,7 @@ export class MarketplaceIndexer extends MarketplaceRpc {
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
// automatically include jwt and access key auth header to requests
// if its been set on the api client
const headers: { [key: string]: any } = {}
const headers: Record<string, string> = {}

const jwtAuth = this.jwtAuth
const projectAccessKey = this.projectAccessKey
Expand Down
4 changes: 4 additions & 0 deletions packages/services/metadata/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { config as baseConfig } from "@repo/eslint-config/base"

/** @type {import("eslint").Linter.Config} */
export default baseConfig
5 changes: 4 additions & 1 deletion packages/services/metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/services/metadata",
"author": "Sequence Platforms ULC",
"license": "Apache-2.0",
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "echo",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings 0"
},
"exports": {
".": {
Expand All @@ -21,6 +23,7 @@
}
},
"devDependencies": {
"@repo/eslint-config": "workspace:^",
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"typescript": "^5.9.3"
Expand Down
8 changes: 4 additions & 4 deletions packages/services/metadata/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './metadata.gen'
export * from './metadata.gen.js'

import { Metadata as MetadataRpc, Collections as CollectionsRpc } from './metadata.gen'
import { Metadata as MetadataRpc, Collections as CollectionsRpc } from './metadata.gen.js'

export class SequenceMetadata extends MetadataRpc {
constructor(
Expand All @@ -15,7 +15,7 @@ export class SequenceMetadata extends MetadataRpc {
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
// automatically include jwt and access key auth header to requests
// if its been set on the client
const headers: { [key: string]: any } = {}
const headers: Record<string, string> = {}

const jwtAuth = this.jwtAuth
const projectAccessKey = this.projectAccessKey
Expand Down Expand Up @@ -47,7 +47,7 @@ export class SequenceCollections extends CollectionsRpc {
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
// automatically include jwt auth header to requests
// if its been set on the client
const headers: { [key: string]: any } = {}
const headers: Record<string, string> = {}

const jwtAuth = this.jwtAuth

Expand Down
4 changes: 4 additions & 0 deletions packages/services/relayer/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { config as baseConfig } from "@repo/eslint-config/base"

/** @type {import("eslint").Linter.Config} */
export default baseConfig
4 changes: 3 additions & 1 deletion packages/services/relayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"old-test:file": "NODE_OPTIONS='--import tsx' mocha --timeout 60000",
"old-test:concurrently": "concurrently -k --success first 'pnpm start:hardhat > /dev/null' ",
"start:hardhat": "pnpm hardhat node --port 9547",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings 0"
},
"exports": {
".": {
Expand All @@ -26,6 +27,7 @@
}
},
"devDependencies": {
"@repo/eslint-config": "workspace:^",
"@repo/typescript-config": "workspace:^",
"@types/node": "^25.3.0",
"typescript": "^5.9.3",
Expand Down
Loading