Go to file
guibescos 8b1c29e81a
feat: transaction builder (#1356)
* Do it

* Remove some duplicate code

* Cleanup

* Cleanup

* Cleanup import

* Correct description

* Fix path

* Cleanup deps

* Unique

* Works

* Continue

* Lint

* Lint config

* Fix ci

* Checkpoint

* Checkpoint

* Gitignore

* Cleanup

* Cleanup

* Continue building the sdk

* build function

* Remove files

* Remove files

* Rename

* Refactor : make transaction builder

* Make commitment

* Move

* Progress

* Checkpoint

* Ephemeral signers 2

* Checkpoint

* Checkpoint

* Fix bug

* Cleanup idls

* Compute units

* Make program addresses configurable

* Handle arrays

* Handle arrays

* Move PythSolanaReceiver

* Cleanup constants

* Contants

* Refactor constants

* Gitignore refactor

* package lock

* Cleanup idl

* Add useful static

* Add useful static

* Add useful static

* Lint

* Add lint config

* Docs

* Comments

* Docs

* Don't touch this

* Readme

* Readme

* Cleanup

* Readme

* Fix

* address readme comments

* from pyth, not pythnet

* Add a couple more comments

* Rename cleanup to close

* Go go go

* Gogogo

* Go

* Fix readme

* Improve readme

* Nit

* Nits

* Refactor withClose

* Update comments

* Cleanup

* First rename

* Rename 2

* Improve error message
2024-03-15 12:11:22 +00:00
.github/workflows chore(target_chains/sui): update sui and wormhole dependency (#1341) 2024-03-07 10:46:47 +01:00
contract_manager chore(target_chains/ethereum): add manta_sepolia (#1359) 2024-03-14 15:28:18 -04:00
express_relay/sdk feat(per-js-sdk): Add support for bid state and raw bid submission + renames (#1329) 2024-03-14 20:15:14 +01:00
fortuna feat(Fortuna): add finality checks (#1322) 2024-02-27 19:08:16 +05:30
governance feat: transaction builder (#1356) 2024-03-15 12:11:22 +00:00
hermes chore: fix nits (#1350) 2024-03-12 15:21:03 +00:00
price_pusher fix: typos (#1347) 2024-03-11 15:50:28 +00:00
price_service chore: fix nits (#1350) 2024-03-12 15:21:03 +00:00
pythnet fix: typos (#1335) 2024-03-01 23:05:39 +00:00
target_chains feat: transaction builder (#1356) 2024-03-15 12:11:22 +00:00
wormhole_attester chore(wormhole_attester): update cargo packages to fix ci (#1275) 2024-02-01 19:05:55 +01:00
.dockerignore fix(hermes): unignore cache.rs from docker 2023-09-19 16:20:17 +02:00
.gitignore [sui 8/x] - finalize contracts, deploy scripts, address audit feedback (#783) 2023-06-19 23:05:33 -04:00
.pre-commit-config.yaml Fix pythnet-sdk ci (#1213) 2024-01-08 18:09:31 +00:00
Dockerfile.lerna chore: cleanup repo 2023-10-18 18:32:42 +02:00
LICENSE Remove unused components/projects (#481) 2023-01-12 13:52:43 +01:00
README.md chore: update readme pull request instructions (#1338) 2024-03-01 12:54:39 +01:00
SECURITY.md chore: fix nits (#1350) 2024-03-12 15:21:03 +00:00
lerna.json [refactor] Add global lerna (#546) 2023-01-31 17:09:31 +01:00
package-lock.json feat(per-js-sdk): Add support for bid state and raw bid submission + renames (#1329) 2024-03-14 20:15:14 +01:00
package.json 0.0.1 2024-03-05 09:27:55 -08:00
rustfmt.toml Update rustfmt (#864) 2023-06-08 15:07:15 +02:00
tsconfig.base.json Expose pythnet message buffer idls (#865) 2023-06-09 14:10:28 +02:00

README.md

Pyth Crosschain

This repository acts as a monorepo for the various components that make up Pyth Crosschain.

Within this monorepo you will find the following subprojects:

Target Chains

target_chains

This directory contains on-chain contracts and SDKs for all of the various blockchain runtimes that Pyth supports. Each subdirectory corresponds to a blockchain runtime. Inside each subdirectory, there are subfolders for contracts, SDKs, and examples.

Hermes

hermes

Hermes is an off-chain service which constantly observes Pythnet and the Wormhole network watching for price updates emitted from the Pyth contract. It exposes all observed attestations via a public API over HTTPS/WSS which can be consumed by client-side applications that wish to use Pyth pricing data.

The price_service/client directory provides an SDK for interacting with Hermes. However, most users will interact with the price service via a chain-specific SDK

For a guide on utilising this service in your project, see the chain-specific SDK and examples for your blockchain runtime in the target_chains directory.

Development

Pull requests

Use the Conventional Commits format for your commit messages and PR titles. In the PR description, please include a summary of the changes and any relevant context. Also, please make sure to update the package versions following the Semantic Versioning rules.

Releases

The repository has a CI workflow that will release javascript packages whose version number has changed. To perform a release, follow these steps:

  1. Update the version number in the package.json file for the package(s) you wish to release. Please follow Semantic Versioning for package versions.
  2. Submit a PR with the changes and merge them in to main.
  3. Create a new tag pyth-js-v<number> and push to github. You can simply increment the version number each time -- it doesn't affect any of the published information.
  4. Pushing the tag automatically triggers a CI workflow to publish the updated packages to NPM.

If you have a javascript package that shouldn't be published, simply add "private": "true" to the package.json file and it will be excluded from the publishing workflow. If you are creating a new public javascript package, you should add the following config option to package.json:

  "publishConfig": {
    "access": "public"
  },

pre-commit hooks

pre-commit is a tool that checks and fixes simple issues (formatting, ...) before each commit. You can install it by following their website. In order to enable checks for this repo run pre-commit install from command-line in the root of this repo.

The checks are also performed in the CI to ensure the code follows consistent formatting.

Tilt CI

Integration tests run in Tilt (via the tilt ci command). The Tilt CI workflow requires approval from a member of the Pyth team. If you are a member, click on "Details" next to the "Workflow / ci-pyth-crosschain" check in a pull request, and then on the "Resume" button on the workflow page.

Typescript Monorepo

All of the typescript / javascript packages in this repository are part of a lerna monorepo. This setup allows each package to reference the current version of the others. You can install dependencies using npm ci from the repository root. You can build all of the packages using npx lerna run build and test with npx lerna run test.

Lerna has some common failure modes that you may encounter:

  1. npm ci fails with a typescript compilation error about a missing package. This error likely means that the failing package has a prepare entry compiling the typescript in its package.json. Fix this error by moving that logic to the prepublishOnly entry.
  2. The software builds locally but fails in CI, or vice-versa. This error likely means that some local build caches need to be cleaned. The build error may not indicate that this is a caching issue, e.g., it may appear that the packages are being built in the wrong order. Delete node_modules/, lib/ and tsconfig.tsbuildinfo from each package's subdirectory. then try again.

Audit / Feature Status

This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Or plainly spoken - this is a very complex piece of software which targets a bleeding-edge, experimental smart contract runtime. Mistakes happen, and no matter how hard you try and whether you pay someone to audit it, it may eat your tokens, set your printer on fire or startle your cat. Cryptocurrencies are a high-risk investment, no matter how fancy.