Synq Docs
SDK reference

@synqauth/solana-mobile

Sign in to Synq with a Solana wallet app on Android, through Mobile Wallet Adapter.

@synqauth/solana-mobile

base58Address

Function. A Solana address (32 bytes) in base58, as the issuer names wallets.

function base58Address(bytes: Uint8Array<ArrayBufferLike>): string

MwaSignInResult

Interface. What MWA's authorize answers for a sign-in: every field base64.

interface MwaSignInResult {
    readonly address: string;
    readonly signed_message: string;
    readonly signature: string;
    readonly signature_type?: string;
}

siwsFromMwa

Function. synq_siws for MWA's sign-in result for request: the address in base58, the signature as it came, and the request's nonce. Refuses a result whose signed message isn't the issuer's request for that address, or that isn't an Ed25519 signature.

function siwsFromMwa(request: SignInRequest, result: MwaSignInResult): string

@synqauth/solana-mobile/core

base58Address

Function. A Solana address (32 bytes) in base58, as the issuer names wallets.

function base58Address(bytes: Uint8Array<ArrayBufferLike>): string

MwaSignInResult

Interface. What MWA's authorize answers for a sign-in: every field base64.

interface MwaSignInResult {
    readonly address: string;
    readonly signed_message: string;
    readonly signature: string;
    readonly signature_type?: string;
}

siwsFromMwa

Function. synq_siws for MWA's sign-in result for request: the address in base58, the signature as it came, and the request's nonce. Refuses a result whose signed message isn't the issuer's request for that address, or that isn't an Ed25519 signature.

function siwsFromMwa(request: SignInRequest, result: MwaSignInResult): string

@synqauth/solana-mobile/react-native

MobileWalletSignInOptions

Interface. What mobileWalletSignInUrl takes besides the client.

interface MobileWalletSignInOptions extends Omit<AuthorizationUrlOptions, 'pushed' | 'prompt' | 'method'> {
    issuer: string | URL;
    clientId: string;
    appOrigin: string;
    identity: {
        name?: string;
        uri?: string;
        icon?: string;
    };
    transact: MwaTransact;
    fetch?: typeof fetch;
}

mobileWalletSignInUrl

Function. The issuer's request, signed by the wallet app through MWA, pushed to Synq: the URL to open in the system browser, which comes straight back to the app's redirect URI with a code. A person who declines in the wallet app is wallet_rejected. The app needs an https identity it claims as appOrigin (an App Link, a universal link): one whose only redirect URI is a scheme of its own signs in through the browser only, and is invalid_options here, before anyone is asked.

function mobileWalletSignInUrl(client: SynqClient, options: MobileWalletSignInOptions): Promise<URL>

MwaSignInResult

Interface. What MWA's authorize answers for a sign-in: every field base64.

interface MwaSignInResult {
    readonly address: string;
    readonly signed_message: string;
    readonly signature: string;
    readonly signature_type?: string;
}

MwaTransact

Type. MWA's transact: runs callback in a session with the wallet app the person picks.

type MwaTransact = <T>(callback: (wallet: MwaWallet) => Promise<T>) => Promise<T>;

MwaWallet

Interface. The part of an MWA wallet session this uses.

interface MwaWallet {
    authorize(params: {
        identity: {
            name?: string;
            uri?: string;
            icon?: string;
        };
        chain?: string;
        sign_in_payload?: SignInRequest;
    }): Promise<{
        sign_in_result?: MwaSignInResult;
    }>;
}

siwsFromMwa

Function. synq_siws for MWA's sign-in result for request: the address in base58, the signature as it came, and the request's nonce. Refuses a result whose signed message isn't the issuer's request for that address, or that isn't an Ed25519 signature.

function siwsFromMwa(request: SignInRequest, result: MwaSignInResult): string

@synqauth/solana-mobile/web

registerMobileWallet

Function. Registers Mobile Wallet Adapter as a wallet the page's discovery finds; does nothing off a browser.

function registerMobileWallet(options: RegisterMobileWalletOptions): boolean

RegisterMobileWalletOptions

Interface. What registerMobileWallet takes.

interface RegisterMobileWalletOptions {
    registerMwa: (options: RegisterMwaOptions) => void;
    appIdentity: RegisterMwaOptions['appIdentity'];
    chains?: readonly string[];
    options?: Record<string, unknown>;
}

RegisterMwaOptions

Interface. The options registerMwa takes that this sets; the rest pass through.

interface RegisterMwaOptions {
    appIdentity: {
        name?: string;
        uri?: string;
        icon?: string;
    };
    chains: readonly string[];
    [option: string]: unknown;
}

See every package.

On this page