Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 5f67e17
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 11:04:53 2024 -0400

    Tweaks

commit 30e8806
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 11:00:38 2024 -0400

    Test

commit 363167a
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:59:06 2024 -0400

    test

commit 694373a
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:58:01 2024 -0400

    Test

commit a0bee58
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:46:54 2024 -0400

    Fixes

commit 310a3c9
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:40:23 2024 -0400

    Tweak

commit 80942de
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:38:46 2024 -0400

    Tweak

commit af029c5
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:36:35 2024 -0400

    Fix

commit 0e74d16
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:35:30 2024 -0400

    Tweaks

commit 87adc7d
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:29:19 2024 -0400

    Tweak

commit 805bfd7
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:24:37 2024 -0400

    Fix

commit 78c137d
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:23:29 2024 -0400

    Tweaks

commit 907ff55
Author: Wilhelm Thieme <[email protected]>
Date:   Sun Oct 20 10:20:39 2024 -0400

    Use local anchor setup instead of docker image

commit 5b8c691
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 21:48:55 2024 -0400

    test?

commit a02b9e1
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 21:07:52 2024 -0400

    Revert test

commit 559caa4
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 20:45:48 2024 -0400

    test

commit f18648d
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 20:19:51 2024 -0400

    Run ci in container

commit c51bd9a
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 15:30:42 2024 -0400

    Tweaks

commit e789058
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 15:27:24 2024 -0400

    Tweak

commit 174c99d
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 11:03:15 2024 -0400

    Tweak

commit 928580a
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 09:58:47 2024 -0400

    Tweak CI

commit 675889b
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 09:46:06 2024 -0400

    Node 22

commit edb7b91
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 09:34:40 2024 -0400

    Tweak

commit a3c067f
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 19 09:26:30 2024 -0400

    Build fix

commit f36ef1f
Author: Wilhelm Thieme <[email protected]>
Date:   Fri Oct 18 23:38:27 2024 -0400

    Fix failing tests

commit 0073f8d
Author: Wilhelm Thieme <[email protected]>
Date:   Fri Oct 18 22:38:35 2024 -0400

    vitest

commit 564c701
Author: Wilhelm Thieme <[email protected]>
Date:   Fri Oct 18 17:39:36 2024 -0400

    Edge case fix

commit 7ac67d6
Merge: 057136c 1985fac
Author: Wilhelm Thieme <[email protected]>
Date:   Fri Oct 18 14:31:07 2024 -0400

    Merge branch 'main' into wjthieme/utils-package

    # Conflicts:
    #	docs/ts/package.json
    #	yarn.lock

commit 057136c
Author: Wilhelm Thieme <[email protected]>
Date:   Fri Oct 18 14:30:24 2024 -0400

    Review comments

commit 5127075
Author: calintje <[email protected]>
Date:   Thu Oct 17 14:40:03 2024 +0200

    Fix description of slippage tolerance

