SDM JS SDK

SDM JS SDK an universal sdk for Dapp developer, compitable for web, iOS and Andriod.

Overview

Git Repo

API List

export interface PlatformInterface {
  // getAuthorizationCode: (clientId: string, url: string)=> IAuth;
  // getAccessToken: ()=> IAccessToken;
  /**
   * @params 
   */
  getMyProfile: (callback: (userProfile: UserProfile)=>void) => void;
  getUserProfile: (userId: string, callback: (userProfile: UserProfile)=>void) => void;
  getRoomInfo: (roomId: string, callback: (room: Room)=>void) => void;
  getMembers: (roomId: string, callback: (members: Member[])=> void) => void;
  getUserList: (userIds: string[], callback:(users: User[])=>void)=>void;
  getSquadInfo: (squadId: string, callback: (squadInfo: SquadInfo) => void) => void;
  getRoomMember: (roomId: string, userId: string, callback: (member: Member)=>{}) => void;
  getUserSquadInvitations: (roomId: string, userId: string, callback: ()=>void)=>void;
  sendMessage: (roomId: string, body: MessageBody, callback: (result: any)=>void)=>void;
}

Basic Flow

Feature APIs

API getMyProfile

  • Description
    • Get my profile, etc.
  • Call Method
        getMyProfile: (callback: (userProfile: UserProfile)=>void) => void;
    
  • Request
    • Required Params
      • request_type: <string> Request type (range: ‘code’)
      • client_id: <string> APP registered ID
      • redirect_uri: <string> APP registered redirect uri
    • Optional Params
  • Response
    {
        "authorization_code": "53ddd55b-c1c9-49b8-b623-xxx" 
    }
    
  • Example
     //SdmClient.fetchAuthorizeCode('code','1111111111111', 'https://lucky.socialswap.com', cb)