{"id":15611745,"url":"https://github.com/fukaoi/crystal-ripple","last_synced_at":"2025-04-28T12:21:48.117Z","repository":{"id":43046380,"uuid":"307666093","full_name":"fukaoi/crystal-ripple","owner":"fukaoi","description":"Ripple blockchain client sdk for crystal","archived":false,"fork":false,"pushed_at":"2025-03-05T22:56:46.000Z","size":217,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T09:31:32.542Z","etag":null,"topics":["blockchain","crystal","crystal-language","ripple","sdk"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fukaoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-27T10:40:05.000Z","updated_at":"2025-03-05T22:56:44.000Z","dependencies_parsed_at":"2023-01-29T23:15:38.904Z","dependency_job_id":"559dcd6b-ac20-42d3-998e-5649f980609d","html_url":"https://github.com/fukaoi/crystal-ripple","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":0.07692307692307687,"last_synced_commit":"c3e07421c945687b1e6ae8a556e79f36f03f9586"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukaoi%2Fcrystal-ripple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukaoi%2Fcrystal-ripple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukaoi%2Fcrystal-ripple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukaoi%2Fcrystal-ripple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fukaoi","download_url":"https://codeload.github.com/fukaoi/crystal-ripple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311385,"owners_count":21569018,"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":["blockchain","crystal","crystal-language","ripple","sdk"],"created_at":"2024-10-03T06:07:32.344Z","updated_at":"2025-04-28T12:21:48.097Z","avatar_url":"https://github.com/fukaoi.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crystal-ripple-sdk\n[![Build Status](https://travis-ci.org/solidum-particles/crystal-ripple-sdk.svg?branch=master)](https://travis-ci.org/solidum-particles/crystal-ripple-sdk)\n\nClient SDK for a rippled,  Can doing about creates accounts, setting multisig, sends payment.\nthis SDK dependency is [ripple-lib](https://github.com/ripple/ripple-lib), [crystal-nodejs](https://github.com/fukaoi/crystal-nodejs). And no need to install Node.JS, ripple-lib of the npm module, Because of the function of crystal-nodejs. If you want to know crystal-nodejs, read README of crystal-nodejs\n\nThe main function as Account, Multisig, Payment has existed, there always run verify function after submit the transaction on ripple network . So is the finallize response that return value of crystal-ripple-sdk \n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     ripple:\n       github: solidum-particles/crystal-ripple-sdk\n   ```\n\n2. Run `shards install`\n\n## NPM module installation\n\nwant to add npm module\n\n1. Add the npm module to `js/package.json`\n\n2. Run `make \u0026\u0026 make install`\n\n## Audit NPM mobule and JS code\n\nScan npm module for vulnerability and Perform static analyze of js code for security\n\n1. Run `make secure_check`\n\n## Usage\n\n### Account\n\n#### Set up network(testnet or mainnet)\n\n Only once call set_network() in an application\n\n```crystal\nRipple.set_network(Ripple::Network::Testnet)\n\nor \n\nRipple.set_network(Ripple::Network::Mainnet)\n```\n\nConnect to rippled URL(\"s.altnet.rippletest.net:51233\" or \"s1.ripple.com:443\")in default, But want to change URL\n\n```crystal\nRipple.set_network(Ripple::Network::Testnet, \"wss://xxxxxxxxxxxxxxxxxxx\")\n\nor \n\nRipple.set_network(Ripple::Network::Mainnet, \"wss://xxxxxxxxxxxxxxxxxxx\")\n```\n\n\n#### Generate an account for mainnet\n\n```crystal\nrequire \"ripple\"\n\nRipple.set_network(Ripple::Network::Mainnet)\nRipple::Account.generate_account\n\n# \u003cRipple::Response::Account:0x7ff4e11e19c0 \n# @address=\"rfCs6UPgyW9QEy7nHijAGUhv4neHggMmx6\", \n# @secret=\"spyJDTDjGJUV9Umd3tF93BzY8RshX\" \u003e\n```\n\n#### Generate an account for testnet\n\nCan receive payment 1000 XRP from testnet faucet when a created account\n\n```crystal\nrequire \"ripple\"\n\nRipple.set_network(Ripple::Network::Testnet)\nRipple::Account.generate_account\n\n# \u003cRipple::Response::Account:0x7f72ab31a9c0 \n# @address=\"rfu3t8HwXARgwKHBvmi5QANw4ta8khwbMY\", \n# @secret=\"shYtb9yWW8PHvB7oudt1Fw6B9hTvd\" \u003e\n```\n\n#### Get account info by address\n\n```crystal\nrequire \"ripple\"\n\nRipple::Account.get_info(\"rfu3t8HwXARgwKHBKmi5QANw4ta8khwbMY\")\n\n# \u003cRipple::Response::Account::Info:0x7f0629d4a280 \n# @sequence=1.0, \n# @xrpBalance=\"10000\", \n# @ownerCount=0.0, \n# @previousAffectingTransactionID=\"D281559B5CB4F943E724A6F4576F31798FB5F16BEFA2C3C7D95323504D7B81AC\", \n# @previousAffectingTransactionLedgerVersion=19481958.0\u003e\n```\n\n### Multisig\n\n#### Create signer list\n\n```crystal\nrequire \"ripple\"\n\nowner_account = \n{\n  address: \"rKN412L8bRyG3t6Gb3KasggrjdxgtAcU9g\",\n  secret:  \"shqf5DBf41QE1b3eeBU11KFizVsb4\",\n}\n \nsigners = \n[\n  {\n    address: \"r9VQQuGXQRLsQ6CUG2jmwPDr9cGyeczUiY\",\n    weight:  2,\n  },\n  {\n    address: \"r3bJteyQ9VU6gQPn5Ar6nMH9ELjUTY12f\",\n    weight:  1,\n  },\n]\n \nquorum = 3\n\nRipple::Multisig.create_signer_list(\n  owner_account,\n  signers,\n  quorum\n)\n \n# \u003cRipple::Response::Multisig:0x7f5346fa1dc0 \n# @resultCode=\"tesSUCCESS\", \n# @resultMessage=\"The transaction was applied. Only final in a validated ledger.\", \n# .... more values\n```\n\n#### Create signer list, Set customize fee\n\n```crystal\nrequire \"ripple\"\n\n# Can set customize fee\n \n\nowner_account = \n{\n  address: \"rKN412L8bRyG3t6Gb3KasggrjdxgtAcU9g\",\n  secret:  \"shqf5DBf41QE1b3eeBU11KFizVsb4\",\n}\n \nsigners = \n[\n  {\n    address: \"r9VQQuGXQRLsQ6CUG2jmwPDr9cGyeczUiY\",\n    weight:  2,\n  },\n  {\n    address: \"r3bJteyQ9VU6gQPn5Ar6nMH9ELjUTY12f\",\n    weight:  1,\n  },\n]\n \nquorum = 3\n\n# XRP\nfee = \"0.000012\"\n\nRipple::Multisig.create_signer_list(\n  owner_account,\n  signers,\n  quorum,\n  fee\n)\n \n# \u003cRipple::Response::Multisig:0x7f5346fa1dc0 \n# @resultCode=\"tesSUCCESS\", \n# @resultMessage=\"The transaction was applied. Only final in a validated ledger.\", \n# .... more values\n```\n\n### Payment\n\n#### Send payment\n\n```crystal\nrequire \"ripple\"\n\nowner_account = \n{\n  address: \"rKN412L8bRyG3t6Gb3KasggrjdxgtAcU9g\",\n  secret:  \"shqf5DBf41QE1b3eeBU11KFizVsb4\",\n}\n\nto_address = \"raNMGRcQ7McWzXYL7LisGDPH5D5Qrtoprp\"\n\n# XRP\namount = \"100\" \n\nRipple::Payment.send(\n  owner_account, \n  to_address,\n  amount\n)\n \n# \u003cRipple::Response::Payment:0x7fe8ce105c80 \n# @resultCode=\"tesSUCCESS\", \n# @resultMessage=\"The transaction was applied. Only final in a validated ledger.\",  \n# .... more values\n```\n\n#### Send payment together with tags, memots\n\n```crystal\nrequire \"ripple\"\n\nowner_account = \n{\n  address: \"rKN412L8bRyG3t6Gb3KasggrjdxgtAcU9g\",\n  secret:  \"shqf5DBf41QE1b3eeBU11KFizVsb4\",\n}\n\nto_address = \"raNMGRcQ7McWzXYL7LisGDPH5D5Qrtoprp\"\n\ntags = {source: \"410084811\", destination: \"21002010\"}\n\nmemos = {type: \"test\", data: \"spec demo data\", format: \"text/plain\"}\n\n# XRP\namount = \"100\" \n\nRipple::Payment.send(\n  owner_account, \n  to_address,\n  amount,\n  tags,\n  memos\n)\n \n# \u003cRipple::Response::Payment:0x7fe8ce105c80 \n# @resultCode=\"tesSUCCESS\", \n# @resultMessage=\"The transaction was applied. Only final in a validated ledger.\",  \n# .... more values\n```\n\n#### Send payment by multisig\n\nCase send payment by multisig, use send_by_multisig method \n\n```crystal\nrequire \"ripple\"\n\nowner_account = \n{\n  address: \"rKN412L8bRyG3t6Gb3KasggrjdxgtAcU9g\",\n  secret:  \"shqf5DBf41QE1b3eeBU11KFizVsb4\",\n}\n\nto_address = \"raNMGRcQ7McWzXYL7LisGDPH5D5Qrtoprp\"\n\nsigners =\n[\n  {\n    secret:  \"snKL7oepViqLduoqtTBygTrZ93CDB\",\n    address: \"rhjH5BdaH4xen4uWQQPH39xMMHgz3N45Hx\",\n  },\n  {\n    secret:  \"snHdYhJWoxTyVoRchFdgcyKkTK24X\",\n    address: \"rsHbJ4gaxL8GYVDjZmWYixiRXsVHehLJhQ\",\n  },\n]\n\n# XRP\namount = \"100\" \n\nRipple::Payment.send_by_multisig(\n  owner_account, \n  to_address,\n  amount,\n  signers\n)\n \n# \u003cRipple::Response::Payment:0x7fe8ce105c80 \n# @resultCode=\"tesSUCCESS\", \n# @resultMessage=\"The transaction was applied. Only final in a validated ledger.\",  \n# .... more values\n```\n\n\n## Development\n\n#### JS codes\n\nJsClass is defined fat code, common logic code\n\n\u003esource: src/ripple/js_class/*\n\n* Ripple::JsClass::Account  \n* Ripple::JsClass::Multisig  \n* Ripple::JsClass::Payment  \n\n\n#### Response types\n\nBe Converted to Ripple::Response class from all responses of ripple-lib\n\n\u003esource: src/ripple/response/*\n\n* Ripple::Response::Account\n* Ripple::Response::Memos\n* Ripple::Response::Multisig\n* Ripple::Response::Payment\n* Ripple::Response::Settings\n* Ripple::Response::Verify\n\n#### Error types\n\n\u003esource: src/ripple.cr\n\n\nResponseError\n\n* Raised exception, If the empty response from ripple-lib\n\nValidationError\n\n* Raised this exception in two cases,  one it when is returned key \"validError\"  in JS code, two  it when did validation error in Crystal code \n\n#### Create address in command line\n\na wordy command, but you can write with one liner.Changing Mainnet and Testnet is \n only change of param(Ripple::Network)  in set_network() method\n\n* testnet: \n\n```crystal\ncrystal eval 'require \"./src/ripple\";Ripple.set_network(Ripple::Network::Testnet);p Ripple::Account.generate_account'\n```\n\n* mainnet: \n\n```crystal\ncrystal eval 'require \"./src/ripple\";Ripple.set_network(Ripple::Network::Mainnet);p Ripple::Account.generate_account'\n```\n\n\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/solidum-particles/crystal-ripple-sdk/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [fukaoi](https://github.com/fukaoi) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffukaoi%2Fcrystal-ripple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffukaoi%2Fcrystal-ripple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffukaoi%2Fcrystal-ripple/lists"}