walletconnect / walletconnect-docs Goto Github PK
View Code? Open in Web Editor NEWWalletConnect Documentation
Home Page: https://docs.walletconnect.com
License: MIT License
WalletConnect Documentation
Home Page: https://docs.walletconnect.com
License: MIT License
Reference: https://docs.walletconnect.org/quick-start#for-web3-provider-web-3-js
yarn and npm install methods are provided. Then documentation recommends the import
method.
import
isn't even usable in browsers yet. Source: https://caniuse.com/#feat=es6-module-dynamic-import
Instead, the first and simplest example should show how to create a dapp using a JS file included from CDN (including SRI integrity hash).
You are competing with MetaMask. They have a zero-step install process, keep that in mind.
const request = connector._formatRequest({
method: 'get_accounts',
});
connector
._sendCallRequest(request)
.then(result => {
// Returns the accounts
console.log(result);
})
.catch(error => {
// Error returned when rejected
console.error(error);
});
[
{
network: number,
address: string
}
]
tratando de clonar una imagen básica.
Issue to track the docs improvements
keyvaluestorage
package changes and document thosecurrent import (import WalletConnectProvider from "@walletconnect/web3-provider"
) depends on Node/Commonjs modules like crypto which is not available in browser & angular cli don't support it, so please add prebuilt CDN version, it is very difficult to integrate with default angular setup with official cli.
Here are the errors shown in angular:
ERROR in ./node_modules/@pedrouid/iso-crypto/dist/cjs/helpers/env/node.js
Module not found: Error: Can't resolve 'crypto' in '/Users/aks/work/projects/akemona-frontend/node_modules/@pedrouid/iso-crypto/dist/cjs/helpers/env'ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Can't resolve 'http' in '/Users/aks/work/projects/akemona-frontend/node_modules/xhr2-cookies/dist'ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Can't resolve 'https' in '/Users/aks/work/projects/akemona-frontend/node_modules/xhr2-cookies/dist'ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Can't resolve 'os' in '/Users/aks/work/projects/akemona-frontend/node_modules/xhr2-cookies/dist'ERROR in ./node_modules/cipher-base/index.js
Module not found: Error: Can't resolve 'stream' in '/Users/aks/work/projects/akemona-frontend/node_modules/cipher-base'ERROR in ./node_modules/keccak/lib/api/keccak.js
Module not found: Error: Can't resolve 'stream' in '/Users/aks/work/projects/akemona-frontend/node_modules/keccak/lib/api'ERROR in ./node_modules/keccak/lib/api/shake.js
Module not found: Error: Can't resolve 'stream' in '/Users/aks/work/projects/akemona-frontend/node_modules/keccak/lib/api'
& Here is the warning:
WARNING in /Users/../../projects/../src/app/../web3.service.ts depends on '@walletconnect/web3-provider'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Hello, I encountered the following problems when using Walletconnect.
Walletconnect version V2.0
When I use the wallet link of the document to scan the QR code for testing, the App reports an error 'Code: 1601, message:' session not approved '.
The code is as follows:
const client = await WalletConnectClient.init({ relayProvider: "wss://relay.walletconnect.org", metadata: { name: "grid Dapp", description: "grid Dapp", url: "https://walletconnect.org/", icons: ["https://walletconnect.org/walletconnect-logo.png"], }, }); client.on( CLIENT_EVENTS.pairing.proposal, async (proposal) => { // uri should be shared with the Wallet either through QR Code scanning or mobile deep linking const { uri } = proposal.signal.params; QRCodeModal.open(uri, () => { console.log("EVENT", "QR Code Modal closed"); }); } ); const session = await client.connect({ permissions: { blockchain: { chains: ["eip155:1"], }, jsonrpc: { methods: ["eth_sendTransaction", "personal_sign", "eth_signTypedData"], }, }, });
Can you tell me the reason for the error and the solution
If you need futher information, please feel free to contact with me, and look forward to your feedback. Thanks for your help!
Hello
Getting error after I run the command:
npm install --save web3 @walletconnect/web3-provider
And here is part of the log:
222 silly resolveWithNewModule [email protected] checking installable status
223 silly fetchPackageMetaData error for ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git Error while executing:
223 silly fetchPackageMetaData undefined ls-remote -h -t https://github.com/ethereumjs/ethereumjs-abi.git
223 silly fetchPackageMetaData
223 silly fetchPackageMetaData
223 silly fetchPackageMetaData spawn git ENOENT
224 silly pacote range manifest for ethereumjs-util@^5.1.1 fetched in 17ms
225 silly resolveWithNewModule [email protected] checking installable status
226 timing stage:rollbackFailedOptional Completed in 1ms
227 timing stage:runTopLevelLifecycles Completed in 16525ms
228 silly saveTree [email protected]
.
.
.
228 silly saveTree `-- [email protected]
229 verbose stack Error: spawn git ENOENT
229 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
229 verbose stack at onErrorNT (internal/child_process.js:467:16)
229 verbose stack at processTicksAndRejections (internal/process/task_queues.js:82:21)
May I know how can I get this install correctly?
Why have all the links like https://docs.walletconnect.org/v/1.0/... been removed ?
We have wrote a WalletConnect library, and our document point to multiple links using existing links (some months ago), with "/v/1.0/", and now there are linked to 404 page. 😢
Our library is now compatible with v2, but still, the links are broken and we need to update. Also what is the separation from the URL point of view for v1 and v2 now ?
Is your feature request related to a problem? Please describe.
The current solana RPC implementation is insufficient for Solana wallet adapters. Wallets have no way to modify the transaction if they wish. It also doesn't support offline nonce'd transactions
Describe the solution you'd like
Update public implementations
Describe alternatives you've considered
An alternative is solana_sendTransaction which doesn't have this problem. However wallet adapters don't send transactions and are assumed to return a fully signed transaction for the frontend to send
If all other options are exhausted I may create a nonstandard wallet adapter that doesn't follow the RPC spec
Additional context
Wallet adapters are the main way solana dApps sign transactions so it makes sense to make RPC suitable for them. Eth doesn't have this issue because it returns the signed transaction
I'm happy to get this done. Any thoughts on this?
npm install --save @walletconnect/client @walletconnect/qrcode-modal
Hi team,
First of all, I'm really appreciated for making such an amazing library.
Currently, I'm using "@walletconnect/client": "1.6.6" for dApp that interacts with Binance Chain (Not BSC) which is similar to this app.
Since WalletConnect V2.0 is published, I'd like to confirm if my dApp still can use the same protocol/structure as V1 with v.1.6.6. Because there is no breaking change on Binance Chain
recently, I want to stick to the same logic as V1 for avoiding potential conflict in the future.
I m successfully install @walletconnect/client package after the when i import @walletconnect/client package It throw this error
(ReferenceError: Buffer is not defined ) and also I follow this below steps.
npm i --save react-native-crypto // install peer deps npm i --save react-native-randombytes react-native link react-native-randombytes // install latest rn-nodeify npm i --save-dev tradle/rn-nodeify ./node_modules/.bin/rn-nodeify --hack --install
I m implementated this thing with react native Is it this library was supportted for react-native
Is there any help to solve this problem
Thanks in advance
while using walletconnect/client,
I get following error :-
This package itself specifies a "main" module field that could not be resolved.
after linking the packages,
(npm install --save rn-nodeify
rn-nodeify --install --hack)
I am getting following error : -
null is not an object(evaluating 'RNRandomBytes.seed')
These diagrams are to be included in the documentation which currently is in progress but should provide enough information to design these.
Read the full introduction docs: http://walletconnect.readthedocs.io/en/latest/introduction/
The idea is to visualize with the diagrams both at a basic and an advanced level (more technically detailed) how WalletConnect works and how data is shared between all parts of the infrastructure
Acceptance Criteria
When I use WalletConnect with MetaMask, MetaMask get request, send token and eth together in one transaction, equal amount, example 800tokens+800ETH that is wrong, when I use MetaMask without WalletConnect all ok, sends only 800tokens, that is right. I use different methods but result is only one wrong. Example:
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/web3.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/index.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/umd/index.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/@walletconnect/[email protected]/dist/umd/index.min.js"></script>
const providerOptions = {
walletconnect: {
package: WalletConnectProvider,
options: {
// Mikko's test key - don't copy as your mileage may vary
infuraId: "**************"
}
}
};
web3Modal = new Web3Modal({
cacheProvider: false, // optional
providerOptions, // required
disableInjectedProvider: false, // optional. For MetaMask / Brave / Opera.
});
try {
provider = await web3Modal.connect(); //choose WalletConnect and open MetaMask
} catch(e) {
console.log("Could not get a wallet connection", e);
return;
}
let web3 = new Web3(provider);
let mycontract
try {
mycontract=new web3.eth.Contract(contract.abi,contract.address,{
from: selectedAccount // default from address
});
} catch (error) {
}
let amount=parseFloat(800).toFixed(18); //get count tokens
amount=web3.utils.toWei(amount, "ether");
let data=mycontract.methods.transfer(recipient,amount).encodeABI()
// start method 1 to send tokens
let params= [
{
from: selectedAccount,
to:contract.address,
data:data
}
];
provider.request({
method: 'eth_sendTransaction',
params
})
.then((result) => {
// The result varies by RPC method.
// For example, this method will return a transaction hash hexadecimal string on success.
console.log("provider.request:",result)
})
.catch((error) => {
onsole.error("provider.request error:",error)
// If the request fails, the Promise will reject with an error.
});
//end method 1, send 800tokens+800ETH in MetaMask and need only 800tokens
//start method 2 to send tokens
mycontract.methods.transfer(recipient,amount).send({from:selectedAccount},function(err,transfer){
if (err) throw err
});
//end method 2 send example 800tokens+800ETH in MetaMask and need only 800tokens
//Please help me, I don know what do,Where is trouble
hello, is there any more walletconnect test link such as https://example.walletconnect.org/ in test net like Goerli,
but have more functions, such as transfer token, approve token, contract call. etc
This tutorial will walkthrough the whole implementation for using Firebase Cloud Messaging push service to trigger notifications on mobile and also include an implementation for Firebase functios to be used as an easy alternative to py-walletconnect-push library
the first 3 links in the README 404:
* [Overview](https://github.com/WalletConnect/walletconnect-docs/blob/master/docs/home.adoc)
* [Wallet Addresses Flow](https://github.com/WalletConnect/walletconnect-docs/blob/master/docs/wallet_addresses.adoc)
* [Transactions Flow](https://github.com/WalletConnect/walletconnect-docs/blob/master/docs/transactions.adoc)
In project wallet-connect-kotlin, file 'com.trustwallet.walletconnect.extensions.String.kt', HEX_CHARS is a test variable, or it must be handled like this. Is it possible to use toByteArray() instead of hexStringToByteArray().
client.request()
is definefined as request(params: ClientTypes.RequestParams): Promise<any>
.ClientTypes.RequestParams
is defíned as type RequestParams = SessionTypes.RequestParams;
SessionTypes.RequestParams
is defined as:
interface RequestParams extends SequenceTypes.RequestParams {
chainId?: string;
}
SequenceTypes.RequestParams
is defined as:
interface RequestParams {
topic: string;
request: RequestArguments;
timeout?: number;
chainId?: string;
}
RequestParams
is defined in
import { JsonRpcPayload, IEvents, RequestArguments, JsonRpcRequest, JsonRpcResponse } from "@walletconnect/jsonrpc-types";
in export * from "./jsonrpc";
in
export interface RequestArguments<T = any> {
method: string;
params?: T;
}
On Android for React Native, I went step by step through the tutorial here:
But after Architecture my app crashed as "crypto could not be found within the project". How to resolve?
npm i --save react-native-crypto
didn't help
Auth API is a lightweight API to verify wallet address ownership for web3 use cases such as SIWE.
The goal of the Auth API is to support our mission to be the gateway to web3 and make it easy for millions of end-users to interact with the blockchain. Specifically, the goal of Auth API is to make it easy for both developers and end-users to verify ownership of a wallet address to support various web3 use cases.
TODO
Implementation
Next
i use angular dapp i have 2 problem
make transaction
const msgParams = [
convertUtf8ToHex(message), // Required
"0xbc28ea04101f03ea7a94c1379bc3ab32e65e62d3", // Required
];
// Sign personal message
self.connector
.signPersonalMessage(msgParams)
.then((result) => {
// Returns signature.
console.log(result)
})
.catch(error => {
// Error returned when rejected
console.error(error);
})
sign message
show modal with all wallet available
but in docs i not found and now my code work for connect to metamask only but i can't send transaction
my full code service
import { Injectable } from '@angular/core';
import WalletConnectProvider from "@walletconnect/web3-provider";
import WalletConnect from "@walletconnect/client";
import QRCodeModal from "@walletconnect/qrcode-modal";
import { convertUtf8ToHex } from "@walletconnect/utils";
import { Wallet } from '../model/wallet';
import { DappBaseService } from './dappbase.service';
import { providers } from "ethers";
import Big from 'big.js';
import { resolve } from '@angular/compiler-cli/src/ngtsc/file_system';
@Injectable({
providedIn: 'root'
})
export class DappMobileService implements DappBaseService {
isConnect: boolean = false;
public account: any = null;
provider: any;
connector: any;
constructor() {
}
buyToken(data: any): Promise<any> {
throw new Error('Method not implemented.');
}
sellToken(data: any): Promise<any> {
throw new Error('Method not implemented.');
}
getStag(): Promise<any> {
throw new Error('Method not implemented.');
}
getUser(): Promise<any> {
throw new Error('Method not implemented.');
}
getRate(): Promise<any> {
throw new Error('Method not implemented.');
}
getAccount() {
return this.account;
}
async enableMetaMask(): Promise<any> {
let self = this;
return await new Promise((resolve, reject) => {
this.provider.enable().then(async function (x) {
console.log(x);
self.account = x[0];
self.isConnect = true;
// Draft Message Parameters
const message = "My email is [email protected] - 1537836206101"
const msgParams = [
convertUtf8ToHex(message), // Required
"0xbc28ea04101f03ea7a94c1379bc3ab32e65e62d3", // Required
];
// Sign personal message
self.connector
.signPersonalMessage(msgParams)
.then((result) => {
// Returns signature.
console.log(result)
})
.catch(error => {
// Error returned when rejected
console.error(error);
})
resolve(x[0]);
});
}) as Promise<any>;
}
isConnected() {
return this.isConnect;
}
callMethods(method: any, paramas: any): Promise<any> {
throw new Error('Method not implemented.');
}
Connect() {
// Create WalletConnect Provider
this.provider = new WalletConnectProvider({
infuraId: "c52ac0811f45487db5b56e0cf79"
});
// Create a connector
this.connector = new WalletConnect({
bridge: "https://bridge.walletconnect.org", // Required
qrcodeModal: QRCodeModal,
});
// Check if connection is already established
if (!this.connector.connected) {
// create new session
this.connector.createSession();
}
// Subscribe to connection events
this.connector.on("connect", (error, payload) => {
if (error) {
throw error;
}
// Get provided accounts and chainId
const { accounts, chainId } = payload.params[0];
localStorage.setItem('playdbet:user:defaultAccount', accounts[0]);
console.log('connect');
});
this.connector.on("session_update", (error, payload) => {
if (error) {
throw error;
}
// Get updated accounts and chainId
const { accounts, chainId } = payload.params[0];
console.log(payload.accounts);
});
this.connector.on("disconnect", (error, payload) => {
if (error) {
throw error;
}
// Delete connector
});
}
Disconnect() {
throw new Error('Method not implemented.');
}
Transaction() {
throw new Error('Method not implemented.');
}
loadAccount(): Promise<any> {
return this.enableMetaMask();
}
}
Steps to Reproduce.
Go to the Getting Starting Guide.
Click the link in the screenshot:
Expected Behavior: some sort of getting started documentation exists -- or don't mention it as if it does on the homepage!
WIP PR at #160
I'm using the Hashlips minting dapp and trying to integrate walletconnect since out of the box it only supports MetaMask. This gist works all the way up to actually purchasing the NFT from coinbase wallet, as it's unable to get the network fees. Does anyone know why this would be happening? I don't see any settings that I missed. I currently have it set up using an Infura ID/rpc URL to ETH mainnet.
Can anyone help me narrow it down to a walletconnect missing setting? Could just be the underlying app code not configured right for this functionality or Coinbase wallet just can't mint.
https://gist.github.com/Karmeleons/d15c472ce1f15558481a442c12348644
I used flutter, why is there no bersion of flutter?
Can you develop a version of flutter?
It seems that eip-1559 is not supported, is there a plan?
Problem: When I am trying to access the website and docs, my avast antivirus prompt out a modal box and saying that this is a phishing site
Window: Window 10
Browser: Brave Version 1.37.111 Chromium: 100.0.4896.79 (Official Build) (64-bit)
After I turn off avast. The website is back to normal. May I know why?
import WalletConnect from "@walletconnect/client";
import QRCodeModal from "@walletconnect/qrcode-modal";
// Create a connector
const connector = new WalletConnect({
bridge: "https://bridge.walletconnect.org", // Required
qrcodeModal: QRCodeModal,
});
// Check if connection is already established
if (!connector.connected) {
// create new session
connector.createSession();
}
// Subscribe to connection events
connector.on("connect", (error, payload) => {
if (error) {
throw error;
}
// Get provided accounts and chainId
const { accounts, chainId } = payload.params[0];
});
connector.on("session_update", (error, payload) => {
if (error) {
throw error;
}
// Get updated accounts and chainId
const { accounts, chainId } = payload.params[0];
});
connector.on("disconnect", (error, payload) => {
if (error) {
throw error;
}
// Delete connector
});
Hi. I have a problem to solve. I use walletconnect SDK to send coin. But I do not know how to choose type of coin I want. Example: In chain Polygon have Matic and NXD. Default call api send transaction. It will send Matic. I want choose NXD to send. Please help me? Thanks
It seems as though eth_signTypedData
from https://docs.walletconnect.com/quick-start/dapps/client#sign-typed-data-eth_signtypeddata requires a properly escaped JSON string to succeed.
Although one can pass the object as indicated in the documents and apparently sign it, I was only getting a failed response in my dapp. Only when I wrapped typedParams
with JSON.stringify
was I able to get a successful response.
I only resolved this problem when I went back to the example dapp to double check my implementation and saw that JSON.stringify
was used https://github.com/WalletConnect/walletconnect-example-dapp/blob/79e427903f66ca0070ca3551c2391609b56be382/src/App.tsx#L590.
Before jumping into a fix, I want to verify that I haven't missed a case where this is not appropriate, otherwise I can add this to https://docs.walletconnect.com/quick-start/dapps/client.
Similarly to how we have tabs for NPM and Yarn instructions... we should add the same for instructions between web3.js and ethers.js
session events are not fired. I followed official docs of react native.
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.