Untitled
@startbahn/startrail-sdk-js
What can you do with the SDK?
- Allocates and manages EOA
- Signs a message with a user's Ethereum private key
- Call Blockchain Tx (eg. execute secondary transfer)
System flow to get EOA + to authenticate
Implementation Details of above Flow at No9. 上記フローチャートNo9の詳細
// ① DBからEOAを元に最初に生成し文字列を取り出す
// ① Fetch the originally generated string that was passed to the user
const originalMessage = await this.findOne(eoa)
let messageToBeSigned
if (prefix) {
// ② DBから取得したoriginalMessageを基に実際に署名を行った文字列を復元する
// ② Restore the messageToBeSigned, from the originalMessage, that was signed inside Startrail-sdk-js.
messageToBeSigned = `${prefix}${originalMessage.length.toString()}${originalMessage}`;
} else {
// ポップアップを隠さない場合も考慮し、prefixがundefinedである場合のロジックも記述
// Write the logic in case the prefix is undefined given the usecase that popup is not hidden
messageToBeSigned = originalMessage
}
// HTTP call to Validator-API (message: messageToBeSigned, signature, address )
Wallet
Available Method To Login |
Documents to check |
Google |
‣ |
Email&Password |
‣ |
MetaMask |
‣ |
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 / SDKインスタンスはページリロード時にアプリケーション上から消えてしまうため、それ以降は再インスタンス化を行わないと使用できなくなってしまう。しかし
sdk.logout()
が実行されない限りは、Torusドメインと認証サービスとの間でセッションは持続し、追加のログイン・プロセスの必要なしにSDKの関数を実行することができます。
Functions
approveSRRByCommitment()