LYNC
DashboardSupport
  • 👋Introducing LYNC
  • Products
    • LYNC Account Abstraction SDK
    • LYNC Account Abstraction WebGL SDK
    • Metamask Wallet
    • LYNC Metamask PC SDK
    • OKX Wallet
    • LYNC In-Game Marketplace SDK
    • NFT Fetcher
    • No-Code Smart Contract Deployer
    • EVM Lootbox SDK
      • Getting Started
      • Using the SDK
        • Creating a new lootbox
        • Opening a lootbox
        • Claiming rewards
        • Whitelisting users using lootbox
        • Lootbox admin functions
        • Useful information functions from LyncLootBox class
        • Multicall : opening and claiming multiple lootboxes in a single transaction
      • Example Codes in React & TypeScript
        • Example code for creating a new lootbox
        • Example code for opening a lootbox
        • Example code for claiming a lootbox
    • Launch your products on Telegram
      • Configure Your Telegram Bot
      • Deploying Your Product on TG
  • APTOS
    • LYNC Paymaster - Supporting Aptos
      • How to Register on LYNC Dashboard
      • How to Create Paymaster
      • How to Fund the Paymaster
      • Module & Function Whitelist
      • How to Integrate Paymaster
        • Unity
        • API
        • JavaScript/ TypeScript
    • LYNC Unity Aptos SDK
    • Keyless Accounts
      • Configure Your OIDC Provider
      • Integrate Keyless in Unity
    • Wallet Creation and Transaction APIs
      • Pre-requisites
      • Integration
        • API Overview
        • Create a new wallet
        • Get already created wallet
        • Mint NFT transactions
        • Send generic transactions on Aptos
    • LYNC Social Login SDK on Aptos
      • Getting Started
      • Using the SDK
      • Example Codes in React & TypeScript
      • Types Used in the Methods Provided by the SDK
      • Other Specification
    • LYNC Aptos Lootbox
      • Getting Started
      • Creating a Lootbox
      • Opening a Lootbox
      • Claiming the Rewards
      • Conclusion
  • Movement Labs
    • 📇Indexer
      • How to run index custom data?
      • Example Queries
        • Get Token Info
        • Get Token Balances
        • Get NFTs Owned by an Account
    • NFT Deployer
    • LYNC Social Login SDK on Movement
      • Getting Started
      • Using the SDK
      • Example Codes in React & TypeScript
      • Types and Enums Used in the Methods Provided by the SDK
      • Other Specification
    • LYNC Unity Movement SDK
    • Wallet Creation and Transaction APIs
      • Pre-requisites
      • Integration
        • API Overview
        • Create a new wallet
        • Get already created wallet
        • Mint NFT transactions
    • LYNC Paymaster - Supporting Movement
      • How to Register on LYNC Dashboard
      • How to Create Paymaster
      • How to Fund the Paymaster
      • Module & Function Whitelist
      • How to Integrate Paymaster
        • JavaScript/ TypeScript
  • Supra
    • LYNC Paymaster - Supporting Supra L1
      • How to Register on LYNC Dashboard
      • How to Create Paymaster
      • How to Fund the Paymaster
      • Module & Function Whitelist
      • How to Integrate Paymaster
        • JavaScript/ TypeScript
    • LYNC Unity SUPRA SDK
    • Wallet Creation and Transaction APIs
      • Pre-requisites
      • Integration
        • API Overview
        • Create a new wallet
        • Get already created wallet
        • Mint NFT transactions
  • Fuel
    • LYNC Unity Fuel SDK
    • LYNC NFT Deployer
      • Introduction
      • Getting Started
      • Deploying Your NFTs
        • Launch Your Entire Collection
      • Troubleshooting and FAQs
    • LYNC Fuel Lootbox
      • Getting Started
      • Creating a Lootbox
      • Opening a Lootbox
      • Claiming the Rewards
      • Conclusion
    • Wallet Creation and Transaction APIs
      • Pre-requisites
      • Integration
        • API Overview
        • Create a new wallet
        • Get already created wallet
    • Fuel Marketplace NPM SDK
      • Getting Started
      • Using the SDK
        • Using hooks to get the marketplace data
        • Using services provided by the SDK to list, buy, and manage tokens
        • Some useful functions provided by the SDK
        • Error codes for the SDK
        • Interfaces and Enums provided by the SDK
      • Support
  • Metis
    • Wallet Creation and Transaction APIs
      • Pre-requisites
      • Integration
        • API Overview
        • Create a new wallet
        • Get already created wallet
        • Mint NFT transactions
  • NPM Packages
    • Marketplace
      • Hook: useAllCollectionNFT
      • Hook: useAllBuyNFT
      • Hook: useAllOwnerNFT
      • Hook: useNFTDetails
      • Hook: useAllNFTForRent
Powered by GitBook
On this page
  • Functions Overview
  • 2. signOutUser: (logEnabled?: boolean) => Promise<SignOutUserReturn>
  • 3. getUserData: (email: string, network: MovementNetwork, apiKey: string, logEnabled?: boolean) => Promise<GetUserProfileReturn>
  • 4. movementTransaction: (args: MovementTransactionFuncArgs, apiKey: string, logEnabled?: boolean) => Promise<MovementTransactionReturn>
  1. Movement Labs
  2. LYNC Social Login SDK on Movement

Using the SDK

In this Section, you will learn what are the functions provided by the SDK to integrate authentication, user management, and Movement transaction execution into your project.

Functions Overview

  1. signInWithGoogle: (network: MovementNetwork, apiKey: string, logEnabled?: boolean) => Promise<SignInWithGoogleReturn>

