Comment on page
Connect using f(x)Wallet (Wallet Connect)
Steps to connect f(x)Wallet using Wallet Connect to Dapps
When you create an account on the f(x)Wallet application, it automatically generates an Ethereum address. This address can be used to interact with Dapps via Wallet Connect. In this tutorial iOS is used, the process is similar on Andriod.
Only connect to websites that you trust. Always check that the URL is correct, and bookmark Dapps that you regularly visit/use.
- 1.Click on 'Connect Wallet' or 'Connect to a wallet'. Other Dapps will have similar buttons for the user to connect their wallet to start using the application.
- 2.Select 'WalletConnect'
- 3.A QR code will appear
- 4.Open f(x)Wallet, and click on the blue button at the bottom.
- 5.Select 'Scan'
- 6.Scan the QR code
- 7.The wallet will show it is connecting for a brief moment
- 8.Select the address you want to connect to the Dapp
- 9.Click on 'Authorize'
- 10.Now, you will see your address of the account at the top right hand corner instead of 'Connect to a wallet'

Click on 'WalletConnect'

QR code will appear
Read from left to right.

Press on the blue button

Select 'Scan'

Scan the QR code

Wait for it to connect

Select the address to connect

'Authorize' the Dapp to connect to your address

Connected via WalletConnect!
WalletConnect only allows you to connect to one Dapp at a time. You will have to disconnect from the previous Dapp before connecting to another Dapp. It is good practice to disconnect your account from the Dapp when you are done using it.
- 1.You will see a tab appear on your f(x)wallet home screen, click on it and it will open up the page for you to disconnect
- 2.Click on 'Disconnect'
- 3.It will prompt you once more, click on 'Disconnect' again

Click on the tab

Click on 'Disconnect'

Click on 'Disconnect'
Your Dapp should now not show your address being connected anymore.
- fxwallet version (minimum): v2.0
- 39778
- fxevm
1
export function getAccountRequest(chainIds) {
2
return {
3
id: payloadId(),
4
jsonrpc: '2.0',
5
method: 'functionx_wc_accounts_v1',
6
params: chainIds,
7
};
8
}
Example
1
const request = getAccountRequest([CHAIN_ID,CHAIN_ID]);
2
connector.sendCustomRequest(request)
3
.then((accounts) => {
4
setAccounts(accounts);
5
console.log(accounts.length == 1);
6
}).catch((error) => {
7
console.error(error);
8
});
Result
[name, algo, publicKey, addressByte, bech32Address]
Sign transaction using FunctionX Mobile Wallet via Wallet Connect
- signer: bech32Address
Example:
1
import {
2
makeSignDoc as makeAminoSignDoc,
3
serializeSignDoc
4
} from "@cosmjs/amino"
5
import { fromUtf8 } from "@cosmjs/encoding"
6
7
const signDoc = makeAminoSignDoc(messages, fee, chainId, memo, accountNumber, sequence)
8
const signBytes = serializeSignDoc(signDoc)
9
const signData = fromUtf8(signBytes)
10
11
connector.sendCustomRequest({
12
id: payloadId(),
13
jsonrpc: '2.0',
14
method: 'functionx_wc_sign_tx_v1',
15
params: [chainId, signer, signData],
16
})
17
.then((response) => {
18
const signed = _.get(response, '0.signed');
19
const signature = _.get(response, '0.signature');
20
return broadcastTx(signed, signature);
21
}).then((result) => {
22
const code = _.get(result, 'code');
23
if (code === 0) {
24
const txHash = _.get(result, 'txhash');
25
console.log(txHash);
26
} else {
27
const rawLog = _.get(result, 'raw_log');
28
console.error(rawLog);
29
}
30
})
Last modified 1yr ago