{"id":22030879,"url":"https://github.com/softwareengineerchris/monetaryexchange","last_synced_at":"2025-03-23T11:26:11.328Z","repository":{"id":63920547,"uuid":"212408812","full_name":"SoftwareEngineerChris/MonetaryExchange","owner":"SoftwareEngineerChris","description":"💱 Provides exchange rates between currencies and converts monetary amounts - Swift Micro Package","archived":false,"fork":false,"pushed_at":"2019-11-21T14:04:29.000Z","size":260,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T01:45:18.605Z","etag":null,"topics":["cross-rates","currency","exchange-rates","fixer","fixer-client","fixerio","micropackage","monetary","money","swift"],"latest_commit_sha":null,"homepage":"https://softwareengineerchris.github.io/MonetaryExchange/","language":"Swift","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/SoftwareEngineerChris.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}},"created_at":"2019-10-02T18:07:42.000Z","updated_at":"2024-08-06T20:59:49.000Z","dependencies_parsed_at":"2022-11-29T10:45:15.943Z","dependency_job_id":null,"html_url":"https://github.com/SoftwareEngineerChris/MonetaryExchange","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwareEngineerChris%2FMonetaryExchange","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwareEngineerChris%2FMonetaryExchange/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwareEngineerChris%2FMonetaryExchange/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwareEngineerChris%2FMonetaryExchange/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SoftwareEngineerChris","download_url":"https://codeload.github.com/SoftwareEngineerChris/MonetaryExchange/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245093477,"owners_count":20559738,"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":["cross-rates","currency","exchange-rates","fixer","fixer-client","fixerio","micropackage","monetary","money","swift"],"created_at":"2024-11-30T08:11:25.706Z","updated_at":"2025-03-23T11:26:11.306Z","avatar_url":"https://github.com/SoftwareEngineerChris.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MonetaryExchange\n\n[![Build Status](https://app.bitrise.io/app/57e424b934229804/status.svg?token=zDHT8jgVf-wPoK5oVp7LcA\u0026branch=master)](https://app.bitrise.io/app/57e424b934229804)\n[![Docs](https://softwareengineerchris.github.io/MonetaryExchange/badge.svg)](https://softwareengineerchris.github.io/MonetaryExchange)\n[![SPM](https://img.shields.io/badge/SPM-Supported-informational)](#)\n[![Swift Version](https://img.shields.io/badge/Swift%20Version-5.1-informational)](#)\n\n`Exchange` provides exchange rates between currencies. It can also convert `MonetaryAmount` values into\nthose of different `Currency` values.\n\n## Installation\n\n### Swift Package Manager\n```swift\ndependencies: [\n    .package(url: \"https://github.com/SoftwareEngineerChris/MonetaryExchange.git\", from: \"1.0.0\")\n]\n```\n\n## Decoding a Fixer.io JSON response\nAn `Exchange` can be decoded directly from a the [Fixer.io](https://fixer.io/) Latest Rates JSON response.\nSee [Fixer API Documentation](https://fixer.io/documentation#latestrates) for more information about its API usage.\n\n### Example using the Fixer Extension\n\n```swift\nExchange.Fixer.exchange(accessKey: \"YourFixerAccessKey\") { result in\n    switch result {\n        case let .success(exchange):\n            // We have an Exchange value\n\n        case let .failure(error):\n            // Something went wrong. Dig into the error.\n     }\n}\n```\nSee the documentation for `Exchange.Fixer` for more information.\n\n### Example using JSONDecoder Directly\n\n```swift\nlet exchange = try? JSONDecoder().decode(Exchange.self, from: fixerResponseData)\n```\n\nAlternatively, an `Exchange` can be constructed with a base currency and a dictionary of currency-rate pairs.\n\n## Cross-rates\n\nIf converting between two currencies which neither are the base currency, but each have a rate against the base currency,\nthen a cross-rate will be produced.\n\nFor example, if the base currency is _EUR_ but a rate for _GBP to USD_ is requested, a cross-rate will be used. i.e. _GBP to EUR to USD_.\n\nSee the Collins Dictionary definition of [Cross-Rate](https://www.collinsdictionary.com/dictionary/english/cross-rate)\nfor more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwareengineerchris%2Fmonetaryexchange","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwareengineerchris%2Fmonetaryexchange","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwareengineerchris%2Fmonetaryexchange/lists"}