@hazae41/bobine 0.0.13 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  A blockchain in your garage
4
4
 
5
- https://bobine.tech/
6
-
7
- [**📦 NPM**](https://www.npmjs.com/package/@hazae41/bobine) • [**📦 JSR**](https://jsr.io/@hazae41/bobine)
5
+ [**🌐 Website**](https://bobine.tech/) • [**📦 NPM**](https://www.npmjs.com/package/@hazae41/bobine)
8
6
 
9
7
  ## Features
10
8
 
@@ -24,7 +22,7 @@ https://bobine.tech/
24
22
  Install the binary with Deno
25
23
 
26
24
  ```bash
27
- deno install -gf -A jsr:@hazae41/bobine
25
+ deno install -gf -A npm:@hazae41/bobine
28
26
  ```
29
27
 
30
28
  Generate an Ed25519 keypair by running the following code in your browser/deno/node/bun console
@@ -1,3 +1,4 @@
1
+ /// <reference lib="webworker" />
1
2
  import { RpcMethodNotFoundError } from "@hazae41/jsonrpc";
2
3
  import { connect } from "@tursodatabase/database";
3
4
  import { runAsImmediateOrThrow } from "../../libs/sql/mod.js";
@@ -1,3 +1,4 @@
1
+ /// <reference lib="deno.ns" />
1
2
  import { readFileSync } from "node:fs";
2
3
  import process from "node:process";
3
4
  import { serveWithEnv } from "./mod.js";
@@ -1,4 +1,5 @@
1
1
  // deno-lint-ignore-file no-explicit-any no-unused-vars ban-unused-ignore
2
+ /// <reference lib="webworker" />
2
3
  import { Readable, Writable } from "@hazae41/binary";
3
4
  import { RpcErr, RpcError, RpcMethodNotFoundError, RpcOk } from "@hazae41/jsonrpc";
4
5
  import * as Wasm from "@hazae41/wasm";
@@ -116,15 +117,21 @@ function run(module, method, params, mode, maxsparks) {
116
117
  from_base16: (text) => {
117
118
  return Uint8Array.fromHex(text);
118
119
  },
119
- to_base16: (bytes) => {
120
- return bytes.toHex();
120
+ to_base16: (blob) => {
121
+ return blob.toHex();
121
122
  },
122
123
  from_base64: (text) => {
123
124
  return Uint8Array.fromBase64(text);
124
125
  },
125
- to_base64: (bytes) => {
126
- return bytes.toBase64();
126
+ to_base64: (blob) => {
127
+ return blob.toBase64();
127
128
  },
129
+ encode: (value) => {
130
+ return pack_encode(value);
131
+ },
132
+ decode: (blob) => {
133
+ return pack_decode(blob);
134
+ }
128
135
  };
129
136
  imports["texts"] = {
130
137
  length: (text) => {
package/package.json CHANGED
@@ -1,15 +1,13 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@hazae41/bobine",
4
- "version": "0.0.13",
4
+ "version": "0.0.17",
5
5
  "description": "A blockchain in your garage",
6
6
  "repository": "github:hazae41/bobine",
7
7
  "author": "hazae41",
8
8
  "license": "MIT",
9
9
  "scripts": {
10
10
  "examine": "deno lint ./src && deno check ./src && deno test -R ./src",
11
- "version": "deno -RW ./x.vsync.ts && git add deno.json",
12
- "prepare": "deno -RW ./x.dsync.ts && deno install",
13
11
  "prepack": "rm -rf ./out && tsc && tscousin",
14
12
  "produce": "deno run -A ./src/mod.ts serve --env=./.env.local",
15
13
  "develop": "deno run -A ./src/mod.ts serve --env=./.env.local --dev"