{"id":13728299,"url":"https://github.com/Soneso/stellar-ios-mac-sdk","last_synced_at":"2025-05-08T00:31:34.089Z","repository":{"id":28572221,"uuid":"118758582","full_name":"Soneso/stellar-ios-mac-sdk","owner":"Soneso","description":"Stellar SDK for iOS \u0026 macOS - Swift, Stellar, Horizon, Soneso","archived":false,"fork":false,"pushed_at":"2025-04-23T07:45:16.000Z","size":2841,"stargazers_count":122,"open_issues_count":1,"forks_count":57,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-23T08:03:50.754Z","etag":null,"topics":["blockchain","cryptocurrency","horizon","ios","macos","sdk","stellar","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Soneso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2018-01-24T11:50:31.000Z","updated_at":"2025-04-23T07:42:24.000Z","dependencies_parsed_at":"2023-02-18T09:45:40.276Z","dependency_job_id":"abfdb40f-4411-48e9-97cd-dc52da0e21ba","html_url":"https://github.com/Soneso/stellar-ios-mac-sdk","commit_stats":{"total_commits":585,"total_committers":19,"mean_commits":"30.789473684210527","dds":"0.36239316239316244","last_synced_commit":"0037ab77a21bbeb755ef3ffa48c792d41eefb59b"},"previous_names":[],"tags_count":124,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soneso%2Fstellar-ios-mac-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soneso%2Fstellar-ios-mac-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soneso%2Fstellar-ios-mac-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soneso%2Fstellar-ios-mac-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soneso","download_url":"https://codeload.github.com/Soneso/stellar-ios-mac-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252681970,"owners_count":21787769,"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","cryptocurrency","horizon","ios","macos","sdk","stellar","swift"],"created_at":"2024-08-03T02:00:40.143Z","updated_at":"2025-05-08T00:31:29.066Z","avatar_url":"https://github.com/Soneso.png","language":"Swift","funding_links":[],"categories":["Developer Resources","Swift","开发者资源"],"sub_categories":[],"readme":"# stellar-ios-mac-sdk\n\nThe Soneso open source stellar SDK for iOS \u0026amp; Mac provides APIs to build transactions and connect to [Horizon](https://github.com/stellar/horizon).\n\n\n## Installation\n\n### Swift Package Manager\n\n#### Latest stable release:\n\n```swift\n.package(name: \"stellarsdk\", url: \"git@github.com:Soneso/stellar-ios-mac-sdk.git\", from: \"3.0.0\"),\n```\n\n#### Prepare for Protocol 22 update:\n\n```swift\n.package(url: \"https://github.com/Soneso/stellar-ios-mac-sdk\", exact: \"3.0.1-beta.2\"),\n```\n\nIf not loading (err: `cannot use bare repository`), then remove:\n\n```sh\n[safe]\n    bareRepository = explicit\n```\n\nfrom `~/.gitconfig`. See also this [SourceTree issue](https://forums.swift.org/t/fatal-cannot-use-bare-repository/75588). \n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate stellar SDK into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n#### Last stable release:\n\n```ruby\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'stellar-ios-mac-sdk', '~\u003e 3.0.0'\nend\n```\n\n#### Prepare for Protocol 22:\n\n```ruby\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'stellar-ios-mac-sdk', '~\u003e 3.0.1-beta.2'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod repo update\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](https://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate stellar-ios-mac-sdk into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n#### Last stable release:\n\n```ogdl\ngithub \"soneso/stellar-ios-mac-sdk\" ~\u003e 3.0.0\n```\n\n#### Prepare for Protocol 22:\n\n```ogdl\ngithub \"soneso/stellar-ios-mac-sdk\" ~\u003e 3.0.1-beta.2\n```\n\nRun `carthage update` to build the framework and drag the build `stellar-ios-mac-sdk.framework` into your Xcode project.\n\n\n### Manual\n\nAdd the SDK project as a subproject, and having the SDK as a target dependencies. Here is a step by step that we recommend:\n\n1. Clone this repo (as a submodule or in a different directory, it's up to you);\n2. Drag `stellarsdk.xcodeproj` as a subproject;\n3. In your main `.xcodeproj` file, select the desired target(s);\n4. Go to **Build Phases**, expand Target Dependencies, and add `stellarsdk` for iOS and `stellarsdk-macOS` for OSX;\n5. In Swift, `import stellarsdk` and you are good to go! \n\n\n## Quick Start\n\n### 1. Create a Stellar key pair\n\n#### 1.1 Random generation\n\n```swift\n// create a completely new and unique pair of keys.\nlet keyPair = try! KeyPair.generateRandomKeyPair()\n\nprint(\"Account Id: \\(keyPair.accountId)\")\n// GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB\n\nprint(\"Secret Seed: \\(keyPair.secretSeed!)\")\n// SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7\n```\n\n#### 1.2 Deterministic generation\n\nThe Stellar Ecosystem Proposal [SEP-005 Key Derivation Methods for Stellar Accounts](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md) describes methods for key derivation for Stellar. This improves key storage and moving keys between wallets and apps.\n\nGenerate mnemonic\n```swift\nlet mnemonic = WalletUtils.generate24WordMnemonic()\nprint(\"generated 24 words mnemonic: \\(mnemonic)\")\n// bench hurt jump file august wise shallow faculty impulse spring exact slush thunder author capable act festival slice deposit sauce coconut afford frown better\n```\n\nGenerate key pairs\n```swift\nlet keyPair0 = try! WalletUtils.createKeyPair(mnemonic: mnemonic, passphrase: nil, index: 0)\nlet keyPair1 = try! WalletUtils.createKeyPair(mnemonic: mnemonic, passphrase: nil, index: 1)\n\nprint(\"key pair 0 accountId: \\(keyPair0.accountId)\")\n// key pair 0 accountId: GC3MMSXBWHL6CPOAVERSJITX7BH76YU252WGLUOM5CJX3E7UCYZBTPJQ\n\nprint(\"key pair 0 secretSeed: \\(keyPair0.secretSeed!)\")\n// key pair 0 secretSeed: SAEWIVK3VLNEJ3WEJRZXQGDAS5NVG2BYSYDFRSH4GKVTS5RXNVED5AX7\n```\n\nGenerate key pairs with passphrase\n```swift\nlet keyPair0 = try! WalletUtils.createKeyPair(mnemonic: mnemonic, passphrase: \"p4ssphr4se\", index: 0)\nlet keyPair1 = try! WalletUtils.createKeyPair(mnemonic: mnemonic, passphrase: \"p4ssphr4se\", index: 1)\n``` \n\nBIP and master key generation\n```swift\nlet bip39Seed = Mnemonic.createSeed(mnemonic: mnemonic)\n\nlet masterPrivateKey = Ed25519Derivation(seed: bip39Seed)\nlet purpose = masterPrivateKey.derived(at: 44)\nlet coinType = purpose.derived(at: 148)\n\nlet account0 = coinType.derived(at: 0)\nlet keyPair0 = try! KeyPair.init(seed: Seed(bytes: account0.raw.bytes))\n\nlet account1 = coinType.derived(at: 1)\nlet keyPair1 = try! KeyPair.init(seed: Seed(bytes: account1.raw.bytes))\n```      \n\n### 2. Create an account\n\nAfter the key pair generation, you have already got the address, but it is not activated until someone transfers at least 1 lumen into it.\n\n#### 2.1 Testnet\n\nIf you want to play in the Stellar test network, the sdk can ask Friendbot to create an account for you as shown below:\n\n```swift\n// To create a test account, sdk.accounts.createTestAccount will send Friendbot the public key you created\nlet responseEnum = await sdk.accounts.createTestAccount(accountId: keyPair.accountId)\nswitch responseEnum {\ncase .success(let details):\n    print(details)\ncase .failure(let error):\n    StellarSDKLog.printHorizonRequestErrorMessage(tag:\"createTestAccount\", horizonRequestError: error)\n}\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L18)\n \n#### 2.2 Public net\n\nOn the other hand, if you would like to create an account in the public net, you should buy some Stellar Lumens from an exchange. See [Stellar's lumen buying guide](https://www.stellar.org/lumens/exchanges). When you withdraw the Lumens into your new account, the exchange will automatically create the account for you. However, if you want to create an account from another account of your own, you may run the following code:\n\n```swift\n// build the operation\nlet createAccount = try CreateAccountOperation(sourceAccountId: nil,\n                                           destinationAccountId: destinationAccountId,\n                                           startBalance: 2.0)\n\n// build the transaction\nlet transaction = try Transaction(sourceAccount: accountResponse,\n                                     operations: [createAccount],\n                                     memo: Memo.none)\n                                     \n// sign the transaction\ntry transaction.sign(keyPair: sourceAccountKeyPair, network: Network.testnet)\n                        \n// submit the transaction\nlet responseEnum = await sdk.transactions.submitTransaction(transaction: transaction)\nswitch responseEnum {\ncase .success(let details):\n    //...\ncase .destinationRequiresMemo(destinationAccountId: let destinationAccountId):\n    print(\"destination account \\(destinationAccountId) requires memo\")\ncase .failure(error: let error):\n    StellarSDKLog.printHorizonRequestErrorMessage(tag:\"submitTransaction\", horizonRequestError: error)\n}\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L37)\n\n### 3. Check account\n#### 3.1 Basic info\n\nAfter creating the account, we may check the basic information of the account.\n\n```swift\nlet responseEnum = await sdk.accounts.getAccountDetails(accountId: keyPair.accountId)\n\nswitch responseEnum {\ncase .success(let accountDetails):\n    // You can check the `balance`, `sequence`, `flags`, `signers`, `data` etc.\n    \n    for balance in accountDetails.balances {\n        switch balance.assetType {\n        case AssetTypeAsString.NATIVE:\n            print(\"balance: \\(balance.balance) XLM\")\n        default:\n            print(\"balance: \\(balance.balance) \\(balance.assetCode!) issuer: \\(balance.assetIssuer!)\")\n        }\n    }\n\n    print(\"sequence number: \\(accountDetails.sequenceNumber)\")\n\n    for signer in accountDetails.signers {\n        print(\"signer public key: \\(signer.key)\")\n    }\n\n    print(\"auth required: \\(accountDetails.flags.authRequired)\")\n    print(\"auth revocable: \\(accountDetails.flags.authRevocable)\")\n\n    for (key, value) in accountDetails.data {\n        print(\"data key: \\(key) value: \\(value.base64Decoded() ?? \"\")\")\n    }\ncase .failure(let error):\n    StellarSDKLog.printHorizonRequestErrorMessage(tag:\"account details\", horizonRequestError: error)\n}\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L92)\n\n#### 3.2 Check payments\n\nYou can check the most recent payments by:\n\n```swift\nlet responseEnum = await sdk.payments.getPayments(order:Order.descending, limit:10)\n\nswitch responseEnum {\ncase .success(let page):\n    for payment in page.records {\n        if let nextPayment = payment as? PaymentOperationResponse {\n            if (nextPayment.assetType == AssetTypeAsString.NATIVE) {\n                print(\"received: \\(nextPayment.amount) lumen\" )\n            } else {\n                print(\"received: \\(nextPayment.amount) \\(nextPayment.assetCode!)\" )\n            }\n            print(\"from: \\(nextPayment.from)\" )\n        }\n        else if let nextPayment = payment as? AccountCreatedOperationResponse {\n            //...\n        }\n        else if let nextPayment = payment as? PathPaymentStrictSendOperationResponse {\n            //...\n        }\n        // ...\n    }\ncase .failure(let error):\n    // ...\n}\n```\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L139)\n\nYou can use the parameters:`limit`, `order`, and `cursor` to customize the query. You can also get most recent payments for accounts, ledgers and transactions. \n\nFor example get payments for account:\n\n```swift\nsdk.payments.getPayments(forAccount:keyPair.accountId, order:Order.descending, limit:10)\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L171)\n\nHorizon has SSE support for push data. You can use it like this:\n\nfirst define your stream item somewhere to be able to hold the reference:\n```swift\nvar streamItem:OperationsStreamItem? = nil\n```\n\nthen create, assign and use it:\n```swift\nstreamItem = sdk.payments.stream(for: .paymentsForAccount(account: destinationAccountId, cursor: nil))\n\nstreamItem.onReceive { (response) -\u003e (Void) in\n    switch response {\n    case .open:\n        break\n    case .response(let id, let operationResponse):\n        if let paymentResponse = operationResponse as? PaymentOperationResponse {\n            switch paymentResponse.assetType {\n            case AssetTypeAsString.NATIVE:\n                print(\"Payment of \\(paymentResponse.amount) XLM from \\(paymentResponse.sourceAccount) received -  id \\(id)\" )\n            default:\n                print(\"Payment of \\(paymentResponse.amount) \\(paymentResponse.assetCode!) from \\(paymentResponse.sourceAccount) received -  id \\(id)\" )\n            }\n        }\n    case .error(let err):\n        print(err?.localizedDescription ?? \"Error\")\n    }\n}\n```\n\nlater you can close the stream item:\n\n```swift\nstreamItem.close()\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L201)\n\n#### 3.3 Check others\n\nJust like payments, you can check `assets`, `transactions`, `effects`, `offers`, `operations`, `ledgers` etc.  by:\n\n```swift\nsdk.assets.getAssets()\nsdk.transactions.getTransactions()\nsdk.effects.getEffects()\nsdk.offers.getOffers()\nsdk.operations.getOperations()\n// add so on ...\n```\n\n### 4. Building and submitting transactions\n\nExample \"send payment\":\n\n```swift\n// create the payment operation\nlet paymentOperation = PaymentOperation(sourceAccountId: sourceAccountId,\n                                        destinationAccountId: destinationAccountId,\n                                        asset: Asset(type: AssetType.ASSET_TYPE_NATIVE)!,\n                                        amount: 1.5)\n                                        \n// create the transaction containing the payment operation                                        \nlet transaction = try Transaction(sourceAccount: accountResponse,\n                                  operations: [paymentOperation],\n                                  memo: Memo.none)\n\n// sign the transaction\ntry transaction.sign(keyPair: sourceAccountKeyPair, network: Network.testnet)\n\n// submit the transaction\nlet responseEnum = await sdk.transactions.submitTransaction(transaction: transaction)\nswitch responseEnum {\ncase .success(let result):\n    // ...\ndefault:\n    // ...\n}\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L281)\n\nGet a transaction envelope from an XDR string:\n\n```swift\nlet xdrString = \"AAAAAJ/Ax+axve53/7sXfQY0fI6jzBeHEcPl0Vsg1C2tqyRbAAAAZAAAAAAAAAAAAAAAAQAAAABb2L/OAAAAAFvYwPoAAAAAAAAAAQAAAAEAAAAAo7FW8r8Nj+SMwPPeAoL4aUkLob7QU68+9Y8CAia5k78AAAAKAAAAN0NJcDhiSHdnU2hUR042ZDE3bjg1ZlFGRVBKdmNtNFhnSWhVVFBuUUF4cUtORVd4V3JYIGF1dGgAAAAAAQAAAEDh/7kQjZbcXypISjto5NtGLuaDGrfL/F08apZQYp38JNMNQ9p/e1Fy0z23WOg/Ic+e91+hgbdTude6+1+i0V41AAAAAAAAAAGtqyRbAAAAQNeY1rEwPynWnVXaaE/XWeuRnOHS/479J+Eu7s5OplSlF41xB7E8u9WzEItaOs167xuOVcLZUKBCBF1fnfzMEQg=\"\ndo {\n    let envelope = try TransactionEnvelopeXDR(xdr:xdrString)\n    let envelopeString = envelope.xdrEncoded\n} catch {\n    print(\"Invalid xdr string\")\n}\n```\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L342)\n\nGet a transaction object from an XDR string:\n\n```swift\nlet xdrString = \"AAAAAJ/Ax+axve53/7sXfQY0fI6jzBeHEcPl0Vsg1C2tqyRbAAAAZAAAAAAAAAAAAAAAAQAAAABb2L/OAAAAAFvYwPoAAAAAAAAAAQAAAAEAAAAAo7FW8r8Nj+SMwPPeAoL4aUkLob7QU68+9Y8CAia5k78AAAAKAAAAN0NJcDhiSHdnU2hUR042ZDE3bjg1ZlFGRVBKdmNtNFhnSWhVVFBuUUF4cUtORVd4V3JYIGF1dGgAAAAAAQAAAEDh/7kQjZbcXypISjto5NtGLuaDGrfL/F08apZQYp38JNMNQ9p/e1Fy0z23WOg/Ic+e91+hgbdTude6+1+i0V41AAAAAA==\"\ndo {\n    // Get the transaction object\n    let transaction = try Transaction(xdr:xdrString)\n    // Convert your transaction back to xdr\n    let transactionString = transaction.xdrEncoded\n} catch {\n    print(\"Invalid xdr string\")\n}\n```\n\n### 5. Using a federation server\n\nThe Stellar federation protocol defined in [SEP-002](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0002.md) maps Stellar addresses to more information about a given user. It’s a way for Stellar client software to resolve email-like addresses such as:\n\nname*yourdomain.com \n\ninto account IDs like: \n\nGCCVPYFOHY7ZB7557JKENAX62LUAPLMGIWNZJAFV2MITK6T32V37KEJU \n\nStellar addresses provide an easy way for users to share payment details by using a syntax that interoperates across different domains and providers.\n\n#### 5.1 Get federation server address for a domain\n\nGet the federation of your domain:\n\n```swift\nlet responseEnum = await Federation.forDomain(domain: domain, secure: secure)\nswitch responseEnum {\ncase .success(let federation):\n    //use the federation object to map your infos\ncase .failure(let error):\n    //something went wrong\n}\n```\n\n#### 5.2 Resolve a federation address to an account id\n\nResolve your addresses:\n\n```swift\nlet federation = Federation(federationAddress: \"https://YOUR_FEDERATION_SERVER\")\nlet responseEnum = await federation.resolve(address: \"bob*YOUR_DOMAIN\")\nswitch responseEnum {\ncase .success(let federationResponse):\n    if let accountId = federationResponse.accountId {\n        // use the account id\n    } else {\n        // there is no account id corresponding to the given address\n    }\ncase .failure(_):\n    // something went wrong\n}\n```\n\n### 6. Anchor-Client interoperability\n\nSee [SDK's SEP-006 docs](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/docs/SEP-0006.md)\n\n### 7. URI Scheme to facilitate delegated signing\n\nThe Stellar Ecosystem Proposal [SEP-007](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md) introduces a URI Scheme that can be used to generate a URI that will serve as a request to sign a transaction. The URI (request) will typically be signed by the user’s trusted wallet where she stores her secret key(s).\n\n#### 7.1 Generate a URI for sign transaction.\n\nGenerate a URI that will serve as a request to sign a transaction. The URI (request) will typically be signed by the user’s trusted wallet where he stores his secret key(s).\n\n```swift\n// create the payment operation\nlet paymentOperation = try! PaymentOperation(sourceAccountId: sourceAccountId,\n                                        destinationAccountId: destinationAccountId,\n                                        asset: Asset(type: AssetType.ASSET_TYPE_NATIVE)!,\n                                        amount: 1.5)\n\n// create the transaction containing the payment operation\nlet transaction = try! Transaction(sourceAccount: accountResponse,\n                                  operations: [paymentOperation],\n                                  memo: Memo.none)\n// create the URIScheme object\nlet uriSchemeBuilder = URIScheme()\n\n// get the URI with your transactionXDR\n// more params can be added to the url, check method definition\nlet uriScheme = uriSchemeBuilder.getSignTransactionURI(transactionXDR: transaction.transactionXDR, callBack: \"your_callback_api.com\")\nprint (uriScheme);\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L372)\n\n#### 7.2 Generate a URI for pay operation\n\nGenerate a URI that will serve as a request to pay a specific address with a specific asset, regardless of the source asset used by the payer.\n\n```swift\nlet uriSchemeBuilder = URIScheme()\n// more params can be added to the url, check method definition\nlet uriScheme = uriSchemeBuilder.getPayOperationURI(destination: \"GAK7I2E6PVBFF27NU5MRY6UXGDWAJT4PF2AH46NUWLFJFFVLOZIEIO4Q\", amount: 100, assetCode: \"BTC\", assetIssuer:\"GC2PIUYXSD23UVLR5LZJPUMDREQ3VTM23XVMERNCHBRTRVFKWJUSRON5\", callBack: \"your_callback_api.com\")\nprint (uriScheme);\n```\n\nSee also: [detailed code example](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/stellarsdk/stellarsdkTests/docs/QuickStartTest.swift#L424)\n\n#### 7.3 Sign a transaction from a given URI and send it to the network\n\nSigns a transaction from a URI and sends it to the callback url if present or to the stellar network otherwise.\n\n```swift\nlet responseEnum = await uriBuilder.signAndSubmitTransaction(forURL: uri, signerKeyPair: keyPair, transactionConfirmation: { (transaction) -\u003e (Bool) in\n    // here the transaction from the uri can be checked and confirmed if the signing should continue\n    return false\n})\n\nswitch responseEnum {\ncase .success:\n    // the transaction was successfully signed and sent\ncase .failure(error: let error):\n    // the transaction wasn't valid or it didn't pass the confirmation\n}\n```\n\n### 8. Stellar Web Authentication\n\nThis SEP defines the standard way for clients such as wallets or exchanges to create authenticated web sessions on behalf of a user who holds a Stellar account. A wallet may want to authenticate with any web service which requires a Stellar account ownership verification, for example, to upload KYC information to an anchor in an authenticated way as described in SEP-6. Stellar Web Authentication is described in [SEP-0010](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md).\n\n#### 8.1 Get a JWT token.\n\nAuthenticate with a server and get a JWT token.\n\n```swift\nlet authEndpoint = \"https://testanchor.stellar.org/auth\"\nlet serverSigningKey = \"GCUZ6YLL5RQBTYLTTQLPCM73C5XAIUGK2TIMWQH7HPSGWVS2KJ2F3CHS\"\nlet serverHomeDomain = \"testanchor.stellar.org\"\nlet userAccountId = \"GB4L7JUU5DENUXYH3ANTLVYQL66KQLDDJTN5SF7MWEDGWSGUA375V44V\"\nlet userSeed = \"SBAYNYLQFXVLVAHW4BXDQYNJLMDQMZ5NQDDOHVJD3PTBAUIJRNRK5LGX\"\n\n// Hold a strong reference to this to avoid being deallocated\nlet webAuth = WebAuthenticator(authEndpoint: authEndpoint, network: .testnet,\n                                serverSigningKey: serverSigningKey, serverHomeDomain: serverHomeDomain)\n\nlet signers = [try! KeyPair(secretSeed: self.userSeed)]\n\nlet responseEnum = await webAuth.jwtToken(forUserAccount: userAccountId, signers: signers)\nswitch responseEnum {\ncase .success(let jwtToken):\n    print(\"JWT received: \\(jwtToken)\")\ncase .failure(let error):\n    // ...\n}\n```\n\n#### 8.2 Create WebAuthenticator from stellar.toml\n\nCreates the WebAuthenticator by loading the web auth endpoint and the server signing key from the stellar.toml file of the given domain.\n\n```swift\nlet responseEnum = await WebAuthenticator.from(domain:\"yourserverhomedomain.com\", network: .testnet)\nswitch responseEnum {\ncase .success(let webAuth):\n    // use the web auth object\ncase .failure(let error):\n    //...\n}\n\n```\nThe Web Authenticator can now be used to get the JWT token (see: 8.1)\n\n\n### 9.  Txrep: human-readable low-level representation of Stellar transactions\nTxrep: human-readable low-level representation of Stellar transactions is described in [SEP-0011](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0011.md).\n\nFor more details have a look to our [Txrep examples](docs/SEP-0011.md)\n\n\n### 10. Hosted Deposit and Withdrawal\n\nHelps clients to interact with anchors in a standard way defined by [SEP-0024: Hosted Deposit and Withdrawal](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md).\n\nSee [SEP-0024 SDK documentation](https://github.com/Soneso/stellar-ios-mac-sdk/tree/master/docs/SEP-0024.md)\n\n### 11. Account recovery\n\nEnables an individual (e.g., a user or wallet) to regain access to a Stellar account as defined by \n[SEP-0030: Account Recovery](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0030.md).\n\nSee [SEP-0030: Account Recovery](https://github.com/Soneso/stellar-ios-mac-sdk/tree/master/docs/SEP-0030.md)\n\n### 12. Quotes\n\nsee [SEP-38 - Anchor RFQ API](https://github.com/Soneso/stellar-ios-mac-sdk/tree/master/docs/SEP-0038.md)\n\n### 13. Regulated Assets \n\nsee [SEP-08 - Regulated Assets](https://github.com/Soneso/stellar-ios-mac-sdk/tree/master/docs/SEP-0008.md)\n\n## Documentation and Examples\n\nYou can find more documentation and examples in the [docs](https://github.com/Soneso/stellar-ios-mac-sdk/tree/master/docs) folder.\n\n## Sample\n\nOur SDK is used by the open source [LOBSTR Vault](https://vault.lobstr.co). You can find the LOBSTR Vault source code [here](https://github.com/Lobstrco/Vault-iOS).\n\nOur SDK is also used by the [LOBSTR Wallet](https://lobstr.co).\n\n## Stellar Ecosystem Proposals (SEPs) supported\n\n- [SEP-0001](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md) - Stellar Info File (Toml)\n- [SEP-0002](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0002.md) - Federation protocol\n- [SEP-0005](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md) - Key Derivation Methods for Stellar Accounts\n- [SEP-0006](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md) - Anchor/Client interoperability\n- [SEP-0007](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md) - URI Scheme to facilitate delegated signing\n- [SEP-0008](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0008.md) - Regulated Assets\n- [SEP-0009](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0009.md) - Standard KYC / AML fields\n- [SEP-0010](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md) - Stellar Web Authentication\n- [SEP-0011](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0011.md) - Txrep\n- [SEP-0012](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0012.md) - Anchor/Client customer info transfer\n- [SEP-0024](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md) - Hosted Deposit and Withdrawal\n- [SEP-0030](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0030.md) - Account Recovery\n- [SEP-0038](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md) - Anchor RFQ API\n\n## Soroban support\n\nThis SDK provides [support for Soroban](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/soroban.md). \n\n## How to contribute\n\nPlease read our [Contribution Guide](https://github.com/Soneso/stellar-ios-mac-sdk/blob/master/CONTRIBUTING.md).\n\nThen please [sign the Contributor License Agreement](https://goo.gl/forms/hS2KOI8d7WcelI892).\n\n## License\n\nstellar-ios-mac-sdk is licensed under an Apache-2.0 license. See the [LICENSE](https://github.com/soneso/stellar-ios-mac-sdk/blob/master/LICENSE) file for details.\n\n## Donations\nSend lumens to: GANSYJ64BTHYFM6BAJEWXYLVSZVSHYZFPW4DIQDWJL5BOT6O6GUE7JM5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSoneso%2Fstellar-ios-mac-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSoneso%2Fstellar-ios-mac-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSoneso%2Fstellar-ios-mac-sdk/lists"}