{"id":18645856,"url":"https://github.com/interledger/open-payments-snippets","last_synced_at":"2025-04-11T12:31:38.478Z","repository":{"id":199723850,"uuid":"694652396","full_name":"interledger/open-payments-snippets","owner":"interledger","description":"Open Payments code snippets using the Node SDK","archived":false,"fork":false,"pushed_at":"2025-01-27T10:04:45.000Z","size":82,"stargazers_count":38,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T10:38:07.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://openpayments.guide/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interledger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-21T12:29:10.000Z","updated_at":"2025-01-27T10:04:52.000Z","dependencies_parsed_at":"2024-02-09T05:27:46.757Z","dependency_job_id":"f88a3909-c991-4400-b2d8-05bd8567fc4b","html_url":"https://github.com/interledger/open-payments-snippets","commit_stats":null,"previous_names":["interledger/open-payments-snippets"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Fopen-payments-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Fopen-payments-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Fopen-payments-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledger%2Fopen-payments-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interledger","download_url":"https://codeload.github.com/interledger/open-payments-snippets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401966,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:17:28.628Z","updated_at":"2025-04-11T12:31:38.171Z","avatar_url":"https://github.com/interledger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Payments Node SDK Snippets\n\nThese code snippets are intended for use with \u003ca href=\"https://rafiki.money\" target=\"_blank\"\u003eRafiki Money\u003c/a\u003e. While\neveryone is welcome to use these code snippets as a reference, please note that they may need to be adapted to suit your\nparticular application.\n\n---\n\n### Prerequisites\n\n-   A preferred package manager (`npm`, `pnpm`, `yarn`)\n-   An active account on \u003ca href=\"https://rafiki.money\" target=\"_blank\"\u003eRafiki Money\u003c/a\u003e\n-   A payment pointer associated with your account\n-   Payment pointer keys should be generated (refer to [loading the private key](#loading-the-private-key))\n\n### Setup\n\nInstall dependencies:\n\n```sh\n# Using NPM\nnpm install\n\n# Using PNPM\npnpm install\n\n# Using Yarn\nyarn\n```\n\n### Loading the private key\n\nWhen generating the keys for a payment pointer on\n\u003ca href=\"https://rafiki.money/settings/developer-keys\" target=\"_blank\"\u003eRafiki Money Developer Keys section\u003c/a\u003e, the\nprivate key will be automatically downloaded to your machine. Please relocate the `private.key` file to the root\ndirectory of this repository.\n\nEnsure you are at the repository root and execute the following command in your terminal:\n\n```sh\ncp .env.example .env\n```\n\nOpen the newly created `.env` file and fill in the following variables:\n\n-   `WALLET_ADDRESS`\n-   `KEY_ID`\n\nNow that you have all the necessary components to initialize the authenticated Open Payments client, you're ready to\nbegin utilizing the code snippets.\n\n### Running a snippet\n\nFrom the repository's root you can execute the following scripts using your preferred package manager:\n\n| Script             | Description                                    |\n| ------------------ | ---------------------------------------------- |\n| grant              | Request a grant                                |\n| grant:continuation | Continuation request for a grant (interactive) |\n| grant:ip           | Request a grant for an incoming payment        |\n| grant:op           | Request a grant for an outgoing payment        |\n| grant:quote        | Request a grant for a quote                    |\n| ip:create          | Create an incoming payment                     |\n| ip:complete        | Complete an incoming payment                   |\n| ip:get             | Retrieve an incoming payment                   |\n| ip:list            | List incoming payments                         |\n| op:create          | Create an outgoing payment                     |\n| op:get             | Retrieve an outgoing payment                   |\n| op:list            | List outgoing payments                         |\n| quote:create       | Create a quote                                 |\n| quote:get          | Retrieve a quote                               |\n| wa:get             | Retrieve wallet address' information           |\n| wa:get-keys        | Retrieve wallet address' JWKs                  |\n| token:revoke       | Revoke a token                                 |\n| token:revoke:ip    | Revoke incoming payment token                  |\n| token:revoke:op    | Revoke outgoing payment token                  |\n| token:revoke:quote | Revoke quote token                             |\n| token:rotate       | Rotate a token                                 |\n| token:rotate:ip    | Rotate incoming payment token                  |\n| token:rotate:op    | Rotate outgoing payment token                  |\n| token:rotate:quote | Rotate quote token                             |\n\nExample:\n\n```sh\n# Using NPM\nnpm run grant\n\n# Using PNPM\npnpm grant\n\n# Using Yarn\nyarn grant\n```\n\n### Examples\n\n-   [Payment flow example](./examples/payment-flow.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledger%2Fopen-payments-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterledger%2Fopen-payments-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledger%2Fopen-payments-snippets/lists"}