simple-stellar-signer-api
v1.0.2-b
Published
Handles SimpleSigner operations and exposes its async methods
Downloads
13
Readme
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
- Params:
- network: Network
- (Optional) wallets: WalletType[]
- Returns:
- wallet: { publicKey: string, wallet: WalletType }
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