Swiftpack.co - Cybrid-app/cybrid-api-bank-swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Cybrid-app.
Cybrid-app/cybrid-api-bank-swift v0.67.6
Swift client for the Cybrid Bank APIs
⭐️ 0
🕓 1 hour ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/Cybrid-app/cybrid-api-bank-swift.git", from: "v0.67.6")

Swift5 API client for CybridApiBankSwift

Cybrid API documentation

Welcome to Cybrid, an all-in-one crypto platform that enables you to easily build and launch white-label crypto products or services.

In these documents, you'll find details on how our REST API operates and generally how our platform functions.

If you're looking for our UI SDK Widgets for Web or Mobile (iOS/Android), generated API clients, or demo applications, head over to our Github repo.

💡 We recommend bookmarking the Cybrid LinkTree which contains many helpful links to platform resources.

Getting Started

This is Cybrid's public interactive API documentation, which allows you to fully test our APIs. If you'd like to use a different tool to exercise our APIs, you can download the Open API 3.0 yaml for import.

If you're new to our APIs and the Cybrid Platform, follow the below guides to get set up and familiar with the platform:

  1. Getting Started in the Cybrid Sandbox
  2. Getting Ready for Trading
  3. Running the Web Demo App (or, alternatively, Testing with Hosted Web Demo App)

In Getting Started in the Cybrid Sandbox, we walk you through how to use the Cybrid Sandbox to create a test bank and generate API keys. In Getting Ready for Trading, we walk through creating customers, customer identities, accounts, as well as executing quotes and trades.

If you've already run through the first two guides, you can follow the Running the Web Demo App guide to test our web SDK with your sandbox bank and customer.

Working with the Cybrid Platform

There are three primary ways you can interact with the Cybrid platform:

  1. Directly via our RESTful API (this documentation)
  2. Using our API clients available in a variety of languages (Angular, Java, Kotlin, Python, Ruby, Swift or Typescript)
  3. Integrating a platform specific SDK (Web, Android, iOS)

Our complete set of APIs allows you to manage resources across three distinct areas: your Organization, your Banks and your Identities. For most of your testing and interaction you'll be using the Bank API, which is where the majority of APIs reside.

The complete set of APIs can be found on the following pages:

API Description
Organization API APIs to manage organizations
Bank API APIs to manage banks (and all downstream customer activity)
Identities API APIs to manage organization and bank identities

For questions please contact Support at any time for assistance, or contact the Product Team for product suggestions.

Authenticating with the API

The Cybrid Platform uses OAuth 2.0 Bearer Tokens to authenticate requests to the platform. Credentials to create Organization and Bank tokens can be generated via the Cybrid Sandbox. Access tokens can be generated for a Customer as well via the Cybrid IdP as well.

An Organization access token applies broadly to the whole Organization and all of its Banks, whereas, a Bank access token is specific to an individual Bank. Customer tokens, similarly, are scoped to a specific customer in a bank.

Both Organization and Bank tokens can be created using the OAuth Client Credential Grant flow. Each Organization and Bank has its own unique Client ID and Secret that allows for machine-to-machine authentication.

A Bank can then generate Customer access tokens via API using our Identities API.

<font color="orange">⚠️ Never share your Client ID or Secret publicly or in your source code repository.

Your Client ID and Secret can be exchanged for a time-limited Bearer Token by interacting with the Cybrid Identity Provider or through interacting with the Authorize button in this document.

The following curl command can be used to quickly generate a Bearer Token for use in testing the API or demo applications.

# Example request when using Bank credentials
curl -X POST <api_idp_url>/oauth/token -d '{
    \"grant_type\": \"client_credentials\",
    \"client_id\": \"<Your Client ID>\",
    \"client_secret\": \"<Your Secret>\",
    \"scope\": \"<api_platform_bank_scopes>\"
  }' -H \"Content-Type: application/json\"

# When using Organization credentials set `scope` to '<api_platform_organization_scopes>'

<font color="orange">⚠️ Note: The above curl will create a bearer token with full scope access. Delete scopes if you'd like to restrict access.

Authentication Scopes

