Giter Site home page Giter Site logo

suiet / wallet-kit Goto Github PK

View Code? Open in Web Editor NEW
148.0 7.0 52.0 10.32 MB

The first choice to connect all wallets on Sui blockchain

Home Page: https://kit.suiet.app

License: MIT License

TypeScript 90.99% SCSS 4.95% JavaScript 2.54% CSS 1.24% HTML 0.25% Shell 0.03%
sui wallet wallet-adapter wallet-kit

wallet-kit's Introduction

Suiet wallet kit, connection made easy

👋 If you want to know how to install/use suiet, please visit our offical website suiet.app or docs

Suiet wallet kit is an awesome react toolkit for DApps to interact with all the wallets in Sui💧 easily 🥳

Now we announce the Sui Wallet Standard is supported ✅ Update to the latest kit version and empower your dapp with auto-detect-wallet feature 🥳

⭐️ That means with our kit, your dapp can automatically detect all the installed wallets which implement wallet-standard in users' browser, rather than manually importing specific wallet adapter.

We present React Provider & Hooks, UI components for the DApp (React) developers to connect your DApp and all the wallet extensions 🔗 Integration solution or customization are both supported ✅

Documentation

See https://kit.suiet.app/docs/QuickStart

💡 Have fun with Demo Playground + Vite example repo

wallet-kit's People

Contributors

bruceeewong avatar chendatony31 avatar chiumungzitalexander avatar cijiugechu avatar dekura avatar dependabot[bot] avatar fredliang44 avatar frontierpawan avatar github-merge-queue[bot] avatar hzy avatar i-am-neon avatar leanllg avatar loclanhlung avatar pantinho avatar pawel-szydlo avatar renovate[bot] avatar shayha271097 avatar vidorge avatar web3jt 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

wallet-kit's Issues

devnet can not execute transaction today

my code does not change, it worked well last night, and today does not work
error code:

Error: [WALLET.SIGN_TX_ERROR] Cannot read properties of null (reading 'parameters')
at sa.signAndExecuteTransactionBlock (index.js:9994:13)
at async Object.signAndExecuteTransactionBlock (index.js:10298:12)

Suiet Modal needs a transition when popping up

This is not a issue, but rather an improvement request.

Modal is popping up instantly, yes you can fix that by adding transition of your own.
But this can be done internally with framer-motion or headless-ui, and can be added a 300-500ms transition when entering dom or leaving dom

This can make user experience more great, while making the modal more look great.

Error when signtransaction in Sui wallet in version @suiet/[email protected]

