GithubHelp home page GithubHelp logo

walletconnect / walletconnect-test-wallet Goto Github PK

View Code? Open in Web Editor NEW
168.0 30.0 118.0 4.1 MB

Test Wallet (Web)

Home Page: https://test.walletconnect.org/

License: MIT License

HTML 0.92% TypeScript 99.00% Shell 0.08%
walletconnect example test wallet mock sample browser web3 ethereum

walletconnect-test-wallet's Introduction

walletconnect-test-wallet

Test Wallet (Web)

Setup INFURA project id

An INFURA project id is required to run this project. Signup for a free INFURA project id here.

Once you have the project id, setup the environment variable in file .env.local as follow.

REACT_APP_INFURA_PROJECT_ID=<your infura project id>

Develop

npm run start

Test

npm run test

Build

npm run build

walletconnect-test-wallet's People

Contributors

21paradox avatar abstractpoint avatar arctek avatar chadyj avatar dependabot[bot] avatar ilanolkies avatar koirikivi avatar paouvrard avatar pedrouid avatar petertheone avatar pranjal1127 avatar rhlsthrm avatar yuetloo 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

walletconnect-test-wallet's Issues

eth_sendTransaction method fails on opensea

I am trying to initiate a sell request on opensea, sendTransaction method looks like this

`
const transaction = {
gasLimit: request.params[0].gas,
data: request.params[0].data,
gasPrice: request.params[0].gasPrice,
nonce: request.params[0].nonce,
to: request.params[0].to,
value: request.params[0].value,
};

  const result = await wallet.sendTransaction(transaction);
  await connector.approveRequest
  ({
    id: request.id,
    result: result
  });

`

On opensea it throws an error like this

