├── .prettierignore ├── .github ├── CODEOWNERS ├── workflows │ └── tests.yml └── CONTRIBUTING.md ├── crates ├── canpack │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── canpack-example-hello │ ├── src │ │ └── lib.rs │ └── Cargo.toml └── canpack-macros │ ├── Cargo.toml │ └── src │ └── lib.rs ├── tests ├── packages │ └── ecdsa │ │ ├── rust │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ │ ├── mops.toml │ │ └── src │ │ └── lib.mo ├── canpack.test.ts └── dfx │ ├── Cargo.toml │ ├── mops.toml │ ├── src │ └── Main.mo │ ├── dfx.json │ └── Cargo.lock ├── jest.config.ts ├── tslint.json ├── bin └── canpack.cjs ├── .gitignore ├── .prettierrc ├── Cargo.toml ├── common ├── templates │ ├── Cargo.toml │ └── rust │ │ ├── Cargo.toml │ │ └── main.rs └── canpack.schema.json ├── src ├── index.ts ├── util.ts ├── commands │ └── canpack.ts ├── config.ts ├── mops.ts └── generate.ts ├── tsconfig.json ├── package.json ├── README.md └── LICENSE /.prettierignore: -------------------------------------------------------------------------------- 1 | /lib 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @dfinity/dx 2 | -------------------------------------------------------------------------------- /crates/canpack/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub use canpack_macros::*; 2 | -------------------------------------------------------------------------------- /tests/packages/ecdsa/rust/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /Cargo.lock 3 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | }; 4 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-floating-promises": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /bin/canpack.cjs: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | 'use strict'; 3 | 4 | import('../lib/commands/canpack.js'); 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | target/ 3 | .dfx/ 4 | .mops/ 5 | .vessel/ 6 | 7 | /lib/ 8 | /pkg/ 9 | 10 | /Cargo.lock 11 | -------------------------------------------------------------------------------- /tests/canpack.test.ts: -------------------------------------------------------------------------------- 1 | describe('canpack', () => { 2 | test('placeholder', () => { 3 | expect(1).toEqual(1); 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": true, 4 | "tabWidth": 2, 5 | "bracketSpacing": true, 6 | "trailingComma": "all" 7 | } 8 | -------------------------------------------------------------------------------- /tests/dfx/Cargo.toml: -------------------------------------------------------------------------------- 1 | [profile.release] 2 | lto = true 3 | opt-level = "s" 4 | 5 | [workspace] 6 | resolver = "2" 7 | members = [ ".canpack/motoko_rust" ] 8 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = [ 4 | "crates/canpack", 5 | "crates/canpack-example-hello", 6 | "crates/canpack-macros", 7 | ] 8 | -------------------------------------------------------------------------------- /crates/canpack-example-hello/src/lib.rs: -------------------------------------------------------------------------------- 1 | canpack::export! { 2 | pub fn canpack_example_hello(name: String) -> String { 3 | format!("Hello, {name}!") 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /common/templates/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Generated by Canpack 2 | 3 | [profile.release] 4 | lto = true 5 | opt-level = "s" 6 | 7 | [workspace] 8 | resolver = "2" 9 | # __members__ 10 | -------------------------------------------------------------------------------- /tests/packages/ecdsa/mops.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ecdsa" 3 | version = "0.0.1" 4 | description = "ECDSA verification" 5 | 6 | [dependencies] 7 | base = "0.10.2" 8 | 9 | [rust-dependencies] 10 | ic-ecdsa = { path = "./rust" } 11 | -------------------------------------------------------------------------------- /tests/dfx/mops.toml: -------------------------------------------------------------------------------- 1 | [dependencies] 2 | base = "0.10.4" 3 | ecdsa = "../packages/ecdsa" 4 | 5 | [rust-dependencies] 6 | canpack-example-hello = { path = "../../crates/canpack-example-hello" } 7 | # ic-ecdsa = { path = "../packages/ecdsa/rust" } 8 | -------------------------------------------------------------------------------- /tests/packages/ecdsa/src/lib.mo: -------------------------------------------------------------------------------- 1 | import Rust "canister:motoko_rust"; 2 | 3 | module { 4 | public func verify(address : Text, message : Text, signature : Text) : async Bool { 5 | await Rust.ecdsa_verify(address, message, signature); 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /crates/canpack/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "canpack" 3 | version = "0.1.1" 4 | description = "Canpack Rust utilities" 5 | authors = ["Ryan Vandersmith"] 6 | license = "Apache-2.0" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | canpack-macros = { version = "^0.1", path = "../canpack-macros" } 11 | -------------------------------------------------------------------------------- /common/templates/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Generated by Canpack 2 | 3 | [package] 4 | name = "__package_name__" 5 | version = "0.0.0" 6 | edition = "2021" 7 | 8 | [[bin]] 9 | name = "__package_name__" 10 | path = "main.rs" 11 | 12 | [dependencies] 13 | ic-cdk = "0.12" 14 | ic-cdk-macros = "0.8" 15 | candid = "0.10" 16 | 17 | # __parts__ 18 | -------------------------------------------------------------------------------- /crates/canpack-example-hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "canpack-example-hello" 3 | version = "0.1.0" 4 | description = "An example Rust crate with Canpack compatibility" 5 | authors = ["Ryan Vandersmith"] 6 | license = "Apache-2.0" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | canpack = { version = "^0.1", path = "../canpack" } 11 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { Config } from './config.js'; 2 | import { generate } from './generate.js'; 3 | 4 | export const canpack = async (config: Config) => { 5 | if (config.canisters) { 6 | const changes = await generate(config); 7 | if (changes.length) { 8 | changes.forEach((change) => { 9 | console.log(change); 10 | }); 11 | } 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /crates/canpack-macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "canpack-macros" 3 | version = "0.1.1" 4 | description = "Canpack Rust procedural macros" 5 | authors = ["Ryan Vandersmith"] 6 | license = "Apache-2.0" 7 | edition = "2021" 8 | 9 | [lib] 10 | proc-macro = true 11 | 12 | [dependencies] 13 | proc-macro2 = "1.0" 14 | quote = "1.0" 15 | syn = { version = "2.0", features = ["full"] } 16 | -------------------------------------------------------------------------------- /common/templates/rust/main.rs: -------------------------------------------------------------------------------- 1 | // Generated by Canpack 2 | 3 | #![allow(unused_imports)] 4 | 5 | use candid::candid_method; 6 | use ic_cdk::{query, update}; 7 | 8 | // __parts__ 9 | 10 | #[cfg(any(target_arch = "wasm32", test))] 11 | fn main() {} 12 | 13 | #[cfg(not(any(target_arch = "wasm32", test)))] 14 | fn main() { 15 | candid::export_service!(); 16 | println!("{}", __export_service()); 17 | } 18 | -------------------------------------------------------------------------------- /tests/packages/ecdsa/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | 3 | [package] 4 | name = "ic-ecdsa" 5 | version = "0.0.1" 6 | description = "ECDSA bindings" 7 | authors = ["Ryan Vandersmith"] 8 | edition = "2021" 9 | 10 | [dependencies] 11 | candid = "0.10" 12 | ic-cdk = "0.12" 13 | ic-cdk-macros = "0.8" 14 | canpack = { path = "../../../../crates/canpack" } 15 | serde = "1.0" 16 | hex = "0.4" 17 | ethers-core = "2.0" 18 | getrandom = { version = "0.2", features = ["custom"] } 19 | -------------------------------------------------------------------------------- /tests/dfx/src/Main.mo: -------------------------------------------------------------------------------- 1 | import Rust "canister:motoko_rust"; 2 | 3 | actor { 4 | public composite query func hello(name : Text) : async Text { 5 | await Rust.canpack_example_hello(name); 6 | }; 7 | 8 | public composite query func verify() : async Bool { 9 | await Rust.ecdsa_verify("0xc9b28dca7ea6c5e176a58ba9df53c30ba52c6642", "hello", "0x5c0e32248c10f7125b32cae1de9988f2dab686031083302f85b0a82f78e9206516b272fb7641f3e8ab63cf9f3a9b9220b2d6ff2699dc34f0d000d7693ca1ea5e1c"); 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /tests/dfx/dfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "canisters": { 3 | "service": { 4 | "dependencies": [ 5 | "motoko_rust" 6 | ], 7 | "type": "motoko", 8 | "main": "src/Main.mo" 9 | }, 10 | "motoko_rust": { 11 | "type": "rust", 12 | "package": "motoko_rust", 13 | "candid": ".canpack/motoko_rust/service.did", 14 | "gzip": true, 15 | "canpack": true 16 | } 17 | }, 18 | "defaults": { 19 | "build": { 20 | "packtool": "mops sources" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "es2020", 4 | "esModuleInterop": true, 5 | "allowSyntheticDefaultImports": true, 6 | "target": "es6", 7 | "noImplicitAny": true, 8 | "moduleResolution": "node", 9 | "sourceMap": true, 10 | "declaration": true, 11 | "declarationMap": true, 12 | "outDir": "lib", 13 | "declarationDir": "lib", 14 | "baseUrl": ".", 15 | "paths": { 16 | "*": ["src/types/*"] 17 | } 18 | }, 19 | "include": ["src/**/*"] 20 | } 21 | -------------------------------------------------------------------------------- /tests/packages/ecdsa/rust/src/lib.rs: -------------------------------------------------------------------------------- 1 | use std::str::FromStr; 2 | 3 | use ethers_core::types::{Address, RecoveryMessage, Signature}; 4 | 5 | canpack::export! { 6 | #[canpack(query, rename = "ecdsa_verify")] 7 | pub async fn verify(eth_address: String, message: String, signature: String) -> bool { 8 | Signature::from_str(&signature) 9 | .unwrap() 10 | .verify( 11 | RecoveryMessage::Data(message.into_bytes()), 12 | Address::from_str(ð_address).unwrap(), 13 | ) 14 | .is_ok() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/util.ts: -------------------------------------------------------------------------------- 1 | import { stat } from 'fs/promises'; 2 | import { join, dirname } from 'path'; 3 | import { fileURLToPath } from 'url'; 4 | 5 | /// https://github.com/nodejs/node/issues/39960 6 | export const exists = async (filePath: string): Promise => { 7 | try { 8 | await stat(filePath); 9 | return true; 10 | } catch { 11 | return false; 12 | } 13 | }; 14 | 15 | /// Construct a relative path from the specified module import metadata. 16 | export const moduleRelative = (meta: ImportMeta, ...args: string[]): string => { 17 | const importMetaDirname = dirname(fileURLToPath(meta.url)); 18 | return join(importMetaDirname, ...args); 19 | }; 20 | 21 | /// Check if the JSON of two objects are equal to each other 22 | export const jsonEqual = (a: T, b: T): boolean => { 23 | return JSON.stringify(a) === JSON.stringify(b); 24 | }; 25 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: 4 | push: 5 | branches: ['main'] 6 | pull_request: 7 | branches: ['main'] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [18.x, 20.x, 22.x] 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v3 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | cache: 'npm' 24 | - name: Install dfx 25 | uses: dfinity/setup-dfx@main 26 | - name: Install Mops 27 | run: npm i -g ic-mops 28 | - run: dfx cache install 29 | - run: npm ci 30 | - run: npm run build --if-present 31 | - run: npm test 32 | - name: Run CLI with `--version` 33 | run: bin/canpack.cjs --version 34 | - name: Run Canpack in `tests/dfx` directory 35 | run: npm run build && bin/canpack.cjs -D tests/dfx 36 | -------------------------------------------------------------------------------- /common/canpack.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "canisters": { 5 | "type": "object", 6 | "additionalProperties": { 7 | "type": "object", 8 | "properties": { 9 | "type": { 10 | "type": "string" 11 | }, 12 | "parts": { 13 | "type": "array", 14 | "items": { 15 | "type": "object", 16 | "properties": { 17 | "path": { "type": "string" }, 18 | "package": { "type": "string" }, 19 | "version": { "type": "string" }, 20 | "features": { 21 | "type": "array", 22 | "items": { "type": "string" } 23 | } 24 | }, 25 | "required": ["package"] 26 | } 27 | } 28 | }, 29 | "required": ["type", "parts"] 30 | } 31 | }, 32 | "git": { 33 | "type": "boolean" 34 | }, 35 | "verbose": { 36 | "type": "boolean" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/commands/canpack.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | import { program } from 'commander'; 3 | import { readFileSync } from 'fs'; 4 | import { loadConfig } from '../config.js'; 5 | import { canpack } from '../index.js'; 6 | import { moduleRelative } from '../util.js'; 7 | 8 | const { verbose, directory, version } = program 9 | .name('canpack') 10 | .option('-v, --verbose', `verbose output`) 11 | .option('-D, --directory ', `directory`, '.') 12 | .option('-V, --version', `show installed version`) 13 | .parse() 14 | .opts(); 15 | 16 | if (version) { 17 | console.log( 18 | 'canpack', 19 | JSON.parse( 20 | readFileSync(moduleRelative(import.meta, '../../package.json'), 'utf8'), 21 | ).version, 22 | ); 23 | process.exit(0); 24 | } 25 | 26 | if (directory) { 27 | process.chdir(directory); 28 | } 29 | 30 | // tslint:disable-next-line 31 | (async () => { 32 | const directory = '.'; // Current working directory 33 | 34 | const config = await loadConfig({directory, verbose}); 35 | if (verbose) { 36 | config.verbose = true; 37 | console.log('Resolved configuration:'); 38 | console.log(chalk.gray(JSON.stringify(config, null, 2))); 39 | } 40 | await canpack(config); 41 | })(); 42 | -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- 1 | import Ajv, { JSONSchemaType } from 'ajv'; 2 | import { readFileSync } from 'fs'; 3 | import { exists, moduleRelative } from './util.js'; 4 | import { loadMopsCanisters } from './mops.js'; 5 | import { readFile } from 'fs/promises'; 6 | import { join } from 'path'; 7 | 8 | export interface Config { 9 | canisters?: Record; 10 | git?: boolean; 11 | verbose?: boolean; 12 | } 13 | 14 | export type CanisterConfig = RustConfig; 15 | 16 | export interface RustConfig { 17 | type: 'rust'; 18 | parts: RustDependency[]; 19 | } 20 | 21 | export interface RustDependency { 22 | package: string; 23 | version?: string; 24 | path?: string; 25 | git?: string; 26 | } 27 | 28 | export const configSchema = JSON.parse( 29 | readFileSync( 30 | moduleRelative(import.meta, '../common/canpack.schema.json'), 31 | 'utf8', 32 | ), 33 | ) as JSONSchemaType; 34 | 35 | const ajv = new Ajv(); 36 | 37 | interface LoadConfigArgs { 38 | directory: string; 39 | verbose: boolean; 40 | } 41 | 42 | export const loadConfig = async ({ 43 | directory, 44 | verbose, 45 | }: LoadConfigArgs): Promise => { 46 | // canpack.json 47 | const configPath = join(directory, 'canpack.json'); 48 | const config: Config = (await exists(configPath)) 49 | ? JSON.parse(await readFile(configPath, 'utf8')) 50 | : {}; 51 | const validate = ajv.compile(configSchema); 52 | if (!validate(config)) { 53 | // TODO: simplify error output 54 | throw new Error(JSON.stringify(validate.errors, null, 2)); 55 | } 56 | // mops.toml 57 | const mopsCanisters = await loadMopsCanisters(verbose); 58 | if (mopsCanisters) { 59 | config.canisters = { ...mopsCanisters, ...config.canisters }; 60 | } 61 | return config; 62 | }; 63 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "canpack", 3 | "version": "0.2.3", 4 | "description": "Package multiple libraries into one ICP canister.", 5 | "author": "Ryan Vandersmith (https://github.com/rvanasa)", 6 | "license": "Apache-2.0", 7 | "type": "module", 8 | "main": "lib/index.js", 9 | "types": "lib/index.d.ts", 10 | "bin": { 11 | "canpack": "bin/canpack.cjs" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "directory": "https://github.com/dfinity/canpack.git" 16 | }, 17 | "scripts": { 18 | "start": "ts-node --esm src/commands/canpack.js", 19 | "build": "rimraf ./lib && tsc -p .", 20 | "prepare": "husky install", 21 | "lint": "tslint --project tsconfig.json", 22 | "test": "jest", 23 | "package": "rimraf ./pkg && run-s build test package:pkg package:zip", 24 | "package:pkg": "pkg -t node18-linux,node18-win,node18-macos lib/commands/canpack.js -o pkg/canpack", 25 | "package:zip": "run-s package:zip:linux package:zip:macos package:zip:win", 26 | "package:zip:linux": "cd pkg && mkdir linux && cp canpack-linux linux/canpack && cd linux && tar -czvf ../canpack-linux.tar.gz canpack", 27 | "package:zip:macos": "cd pkg && mkdir macos && cp canpack-macos macos/canpack && cd macos && tar -czvf ../canpack-macos.tar.gz canpack", 28 | "package:zip:win": "cd pkg && mkdir win && cp canpack-win.exe win/canpack.exe && cd win && zip ../canpack-windows.zip canpack.exe", 29 | "precommit": "lint-staged", 30 | "prepublishOnly": "run-s build test" 31 | }, 32 | "dependencies": { 33 | "@iarna/toml": "2.2.5", 34 | "ajv": "^8.13.0", 35 | "chalk": "^5.3.0", 36 | "commander": "^12.1.0", 37 | "execa": "^9.1.0", 38 | "ic-mops": "^0.44.1", 39 | "mkdirp": "^3.0.1", 40 | "recursive-copy": "^2.0.14", 41 | "rimraf": "^5.0.7" 42 | }, 43 | "devDependencies": { 44 | "@types/jest": "^29.5.12", 45 | "cross-env": "^7.0.3", 46 | "eslint-config-prettier": "^9.1.0", 47 | "husky": "^9.0.11", 48 | "jest": "^29.7.0", 49 | "lint-staged": "^15.2.4", 50 | "npm-run-all": "^4.1.5", 51 | "prettier": "^3.2.5", 52 | "ts-jest": "^29.1.3", 53 | "ts-node": "^10.9.2", 54 | "tslint": "^6.1.3", 55 | "typescript": "^5.4.5" 56 | }, 57 | "lint-staged": { 58 | "{bin,src,lib,common}/**/*.{js,ts,jsx,tsx,json}": [ 59 | "prettier --write" 60 | ], 61 | "src/**/*.{ts,tsx}": [ 62 | "npm run lint" 63 | ] 64 | }, 65 | "directories": { 66 | "lib": "lib", 67 | "example": "examples" 68 | }, 69 | "files": [ 70 | "src/**/*", 71 | "lib/**/*", 72 | "common/**/*" 73 | ], 74 | "keywords": [ 75 | "motoko", 76 | "language", 77 | "programming-language", 78 | "dfinity", 79 | "smart-contract", 80 | "canister", 81 | "browser", 82 | "ic", 83 | "icp", 84 | "internet-computer", 85 | "blockchain", 86 | "cryptocurrency", 87 | "rust", 88 | "cargo", 89 | "crate", 90 | "language-bindings" 91 | ] 92 | } 93 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for your interest in contributing to this repo. As a member of the community, you are invited and encouraged to contribute by submitting issues, offering suggestions for improvements, adding review comments to existing pull requests, or creating new pull requests to fix issues. 4 | 5 | All contributions to DFINITY documentation and the developer community are respected and appreciated. 6 | Your participation is an important factor in the success of the Internet Computer. 7 | 8 | ## Before you contribute 9 | 10 | Before contributing, please take a few minutes to review these contributor guidelines. 11 | The contributor guidelines are intended to make the contribution process easy and effective for everyone involved in addressing your issue, assessing changes, and finalizing your pull requests. 12 | 13 | Before contributing, consider the following: 14 | 15 | - If you want to report an issue, click **Issues**. 16 | 17 | - If you have a general question, post a message to the [community forum](https://forum.dfinity.org/) or submit a [support request](mailto://support@dfinity.org). 18 | 19 | - If you are reporting a bug, provide as much information about the problem as possible. 20 | 21 | - If you want to contribute directly to this repository, typical fixes might include any of the following: 22 | 23 | - Fixes to resolve bugs or documentation errors 24 | - Code improvements 25 | - Feature requests 26 | 27 | Note that any contribution to this repository must be submitted in the form of a **pull request**. 28 | 29 | - If you are creating a pull request, be sure that the pull request only implements one fix or suggestion. 30 | 31 | If you are new to working with GitHub repositories and creating pull requests, consider exploring [First Contributions](https://github.com/firstcontributions/first-contributions) or [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). 32 | 33 | # How to make a contribution 34 | 35 | Depending on the type of contribution you want to make, you might follow different workflows. 36 | 37 | This section describes the most common workflow scenarios: 38 | 39 | - Reporting an issue 40 | - Submitting a pull request 41 | 42 | ### Reporting an issue 43 | 44 | To open a new issue: 45 | 46 | 1. Click **Issues**. 47 | 48 | 1. Click **New Issue**. 49 | 50 | 1. Click **Open a blank issue**. 51 | 52 | 1. Type a title and description, then click **Submit new issue**. 53 | 54 | Be as clear and descriptive as possible. 55 | 56 | For any problem, describe it in detail, including details about the crate, the version of the code you are using, the results you expected, and how the actual results differed from your expectations. 57 | 58 | ### Submitting a pull request 59 | 60 | If you want to submit a pull request to fix an issue or add a feature, here's a summary of what you need to do: 61 | 62 | 1. Make sure you have a GitHub account, an internet connection, and access to a terminal shell or GitHub Desktop application for running commands. 63 | 64 | 2. Navigate to the official repository in a web browser. 65 | 66 | 3. Click **Fork** to create a copy of the repository associated with the issue you want to address under your GitHub account or organization name. 67 | 68 | 4. Clone the repository to your local machine. 69 | 70 | 5. Create a new branch for your fix by running a command similar to the following: 71 | 72 | ```bash 73 | git checkout -b my-branch-name-here 74 | ``` 75 | 76 | 6. Open the file you want to fix in a text editor and make the appropriate changes for the issue you are trying to address. 77 | 78 | 7. Add the file contents of the changed files to the index `git` uses to manage the state of the project by running a command similar to the following: 79 | 80 | ```bash 81 | git add path-to-changed-file 82 | ``` 83 | 8. Commit your changes to store the contents you added to the index along with a descriptive message by running a command similar to the following: 84 | 85 | ```bash 86 | git commit -m "Description of the fix being committed." 87 | ``` 88 | 89 | 9. Push the changes to the remote repository by running a command similar to the following: 90 | 91 | ```bash 92 | git push origin my-branch-name-here 93 | ``` 94 | 95 | 10. Create a new pull request for the branch you pushed to the upstream GitHub repository. 96 | 97 | Provide a title that includes a short description of the changes made. 98 | 99 | 11. Wait for the pull request to be reviewed. 100 | 101 | 12. Make changes to the pull request, if requested. 102 | 103 | 13. Celebrate your success after your pull request is merged! 104 | -------------------------------------------------------------------------------- /src/mops.ts: -------------------------------------------------------------------------------- 1 | import TOML from '@iarna/toml'; 2 | import { readFile } from 'fs/promises'; 3 | import { installAll } from 'ic-mops/dist/commands/install/install-all.js'; 4 | import { 5 | formatDir, 6 | formatGithubDir, 7 | getDependencyType, 8 | } from 'ic-mops/dist/mops.js'; 9 | import { resolvePackages } from 'ic-mops/dist/resolve-packages.js'; 10 | import { join, relative, resolve } from 'path'; 11 | import { CanisterConfig, RustConfig, RustDependency } from './config.js'; 12 | import { exists, jsonEqual } from './util.js'; 13 | import chalk from 'chalk'; 14 | 15 | interface MopsConfig { 16 | package?: { 17 | name?: string; 18 | version?: string; 19 | description?: string; 20 | }; 21 | dependencies?: Record; 22 | 'rust-dependencies'?: Record; 23 | } 24 | 25 | const mopsPathSymbol = Symbol.for('mopsPath'); 26 | 27 | interface MopsRustDependency extends RustDependency { 28 | [mopsPathSymbol]?: string; 29 | } 30 | 31 | export const loadMopsCanisters = async ( 32 | verbose: boolean, 33 | ): Promise | undefined> => { 34 | const baseDirectory = '.'; // Mops currently only supports CWD in `resolvePackages()` 35 | 36 | const canisters: Record = {}; 37 | const rustConfig: RustConfig = { type: 'rust', parts: [] }; 38 | canisters['motoko_rust'] = rustConfig; 39 | const mainDependencies = await getMopsRustDependencies( 40 | baseDirectory, 41 | baseDirectory, 42 | ); 43 | if (!mainDependencies) { 44 | return; 45 | } 46 | if (verbose) { 47 | console.log(chalk.grey('Installing Mops packages...')); 48 | } 49 | await installAll({ verbose, lock: 'ignore' }); 50 | const dependencies = [...mainDependencies]; 51 | const mopsPackages = await resolvePackages({ verbose: false }); 52 | 53 | ( 54 | await Promise.all( 55 | Object.entries(mopsPackages).map(async ([name, version]) => { 56 | // TODO: contribute utility method in Mops 57 | const type = getDependencyType(version); 58 | let directory; 59 | if (type === 'local') { 60 | directory = relative(baseDirectory, version); 61 | } else if (type === 'github') { 62 | directory = relative(baseDirectory, formatGithubDir(name, version)); 63 | } else if (type === 'mops') { 64 | directory = relative(baseDirectory, formatDir(name, version)); 65 | } else { 66 | throw new Error(`Unknown dependency type: ${type}`); 67 | } 68 | return getMopsRustDependencies(directory, baseDirectory); 69 | }), 70 | ) 71 | ).forEach((packageDependencies) => { 72 | if (packageDependencies) { 73 | packageDependencies.forEach((dependency) => { 74 | const other = dependencies.find( 75 | (other) => dependency.package === other.package, 76 | ); 77 | if (!other) { 78 | dependencies.push(dependency); 79 | } else if ( 80 | !mainDependencies.includes(other) && 81 | !jsonEqual(dependency, other) 82 | ) { 83 | const showDependency = (dependency: MopsRustDependency) => 84 | `${dependency.package} = ${JSON.stringify({ ...dependency, package: undefined })} in ${resolve(dependency[mopsPathSymbol])}`; 85 | throw new Error( 86 | [ 87 | `Conflict between transitive Rust dependencies:`, 88 | showDependency(dependency), 89 | showDependency(other), 90 | `Fix this by specifying \`${dependency.package} = ...\` in the [rust-dependencies] section of your mops.toml file.`, 91 | ].join('\n'), 92 | ); 93 | } 94 | }); 95 | } 96 | }); 97 | rustConfig.parts.push(...dependencies); 98 | 99 | return canisters; 100 | }; 101 | 102 | const getMopsRustDependencies = async ( 103 | directory: string, 104 | baseDirectory: string, 105 | ): Promise => { 106 | const mopsTomlPath = join(directory, 'mops.toml'); 107 | if (!(await exists(mopsTomlPath))) { 108 | return; 109 | } 110 | const dependencies: MopsRustDependency[] = []; 111 | const mopsToml: MopsConfig = TOML.parse(await readFile(mopsTomlPath, 'utf8')); 112 | if (mopsToml?.['rust-dependencies']) { 113 | Object.entries(mopsToml['rust-dependencies']).forEach(([name, value]) => { 114 | dependencies.push({ 115 | package: name, 116 | [mopsPathSymbol]: mopsTomlPath, 117 | ...(typeof value === 'string' 118 | ? { version: value } 119 | : { 120 | ...value, 121 | path: 122 | value.path === undefined 123 | ? undefined 124 | : join(relative(baseDirectory, directory), value.path), 125 | }), 126 | }); 127 | }); 128 | } 129 | return dependencies; 130 | }; 131 | -------------------------------------------------------------------------------- /crates/canpack-macros/src/lib.rs: -------------------------------------------------------------------------------- 1 | use proc_macro::TokenStream; 2 | use proc_macro2::TokenStream as TokenStream2; 3 | use quote::quote; 4 | use syn::{punctuated::Punctuated, spanned::Spanned, Attribute}; 5 | 6 | #[derive(Default)] 7 | struct CanpackAttribute { 8 | rename: Option, 9 | mode: Option, 10 | } 11 | 12 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] 13 | enum MethodMode { 14 | // Init, 15 | Query, 16 | CompositeQuery, 17 | Update, 18 | } 19 | 20 | impl MethodMode { 21 | pub fn candid_mode(&self) -> TokenStream2 { 22 | match self { 23 | // Self::Init => "init", 24 | Self::Query => quote! {query}, 25 | Self::CompositeQuery => quote! {composite_query}, 26 | Self::Update => quote! {update}, 27 | } 28 | } 29 | 30 | pub fn ic_cdk_attr(&self) -> TokenStream2 { 31 | match self { 32 | // Self::Init => "init", 33 | Self::Query => quote! {query}, 34 | Self::CompositeQuery => quote! {query(composite = true)}, 35 | Self::Update => quote! {update}, 36 | } 37 | } 38 | } 39 | 40 | impl<'a> TryFrom<&'a str> for MethodMode { 41 | type Error = &'a str; 42 | 43 | fn try_from(mode: &'a str) -> Result { 44 | use MethodMode::*; 45 | Ok(match mode { 46 | // "init" => Init, 47 | "query" => Query, 48 | "composite_query" => CompositeQuery, 49 | "update" => Update, 50 | _ => Err(mode)?, 51 | }) 52 | } 53 | } 54 | 55 | fn get_lit_str(expr: &syn::Expr) -> std::result::Result { 56 | if let syn::Expr::Lit(expr) = expr { 57 | if let syn::Lit::Str(lit) = &expr.lit { 58 | return Ok(lit.clone()); 59 | } 60 | } 61 | Err(()) 62 | } 63 | 64 | fn parse_canpack_args(attr: &Attribute) -> syn::Result> { 65 | Ok(attr 66 | .meta 67 | .require_list()? 68 | .parse_args_with(Punctuated::::parse_terminated)?) 69 | } 70 | 71 | fn read_canpack_attribute(args: Vec) -> syn::Result { 72 | let mut attr = CanpackAttribute { 73 | rename: None, 74 | mode: None, 75 | }; 76 | for meta in args { 77 | match &meta { 78 | syn::Meta::NameValue(m) if m.path.is_ident("rename") && attr.rename.is_none() => { 79 | if let Ok(lit) = get_lit_str(&m.value) { 80 | attr.rename = Some(lit.value()); 81 | } 82 | } 83 | syn::Meta::Path(p) if attr.mode.is_none() => { 84 | let mode = p.get_ident().unwrap().to_string(); 85 | attr.mode = Some(mode.as_str().try_into().map_err(|mode| { 86 | syn::Error::new_spanned(meta, format!("unknown mode: {}", mode)) 87 | })?) 88 | } 89 | meta => { 90 | return Err(syn::Error::new_spanned( 91 | meta, 92 | format!("unknown or conflicting attribute: {}", quote! {#meta}), 93 | )) 94 | } 95 | } 96 | } 97 | Ok(attr) 98 | } 99 | 100 | #[proc_macro] 101 | pub fn export(input: TokenStream) -> TokenStream { 102 | match export_macro(input) { 103 | Ok(output) => output, 104 | Err(err) => err.to_compile_error().into(), 105 | } 106 | } 107 | 108 | fn export_macro(input: TokenStream) -> syn::Result { 109 | let input2: TokenStream2 = input.into(); 110 | let module: syn::ItemMod = syn::parse( 111 | quote! { 112 | mod __canpack_export { 113 | #input2 114 | } 115 | } 116 | .into(), 117 | )?; 118 | 119 | let mut module_output = quote! {}; 120 | let mut canpack_output = quote! {}; 121 | 122 | let mut functions = vec![]; 123 | 124 | for item in module.content.unwrap().1 { 125 | if let syn::Item::Fn(function) = item { 126 | functions.push(function); 127 | } else { 128 | return Err(syn::Error::new_spanned( 129 | item, 130 | "expected a function in `canpack::export!` macro", 131 | )); 132 | } 133 | } 134 | for mut function in functions { 135 | let (canpack_attrs, fn_attrs) = function 136 | .attrs 137 | .into_iter() 138 | .partition(|attr| attr.path().is_ident("canpack")); 139 | function.attrs = fn_attrs; 140 | if canpack_attrs.len() > 1 { 141 | return Err(syn::Error::new_spanned( 142 | canpack_attrs.last().unwrap(), 143 | "more than one #[canpack] attribute on the same function", 144 | )); 145 | } 146 | 147 | let fn_sig = &function.sig; 148 | let fn_name = &function.sig.ident; 149 | let fn_args = function 150 | .sig 151 | .inputs 152 | .iter() 153 | .map(|arg| { 154 | if let syn::FnArg::Typed(pat_type) = arg { 155 | if let syn::Pat::Ident(id) = &*pat_type.pat { 156 | return Ok(&id.ident); 157 | } 158 | } 159 | Err(syn::Error::new_spanned( 160 | arg, 161 | "non-identifier pattern in function args", 162 | )) 163 | }) 164 | .collect::>>()?; 165 | 166 | let mut mode = MethodMode::Query; 167 | let mut fn_sig_rename = fn_sig.clone(); 168 | 169 | for attr in canpack_attrs { 170 | let args = parse_canpack_args(&attr)?; 171 | let canpack_attr = read_canpack_attribute(args.clone().into_iter().collect())?; 172 | mode = canpack_attr.mode.unwrap_or(mode); 173 | fn_sig_rename.ident = canpack_attr 174 | .rename 175 | .map(|name| syn::Ident::new(&name, attr.span())) 176 | .unwrap_or(fn_sig_rename.ident); 177 | } 178 | 179 | let ic_cdk_attr = mode.ic_cdk_attr(); 180 | let candid_mode = mode.candid_mode(); 181 | let opt_await = fn_sig.asyncness.map(|_| quote! { .await }); 182 | 183 | module_output = quote! { 184 | #module_output 185 | #function 186 | }; 187 | canpack_output = quote! { 188 | #canpack_output 189 | #[ic_cdk::#ic_cdk_attr] 190 | #[candid::candid_method(#candid_mode)] 191 | #fn_sig_rename { 192 | $crate::#fn_name(#fn_args)#opt_await 193 | } 194 | }; 195 | } 196 | let output = quote! { 197 | #module_output 198 | #[macro_export] 199 | macro_rules! canpack { 200 | () => { 201 | #canpack_output 202 | }; 203 | } 204 | }; 205 | // Err(syn::Error::new_spanned( 206 | // output.clone(), 207 | // format!(">>>\n{}", quote! {#output}), 208 | // ))?; 209 | Ok(output.into()) 210 | } 211 | -------------------------------------------------------------------------------- /src/generate.ts: -------------------------------------------------------------------------------- 1 | import TOML from '@iarna/toml'; 2 | import { execa } from 'execa'; 3 | import { readFile, writeFile } from 'fs/promises'; 4 | import { mkdirp } from 'mkdirp'; 5 | import { join, resolve } from 'path'; 6 | import copy from 'recursive-copy'; 7 | import { rimraf } from 'rimraf'; 8 | import { Config, RustDependency } from './config.js'; 9 | import { exists, moduleRelative } from './util.js'; 10 | import chalk from 'chalk'; 11 | 12 | interface DfxJson { 13 | canisters?: Record; 14 | } 15 | 16 | interface CargoToml { 17 | workspace?: { 18 | members?: string[]; 19 | }; 20 | } 21 | 22 | interface DfxCanister { 23 | type?: string; 24 | package?: string; 25 | candid?: string; 26 | gzip?: boolean; 27 | canpack?: boolean; 28 | } 29 | 30 | const replaceInFile = async ( 31 | path: string, 32 | variables: [string | RegExp, string][], 33 | options?: { from: string }, 34 | ): Promise => { 35 | let content = await readFile(options?.from ?? path, 'utf8'); 36 | variables.forEach(([key, value]) => { 37 | content = content.replace(key, value); 38 | }); 39 | await writeFile(path, content); 40 | }; 41 | 42 | const getPartIdentifier = (part: RustDependency, i: number) => `part_${i}`; 43 | 44 | export const generate = async (config: Config): Promise => { 45 | const changes = []; 46 | 47 | // dfx.json 48 | const dfxJsonPath = 'dfx.json'; 49 | if (await exists(dfxJsonPath)) { 50 | let changed = false; 51 | const json = JSON.parse(await readFile(dfxJsonPath, 'utf8')) as DfxJson; 52 | if (json?.canisters) { 53 | // Remove previously added canisters 54 | for (const [name, canister] of Object.entries(json.canisters)) { 55 | if (canister?.canpack) { 56 | delete json.canisters[name]; 57 | changed = true; 58 | } 59 | } 60 | if (config.canisters) { 61 | for (const [name, canisterConfig] of Object.entries(config.canisters)) { 62 | if (!(json as any)?.canisters?.[name]) { 63 | if (canisterConfig.type === 'rust') { 64 | (json.canisters || (json.canisters = {}))[name] = { 65 | type: 'rust', 66 | package: name, 67 | candid: `.canpack/${name}/service.did`, 68 | gzip: true, 69 | canpack: true, 70 | }; 71 | changed = true; 72 | } 73 | } 74 | } 75 | } 76 | if (changed) { 77 | changes.push('* dfx.json'); 78 | // TODO: keep formatting 79 | await writeFile(dfxJsonPath, JSON.stringify(json, null, 2)); 80 | } 81 | } 82 | 83 | const rustProjects = config.canisters 84 | ? Object.entries(config.canisters).filter( 85 | ([, { type }]) => type === 'rust', 86 | ) 87 | : []; 88 | 89 | const templateDirectory = moduleRelative( 90 | import.meta, 91 | '../common/templates', 92 | ); 93 | 94 | // Cargo.toml (replace if file starts with generated comment) 95 | const cargoTomlPath = 'Cargo.toml'; 96 | const cargoTomlExists = await exists(cargoTomlPath); 97 | const getMemberPath = (name: string) => `.canpack/${name}`; 98 | if ( 99 | !cargoTomlExists || 100 | (await readFile(cargoTomlPath, 'utf8')).startsWith( 101 | '# Generated by Canpack', 102 | ) 103 | ) { 104 | changes.push(`${cargoTomlExists ? '*' : '+'} Cargo.toml`); 105 | await replaceInFile( 106 | cargoTomlPath, 107 | [ 108 | [ 109 | '# __members__', 110 | `${TOML.stringify({ 111 | members: rustProjects.map(([name]) => getMemberPath(name)), 112 | }).trim()}`, 113 | ], 114 | ], 115 | { from: join(templateDirectory, 'Cargo.toml') }, 116 | ); 117 | } else { 118 | const cargoToml: CargoToml = TOML.parse( 119 | await readFile(cargoTomlPath, 'utf8'), 120 | ); 121 | const missingMembers = rustProjects 122 | .map(([name]) => getMemberPath(name)) 123 | .filter((path) => !cargoToml?.workspace?.members?.includes(path)); 124 | if (missingMembers.length) { 125 | console.log( 126 | chalk.yellow( 127 | `Add the following \`workspace.members\` to ${resolve(cargoTomlPath)}: ${JSON.stringify(missingMembers)}`, 128 | ), 129 | ); 130 | } 131 | } 132 | 133 | // .canpack/ 134 | const canpackDirectory = '.canpack'; 135 | if (await exists(canpackDirectory)) { 136 | changes.push('* .canpack/'); 137 | await rimraf(canpackDirectory); 138 | } else { 139 | changes.push('+ .canpack/'); 140 | } 141 | await mkdirp(canpackDirectory); 142 | 143 | // .canpack/.gitignore 144 | if (!config.git) { 145 | const gitignorePath = join(canpackDirectory, '.gitignore'); 146 | if (!(await exists(gitignorePath))) { 147 | await writeFile(gitignorePath, '**/*\n'); 148 | } 149 | } 150 | 151 | // .canpack// 152 | if (rustProjects.length) { 153 | for (const [name, canisterConfig] of rustProjects) { 154 | const canisterDirectory = join(canpackDirectory, name); 155 | await copy(join(templateDirectory, 'rust'), canisterDirectory, { 156 | dot: true, 157 | }); 158 | // .canpack//Cargo.toml 159 | await replaceInFile(join(canisterDirectory, 'Cargo.toml'), [ 160 | [/"__package_name__"/g, JSON.stringify(name)], 161 | [ 162 | '# __parts__', 163 | canisterConfig.parts 164 | .map((part, i) => 165 | TOML.stringify({ 166 | dependencies: { 167 | [getPartIdentifier(part, i)]: 168 | typeof part === 'string' 169 | ? part 170 | : { 171 | ...part, 172 | path: part.path 173 | ? join('../..', part.path) 174 | : undefined, 175 | }, 176 | }, 177 | }), 178 | ) 179 | .join(''), 180 | ], 181 | ]); 182 | // .canpack//main.rs 183 | await replaceInFile(join(canisterDirectory, 'main.rs'), [ 184 | [ 185 | '// __parts__', 186 | canisterConfig.parts 187 | .map((part, i) => `${getPartIdentifier(part, i)}::canpack!();`) 188 | .join('\n'), 189 | ], 190 | ]); 191 | } 192 | 193 | // .canpack//service.did 194 | for (const [name, canisterConfig] of rustProjects) { 195 | changes.push(`* .canpack/${name}/service.did`); 196 | const result = await execa('cargo', ['run', '--package', name], { 197 | stderr: 'inherit', // Console output 198 | }).catch((err) => { 199 | process.exit(err.exitCode); 200 | }); 201 | await writeFile( 202 | join(canpackDirectory, name, 'service.did'), 203 | result.stdout, 204 | ); 205 | } 206 | } 207 | } 208 | 209 | return changes; 210 | }; 211 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `canpack`   [![npm version](https://img.shields.io/npm/v/canpack.svg?logo=npm&color=default)](https://www.npmjs.com/package/canpack) [![GitHub license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 2 | 3 | Canpack is a code generation tool which simplifies cross-language communication in [Internet Computer](https://internetcomputer.org/) canisters (such as calling a [Rust](https://www.rust-lang.org/) crate from [Motoko](https://github.com/dfinity/motoko)). This works by generating a separate canister from the host language, combining fragments defined across multiple libraries. 4 | 5 | **Note:** This project is early in development; unannounced breaking changes may occur at any time. 6 | 7 | ## Installation 8 | 9 | Ensure that the following software is installed on your system: 10 | * [dfx](https://support.dfinity.org/hc/en-us/articles/10552713577364-How-do-I-install-dfx) (latest version) 11 | * [Rust](https://www.rust-lang.org/tools/install) `>= 1.71` 12 | * [Node.js](https://nodejs.org/en) `>= 18` 13 | 14 | Run the following command to install the Canpack CLI on your global system path: 15 | 16 | ``` 17 | npm install -g canpack 18 | ``` 19 | 20 | ## Quick Start (Motoko + Rust) 21 | 22 | Canpack has built-in support for the [Mops](https://mops.one/) package manager. 23 | 24 | In your canister's `mops.toml` file, add a `rust-dependencies` section: 25 | 26 | ```toml 27 | [rust-dependencies] 28 | canpack-example-hello = "^0.1" 29 | local-crate = { path = "path/to/local-crate" } 30 | ``` 31 | 32 | You can also specify `[rust-dependencies]` in a Motoko package's `mops.toml` file to include Rust crates in any downstream canisters. 33 | 34 | Next, run the following command in the directory with the `mops.toml` and `dfx.json` files: 35 | 36 | ```bash 37 | canpack 38 | ``` 39 | 40 | This will configure and generate a `motoko_rust` canister with Candid bindings for the specified dependencies. Here is a Motoko canister which uses a function defined in the [`canpack-example-hello`](https://docs.rs/canpack-example-hello/latest/src/canpack_example_hello/lib.rs.html) crate: 41 | 42 | ```motoko 43 | import Rust "canister:motoko_rust"; 44 | 45 | actor { 46 | public composite query func hello(name: Text) : async Text { 47 | await Rust.canpack_example_hello(name) 48 | } 49 | } 50 | ``` 51 | 52 | Any Rust crate with Canpack compatibility can be specified as a standard [`Cargo.toml` dependency](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html). See the [Rust Crates](#rust-crates) section for more details. 53 | 54 | ## Rust Crates 55 | 56 | It's relatively simple to add Canpack support to any IC Wasm-compatible Rust crate. 57 | 58 | Here is the full implementation of the [`canpack-example-hello`](https://docs.rs/canpack-example-hello/latest/src/canpack_example_hello/lib.rs.html) package: 59 | 60 | ```rust 61 | canpack::export! { 62 | pub fn canpack_example_hello(name: String) -> String { 63 | format!("Hello, {name}!") 64 | } 65 | } 66 | ``` 67 | 68 | If needed, you can configure the generated Candid method using a `#[canpack]` attribute: 69 | 70 | ```rust 71 | canpack::export! { 72 | #[canpack(composite_query, rename = "canpack_example_hello")] 73 | pub fn hello(name: String) -> String { 74 | format!("Hello, {name}!") 75 | } 76 | } 77 | ``` 78 | 79 | Note that it is possible to reference local constants, methods, etc. 80 | 81 | ```rust 82 | const WELCOME: &str = "Welcome"; 83 | 84 | fn hello(salutation: &str, name: String) -> String { 85 | format!("{salutation}, {name}!") 86 | } 87 | 88 | canpack::export! { 89 | pub fn canpack_example_hello(name: String) -> String { 90 | hello(WELCOME, name) 91 | } 92 | } 93 | ``` 94 | 95 | The `canpack::export!` shorthand requires adding [`canpack`](https://crates.io/crates/canpack) as a dependency in your Cargo.toml file. It's also possible to manually define Candid methods by exporting a `canpack!` macro: 96 | 97 | ```rust 98 | pub fn hello(name: String) -> String { 99 | format!("Hello, {name}!") 100 | } 101 | 102 | #[macro_export] 103 | macro_rules! canpack { 104 | () => { 105 | #[ic_cdk::query] 106 | #[candid::candid_method(query)] 107 | fn canpack_example_hello(name: String) -> String { 108 | $crate::hello(name) 109 | } 110 | }; 111 | } 112 | ``` 113 | 114 | ## Advanced Usage 115 | 116 | ### `canpack.json` 117 | 118 | Pass the `-v` or `--verbose` flag to view the resolved JSON configuration for a project: 119 | 120 | ```bash 121 | canpack --verbose 122 | ``` 123 | 124 | Below is a step-by-step guide for setting up a `dfx` project with a `canpack.json` config file. The goal here is to illustrate how one could use Canpack without additional tools such as Mops, which is specific to the Motoko ecosystem. 125 | 126 | Run `dfx new my_project`, selecting "Motoko" for the backend and "No frontend canister" for the frontend. Once complete, run `cd my_project` and open in your editor of choice. 127 | 128 | Add a new file named `canpack.json` in the same directory as `dfx.json`. 129 | 130 | In the `canpack.json` file, define a Rust canister named `my_project_backend_rust`: 131 | 132 | ```json 133 | { 134 | "canisters": { 135 | "my_project_backend_rust": { 136 | "type": "rust", 137 | "parts": [{ 138 | "package": "canpack-example-hello", 139 | "version": "^0.1" 140 | }] 141 | } 142 | } 143 | } 144 | ``` 145 | 146 | Next, run the following command in this directory to generate all necessary files: 147 | 148 | ```bash 149 | canpack 150 | ``` 151 | 152 | In your `dfx.json` file, configure the `"dependencies"` for the Motoko canister: 153 | 154 | ```json 155 | { 156 | "canisters": { 157 | "my_project_backend": { 158 | "dependencies": ["my_project_backend_rust"], 159 | "main": "src/my_project_backend/main.mo", 160 | "type": "motoko" 161 | } 162 | }, 163 | } 164 | ``` 165 | 166 | Now you can call Rust functions from Motoko using a canister import: 167 | 168 | ```motoko 169 | import Rust "canister:my_project_backend_rust"; 170 | 171 | actor { 172 | public func hello(name: Text) : async Text { 173 | await Rust.canpack_example_hello(name) 174 | } 175 | } 176 | ``` 177 | 178 | Run the following commands to build and deploy the `dfx` project on your local machine: 179 | 180 | ``` 181 | dfx start --background 182 | dfx deploy 183 | ``` 184 | 185 | ### Programmatic API 186 | 187 | Canpack may be used as a low-level building block for package managers and other development tools. 188 | 189 | Add the `canpack` dependency to your Node.js project with the following command: 190 | 191 | ```bash 192 | npm i --save canpack 193 | ``` 194 | 195 | The following example JavaScript code runs Canpack in the current working directory: 196 | 197 | ```js 198 | import { canpack } from 'canpack'; 199 | 200 | const config = { 201 | verbose: true, 202 | canisters: { 203 | my_canister: { 204 | type: 'rust', 205 | parts: [{ 206 | package: 'canpack-example-hello', 207 | version: '^0.1', 208 | }] 209 | } 210 | } 211 | }; 212 | 213 | await canpack(config); 214 | ``` 215 | 216 | --- 217 | 218 | This project is early in development. Please feel free to report a bug, ask a question, or request a feature on the project's [GitHub issues](https://github.com/dfinity/canpack/issues) page. 219 | 220 | Contributions are welcome! Please check out the [contributor guidelines](https://github.com/dfinity/canpack/blob/main/.github/CONTRIBUTING.md) for more information. 221 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /tests/dfx/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "1.1.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "anyhow" 16 | version = "1.0.79" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" 19 | 20 | [[package]] 21 | name = "arrayvec" 22 | version = "0.5.2" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 25 | 26 | [[package]] 27 | name = "arrayvec" 28 | version = "0.7.4" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" 31 | 32 | [[package]] 33 | name = "auto_impl" 34 | version = "1.1.2" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" 37 | dependencies = [ 38 | "proc-macro2", 39 | "quote", 40 | "syn 2.0.48", 41 | ] 42 | 43 | [[package]] 44 | name = "autocfg" 45 | version = "1.1.0" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 48 | 49 | [[package]] 50 | name = "base16ct" 51 | version = "0.2.0" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" 54 | 55 | [[package]] 56 | name = "base64ct" 57 | version = "1.6.0" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" 60 | 61 | [[package]] 62 | name = "binread" 63 | version = "2.2.0" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "16598dfc8e6578e9b597d9910ba2e73618385dc9f4b1d43dd92c349d6be6418f" 66 | dependencies = [ 67 | "binread_derive", 68 | "lazy_static", 69 | "rustversion", 70 | ] 71 | 72 | [[package]] 73 | name = "binread_derive" 74 | version = "2.1.0" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "1d9672209df1714ee804b1f4d4f68c8eb2a90b1f7a07acf472f88ce198ef1fed" 77 | dependencies = [ 78 | "either", 79 | "proc-macro2", 80 | "quote", 81 | "syn 1.0.109", 82 | ] 83 | 84 | [[package]] 85 | name = "bitflags" 86 | version = "2.4.2" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" 89 | 90 | [[package]] 91 | name = "bitvec" 92 | version = "1.0.1" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 95 | dependencies = [ 96 | "funty", 97 | "radium", 98 | "tap", 99 | "wyz", 100 | ] 101 | 102 | [[package]] 103 | name = "block-buffer" 104 | version = "0.10.4" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 107 | dependencies = [ 108 | "generic-array", 109 | ] 110 | 111 | [[package]] 112 | name = "byte-slice-cast" 113 | version = "1.2.2" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" 116 | 117 | [[package]] 118 | name = "byteorder" 119 | version = "1.5.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 122 | 123 | [[package]] 124 | name = "bytes" 125 | version = "1.5.0" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" 128 | dependencies = [ 129 | "serde", 130 | ] 131 | 132 | [[package]] 133 | name = "candid" 134 | version = "0.10.3" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "182543fbc03b4ad0bfc384e6b68346e0b0aad0b11d075b71b4fcaa5d07f8862c" 137 | dependencies = [ 138 | "anyhow", 139 | "binread", 140 | "byteorder", 141 | "candid_derive", 142 | "hex", 143 | "ic_principal", 144 | "leb128", 145 | "num-bigint", 146 | "num-traits", 147 | "paste", 148 | "pretty", 149 | "serde", 150 | "serde_bytes", 151 | "stacker", 152 | "thiserror", 153 | ] 154 | 155 | [[package]] 156 | name = "candid_derive" 157 | version = "0.6.5" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "970c220da8aa2fa6f7ef5dbbf3ea5b620a59eb3ac107cfb95ae8c6eebdfb7a08" 160 | dependencies = [ 161 | "lazy_static", 162 | "proc-macro2", 163 | "quote", 164 | "syn 2.0.48", 165 | ] 166 | 167 | [[package]] 168 | name = "canpack" 169 | version = "0.1.1" 170 | dependencies = [ 171 | "canpack-macros", 172 | ] 173 | 174 | [[package]] 175 | name = "canpack-example-hello" 176 | version = "0.1.0" 177 | dependencies = [ 178 | "canpack", 179 | ] 180 | 181 | [[package]] 182 | name = "canpack-macros" 183 | version = "0.1.1" 184 | dependencies = [ 185 | "proc-macro2", 186 | "quote", 187 | "syn 2.0.48", 188 | ] 189 | 190 | [[package]] 191 | name = "cc" 192 | version = "1.0.83" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 195 | dependencies = [ 196 | "libc", 197 | ] 198 | 199 | [[package]] 200 | name = "cfg-if" 201 | version = "1.0.0" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 204 | 205 | [[package]] 206 | name = "chrono" 207 | version = "0.4.34" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" 210 | dependencies = [ 211 | "num-traits", 212 | ] 213 | 214 | [[package]] 215 | name = "const-hex" 216 | version = "1.11.0" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" 219 | dependencies = [ 220 | "cfg-if", 221 | "cpufeatures", 222 | "hex", 223 | "proptest", 224 | "serde", 225 | ] 226 | 227 | [[package]] 228 | name = "const-oid" 229 | version = "0.9.6" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 232 | 233 | [[package]] 234 | name = "cpufeatures" 235 | version = "0.2.12" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 238 | dependencies = [ 239 | "libc", 240 | ] 241 | 242 | [[package]] 243 | name = "crc32fast" 244 | version = "1.4.0" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" 247 | dependencies = [ 248 | "cfg-if", 249 | ] 250 | 251 | [[package]] 252 | name = "crunchy" 253 | version = "0.2.2" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 256 | 257 | [[package]] 258 | name = "crypto-bigint" 259 | version = "0.5.5" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" 262 | dependencies = [ 263 | "generic-array", 264 | "rand_core", 265 | "subtle", 266 | "zeroize", 267 | ] 268 | 269 | [[package]] 270 | name = "crypto-common" 271 | version = "0.1.6" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 274 | dependencies = [ 275 | "generic-array", 276 | "typenum", 277 | ] 278 | 279 | [[package]] 280 | name = "data-encoding" 281 | version = "2.5.0" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" 284 | 285 | [[package]] 286 | name = "der" 287 | version = "0.7.8" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" 290 | dependencies = [ 291 | "const-oid", 292 | "zeroize", 293 | ] 294 | 295 | [[package]] 296 | name = "derive_more" 297 | version = "0.99.17" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 300 | dependencies = [ 301 | "proc-macro2", 302 | "quote", 303 | "syn 1.0.109", 304 | ] 305 | 306 | [[package]] 307 | name = "digest" 308 | version = "0.10.7" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 311 | dependencies = [ 312 | "block-buffer", 313 | "const-oid", 314 | "crypto-common", 315 | "subtle", 316 | ] 317 | 318 | [[package]] 319 | name = "ecdsa" 320 | version = "0.16.9" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" 323 | dependencies = [ 324 | "der", 325 | "digest", 326 | "elliptic-curve", 327 | "rfc6979", 328 | "signature", 329 | "spki", 330 | ] 331 | 332 | [[package]] 333 | name = "either" 334 | version = "1.10.0" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" 337 | 338 | [[package]] 339 | name = "elliptic-curve" 340 | version = "0.13.8" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" 343 | dependencies = [ 344 | "base16ct", 345 | "crypto-bigint", 346 | "digest", 347 | "ff", 348 | "generic-array", 349 | "group", 350 | "pkcs8", 351 | "rand_core", 352 | "sec1", 353 | "subtle", 354 | "zeroize", 355 | ] 356 | 357 | [[package]] 358 | name = "equivalent" 359 | version = "1.0.1" 360 | source = "registry+https://github.com/rust-lang/crates.io-index" 361 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 362 | 363 | [[package]] 364 | name = "errno" 365 | version = "0.3.8" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 368 | dependencies = [ 369 | "libc", 370 | "windows-sys", 371 | ] 372 | 373 | [[package]] 374 | name = "ethabi" 375 | version = "18.0.0" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" 378 | dependencies = [ 379 | "ethereum-types", 380 | "hex", 381 | "once_cell", 382 | "regex", 383 | "serde", 384 | "serde_json", 385 | "sha3", 386 | "thiserror", 387 | "uint", 388 | ] 389 | 390 | [[package]] 391 | name = "ethbloom" 392 | version = "0.13.0" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" 395 | dependencies = [ 396 | "crunchy", 397 | "fixed-hash", 398 | "impl-codec", 399 | "impl-rlp", 400 | "impl-serde", 401 | "scale-info", 402 | "tiny-keccak", 403 | ] 404 | 405 | [[package]] 406 | name = "ethereum-types" 407 | version = "0.14.1" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" 410 | dependencies = [ 411 | "ethbloom", 412 | "fixed-hash", 413 | "impl-codec", 414 | "impl-rlp", 415 | "impl-serde", 416 | "primitive-types", 417 | "scale-info", 418 | "uint", 419 | ] 420 | 421 | [[package]] 422 | name = "ethers-core" 423 | version = "2.0.13" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" 426 | dependencies = [ 427 | "arrayvec 0.7.4", 428 | "bytes", 429 | "chrono", 430 | "const-hex", 431 | "elliptic-curve", 432 | "ethabi", 433 | "generic-array", 434 | "k256", 435 | "num_enum", 436 | "open-fastrlp", 437 | "rand", 438 | "rlp", 439 | "serde", 440 | "serde_json", 441 | "strum", 442 | "tempfile", 443 | "thiserror", 444 | "tiny-keccak", 445 | "unicode-xid", 446 | ] 447 | 448 | [[package]] 449 | name = "fastrand" 450 | version = "2.0.1" 451 | source = "registry+https://github.com/rust-lang/crates.io-index" 452 | checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" 453 | 454 | [[package]] 455 | name = "ff" 456 | version = "0.13.0" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" 459 | dependencies = [ 460 | "rand_core", 461 | "subtle", 462 | ] 463 | 464 | [[package]] 465 | name = "fixed-hash" 466 | version = "0.8.0" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" 469 | dependencies = [ 470 | "byteorder", 471 | "rand", 472 | "rustc-hex", 473 | "static_assertions", 474 | ] 475 | 476 | [[package]] 477 | name = "funty" 478 | version = "2.0.0" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 481 | 482 | [[package]] 483 | name = "generic-array" 484 | version = "0.14.7" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 487 | dependencies = [ 488 | "typenum", 489 | "version_check", 490 | "zeroize", 491 | ] 492 | 493 | [[package]] 494 | name = "getrandom" 495 | version = "0.2.12" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" 498 | dependencies = [ 499 | "cfg-if", 500 | "libc", 501 | "wasi", 502 | ] 503 | 504 | [[package]] 505 | name = "group" 506 | version = "0.13.0" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 509 | dependencies = [ 510 | "ff", 511 | "rand_core", 512 | "subtle", 513 | ] 514 | 515 | [[package]] 516 | name = "hashbrown" 517 | version = "0.14.3" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 520 | 521 | [[package]] 522 | name = "heck" 523 | version = "0.4.1" 524 | source = "registry+https://github.com/rust-lang/crates.io-index" 525 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 526 | 527 | [[package]] 528 | name = "hex" 529 | version = "0.4.3" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 532 | 533 | [[package]] 534 | name = "hmac" 535 | version = "0.12.1" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 538 | dependencies = [ 539 | "digest", 540 | ] 541 | 542 | [[package]] 543 | name = "ic-cdk" 544 | version = "0.12.1" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "9f3d204af0b11c45715169c997858edb58fa8407d08f4fae78a6b415dd39a362" 547 | dependencies = [ 548 | "candid", 549 | "ic-cdk-macros", 550 | "ic0", 551 | "serde", 552 | "serde_bytes", 553 | ] 554 | 555 | [[package]] 556 | name = "ic-cdk-macros" 557 | version = "0.8.4" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "a5a618e4020cea88e933d8d2f8c7f86d570ec06213506a80d4f2c520a9bba512" 560 | dependencies = [ 561 | "candid", 562 | "proc-macro2", 563 | "quote", 564 | "serde", 565 | "serde_tokenstream", 566 | "syn 1.0.109", 567 | ] 568 | 569 | [[package]] 570 | name = "ic-ecdsa" 571 | version = "0.0.1" 572 | dependencies = [ 573 | "candid", 574 | "canpack", 575 | "ethers-core", 576 | "getrandom", 577 | "hex", 578 | "ic-cdk", 579 | "ic-cdk-macros", 580 | "serde", 581 | ] 582 | 583 | [[package]] 584 | name = "ic0" 585 | version = "0.21.1" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "a54b5297861c651551676e8c43df805dad175cc33bc97dbd992edbbb85dcbcdf" 588 | 589 | [[package]] 590 | name = "ic_principal" 591 | version = "0.1.1" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "1762deb6f7c8d8c2bdee4b6c5a47b60195b74e9b5280faa5ba29692f8e17429c" 594 | dependencies = [ 595 | "crc32fast", 596 | "data-encoding", 597 | "serde", 598 | "sha2", 599 | "thiserror", 600 | ] 601 | 602 | [[package]] 603 | name = "impl-codec" 604 | version = "0.6.0" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" 607 | dependencies = [ 608 | "parity-scale-codec", 609 | ] 610 | 611 | [[package]] 612 | name = "impl-rlp" 613 | version = "0.3.0" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" 616 | dependencies = [ 617 | "rlp", 618 | ] 619 | 620 | [[package]] 621 | name = "impl-serde" 622 | version = "0.4.0" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" 625 | dependencies = [ 626 | "serde", 627 | ] 628 | 629 | [[package]] 630 | name = "impl-trait-for-tuples" 631 | version = "0.2.2" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" 634 | dependencies = [ 635 | "proc-macro2", 636 | "quote", 637 | "syn 1.0.109", 638 | ] 639 | 640 | [[package]] 641 | name = "indexmap" 642 | version = "2.2.3" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" 645 | dependencies = [ 646 | "equivalent", 647 | "hashbrown", 648 | ] 649 | 650 | [[package]] 651 | name = "itoa" 652 | version = "1.0.10" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" 655 | 656 | [[package]] 657 | name = "k256" 658 | version = "0.13.3" 659 | source = "registry+https://github.com/rust-lang/crates.io-index" 660 | checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" 661 | dependencies = [ 662 | "cfg-if", 663 | "ecdsa", 664 | "elliptic-curve", 665 | "once_cell", 666 | "sha2", 667 | ] 668 | 669 | [[package]] 670 | name = "keccak" 671 | version = "0.1.5" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" 674 | dependencies = [ 675 | "cpufeatures", 676 | ] 677 | 678 | [[package]] 679 | name = "lazy_static" 680 | version = "1.4.0" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 683 | 684 | [[package]] 685 | name = "leb128" 686 | version = "0.2.5" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" 689 | 690 | [[package]] 691 | name = "libc" 692 | version = "0.2.153" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 695 | 696 | [[package]] 697 | name = "libm" 698 | version = "0.2.8" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" 701 | 702 | [[package]] 703 | name = "linux-raw-sys" 704 | version = "0.4.13" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" 707 | 708 | [[package]] 709 | name = "memchr" 710 | version = "2.7.1" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 713 | 714 | [[package]] 715 | name = "motoko_rust" 716 | version = "0.0.0" 717 | dependencies = [ 718 | "candid", 719 | "canpack-example-hello", 720 | "ic-cdk", 721 | "ic-cdk-macros", 722 | "ic-ecdsa", 723 | ] 724 | 725 | [[package]] 726 | name = "num-bigint" 727 | version = "0.4.4" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" 730 | dependencies = [ 731 | "autocfg", 732 | "num-integer", 733 | "num-traits", 734 | "serde", 735 | ] 736 | 737 | [[package]] 738 | name = "num-integer" 739 | version = "0.1.46" 740 | source = "registry+https://github.com/rust-lang/crates.io-index" 741 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 742 | dependencies = [ 743 | "num-traits", 744 | ] 745 | 746 | [[package]] 747 | name = "num-traits" 748 | version = "0.2.18" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 751 | dependencies = [ 752 | "autocfg", 753 | "libm", 754 | ] 755 | 756 | [[package]] 757 | name = "num_enum" 758 | version = "0.7.2" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" 761 | dependencies = [ 762 | "num_enum_derive", 763 | ] 764 | 765 | [[package]] 766 | name = "num_enum_derive" 767 | version = "0.7.2" 768 | source = "registry+https://github.com/rust-lang/crates.io-index" 769 | checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" 770 | dependencies = [ 771 | "proc-macro-crate 3.1.0", 772 | "proc-macro2", 773 | "quote", 774 | "syn 2.0.48", 775 | ] 776 | 777 | [[package]] 778 | name = "once_cell" 779 | version = "1.19.0" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 782 | 783 | [[package]] 784 | name = "open-fastrlp" 785 | version = "0.1.4" 786 | source = "registry+https://github.com/rust-lang/crates.io-index" 787 | checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" 788 | dependencies = [ 789 | "arrayvec 0.7.4", 790 | "auto_impl", 791 | "bytes", 792 | "ethereum-types", 793 | "open-fastrlp-derive", 794 | ] 795 | 796 | [[package]] 797 | name = "open-fastrlp-derive" 798 | version = "0.1.1" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" 801 | dependencies = [ 802 | "bytes", 803 | "proc-macro2", 804 | "quote", 805 | "syn 1.0.109", 806 | ] 807 | 808 | [[package]] 809 | name = "parity-scale-codec" 810 | version = "3.6.9" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" 813 | dependencies = [ 814 | "arrayvec 0.7.4", 815 | "bitvec", 816 | "byte-slice-cast", 817 | "impl-trait-for-tuples", 818 | "parity-scale-codec-derive", 819 | "serde", 820 | ] 821 | 822 | [[package]] 823 | name = "parity-scale-codec-derive" 824 | version = "3.6.9" 825 | source = "registry+https://github.com/rust-lang/crates.io-index" 826 | checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" 827 | dependencies = [ 828 | "proc-macro-crate 2.0.0", 829 | "proc-macro2", 830 | "quote", 831 | "syn 1.0.109", 832 | ] 833 | 834 | [[package]] 835 | name = "paste" 836 | version = "1.0.14" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 839 | 840 | [[package]] 841 | name = "pkcs8" 842 | version = "0.10.2" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" 845 | dependencies = [ 846 | "der", 847 | "spki", 848 | ] 849 | 850 | [[package]] 851 | name = "ppv-lite86" 852 | version = "0.2.17" 853 | source = "registry+https://github.com/rust-lang/crates.io-index" 854 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 855 | 856 | [[package]] 857 | name = "pretty" 858 | version = "0.12.3" 859 | source = "registry+https://github.com/rust-lang/crates.io-index" 860 | checksum = "b55c4d17d994b637e2f4daf6e5dc5d660d209d5642377d675d7a1c3ab69fa579" 861 | dependencies = [ 862 | "arrayvec 0.5.2", 863 | "typed-arena", 864 | "unicode-width", 865 | ] 866 | 867 | [[package]] 868 | name = "primitive-types" 869 | version = "0.12.2" 870 | source = "registry+https://github.com/rust-lang/crates.io-index" 871 | checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" 872 | dependencies = [ 873 | "fixed-hash", 874 | "impl-codec", 875 | "impl-rlp", 876 | "impl-serde", 877 | "scale-info", 878 | "uint", 879 | ] 880 | 881 | [[package]] 882 | name = "proc-macro-crate" 883 | version = "1.3.1" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" 886 | dependencies = [ 887 | "once_cell", 888 | "toml_edit 0.19.15", 889 | ] 890 | 891 | [[package]] 892 | name = "proc-macro-crate" 893 | version = "2.0.0" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" 896 | dependencies = [ 897 | "toml_edit 0.20.7", 898 | ] 899 | 900 | [[package]] 901 | name = "proc-macro-crate" 902 | version = "3.1.0" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" 905 | dependencies = [ 906 | "toml_edit 0.21.1", 907 | ] 908 | 909 | [[package]] 910 | name = "proc-macro2" 911 | version = "1.0.78" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" 914 | dependencies = [ 915 | "unicode-ident", 916 | ] 917 | 918 | [[package]] 919 | name = "proptest" 920 | version = "1.4.0" 921 | source = "registry+https://github.com/rust-lang/crates.io-index" 922 | checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" 923 | dependencies = [ 924 | "bitflags", 925 | "lazy_static", 926 | "num-traits", 927 | "rand", 928 | "rand_chacha", 929 | "rand_xorshift", 930 | "regex-syntax", 931 | "unarray", 932 | ] 933 | 934 | [[package]] 935 | name = "psm" 936 | version = "0.1.21" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" 939 | dependencies = [ 940 | "cc", 941 | ] 942 | 943 | [[package]] 944 | name = "quote" 945 | version = "1.0.35" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 948 | dependencies = [ 949 | "proc-macro2", 950 | ] 951 | 952 | [[package]] 953 | name = "radium" 954 | version = "0.7.0" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 957 | 958 | [[package]] 959 | name = "rand" 960 | version = "0.8.5" 961 | source = "registry+https://github.com/rust-lang/crates.io-index" 962 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 963 | dependencies = [ 964 | "libc", 965 | "rand_chacha", 966 | "rand_core", 967 | ] 968 | 969 | [[package]] 970 | name = "rand_chacha" 971 | version = "0.3.1" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 974 | dependencies = [ 975 | "ppv-lite86", 976 | "rand_core", 977 | ] 978 | 979 | [[package]] 980 | name = "rand_core" 981 | version = "0.6.4" 982 | source = "registry+https://github.com/rust-lang/crates.io-index" 983 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 984 | dependencies = [ 985 | "getrandom", 986 | ] 987 | 988 | [[package]] 989 | name = "rand_xorshift" 990 | version = "0.3.0" 991 | source = "registry+https://github.com/rust-lang/crates.io-index" 992 | checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" 993 | dependencies = [ 994 | "rand_core", 995 | ] 996 | 997 | [[package]] 998 | name = "regex" 999 | version = "1.10.3" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" 1002 | dependencies = [ 1003 | "aho-corasick", 1004 | "memchr", 1005 | "regex-automata", 1006 | "regex-syntax", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "regex-automata" 1011 | version = "0.4.5" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" 1014 | dependencies = [ 1015 | "aho-corasick", 1016 | "memchr", 1017 | "regex-syntax", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "regex-syntax" 1022 | version = "0.8.2" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" 1025 | 1026 | [[package]] 1027 | name = "rfc6979" 1028 | version = "0.4.0" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" 1031 | dependencies = [ 1032 | "hmac", 1033 | "subtle", 1034 | ] 1035 | 1036 | [[package]] 1037 | name = "rlp" 1038 | version = "0.5.2" 1039 | source = "registry+https://github.com/rust-lang/crates.io-index" 1040 | checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" 1041 | dependencies = [ 1042 | "bytes", 1043 | "rlp-derive", 1044 | "rustc-hex", 1045 | ] 1046 | 1047 | [[package]] 1048 | name = "rlp-derive" 1049 | version = "0.1.0" 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" 1051 | checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" 1052 | dependencies = [ 1053 | "proc-macro2", 1054 | "quote", 1055 | "syn 1.0.109", 1056 | ] 1057 | 1058 | [[package]] 1059 | name = "rustc-hex" 1060 | version = "2.1.0" 1061 | source = "registry+https://github.com/rust-lang/crates.io-index" 1062 | checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" 1063 | 1064 | [[package]] 1065 | name = "rustix" 1066 | version = "0.38.31" 1067 | source = "registry+https://github.com/rust-lang/crates.io-index" 1068 | checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" 1069 | dependencies = [ 1070 | "bitflags", 1071 | "errno", 1072 | "libc", 1073 | "linux-raw-sys", 1074 | "windows-sys", 1075 | ] 1076 | 1077 | [[package]] 1078 | name = "rustversion" 1079 | version = "1.0.14" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1082 | 1083 | [[package]] 1084 | name = "ryu" 1085 | version = "1.0.17" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 1088 | 1089 | [[package]] 1090 | name = "scale-info" 1091 | version = "2.10.0" 1092 | source = "registry+https://github.com/rust-lang/crates.io-index" 1093 | checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" 1094 | dependencies = [ 1095 | "cfg-if", 1096 | "derive_more", 1097 | "parity-scale-codec", 1098 | "scale-info-derive", 1099 | ] 1100 | 1101 | [[package]] 1102 | name = "scale-info-derive" 1103 | version = "2.10.0" 1104 | source = "registry+https://github.com/rust-lang/crates.io-index" 1105 | checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" 1106 | dependencies = [ 1107 | "proc-macro-crate 1.3.1", 1108 | "proc-macro2", 1109 | "quote", 1110 | "syn 1.0.109", 1111 | ] 1112 | 1113 | [[package]] 1114 | name = "sec1" 1115 | version = "0.7.3" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" 1118 | dependencies = [ 1119 | "base16ct", 1120 | "der", 1121 | "generic-array", 1122 | "pkcs8", 1123 | "subtle", 1124 | "zeroize", 1125 | ] 1126 | 1127 | [[package]] 1128 | name = "serde" 1129 | version = "1.0.196" 1130 | source = "registry+https://github.com/rust-lang/crates.io-index" 1131 | checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" 1132 | dependencies = [ 1133 | "serde_derive", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "serde_bytes" 1138 | version = "0.11.14" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" 1141 | dependencies = [ 1142 | "serde", 1143 | ] 1144 | 1145 | [[package]] 1146 | name = "serde_derive" 1147 | version = "1.0.196" 1148 | source = "registry+https://github.com/rust-lang/crates.io-index" 1149 | checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" 1150 | dependencies = [ 1151 | "proc-macro2", 1152 | "quote", 1153 | "syn 2.0.48", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "serde_json" 1158 | version = "1.0.114" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" 1161 | dependencies = [ 1162 | "itoa", 1163 | "ryu", 1164 | "serde", 1165 | ] 1166 | 1167 | [[package]] 1168 | name = "serde_tokenstream" 1169 | version = "0.1.7" 1170 | source = "registry+https://github.com/rust-lang/crates.io-index" 1171 | checksum = "797ba1d80299b264f3aac68ab5d12e5825a561749db4df7cd7c8083900c5d4e9" 1172 | dependencies = [ 1173 | "proc-macro2", 1174 | "serde", 1175 | "syn 1.0.109", 1176 | ] 1177 | 1178 | [[package]] 1179 | name = "sha2" 1180 | version = "0.10.8" 1181 | source = "registry+https://github.com/rust-lang/crates.io-index" 1182 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 1183 | dependencies = [ 1184 | "cfg-if", 1185 | "cpufeatures", 1186 | "digest", 1187 | ] 1188 | 1189 | [[package]] 1190 | name = "sha3" 1191 | version = "0.10.8" 1192 | source = "registry+https://github.com/rust-lang/crates.io-index" 1193 | checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" 1194 | dependencies = [ 1195 | "digest", 1196 | "keccak", 1197 | ] 1198 | 1199 | [[package]] 1200 | name = "signature" 1201 | version = "2.2.0" 1202 | source = "registry+https://github.com/rust-lang/crates.io-index" 1203 | checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 1204 | dependencies = [ 1205 | "digest", 1206 | "rand_core", 1207 | ] 1208 | 1209 | [[package]] 1210 | name = "spki" 1211 | version = "0.7.3" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" 1214 | dependencies = [ 1215 | "base64ct", 1216 | "der", 1217 | ] 1218 | 1219 | [[package]] 1220 | name = "stacker" 1221 | version = "0.1.15" 1222 | source = "registry+https://github.com/rust-lang/crates.io-index" 1223 | checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" 1224 | dependencies = [ 1225 | "cc", 1226 | "cfg-if", 1227 | "libc", 1228 | "psm", 1229 | "winapi", 1230 | ] 1231 | 1232 | [[package]] 1233 | name = "static_assertions" 1234 | version = "1.1.0" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1237 | 1238 | [[package]] 1239 | name = "strum" 1240 | version = "0.25.0" 1241 | source = "registry+https://github.com/rust-lang/crates.io-index" 1242 | checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" 1243 | dependencies = [ 1244 | "strum_macros", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "strum_macros" 1249 | version = "0.25.3" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" 1252 | dependencies = [ 1253 | "heck", 1254 | "proc-macro2", 1255 | "quote", 1256 | "rustversion", 1257 | "syn 2.0.48", 1258 | ] 1259 | 1260 | [[package]] 1261 | name = "subtle" 1262 | version = "2.5.0" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" 1265 | 1266 | [[package]] 1267 | name = "syn" 1268 | version = "1.0.109" 1269 | source = "registry+https://github.com/rust-lang/crates.io-index" 1270 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1271 | dependencies = [ 1272 | "proc-macro2", 1273 | "quote", 1274 | "unicode-ident", 1275 | ] 1276 | 1277 | [[package]] 1278 | name = "syn" 1279 | version = "2.0.48" 1280 | source = "registry+https://github.com/rust-lang/crates.io-index" 1281 | checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" 1282 | dependencies = [ 1283 | "proc-macro2", 1284 | "quote", 1285 | "unicode-ident", 1286 | ] 1287 | 1288 | [[package]] 1289 | name = "tap" 1290 | version = "1.0.1" 1291 | source = "registry+https://github.com/rust-lang/crates.io-index" 1292 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 1293 | 1294 | [[package]] 1295 | name = "tempfile" 1296 | version = "3.10.0" 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" 1298 | checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" 1299 | dependencies = [ 1300 | "cfg-if", 1301 | "fastrand", 1302 | "rustix", 1303 | "windows-sys", 1304 | ] 1305 | 1306 | [[package]] 1307 | name = "thiserror" 1308 | version = "1.0.57" 1309 | source = "registry+https://github.com/rust-lang/crates.io-index" 1310 | checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" 1311 | dependencies = [ 1312 | "thiserror-impl", 1313 | ] 1314 | 1315 | [[package]] 1316 | name = "thiserror-impl" 1317 | version = "1.0.57" 1318 | source = "registry+https://github.com/rust-lang/crates.io-index" 1319 | checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" 1320 | dependencies = [ 1321 | "proc-macro2", 1322 | "quote", 1323 | "syn 2.0.48", 1324 | ] 1325 | 1326 | [[package]] 1327 | name = "tiny-keccak" 1328 | version = "2.0.2" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" 1331 | dependencies = [ 1332 | "crunchy", 1333 | ] 1334 | 1335 | [[package]] 1336 | name = "toml_datetime" 1337 | version = "0.6.5" 1338 | source = "registry+https://github.com/rust-lang/crates.io-index" 1339 | checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" 1340 | 1341 | [[package]] 1342 | name = "toml_edit" 1343 | version = "0.19.15" 1344 | source = "registry+https://github.com/rust-lang/crates.io-index" 1345 | checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" 1346 | dependencies = [ 1347 | "indexmap", 1348 | "toml_datetime", 1349 | "winnow", 1350 | ] 1351 | 1352 | [[package]] 1353 | name = "toml_edit" 1354 | version = "0.20.7" 1355 | source = "registry+https://github.com/rust-lang/crates.io-index" 1356 | checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" 1357 | dependencies = [ 1358 | "indexmap", 1359 | "toml_datetime", 1360 | "winnow", 1361 | ] 1362 | 1363 | [[package]] 1364 | name = "toml_edit" 1365 | version = "0.21.1" 1366 | source = "registry+https://github.com/rust-lang/crates.io-index" 1367 | checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" 1368 | dependencies = [ 1369 | "indexmap", 1370 | "toml_datetime", 1371 | "winnow", 1372 | ] 1373 | 1374 | [[package]] 1375 | name = "typed-arena" 1376 | version = "2.0.2" 1377 | source = "registry+https://github.com/rust-lang/crates.io-index" 1378 | checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" 1379 | 1380 | [[package]] 1381 | name = "typenum" 1382 | version = "1.17.0" 1383 | source = "registry+https://github.com/rust-lang/crates.io-index" 1384 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1385 | 1386 | [[package]] 1387 | name = "uint" 1388 | version = "0.9.5" 1389 | source = "registry+https://github.com/rust-lang/crates.io-index" 1390 | checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" 1391 | dependencies = [ 1392 | "byteorder", 1393 | "crunchy", 1394 | "hex", 1395 | "static_assertions", 1396 | ] 1397 | 1398 | [[package]] 1399 | name = "unarray" 1400 | version = "0.1.4" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" 1403 | 1404 | [[package]] 1405 | name = "unicode-ident" 1406 | version = "1.0.12" 1407 | source = "registry+https://github.com/rust-lang/crates.io-index" 1408 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1409 | 1410 | [[package]] 1411 | name = "unicode-width" 1412 | version = "0.1.11" 1413 | source = "registry+https://github.com/rust-lang/crates.io-index" 1414 | checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" 1415 | 1416 | [[package]] 1417 | name = "unicode-xid" 1418 | version = "0.2.4" 1419 | source = "registry+https://github.com/rust-lang/crates.io-index" 1420 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 1421 | 1422 | [[package]] 1423 | name = "version_check" 1424 | version = "0.9.4" 1425 | source = "registry+https://github.com/rust-lang/crates.io-index" 1426 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1427 | 1428 | [[package]] 1429 | name = "wasi" 1430 | version = "0.11.0+wasi-snapshot-preview1" 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" 1432 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1433 | 1434 | [[package]] 1435 | name = "winapi" 1436 | version = "0.3.9" 1437 | source = "registry+https://github.com/rust-lang/crates.io-index" 1438 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1439 | dependencies = [ 1440 | "winapi-i686-pc-windows-gnu", 1441 | "winapi-x86_64-pc-windows-gnu", 1442 | ] 1443 | 1444 | [[package]] 1445 | name = "winapi-i686-pc-windows-gnu" 1446 | version = "0.4.0" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1449 | 1450 | [[package]] 1451 | name = "winapi-x86_64-pc-windows-gnu" 1452 | version = "0.4.0" 1453 | source = "registry+https://github.com/rust-lang/crates.io-index" 1454 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1455 | 1456 | [[package]] 1457 | name = "windows-sys" 1458 | version = "0.52.0" 1459 | source = "registry+https://github.com/rust-lang/crates.io-index" 1460 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1461 | dependencies = [ 1462 | "windows-targets", 1463 | ] 1464 | 1465 | [[package]] 1466 | name = "windows-targets" 1467 | version = "0.52.0" 1468 | source = "registry+https://github.com/rust-lang/crates.io-index" 1469 | checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" 1470 | dependencies = [ 1471 | "windows_aarch64_gnullvm", 1472 | "windows_aarch64_msvc", 1473 | "windows_i686_gnu", 1474 | "windows_i686_msvc", 1475 | "windows_x86_64_gnu", 1476 | "windows_x86_64_gnullvm", 1477 | "windows_x86_64_msvc", 1478 | ] 1479 | 1480 | [[package]] 1481 | name = "windows_aarch64_gnullvm" 1482 | version = "0.52.0" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" 1485 | 1486 | [[package]] 1487 | name = "windows_aarch64_msvc" 1488 | version = "0.52.0" 1489 | source = "registry+https://github.com/rust-lang/crates.io-index" 1490 | checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" 1491 | 1492 | [[package]] 1493 | name = "windows_i686_gnu" 1494 | version = "0.52.0" 1495 | source = "registry+https://github.com/rust-lang/crates.io-index" 1496 | checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" 1497 | 1498 | [[package]] 1499 | name = "windows_i686_msvc" 1500 | version = "0.52.0" 1501 | source = "registry+https://github.com/rust-lang/crates.io-index" 1502 | checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" 1503 | 1504 | [[package]] 1505 | name = "windows_x86_64_gnu" 1506 | version = "0.52.0" 1507 | source = "registry+https://github.com/rust-lang/crates.io-index" 1508 | checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" 1509 | 1510 | [[package]] 1511 | name = "windows_x86_64_gnullvm" 1512 | version = "0.52.0" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" 1515 | 1516 | [[package]] 1517 | name = "windows_x86_64_msvc" 1518 | version = "0.52.0" 1519 | source = "registry+https://github.com/rust-lang/crates.io-index" 1520 | checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" 1521 | 1522 | [[package]] 1523 | name = "winnow" 1524 | version = "0.5.40" 1525 | source = "registry+https://github.com/rust-lang/crates.io-index" 1526 | checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" 1527 | dependencies = [ 1528 | "memchr", 1529 | ] 1530 | 1531 | [[package]] 1532 | name = "wyz" 1533 | version = "0.5.1" 1534 | source = "registry+https://github.com/rust-lang/crates.io-index" 1535 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 1536 | dependencies = [ 1537 | "tap", 1538 | ] 1539 | 1540 | [[package]] 1541 | name = "zeroize" 1542 | version = "1.7.0" 1543 | source = "registry+https://github.com/rust-lang/crates.io-index" 1544 | checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" 1545 | --------------------------------------------------------------------------------