Giter Site home page Giter Site logo

blocto / blocto-sdk Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 10.0 7.44 MB

Integrate with Blocto wallet on Arbitrum, Optimism, Aptos, Polygon, BNB Chain, Avalanche and Ethereum.

Home Page: https://docs.blocto.app/

License: MIT License

JavaScript 25.87% HTML 2.57% TypeScript 71.50% Shell 0.06%
aptos arbitrum avalanche blocto bnb bnb-chain bnb-smart-chain ethereum optimism polygon

blocto-sdk's People

Contributors

akira02 avatar boczeratul avatar dependabot[bot] avatar github-actions[bot] avatar jordaaash avatar monsonjeremy avatar moojing avatar mordochi avatar q20274982 avatar sanyu1225 avatar scottphc avatar yanglin5689446 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blocto-sdk's Issues

Authentication feature for multiple account same device login

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.

7ba888e7cdd2e274c5894e352548c89d

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

87e114e3eb5ae48e1c5afc94e3a03143

Also, if there is already a workaround solution, could someone please guide me on how to overcome this issue?

Error: An interface property cannot have an initializer

The published TypeScript definitions seem to contain an error:

../../../node_modules/@blocto/sdk/dist/blocto-sdk.d.ts:17:25 - error TS1246: An interface property cannot have an initializer.

17   code: string | null = null;

Screen Shot 2021-12-12 at 5 21 10 PM

This is using "@blocto/sdk": "^0.2.20".

setting RPC urls when initializing

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

Use different session keys for different environments

The issue

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

Possible solution

Use different LocalStorage keys across different networks

Request: Temporary accounts on Testnet

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.