![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
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.
@turnkey/viem
Advanced tools
This package contains helpers to use Viem with Turnkey.
We provide a Turnkey Custom Account (signer) which implements the signing APIs expected by Viem clients.
If you need a lower-level, fully typed HTTP client for interacting with Turnkey API, check out @turnkey/http
.
$ npm install viem @turnkey/viem
import { createAccount } from "@turnkey/viem";
import { TurnkeyClient } from "@turnkey/http";
import { ApiKeyStamper } from "@turnkey/api-key-stamper";
import { createWalletClient, http } from "viem";
import { sepolia } from "viem/chains";
async function main() {
// Create a Turnkey HTTP client with API key credentials
const httpClient = new TurnkeyClient(
{
baseUrl: "https://api.turnkey.com",
},
// This uses API key credentials.
// If you're using passkeys, use `@turnkey/webauthn-stamper` to collect webauthn signatures:
// new WebauthnStamper({...options...})
new ApiKeyStamper({
apiPublicKey: "...",
apiPrivateKey: "...",
}),
);
// Create the Viem custom account
const turnkeyAccount = await createAccount({
client: httpClient,
organizationId: "...",
signWith: "...",
// optional; will be fetched from Turnkey if not provided
ethereumAddress: "...",
});
// Below: standard Viem APIs are used, nothing special!
const client = createWalletClient({
account: turnkeyAccount,
chain: sepolia,
transport: http(`https://sepolia.infura.io/v3/$(YOUR_INFURA_API_KEY)`),
});
const transactionRequest = {
to: "0x08d2b0a37F869FF76BACB5Bab3278E26ab7067B7" as `0x${string}`,
value: 1000000000000000n, // 0.001 ETH
};
const txHash = await client.sendTransaction(transactionRequest);
console.log(`Success! Transaction broadcast with hash ${txHash}`);
}
main().catch((error) => {
console.error(error);
process.exit(1);
});
See .env.example
to get your local testing environment right. In order to run the tests, run an Anvil node in one shell (via pnpm anvil
), and run pnpm jest
in another.
@turnkey/example-with-viem
: example using this package to create, sign, and broadcast a transaction on Sepolia (Ethereum testnet)@turnkey/http
: lower-level fully typed HTTP client for interacting with Turnkey API@turnkey/api-key-stamper
: package to authenticate to Turnkey using API key credentials@turnkey/webauthn-stamper
: package to authenticate to Turnkey using Webauthn/passkeys.FAQs
Turnkey Helpers to work with Viem
We found that @turnkey/viem demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.