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 #190

Merged
merged 20 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 17 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop

jobs:
release:
Expand All @@ -12,9 +13,23 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
scope: '@staratlas'
node-version-file: '.nvmrc'
always-auth: true
- run: npm ci
- run: npx semantic-release
- uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/changelog
branches: |
[
'main',
{
name: 'develop',
prerelease: true
},
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 0 additions & 15 deletions CHANGELOG.md

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ npm i

## Packages

| Package | Description | Version | Docs |
| :-- | :-- | :--| :-- |

| Package | Description | Version | Docs |
|:---------------------|:---------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------|
| `@staratlas/factory` | TypeScript interface for Star Atlas programs | [![npm](https://img.shields.io/npm/v/@staratlas/factory.svg?color=blue)](https://www.npmjs.com/package/@staratlas/factory) | [![Docs](https://img.shields.io/badge/docs-typedoc-blue)](https://staratlasmeta.github.io/factory/index.html) |
683 changes: 358 additions & 325 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "@staratlas/factory",
"version": "0.7.1",
"publishConfig": {
"access": "public"
},
"description": "Star Atlas Factory for constructing Transactions targeting Solana on-chain programs",
"repository": {
"type": "git",
Expand Down
11 changes: 2 additions & 9 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
module.exports = {
branches: ["main"],
branches: ['main', 'develop'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
[
'@semantic-release/git',
{
assets: ['package.json', 'CHANGELOG.md'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}
],
'@semantic-release/github' // creates GitHub releases
'@semantic-release/github',
],
};
33 changes: 10 additions & 23 deletions src/factions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,14 @@ export async function enlistToFaction(
const idl = getIDL(programId);
const provider = new AnchorProvider(connection, null, null);
const program = new Program(<Idl>idl, programId, provider);
const txInstruction = await program.instruction.processEnlistPlayer(
bump,
factionID,
{
accounts: {
playerFactionAccount: playerFactionPda,
playerAccount: playerPublicKey,
systemProgram: web3.SystemProgram.programId,
clock: web3.SYSVAR_CLOCK_PUBKEY,
},
return await program.instruction.processEnlistPlayer(bump, factionID, {
accounts: {
playerFactionAccount: playerFactionPda,
playerAccount: playerPublicKey,
systemProgram: web3.SystemProgram.programId,
clock: web3.SYSVAR_CLOCK_PUBKEY,
},
);

return txInstruction;
});
}

/**
Expand All @@ -241,8 +235,7 @@ export async function getPlayer(
const idl = getIDL(programId);
const program = new Program(<Idl>idl, programId, provider);

const [playerFactionPDA] = getPlayerFactionPDA(playerPublicKey, programId,
);
const [playerFactionPDA] = getPlayerFactionPDA(playerPublicKey, programId);
const obj = await program.account.playerFactionData.fetch(playerFactionPDA);
return obj as PlayerFaction;
}
Expand All @@ -260,11 +253,7 @@ export async function getAllPlayers(
const program = new Program(<Idl>idl, programId, provider);
const programAccounts = await program.account.playerFactionData.all();

const players = programAccounts.map(
(player) => <PlayerFaction>player.account,
);

return players;
return programAccounts.map((player) => <PlayerFaction>player.account);
}

/**
Expand All @@ -281,9 +270,7 @@ export async function getPlayersOfFaction(
const program = new Program(<Idl>idl, programId, provider);
const programAccounts = await program.account.playerFactionData.all();

const filtered = programAccounts
return programAccounts
.map((player) => <PlayerFaction>player.account)
.filter((player) => player.factionId == factionID);

return filtered;
}
7 changes: 3 additions & 4 deletions src/marketplace/pda_getters/pda_info_getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
getMarketVarsAccount,
getRegisteredCurrencyAccount,
} from './pda_getters';
import { getMarketplaceProgram } from './../utils/getMarketplaceProgram';
import { getMarketplaceProgram } from '../utils';
import {
FeeExemptInfo,
MarketVarsAccountInfo,
RegisteredCurrencyInfo,
RoyaltyTiers,
} from '../types/marketplace_accounts';
} from '../types';
import { getStakingAccount, getStakingAccountInfo } from '../../atlas-staking';

/**
Expand Down Expand Up @@ -44,8 +44,7 @@ export async function getFeeExemptAccountInfo(
programId: programId,
});

const [feeExemptAccount] = getFeeExemptAccount(targetAccount, programId,
);
const [feeExemptAccount] = getFeeExemptAccount(targetAccount, programId);
const feeExemptInfo = await program.account.feeExempt.fetch(feeExemptAccount);
return feeExemptInfo as FeeExemptInfo;
}
Expand Down
Loading