{"id":25716315,"url":"https://github.com/interledgerjs/ilp-plugin-xrp-asym-client","last_synced_at":"2025-05-05T20:45:35.084Z","repository":{"id":72490915,"uuid":"116732924","full_name":"interledgerjs/ilp-plugin-xrp-asym-client","owner":"interledgerjs","description":"Client to Asymmetric XRP Paychan","archived":false,"fork":false,"pushed_at":"2018-12-07T22:58:42.000Z","size":353,"stargazers_count":6,"open_issues_count":4,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T23:31:34.299Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/interledgerjs.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":"2018-01-08T21:57:33.000Z","updated_at":"2025-01-31T13:22:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac1ace1b-f2c5-47b6-9802-5bbc784452de","html_url":"https://github.com/interledgerjs/ilp-plugin-xrp-asym-client","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-plugin-xrp-asym-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-plugin-xrp-asym-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-plugin-xrp-asym-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interledgerjs%2Filp-plugin-xrp-asym-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interledgerjs","download_url":"https://codeload.github.com/interledgerjs/ilp-plugin-xrp-asym-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252574434,"owners_count":21770400,"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":"2025-02-25T14:52:57.460Z","updated_at":"2025-05-05T20:45:35.077Z","avatar_url":"https://github.com/interledgerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ILP Plugin XRP Asym Client\n\nThis plugin allows a user to create a payment channel to a connector without\nthe connector having to add an entry to their list of peers. It is therefore\nvery useful for creating your own sub-connector. The client plugin first opens\na channel to the server, and then informs the server of this channel while\nproviding proof that it controls it. If the proof is satisfactory and the\nchannel contains at least 10 XRP (to prevent a DoS attack), the server will\nopen a channel back to the client for carrying incoming funds.\n\nPersistent state is not required to run this plugin, even though it makes use\nof payment channels. When your peer wants you to sign a new claim, they will\nfirst give you the best claim of yours that they have seen. This plugin will\nthen verify that claim and sign a higher one. In this way, the best outgoing\nclaim does not have to be stored.\n\nFor incoming funds, the connector will give you a signed claim for the amount\nthey owe you. This claim signature is verified against payment channel details,\nand against an internally kept balance. This balance is set by loading the\npayment channel details at every start up. If persistence is enabled, this\nincoming balance will be loaded from the provided store.\n\nILP Plugin XRP Asym Client is based off of\n[`ilp-plugin-btp`](https://github.com/interledgerjs/ilp-plugin-btp). The ILP\nPlugin XRP Asym Server is located\n[here](https://github.com/interledgerjs/ilp-plugin-xrp-asym-server).\n\n```js\nconst clientPlugin = new IlpPluginXrpAsymClient({\n  // The BTP address of the asymmetric server plugin. The `btp_secret`\n  // in here is hashed to become the account name. Note that if you switch\n  // XRP accounts, you also have to switch `btp_secret`s\n  server: 'btp+ws://:btp_secret@localhost:6666',\n\n  // Rippled server for client use\n  xrpServer: 'wss://s.altnet.rippletest.net:51233',\n\n  // XRP secret. The address can be dynamically determined from this,\n  // or can be specified as a separate option.\n  secret: 'ss1oM64ccuJuX9utz5pdPRuu5QKMs',\n\n  // A store can be optionally passed in to save claims in case of a crash.\n  // If no store is present, then the best claim will be submitted on plugin\n  // disconnect, as well as once every five minutes (interval is configurable\n  // via claimInterval)\n  _store: new Store(),\n\n  // Interval on which to claim funds from channel. Defaults to 5 minutes.\n  claimInterval: 5 * 60 * 1000\n})\n```\n\n# Interfaucet example\n\nFull example of obtaining money from the Interfaucet using this plugin:\n```js\nconst Plugin = require('.')\nconst crypto = require('crypto')\nconst IlDcp = require('ilp-protocol-ildcp')\nconst IlpPacket = require('ilp-packet')\nfunction sha256(preimage) { return crypto.createHash('sha256').update(preimage).digest() }\n\nconst plugin = new Plugin({\n  xrpServer: 'wss://s.altnet.rippletest.net:51233',\n  secret: 'sspPGRjcBXT9UBxewQUJKcWZCR1zC',\n\n  // Interval on which to claim funds from channel. Defaults to 5 minutes.\n  claimInterval: 5 * 60 * 1000,\n  server: 'btp+wss://:token@amundsen.ilpdemo.org:1801'\n})\nconsole.log('connecting')\nplugin.connect().then(async () =\u003e {\n  console.log('connected')\n  const request = IlDcp.serializeIldcpRequest()\n  const response = await plugin.sendData(request)\n  const info = IlDcp.deserializeIldcpResponse(response)\n  const fulfillment = crypto.randomBytes(32)\n  const condition = sha256(fulfillment)\n  console.log(`Now go to https://interfaucet.ilpdemo.org/?address=${info.clientAddress}\u0026condition=${condition.toString('hex')}`)\n  plugin.registerDataHandler(packet =\u003e {\n    const prepare = IlpPacket.deserializeIlpPrepare(packet)\n    console.log(prepare)\n    return IlpPacket.serializeIlpFulfill({ fulfillment: fulfillment, data: Buffer.from([]) })\n  })\n  plugin.registerMoneyHandler(packet =\u003e {\n    console.log('got money!', packet)\n    plugin.disconnect()\n  })\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledgerjs%2Filp-plugin-xrp-asym-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterledgerjs%2Filp-plugin-xrp-asym-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterledgerjs%2Filp-plugin-xrp-asym-client/lists"}