blocto / blocto-sdk Goto Github PK
View Code? Open in Web Editor NEWIntegrate with Blocto wallet on Arbitrum, Optimism, Aptos, Polygon, BNB Chain, Avalanche and Ethereum.
Home Page: https://docs.blocto.app/
License: MIT License
Integrate with Blocto wallet on Arbitrum, Optimism, Aptos, Polygon, BNB Chain, Avalanche and Ethereum.
Home Page: https://docs.blocto.app/
License: MIT License
I am currently allowing users to log in/signup by using the fcl API to interact with blocto.
Assume we have users A and B who both use the same device.
User A logs into his account to do some transactions then logs out and leaves the device. User B then tries to log in but when he presses the login button, they see the following.
So now User B can either press confirm and log into user's A account or click the "use Another Account" button to log into his account.
What is mentioned above is very inconvenient especially if a user has multiple accounts and wants to perform transactions on one account but presses "confirm" by mistake and accidentally performs the transactions on a different account.
What I am asking is if there is a way to the following whenever a user presses the login button
Also, if there is already a workaround solution, could someone please guide me on how to overcome this issue?
When creating a bloctoSDK instance, would it be possible to pass all RPC and chains we want to potentially use? to avoid using wallet_addEthereumChain
on the flow? I'm not sure if this makes sense, I'm currently exploring Blocto wallet.
I mean something like this
import BloctoSDK from '@blocto/sdk'
const bloctoSDK = new BloctoSDK({
ethereum: {
1: 'https://mainnet.infura.io/v3/YOUR_INFURA_ID',
5: 'https://rpc.ankr.com/eth_goerli',
},
// (optional) Blocto app ID
appId: 'YOUR_BLOCTO_APP_ID',
});
Thanks
Currently the login session preservation uses the same key in LocalStorage
, across different environments (mainnet vs. testnet)
https://github.com/portto/blocto-sdk/blob/30635a0fbad005c36c4d56e9d3fd7582b9f5632f/src/providers/blocto.ts#L18
For developers that are testing the same site domain (i.e. localhost:3000
) and is switching between networks, the login session may be mixed up and cause troubles
Use different LocalStorage
keys across different networks
I'm integrating Flow/FCL with Blocto. Testing new user flow is a pain because my email is already tied to a wallet, and blocto too clever to allow [email protected]
.
A testnet only feature to have temporary/ephemeral wallets would be appreciated.
It can actually be replaced by adding once
option in addEventListener
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
I followed install instructions but
https://localhost:7777/test.html returns a 404
Due to the local storage code using window at the top level without checking if it exists, server side static renders on NextJS are failing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.