Skip to content

Latest commit

 

History

History
116 lines (79 loc) · 2.62 KB

README.md

File metadata and controls

116 lines (79 loc) · 2.62 KB

Universal Wallet Backup Container Export (@interop/wallet-export-ts)

Build status NPM Version

A Javascript/Typescript library for exporting Universal Wallet Backup Containers.

Table of Contents

Background

TBD

Security

TBD

Install

  • Node.js 14+ is recommended.

NPM

To install via NPM:

npm install @interop/wallet-export-ts

Development

To install locally (for development):

git clone https://github.com/interop-alliance/wallet-export-ts.git
cd wallet-export-ts
npm install

Usage

Export an empty wallet.

export() // no wallet passed in, generates an empty Universal Wallet Backup TAR file

...

$ tar -vtf wallet-export-2024-01-01.tar

drwxr-xr-x 0/0               0 2024-06-11 15:58 app
drwxr-xr-x 0/0               0 2024-06-11 15:58 keys
-rw-r--r-- 0/0              21 2024-06-11 15:58 manifest.yaml

$ cat manifest.yaml
---
ubc-version: 0.1
meta:
  created: 2024-01-01
  createdBy:
    client:
      url: https://github.com/interop-alliance/wallet-export-ts

Export an ActivityPub Actor Profile

import * as fs from 'node:fs'
import { exportActorProfile } from '@interop/wallet-export-ts'

const filename = 'out/test-export-2024-01-01.tar'
const tarball = fs.createWriteStream(filename)

// Each of the arguments passed in is Optional
const packStream = exportActorProfile({
  actorProfile, outbox, followers, followingAccounts, lists, bookmarks, likes,
  blockedAccounts, blockedDomains, mutedAccounts
})

packStream.pipe(tarball)

then

cd out
tar -vtf test-export-2024-01-01.tar
 
drwxr-xr-x  0 0      0           0 Oct  9 20:19 activitypub
-rw-r--r--  0 0      0        3526 Oct  9 20:19 activitypub/actor.json
-rw-r--r--  0 0      0        4367 Oct  9 20:19 activitypub/outbox.json
-rw-r--r--  0 0      0         386 Oct  9 20:19 manifest.yaml

see https://codeberg.org/fediverse/fep/src/branch/main/fep/6fcd/fep-6fcd.md#activitypub-export-example for contents

Contribute

PRs accepted.

If editing the Readme, please conform to the standard-readme specification.

License

MIT License © 2024 Interop Alliance and Dmitri Zagidulin.