Smart invoice builds trust between payer and payee by creating a secure neutral channel for transferring money
MIT License
Smart Invoice is an easy-to-use tool that empowers web3 freelancers with secure cryptocurrency invoicing, escrow services, and arbitration. Designed to streamline the payment process, Smart Invoice ensures that freelancers and clients can transact with confidence, knowing that funds are securely held in escrow until work is completed to satisfaction.
This project is organized as a pnpm monorepo, containing several packages to handle different aspects of the Smart Invoice protocol. Below is an overview of the key packages:
To get started with Smart Invoice, install the necessary dependencies using pnpm
:
pnpm install
Several packages in the Smart Invoice monorepo are published on npm and can be used directly in your project. Below are the installation commands for these packages:
constants: Install the constants package:
pnpm add @smartinvoicexyz/constants
graphql: Install the GraphQL package:
pnpm add @smartinvoicexyz/graphql
hooks: Install the React hooks package:
pnpm add @smartinvoicexyz/hooks
utils: Install the utilities package:
pnpm add @smartinvoicexyz/utils
types: Install the TypeScript types package:
pnpm add @smartinvoicexyz/types
forms: Install the forms package:
pnpm add @smartinvoicexyz/forms
ui: Install the ui package:
pnpm add @smartinvoicexyz/ui
shared: Install the shared utilities and components package:
pnpm add @smartinvoicexyz/shared
These packages can be integrated into your own projects to leverage the core functionalities of the Smart Invoice protocol.
We follow Semantic Versioning for all packages in the Smart Invoice monorepo. To keep versions synchronized across packages, we use syncpack
. After making changes and updating versions in package.json
, you can ensure consistency by running:
pnpx syncpack fix-mismatches
This command checks for version mismatches and updates them across the monorepo to maintain alignment.
Smart Invoice uses Changesets to manage versioning and publishing for the monorepo. Changesets provide a simple way to track changes to the various packages and ensure that proper versioning is applied before publishing updates.
Whenever you make changes to any of the packages in the monorepo, you need to create a changeset to document those modifications. Use the following command to create a new changeset:
pnpm changeset
You will be prompted to select which packages are affected by the change, and what kind of version bump (major, minor, patch) is required.
After completing the prompt, a markdown file will be created in the .changeset
folder, which details the changes made.
Once you've created a changeset, you can commit it to version control along with your code changes. Review the generated changeset markdown to ensure it correctly reflects the changes and intended version bumps.
When you're ready to release new versions of your packages, run the following command to bump the versions in package.json
files based on the changesets:
pnpm changeset version
This will update the package versions according to the changes you made in the .changeset
folder.
Once the versions are bumped, you can publish the updated packages to npm using:
pnpm changeset publish
This command will publish all packages in the monorepo that have had changes, using the version bumps defined in the changeset.
To ensure all package versions are synchronized and consistent across the monorepo, you can use syncpack
as described in the Versioning section.
All metadata uploaded to IPFS and saved as details in a Smart Invoice contract must adhere to the following schema:
{
projectName: "Project Name",
projectDescription: "Description of the project",
projectAgreement: [{
type: "https", // or "ipfs"
src: "https://urlToAgreement.com",
createdAt: "seconds since epoch"
}],
startDate: UNIX_TIMESTAMP,
endDate: UNIX_TIMESTAMP
}
type
and src
that must match exactly.Join our community on Discord for support, discussions, and updates about Smart Invoice.