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.
Files changed (98) hide show
  1. package/Datatypes/arr.js +11 -0
  2. package/Datatypes/bool.js +11 -0
  3. package/Datatypes/callable.js +11 -0
  4. package/Datatypes/functions/storage.js +5 -0
  5. package/Datatypes/num.js +11 -0
  6. package/Datatypes/str.js +11 -0
  7. package/Datatypes/twa.js +11 -0
  8. package/Datatypes/voi.js +11 -0
  9. package/Index.js +36 -2
  10. package/Objects/Account.js +35 -322
  11. package/Objects/Block.js +7 -80
  12. package/Objects/Blockweb.js +19 -26
  13. package/Objects/Callable.js +40 -0
  14. package/Objects/Chain.js +20 -244
  15. package/Objects/GDS/Arena_classic/.config +1 -0
  16. package/Objects/GDS/Arena_classic/Accounts/lola/.config +1 -0
  17. package/Objects/Manager.js +28 -294
  18. package/Objects/Oracle.js +67 -84
  19. package/Objects/Repository.js +67 -0
  20. package/Objects/Trinity.js +24 -0
  21. package/Objects/Virtual_machine.js +16 -206
  22. package/callables/functions/assign.js +6 -0
  23. package/callables/functions/display.js +3 -0
  24. package/callables/register.js +22 -0
  25. package/package.json +24 -43
  26. package/utils/create_server.js +35 -88
  27. package/utils/functions.js +0 -70
  28. package/utils/server.cert +23 -0
  29. package/utils/server.key +28 -0
  30. package/utils/services.js +61 -21
  31. package/utils/vm_utils.js +53 -275
  32. package/Executables/callables.js +0 -131
  33. package/Executables/executables.js +0 -230
  34. package/Executables/functions/adminstrator/adm_register.js +0 -29
  35. package/Executables/functions/adminstrator/native_components.js +0 -10
  36. package/Executables/functions/adminstrator/query_selectors.js +0 -10
  37. package/Executables/functions/adminstrator/render.js +0 -24
  38. package/Executables/functions/array_register.js +0 -161
  39. package/Executables/functions/assign.js +0 -19
  40. package/Executables/functions/display.js +0 -55
  41. package/Executables/functions/folder.js +0 -95
  42. package/Executables/functions/folder_register.js +0 -87
  43. package/Executables/functions/importcheck.js +0 -13
  44. package/Executables/functions/indices.js +0 -56
  45. package/Executables/functions/len.js +0 -22
  46. package/Executables/functions/methods/array.js +0 -272
  47. package/Executables/functions/methods/string.js +0 -197
  48. package/Executables/functions/methods/twain.js +0 -148
  49. package/Executables/functions/op.js +0 -15
  50. package/Executables/functions/price_register.js +0 -30
  51. package/Executables/functions/pricing.js +0 -26
  52. package/Executables/functions/servers/account.js +0 -81
  53. package/Executables/functions/servers/account_register.js +0 -56
  54. package/Executables/functions/servers/block.js +0 -21
  55. package/Executables/functions/servers/block_register.js +0 -18
  56. package/Executables/functions/servers/chain.js +0 -42
  57. package/Executables/functions/servers/chain_register.js +0 -28
  58. package/Executables/functions/set_error_catch.js +0 -34
  59. package/Executables/functions/string_register.js +0 -130
  60. package/Executables/functions/twain_register.js +0 -56
  61. package/Executables/functions/typecast.js +0 -43
  62. package/Executables/functions/utils.js +0 -9
  63. package/Executables/stack.js +0 -53
  64. package/Loader_sequence/main.js +0 -805
  65. package/Loader_sequence/repository.js +0 -33
  66. package/Objects/Explorer.js +0 -40
  67. package/Objects/Fee.js +0 -33
  68. package/Objects/Filesystem.js +0 -216
  69. package/Objects/Frame.js +0 -54
  70. package/Objects/Opcodes.js +0 -87
  71. package/Objects/Protocol.js +0 -5
  72. package/Trinity.js +0 -20
  73. package/callables.js +0 -172
  74. package/framer.js +0 -124
  75. package/opcodes/add.js +0 -15
  76. package/opcodes/indices.js +0 -82
  77. package/opcodes/jmp.js +0 -16
  78. package/opcodes/std.js +0 -12
  79. package/opcodes.js +0 -96
  80. package/readme.md +0 -133
  81. package/starter_scripts/constants.seq +0 -11
  82. package/tsconfig.json +0 -8
  83. package/types/Account.d.ts +0 -73
  84. package/types/Block.d.ts +0 -22
  85. package/types/Blockweb.d.ts +0 -14
  86. package/types/Chain.d.ts +0 -35
  87. package/types/Explorer.d.ts +0 -9
  88. package/types/Filesystem.d.ts +0 -23
  89. package/types/Frame.d.ts +0 -14
  90. package/types/Manager.d.ts +0 -21
  91. package/types/Opcodes.d.ts +0 -11
  92. package/types/Oracle.d.ts +0 -17
  93. package/types/Virtual_machine.d.ts +0 -20
  94. package/types/index.d.ts +0 -4
  95. package/utils/hash.js +0 -13
  96. package/utils/logger.js +0 -79
  97. package/utils/privacy.js +0 -22
  98. 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;
@@ -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;
@@ -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
@@ -1,4 +0,0 @@
1
- export { default as Account } from "./Account";
2
- export { default as Virtual_machine } from "./Virtual_machine";
3
- export { default as Filesystem } from "./Filesystem";
4
- export { default as Loader_sequence } from "../Loader_sequence/main";
package/utils/hash.js DELETED
@@ -1,13 +0,0 @@
1
- const crypto = require("crypto");
2
-
3
- const hash = (data, alg) => {
4
- let hash = crypto.createHash(alg|| "sha256");
5
-
6
- hash.update(data);
7
-
8
- let result = hash.digest("hex");
9
-
10
- return result;
11
- };
12
-
13
- export { hash };
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;
@@ -1,3 +0,0 @@
1
- const type_coersion = (operation, op0, op1)=>{
2
-
3
- }