API Notes
This guide lists the common methods and basic types of window.$ukey.stellar. The business code should select the corresponding signature method based on the current network and address.
Methods
| Method | Details |
|---|---|
getAddress(params?) | Request authorization and return current Stellar address |
getNetwork() | Read the current Network and Network passphrase |
signTransaction(xdr, opts?) | Signature Stellar Transaction XDR |
signAuthEntry(authEntry, opts?) | Signature Stellar Auth Entry XDR |
signMessage(message, opts?) | Signing off-chain messages |
property
| Property | Type | Description |
|---|---|---|
isUKey | boolean | UKey Wallet Provider logo |
Types
export type StellarGetAddressParams = { path?: string };
export type StellarGetAddressResponse = { address: string };
export type StellarNetworkInfo = {
network: string;
networkPassphrase: string;
};
export type StellarSignTransactionOpts = {
networkPassphrase?: string;
address?: string;
path?: string;
submit?: boolean;
submitUrl?: string;
};
export type StellarSignTransactionResponse = {
signedTxXdr: string;
signerAddress?: string;
};
export type StellarSignAuthEntryOpts = {
networkPassphrase?: string;
address?: string;
path?: string;
};
export type StellarSignAuthEntryResponse = {
signedAuthEntry: string;
signerAddress: string;
};
export type StellarSignMessageOpts = {
networkPassphrase?: string;
address?: string;
path?: string;
};
export type StellarSignMessageResponse = {
signedMessage: string;
signerAddress: string;
};
Basic type (for reference only)
export type UKeyStellarProvider = {
isUKey: boolean;
// Kept in sync with Stellar Wallets Kit (KitActions)
getAddress: (
requestParams?: StellarGetAddressParams,
) => Promise<StellarGetAddressResponse>;
getNetwork: () => Promise<StellarNetworkInfo>;
signTransaction: (
xdr: string,
opts?: StellarSignTransactionOpts,
) => Promise<StellarSignTransactionResponse>;
signAuthEntry: (
authEntry: string,
opts?: StellarSignAuthEntryOpts,
) => Promise<StellarSignAuthEntryResponse>;
signMessage: (
message: string,
opts?: StellarSignMessageOpts,
) => Promise<StellarSignMessageResponse>;
};