commit de26337
Author: Calin <[email protected]>
Date:   Thu Oct 17 14:28:40 2024 +0200

    Typedocs for TS SDK (#381)

    * Base typedocs

    * Update docs

    * Finish typedocs for PR. Add export keyword for types. Update examples. Update typedocs for types.

    * Resolve comments

    ---------

    Co-authored-by: calintje <[email protected]>

commit 8ecfdb0
Author: Wilhelm Thieme <[email protected]>
Date:   Tue Oct 15 17:06:02 2024 -0400

    Swap tests and logic

commit 6a088eb
Author: Wilhelm Thieme <[email protected]>
Date:   Tue Oct 15 13:39:42 2024 -0400

    Tick array sequence function signature

commit 81da815
Merge: 5e262b0 cd4fa33
Author: Wilhelm Thieme <[email protected]>
Date:   Tue Oct 15 11:32:52 2024 -0400

    Merge branch 'main' into wjthieme/utils-package

    # Conflicts:
    #	docs/ts/package.json
    #	yarn.lock

commit 5e262b0
Author: Wilhelm Thieme <[email protected]>
Date:   Tue Oct 15 11:17:58 2024 -0400

    Better swap quote function signature

commit 78de101
Author: Wilhelm Thieme <[email protected]>
Date:   Tue Oct 15 10:15:09 2024 -0400

    Deposit ratio

commit 48819ae
Author: Wilhelm Thieme <[email protected]>
Date:   Mon Oct 14 17:12:43 2024 -0400

    Fixes

commit 11e4a3d
Author: Wilhelm Thieme <[email protected]>
Date:   Mon Oct 14 09:26:13 2024 -0400

    High level TS function naming

commit 706313f
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 12 21:52:36 2024 -0400

    Fix some tests

commit 4aa3fd2
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 12 21:42:41 2024 -0400

    Refactor macros

commit 3e65908
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 12 15:17:22 2024 -0400

    Fix some tests

commit d95f035
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 12 14:37:02 2024 -0400

    Format

commit 5f5b111
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 12 12:58:05 2024 -0400

    Merge

commit 33cf14c
Author: Wilhelm Thieme <[email protected]>
Date:   Sat Oct 12 10:44:07 2024 -0400

    Squashed commit of the following:

    commit 6f50883
    Author: Wilhelm Thieme <[email protected]>
    Date:   Thu Oct 10 11:13:31 2024 -0400

        Create pool naming

    commit f54d406
    Author: Wilhelm Thieme <[email protected]>
    Date:   Wed Oct 9 11:45:09 2024 -0400

        Fix build

    commit 04e0dab
    Author: Wilhelm Thieme <[email protected]>
    Date:   Wed Oct 9 09:13:34 2024 -0400

        Squashed commit of the following:

        commit 05cad83
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Oct 8 21:37:12 2024 -0400

            Tweaks

        commit db00d93
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Oct 8 11:20:12 2024 -0400

            New open/close instructions

        commit 1fd4563
        Merge: df7466d 447528b
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Oct 8 11:01:03 2024 -0400

            Merge branch 'wjthieme/utils-package' into wjthieme/ts-sdk

            # Conflicts:
            #	yarn.lock

        commit 447528b
        Merge: aa32a8f 16661e2
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Oct 8 11:00:17 2024 -0400

            Merge branch 'main' into wjthieme/utils-package

            # Conflicts:
            #	docs/ts/package.json
            #	yarn.lock

        commit df7466d
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Oct 8 10:59:02 2024 -0400

            Fetch positions and Transfer fees

        commit a4a967b
        Author: Wilhelm Thieme <[email protected]>
        Date:   Mon Oct 7 08:34:20 2024 -0400

            Add TODOs

        commit 8454019
        Merge: f66c061 aa32a8f
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Oct 2 17:46:49 2024 -0400

            Merge branch 'wjthieme/utils-package' into wjthieme/ts-sdk

            # Conflicts:
            #	ts-sdk/client/package.json
            #	yarn.lock

        commit aa32a8f
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Oct 2 17:45:24 2024 -0400

            Cargo lock

        commit 6ac1a3f
        Merge: 3c32ace 2c35e54
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Oct 2 17:45:03 2024 -0400

            Merge branch 'main' into wjthieme/utils-package

            # Conflicts:
            #	rust-sdk/client/Cargo.toml
            #	yarn.lock

        commit f66c061
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Oct 2 17:42:23 2024 -0400

            Build fix

        commit 4604375
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Sep 17 11:04:09 2024 +0800

            Failing test

        commit 373ad97
        Merge: 919f0dd 3c32ace
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Sep 17 09:54:29 2024 +0800

            Merge branch 'wjthieme/utils-package' into wjthieme/ts-sdk

            # Conflicts:
            #	ts-sdk/whirlpool/package.json
            #	yarn.lock

        commit 3c32ace
        Merge: 7424e40 18d5bcc
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Sep 17 09:52:38 2024 +0800

            Merge branch 'main' into wjthieme/utils-package

            # Conflicts:
            #	docs/ts/package.json
            #	yarn.lock

        commit 919f0dd
        Author: Wilhelm Thieme <[email protected]>
        Date:   Mon Sep 9 18:06:26 2024 -0400

            Fix tests

        commit 7424e40
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 22:31:55 2024 -0500

            Format

        commit f61b31f
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 22:31:32 2024 -0500

            Format

        commit acaee2a
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 22:26:51 2024 -0500

            Swap

        commit 4cd718a
        Merge: 31956ef 4d627c4
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 22:13:05 2024 -0500

            Merge branch 'wjthieme/utils-package' into wjthieme/ts-sdk

        commit 4d627c4
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 22:12:57 2024 -0500

            Fix test

        commit 31956ef
        Merge: 25a2b87 0dbd9dd
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 22:10:54 2024 -0500

            Merge branch 'wjthieme/utils-package' into wjthieme/ts-sdk

        commit 0dbd9dd
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 22:10:45 2024 -0500

            More tick arrays

        commit a0834c1
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 30 11:36:11 2024 -0500

            Manifest and readme files

        commit 25a2b87
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 29 11:27:07 2024 -0500

            Token 22 test case

        commit c5afd33
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 29 11:21:04 2024 -0500

            Typedoc

        commit 030ff19
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 29 11:08:22 2024 -0500

            Instruction assertions

        commit bba3da0
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 29 09:22:11 2024 -0500

            Tests for token account creation

        commit dde599b
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Aug 28 17:00:31 2024 -0500

            Amend

        commit fc75f93
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Aug 28 16:59:59 2024 -0500

            Sol wrapping and unwrapping

        commit f8c00d4
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Aug 28 11:16:54 2024 -0400

            Mock rpc for testing ts whirlpool lib

        commit 82415e4
        Merge: addf594 c2cfe57
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Aug 28 07:28:27 2024 -0400

            Merge branch 'wjthieme/utils-package' into wjthieme/ts-sdk

            # Conflicts:
            #	rust-sdk/core/src/quote/swap.rs

        commit c2cfe57
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Aug 28 07:27:20 2024 -0400

            Tweaks

        commit addf594
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Aug 27 11:30:13 2024 -0400

            Types tests

        commit 5be25bd
        Author: Wilhelm Thieme <[email protected]>
        Date:   Tue Aug 27 09:59:00 2024 -0400

            Enum type

        commit f113c26
        Author: Wilhelm Thieme <[email protected]>
        Date:   Mon Aug 26 17:09:01 2024 -0400

            Ts core smoke test

        commit 14158b4
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 23 14:49:50 2024 -0400

            Decrease liq and harvest position

        commit d0a75e8
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 23 13:06:50 2024 -0400

            Format

        commit edf241d
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 23 12:39:15 2024 -0400

            Format

        commit 621424d
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 23 12:37:10 2024 -0400

            open position and increase liquidity

        commit fbf54d1
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 23 08:48:19 2024 -0400

            Format

        commit ef97db2
        Author: Wilhelm Thieme <[email protected]>
        Date:   Fri Aug 23 08:39:58 2024 -0400

            PDA tests

        commit 78bea38
        Author: Sam Johnson <[email protected]>
        Date:   Fri Aug 23 00:19:45 2024 -0400

            add support for arrays

        commit f4dabc0
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 22 17:47:33 2024 -0400

            Create Pool

        commit 57b7613
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 22 15:49:29 2024 -0400

            Scaffolding

        commit 4f637c6
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 22 13:00:51 2024 -0400

            Fix failing tests

        commit 4ab7c35
        Merge: a11aeff 261905d
        Author: Wilhelm Thieme <[email protected]>
        Date:   Thu Aug 22 12:03:55 2024 -0400

            Merge branch 'main' into wjthieme/utils-package

            # Conflicts:
            #	yarn.lock

        commit a11aeff
        Author: Wilhelm Thieme <[email protected]>
        Date:   Wed Aug 21 21:09:16 2024 -0400

            Squash

commit 92ed426
Author: Wilhelm Thieme <[email protected]>
Date:   Wed Oct 9 09:04:28 2024 -0400

    Squashed commit of the following:

    commit 447528b
    Merge: aa32a8f 16661e2
    Author: Wilhelm Thieme <[email protected]>
    Date:   Tue Oct 8 11:00:17 2024 -0400

        Merge branch 'main' into wjthieme/utils-package

        # Conflicts:
        #	docs/ts/package.json
        #	yarn.lock

    commit aa32a8f
    Author: Wilhelm Thieme <[email protected]>
    Date:   Wed Oct 2 17:45:24 2024 -0400

        Cargo lock

    commit 6ac1a3f
    Merge: 3c32ace 2c35e54
    Author: Wilhelm Thieme <[email protected]>
    Date:   Wed Oct 2 17:45:03 2024 -0400

        Merge branch 'main' into wjthieme/utils-package

        # Conflicts:
        #	rust-sdk/client/Cargo.toml
        #	yarn.lock

    commit 3c32ace
    Merge: 7424e40 18d5bcc
    Author: Wilhelm Thieme <[email protected]>
    Date:   Tue Sep 17 09:52:38 2024 +0800

        Merge branch 'main' into wjthieme/utils-package

        # Conflicts:
        #	docs/ts/package.json
        #	yarn.lock

    commit 7424e40
    Author: Wilhelm Thieme <[email protected]>
    Date:   Fri Aug 30 22:31:55 2024 -0500

        Format

    commit 4d627c4
    Author: Wilhelm Thieme <[email protected]>
    Date:   Fri Aug 30 22:12:57 2024 -0500

        Fix test

    commit 0dbd9dd
    Author: Wilhelm Thieme <[email protected]>
    Date:   Fri Aug 30 22:10:45 2024 -0500

        More tick arrays

    commit a0834c1
    Author: Wilhelm Thieme <[email protected]>
    Date:   Fri Aug 30 11:36:11 2024 -0500

        Manifest and readme files

    commit c2cfe57
    Author: Wilhelm Thieme <[email protected]>
    Date:   Wed Aug 28 07:27:20 2024 -0400

        Tweaks

    commit 4f637c6
    Author: Wilhelm Thieme <[email protected]>
    Date:   Thu Aug 22 13:00:51 2024 -0400

        Fix failing tests

    commit 4ab7c35
    Merge: a11aeff 261905d
    Author: Wilhelm Thieme <[email protected]>
    Date:   Thu Aug 22 12:03:55 2024 -0400

        Merge branch 'main' into wjthieme/utils-package

        # Conflicts:
        #	yarn.lock

    commit a11aeff
    Author: Wilhelm Thieme <[email protected]>
    Date:   Wed Aug 21 21:09:16 2024 -0400

        Squash
  • Loading branch information
wjthieme committed Oct 20, 2024
1 parent 1985fac commit 1152cec
Show file tree
Hide file tree
Showing 140 changed files with 14,233 additions and 2,613 deletions.
104 changes: 45 additions & 59 deletions .github/actions/anchor/action.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,69 @@
name: 'Setup Anchor Development Environment'
description: 'Sets up the solana sdk using the specified version'
name: 'Setup Anchor'
description: 'Sets up an Anchor development environment.'

branding:
icon: anchor
color: blue

inputs:
anchor-version:
description: 'The version of anchor to use.'
required: false
default: 'v0.29.0'
rust-version:
description: 'The version of rust to use.'
required: false
default: '1.80'
solana-key:
description: 'The private key to use for the solana sdk.'
required: false
solana-cluster:
description: 'The cluster to use for the solana sdk.'
required: false
default: 'devnet'
run:
description: 'The command(s) to run.'
solana-key:
description: 'The private key to use for the solana sdk.'
required: false
rustc-version:
description: 'The version of rustc to use.'
default: 'v1.78.0'
node-version:
description: 'The version of node to use.'
default: 'v22.8.0'
solana-version:
description: 'The version of solana to use.'
default: 'v1.17.25'
anchor-version:
description: 'The version of anchor to use.'
default: 'v0.29.0'

runs:
using: "composite"
steps:
- name: Shell Setup
run: |
touch run
chmod +x run
echo "#!/bin/bash" >> run
echo "set -xeo pipefail" >> run
echo "export RUST_LOG=" >> run
shell: bash
- name: Install Dependencies
run: |
echo "yarn" >> run
shell: bash
- name: Update rustc
run: |
echo "rustup install ${{ inputs.rust-version }}" >> run
echo "rustup default ${{ inputs.rust-version }}" >> run
shell: bash
- name: Configure Solana
run: |
echo "solana config set --url ${{ inputs.solana-cluster }}" >> run
shell: bash
- name: Configure Solana Key
if: ${{ !inputs.solana-key }}
- name: Setup rustc
run: |
echo "solana-keygen new --no-bip39-passphrase" >> run
rust_version=${{ inputs.rustc-version }}
rustup toolchain install ${rust_version#v}
rustup default ${rust_version#v}
rustup component add rustfmt clippy
shell: bash
- name: Configure Solana Key
if: ${{ inputs.solana-key }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Install Solana CLI
run: |
echo "echo \"${{ inputs.solana-key }}\" > ~/.config/solana/id.json" >> run
wget -qO- "https://release.anza.xyz/${{ inputs.solana-version }}/solana-release-x86_64-unknown-linux-gnu.tar.bz2" | tar -xvj
echo "$PWD/solana-release/bin" >> $GITHUB_PATH
shell: bash
- name: Airdrop Solana
if: ${{ inputs.solana-key && inputs.solana-cluster == 'devnet' }}
- name: Install Anchor CLI
run: |
echo "solana airdrop 1 || true" >> run
anchor_version=${{ inputs.anchor-version }}
npm install -g @coral-xyz/anchor-cli@${anchor_version#v}
shell: bash
- name: Run Commands
- name: Configure Solana CLI
run: |
echo "${{ inputs.run }}" >> run
solana config set --url ${{ inputs.solana-cluster }}
if [ -z "${{ inputs.solana-key }}" ]; then
solana-keygen new --no-bip39-passphrase
else
echo "${{ inputs.solana-key }}" > ~/.config/solana/id.json
fi
solana airdrop 1 || true
shell: bash
- name: Log Commands
- name: Log Installed Tools
run: |
echo "---"
cat run
echo "---"
echo "rustc: $(rustc --version)"
echo "node: $(node --version)"
echo "solana: $(solana --version)"
echo "anchor: $(anchor --version)"
shell: bash
- name: Run Docker
run: |
docker run \
--entrypoint '/workdir/run' \
-v "$(pwd)":/workdir \
backpackapp/build:${{ inputs.anchor-version }}
shell: bash

29 changes: 16 additions & 13 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Checks

on:
pull_request:
branches: [main]
branches: "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -15,30 +15,33 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Packages
- name: Setup Anchor
uses: ./.github/actions/anchor
with:
run: |
yarn build --output-style static
- name: Install dependencies
run: yarn install
- name: Build packages
run: yarn build --output-style static

test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Tests
- name: Setup Anchor
uses: ./.github/actions/anchor
with:
run: |
yarn test --exclude legacy-sdk/whirlpool --output-style static
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test --exclude legacy-sdk/whirlpool --output-style static

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Lint
- name: Setup Anchor
uses: ./.github/actions/anchor
with:
run: |
yarn lint --output-style static
- name: Install dependencies
run: yarn install
- name: Run Lint
run: yarn lint --output-style static
15 changes: 8 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Setup Github Pages
uses: actions/configure-pages@v5
- name: Build Docs
uses: ./.github/actions/anchor
with:
run: |
yarn build docs/whirlpool --output-style static
- name: Upload Artifact
- name: Install dependencies
run: yarn install
- name: Build docs
run: yarn build docs/whirlpool --output-style static
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/whirlpool/dist
- name: Deploy Artifact
- name: Deploy artifact
id: deployment
uses: actions/deploy-pages@v4
41 changes: 23 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Set Version
uses: ./.github/actions/version
with:
version: ${{ github.ref }}
manifest-file: ts-sdk/${{ matrix.package }}/package.json
- name: Deploy npm
uses: ./.github/actions/anchor
with:
run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} && yarn
yarn build ts-sdk/${{ matrix.package }} --output-style static
cd ts-sdk/${{ matrix.package }} && npm publish --access public
- name: Setup npm
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: yarn install
- name: Build package
run: yarn build ts-sdk/${{ matrix.package }} --output-style static
- name: Publish package
working-directory: ts-sdk/${{ matrix.package }}
run: npm publish --access public

cargo:
strategy:
Expand All @@ -44,18 +48,20 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Set Version
uses: ./.github/actions/version
with:
version: ${{ github.ref }}
manifest-file: rust-sdk/${{ matrix.package }}/Cargo.toml
- name: Deploy cargo
uses: ./.github/actions/anchor
with:
run: |
export CARGO_REGISTRY_TOKEN=${{ secrets.CRATES_TOKEN }}
yarn build rust-sdk/${{ matrix.package }} --output-style static
cd rust-sdk/${{ matrix.package }} && cargo publish --allow-dirty
- name: Install dependencies
run: yarn install
- name: Build package
run: yarn build rust-sdk/${{ matrix.package }} --output-style static
- name: Publish package
working-directory: rust-sdk/${{ matrix.package }}
run: cargo publish --allow-dirty

idl:
runs-on: ubuntu-latest
Expand All @@ -64,11 +70,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build idl
- name: Setup Anchor
uses: ./.github/actions/anchor
with:
run: |
anchor build
- name: Build idl
run: anchor build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
# yarn lint-staged
2 changes: 1 addition & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cluster = "localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn ts-mocha --timeout 1000000 legacy-sdk/whirlpool/**/*.test.ts"
test = "yarn vitest run --test-timeout 1000000 --no-file-parallelism --globals legacy-sdk/whirlpool/tests"

[test.validator]
slots_per_epoch = "33"
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ The program has been audited several times by different security firms.

***The new whirlpool SDKs are still in development and are not recommended for production use yet. Please see [Legacy](#legacy)***

This repository contains several libraries that can be used to interact with the Whirlpools contract. For most purposes you can use the full library (`@orca-so/whirlpools` and `orca-whirlpools`).
This repository contains several libraries that can be used to interact with the Whirlpools contract. For most purposes you can use the full library (`@orca-so/whirlpools` and `orca_whirlpools`).

For specific use-cases you can opt for integrating with lower level packages such as:
* `@orca-so/whirlpools-client` & `orca-whirlpools-client` - auto-generated client for the Whirlpools program that contains account, instruction and error parsing.
* `@orca-so/whirlpools-quoting` & `orca-whirlpools-quoting` - math lib used to calculate a quote for a given trade or liquidity action.
* `@orca-so/whirlpools-composite` & `orca-whirlpools-composite` - helper package for compositing instructions together for executing common actions.
* `@orca-so/whirlpools-utils` & `orca-whirlpools-utils` - utility and math functions used by other packages.
* `@orca-so/whirlpools-client` & `orca_whirlpools_client` - auto-generated client for the Whirlpools program that contains account, instruction and error parsing.
* `@orca-so/whirlpools-core` & `orca_whirlpools_core` - utility and math functions used by other packages.

### Legacy

Expand Down Expand Up @@ -91,8 +89,6 @@ If you look closely, the commands just call individual commands specified in the

If you want to stream the logs of a specific command you can add the `--output-style stream` flag to the command. This allows you to view the logs of the command as they are being produced which can be useful for longer running tasks like integration tests.

---

# Support

### Questions
Expand Down
1 change: 1 addition & 0 deletions docs/legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"clean": "rimraf dist"
},
"devDependencies": {
"@orca-so/whirlpools": "*",
"@orca-so/whirlpools-sdk": "*",
"typedoc": "^0.26.10",
"typescript": "^5.6.3"
Expand Down
1 change: 1 addition & 0 deletions docs/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"devDependencies": {
"@orca-so/whirlpools": "*",
"@orca-so/whirlpools-sdk": "*",
"typedoc": "^0.26.10",
"typescript": "^5.6.3"
}
Expand Down
3 changes: 2 additions & 1 deletion docs/whirlpool/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export default {
docs: {
routeBasePath: "/",
sidebarPath: "./sidebars.js",
editUrl: "https://github.com/orca-so/whirlpools/tree/main/docs/whirlpool",
editUrl:
"https://github.com/orca-so/whirlpools/tree/main/docs/whirlpool",
},
theme: {
customCss: "./static/index.css",
Expand Down
1 change: 0 additions & 1 deletion legacy-sdk/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"@solana/web3.js": "^1.95.2"
},
"devDependencies": {
"@types/mocha": "^10.0.9",
"@types/mz": "^2.7.3",
"mz": "^2.7.0",
"typescript": "^5.6.3"
Expand Down
2 changes: 2 additions & 0 deletions legacy-sdk/whirlpool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"@orca-so/whirlpools-program": "*",
"@solana/spl-token": "^0.4.8",
"@solana/web3.js": "^1.90.0",
"@types/bn.js": "~5.1.6",
"@types/jest": "^29.5.13",
"decimal.js": "^10.4.3",
"typescript": "^5.6.3"
},
Expand Down
4 changes: 2 additions & 2 deletions legacy-sdk/whirlpool/src/utils/public/price-math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ export class PriceMath {
.toDecimalPlaces(0);

const lowerBoundSqrtPrice = BN.min(
BN.max(new BN(lowerBoundSqrtPriceDecimal.toString()), MIN_SQRT_PRICE_BN),
BN.max(new BN(lowerBoundSqrtPriceDecimal.toFixed(0)), MIN_SQRT_PRICE_BN),
MAX_SQRT_PRICE_BN,
);
const upperBoundSqrtPrice = BN.min(
BN.max(new BN(upperBoundSqrtPriceDecimal.toString()), MIN_SQRT_PRICE_BN),
BN.max(new BN(upperBoundSqrtPriceDecimal.toFixed(0)), MIN_SQRT_PRICE_BN),
MAX_SQRT_PRICE_BN,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("close_bundled_position", () => {
let whirlpoolPda: PDA;
const funderKeypair = anchor.web3.Keypair.generate();

before(async () => {
beforeAll(async () => {
poolInitInfo = (await initTestPool(ctx, TickSpacing.Standard)).poolInitInfo;
whirlpoolPda = poolInitInfo.whirlpoolPda;
await systemTransferTx(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("close_position_with_token_extensions", () => {
let whirlpoolPda: PDA;
const funderKeypair = anchor.web3.Keypair.generate();

before(async () => {
beforeAll(async () => {
poolInitInfo = (await initTestPool(ctx, TickSpacing.Standard)).poolInitInfo;
whirlpoolPda = poolInitInfo.whirlpoolPda;
await systemTransferTx(
Expand Down
Loading

0 comments on commit 1152cec

Please sign in to comment.