The Cybrid platform supports the use of scopes to control the level of access a token is limited to. Scopes do not grant access to resources; instead, they provide limits, in support of the least privilege principal.

The following scopes are available on the platform and can be requested when generating either an Organization, Bank or Customer token. Generally speaking, the Read scope is required to read and list resources, the Write scope is required to update a resource and the Execute scope is required to create a resource.

Resource Read scope (Token Type) Write scope (Token Type) Execute scope (Token Type)
Account accounts:read (Organization, Bank, Customer) accounts:execute (Bank, Customer)
Bank banks:read (Organization, Bank) banks:write (Organization, Bank) banks:execute (Organization)
Customer customers:read (Organization, Bank, Customer) customers:write (Bank, Customer) customers:execute (Bank)
Deposit Address deposit_addresses:read (Organization, Bank, Customer) deposit_addresses:write (Bank, Customer) deposit_addresses:execute (Bank, Customer)
External Bank Account external_bank_accounts:read (Organization, Bank, Customer) external_bank_accounts:write (Bank, Customer) external_bank_accounts:execute (Bank, Customer)
Organization organizations:read (Organization) organizations:write (Organization)
Price prices:read (Bank, Customer)
Quote quotes:read (Organization, Bank, Customer) quotes:execute (Bank, Customer)
Reward rewards:read (Bank, Customer) rewards:execute (Bank)
Trade trades:read (Organization, Bank, Customer) trades:execute (Bank, Customer)
Transfer transfers:read (Organization, Bank, Customer) transfers:execute (Bank, Customer)
Workflow workflows:read (Organization, Bank, Customer) workflows:execute (Bank, Customer)

Available Endpoints

The available APIs for the Identity, Organization and Bank API services are listed below:

API Service Model API Endpoint Path Description
Identity Bank /api/bank_applications Create and list banks
Identity CustomerToken /api/customer_tokens Create customer JWT access tokens
Identity Organization /api/organization_applications Create and list organizations
Organization Organization /api/organizations APIs to retrieve and update organization name
Bank Account /api/accounts Create and list accounts, which hold a specific asset for a customers
Bank Asset /api/assets Get a list of assets supported by the platform (ex: BTC, ETH)
Bank Bank /api/banks Create, update and list banks, the parent to customers, accounts, etc
Bank BankVerificationKey /api/bank_verification_keys Create, list and retrive verification keys, used for signing identities
Bank Customer /api/customers Create and list customers
Bank DepositAddress /api/deposit_addresses Create, get and list deposit addresses
Bank ExternalBankAccount /api/external_bank_accounts Create, get and list external bank accounts, which connect customer bank accounts to the platform
Bank IdentityRecord /api/identity_records Create and list identity records, which are attached to customers for KYC
Bank IdentityVerification /api/identity_verifications Create and list identity verifications, which are performed on customers for KYC
Bank Price /api/prices Get the current prices for assets on the platform
Bank Quote /api/quotes Create and list quotes, which are required to execute trades
Bank Reward /api/rewards Create a new reward (automates quote/trade for simplicity)
Bank Symbol /api/symbols Get a list of symbols supported for trade (ex: BTC-USD)
Bank Trade /api/trades Create and list trades, which buy or sell cryptocurrency
Bank Transfer /api/transfers Create, get and list transfers (e.g., funding, book)
Bank Workflow /api/workflows Create, get and list workflows

Understanding Object Models & Endpoints

Organizations

An Organization is meant to represent the organization partnering with Cybrid to use our platform.

An Organization does not directly interact with customers. Instead, an Organization has one or more banks, which encompass the financial service offerings of the platform.

Banks

A Bank is owned by an Organization and can be thought of as an environment or container for customers and product offerings. Banks are created in either Sandbox or Production mode, where Sandbox is the environment that you would test, prototype and build in prior to moving to Production.

An Organization can have multiple banks, in either Sandbox or Production environments. A Sandbox Bank will be backed by stubbed data and process flows. For instance, funding source transfer processes as well as trades will be simulated rather than performed, however asset prices are representative of real-world values. You have an unlimited amount of simulated fiat currency for testing purposes.

Customers

Customers represent your banking users on the platform. At present, we offer support for Individuals as Customers.

