Skip to main content
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.

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:
The wallet instance can be further configured. For example, to connect to the public network:

Configuring the Client

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:
This example will create a Stellar class that manages the connection to Horizon service.
Default configuration connects to the public Stellar Horizon instance. You can change this behavior as described above.
You can read more about working with the Stellar network in the respective section.

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:
If the anchor home domain uses http, then you need to set the allowHttp flag when creating the anchor:
This can only be used on Testnet.
And the most basic interaction of fetching a SEP-1: Stellar Info File:
Below you can find all the SEPs the anchor class currently supports: Besides the SEPs supported by the anchor class the wallet SDK also has support for the SEP-7 protocol which is explored on URI Scheme to facilitate delegated signing section.