pubk to address and vice versa

and other stuff, and stuff that was needed for pubk to address and vice versa, which is a lot of stuff
This commit is contained in:
stjet
2024-06-15 13:37:15 +00:00
parent b0a6bfea47
commit 5977833c0d
64 changed files with 306 additions and 153 deletions

View File

@@ -1,6 +1,5 @@
export type BananoAddress = `ban_${string}`;
export type NanoAddress = `nano_${string}`;
export type Address = BananoAddress | NanoAddress;
export type AddressPrefix = "ban_" | "nano_";
export type Address = `${AddressPrefix}${string}`;
/** 32 byte block hash represented as 64 char hexadecimal */
export type BlockHash = string;
@@ -11,7 +10,7 @@ export type BlockSubtype = BlockBasicTypes | "epoch";
export type BlockLegacyTypes = BlockBasicTypes | "open";
export type BlockAllTypes = BlockLegacyTypes | "state";
export interface Block {
export interface BlockNoSignature {
type: BlockAllTypes,
account: Address,
previous: BlockHash,
@@ -19,6 +18,9 @@ export interface Block {
balance: `${number}`,
link: BlockHash,
link_as_account: Address,
}
export interface Block extends BlockNoSignature {
signature: string,
work?: string,
}