### Install and Run Development Server Source: https://github.com/cartridge-gg/paymaster/blob/main/website/README.md Install project dependencies and start the development server using Yarn. ```bash yarn install yarn dev ``` -------------------------------- ### Build the Project Source: https://github.com/cartridge-gg/paymaster/blob/main/CONTRIBUTING.md Install project dependencies by building the Rust project. ```bash cargo build ``` -------------------------------- ### Install AVNU Paymaster CLI using asdf Source: https://github.com/cartridge-gg/paymaster/blob/main/README.md Install the AVNU Paymaster CLI using the asdf version manager. This is the recommended installation method. ```bash asdf plugin add paymaster https://github.com/cartridge-gg/paymaster.git asdf install paymaster latest asdf set paymaster latest paymaster-cli --help ``` -------------------------------- ### Quick Setup AVNU Paymaster CLI Source: https://github.com/cartridge-gg/paymaster/blob/main/README.md Use the CLI to quickly set up a Paymaster instance for a specific Starknet chain. Requires master address and private key. ```bash cargo install --path . --bin paymaster-cli cargo run --bin paymaster-cli quick-setup \ --chain-id=sepolia \ --master-address=0xDEAD \ --master-pk=0xBEEF \ --profile=my-profile ``` -------------------------------- ### Website Development Commands Source: https://github.com/cartridge-gg/paymaster/blob/main/CLAUDE.md Commands for navigating to the website directory, installing dependencies, and running development or production builds. ```bash # Navigate to website directory cd website # Install dependencies yarn install # Run development server yarn run dev # Build for production yarn run build # Preview production build yarn run preview ``` -------------------------------- ### Run CLI Tools Source: https://github.com/cartridge-gg/paymaster/blob/main/CLAUDE.md Commands to interact with the paymaster CLI for quick setup, deployment, and management of relayers. ```bash # Run CLI (shows available commands) cargo run -p paymaster-cli # Quick setup cargo run -p paymaster-cli quick-setup # Deploy relayers cargo run -p paymaster-cli deploy-relayers # Check relayer balances cargo run -p paymaster-cli relayers-balance # Rebalance relayers cargo run -p paymaster-cli relayers-rebalance ``` -------------------------------- ### Run AVNU Paymaster Service Source: https://github.com/cartridge-gg/paymaster/blob/main/README.md Start the AVNU Paymaster service using a JSON profile file. Ensure you have the profile path correct. ```bash cargo run --release --bin paymaster-service --profile=path/to/my-profile.json ``` -------------------------------- ### Start Redis for Development Source: https://github.com/cartridge-gg/paymaster/blob/main/CLAUDE.md Command to start Redis in detached mode using Docker Compose, which is required by the service on port 6379. ```bash # Start Redis for development docker-compose up -d # This starts Redis on port 6379 as required by the service ``` -------------------------------- ### Integrate Paymaster with starknet.js Source: https://github.com/cartridge-gg/paymaster/blob/main/README.md Example of integrating the AVNU Paymaster with starknet.js for executing paymaster transactions. Allows users to pay fees in ERC-20 tokens. ```typescript const paymasterRpc = new PaymasterRpc({ nodeUrl: "https://sepolia.paymaster.avnu.fi", headers: {'x-paymaster-api-key': 'IF_NEEDED'}, }); // const paymasterRpc = new PaymasterRpc({ default: true }); const account = await WalletAccount.connect(STARKNET_PROVIDER, STARKNET_WINDOW_OBJECT_WALLET, undefined, paymasterRpc); const result = await account.executePaymasterTransaction( [CALLS], { feeMode: { mode: "default", gasToken: "" } } ); const { transaction_hash } = result; ``` -------------------------------- ### Run AVNU Paymaster Docker Container Source: https://github.com/cartridge-gg/paymaster/blob/main/README.md Run the AVNU Paymaster service using a Docker container. This example shows how to pull the latest image and run it with a default profile. ```bash docker pull avnulabs/paymaster:latest docker run --rm -d -p 12777:12777 -e PAYMASTER_PROFILE=/profiles/default.json -v /paymaster/profiles/main.json:/profiles/default.json --name paymaster paymaster ``` -------------------------------- ### Build and Lint Project Source: https://github.com/cartridge-gg/paymaster/blob/main/website/README.md Build the project for production and run linting and formatting checks. ```bash yarn build yarn format && yarn lint ``` -------------------------------- ### Project Structure Overview Source: https://github.com/cartridge-gg/paymaster/blob/main/website/README.md Displays the directory and file structure of the website project. ```tree website/ ├── public/ │ ├── avnu_paymaster.mp4 # Promotional video │ └── og-image.png # Open Graph image ├── src/ │ ├── App.jsx # Main application component │ ├── main.jsx # Application entry point │ ├── index.css # Global styles and animations │ └── config/ │ └── app-config.js # Configuration (links, SEO, etc.) ├── package.json # Dependencies and scripts ├── vite.config.js # Vite configuration ├── tailwind.config.js # Tailwind CSS configuration ├── postcss.config.js # PostCSS configuration └── eslint.config.js # ESLint configuration ``` -------------------------------- ### Build AVNU Paymaster Service from Source Source: https://github.com/cartridge-gg/paymaster/blob/main/README.md Build the AVNU Paymaster service binary from its Rust source code. This method is suitable if you need to compile from the repository. ```bash git clone https://github.com/cartridge-gg/paymaster cd paymaster cargo build --release --bin paymaster-service ``` -------------------------------- ### Build and Test Workspace Source: https://github.com/cartridge-gg/paymaster/blob/main/CLAUDE.md Commands to build the entire Rust workspace, specific crates, and run tests. Includes formatting and linting commands. ```bash # Build the entire workspace cargo build # Build specific crate cargo build -p paymaster-service # Run tests cargo test # Run tests for specific crate cargo test -p paymaster-starknet # Format code cargo fmt # Run linter cargo clippy ``` -------------------------------- ### Scarb Build and Test Commands Source: https://github.com/cartridge-gg/paymaster/blob/main/contracts/README.md Common commands for managing Starknet contracts using Scarb, including formatting, testing, and building. ```shell # Format scarb fmt ``` ```shell # Run the tests scarb test ``` ```shell # Build contracts scarb build ``` -------------------------------- ### Run Project Tests Source: https://github.com/cartridge-gg/paymaster/blob/main/CONTRIBUTING.md Execute all project tests to ensure code integrity and functionality. ```bash cargo test ``` -------------------------------- ### Clone the Paymaster Repository Source: https://github.com/cartridge-gg/paymaster/blob/main/CONTRIBUTING.md Clone the Paymaster repository to your local machine and navigate into the project directory. ```bash git clone https://github.com/avnu-labs/paymaster && cd paymaster ``` -------------------------------- ### Create a Feature Branch Source: https://github.com/cartridge-gg/paymaster/blob/main/CONTRIBUTING.md Before making changes, create a new branch for your feature. ```bash git checkout -b feature/your-feature-name ``` -------------------------------- ### Run Main Paymaster Service Source: https://github.com/cartridge-gg/paymaster/blob/main/CLAUDE.md Commands to run the main paymaster service, with an option to specify a configuration file. ```bash # Run the main paymaster service cargo run -p paymaster-service # Run with specific configuration PAYMASTER_CONFIG=config.json cargo run -p paymaster-service ``` -------------------------------- ### Check Code Formatting Source: https://github.com/cartridge-gg/paymaster/blob/main/CONTRIBUTING.md Ensure your code adheres to Rust formatting standards without applying changes. ```bash cargo fmt --check ``` -------------------------------- ### Forwarder Contract Interface Source: https://github.com/cartridge-gg/paymaster/blob/main/contracts/README.md Defines the interface for the Forwarder contract, including methods for managing gas fees recipients and executing user calls with or without sponsorship. ```cairo #[starknet::interface] trait IForwarder { fn get_gas_fees_recipient(self: @TContractState) -> ContractAddress; fn set_gas_fees_recipient(ref self: TContractState, gas_fees_recipient: ContractAddress) -> bool; fn execute( ref self: TContractState, account_address: ContractAddress, entrypoint: felt252, calldata: Array, gas_token_address: ContractAddress, gas_amount: u256, ) -> bool; fn execute_sponsored( ref self: TContractState, account_address: ContractAddress, entrypoint: felt252, calldata: Array, sponsor_metadata: Array, ) -> bool; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.