Error: invalid hash (argument="value", value={"type":2,"chainId":80001,"nonce":31,"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x0fe0cd69c8"},"gasPrice":null,"gasLimit":{"type":"BigNumber","hex":"0xedce"},"to":"0x26CAa8530e8d0FA57931FEFc32165F2ffa65ab10","value":{"type":"BigNumber","hex":"0x00"},"data":"0xf242432a000000000000000000000000ca571a49f03458621dcdaa8d17030336c86f7dc80000000000000000000000001de1b2a7bf0bb71ac0457a20103b8852d8a134890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","accessList":[],"hash":"0x91f3bfac8c3de6ee750b44932adc32ff6077f3dbfcde6f04cd86f959103cab31","v":0,"r":"0xd05f262ef378af385d084a1ff1462c973c76093d4b4de725abdaae028b4583a7","s":"0x77b4120107deaf67dd7cc9e1a31e

Access to XMLHttpRequest at 'https://ropsten.infura.io/v3/%API_KEY%' origin 'https://localhost:3000' has been blocked by CORS policy:

I start walletconnect-test-wallet from localhost and
access local host https://localhost:3000/ but chrome console show below,
can not get balance from ropsten.

HTTPS=true SSL_CRT_FILE=cert.crt SSL_KEY_FILE=cert.key npm start

Access to XMLHttpRequest at 'https://ropsten.infura.io/v3/%API_KEY%' 
from origin 'https://localhost:3000' has been blocked by CORS policy: Response to preflight 
request doesn't pass access control check: No 'Access-Control-Allow-Origin'
 header is present on the requested resource.

eth_sendTransaction crashes

When my dapp creates a transaction, I can see it receives a eth_sendTransaction request on test.walletconnect.org, but when I click on it the webpage just when blank.
In the console there is an error message:

[Error] TypeError: null is not an object (evaluating 'n.slice') — utilities.ts:36
	ns (1.6bf39b93.chunk.js:1:1218449)
	(anonymous function) (1.6bf39b93.chunk.js:1:1225358)
	po (1.6bf39b93.chunk.js:1:1184397)
	us (1.6bf39b93.chunk.js:1:1219796)
	(anonymous function) (1.6bf39b93.chunk.js:1:1237536)
	(anonymous function)
	(anonymous function) (1.6bf39b93.chunk.js:1:1256809)
	_u (1.6bf39b93.chunk.js:1:1234026)
	hu (1.6bf39b93.chunk.js:1:1230150)
	hu
	(anonymous function) (1.6bf39b93.chunk.js:1:1181139)
	(anonymous function) (1.6bf39b93.chunk.js:1:1256809)
	Zi (1.6bf39b93.chunk.js:1:1181086)
	Gi (1.6bf39b93.chunk.js:1:1181021)
	ou (1.6bf39b93.chunk.js:1:1226718)
	enqueueSetState (1.6bf39b93.chunk.js:1:1184847)
	(anonymous function) (1.6bf39b93.chunk.js:1:1130854)
	(anonymous function) (main.80dd7bd7.chunk.js:1:42162)
	(anonymous function) (1.6bf39b93.chunk.js:1:3663)
	a (1.6bf39b93.chunk.js:1:2509)
	promiseReactionJob

eth_sendTransaction throws error because nonce is missing

I’m using Web3 v1.2.11 and the latest WalletConnect Web3 Provider to connect my app to the test wallet. When I send a transaction it shows up in the test wallet as expected. Now, if I confirm the pending transaction the test wallet crashes with

react_devtools_backend.js:2273 TypeError: Cannot read property 'replace' of undefined
    at C (index.js:270)
    at Object.M [as hexToNumber] (index.js:97)
    at e.convertHexToNumber (encoding.js:120)
    at Object.render (ethereum.ts:68)
    at n.render (index.ts:23)
    at renderPayload (App.tsx:543)
    at e.render (RequestDisplay.tsx:43)
    at Fa (react-dom.production.min.js:4333)
    at Ua (react-dom.production.min.js:4324)
    at bs (react-dom.production.min.js:6700)

The problem seems to be that the test wallet expects the transaction payload from the app to include the nonce which it does not.

Failed to compile

Failed to compile
/Users/show/Desktop/test/walletconnect-test-wallet/src/controllers/wallet.ts
ERROR in /Users/show/Desktop/test/walletconnect-test-wallet/src/controllers/wallet.ts(2,10):
TS2305: Module '"../../node_modules/@types/eth-sig-util"' has no exported member 'signTypedData_v4'.
This error occurred during the build time and cannot be dismissed.

@pedrouid I tested it again, I didn't change my code, but this time it showed a different error message:

@pedrouid I tested it again, I didn't change my code, but this time it showed a different error message:

Error: Number can only safely store up to 53 bits
    n bn.js:5
    toNumber bn.js:474
    convertHexToNumber encoding.js:123
    render ethereum.ts:72
    render index.ts:23
    renderPayload App.tsx:554
    render RequestDisplay.tsx:45
    React 7
    unstable_runWithPriority scheduler.production.min.js:309
    React 6
    openRequest App.tsx:415
    s tslib.es6.js:212
    s tslib.es6.js:142
    a tslib.es6.js:97
    promise callback*u tslib.es6.js:112
    l tslib.es6.js:115
    l tslib.es6.js:94
    openRequest App.tsx:407
    onClick App.tsx:540
    React 12
    unstable_runWithPriority scheduler.production.min.js:309
    React 3
react_devtools_backend.js:2430:23
    overrideMethod react_devtools_backend.js:2430
    React 5
    unstable_runWithPriority scheduler.production.min.js:309
    React 4
    unstable_runWithPriority scheduler.production.min.js:309
    React 6
    openRequest App.tsx:415
    s tslib.es6.js:212
    s tslib.es6.js:142
    a tslib.es6.js:97
    (Async: promise callback)
    u tslib.es6.js:112
    l tslib.es6.js:115
    l tslib.es6.js:94
    openRequest App.tsx:407
    onClick App.tsx:540
    React 12
    unstable_runWithPriority scheduler.production.min.js:309

Originally posted by @StillFantastic in #29 (comment)

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.