{"id":19909013,"url":"https://github.com/dyne/social-wallet-api","last_synced_at":"2025-12-12T01:24:30.261Z","repository":{"id":62434664,"uuid":"103627094","full_name":"dyne/social-wallet-api","owner":"dyne","description":"Social Wallet REST API web interface","archived":false,"fork":false,"pushed_at":"2019-12-04T14:29:45.000Z","size":458,"stargazers_count":13,"open_issues_count":5,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-07T10:35:42.333Z","etag":null,"topics":["bitcoin","blockchain","clojure","rest-api","rpc","swagger","wallet"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dyne.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.markdown","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-15T07:21:18.000Z","updated_at":"2025-04-05T18:07:43.000Z","dependencies_parsed_at":"2022-11-01T21:02:29.498Z","dependency_job_id":null,"html_url":"https://github.com/dyne/social-wallet-api","commit_stats":null,"previous_names":["commonfare-net/social-wallet-api"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fsocial-wallet-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fsocial-wallet-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fsocial-wallet-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fsocial-wallet-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyne","download_url":"https://codeload.github.com/dyne/social-wallet-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252133719,"owners_count":21699585,"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":["bitcoin","blockchain","clojure","rest-api","rpc","swagger","wallet"],"created_at":"2024-11-12T21:14:09.585Z","updated_at":"2025-12-12T01:24:30.218Z","avatar_url":"https://github.com/dyne.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Social Wallet API\n\nThe Social Wallet API  is made to facilitate the integration of blockchain\nfunctions into existing front-end applications, providing an easy\nbackend of documented REST API endpoints that are validated and, in\ncase of error, report meaningful messages. It also gives the opportunity to add\nmetadata to transactions which can be very useful for grouping, labeling and filtering\nas well as adding some context.\n\nThe Social Wallet API allows to make calls to mongo db and to running\nblockchain nodes that are compatibile with Bitcoin Core and support\nthe generic Bitcoin RPC. Overtime more implemenations will be provided for\ndifferent distributed ledger implementations and storages.\n\nThe Social wallet API can also operate with only the DB without any blockchain connection,\nwhich is great for experimentation, testing or situations where the complexity of \na distributed ledger is not required.\n\n\u003ca href=\"https://www.dyne.org\"\u003e\u003cimg\nsrc=\"https://secrets.dyne.org/static/img/swbydyne.png\"\nalt=\"software by Dyne.org\"\ntitle=\"software by Dyne.org\" class=\"pull-right\"\u003e\u003c/a\u003e\n\n[Getting started](#Getting-Started) | [Prerequisites](#Prerequisites) | [Running](#Running-the-Social-Wallet-API) | [Running the tests](#Running-the-tests) | [Deployment](#Deployment) | [Todos](#Todos) | [Acknowledgements](#Acknowledgements) | [License](#License) | [change log](https://github.com/Commonfare-net/social-wallet-api/blob/master/CHANGELOG.markdown) \n\n[![Build Status](https://travis-ci.org/Commonfare-net/social-wallet-api.svg?branch=master)](https://travis-ci.org/Commonfare-net/social-wallet-api)\n[![Clojars Project](https://img.shields.io/clojars/v/social-wallet-api.svg)](https://clojars.org/social-wallet-api)\n[![Freecoin project stats](https://www.openhub.net/p/freecoin/widgets/project_thin_badge.gif)](https://www.openhub.net/p/freecoin)\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n\nThis REST API interface is so far meant for low-level access of\nwallets built using the [Freecoin toolkit](https://freecoin.dyne.org).\n\n[![Freecoin.dyne.org](https://freecoin.dyne.org/images/freecoin_logo.png)](https://freecoin.dyne.org)\n\n\n## Getting Started\n\n\u003cimg class=\"pull-right\"\nsrc=\"https://secrets.dyne.org/static/img/clojure.png\"\u003e\n\nThe Social Wallet API is written in Clojure and is fully\ncross-platform: one can run it locally on a GNU/Linux machine, as well\non Apple/OSX and MS/Windows.\n\n### Prerequisites\n\n\u003cimg class=\"pull-left\" src=\"https://secrets.dyne.org/static/img/leiningen.jpg\"\nstyle=\"padding-right: 1.5em\"\u003e\n\nPlease install\n1. A JDK. The software is tested on [openJDK](http://openjdk.java.net/) versions 7 and 8 as well as with [oracleJDK 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and 10. Make sure that the env var JAVA_HOME is set to the JDK install dir like [mentioned here](https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html).\n2. [MongoDB community edition](https://docs.mongodb.com/manual/administration/install-community/). The software has been tested on Mongo v3.6.4. Earlier versions might not work due to loss of precision (Decimal128 was not introduced).\n3. [leiningen](https://leiningen.org/) which is used for dependency management like:\n```\nmkdir ~/bin\nwget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O ~/bin/lein\nchmod +x ~/bin/lein\n```\n\nFor instance on Devuan systems one can install all necessary\ndependencies using apt and the following packages: `apt-get\nopenjdk-7-jdk libversioneer-clojure haveged`.\n\n### Running the Social Wallet API\n\nFirst of all check the configuration in\n`resources/social-wallet-api.yaml` and adjust its contents to your\nsetup. Here a sample configuration:\n\n```yaml\n# verbosity level of messages\nlog-level: debug\n\n# open freecoin specific section\nfreecoin:\n# indentation matters: mind the initial spaces of following sections\n  # If an apikey is added to the config, for that particular installation an apikey will be created, stored and required with every request. Device-id should be replaced with the device/client-app name/id.\n  apikey: device-id ## optional\n# configuration for the database holding local transactions\n  mongo:\n    host: localhost\n    port: 27017\n    db:   freecoin\n    currency: Commoncoin # You can set this to the name of the local currency to be used on the DB\n\n## All the configurations below are optional and multiple can be added\n\n# configuration of the 'faircoin' blockchain\n  faircoin:\n# visualised name of the currency\n    currency: fair\n# number of confirmations to consider a transaction as valid\n    number-confirmations: 6\n# frequency of confirmations checks in milliseconds\n    frequency-confirmations-millis: 20000\n# path to the rpc configuration holding username and password\n    rpc-config-path: /home/user/.faircoin2/faircoin.conf\n# deposit to an address watch expiration time in milliseconds\n    deposit-expiration-millis: 3600000\n# frequency of deposit checks in milliseconds\n    frequency-deposit-millis: 60000\n\n# configuration of the 'bitcoin' blockchain\n  bitcoin:\n# visualised name of the currency\n    currency: btc\n# number of confirmations to consider a transaction as valid\n    number-confirmations: 6\n# frequency of confirmations checks in milliseconds\n    frequency-confirmations-millis: 20000\n# path to the rpc configuration holding username and password\n    rpc-config-path: /home/user/.bitcoin/bitcoin.conf\n```\n\nOnce correctly configured, from inside the social-wallet-api source\ndirectory one can use various commands to run it live (refreshing live\nchanges to the code) using:\n\n- `lein ring server` (which will start and spawn a browser on it)\n- `lein ring server-headless` (will start without browser)\n\nOne can also use `lein uberjar` to build a standalone jar application,\nor `lein uberwar` to build a standalone war application ready to be\nserved from enterprise infrastructure using JBoss or Tomcat.\n\n## Running the tests\n\nTo run all tests one need to run\n` lein midje`\non the project dir\n\n#### Run only the fast tests\n\nSome of the tests are marked as slow. If you want to avoid running them you can either\n\n```\nlein midje :filter -slow\n```\n\nor use the alias\n\n```\nlein test-basic\n```\n\n\n## Deployment\n\nEven though there are many ways to deploy this software, a dockerised version is provided in this project. \nFor more details look into the [docker](docker) folder. Please keep in mind that we do not recommend docker for production\ndue to some security concerns. \n\n## Summary\n\nThis table summarizes which are the available methods for the different backends.\n\n| method                   | database | blockchain |\n|--------------------------|:--------:|:----------:|\n| `tags.list`              | ✅        | 🚫         |\n| `transactions(...).new`  | ✅        | 🚫         |\n| `transactions(...).list` | ✅        | ✅         |\n| `transactions(...).get`  | ✅        | ✅         |\n| `balance`                | ✅        | ✅         |\n| `label`                  | ✅        | ✅         |\n| `address`                | 🚫        | ✅         |\n| `withdraws.new`          | 🚫        | ✅         |\n| `deposits.new`           | 🚫        | ✅         |\n| `deposits.check`         | 🚫        | ✅         |\n\n\n## Articles \u0026 Guides\n\n- [Setup and running swapi with bitcoin v0.18](https://www.dyne.org/setup-and-running-swapi-with-bitcoin-v0-18/)\n\n## Todos\n\n- Multicurrency on the DB\n\n## Acknowledgements\n\nThe Social Wallet API is Free and Open Source research and development\nactivity funded by the European Commission in the context of\nthe\n[Collective Awareness Platforms for Sustainability and Social Innovation (CAPSSI)](https://ec.europa.eu/digital-single-market/en/collective-awareness) program. Social\nWallet API uses the\nunderlying [Freecoin-lib](https://github.com/dyne/freecoin-lib)\nblockchain implementation library and adopted as a component of the\nsocial wallet toolkit being developed for\nthe [Commonfare project](http://pieproject.eu) (grant nr. 687922) .\n\n\n## License\n\nThis project is licensed under the AGPL 3 License - see the [LICENSE](LICENSE) file for details\n\n#### Additional permission under GNU AGPL version 3 section 7.\n\nIf you modify Freecoin-lib, or any covered work, by linking or combining it with any library (or a modified version of that library), containing parts covered by the terms of EPL v 1.0, the licensors of this Program grant you additional permission to convey the resulting work. Your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of the libraries (dependencies) covered by the terms of EPL v 1.0 used as well as that of the covered work.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Fsocial-wallet-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyne%2Fsocial-wallet-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Fsocial-wallet-api/lists"}