Giter Site home page Giter Site logo

keyspace-client's Introduction

Example Keyspace Client

An example Keyspace client implemented in TypeScript. This client is the basis for the Keyspace documentation and will eventually become a client library for Keyspace.

Install Dependencies

bun install

Create Private Keys

secp256k1 (Ethereum EOA)

cast wallet new

P256 (secp256r1, Passkeys)

bun run scripts/create-p256-key.ts

Configuration

bun automatically loads environment variables from a .env file. Create a .env file in the root of the project.

touch .env
Environment Variable Description
RPC_URL Ethereum RPC URL for general RPC calls
BUNDLER_RPC_URL Ethereum RPC URL for ERC-4337 calls
KEYSPACE_RPC_URL Keyspace RPC URL
RECOVERY_RPC_URL Recovery Service RPC URL

Scripts

Get Keyspace Key

bun run scripts/get-keyspace-key.ts
Argument Environment Variable Description
--private-key PRIVATE_KEY secp256k1 private key or P256 JWK
--signature-type secp256k1 (default) or webauthn

Send ETH

bun run scripts/send-eth.ts
Argument Environment Variable Description
--keyspace-key KEYSPACE_KEY The wallet's Keyspace key
--private-key PRIVATE_KEY secp256k1 private key or P256 JWK
--signature-type secp256k1 (default) or webauthn

Make sure there's ETH in the account you're sending from. You can get the Ethereum address of the smart wallet by running bun run scripts/get-keyspace-key.ts.

Change Owner

bun run scripts/change-owner.ts
Argument Environment Variable Description
--keyspace-key KEYSPACE_KEY The wallet's Keyspace key
--private-key PRIVATE_KEY secp256k1 private key or P256 JWK
--new-private-key NEW_PRIVATE_KEY new secp256k1 private key or P256 JWK
--signature-type secp256k1 (default) or webauthn

Build Documentation

bun run docs:dev
bun run docs:build

keyspace-client's People

Contributors

niran avatar wilsoncusack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.