Customers must be verified (i.e., KYC'd) in our system before they can play any part on the platform, which means they must have an associated and valid Identity Record. See the Identity Records section for more details on how a customer can be verified.

Customers must also have an Account to be able to transact, in the desired asset class. See the Accounts APIs for more details on setting up accounts for the customer.

Overview

This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.

  • API version: v0.0.0
  • Package version:
  • Build package: org.openapitools.codegen.languages.Swift5ClientCodegen

Installation

Carthage

Run carthage update

CocoaPods

Run pod install

Documentation for API Endpoints

All URIs are relative to http://api-bank.cybrid.local

Class Method HTTP request Description
AccountsAPI createAccount POST /api/accounts Create Account
AccountsAPI getAccount GET /api/accounts/{account_guid} Get Account
AccountsAPI listAccounts GET /api/accounts List Accounts
AssetsAPI listAssets GET /api/assets Get assets list
BanksAPI createBank POST /api/banks Create Bank
BanksAPI getBank GET /api/banks/{bank_guid} Get Bank
BanksAPI listBanks GET /api/banks Get banks list
BanksAPI updateBank PATCH /api/banks/{bank_guid} Patch Bank
CustomersAPI createCustomer POST /api/customers Create Customer
CustomersAPI getCustomer GET /api/customers/{customer_guid} Get Customer
CustomersAPI listCustomers GET /api/customers Get customers list
DepositAddressesAPI createDepositAddress POST /api/deposit_addresses Create Deposit Address
DepositAddressesAPI getDepositAddress GET /api/deposit_addresses/{deposit_address_guid} Get Deposit Address
DepositAddressesAPI listDepositAddresses GET /api/deposit_addresses List Deposit Addresses
ExternalBankAccountsAPI createExternalBankAccount POST /api/external_bank_accounts Create ExternalBankAccount
ExternalBankAccountsAPI deleteExternalBankAccount DELETE /api/external_bank_accounts/{external_bank_account_guid} Delete External Bank Account
ExternalBankAccountsAPI getExternalBankAccount GET /api/external_bank_accounts/{external_bank_account_guid} Get External Bank Account
ExternalBankAccountsAPI listExternalBankAccounts GET /api/external_bank_accounts Get external bank accounts list
ExternalBankAccountsAPI patchExternalBankAccount PATCH /api/external_bank_accounts/{external_bank_account_guid} Patch ExternalBankAccount
IdentityRecordsAPI createIdentityRecord POST /api/identity_records Create Identity Record
IdentityRecordsAPI getIdentityRecord GET /api/identity_records/{identity_record_guid} Get Identity Record
IdentityRecordsAPI listIdentityRecords GET /api/identity_records List Identity Records
IdentityVerificationsAPI createIdentityVerification POST /api/identity_verifications Create Identity Verification
IdentityVerificationsAPI getIdentityVerification GET /api/identity_verifications/{identity_verification_guid} Get Identity Verification
IdentityVerificationsAPI listIdentityVerifications GET /api/identity_verifications List Identity Verifications
InternalAPI internalClaimExchangeSettlementPaymentOrder POST /api/internal/exchange_settlement_payment_orders/{guid}/claim Claim Exchange Settlement Payment Order
InternalAPI internalClaimExpectedPayment POST /api/internal/expected_payments/{guid}/claim Claim Expected Payment
InternalAPI internalCreateAccount POST /api/internal/accounts Create Account
InternalAPI internalCreateComplianceDecision POST /api/internal/compliance_decisions Create Compliance Decision
InternalAPI internalCreateCountryCodeConfiguration POST /api/internal/country_code_configurations Create CountryCodeConfiguration
InternalAPI internalCreateCybridAccount POST /api/internal/cybrid_accounts Create CybridAccount
InternalAPI internalCreateExchange POST /api/internal/exchanges Create Exchange
InternalAPI internalCreateExchangeAccount POST /api/internal/exchange_accounts Create ExchangeAccount
InternalAPI internalCreateExchangeSettlement POST /api/internal/exchange_settlements Create Exchange Settlement
InternalAPI internalCreateExchangeSettlementApproval POST /api/internal/exchange_settlements/{guid}/approval Create Exchange Settlement Approval
InternalAPI internalCreateExchangeSettlementCompletion POST /api/internal/exchange_settlements/{guid}/completion Create Exchange Settlement Completion
InternalAPI internalCreateExchangeSettlementPaymentOrder POST /api/internal/exchange_settlement_payment_orders Create Exchange Settlement Payment Order
InternalAPI internalCreateExpectedPayment POST /api/internal/expected_payments Create Expected Payment
InternalAPI internalCreateExternalBankAccount POST /api/internal/external_bank_accounts Create ExternalBankAccount
InternalAPI internalCreateExternalWallet POST /api/internal/external_wallets Create ExternalWallet
InternalAPI internalCreateFeeConfiguration POST /api/internal/fee_configurations Create FeeConfiguration
InternalAPI internalCreateFiatAssetConfiguration POST /api/internal/fiat_asset_configurations Create FiatAssetConfiguration
InternalAPI internalCreateInternalBankAccount POST /api/internal/internal_bank_accounts Create InternalBankAccount
InternalAPI internalCreateInternalTransfer POST /api/internal/internal_transfers Create InternalTransfer
InternalAPI internalCreateInternalWallet POST /api/internal/internal_wallets Create InternalWallet
InternalAPI internalCreatePersonDetails POST /api/internal/person_details Create Person Details
InternalAPI internalCreateQuote POST /api/internal/quotes Create InternalQuote
InternalAPI internalCreateSavingsAssetConfiguration POST /api/internal/savings_asset_configurations Create SavingsAssetConfiguration
InternalAPI internalCreateTradingSymbolConfiguration POST /api/internal/trading_symbol_configurations Create TradingSymbolConfiguration
InternalAPI internalCryptoFundingDepositTransfer POST /api/internal/crypto_funding_deposit_transfers Create Crypto Funding Deposit Transfer
InternalAPI internalGetCybridAccount GET /api/internal/cybrid_accounts/{account_guid} Get CybridAccount
InternalAPI internalGetExchange GET /api/internal/exchanges/{exchange_guid} Get Exchange
InternalAPI internalGetExchangeAccount GET /api/internal/exchange_accounts/{account_guid} Get ExchangeAccount
InternalAPI internalGetExchangeSettlement GET /api/internal/exchange_settlements/{guid} Get Exchange Settlement
InternalAPI internalGetExchangeSettlementObligation GET /api/internal/exchange_settlement_obligations/{guid} Get Exchange Settlement Obligation
InternalAPI internalGetExchangeSettlementPaymentOrder GET /api/internal/exchange_settlement_payment_orders/{guid} Get Exchange Settlement Payment Order
InternalAPI internalGetExpectedPayment GET /api/internal/expected_payments/{guid} Get Expected Payment
InternalAPI internalGetExternalBankAccount GET /api/internal/external_bank_accounts/{external_bank_account_guid} Get ExternalBankAccount
InternalAPI internalGetInternalBankAccount GET /api/internal/internal_bank_accounts/{internal_bank_account_guid} Get InternalBankAccount
InternalAPI internalGetInternalTransfer GET /api/internal/internal_transfers/{guid} Get InternalTransfer
InternalAPI internalGetInternalWallet GET /api/internal/internal_wallets/{internal_wallet_guid} Get InternalWallet
InternalAPI internalGetQuote GET /api/internal/quotes/{quote_guid} Get InternalQuote
InternalAPI internalListExchanges GET /api/internal/exchanges List Exchanges
InternalAPI internalListExternalBankAccounts GET /api/internal/external_bank_accounts List ExternalBankAccounts
InternalAPI internalListExternalWallets GET /api/internal/external_wallets List ExternalWallets
InternalAPI internalListInternalBankAccounts GET /api/internal/internal_bank_accounts List InternalBankAccounts
InternalAPI internalListInternalTransfers GET /api/internal/internal_transfers List InternalTransfers
InternalAPI internalListInternalWallets GET /api/internal/internal_wallets List InternalWallets
InternalAPI internalListTransactions GET /api/internal/transactions List Transactions
InternalAPI internalPatchAccount PATCH /api/internal/accounts/{account_guid} Patch Account
InternalAPI internalPatchCybridAccount PATCH /api/internal/cybrid_accounts/{guid} Patch Cybrid Account
InternalAPI internalPatchDepositAddress PATCH /api/internal/deposit_addresses/{guid} Patch Deposit Address
InternalAPI internalPatchExchangeAccount PATCH /api/internal/exchange_accounts/{guid} Patch Exchange Account
InternalAPI internalPatchExternalBankAccount PATCH /api/internal/external_bank_accounts/{external_bank_account_guid} Patch ExternalBankAccount
InternalAPI internalPatchIdentityRecord PATCH /api/internal/identity_records/{identity_record_guid} Patch Identity Record
InternalAPI internalPatchIdentityVerification PATCH /api/internal/identity_verifications/{identity_verification_guid} Patch Identity Verification
InternalAPI internalPatchInternalBankAccount PATCH /api/internal/internal_bank_accounts/{guid} Patch Internal Bank Account
InternalAPI internalPatchInternalTransfer PATCH /api/internal/internal_transfers/{guid} Patch Internal Transfer
InternalAPI internalPatchInternalWallet PATCH /api/internal/internal_wallets/{guid} Patch Internal Wallet
InternalAPI internalPatchInternalWalletGroup PATCH /api/internal/internal_wallet_groups/{guid} Patch Internal Wallet
InternalAPI internalPatchTransfer PATCH /api/internal/transfers/{transfer_guid} Patch Transfer
InternalAPI internalPatchWorkflow PATCH /api/internal/workflows/{workflow_guid} Patch Workflow
PricesAPI listPrices GET /api/prices Get Price
QuotesAPI createQuote POST /api/quotes Create Quote
QuotesAPI getQuote GET /api/quotes/{quote_guid} Get Quote
QuotesAPI listQuotes GET /api/quotes Get quotes list
RewardsAPI createRewards POST /api/rewards Create Reward
RewardsAPI getReward GET /api/rewards/{reward_guid} Get Reward
RewardsAPI listRewards GET /api/rewards Get rewards list
SymbolsAPI listSymbols GET /api/symbols Get Symbols list
TradesAPI createTrade POST /api/trades Create Trade
TradesAPI getTrade GET /api/trades/{trade_guid} Get Trade
TradesAPI listTrades GET /api/trades Get trades list
TransfersAPI createTransfer POST /api/transfers Create Transfer
TransfersAPI getTransfer GET /api/transfers/{transfer_guid} Get Transfer
TransfersAPI listTransfers GET /api/transfers Get transfers list
VerificationKeysAPI createVerificationKey POST /api/bank_verification_keys Create VerificationKey
VerificationKeysAPI getVerificationKey GET /api/bank_verification_keys/{verification_key_guid} Get VerificationKey
VerificationKeysAPI listVerificationKeys GET /api/bank_verification_keys Get Verification Keys list
WorkflowsAPI createWorkflow POST /api/workflows Create Workflow
WorkflowsAPI getWorkflow GET /api/workflows/{workflow_guid} Get Workflow
WorkflowsAPI listWorkflows GET /api/workflows Get workflows list

Documentation For Models

Documentation For Authorization

BearerAuth

  • Type: HTTP basic authentication

oauth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • banks:read: banks read
  • banks:write: banks write
  • accounts:read: accounts read
  • accounts:execute: accounts execute
  • customers:read: customers read
  • customers:write: customers write
  • customers:execute: customers execute
  • prices:read: prices read
  • quotes:execute: quotes execute
  • quotes:read: quotes read
  • trades:execute: trades execute
  • trades:read: trades read
  • transfers:execute: transfers execute
  • transfers:read: transfers read
  • rewards:execute: rewards execute
  • rewards:read: rewards read
  • external_bank_accounts:read: external_bank_accounts read
  • external_bank_accounts:write: external_bank_accounts write
  • external_bank_accounts:execute: external_bank_accounts execute
  • workflows:read: workflows read
  • workflows:execute: workflows execute
  • deposit_addresses:read: deposit_addresses read
  • deposit_addresses:execute: deposit_addresses execute

Author

[email protected]

GitHub

link
Stars: 0
Last commit: 1 hour ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics