Resolve "WIP: UTXO Selection and Storage"

This commit is contained in:
Jim Hamill
2025-01-11 08:39:24 +00:00
parent f934216d68
commit 33fd9bac4d
156 changed files with 13304 additions and 4595 deletions
@@ -0,0 +1,34 @@
import { Bytes } from '@xocash/primitives';
import { Encryption } from '@xocash/stack';
export const encryption = {
from: [
{
label: 'From Passphrase',
inputs: ['Passphrase'],
models: [''],
callback: (args: [string]) => Encryption.fromPassphrase(...args),
extendedInput: true,
},
],
to: [],
methods: [
{
label: 'Encrypt',
inputs: ['UTF8'],
models: ['Your text here'],
callback: async (encryption: Encryption, args: [string]) =>
Bytes.fromBytes(await encryption.encrypt(...args)).toHex(),
},
{
label: 'Decrypt',
inputs: ['Hex'],
models: ['Encrypted Data (hex)'],
callback: async (encryption: Encryption, args: [string]) =>
Bytes.fromBytes(
await encryption.decrypt(Bytes.fromHex(...args).toBytes()),
).toUtf8(),
},
],
};