const signInWithGoogle: (network: MovementNetwork, apiKey: string, logEnabled?: boolean) => Promise<SignInWithGoogleReturn>

This function allows users to sign in with Google using OAuthProvider.

* @param {MovementNetwork} network - The network on which the transaction will be executed.
* @param {string} apiKey - Your API key generated from the {@link https://dashboard.lync.world|LYNC dashboard}.
* @param {boolean} [logEnabled=true] - Enable/disable logging. The default is true.

* @returns {object} SignInWithGoogleReturn - Returns an object with the success status and the user data or error message.

* @typedef {enum} MovementNetwork - { Mainnet = 1; Testnet = 2; Devnet = 3; }
* @typedef {object} SignInWithGoogleReturn - { success: true; user: ParsedUserData } | { success: false; message: string };
* @typedef {object} ParsedUserData - { email: string; avatar: string; name: string; accountAddress: string; providerId: string; id: string; privateKey: string; network: "Mainnet" | "Testnet" | "Devnet"; }

2. signOutUser: (logEnabled?: boolean) => Promise<SignOutUserReturn>

const signOutUser: (logEnabled?: boolean) => Promise<SignOutUserReturn>

This function is used to sign out a user from the application. It uses Firebase's signOut function to sign out the user.

* @param {boolean} [logEnabled=true] - Enable/disable logging. The default is true.

* @returns {object} SignOutUserReturn - Returns an object that contains a success status and (optionally) an error message.
 
* @typedef {object} SignOutUserReturn - { success: true } | { success: false; message: string };

3. getUserData: (email: string, network: MovementNetwork, apiKey: string, logEnabled?: boolean) => Promise<GetUserProfileReturn>

const getUserData: (email: string, network: MovementNetwork, apiKey: string, logEnabled?: boolean) => Promise<GetUserProfileReturn>

This function is used to get the user data from the server using the getUserProfile function.

* @param {string} email - The email address of the user.
* @param {MovementNetwork} network - The network on which the transaction will be executed.
* @param {string} apiKey - Your API key generated from the {@link https://dashboard.lync.world|LYNC dashboard}.
* @param {boolean} [logEnabled=true] - Enable/disable logging. The default is true.

* @returns {object} GetUserProfileReturn - Returns an object with the success status and the user data or error message.

* @typedef {enum} MovementNetwork - { Mainnet = 1; Testnet = 2; Devnet = 3; }
* @typedef {object} GetUserProfileReturn - { success: true; data: ParsedUserData } | { success: false; message: string };
* @typedef {object} ParsedUserData - { email: string; avatar: string; name: string; accountAddress: string; providerId: string; id: string; privateKey: string; network: "Mainnet" | "Testnet" | "Devnet"; }

4. movementTransaction: (args: MovementTransactionFuncArgs, apiKey: string, logEnabled?: boolean) => Promise<MovementTransactionReturn>

const movementTransaction: (args: MovementTransactionFuncArgs, apiKey: string, logEnabled?: boolean) => Promise<MovementTransactionReturn>

This function will initiate and execute a transaction on the specified Movement network and return an object containing a success status and transaction result or an error message.

* @param {MovementTransactionFuncArgs} args - The arguments required to execute the generic transaction on the Movement blockchain.
  * @param {string} args.email - The email of the user.
  * @param {MovementNetwork} args.network - The network type enum (MovementNetwork).
  * @param {string} args.apiKey - Your API key generated from the {@link https://dashboard.lync.world|LYNC dashboard}.
  * @param {string} args.accountAddress - The wallet address of the currently signed-in user.
  * @param {string} args.contractAddress - The contract address.
  * @param {string} args.contractName - The contract name.
  * @param {string} args.functionName - The function name.
  * @param {Array} args.arguments - The arguments for the transaction.
    * @param {Object} args.arguments[].argument - The argument used by the function.
    * @param {TransactionArgumentTypes} args.arguments[].type - The type of the argument. Can be TransactionArgumentTypes.String, TransactionArgumentTypes.Number, TransactionArgumentTypes.Boolean, TransactionArgumentTypes.ByteArray, or TransactionArgumentTypes.Signature.
  * @param {boolean} [args.usePaymaster=false] - Enable/disable the use of paymaster. If enabled, the transaction will be sponsored. If the wallet doesn't exist, it will be created automatically before the transaction.

* @param {string} apiKey - Your API key generated from the {@link https://dashboard.lync.world|LYNC dashboard}.
* @param {boolean} [logEnabled=true] - Enable/disable logging. The default is true.


* @returns {object} MovementTransactionReturn - Returns an object with the success status and the transaction data or error message.

* @typedef {enum} MovementNetwork - { Mainnet = 1; Testnet = 2; Devnet = 3; }
* @typedef {object} MovementTransactionFuncArgs - { email: string; accountAddress: string; network: MovementNetwork; apiKey: string; contractAddress: string; contractName: string; functionName: string; arguments: Array<MovementTransactionArguments>; usePaymaster?: boolean; }
* @typedef {object} MovementTransactionArguments - { argument: string; type: TransactionArgumentTypes }
* @typedef {enum} TransactionArgumentTypes - { String = 1; Number = 2; ByteArray = 3; Signature = 4; Boolean = 5; }
* @typedef {object} MovementTransactionData - { transactionHash: string }
* @typedef {object} MovementTransactionReturn - { success: true; data: MovementTransactionData } | { success: false; data: string }
 

PreviousGetting StartedNextExample Codes in React & TypeScript

Last updated 3 months ago