Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@bandada/utils
Advanced tools
General Bandada utility functions.
This package provides simple utility functions that can be used by Bandada itself or externals. |
---|
Install the @bandada/utils
package with npm:
npm i @bandada/utils
or yarn:
yarn add @bandada/utils
# request(url: string, config?: AxiosRequestConfig): Promise<any>
Makes a request using Axios.
import { request } from "@bandada/utils"
const url = "https://api.bandada.pse.dev/groups"
const config = {
headers: {
"Content-Type": "application/json"
},
baseURL: "https://api.bandada.pse.dev"
}
const group = await request(url, config)
# shortenAddress(address: string, chars: number): string
Returns a shorter address.
import { shortenAddress } from "@bandada/utils"
const address = shortenAddress("0x1234567890123456789012345678901234567890")
# getProvider(network: Network, apiKey?: string): JsonRpcProvider
Returns the provider to communicate with the blockchain.
import { getProvider } from "@bandada/utils"
const provider = getProvider("localhost")
# getContract(contractName: ContractName, network: Network, privateKeyOrSigner?: string | Signer, apiKey?: string): Contract
Returns an Ethers contract.
import { getContract } from "@bandada/utils"
const contractName = "Semaphore"
const network = "localhost"
const contract = getContract(contractName, network)
# getSemaphoreContract(network: Network, privateKeyOrSigner?: string | Signer, apiKey?: string): SemaphoreContract
Returns a new instance of the SemaphoreContract class.
import { getSemaphoreContract } from "@bandada/utils"
const semaphore = getSemaphoreContract("localhost")
# getBandadaContract(network: Network, privateKeyOrSigner?: string | Signer, apiKey?: string): BandadaContract
Returns a new instance of the BandadaContract class.
import { getBandadaContract } from "@bandada/utils"
const bandada = getBandadaContract("localhost")
# getWallet(privateKey: string, network?: Network, apiKey?: string): JsonRpcProvider
Returns an Ethers wallet.
import { getWallet } from "@bandada/utils"
const privateKey =
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
const wallet = getWallet(privateKey)
# getContractAddresses(networkName: Network): { Bandada: string, Semaphore: string, BandadaSemaphore: string }
Returns the contract addresses for the Bandada, Semaphore and BandadaSemaphore smart contracts.
import { getContractAddresses } from "@bandada/utils"
const addresses = getContractAddresses("sepolia")
FAQs
General Bandada utility functions.
The npm package @bandada/utils receives a total of 15 weekly downloads. As such, @bandada/utils popularity was classified as not popular.
We found that @bandada/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.