Skip to content

ozkavosh/simple-signer-api

Repository files navigation

Simple Stellar Signer API

Handles Simple Stellar Signer popup window message-based implementation and networks, exposing its methods to handle directly as async functions.

How to use

Install package with:

    npm i simple-stellar-signer-api

Import methods into your code such as:

    import { connectWallet, Network } from 'simple-stellar-signer-api'
    
    const handleConnect = async () => {
        try {
            const { publicKey, wallet } = await connectWallet(Network.FUTURENET);
            //Do something with results...
        } catch (err: unknown){
            console.error(err);
        }
    }

Methods

All methods handle window popup, message and event handling then returns either a resolve with message data on success or reject with a string message on error.

connectWallet

signTransaction

  • Params:
    • transactionXDR: string
    • network: Network
    • (Optional) extraConfig: { description?: string, operationGroups?: OperationGroup[] }
  • Returns:
    • signedXDR: string

Exported Enums

Network


pubnet testnet futurenet

WalletType


albedo freighter rabet privateKey walletConnect xbull