This guide is available in three programming languages: TypeScript, Flutter (Dart), and Swift. You can change the shown version on each page via the buttons above.
Installation
First, you need to add the SDK dependency to your project.- TypeScript
- Flutter
- Swift
Working with the SDK
Let’s start with the main class that provides all SDK functionality. It’s advised to have a singleton wallet object shared across the application. Creating a wallet with a default configuration connected to Stellar’s Testnet is simple:- TypeScript
- Flutter
- Swift
- TypeScript
- Flutter
- Swift
Configuring the Client
- TypeScript
- Flutter
The Typescript wallet SDK uses the axios client for all network requests. You can read more about how to configure the axios client here.For example, we can configure our axios client to be globally configured with a timeout:You can find more configure options here.
Stellar Basics
The wallet SDK provides some extra functionality on top of the existing Horizon SDK. For interaction with the Stellar network, the wallet SDK covers only the basics used in a typical wallet flow. For more advanced use cases, the underlying Horizon SDK should be used instead. To interact with the Horizon instance configured in the previous steps, simply do:- TypeScript
- Flutter
- Swift
Default configuration connects to the public Stellar Horizon instance. You can change this behavior as described above.
Anchor Basics
Primary use of the SDK is to provide an easy way to connect to anchors via sets of protocols known as SEPs. Let’s look into connecting to the Stellar test anchor:- TypeScript
- Flutter
- Swift
- TypeScript
If the anchor home domain uses http, then you need to set the This can only be used on Testnet.
allowHttp flag when creating the anchor:- TypeScript
- Flutter
- Swift
- SEP-1: Stellar Info File as shown above
- SEP-10: explored on Stellar Authentication section
- SEP-24: explored on Hosted Deposit and Withdrawal section
- SEP-6: explored on Programmatic Deposit and Withdrawal section
- SEP-12: explored on Providing KYC info subsection
- SEP-38: explored on Quote section