Skip to content

Commit 04bb738

Browse files
run setup script
1 parent 077f1ff commit 04bb738

40 files changed

Lines changed: 475 additions & 336 deletions

.github/workflows/build-rust-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ jobs:
6767
with:
6868
name: rust-client-builds
6969
# First wildcard ensures exported paths are consistently under the clients folder.
70-
path: ./targe*/release/*project_name*
70+
path: ./targe*/release/*amm*
7171
if-no-files-found: error

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to Project Name
1+
# Contributing to Amm
22

3-
This is a quick guide to help you contribute to Project Name.
3+
This is a quick guide to help you contribute to Amm.
44

55
## Getting started
66

Cargo.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PROJECT_README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,22 @@
1-
<h1 align="center">
2-
Anchor Project Template
3-
</h1>
4-
<p align="center">
5-
<img width="400" alt="Anchor Template" src="https://github.com/tensor-foundation/anchor-project-template/assets/729235/e4a818f8-b144-4347-a7df-9123c6fdd707" />
6-
</p>
7-
8-
<p align="center">
9-
A template for Anchor-based programs with generated clients.
10-
</p>
11-
12-
## Features
13-
14-
- **Generate IDLs** using [Anchor](https://github.com/coral-xyz/anchor) + [Shank](https://github.com/metaplex-foundation/shank)
15-
- **Generate clients** for one or more programs using [Kinobi](https://github.com/metaplex-foundation/kinobi)
16-
- Configure **local validators** using [Amman](https://github.com/metaplex-foundation/amman)
17-
- **Build, test and lint** programs and clients using GitHub Actions.
18-
- **Publish** your `web3.js 2.0` JavaScript client and its TypeScript documentation by dispatching a GitHub workflow.
19-
- **Publish** your Rust client SDK to [crates.io](https://crates.io) by dispatching a GitHub workflow.
20-
21-
## Getting started
22-
23-
1. [Use this template](https://github.com/new?template_name=anchor-project-template&template_owner=tensor-foundation) to create a new repository.
24-
25-
2. Open the `setup.sh` script and update the following variables.
26-
```sh
27-
NAME="project-name"
28-
ORGANIZATION="organization"
29-
AUTHOR="author <author@email.com>"
30-
DESCRIPTION="My project description"
31-
PUBLIC_KEY="MyProgram1111111111111111111111111111111111"
32-
```
33-
3. Run the `setup.sh` script to initialize the project. This will find/replace the variable above, rename some files/folders, update the README and, finally, remove the `setup.sh` script.
34-
```bash
35-
./setup.sh
36-
```
37-
4. [Read the `CONTRIBUTING.md` file](./CONTRIBUTING.md) to learn more about how to use the project.
38-
39-
## License
40-
41-
Copyright (c) 2024 Tensor Protocol Foundation
42-
43-
Licensed under the Apache License, Version 2.0 (the "License");
44-
you may not use this file except in compliance with the License.
45-
You may obtain a copy of the License at
46-
47-
http://www.apache.org/licenses/LICENSE-2.0
48-
49-
Unless required by applicable law or agreed to in writing, software
50-
distributed under the License is distributed on an "AS IS" BASIS,
51-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
52-
See the License for the specific language governing permissions and
53-
limitations under the License.
1+
# Amm
2+
3+
Version 2 of the Tensor AMM program..
4+
5+
## Programs
6+
7+
This project contains the following programs:
8+
9+
- [Amm](./programs/amm/README.md) `TAMMqgJYcquwwj2tCdNUerh4C2bJjmghijVziSEf5tA`
10+
11+
You will need a Rust version compatible with BPF to compile the program, currently we recommend using Rust 1.75.0.
12+
13+
## Clients
14+
15+
This project contains the following clients:
16+
17+
- [JavaScript](./clients/js/README.md)
18+
- [Rust](./clients/rust/README.md)
19+
20+
## Contributing
21+
22+
Check out the [Contributing Guide](./CONTRIBUTING.md) the learn more about how to contribute to this project.

clients/js/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to the JavaScript client
22

3-
This is a quick guide to help you contribute to the JavaScript client of Project Name.
3+
This is a quick guide to help you contribute to the JavaScript client of Amm.
44

55
## Getting started
66

@@ -44,12 +44,12 @@ To publish JavaScript clients using GitHub actions, we first need the following
4444

4545
- `NPM_TOKEN` — An access token that can publish your packages to NPM.
4646
- `VERCEL_TOKEN` — An access token that can deploy to Vercel.
47-
- `VERCEL_ORG_ID` — The ID of the Vercel organization you want to deploy to.
47+
- `VERCEL_ORG_ID` — The ID of the Vercel tensor-foundation you want to deploy to.
4848

4949
Then, we'll need to create a new GitHub environment called `js-client-documentation` for the generated documentation of the JavaScript client. We can then select the `main` branch only and add the following secret variable to this specific environment.
5050

5151
- `VERCEL_PROJECT_ID` — The ID of the Vercel project you want to deploy to.
52-
The convention is to create a new Vercel project named `project-name-js-docs` with the following deployment settings:
52+
The convention is to create a new Vercel project named `amm-js-docs` with the following deployment settings:
5353

5454
- Build Command: `pnpm run build:docs`
5555
- Output Directory: `docs`

clients/js/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# JavaScript client for Project Name
1+
# JavaScript client for Amm
22

33
A web3.js 2.0 compatible JavaScript library for the project.
44

55
## Getting started
66

77
Install this library using the package manager of your choice.
88
```sh
9-
npm install @organization/project-name
9+
npm install @tensor-foundation/amm
1010
```
1111

12-
You can learn more about this library's API by reading its generated [TypeDoc documentation](https://project-name-js-docs.vercel.app).
12+
You can learn more about this library's API by reading its generated [TypeDoc documentation](https://amm-js-docs.vercel.app).
1313

1414
## Contributing
1515

clients/js/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@organization/project-name",
2+
"name": "@tensor-foundation/amm",
33
"version": "0.0.0",
4-
"description": "My project description",
4+
"description": "Version 2 of the Tensor AMM program.",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",
77
"scripts": {
@@ -20,9 +20,9 @@
2020
"access": "public",
2121
"registry": "https://registry.npmjs.org"
2222
},
23-
"homepage": "https://github.com/organization",
24-
"repository": "https://github.com/organization/project-name.git",
25-
"author": "author <author@email.com>",
23+
"homepage": "https://github.com/tensor-foundation",
24+
"repository": "https://github.com/tensor-foundation/amm.git",
25+
"author": "Tensor Protocol Foundation <maintainers.foundation>",
2626
"license": "Apache-2.0",
2727
"dependencies": {
2828
"@solana/accounts": "2.0.0-experimental.dbe6a73",

clients/js/src/generated/errors/projectName.ts renamed to clients/js/src/generated/errors/amm.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
* @see https://github.com/metaplex-foundation/kinobi
77
*/
88

9-
export const enum ProjectNameProgramErrorCode {
9+
export const enum AmmProgramErrorCode {
1010
/** InvalidAuthority: Invalid authority for account */
1111
INVALID_AUTHORITY = 0x1770, // 6000
1212
}
1313

14-
export class ProjectNameProgramError extends Error {
15-
override readonly name = 'ProjectNameProgramError';
14+
export class AmmProgramError extends Error {
15+
override readonly name = 'AmmProgramError';
1616

17-
readonly code: ProjectNameProgramErrorCode;
17+
readonly code: AmmProgramErrorCode;
1818

1919
readonly cause: Error | undefined;
2020

2121
constructor(
22-
code: ProjectNameProgramErrorCode,
22+
code: AmmProgramErrorCode,
2323
name: string,
2424
message: string,
2525
cause?: Error
@@ -30,36 +30,36 @@ export class ProjectNameProgramError extends Error {
3030
}
3131
}
3232

33-
let projectNameProgramErrorCodeMap:
34-
| Record<ProjectNameProgramErrorCode, [string, string]>
33+
let ammProgramErrorCodeMap:
34+
| Record<AmmProgramErrorCode, [string, string]>
3535
| undefined;
3636
if (__DEV__) {
37-
projectNameProgramErrorCodeMap = {
38-
[ProjectNameProgramErrorCode.INVALID_AUTHORITY]: [
37+
ammProgramErrorCodeMap = {
38+
[AmmProgramErrorCode.INVALID_AUTHORITY]: [
3939
'InvalidAuthority',
4040
`Invalid authority for account`,
4141
],
4242
};
4343
}
4444

45-
export function getProjectNameProgramErrorFromCode(
46-
code: ProjectNameProgramErrorCode,
45+
export function getAmmProgramErrorFromCode(
46+
code: AmmProgramErrorCode,
4747
cause?: Error
48-
): ProjectNameProgramError {
48+
): AmmProgramError {
4949
if (__DEV__) {
50-
return new ProjectNameProgramError(
50+
return new AmmProgramError(
5151
code,
5252
...(
53-
projectNameProgramErrorCodeMap as Record<
54-
ProjectNameProgramErrorCode,
53+
ammProgramErrorCodeMap as Record<
54+
AmmProgramErrorCode,
5555
[string, string]
5656
>
5757
)[code],
5858
cause
5959
);
6060
}
6161

62-
return new ProjectNameProgramError(
62+
return new AmmProgramError(
6363
code,
6464
'Unknown',
6565
'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.',

clients/js/src/generated/errors/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
* @see https://github.com/metaplex-foundation/kinobi
77
*/
88

9-
export * from './projectName';
9+
export * from './amm';

0 commit comments

Comments
 (0)