Skip to content

Commit

Permalink
Merge pull request #17 from compolabs/feat/1113-new-orderbook-contract
Browse files Browse the repository at this point in the history
[1113] New orderbook contract
  • Loading branch information
EchoDex authored Jun 24, 2024
2 parents 69100b1 + f53c319 commit 8a9d04e
Show file tree
Hide file tree
Showing 28 changed files with 7,773 additions and 10,151 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,34 @@ on:
- main
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Set up Node.js
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install

- name: Build package
run: npm run build
run: pnpm install

- name: Lint and Test
run: npm run lint
run: pnpm run lint

- name: Build package
run: pnpm run build

- name: Publish to npm
run: npm publish --access=public
run: pnpm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ dist-ssr
dist
coverage
.env

package-lock.json
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ const spark = new Spark({
Below is a list of all the available methods in the spark-orderbook-ts-sdk. These methods enable interaction with spot market:

1. **setActiveWallet(wallet?: WalletLocked | WalletUnlocked)** - Updates the active wallet used in the library.
2. **createSpotOrder(baseToken: Asset, quoteToken: Asset, size: string, price: string)** - Creates a spot order with the specified parameters.
3. **cancelSpotOrder(orderId: string)** - Cancels a specified spot order.
4. **matchSpotOrders(sellOrderId: string, buyOrderId: string)** - Matches a sell order with a buy order.
2. **createOrder(baseToken: Asset, quoteToken: Asset, size: string, price: string)** - Creates an order with the specified parameters.
3. **cancelOrder(orderId: string)** - Cancels a specified order.
4. **matchOrders(sellOrderId: string, buyOrderId: string)** - Matches a sell order with a buy order.
5. **mintToken(token: Asset, amount: string)** - Mints the specified amount of a token.
6. **fetchSpotMarkets(limit: number)** - Retrieves a list of spot markets up to the specified limit.
7. **fetchSpotMarketPrice(baseToken: Asset)** - Fetches the current market price for a given spot market token.
8. **fetchSpotOrders(params: FetchOrdersParams)** - Fetches spot orders based on the specified parameters.
9. **fetchSpotTrades(params: FetchTradesParams)** - Retrieves trades for spot markets based on provided parameters.
10. **fetchSpotVolume()** - Retrieves the trading volume for spot markets.
11. **fetchSpotOrderById(orderId: string)** - Retrieves details of a specific spot order by its ID.
6. **fetchMarkets(limit: number)** - Retrieves a list of markets up to the specified limit.
7. **fetchMarketPrice(baseToken: Asset)** - Fetches the current market price for a given market token.
8. **fetchOrders(params: FetchOrdersParams)** - Fetches orders based on the specified parameters.
9. **fetchTrades(params: FetchTradesParams)** - Retrieves trades for markets based on provided parameters.
10. **fetchVolume()** - Retrieves the trading volume for markets.
11. **fetchOrderById(orderId: string)** - Retrieves details of a specific order by its ID.
12. **fetchWalletBalance(asset: Asset)** - Fetches the balance of a specified asset in the wallet.
13. **getProviderWallet()** - Retrieves the wallet associated with the provider.
14. **getProvider()** - Retrieves the provider used by the library.
Expand Down
2 changes: 1 addition & 1 deletion examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ const spark = new SparkOrderbook({
wallet,
});

spark.fetchSpotMarkets(1).then(console.log);
spark.fetchMarkets(1).then(console.log);
Loading

0 comments on commit 8a9d04e

Please sign in to comment.