Me Modules API Reference
Estimated reading time: less than 1 minute
Conventions
- "Request" means your module sends
{ type, payload }.
- "Response payload" means what you'll receive as
msg.payload in the response.
- On failure you'll receive
msg.error (string).
- Some events are fire-and-forget and do not respond.
Events index
Error handling
When the App cannot fulfill a request, it will respond with:
{
"type": "<EVENT_NAME>",
"error": "..."
}
Notes:
error is intentionally unknown to avoid constraining native implementations. It can be a message string or a generic error object.
COMMON
COMMON_APP_INFO
Get basic app context for localization/theme.
Request
{ "type": "COMMON_APP_INFO" }
Response
{
type: "COMMON_APP_INFO";
payload: {
language: string;
version: string;
id: string;
darkMode: boolean;
};
error?: unknown;
}
Response payload fields
COMMON_DEVICE_INFO
Request
{ "type": "COMMON_DEVICE_INFO" }
Response
{
type: "COMMON_DEVICE_INFO";
payload: {
identifier: string;
brand: string;
model: string;
os: string;
country: string;
timezone: string;
};
error?: unknown;
}
Response payload fields
COMMON_STATUS_BAR_DIMENSIONS
Use to position UI under safe areas.
Request
{ "type": "COMMON_STATUS_BAR_DIMENSIONS" }
Response
{
type: "COMMON_STATUS_BAR_DIMENSIONS";
payload: {
top: number;
left: number;
width: number;
height: number;
};
error?: unknown;
}
COMMON_SET_STATUS_BAR_STYLE
Request
{
type: "COMMON_SET_STATUS_BAR_STYLE";
payload: "light" | "dark";
}
Response
{
type: "COMMON_SET_STATUS_BAR_STYLE";
payload: null;
error?: unknown;
}
COMMON_COPY_TO_CLIPBOARD
Request
{
type: "COMMON_COPY_TO_CLIPBOARD";
payload: {
content: string;
showToastNotification?: boolean;
};
}
Response
{
type: "COMMON_COPY_TO_CLIPBOARD";
payload: null;
error?: unknown;
}
Request payload fields
COMMON_OPEN_BROWSER
Opens an in-app browser for a URL. To pass data back, redirect to sharering://close?....
Request
{
type: "COMMON_OPEN_BROWSER";
payload: string; // URL
}
Response
{
type: "COMMON_OPEN_BROWSER";
payload: Record<string, any>;
error?: unknown;
}
Notes
- Response
payload contains the parsed query string parameters as a key-value object when data is passed back on browser close event
COMMON_READ_ASYNC_STORAGE
Read app-managed key/value storage scoped to your module domain.
Request
{
type: "COMMON_READ_ASYNC_STORAGE";
payload: string | string[];
}
Response
{
type: "COMMON_READ_ASYNC_STORAGE";
payload: Record<string, any>;
error?: unknown;
}
Notes
payload can be a string key or an array of keys.
- Response
payload is a key-value object; missing/unavailable keys are omitted.
COMMON_WRITE_ASYNC_STORAGE
Write app-managed key/value storage scoped to your module domain.
Request
{
type: "COMMON_WRITE_ASYNC_STORAGE";
payload: {
[key: string]: any;
};
}
Response
{
type: "COMMON_WRITE_ASYNC_STORAGE";
payload: null;
error?: unknown;
}
NAVIGATION
NAVIGATE_TO
Navigate within the ShareRing Me app.
Request
{
type: "NAVIGATE_TO";
payload: {
to: string;
params?: Record<string, any>;
mode?: "replace" | "push";
};
}
Notes
to can be an in-app screen name or another Me Modules (by its domain name).
mode:
replace: replaces the current route
push: adds a new route to the navigation stack
pop: navigates back to the previous route specified by to. If the route is not found in the stack, it replaces the current route with to
NAVIGATE_BACK
Request
{
type: "NAVIGATE_BACK";
payload: {
steps?: number;
};
}
Response
{
type: "NAVIGATE_BACK";
payload: null;
error?: unknown;
}
Notes
steps defaults to 1 and can be used to go back multiple routes.
NAVIGATE_IS_FOCUSED
Request
{ "type": "NAVIGATE_IS_FOCUSED" }
Response
{
type: "NAVIGATE_IS_FOCUSED";
payload: boolean;
error?: unknown;
}
NAVIGATE_OPEN_DEVICE_SETTINGS
Request
{
type: "NAVIGATE_OPEN_DEVICE_SETTINGS";
payload: string;
}
Notes
payload can be one of: general, location, bluetooth, network, wifi, cellular, app, apps.
NAVIGATE_OPEN_LINK
Opens a URL or deeplink via the OS.
Request
{
type: "NAVIGATE_OPEN_LINK";
payload: string; // deeplink or URL
}
Notes
- The app triggers
Linking.openURL(...); OS handles the target scheme.
VAULT
VAULT_DOCUMENTS
Request
{ "type": "VAULT_DOCUMENTS" }
Response
{
type: "VAULT_DOCUMENTS";
payload: Array<{
id: string;
type: string;
country: string;
}>;
error?: unknown;
}
Response payload fields (per item)
VAULT_EMAIL
Request
{ "type": "VAULT_EMAIL" }
Response
{
type: "VAULT_EMAIL";
payload: string;
error?: unknown;
}
VAULT_AVATAR
Request
{ "type": "VAULT_AVATAR" }
Response
{
type: "VAULT_AVATAR";
payload: string;
error?: unknown;
}
Notes
payload is the base64 encoded image string
VAULT_ADD_DOCUMENT
Add a document to the user's vault.
Request
{
type: "VAULT_ADD_DOCUMENT";
payload: {
image: string;
photo: string;
metadata: {
type: string;
expiryDate: string;
issueDate: string;
number: string;
country: string;
countryCode: string;
fullName: string;
dob: string;
address: string;
nationality: string;
placeOfBirth: string;
issueBy: string;
};
};
}
Response
{
type: "VAULT_ADD_DOCUMENT";
payload: null;
error?: unknown;
}
VAULT_ADD_CUSTOM_VALUE
Request
{
type: "VAULT_ADD_CUSTOM_VALUE";
payload: {
[key: string]: any;
};
}
Response
{
type: "VAULT_ADD_CUSTOM_VALUE";
payload: null;
error?: unknown;
}
VAULT_EXEC_QUERY
Starts a vault query / data sharing flow.
Request
{
type: "VAULT_EXEC_QUERY";
payload: {
queryId: string;
clientId: string;
ownerAddress: string;
sessionId?: string;
customValue?: Array<{ name: string; value: string }>;
};
}
Response
{
type: "VAULT_EXEC_QUERY";
payload: Array<{
name: string;
label: string;
value: string;
}>;
error?: unknown;
}
VAULT_EXEC_QUERY_SILENT
Same request shape as VAULT_EXEC_QUERY, but the app may require PIN confirmation.
Request
{
type: "VAULT_EXEC_QUERY_SILENT";
payload: {
queryId: string;
clientId: string;
ownerAddress: string;
sessionId?: string;
customValue?: Array<{ name: string; value: string }>;
};
}
Response
{
type: "VAULT_EXEC_QUERY_SILENT";
payload: Array<{
name: string;
label: string;
value: string;
}>;
error?: unknown;
}
WALLET
WALLET_MAIN_ACCOUNT
Request
{ "type": "WALLET_MAIN_ACCOUNT" }
Response
{
type: "WALLET_MAIN_ACCOUNT";
payload: {
address: string;
pubKey: string;
};
error?: unknown;
}
WALLET_CURRENT_ACCOUNT
Request
{ "type": "WALLET_CURRENT_ACCOUNT" }
Response
{
type: "WALLET_CURRENT_ACCOUNT";
payload: {
address: string;
pubKey: string;
};
error?: unknown;
}
WALLET_BALANCE
Request
{ "type": "WALLET_BALANCE" }
Response
{
type: "WALLET_BALANCE";
payload: Array<{
amount: string;
denom: string;
}>;
error?: unknown;
}
WALLET_ACCOUNTS
Request
{ "type": "WALLET_ACCOUNTS" }
Response
{
type: "WALLET_ACCOUNTS";
payload: Array<{
address: string;
pubKey: string;
}>;
error?: unknown;
}
WALLET_SWITCH_ACCOUNT
Request
{ "type": "WALLET_SWITCH_ACCOUNT" }
Response
{
type: "WALLET_SWITCH_ACCOUNT";
payload: {
address: string;
pubKey: string;
};
error?: unknown;
}
Notes
- Response
payload is the account that was switched to.
WALLET_SIGN_TRANSACTION
Signs a ShareLedger transaction.
Request
{
type: "WALLET_SIGN_TRANSACTION";
payload: {
messages: string; // hex string of TX messages
memo?: string;
fee: {
amount?: Array<{ amount: string; denom: string }>;
gas?: number;
gasPrice?: string; // e.g. "1000nshr"
granter?: string;
payer?: string;
};
};
}
Response
{
type: "WALLET_SIGN_TRANSACTION";
payload: string; // signature (or signed result)
error?: unknown;
}
WALLET_SIGN_AND_BROADCAST_TRANSACTION
Signs a ShareLedger transaction then commit it to the blockchain.
Request
{
type: "WALLET_SIGN_AND_BROADCAST_TRANSACTION";
payload: {
messages: string; // hex string of TX messages
memo?: string;
fee: {
amount?: Array<{ amount: string; denom: string }>;
gas?: number;
gasPrice?: string;
granter?: string;
payer?: string;
};
};
}
Response
{
type: "WALLET_SIGN_AND_BROADCAST_TRANSACTION";
payload: {
height: number;
transactionHash: string;
gasUsed: number;
gasWanted: number;
code: string;
};
error?: unknown;
}
How to create a ShareLedger transaction
For WALLET_SIGN_TRANSACTION and WALLET_SIGN_AND_BROADCAST_TRANSACTION, the Me Module needs to create a transaction and pass it to the app for signing. Here's a code example showing how to create a transaction:
import { ShareledgerSigningClient } from "@shareledgerjs/client";
// 1. Create a client instance
const client = await ShareledgerSigningClient.connect("https://rpc.explorer.shareri.ng"); // RPC endpoint
// 2. Create a transaction message (example: transfer transaction)
const msg = client.bank.send("<from address>", "<to address>", [{ amount: "1000000000", denom: "nshr" }]);
// 3. Encode the transaction to get a buffer
const msgEncoded = client.registry.encodeTxBody({ messages: [msg] });
// 4. Convert to hex string for passing to the app
const msgEncodedHex = Buffer.from(msgEncoded).toString('hex'); // Pass this hex string to the app
WALLET_SWAP_ACCOUNT
Request
{
type: "WALLET_SWAP_ACCOUNT";
payload: {
network: "eth" | "bsc";
};
}
Response
{
type: "WALLET_SWAP_ACCOUNT";
payload: {
network: "eth" | "bsc";
address: string;
};
error?: unknown;
}
NFT
NFT_NFTS
Request
Response
{
type: "NFT_NFTS";
payload: any[];
}
CRYPTOGRAPHY
CRYPTO_ENCRYPT
Request
{
type: "CRYPTO_ENCRYPT";
payload: string;
}
Response
{
type: "CRYPTO_ENCRYPT";
payload: string;
error?: unknown;
}
CRYPTO_DECRYPT
Request
{
type: "CRYPTO_DECRYPT";
payload: string;
}
Response
{
type: "CRYPTO_DECRYPT";
payload: string;
error?: unknown;
}
CRYPTO_SIGN
Request
{
type: "CRYPTO_SIGN";
payload: {
data: string;
signOptions: {
delimiter: string;
expiration: {
enabled: boolean;
salt?: string;
};
};
};
}
Response
{
type: "CRYPTO_SIGN";
payload: {
signature: string;
data: string;
};
error?: unknown;
}
CRYPTO_VERIFY
Request
{
type: "CRYPTO_VERIFY";
payload: {
data: string;
verifyOptions: {
signature?: string;
delimiter: string;
expiration: {
enabled: boolean;
time: number; // seconds
salt?: string;
};
};
};
}
Response
{
type: "CRYPTO_VERIFY";
payload: {
valid: boolean;
data: string[];
};
error?: unknown;
}
GOOGLE_WALLET
GOOGLE_WALLET_CAN_ADD_PASSES
Request
{ "type": "GOOGLE_WALLET_CAN_ADD_PASSES" }
Response
{
type: "GOOGLE_WALLET_CAN_ADD_PASSES";
payload: boolean;
error?: unknown;
}
GOOGLE_WALLET_ADD_PASS
Request
{
type: "GOOGLE_WALLET_ADD_PASS";
payload: string; // JWT string or URL
}
Response
{
type: "GOOGLE_WALLET_ADD_PASS";
payload: null;
error?: unknown;
}
APPLE_WALLET
APPLE_WALLET_CAN_ADD_PASSES
Request
{ "type": "APPLE_WALLET_CAN_ADD_PASSES" }
Response
{
type: "APPLE_WALLET_CAN_ADD_PASSES";
payload: boolean;
error?: unknown;
}
APPLE_WALLET_ADD_PASS
Request
{
type: "APPLE_WALLET_ADD_PASS";
payload: string; // likely URL/JWT (platform-specific)
}
Response
{
type: "APPLE_WALLET_ADD_PASS";
payload: null;
error?: unknown;
}
APPLE_WALLET_HAS_PASS
Request
{
type: "APPLE_WALLET_HAS_PASS";
payload: {
cardIdentifier: string;
serialNumber?: string;
};
}
Response
{
type: "APPLE_WALLET_HAS_PASS";
payload: boolean;
error?: unknown;
}
APPLE_WALLET_REMOVE_PASS
Request
{
type: "APPLE_WALLET_REMOVE_PASS";
payload: {
cardIdentifier: string;
serialNumber?: string;
};
}
Response
{
type: "APPLE_WALLET_REMOVE_PASS";
payload: boolean;
error?: unknown;
}
APPLE_WALLET_VIEW_PASS
Request
{
type: "APPLE_WALLET_VIEW_PASS";
payload: {
cardIdentifier: string;
serialNumber?: string;
};
}
Response
{
type: "APPLE_WALLET_VIEW_PASS";
payload: null;
error?: unknown;
}