{"id":13566136,"url":"https://github.com/InjectiveLabs/cw-injective","last_synced_at":"2025-04-03T23:31:10.260Z","repository":{"id":47319877,"uuid":"445934052","full_name":"InjectiveLabs/cw-injective","owner":"InjectiveLabs","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-26T13:53:20.000Z","size":2262,"stargazers_count":23,"open_issues_count":7,"forks_count":28,"subscribers_count":21,"default_branch":"dev","last_synced_at":"2025-03-26T14:04:51.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InjectiveLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-08T21:38:50.000Z","updated_at":"2025-03-25T12:19:20.000Z","dependencies_parsed_at":"2023-02-10T01:16:42.266Z","dependency_job_id":"d16c9c9e-dcc4-49e4-a307-5382d99ec6f9","html_url":"https://github.com/InjectiveLabs/cw-injective","commit_stats":{"total_commits":387,"total_committers":21,"mean_commits":"18.428571428571427","dds":0.772609819121447,"last_synced_commit":"c96c4a9b25830de2c4faa9503eaf933a6f8ba133"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InjectiveLabs%2Fcw-injective","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InjectiveLabs%2Fcw-injective/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InjectiveLabs%2Fcw-injective/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InjectiveLabs%2Fcw-injective/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InjectiveLabs","download_url":"https://codeload.github.com/InjectiveLabs/cw-injective/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097701,"owners_count":20883123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:02.919Z","updated_at":"2025-04-03T23:31:07.763Z","avatar_url":"https://github.com/InjectiveLabs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Injective Cosmwasm\n\nThis repository contains packages and examples for how to use CosmWasm with [Injective](https://injective.com).\n\n## Packages\n\nThese packages can be used to integrate CosmWasm and Injective.\n\n| Package                                                           | Description                                                                                                                                                                      |\n| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`injective-cosmwasm`](./packages/injective-cosmwasm/)            | Package for Injective-specific queries and messages.                                                                                                                             |\n| [`injective-math`](./packages/injective-math/)                    | Math utility library including custom FPDecimal type.                                                                                                                            |\n| [`injective-protobuf`](./packages/injective-protobuf/)            | Rust protobuf files generation for Injective messages.                                                                                                                           |\n| [`injective-std`](./packages/injective-std/)                      | Injective's proto-generated types and helpers built using [Buf](https://github.com/bufbuild/buf). Enables interaction with both custom and standard modules.                     |\n\n## Example Contracts\n\nThese contracts can be used as examples for CosmWasm and Injective.\n\n| Contract                                                          | Description                                                                                 |\n| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |\n| [`dummy`](./contracts/dummy/)                                     | A simply template for starting a new contract.                                              |\n| [`atomic-order-example`](./contracts/atomic-order-example/)       | Example contract on how to do atomic market orders on Injective incl handling the response. |\n| [`swap-contract`](https://github.com/InjectiveLabs/swap-contract) | More complex atomic swaps over multiple market hops.                                        |\n\n## Development\n\n### Environment Setup\n\n- Rust v1.69.0\n- `wasm32-unknown-unknown` target\n- Docker\n\n1. Install [`rustup`](https://rustup.rs)\n2. Run the following\n\n```shell\nrustup default 1.69.0\nrustup target add wasm32-unknown-unknown\n```\n\n3. Make sure [Docker](https://docker.com) is installed on your machine\n\n### Unit / Integration Test\n\nEach contract contains Rust unit tests embedded within the contract source directories. You can run\n\n```shell\ncargo unit-test\n```\n\n### Compiling\n\nGo to the contract directory and run\n\nAfter making sure tests pass, you can compile each contract with the following\n\n```bash\nRUSTFLAGS='-C link-arg=-s' cargo wasm\nsha256sum target/wasm32-unknown-unknown/release/\u003cCONTRACT_NAME\u003e.wasm\n```\n\n#### Production\n\nFor production builds, run the following:\n\n```bash\ndocker run --rm -v \"$(pwd)\":/code \\\n  --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n  cosmwasm/workspace-optimizer:0.13.0\n```\n\nThis performs several optimizations which can significantly reduce the final size of the contract binaries, which will\nbe available inside the `artifacts/` directory.\n\n## Formatting\n\nMake sure you run `rustfmt` before creating a PR to the repo.\n\nTo run `rustfmt`,\n\n```\ncargo fmt\n```\n\n## Linting\n\nYou should run `clippy` also. This is a lint tool for Rust. It suggests more efficient/readable code. You can\nsee [the clippy document](https://rust-lang.github.io/rust-clippy/master/index.html) for more information.\n\n### Run\n\n```\ncargo clippy -- -D warnings\n```\n\n## Testing\n\nDevelopers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit\ntests can be compiled and run with: `cargo test --all`. For more details, please reference Unit Tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInjectiveLabs%2Fcw-injective","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FInjectiveLabs%2Fcw-injective","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInjectiveLabs%2Fcw-injective/lists"}