Startrail APIs
  • 🛫Startrail PORT: All in one document for API/SDK
    • 🔀URL per environment
  • Issue transfer api
    • 📬Issue & Transfer SRR (NFT)
      • Request Signed URL for Upload/Download Files
      • File Information Metadata
      • Issue & Transfer
      • Webhook Setup
    • 📂Collection
      • Create Collection
      • Get Collection of LUW
    • 📢Change Logs
      • v1.2.0
      • v1.1.0
      • v1.0.1
  • Metadata Schema
    • 🪅Startrail Registry (SRR)
      • Version 2.2
      • Version 2.1
      • Version 2.0
    • 📤Transfer
      • Version 1.2
      • Version 1.1
      • Version 1.0
    • ☸️Custom History
      • Custom History of Exhibition
        • Version 1.2
      • Custom History of Auction
        • Version 1.3
      • Custom History of Appraisal
        • Version 1.1
      • Custom History of Restoration
        • Version 1.0
      • Custom History of Offchain
        • Version 1.1
  • Get SRR API
    • Get Owned SRRs
    • Get SRR by Collection contract address and Token Id
      • 🚫Get SRR by Token Id
    • Description Of SRR Data
  • Ethereum Signature Validator API
    • 🔏Ethereum Signature Validator API
      • Change Logs
  • Startrail SDK Js
    • 🔰Introduction
    • 🏃Getting Started
      • RPC endpoint and chainId
    • 💳Wallet Methods
    • 🔮Startrail API Methods
      • Add Custom Histories To SRRs
      • Approve SRR By Commitment
      • Bulk
      • Check ERC2981 Royalty
      • Create Collection
      • Convert Metadata
      • Create SRR
      • Transfer Collection Ownership
      • Transfer SRR To Ethereum Address
      • Transfer From With Provenance
      • Update Metadata
    • 📱Login Providers
      • Interface
      • Whitelabeling/Customizing
        • Email Password
      • Hints
      • Multi Factor Account Management
    • 🦊MetaMask
    • 🎎Authentication Integration
    • 👾Errors
    • 📢Change logs
      • v1.35.0
      • v1.34.0
      • v1.33.2
      • v1.33.1
      • v1.32.0
      • v1.31.1
      • v1.30.6
      • v1.30.5
      • v1.30.4
      • v1.30.3
      • v1.30.2
      • v1.30.1
      • v1.30.0
      • v1.29.1
      • v1.29.0
      • v1.28.2
      • v1.28.1
      • v1.28.0
      • v1.27.1
      • v1.27.0
      • v1.26.0
      • v1.25.2(Security Patch)
  • Startrail API
    • 💱Transfer SRR Ownership By RevealHash
    • Get Transaction Data
    • Get Metadata By tokenid
  • Subgraph
    • 📊A introduction of subgraph
    • How to retrieve SRR metadata
Powered by GitBook

©2023 Startbahn, Inc.

On this page
  • login
  • Arguments
  • Returns
  • Example
  • getUserInfo
  • Returns
  • Example
  • signMessage
  • Arguments
  • Returns
  • Example
  • switchLanguage
  • Arguments
  • Returns
  • Example
  • logout
  • Returns
  • Example

Was this helpful?

  1. Startrail SDK Js

Wallet Methods

To know Web3 wallet relevant methods in Startrail-Sdk-Js

login

Authenticate a user and allocate EOA.

Following arguments can be passed to overwrite the configuration originally set at the instantiation.

Arguments

Parameter
Type
Mandatory
Description

authAction

{ login: boolean signup: boolean }

Optional

Client ID of Auth0 account

lang

'ja' | 'en'

Optional

Language displayed on the UI

loginProvider

['google' | 'email_passwordless' | 'facebook' | 'twitter' | 'line' | 'apple' | 'email_password']

Optional

Login providers for SSO(Single Sign-On)

Returns

Promise<string[] | false>: An object containing user information.

Example

await startrailSdk().login()

Distinct EOAs are assigned for each login provider, regardless of whether the same email is utilized for authentication methods, such as Google and Email Passwordless.

To prevent duplicate registration of accounts with the same email and different EOAs, it is recommended that your application rejects duplicate email registrations on your application side.

getUserInfo

Get the logging-in user information.

Returns

Promise<UserInfo | false>: The promise resolves upon the request success and rejects with a specific error code if the request fails.

Value
Type
Description

email

string

name

string

If selected social login knows your name

profileImage

string

If selected social login knows your profile image

typeOfLogin

'google' | 'email_passwordless' | 'facebook' | 'twitter' | 'line' | 'apple' | 'email_password'

Selected social login type

wallet

'startrail' | 'metamask'

Selected wallet type

verifier

string

Web3Auth only feature. It determines your EOA.

verifierId

string

Web3Auth only feature. Verifier Id of the logged in user if your selected wallets knows it

isNewUser

boolean

Web3Auth only feature. Returns if the logged in user is new to Torus wallet which supports Startrail login

Verifier is an identifier that determines EOA in Web3Auth network.
It is only returned under Web3Auth service.

See more details for the Login Providers

Example

await startrailSdk().getUserInfo()
// Response example
// Google Login
{
  email: "sample@example.jp"
  name: "your Google account name"
  profileImage: "https://lh3.googleusercontent.com/a/image_on_google_account"
  typeOfLogin: "google"
  verifier: "google"
  verifierId: "sample@example.jp",
  wallet: "startrail",
  isNewUser: false // Returns if the logged in user is new to Torus wallet
}
// Email&Passwordless
{ 
  email: "sample@example.jp"
  name: "sample@example.jp"
  profileImage: "https://s.gravatar.com/avatar/image_of_default_auth0_icon.png"
  typeOfLogin: "email_passwordless"
  verifier: "torus-auth0-email-passwordless"
  verifierId: "sample@example.jp",
  wallet: "startrail",
  isNewUser: false // Returns if the logged in user is new to Torus wallet
}

signMessage

Sign message with the Ethereum private key associated to your wallet

Arguments

Parameter
Type
Mandatory
Description

message

string

Required

A message to be signed

disableCustomPrefix

string

Optional

Returns

Promise<{signature: string, prefix: string | false} | false>:

Example

await startrailSdk().signMessage('sample')

switchLanguage

Switch language for Web3Auth wallet UI

Arguments

Parameter
Type
Mandatory
Description

lang

"ja" | "en"

Required

Web3Auth only feature to switch language

Returns

Promise<void | false>

Example

await startrailSdk().switchLanguage("ja")

logout

Logout from the wallet.

Returns

Promise<void | false> The promise resolves upon logout request success and rejects with a specific error code if the request fails.

Example

await startrailSdk().logout()

About Page reload and data persistency

  • Wallet information is stored in browser session storage under Torus service domain.

  • As SDK instance is gone at page reload, it's no longer available unless it is instantiated again. User, however, does not require additional login process to trigger its function call since the session between Torus node and Authenticator keeps maintained until sdk.logout function is called

PreviousRPC endpoint and chainIdNextStartrail API Methods

Last updated 1 year ago

Was this helpful?

If selected social login allows email sharing. See more details in

Web3Auth only feature to skip singing popup. See more

💳
Login Providers
details here