@ethernauta/transport
v0.0.40
Published
[](https://deno.bundlejs.com/?q=@ethernauta/[email protected]&treeshake=[*])
Readme
Philosophy
This module aims to be an un-opinionated representation of the defined:
Modules
Examples
Creating reader
import { eip155_11155111 } from "@ethernauta/chain"
import {
create_reader,
encode_chain_id,
http,
} from "@ethernauta/transport"
const NAMESPACE = {
ETHEREUM: "eip155",
}
const ETHEREUM_SEPOLIA_RPC_URL =
"https://grounded-electronic-house.ethereum-sepolia.quiknode.pro/4d40a4c7ec139649d4b1f43f5d536c3756faacc9/"
export const SEPOLIA_CHAIN_ID = encode_chain_id({
namespace: NAMESPACE.ETHEREUM,
reference: eip155_11155111.chainId,
})
export const reader = create_reader([
{
chainId: SEPOLIA_CHAIN_ID,
transports: [http(ETHEREUM_SEPOLIA_RPC_URL)],
},
])Creating a writer
import { eip155_11155111 } from "@ethernauta/chain"
import {
create_writer,
encode_chain_id,
http,
} from "@ethernauta/transport"
const NAMESPACE = {
ETHEREUM: "eip155",
}
const ETHEREUM_SEPOLIA_RPC_URL =
"https://grounded-electronic-house.ethereum-sepolia.quiknode.pro/4d40a4c7ec139649d4b1f43f5d536c3756faacc9/"
export const SEPOLIA_CHAIN_ID = encode_chain_id({
namespace: NAMESPACE.ETHEREUM,
reference: eip155_11155111.chainId,
})
export const writer = create_writer([
{
chainId: SEPOLIA_CHAIN_ID,
transports: [http(ETHEREUM_SEPOLIA_RPC_URL)],
},
])