web-examples icon indicating copy to clipboard operation
web-examples copied to clipboard

feat: added tezos-provider dapp example

Open dianasavvatina opened this issue 1 year ago • 9 comments

Added an example of dApp for Tezos based on TezosProvider.

It supports the following operations:

  • get accounts
  • sign message
  • transaction
  • delegation, undelegation
  • origination
  • contract call
  • stake, unstake, finalize unstake
  • increase paid storage

Currently, TezosProvider is library by trilitech: https://github.com/trilitech/tezos-provider

To run dApp:

cd dapps/universal-provider-tezos
yarn install
yarn build
yarn dev

Then open http://localhost:5173/

TezosProvider allows to connect only one network at a time. Now connect a wallet, e.g. advanced/wallets/react-wallet-v2, react-wallet-v2. It was updated in #694 to allow one network.

Before connection Connected
image image

Operations

Type Screenshot
Get accounts image
Sign image
Send transaction image
Delegation image
Origination image
Contract call image
Stake image
Unstake image
Finalize unstake image
Error handling, e.g. if delegated twice image

dianasavvatina avatar Sep 05 '24 15:09 dianasavvatina

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
vue-web-examples ⬜️ Ignored (Inspect) Visit Preview Jan 6, 2025 1:30pm

vercel[bot] avatar Sep 05 '24 15:09 vercel[bot]

@dianasavvatina is attempting to deploy a commit to the WalletConnect Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Sep 05 '24 15:09 vercel[bot]

hi @dianasavvatina, can you guide me on how to test it ?

trust: only mainnet. temple wallet: didn't work kukai sallet: didn't work

also would you like using the same pattern as other examples for the directory ? universal-provider-tezos

rtomas avatar Nov 28 '24 12:11 rtomas

hi @dianasavvatina, can you guide me on how to test it ?

trust: only mainnet. temple wallet: didn't work kukai sallet: didn't work

also would you like using the same pattern as other examples for the directory ? universal-provider-tezos

Tezos blockchain is supported by several wallets but only one of them currently supports WalletConnect. It's Trust and it has a partial support for WalletConnect.

I'm working now on Umami web to support WalletConnect: https://github.com/trilitech/umami-v2/pull/2029 It's under review. I used Wallet provided by the WalletConnect to test the dapp example built with TezosProvider:

  • wallet: https://github.com/reown-com/web-examples/pull/694
  • dapp: https://github.com/reown-com/web-examples/pull/697
  • Umami web PR: https://github.com/trilitech/umami-v2/pull/2029

I can move the dapp to universal-provider-tezos if needed

dianasavvatina avatar Nov 29 '24 16:11 dianasavvatina

hi @dianasavvatina, can you guide me on how to test it ? trust: only mainnet. temple wallet: didn't work kukai wallet: didn't work

@rtomas , please use Umami for testing: https://umami-v2-web.vercel.app/

I think that Trust works with mainnet only. The problem is that the example wallet supports tezos:testnet as a test network though it's a bug: https://github.com/reown-com/web-examples/blob/main/advanced/wallets/react-wallet-v2/src/data/TezosData.ts#L31

export const TEZOS_TEST_CHAINS: Record<string, ChainMetadata> = {
  'tezos:testnet': {
    chainId: 'testnet',
    name: 'Tezos Testnet',
    logo: '/chain-logos/tezos.svg',
    rgb: '44, 125, 247',
    rpc: 'https://ghostnet.ecadinfra.com',
    namespace: 'tezos'
  }
}

But Tezos has ghostnet as a testnet. See here: https://docs.reown.com/cloud/chains/chain-list I fixed the wallet in https://github.com/reown-com/web-examples/pull/694 It's not merged yet but it will be compatible with the reference docs. See also CAIP-2 for Tezos, here

dianasavvatina avatar Dec 02 '24 11:12 dianasavvatina

I can move the dapp to universal-provider-tezos if needed

please, move it to that directory.

rtomas avatar Dec 03 '24 14:12 rtomas

Example: https://github.com/user-attachments/assets/5fee89dd-dc11-48a9-a6cc-1e000e4e28f8

dApp: this PR

wallet: Umami v2, web, PR#2029 This adaptation is incomplete. Umami doesn't support

  • increase paid storage
  • sign
  • get accounts

dianasavvatina avatar Dec 04 '24 16:12 dianasavvatina

@rtomas as you requested: Second example: https://github.com/user-attachments/assets/25a8a03f-6c51-40d3-b7af-d604a845d9d0

dApp - this PR

wallet - PR#694 it's also waiting for your review

dianasavvatina avatar Dec 04 '24 16:12 dianasavvatina

@rtomas please use Umami web for testing: https://umami-v2-web.vercel.app/

dianasavvatina avatar Jan 22 '25 16:01 dianasavvatina