Connect using Pundi Wallet (Wallet Connect)
Steps to connect Pundi Wallet using Wallet Connect to Dapps
Connecting through the UI
Connect Pundi Wallet account to Dapp
When you create an account on the Pundi 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.
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.
Select 'WalletConnect'
A QR code will appear
Open Pundi Wallet, and click on the blue button at the bottom.
Select 'Scan'
Scan the QR code
The wallet will show it is connecting for a brief moment
Select the address you want to connect to the Dapp
Click on 'Authorize'
Now, you will see your address of the account at the top right hand corner instead of 'Connect to a wallet'









Disconnect Pundi Wallet account from Dapp
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.
You will see a tab appear on your Pundi Wallet home screen, click on it and it will open up the page for you to disconnect
Click on 'Disconnect'
It will prompt you once more, click on 'Disconnect' again



Your Dapp should now not show your address being connected anymore.
For Developers
Dependencies
fxwallet version (minimum): v2.0
fx-js-sdk: https://www.npmjs.com/package/fx-js-sdk
WalletConnectId
39778
CHAIN_ID
fxevm
Get Accounts
export function getAccountRequest(chainIds) {
return {
id: payloadId(),
jsonrpc: '2.0',
method: 'functionx_wc_accounts_v1',
params: chainIds,
};
}
Example
const request = getAccountRequest([CHAIN_ID,CHAIN_ID]);
connector.sendCustomRequest(request)
.then((accounts) => {
setAccounts(accounts);
console.log(accounts.length == 1);
}).catch((error) => {
console.error(error);
});
Result
[name, algo, publicKey, addressByte, bech32Address]
Sign Transactions (amino)
Sign transaction using FunctionX Mobile Wallet via Wallet Connect
signer: bech32Address
Example:
import {
makeSignDoc as makeAminoSignDoc,
serializeSignDoc
} from "@cosmjs/amino"
import { fromUtf8 } from "@cosmjs/encoding"
const signDoc = makeAminoSignDoc(messages, fee, chainId, memo, accountNumber, sequence)
const signBytes = serializeSignDoc(signDoc)
const signData = fromUtf8(signBytes)
connector.sendCustomRequest({
id: payloadId(),
jsonrpc: '2.0',
method: 'functionx_wc_sign_tx_v1',
params: [chainId, signer, signData],
})
.then((response) => {
const signed = _.get(response, '0.signed');
const signature = _.get(response, '0.signature');
return broadcastTx(signed, signature);
}).then((result) => {
const code = _.get(result, 'code');
if (code === 0) {
const txHash = _.get(result, 'txhash');
console.log(txHash);
} else {
const rawLog = _.get(result, 'raw_log');
console.error(rawLog);
}
})
Last updated