
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@tronweb3/tronwallet-adapter-foxwallet
Advanced tools
@tronweb3/tronwallet-adapter-foxwallet
This package provides an adapter to enable TRON DApps to connect to the FoxWallet App.
import { FoxWalletAdapter } from '@tronweb3/tronwallet-adapter-foxwallet';
const adapter = new FoxWalletAdapter();
// connect to FoxWallet
await adapter.connect();
// then you can get address
console.log(adapter.address);
// create a send TRX transaction
const unSignedTransaction = await window.foxwallet.tronLink.tronWeb.transactionBuilder.sendTrx(
targetAddress,
100,
adapter.address
);
// using adapter to sign the transaction
const signedTransaction = await adapter.signTransaction(unSignedTransaction);
// broadcast the transaction
await window.foxwallet.tronLink.tronWeb.trx.sendRawTransaction(signedTransaction);
Constructor(config: FoxWalletAdapterConfig)
interface FoxWalletAdapterConfig {
/**
* Set if open Wallet's website when wallet is not installed.
* Default is true.
*/
openUrlWhenWalletNotFound?: boolean;
/**
* Timeout in millisecond for checking if TokenPocket wallet is supported.
* Default is 2 * 1000ms
*/
checkTimeout?: number;
/**
* Set if open TokenPocket app using DeepLink on mobile device.
* Default is true.
*/
openAppWithDeeplink?: boolean;
}
network()
method is supported to get current network information. The type of returned value is Network
as follows:
export enum NetworkType {
Mainnet = 'Mainnet',
Shasta = 'Shasta',
}
export type Network = {
networkType: NetworkType;
chainId: string;
fullNode: string;
solidityNode: string;
eventServer: string;
};
switchChain()
.NetworkType.Mainnet
, NetworkType.Shasta
currently.tronWeb
is a dynamic instance that will be reinitialized when necessary, so the way to access tronWeb
instance from FoxWallet:
const balance = await window.foxwallet.tronLink.tronWeb.trx.getBalance(address);
const tronWeb = window.foxwallet.tronLink.tronWeb;
const balance = tronWeb.trx.getBalance(address);
For more information about tronwallet adapters, please refer to @tronweb3/tronwallet-adapters
FAQs
Wallet adapter for FoxWallet app.
The npm package @tronweb3/tronwallet-adapter-foxwallet receives a total of 1,979 weekly downloads. As such, @tronweb3/tronwallet-adapter-foxwallet popularity was classified as popular.
We found that @tronweb3/tronwallet-adapter-foxwallet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.