Skip to main content

Python SDK for ApePay

Project description

ApePay

Ape Framework

A smart contract payment system built for automated service management

About

See the blog post to learn more about ApePay!

Documentation

Coming soon!

Contributing

ApePay is open source and we welcome all contributors! Check out the following to get started.

TODOs:

  • Initial implementation
  • Documentation
  • Live testing on Sepolia
  • Production deployment on Arbitrum
  • Frontend management console, for managing subscriptions

Setup (Python)

First, install Ape

Second, make sure to install the plugins:

$ ape plugins install . --upgrade

Next, prior to installing the SDK package, you have to compile the project:

$ ape compile
The SDK package relies on a soft link in [`./sdk/py/apepay/manifest.json`](./sdk/py/apepay/manifest.json)

Lastly, install the SDK package via:

$ poetry install

Then you are ready to contribute!

Setup (JS)

In order to contribute to the JS SDK and React component library, or to build the demo app, you need to first follow the Python Setup instructions to compile the smart contract package.

Next, you need install the node packages for development:

$ npm install

In order to work on the React component library, you need to compile the JS SDK:

$ npm run build --workspace=sdk/js

In order to work on the Demo app, you need to compile the JS SDK (like above) as well as compile the React component library:

$ npm run build --workspace=ui/lib

Then you are ready to contribute!

To run the demo app in development mode, do the following:

$ npm run dev --workspace=ui/app

To build the demo app for production, do the following:

$ npm run build --workspace=ui/app

Testing

To run tests, just use Ape:

$ ape test

To see gas usage, add the --gas flag:

$ ape test --gas

Scripts

To deploy a StreamManager (for testing purposes), run:

$ ape run deploy manager [TOKEN_ADDRESS [...]]
# Or if `ape tokens` is installed with a valid tokenlist
$ ape run deploy manager [TOKEN_SYMBOL [...]]

To deploy the StreamFactory (for production use), run:

$ ape run deploy factory

To deploy a Token (for testing use only), run:

$ ape run deploy token
This test token has an unauthenticated mint, please do not use in production!

To run the demo ApePay cluster daemon, first run a node like anvil:

$ anvil --derivation-path "m/44'/60'/0'/" --block-time 1 --prune-history

NOTE: the --derivation-path flag makes ape's test accounts match anvil's

Then run the daemon:

$ silverback run scripts.daemon:app --network ::foundry --account TEST::0

After that, it's suggested to start ape console and create a stream to watch the daemon react

Publishing

Given the monorepo structure, it's a bit more challenging to distribute all the packages in this repo.

Contracts

TBD

Python SDK

To publish the Python package, there are 5 steps.

# 1. Install everything
$ poetry install`
# 2. Compile the package manifest
$ ape compile
# 3. Copy the package manifest to the Python SDK folder
$ cp .build/__local__.json sdk/py/apepay/manifest.json
# 4. Build the Python SDK with Poetry
$ poetry build
# 5. Publish the package
$ poetry publish

NOTE: make sure to revision the package before publishing, or it will fail.

Javscript SDK and React component library

To publish the JS SDK, do the following:

# 1. Install everything
$ npm install --all-workspaces
# 2. Build SDK
$ npm run build --workspace=sdk/js
# 3. Publish SDK
$ npm publish --workspace=sdk/js

NOTE: make sure to revision the package before publishing, or it will fail.

TO publish the React Component library, do the same thing as the SDK exepct use the ui/lib workspace.

Demo App and Management Console

TBD

License

ApePay is licensed Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apepay-0.2.2.tar.gz (50.6 kB view details)

Uploaded Source

Built Distribution

apepay-0.2.2-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file apepay-0.2.2.tar.gz.

File metadata

  • Download URL: apepay-0.2.2.tar.gz
  • Upload date:
  • Size: 50.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.10 Linux/6.2.0-32-generic

File hashes

Hashes for apepay-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c5df0b54515ebdf586905fb9bec03d5195ec03443960a1579d5948a320dd516e
MD5 d02cd654b4a21e599e9a5f3db8e58237
BLAKE2b-256 d853aa49671b1528749b1ca907759b3ebd7b52656a95d3205358028016b6db85

See more details on using hashes here.

File details

Details for the file apepay-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: apepay-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.10 Linux/6.2.0-32-generic

File hashes

Hashes for apepay-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2d8b991c2901276258c03853bc90f129983cdf8f5fb69154f5e6adb9d1c1df5
MD5 8327f56033b82ac71c768d8563db9b44
BLAKE2b-256 060146a364fd776bad92789b3f85673f3d3dd4841dc2a9b4998a94ae317e1d37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page