Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #172

Merged
merged 53 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3179bc2
Merge pull request #145 from staratlasmeta/main
Buzzec Aug 14, 2023
638750b
chore: remove babel-eslint
mindrunner Mar 18, 2024
b58c49e
chore: remove gumdrop
mindrunner Mar 18, 2024
cab53c9
chore: remove cross-env
mindrunner Mar 18, 2024
6552609
chore: remove big.js dependency
mindrunner Mar 18, 2024
34fc936
chore: remove explicit BN dependency
mindrunner Mar 18, 2024
39f65c4
chore: update jest
mindrunner Mar 18, 2024
bbceba7
chore: update eslint
mindrunner Mar 18, 2024
1869e78
chore: update typedoc
mindrunner Mar 18, 2024
caa79c0
chore: update prettier
mindrunner Mar 18, 2024
2e5f359
chore: update eslint
mindrunner Mar 18, 2024
6d0a4c7
chore: fix bn.js types
mindrunner Mar 18, 2024
3750f98
chore: update mobx
mindrunner Mar 18, 2024
1ff056a
chore: remove unused js-sha3
mindrunner Mar 18, 2024
d29bdf7
chore: update solana web3.js
mindrunner Mar 18, 2024
c8db12d
chore: update typescript / anchor-contrib
mindrunner Mar 18, 2024
0099e37
chore: remove anchor-contrib dependency
mindrunner Mar 19, 2024
ac57813
chore: update project-serum/anchor
mindrunner Mar 19, 2024
edd0f6f
chore: update eslint
mindrunner Mar 19, 2024
d51b247
chore: update solana/spl-token
mindrunner Mar 19, 2024
20b7f1a
chore: migrate to coral-xyz/anchor
mindrunner Mar 19, 2024
bcd2d01
chore: migrate to coral-xyz/anchor 0.27.0
mindrunner Mar 19, 2024
e81e2e7
chore: migrate to typescript 4.9.5
mindrunner Mar 19, 2024
0fdbdd7
chore: migrate to typescript 5.4.2
mindrunner Mar 19, 2024
359af8f
chore: update mobx to `6.12.0`
mindrunner Mar 19, 2024
bb4d04d
chore: wip
mindrunner Mar 19, 2024
035820c
chore: wip
mindrunner Mar 19, 2024
7b653a8
chore: use bn.js for uiPrice
mindrunner Mar 19, 2024
954527e
Merge pull request #147 from mindrunner/develop
mindrunner Apr 18, 2024
5066230
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot Apr 18, 2024
01effad
Merge pull request #148 from staratlasmeta/snyk-fix-c14e28e82426a1862…
mindrunner Apr 18, 2024
21b49dc
chore: update node version / semantic-release (#150)
mindrunner Apr 19, 2024
4d6e1c5
chore(deps-dev): bump typedoc from 0.25.12 to 0.25.13 (#158)
dependabot[bot] Apr 23, 2024
0bbd458
chore(deps): bump oleksiyrudenko/gha-git-credentials (#153)
dependabot[bot] Apr 23, 2024
2cc850f
chore(deps-dev): bump @typescript-eslint/parser from 7.3.1 to 7.7.1 (…
dependabot[bot] Apr 23, 2024
8ad2d7d
chore(deps): bump @solana/web3.js from 1.91.3 to 1.91.7 (#155)
dependabot[bot] Apr 23, 2024
ccca0b2
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#154)
dependabot[bot] Apr 23, 2024
297bc8f
chore(deps-dev): bump typescript from 5.4.2 to 5.4.5 (#157)
dependabot[bot] Apr 23, 2024
fb39c7c
chore(actions): Auto Approve dependabot PRs
mindrunner Apr 23, 2024
566a055
update to findProgramAddressSync (#149)
redazul Apr 24, 2024
3c7e6f7
chore(deps): bump github/codeql-action from 2 to 3 (#152)
dependabot[bot] Apr 24, 2024
f5aff3b
chore(deps): bump mobx from 6.12.0 to 6.12.3 (#160)
dependabot[bot] Apr 24, 2024
b90baf0
chore(deps): bump @solana/spl-token from 0.4.1 to 0.4.6 (#161)
dependabot[bot] Apr 24, 2024
b78e87c
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#164)
dependabot[bot] May 13, 2024
cf1e0a2
chore(deps): bump @solana/web3.js from 1.91.7 to 1.91.8 (#166)
dependabot[bot] May 13, 2024
481ba32
chore(deps-dev): bump @typescript-eslint/parser from 7.7.1 to 7.8.0 (…
dependabot[bot] May 13, 2024
6c4f7a4
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#169)
dependabot[bot] May 17, 2024
3f01fbc
chore(deps-dev): bump @typescript-eslint/parser from 7.8.0 to 7.9.0 (…
dependabot[bot] May 17, 2024
fff66cb
chore(deps-dev): bump semantic-release from 23.0.8 to 23.1.1 (#167)
dependabot[bot] May 17, 2024
7561aee
chore(actions): Use correct node version (#170)
mindrunner May 17, 2024
1846268
Merge branch 'main' into develop
mindrunner May 17, 2024
290afe5
fix(misc): merge conflicts
mindrunner May 17, 2024
d71bbd2
fix(misc): fix warnings
mindrunner May 17, 2024
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
12 changes: 12 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Auto approve

on: pull_request_target

jobs:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.actor == 'dependabot[bot]'
steps:
- uses: hmarr/auto-approve-action@v4
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- uses: actions/setup-node@v4
with:
node-version: 20.12.0
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Run build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: oleksiyrudenko/gha-git-credentials@v2-latest
- uses: oleksiyrudenko/gha-git-credentials@v2.1.2
with:
global: true
name: 'Github CI'
Expand All @@ -19,7 +19,7 @@ jobs:
fetch-depth: '0'
- uses: actions/setup-node@v4
with:
node-version: 20.12.0
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.12.0
node-version-file: '.nvmrc'
- run: npm ci
- run: npx semantic-release
env:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12.0
20.13.1
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"mobx-utils": "^6.0.8"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/big.js": "^6.2.2",
Expand Down
3 changes: 2 additions & 1 deletion src/atlas-staking/instruction_builders/registerStake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ export async function registerStakeInstruction({
signers: [],
};

const [registeredStake] = await getRegisteredStake(
const [registeredStake] = getRegisteredStake(
programId,
authority,
stakeMint,
rewardMint,
);

const rewardAta = await associatedAddress({
owner: registeredStake,
mint: rewardMint,
Expand Down
30 changes: 15 additions & 15 deletions src/atlas-staking/pda_getters/pda_getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {
/**
* Returns the public key and bump seed for a registered stake account
* */
export async function getRegisteredStake(
export function getRegisteredStake(
programId: PublicKey,
authority: PublicKey,
stakeToken: PublicKey,
rewardToken: PublicKey,
): Promise<[PublicKey, number]> {
return PublicKey.findProgramAddress(
): [PublicKey, number] {
return PublicKey.findProgramAddressSync(
[
REGISTERED_STAKE,
authority.toBuffer(),
Expand All @@ -34,12 +34,12 @@ export async function getRegisteredStake(
/**
* Returns the public key and bump seed for a staking account
* */
export async function getStakingAccount(
export function getStakingAccount(
programId: PublicKey,
user: PublicKey,
registeredStake: PublicKey,
): Promise<[PublicKey, number]> {
return PublicKey.findProgramAddress(
): [PublicKey, number] {
return PublicKey.findProgramAddressSync(
[STAKING_ACCOUNT, user.toBuffer(), registeredStake.toBuffer()],
programId,
);
Expand Down Expand Up @@ -74,21 +74,21 @@ export async function getStakingAccountsForRegisteredStake(
*
* @param programId - Deployed program ID for the Staking Program
*/
export async function getStakingVarsAccount(
export function getStakingVarsAccount(
programId: PublicKey,
): Promise<[PublicKey, number]> {
return PublicKey.findProgramAddress([STAKING_VARS], programId);
): [PublicKey, number] {
return PublicKey.findProgramAddressSync([STAKING_VARS], programId);
}

/**
* Returns the public key and bump seed for a user's token escrow
* */
export async function getTokenEscrow(
export function getTokenEscrow(
programId: PublicKey,
user: PublicKey,
registeredStake: PublicKey,
): Promise<[PublicKey, number]> {
return PublicKey.findProgramAddress(
): [PublicKey, number] {
return PublicKey.findProgramAddressSync(
[STAKING_ESCROW, user.toBuffer(), registeredStake.toBuffer()],
programId,
);
Expand All @@ -97,11 +97,11 @@ export async function getTokenEscrow(
/**
* Returns the public key and bump seed for a registered stake's reward vault authority
* */
export async function getRewardAuth(
export function getRewardAuth(
programId: PublicKey,
registeredStake: PublicKey,
): Promise<[PublicKey, number]> {
return PublicKey.findProgramAddress(
): [PublicKey, number] {
return PublicKey.findProgramAddressSync(
[REWARD_AUTH, registeredStake.toBuffer()],
programId,
);
Expand Down
2 changes: 1 addition & 1 deletion src/atlas-staking/pda_getters/pda_info_getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function getStakingVarsAccountInfo(
programId: programId,
});

const [stakingVarsAccount] = await getStakingVarsAccount(programId);
const [stakingVarsAccount] = getStakingVarsAccount(programId);
const stakingVarsInfo =
await program.account.stakingVars.fetch(stakingVarsAccount);
return stakingVarsInfo as StakingVarsAccountInfo;
Expand Down
12 changes: 5 additions & 7 deletions src/factions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@
return _tmp;
}

export async function getPlayerFactionPDA(
export function getPlayerFactionPDA(
playerPublicKey: web3.PublicKey,
programId: web3.PublicKey,
): Promise<[web3.PublicKey, number]> {
return web3.PublicKey.findProgramAddress(
): [web3.PublicKey, number] {
return web3.PublicKey.findProgramAddressSync(
[Buffer.from(FACTION_PREFIX, 'utf8'), playerPublicKey.toBuffer()],
programId,
);
Expand All @@ -204,7 +204,7 @@
playerPublicKey: web3.PublicKey,
programId: web3.PublicKey,
): Promise<web3.TransactionInstruction> {
const [playerFactionPda, bump] = await getPlayerFactionPDA(
const [playerFactionPda, bump] = getPlayerFactionPDA(
playerPublicKey,
programId,
);
Expand Down Expand Up @@ -241,9 +241,7 @@
const idl = getIDL(programId);
const program = new Program(<Idl>idl, programId, provider);

const [playerFactionPDA] = await getPlayerFactionPDA(
playerPublicKey,
programId,
const [playerFactionPDA] = getPlayerFactionPDA(playerPublicKey, programId,

Check failure on line 244 in src/factions.ts

View workflow job for this annotation

GitHub Actions / build

Delete `,⏎··`
);
const obj = await program.account.playerFactionData.fetch(playerFactionPDA);
return obj as PlayerFaction;
Expand Down
2 changes: 1 addition & 1 deletion src/marketplace/instruction_builders/cancelOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function createCancelOrderInstruction({
}

// Derive the open orders counter, initializing if necessary
const [counterAddress] = await getOpenOrdersCounter(
const [counterAddress] = getOpenOrdersCounter(
orderInitializer,
depositMint,
programId,
Expand Down
4 changes: 2 additions & 2 deletions src/marketplace/instruction_builders/createOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function createInitializeBuyOrderInstruction({
initializerReceiveTokenAccount = tokenAccount;
}
// Derive the open orders counter, initializing if necessary
const [counterAddress] = await getOpenOrdersCounter(
const [counterAddress] = getOpenOrdersCounter(
initializerMainAccount,
depositMint,
programId,
Expand Down Expand Up @@ -174,7 +174,7 @@ export async function createInitializeSellOrderInstruction({
}

// Derive the open orders counter, initializing if necessary
const [counterAddress] = await getOpenOrdersCounter(
const [counterAddress] = getOpenOrdersCounter(
initializerMainAccount,
depositMint,
programId,
Expand Down
6 changes: 3 additions & 3 deletions src/marketplace/instruction_builders/exchangeOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ export async function createExchangeInstruction({
initializerReceiveTokenAccount = response.tokenAccount;
}

const [orderVaultAccount] = await getOrderVault(
const [orderVaultAccount] = getOrderVault(
orderInitializer,
initializerDepositMint,
programId,
);
const [openOrdersCounter] = await getOpenOrdersCounter(
const [openOrdersCounter] = getOpenOrdersCounter(
orderInitializer,
initializerDepositMint,
programId,
Expand All @@ -156,7 +156,7 @@ export async function createExchangeInstruction({

const seller = orderType === OrderSide.Buy ? orderTaker : orderInitializer;

const [feeReduction] = await getFeeExemptAccount(seller, programId);
const [feeReduction] = getFeeExemptAccount(seller, programId);

const exchangeIx = await program.methods
.processExchange(new BN(purchaseQty), expectedPrice, seller)
Expand Down
14 changes: 4 additions & 10 deletions src/marketplace/instruction_builders/feeExempt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ export async function createAddFeeExemptionInstruction({
};

const FEE_EXEMPTION = 1_000_000;
const [feeExemptAccount] = await getFeeExemptAccount(
feeExemptTarget,
programId,
);
const [marketVarsAccount] = await getMarketVarsAccount(programId);
const [feeExemptAccount] = getFeeExemptAccount(feeExemptTarget, programId);
const [marketVarsAccount] = getMarketVarsAccount(programId);
const instruction = [
await program.methods
.addFeeExemption(new BN(FEE_EXEMPTION))
Expand Down Expand Up @@ -77,11 +74,8 @@ export async function createRemoveFeeExemptionInstruction({
instructions: [],
};

const [feeExemptAccount] = await getFeeExemptAccount(
feeExemptTarget,
programId,
);
const [marketVarsAccount] = await getMarketVarsAccount(programId);
const [feeExemptAccount] = getFeeExemptAccount(feeExemptTarget, programId);
const [marketVarsAccount] = getMarketVarsAccount(programId);
const instruction = [
await program.methods
.removeFeeExemption()
Expand Down
Loading
Loading