Skip to main content

Wallet Developers

If you're a wallet developer and you want your wallet to be added to the kit, you can do it by creating a "module" compatible with the kit.

This module needs to follow this interface here

/**
* The Kit Actions are the methods the kit use to interact with the Wallet/Service
*/
export interface KitActions {
/**
* Function used to request the public key from the active account or
* specific path on a wallet.
*
* @param params
* @param params.path - The path to tell the wallet which position to ask. This is commonly used in hardware wallets.
*
* @return Promise<{ address: string }>
*/
getAddress(params?: { path?: string }): Promise<{ address: string }>;

/**
* A function to request a wallet to sign a built transaction in its XDR mode
*
* @param xdr - A Transaction or a FeeBumpTransaction
* @param opts - Options compatible with https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0043.md#signtransaction
* @param opts.networkPassphrase - The Stellar network to use when signing
* @param opts.address - The public key of the account that should be used to sign
* @param opts.path - This options is added for special cases like Hardware wallets
*
* @return Promise<{ signedTxXdr: string; signerAddress: string }>
*/
signTransaction(
xdr: string,
opts?: {
networkPassphrase?: string;
address?: string;
path?: string;
submit?: boolean;
submitUrl?: string;
}
): Promise<{ signedTxXdr: string; signerAddress?: string }>;

/**
* A function to request a wallet to sign an AuthEntry XDR.
*
* @param authEntry - An XDR string version of `HashIdPreimageSorobanAuthorization`
* @param opts - Options compatible with https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0043.md#signauthentry
* @param opts.networkPassphrase - The Stellar network to use when signing
* @param opts.address - The public key of the account that should be used to sign
* @param opts.path - This options is added for special cases like Hardware wallets
*
* @return - Promise<{ signedAuthEntry: string; signerAddress: string }>
*/
signAuthEntry(
authEntry: string,
opts?: {
networkPassphrase?: string;
address?: string;
path?: string;
}
): Promise<{ signedAuthEntry: string; signerAddress?: string }>;

/**
* A function to request a wallet to sign an AuthEntry XDR.
*
* @param message - An arbitrary string rather than a transaction or auth entry
* @param opts - Options compatible with https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0043.md#signmessage
* @param opts.networkPassphrase - The Stellar network to use when signing
* @param opts.address - The public key of the account that should be used to sign
* @param opts.path - This options is added for special cases like Hardware wallets
*
* @return - Promise<{ signedMessage: string; signerAddress: string }>
*/
signMessage(
message: string,
opts?: {
networkPassphrase?: string;
address?: string;
path?: string;
}
): Promise<{ signedMessage: string; signerAddress?: string }>;

/**
* A function to request the current selected network in the wallet. This comes
* handy when you are dealing with a wallet that doesn't allow you to specify which network to use (For example Lobstr and Rabet)
*
* @return - Promise<{ network: string; networkPassphrase: string }>
*/
getNetwork(): Promise<{ network: string; networkPassphrase: string }>;
}

/**
* A module is a "plugin" we can use within the kit so is able to handle a
* specific type of wallet/service. There are some modules that are already
* in the kit but any wallet developer can create their own plugins
*/
export interface ModuleInterface extends KitActions {
/**
* The Module type is used for filtering purposes, define the correct one in
* your module so we display it accordingly
*/
moduleType: ModuleType;

/**
* This ID of the module, you should expose this ID as a constant variable
* so developers can use it to show/filter this module if they need to.
*/
productId: string;

/**
* This is the name the kit will show in the builtin Modal.
*/
productName: string;

/**
* This is the URL where users can either download, buy and just know how to
* get the product.
*/
productUrl: string;

/**
* This icon will be displayed in the builtin Modal along with the product name.
*/
productIcon: string;

/**
* This function should return true is the wallet is installed and/or available.
* If for example this wallet/service doesn't need to be installed to be used,
* return `true`.
*
* Important:
* Your wallet/library needs to be able to answer this function in less than 500ms.
* Otherwise, the kit will show it as unavailable
*
*/
isAvailable(): Promise<boolean>;
}

After you have your module done, open a PR with the module and we will review it.