Uncaught (in promise) Error: Transaction failed with the following error. Error executing transaction with request type: Error: RPC Error: The response returned from RPC server does not match the TypeScript definition. This is likely because the SDK version is not compatible with the RPC server. Please update your SDK version to the latest. Result received was: {"EffectsCert":{"certificate":{"transactionDigest":"FZ5ZdgXupt52DsR35SQzsfp9HDZu5U8xtGD3pavvh5mM","data":{"transactions":[{"Call":{"package":{"objectId":"0x9d4ec0c375dd96f27eb209fc4700072b9dbc6d64","version":1,"digest":"TLp6TWHzgmk8eFANJrK+d3fYiQaegJ09wqMKk/nq7Ck="},"module":"cf123","function":"init_inventory_and_listing"}}],"sender":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978","gasPayment":{"objectId":"0x09a29d48a9682ac361d4f5e1ee72828ec0c5d259","version":990,"digest":"NorStp5nsHPFE8PWWKIPoLDxXb9+aThLnREygo92Ag4="},"gasPrice":109,"gasBudget":10000},"txSignature":"AKd6MplFgJW/KZ98p896My8MaDnQ7rvoWgeLW92KhmH8A+oQ/u9lesSGZDAIV0ywkwU2rVA65edWMFGbycHTvgCrXQbO2LG8ily1zHN1CBRZopIYEV/tfP2U/21B+G8IgQ==","authSignInfo":{"epoch":5,"signature":"AZULiW41vwfeodnCe4GOLivC8yILX3OaCqOTMU0ZhuR2mVniPqcAldygikyuXGmIfA==","signers_map":[58,48,0,0,1,0,0,0,0,0,26,0,16,0,0,0,0,0,1,0,4,0,6,0,7,0,8,0,10,0,11,0,12,0,14,0,15,0,18,0,19,0,20,0,22,0,24,0,25,0,27,0,29,0,31,0,32,0,33,0,35,0,36,0,37,0,39,0,40,0]}},"effects":{"transactionEffectsDigest":"Nu/gLCN43wv4+jen2J3MzgT8g6JOxIbm18I69oJ67PM=","effects":{"status":{"status":"success"},"gasUsed":{"computationCost":32809,"storageCost":58,"storageRebate":16},"transactionDigest":"FZ5ZdgXupt52DsR35SQzsfp9HDZu5U8xtGD3pavvh5mM","created":[{"owner":{"Shared":{"initial_shared_version":991}},"reference":{"objectId":"0x0964fc427475a849a254c4b104d650112a22e4a7","version":991,"digest":"wz6kZY1zcDbPeQKkhMaln6UtjLuPXRfYxbGl42xcq1o="}},{"owner":{"AddressOwner":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978"},"reference":{"objectId":"0xdcc1a2cfff8fedd90627125210766eda8a8cda0e","version":991,"digest":"9nuMifbsi0ZvJgA8SVDvEqa91b8Vg9Ub2BR9H5seWLw="}}],"mutated":[{"owner":{"AddressOwner":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978"},"reference":{"objectId":"0x09a29d48a9682ac361d4f5e1ee72828ec0c5d259","version":991,"digest":"nh0qi+Y73k9SNKkg3mbqjsIKFxrPkF5AKPQ2TQ9nESU="}}],"gasObject":{"owner":{"AddressOwner":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978"},"reference":{"objectId":"0x09a29d48a9682ac361d4f5e1ee72828ec0c5d259","version":991,"digest":"nh0qi+Y73k9SNKkg3mbqjsIKFxrPkF5AKPQ2TQ9nESU="}},"events":[{"coinBalanceChange":{"packageId":"0x0000000000000000000000000000000000000002","transactionModule":"gas","sender":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978","changeType":"Gas","owner":{"AddressOwner":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978"},"coinType":"0x2::sui::SUI","coinObjectId":"0x09a29d48a9682ac361d4f5e1ee72828ec0c5d259","version":990,"amount":-32851}},{"newObject":{"packageId":"0x9d4ec0c375dd96f27eb209fc4700072b9dbc6d64","transactionModule":"cf123","sender":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978","recipient":{"Shared":{"initial_shared_version":991}},"objectType":"0x3a36e10ffd9a68382320aa06665eb4b3635812c6::listing::Listing","objectId":"0x0964fc427475a849a254c4b104d650112a22e4a7","version":991}},{"newObject":{"packageId":"0x9d4ec0c375dd96f27eb209fc4700072b9dbc6d64","transactionModule":"cf123","sender":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978","recipient":{"AddressOwner":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978"},"objectType":"0x3a36e10ffd9a68382320aa06665eb4b3635812c6::inventory::Inventory","objectId":"0xdcc1a2cfff8fedd90627125210766eda8a8cda0e","version":991}},{"moveEvent":{"packageId":"0x9d4ec0c375dd96f27eb209fc4700072b9dbc6d64","transactionModule":"cf123","sender":"0xacd021b72dab0bfccad015b9e55dd8a8acb5d978","type":"0x3a36e10ffd9a68382320aa06665eb4b3635812c6::listing::CreateListingEvent","fields":{"listing_id":"0x0964fc427475a849a254c4b104d650112a22e4a7"},"bcs":"CWT8QnR1qEmiVMSxBNZQESoi5Kc="}}],"dependencies":["82aghwoeykMk7FAg8XEZPGJFRPQyayxJhL86Zn2feqCZ","CjSTMRMcCn5z2dhmqFimwF2hxqwxZf11NKfKSouuYNSr"]},"authSignInfo":{"epoch":5,"signature":"AbjKTp0Ww12Xqj4zXQp1uRTHaZDWoj+Rj7PAzWxdlzLYWs06zcbvyv1Q167tRC4neA==","signers_map":[58,48,0,0,1,0,0,0,0,0,28,0,16,0,0,0,0,0,1,0,3,0,4,0,7,0,8,0,10,0,11,0,12,0,13,0,14,0,16,0,18,0,19,0,20,0,22,0,24,0,25,0,26,0,27,0,28,0,29,0,30,0,31,0,32,0,33,0,35,0,39,0,40,0]}},"confirmed_local_execution":true}}

Suiet Modal need to change CSS of Scrollbar

This is not a issue, but rather an improvement request.

Right now scrollbar look like this in my ubuntu computer(might look different in mac pcs):
image

Can we change this scrollbar to be more fit in modal? I have no issues with the result of this, but this scroll can be changed to something more smooth. Example can be gotten from suicoins(shoutout to jose and his team):
image

This can make modal look modern in case of linux/windows type of computers.

useWallet does not identify installed wallets correctly

configuredWallets attribute does not identify installed wallets correctly.

While having 'GlassWallet' extension installed the hook still returns installed as false.
{name: 'GlassWallet', iconUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAA…fDrA16c3sXFqPP9KFPa78f3JWYVNfaX2rAAAAAElFTkSuQmCC', downloadUrl: {…}, adapter: undefined, installed: false}

installed should be true in this case.

This has been reported for following wallets: GlassWallet, OneKey Wallet, Spacecy Sui Wallet a Surf Wallet
So far, I have tested with just the GlassWallet

Error: [WalletError] Permission rejected

Can I detect using the useWallet hook when the user rejects the connection to the wallet.

image
image

Maybe you have some method for this? I didn't find it in the documentation.

Disconnect wallet error

In one of my projects I'm receiving an error when try to disconnect suiet wallet:
TypeError: Cannot read properties of undefined (reading 'address')
2022-12-28 16 31 58

How to verify signMessage in golang?please give me a suggestion

import {useWallet} from '@suiet/wallet-kit'
import * as tweetnacl from 'tweetnacl'

function App() {
  const wallet = useWallet();

  async function handleSignMsg() {
    try {
      const msg = 'Hello world!'
      // convert string to Uint8Array 
      const msgBytes = new TextEncoder().encode(msg)
      
      // call wallet's signMessage function
      const result = await wallet.signMessage({
        message: msgBytes
      })
            // verify signature with publicKey and SignedMessage (params are all included in result)
      const verifyResult = await wallet.verifySignedMessage(result, wallet.account.publicKey)
      if (!verifyResult) {
        console.log('signMessage succeed, but verify signedMessage failed')
      } else {
        console.log('signMessage succeed, and verify signedMessage succeed!')
      }
    } catch (e) {
      console.error('signMessage failed', e)
    }
  }

  return (
    <button onClick={handleSignMsg}> Sign Message </button>
  )
}

前端可以使用 wallet.signMessage签名消息,再使用wallet.verifySignedMessage进行验证。那么我在go中,如何验证wallet.signMessage的结果。其中前端使用了wallet.signMessage给我的result,result包含如下:

"message": "Hello world!",
"signature":"ACgj38Kr1bJU74jxiHPTDIIcxr9UG6WftgWol9iF6I3ai1NRWuob603NazIdJJ0qhP8U5yA67FbYbZb59dbqygK1rQTxoTF1RH+j0mc5ILiRdAW2jX2OKecqYuDbBFN0NQ=="

how to handle list a NFT objects to marketplace

Relation issue here.
I try to list an NFT to my marketplace with the common flow with coin type the summary will show the value of the coin we need and confirm, but with NFT objects I see nothing happen and after submitting the transaction the error is VMVerificationOrDeserializationError if have some docs relate with this issue please let me see.
Please support me, sorry if the question too noob.

how

Currently unable to connect to Sui MetaMask Snap, are there any plans to support it in the future?

signPersonalMessage can't result valid signature

Problem

Can @suiet/wallet-kit support wallet switch?

simple code below

wallet.adapter?.signPersonalMessage({ account: account!, message: new TextEncoder().encode('HelloXXX') })

Let's say I've logged in to a wallet now, and there's a ListBox comp in the upper right corner of my page to switch wallet addresses, when I switch, I call thesignPersonalMessage method, and then request the API after getting the signature, but I find that I can't get a valid signature using SignPersonalMessage

const verifyResult = await wallet.verifySignedMessage(res, account.publicKey)
console.log('verify signedMessage', verifyResult)  // is false

JS this context error

When I use the following writeup it is called successfully.

  const provider = useSuiProvider(SuiConfig.rpc)
  provider.getBalance({ owner: address, coinType: '0x2::sui::SUI' })  

But when I unfolded it, The "client" does not exist.

 const { getBalance } = useSuiProvider(SuiConfig.rpc)
 getBalance({ owner: address, coinType: '0x2::sui::SUI' })  

I have enough money, but it says I don't have enough gas

image

My money is all in one place, how can I split it up and use it for gas?

image

image

When I put the two operations of splitting the money and executing the transaction together, it failed, and the reason for the error was still not enough gas

Can I use this repo to check wallet balance and transfer some funds?

Hello:
I found there is web browser extension wallet: Suiet Wallet, and I want to know the following:
Does the wallet support tokens (like USDT) on HECO chain?
Can I use the repo (do you have NPM for Node.js?) to check wallet balance and transfer received funds to another address via different network: like receive USDT via HECO network, and send to another address via ERC20/BEP20 network?
Please advise,

Can't get balance

I always get zero balance even though my wallet still have money, a few days ago it still shows the balance, anyone know what the problem is?

[Bug] The Suiet Wallet never pop up

Then i use wallet-kit. the Suiet well not be pop up.

The dome in here : https://sui.best/

You can connect and Filp.

This is we got error:

[SUIET_WALLET]: dapp.signAndExecuteTransaction failed Error fetching function: Error: RPC Error: invalid type: null, expected a string at line 1 column 4 for package undefined, module undefined and function undefined}

the core code is here.
same code working with SUI wallet.

      const data = {
        inputCoins: newObject,
        recipients: ['0x111111'],
        amounts: [100000000 * amount],
        gasBudget: 10000
      };

      console.log(data)

      const resData = await signAndExecuteTransaction({
        transaction: {
          kind: 'paySui',
          data: data
        }
      });

Not working with Next.js 13

Next.js 13 no longer supports any polyfills, but this package contains the whatwg-fetch polyfill (probably came from sui.js), so there is an incompatible issue:

Collecting page data .TypeError: Cannot set property Headers of #<Object> which has only a getter

I am not sure what's the best solution. Maybe add a new build that doesn't include the fetch polyfill? For example, adding the following code to vite.config.ts

external: ["react", "react-dom", "cross-fetch", "cross-fetch/polyfill"],

Dry run failed, could not automatically determine a budget

I have this problem, how can I solve it
Dry run failed, could not automatically determine a budget: MoveAbort(MoveLocation { module: ModuleId { address: 773b0bc40977f923354c53c85957e3f2f55149d1a4d2797d0bb5758db48a50c3, name: Identifier("nft_stake") }, function: 9, instruction: 20, function_name: Some("stake") }, 2) in command 1 (code: -1)

Property '#private' in type 'TransactionBlock' refers to a different member that cannot be accessed from within type 'TransactionBlock'.

`

async function handleSignAndExecuteTxBlock() {

if (!wallet.connected) return;

// define a programmable transaction
const tx = new TransactionBlock();

const packageObjectId = "0xXXX";

tx.moveCall({
  target: `${packageObjectId}::nft::mint`,
  arguments: [tx.pure("Example NFT")],
});

try {
  // execute the programmable transaction
  const resData = await wallet.signAndExecuteTransactionBlock({
    transactionBlock: tx,
  });
  console.log("nft minted successfully!", resData);
  alert("Congrats! your nft is minted!");
} catch (e) {
  console.error("nft mint failed", e);
}

}
`
error

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/cicd.yaml
.github/workflows/exp-cicd.yaml
.github/workflows/website.yaml
npm
package.json
packages/kit/package.json
  • @mysten/sui.js 0.51.2
  • @mysten/wallet-standard 0.11.2
  • @wallet-standard/core 1.0.3
  • @mysten/sui.js 0.51.2
packages/sdk/package.json
  • @mysten/sui.js 0.51.2
  • @mysten/wallet-standard 0.11.2
  • @mysten/sui.js 0.51.2
website/package.json
  • @mysten/wallet-adapter-sui-wallet 0.3.0
  • @mysten/wallet-standard ^0.11.0

  • Check this box to trigger a request for Renovate to run again on this repository

Autoconnect wallet

If we have autoconnect enabled .

  1. Use the wallet.disconnect() method and the wallet is disconnected.
  2. Reload the browser page and the wallet is connected again without an approval request.
  3. If I reconnect to a wallet that was already connected before, then the authentication of the login to the wallet is also not requested.

Cannot convert a BigInt

After switching from "@suiet/wallet-kit": "^0.1.26" to "@suiet/wallet-kit": "^0.2.4" I didn't have any problems locally. But after deploying the react js application to the server, the application broke with such an error.

image

image

npm install '@suiet-wallet' not found

Hello I am trying to use useAccountBalance hook, but seems like I cannot get the correct library.
I can access useWallet hook from '@suiet/wallet-kit' but not useAccountBalance.
Is the '@suiet/wallet' currently not published or is there other way to use the hook?
I am following the instructions from the Suiet Wallet Kit documentation.
Thank you.

Does not work well with next.js 12 and 13 versions in production build

Hello! When I using next.js in develpoment ENV everything is ok, useWallet working well, I got right statuses.

Let's make that code:

  const wallet = useWallet();
  useEffect(() => {
    console.log(wallet?.status)
  }, [wallet?.status])

image

Everything is OK.

BUT I caught the bug, when I make next.js production build yarn build thent yarn start. Sometimes wallet status freeze in connecting status.
I thought maybe that some bugs on blockchain. But I try to investigate it, and I thought it bug in the your package.

I understand how to reproduce that bug always:

That bug is very annoying for me, I and my team saw it every day (without throttling). Can you fix it?

Thank you.

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.