Coder Social home page Coder Social logo

seabed-labs / pre-authorized-debit Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 2.77 MB

A public good pre-authorized debit program on Solana. Enables single and recurring scheduled debits from a token account.

Home Page: https://docs.seabed.so/open-source-primitives/pre-authorized-debit-v1

License: Apache License 2.0

Rust 7.25% TypeScript 92.06% JavaScript 0.29% Shell 0.02% CSS 0.39%
solana solana-program solana-token solana-debits solana-subscriptions approve delegate permit2 spl-token multi-delegate

pre-authorized-debit's Introduction

Pre Authorized Debit

CI Status

Tests

SDK Code Coverage

SDK Coverage - Statements

The Pre Authorized Debit (PAD) program is a Solana primitive to extend functionality of a token account with pre-authorized debits (an advanced form of multi delegation or delegate multiplexing which we call smart delegation). The PAD program supports both spl token program and token program 22.

User funds remain non-custodial in their own token accounts, adding a smart-delegate account as their delegate.

Users and protocols agree on and create a pre-authorization account to track the pre-authorized debit state. Pre-authorized debits can be one-time or recurring.

Pre-authorized debt authorities can debit from a users token account using their pre-authorization and the smart-delegate. Debt authorities can debit from a token account as long as:

  • The pre-authorized debit is ready for debiting
  • The token account has the necessary funds needed for the debit
  • The smart-delegate remains the delegate of the token-account

Users at any time withdraw from their token-account as the owner or pause a pre-authorized debit.

Planned Future Work

To prevent accidental removals of the token-account delegate, an ancillary program is planned for future development, mimicking a similar feature set as the associated token program.

Docs

Developer docs and integration guides are viewable at our gitbook.

Contributing Guide

๐Ÿšง๐Ÿšง๐Ÿšง In Progress ๐Ÿšง๐Ÿšง๐Ÿšง

Developers

All anchor integration tests live under program-tests.

All anchor programs live under programs.

All SDK's live under sdk, and their tests live in their nested sdk folder (sdk/<name>/tests).

โ”œโ”€โ”€ program-tests
โ”‚  โ””โ”€โ”€ pre-authorized-debit-v1
โ”œโ”€โ”€ programs
โ”‚  โ””โ”€โ”€ pre-authorized-debit-v1
โ”œโ”€โ”€ scripts
โ”‚  โ”œโ”€โ”€ package.json
โ”‚  โ”œโ”€โ”€ README.md
โ”‚  โ””โ”€โ”€ test.js
โ”œโ”€โ”€ sdk
โ”‚  โ””โ”€โ”€ pre-authorized-debit-v1

Requirements

  • rust 1.72.0
  • node 18.17.1
  • yarn 3.6.0
  • solana 1.16.10
  • anchor 0.28.0

Getting Started

yarn install
yarn test

pre-authorized-debit's People

Contributors

sol-matcha avatar sol-mocha avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.