{"id":18245050,"url":"https://github.com/edgeapp/edge-referral-manager","last_synced_at":"2025-04-08T18:49:33.648Z","repository":{"id":40851880,"uuid":"243852845","full_name":"EdgeApp/edge-referral-manager","owner":"EdgeApp","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-10T22:28:36.000Z","size":992,"stargazers_count":1,"open_issues_count":19,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-14T14:55:05.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/EdgeApp.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":"2020-02-28T20:55:39.000Z","updated_at":"2021-11-17T15:22:25.000Z","dependencies_parsed_at":"2023-10-11T00:48:46.013Z","dependency_job_id":"f6993788-7fb4-4338-afc2-c2beaf7b12b6","html_url":"https://github.com/EdgeApp/edge-referral-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-referral-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-referral-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-referral-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-referral-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EdgeApp","download_url":"https://codeload.github.com/EdgeApp/edge-referral-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247909137,"owners_count":21016475,"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-05T09:18:44.241Z","updated_at":"2025-04-08T18:49:33.619Z","avatar_url":"https://github.com/EdgeApp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# edge-referral-manager\n\n\u003e A REST API for storing \u0026 sending money, powered by Edge\n\nThis repository implements a simple API for storing and sending money to a wallet on a web server. This can be useful for automated payouts, promotions, e-commerce, and various similar things.\n\nWe make this code available for free, but it does require an Edge SDK API key. We recommend closing external ports for security to prevent outside access and should only be used on your local server. Please copy `config.sample.json` to `config.json` and add your API key in there.\n\n## Install production\n\nInstall Node\n\n```sh\nsudo apt update -y\nsudo apt install curl -y\ncurl -sL https://deb.nodesource.com/setup_10.x | sudo bash -\nsudo apt install -y nodejs\n```\n\nInstall Yarn\n\n```sh\ncurl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -\necho \"deb https://dl.yarnpkg.com/debian/ stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list\nsudo apt-get update \u0026\u0026 sudo apt-get install yarn\n```\n\nClone Repo\n\n```sh\ngit clone https://github.com/EdgeApp/edge-referral-manager.git\n```\n\n## Manage server using forever-service\n\n You can then use `forever-service` or similar tools to install the software on your server machine.\n\n```sh\n# install:\nsudo forever-service install edgeRest --script lib/index.js --start\n\n# manage:\nsudo service edgeRest restart\nsudo service edgeRest stop\n\n# uninstall:\nsudo forever-service delete edgeRest\n```\n\n## Manual Testing\n\n`curl http://localhost:80/`\n\n## API Docs\n## Send cryptocurrency from a wallet to a public address\n\n```sh\n# nativeAmount is in satoshi so this will need to be multiplied by 100,000,000, see example for reference\n\n$.post('http://localhost:$PORT/spend/?type=$TYPE', ({ spendTargets: [{ nativeAmount, publicAddress }])\n\n# spend .000011 bitcoin to address 3JVeTHattdtGBAzWskiLzjeuojTb4Rjuui\nawait fetch('http://localhost:8008/spend/?type=bitcoin', {\n  body: JSON.stringify({ spendTargets: [{ \"1100\", \"3JVeTHattdtGBAzWskiLzjeuojTb4Rjuui\" }] }),\n  headers: {\n    'Content-Type': 'application/json'\n  },\n  method: 'POST'\n  })\n\n# spend result\n\u003e {\n\u003e     \"ourReceiveAddresses\": [\n\u003e        \"qqrzxway5u26205mzz5hk5mqerer9dxf8v0jqum5vf\"\n\u003e    ],\n\u003e    \"currencyCode\": \"BCH\",\n\u003e    \"txid\": \"2eea81e5bd42ad8ee5fde9a2923d3e8ec60914ae974071187aa197d4a45af341\",\n\u003e    \"date\": 1583270341.543,\n\u003e    \"blockHeight\": 0,\n\u003e    \"nativeAmount\": \"-11908\",\n\u003e    \"networkFee\": \"908\",\n\u003e    \"signedTx\": \"01000000011152fb90c4eeee7d97a7e4ec58647f0300c0d2a085e4cdfa291ae75865cebfd2010000006b48304502210099d8df18063a8ff865c7638bef8109e83067c8420cf06066bd6c93524392f01602202dc4e57174d3667b421afc3ae4ef1b1eaf12c23c3df74464f4ff3dbd18f118d04121020df58681fe35241fb04863933f47a148f72fab6040255d8059500968e1f5cb3cffffffff02f82a0000000000001976a9143a92370920c0a20f126a6778d1700eb9e970695b88ac355b1c00000000001976a91406233ba4a715a53e9b10a97b5360c8f232b4c93b88ac00000000\"\n\u003e}\n```\n\n## REST API and Front-End App\n\nTo launch the REST API and the front-end application, just type `yarn start`.\n\nYou can also build the server code by running `yarn build`, which puts its output in the `lib` folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeapp%2Fedge-referral-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgeapp%2Fedge-referral-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeapp%2Fedge-referral-manager/lists"}