Skip to content

Commit

Permalink
fix: import rpc 0.7 types from starknetjs impl
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Apr 19, 2024
1 parent 4aab970 commit 4c341d8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 31 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ on:
pull_request:
branches: '*'


jobs:
quality:
name: Quality test
Expand All @@ -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 }}
13 changes: 5 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
7 changes: 1 addition & 6 deletions src/wallet-api/components.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { CONTRACT_CLASS, FELT, ADDRESS, SIGNATURE } from '../api/components.js';
import type { ChainId } from '../api/index.js';

/**
* Account Address
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/wallet-api/events.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/wallet-api/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4c341d8

Please sign in to comment.