diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 770ff9a..b81cabe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,6 @@ on: pull_request: branches: '*' - jobs: quality: name: Quality test @@ -39,17 +38,17 @@ jobs: if: ${{ github.ref == 'refs/heads/main' }} needs: [quality] steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - name: Run Release on Node lts/* - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: 'npm' - - run: npm ci - - run: npm run build - - run: npx semantic-release --debug ${{ inputs.debug }} --dry-run ${{ inputs.dry-run }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + - name: Run Release on Node lts/* + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: 'npm' + - run: npm ci + - run: npm run build + - run: npx semantic-release --debug ${{ inputs.debug }} --dry-run ${{ inputs.dry-run }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/src/index.ts b/src/index.ts index 4ef7345..7abebae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,5 @@ -export * from './api/components.js'; -export * from './wallet-api/constants.js'; -export * from './wallet-api/typedData.js'; -export * from './wallet-api/StarknetWindowObject.js'; -export * from './wallet-api/components.js'; -export * from './wallet-api/methods.js'; -export * from './wallet-api/events.js'; -export * from './wallet-api/errors.js'; +export * from './api/index.js'; +export * as API from './api/index.js'; + +export * from './wallet-api/index.js'; +export * as WALLET_API from './wallet-api/index.js'; diff --git a/src/wallet-api/components.ts b/src/wallet-api/components.ts index abbb816..a9de056 100644 --- a/src/wallet-api/components.ts +++ b/src/wallet-api/components.ts @@ -1,4 +1,5 @@ import type { CONTRACT_CLASS, FELT, ADDRESS, SIGNATURE } from '../api/components.js'; +import type { ChainId } from '../api/index.js'; /** * Account Address @@ -30,12 +31,6 @@ export type SpecVersion = string; */ export type TokenSymbol = string; // TODO: I would recommend rename to TOKEN_SYMBOL to avoid collision with js Symbol (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) -/** - * chain id, given in hex representation. - * @pattern "^0x[a-fA-F0-9]+$" - */ -export type ChainId = string; - /** * Starknet Token * Details of an onchain Starknet ERC20 token diff --git a/src/wallet-api/events.ts b/src/wallet-api/events.ts index 036d447..a172c56 100644 --- a/src/wallet-api/events.ts +++ b/src/wallet-api/events.ts @@ -1,4 +1,4 @@ -import type { ChainId } from './components.js'; +import type { ChainId } from '../api/index.js'; // Optimization on events export type AccountChangeEventHandler = (accounts?: string[]) => void; diff --git a/src/wallet-api/methods.ts b/src/wallet-api/methods.ts index af25581..f571ba7 100644 --- a/src/wallet-api/methods.ts +++ b/src/wallet-api/methods.ts @@ -9,13 +9,13 @@ import type { AddInvokeTransactionResult, AddStarknetChainParameters, Address, - ChainId, RequestAccountsParameters, Signature, SpecVersion, SwitchStarknetChainParameters, WatchAssetParameters, } from './components.js'; +import type { ChainId } from '../api/index.js'; /** * Maps each RPC message type to its corresponding parameters and result type.