godprotocol 1.1.0 → 1.1.2
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/Datatypes/arr.js +11 -0
- package/Datatypes/bool.js +11 -0
- package/Datatypes/callable.js +11 -0
- package/Datatypes/functions/storage.js +5 -0
- package/Datatypes/num.js +11 -0
- package/Datatypes/str.js +11 -0
- package/Datatypes/twa.js +11 -0
- package/Datatypes/voi.js +11 -0
- package/Index.js +36 -2
- package/Objects/Account.js +35 -322
- package/Objects/Block.js +7 -80
- package/Objects/Blockweb.js +19 -26
- package/Objects/Callable.js +40 -0
- package/Objects/Chain.js +20 -244
- package/Objects/GDS/Arena_classic/.config +1 -0
- package/Objects/GDS/Arena_classic/Accounts/lola/.config +1 -0
- package/Objects/Manager.js +28 -294
- package/Objects/Oracle.js +67 -84
- package/Objects/Repository.js +67 -0
- package/Objects/Trinity.js +24 -0
- package/Objects/Virtual_machine.js +16 -206
- package/callables/functions/assign.js +6 -0
- package/callables/functions/display.js +3 -0
- package/callables/register.js +22 -0
- package/package.json +24 -43
- package/utils/create_server.js +35 -88
- package/utils/functions.js +0 -70
- package/utils/server.cert +23 -0
- package/utils/server.key +28 -0
- package/utils/services.js +61 -21
- package/utils/vm_utils.js +53 -275
- package/Executables/callables.js +0 -131
- package/Executables/executables.js +0 -230
- package/Executables/functions/adminstrator/adm_register.js +0 -29
- package/Executables/functions/adminstrator/native_components.js +0 -10
- package/Executables/functions/adminstrator/query_selectors.js +0 -10
- package/Executables/functions/adminstrator/render.js +0 -24
- package/Executables/functions/array_register.js +0 -161
- package/Executables/functions/assign.js +0 -19
- package/Executables/functions/display.js +0 -55
- package/Executables/functions/folder.js +0 -95
- package/Executables/functions/folder_register.js +0 -87
- package/Executables/functions/importcheck.js +0 -13
- package/Executables/functions/indices.js +0 -56
- package/Executables/functions/len.js +0 -22
- package/Executables/functions/methods/array.js +0 -272
- package/Executables/functions/methods/string.js +0 -197
- package/Executables/functions/methods/twain.js +0 -148
- package/Executables/functions/op.js +0 -15
- package/Executables/functions/price_register.js +0 -30
- package/Executables/functions/pricing.js +0 -26
- package/Executables/functions/servers/account.js +0 -81
- package/Executables/functions/servers/account_register.js +0 -56
- package/Executables/functions/servers/block.js +0 -21
- package/Executables/functions/servers/block_register.js +0 -18
- package/Executables/functions/servers/chain.js +0 -42
- package/Executables/functions/servers/chain_register.js +0 -28
- package/Executables/functions/set_error_catch.js +0 -34
- package/Executables/functions/string_register.js +0 -130
- package/Executables/functions/twain_register.js +0 -56
- package/Executables/functions/typecast.js +0 -43
- package/Executables/functions/utils.js +0 -9
- package/Executables/stack.js +0 -53
- package/Loader_sequence/main.js +0 -805
- package/Loader_sequence/repository.js +0 -33
- package/Objects/Explorer.js +0 -40
- package/Objects/Fee.js +0 -33
- package/Objects/Filesystem.js +0 -216
- package/Objects/Frame.js +0 -54
- package/Objects/Opcodes.js +0 -87
- package/Objects/Protocol.js +0 -5
- package/Trinity.js +0 -20
- package/callables.js +0 -172
- package/framer.js +0 -124
- package/opcodes/add.js +0 -15
- package/opcodes/indices.js +0 -82
- package/opcodes/jmp.js +0 -16
- package/opcodes/std.js +0 -12
- package/opcodes.js +0 -96
- package/readme.md +0 -133
- package/starter_scripts/constants.seq +0 -11
- package/tsconfig.json +0 -8
- package/types/Account.d.ts +0 -73
- package/types/Block.d.ts +0 -22
- package/types/Blockweb.d.ts +0 -14
- package/types/Chain.d.ts +0 -35
- package/types/Explorer.d.ts +0 -9
- package/types/Filesystem.d.ts +0 -23
- package/types/Frame.d.ts +0 -14
- package/types/Manager.d.ts +0 -21
- package/types/Opcodes.d.ts +0 -11
- package/types/Oracle.d.ts +0 -17
- package/types/Virtual_machine.d.ts +0 -20
- package/types/index.d.ts +0 -4
- package/utils/hash.js +0 -13
- package/utils/logger.js +0 -79
- package/utils/privacy.js +0 -22
- package/utils/type_coersion.js +0 -3
package/types/Frame.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare class Frame {
|
|
2
|
-
parent: Frame | null;
|
|
3
|
-
object: any;
|
|
4
|
-
children: Frame[];
|
|
5
|
-
instructions: (string | Frame)[];
|
|
6
|
-
|
|
7
|
-
constructor(object: any, parent?: Frame | null);
|
|
8
|
-
|
|
9
|
-
frame(object: any): Frame;
|
|
10
|
-
to_instruction(): void;
|
|
11
|
-
flatten_instructions(): string[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default Frame;
|
package/types/Manager.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import Account from "./Account";
|
|
2
|
-
import Blockweb from "./Blockweb";
|
|
3
|
-
import Oracle from "./Oracle";
|
|
4
|
-
|
|
5
|
-
declare class Manager {
|
|
6
|
-
accounts: { [key: string]: Account };
|
|
7
|
-
running: number;
|
|
8
|
-
tracks: { [key: string]: any };
|
|
9
|
-
web: Blockweb;
|
|
10
|
-
oracle: Oracle;
|
|
11
|
-
clock: NodeJS.Timeout | null;
|
|
12
|
-
|
|
13
|
-
constructor();
|
|
14
|
-
|
|
15
|
-
start_clock(): void;
|
|
16
|
-
get_account(name: string): Account | undefined;
|
|
17
|
-
add_account(name: string, meta?: { private?: boolean }): Account;
|
|
18
|
-
push(program: { sequence: string[]; account: Account; pid: string }): void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default Manager;
|
package/types/Opcodes.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare class Opcodes {
|
|
2
|
-
opcodes: { [key: string]: (args?: any) => any };
|
|
3
|
-
|
|
4
|
-
constructor();
|
|
5
|
-
|
|
6
|
-
set(opcode: string, circuit: (args?: any) => any): void;
|
|
7
|
-
prepare_operation(opcode: string, context: any): void;
|
|
8
|
-
stdin(object: any, cb?: () => void): void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default Opcodes;
|
package/types/Oracle.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// import fs from "fs";
|
|
2
|
-
|
|
3
|
-
declare class Oracle {
|
|
4
|
-
// fs: typeof fs;
|
|
5
|
-
mgr: any;
|
|
6
|
-
datapaths: { [key: string]: { type: string; obj: any } };
|
|
7
|
-
|
|
8
|
-
constructor(mgr: any);
|
|
9
|
-
|
|
10
|
-
set(path: string, data: { type: string; obj: any }): void;
|
|
11
|
-
|
|
12
|
-
get(path: string): { type: string; obj: any } | undefined;
|
|
13
|
-
|
|
14
|
-
write(addr: string, data: any, meta?: { encoding: string }): void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default Oracle;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import Opcodes from "./Opcodes";
|
|
2
|
-
|
|
3
|
-
declare class Virtual_machine extends Opcodes {
|
|
4
|
-
account: any;
|
|
5
|
-
contexts: any[];
|
|
6
|
-
stack: any[];
|
|
7
|
-
track: any;
|
|
8
|
-
|
|
9
|
-
constructor(context: any);
|
|
10
|
-
|
|
11
|
-
get_context(index?: number): any;
|
|
12
|
-
|
|
13
|
-
parse_arg(arg: string, is_cursor: boolean): any;
|
|
14
|
-
|
|
15
|
-
split_instruction(instruction: string): { opcode: string; args: string };
|
|
16
|
-
|
|
17
|
-
execute(instruction: string, track: any): void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default Virtual_machine;
|
package/types/index.d.ts
DELETED
package/utils/hash.js
DELETED
package/utils/logger.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
const blessed = require('blessed');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// const screen = blessed.screen({
|
|
5
|
-
// smartCSR: true,
|
|
6
|
-
// title:'God Protocol'
|
|
7
|
-
// })
|
|
8
|
-
|
|
9
|
-
class Logger {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.log_boxes= new Array()
|
|
12
|
-
|
|
13
|
-
// this. clock_box = blessed.box({
|
|
14
|
-
// left: 'left',
|
|
15
|
-
// width: '100%',
|
|
16
|
-
// height: 'shrink',
|
|
17
|
-
// content: '',
|
|
18
|
-
// tags: true,
|
|
19
|
-
// border: {
|
|
20
|
-
// type: 'line'
|
|
21
|
-
// },
|
|
22
|
-
// style: {
|
|
23
|
-
// border: {
|
|
24
|
-
// fg: 'cyan'
|
|
25
|
-
// }
|
|
26
|
-
// }
|
|
27
|
-
// })
|
|
28
|
-
|
|
29
|
-
// screen.append(this.clock_box)
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
log=(data_logger)=> {
|
|
36
|
-
// this.clock_box.setContent(data_logger())
|
|
37
|
-
// this.update_log_box_positions()
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
update_log_box_positions() {
|
|
42
|
-
// this.log_boxes.forEach((box, index) => {
|
|
43
|
-
// box.top = index;
|
|
44
|
-
// });
|
|
45
|
-
|
|
46
|
-
// this.clock_box.top = this.log_boxes.length;
|
|
47
|
-
// screen.render();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
store_log=(message)=> {
|
|
51
|
-
// const logBox = blessed.box({
|
|
52
|
-
// top: this.log_boxes.length,
|
|
53
|
-
// left: 'left',
|
|
54
|
-
// width: '100%',
|
|
55
|
-
// height: 3,
|
|
56
|
-
// content: message,
|
|
57
|
-
// tags: true,
|
|
58
|
-
// border: {
|
|
59
|
-
// type: 'line'
|
|
60
|
-
// },
|
|
61
|
-
// style: {
|
|
62
|
-
// border: {
|
|
63
|
-
// fg: 'green'
|
|
64
|
-
// }
|
|
65
|
-
// }
|
|
66
|
-
// });
|
|
67
|
-
|
|
68
|
-
// screen.append(logBox);
|
|
69
|
-
// this.log_boxes.push(logBox);
|
|
70
|
-
// this. update_log_box_positions();
|
|
71
|
-
// screen.render();
|
|
72
|
-
// console.log(message)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export default Logger;
|
package/utils/privacy.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const EC = require("elliptic").ec;
|
|
2
|
-
const ec = new EC("secp256k1"); // You can use other curves like 'ed25519' based on your requirements
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Function to validate a signature using elliptic
|
|
6
|
-
* @param {string} public_key - The public key of the user
|
|
7
|
-
* @param {string} message - The original message that was signed
|
|
8
|
-
* @param {string} signature - The signature to be validated
|
|
9
|
-
* @returns {boolean} - True if the signature is valid, false otherwise
|
|
10
|
-
*/
|
|
11
|
-
const validate_signature = (public_key, message, signature) => {
|
|
12
|
-
let key = ec.keyFromPublic(public_key, "hex");
|
|
13
|
-
let hash = ec.hash().update(message).digest("hex");
|
|
14
|
-
let sig = {
|
|
15
|
-
r: signature.slice(0, 64),
|
|
16
|
-
s: signature.slice(64, 128),
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return key.verify(hash, sig);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default validate_signature;
|
package/utils/type_coersion.js
DELETED