2.1.0-alpha.7 • Published 5 months ago

makahiki v2.1.0-alpha.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

makahiki.js

The smart account SDK for Stackup's onchain financial platform.

Getting started

This library enables interactions with Simple Team Account using viem's account abstraction interface.

Installation

Note: this SDK uses viem@2.19.7, and webauthn-p256@0.0.10. It is recommended to pin these versions to avoid typing issues.

pnpm install makahiki

Initialize smart account

import { http, pad } from "viem";
import { sepolia } from "viem/chains";
import { toSmartAccountV2 } from "makahiki";

const account = await toSmartAccountV2({
  rootPublicKey,
  signerPublicKey,
  webAuthnAccount,
  publicClientConfig: {
    chain: sepolia,
    transport: http("Your node rpc here..."),
  },

  // Optional fields
  salt: pad("0x00", { size: 32 }),
  nonceKey: 0n,

  // Verifier fields
  verifier: "0xffff....dddd"
  verifyUserOp: async (userOp) => {
    return "0xdeadbeef"
  }
});

Initialization options

OptionDescription
rootPublicKeyA hex public key of the root admin that deployed the smart account. Equivalent to viem's webAuthnAccount.publicKey. This determines the counterfactual address.
signerPublicKeyA hex public key of the current signer for outgoing transactions. Equivalent to viem's webAuthnAccount.publicKey.
webAuthnAccountThe webAuthn interface for the current user. See here.
publicClientConfigThe same config object to initialize a viem Public Client. Note that chain is required. See here.
saltA 32 byte hex string that is used to derive the smart account address. Defaults to the zero hash. (Optional)
nonceKeyA bigint value to set the key for the 2D nonce. Defaults to 0. (Optional)
verifierThe address of the off-chain permissions entity that co-signs member level transactions. (optional)
verifyUserOpA hook called during the final signature phase to retrieve and return the verifier signature. (required only for Member transactions)

Return type

Returns an instance of a viem SmartAccount.

Contributing

Steps for setting up a local dev environment for contributing to makahiki.js.

Prerequisites

  • Node >=18.0.0

Setup

Install dependencies:

pnpm install

Run tests:

pnpm test

License

Distributed under the MIT License. See LICENSE for more information.

1.0.0

8 months ago

2.0.0-alpha.3

6 months ago

2.0.0-alpha.1

6 months ago

2.0.0-alpha.2

6 months ago

2.1.0-alpha.7

5 months ago

2.1.0-alpha.6

5 months ago

2.1.0-alpha.5

5 months ago

2.1.0-alpha.4

5 months ago

2.1.0-alpha.3

5 months ago

2.1.0-alpha.2

5 months ago

2.1.0-alpha.1

5 months ago

0.1.0-alpha.5

9 months ago

0.1.0-alpha.4

10 months ago

0.1.0-alpha.1

10 months ago

0.1.0-alpha.3

10 months ago

0.1.0-alpha.2

10 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago