@enc-protocol/wallet

0.2.1

ENC Wallet SDK — composes DM+Registry+EVM

npm i @enc-protocol/wallet

@enc-protocol/wallet

Wallet SDK — pure, in-memory Node, real crypto.

Install

npm install @enc-protocol/wallet --registry https://npm-registry.ocrybit.workers.dev/

Usage

import { WalletClient, createIdentity } from "@enc-protocol/wallet"

// Create identity and enclave
const owner = createIdentity("alice")
const client = WalletClient.create(owner)

// Query events
const events = client.query()

// Grant role to another identity
const bob = createIdentity("bob")
client.grant(bob, "Member")

// Use as different identity
const bobClient = client.as(bob)

API

WalletClient

Extends AppClient from @enc-protocol/app.

MethodParamsReturnsDescription
query(type?)stringEvent[]Query events
grant(target, role)Identity, string{ ok, error? }Grant role
as(identity)IdentityWalletClientSwitch identity
static create(owner)IdentityWalletClientCreate enclave

RBAC Rules

EventRoleOps
TerminateownerC
*PublicR
*OWNERR
*FRIENDR

Audit

All properties proven by Lean native_decide:

  • valid: (validate config).allPass = true := by native_decide
  • no_own_schemas: config.eventSchemas.length = 0 := by native_decide
  • all_roles_read: config.permits "*" "Public" "R" = true ∧ ... := by native_decide
  • components_reachable: componentsReachable config = true := by native_decide
  • owner_terminates: config.permits "Terminate" "owner" "C" = true := by native_decide
  • deps_resolve: depsResolve config = true := by native_decide
  • all_tests_pass: verifyTestSuite config tests = true := by native_decide
  • all_stateful_tests_pass: verifyStatefulSuite config statefulTests = true := by native_decide

Dependencies

  • @enc-protocol/app