@leofcoin/chain 1.4.78 → 1.4.80

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.
@@ -1,205 +0,0 @@
1
- import { F as FormatInterface } from './node-browser-b35d8f46.js';
2
- import './index-fa2c6beb.js';
3
-
4
- var proto$b = {
5
- data: new Uint8Array(),
6
- signature: new Uint8Array(),
7
- 'from?': String(),
8
- 'to?': String(),
9
- 'id?': String()
10
- };
11
-
12
- class PeernetMessage extends FormatInterface {
13
- get messageName() {
14
- return 'PeernetMessage';
15
- }
16
- constructor(buffer) {
17
- const name = 'peernet-message';
18
- super(buffer, proto$b, { name });
19
- }
20
- }
21
-
22
- var proto$a = {
23
- hash: String(),
24
- 'store?': String()
25
- };
26
-
27
- /**
28
- * @example `
29
- new DHTMessage(hash, store)
30
- // store = optional if not set, peernet checks every store
31
- let message = new DHTMessage('hashmvbs124xcfd...', 'transaction')
32
- message = new DHTMessage('hashmvbs124xcfd...', 'block')
33
- `
34
- */
35
- class DHTMessage extends FormatInterface {
36
- get messageName() {
37
- return 'PeernetDHTMessage';
38
- }
39
- constructor(data) {
40
- const name = 'peernet-dht';
41
- super(data, proto$a, { name });
42
- }
43
- }
44
-
45
- var proto$9 = {
46
- hash: String(),
47
- has: Boolean()
48
- };
49
-
50
- class DHTMessageResponse extends FormatInterface {
51
- get messageName() {
52
- return 'PeernetDHTMessageResponse';
53
- }
54
- constructor(data) {
55
- const name = 'peernet-dht-response';
56
- super(data, proto$9, { name });
57
- }
58
- }
59
-
60
- var proto$8 = {
61
- hash: String(),
62
- 'store?': String()
63
- };
64
-
65
- /**
66
- * @extends {CodecFormat}
67
- */
68
- class DataMessage extends FormatInterface {
69
- get messageName() {
70
- return 'PeernetDataMessage';
71
- }
72
- /**
73
- * @param {Buffer|String|Object|DataMessage} data - The data needed to create the DataMessage
74
- */
75
- constructor(data) {
76
- super(data, proto$8, { name: 'peernet-data' });
77
- }
78
- }
79
-
80
- var proto$7 = {
81
- data: new Uint8Array(),
82
- topic: new Uint8Array()
83
- };
84
-
85
- class PsMessage extends FormatInterface {
86
- get messageName() {
87
- return 'PsMessage';
88
- }
89
- constructor(buffer) {
90
- const name = 'peernet-ps';
91
- super(buffer, proto$7, { name });
92
- }
93
- }
94
-
95
- var proto$6 = {
96
- id: String()
97
- };
98
-
99
- class PeerMessage extends FormatInterface {
100
- get messageName() {
101
- return 'PeernetPeerMessage';
102
- }
103
- constructor(data) {
104
- const name = 'peernet-peer';
105
- super(data, proto$6, { name });
106
- }
107
- }
108
-
109
- var proto$5 = {
110
- request: String(),
111
- 'requested?': new Uint8Array()
112
- };
113
-
114
- class RequestMessage extends FormatInterface {
115
- get messageName() {
116
- return 'PeernetRequestMessage';
117
- }
118
- constructor(data) {
119
- const name = 'peernet-request';
120
- super(data, proto$5, { name });
121
- }
122
- }
123
-
124
- var proto$4 = {
125
- response: {}
126
- };
127
-
128
- class ResponseMessage extends FormatInterface {
129
- get messageName() {
130
- return 'PeernetResponseMessage';
131
- }
132
- constructor(data) {
133
- const name = 'peernet-response';
134
- super(data, proto$4, { name });
135
- }
136
- }
137
-
138
- var proto$3 = {
139
- id: String()
140
- };
141
-
142
- class PeerMessageResponse extends FormatInterface {
143
- get messageName() {
144
- return 'PeernetPeerMessageResponse';
145
- }
146
- constructor(data) {
147
- const name = 'peernet-peer-response';
148
- super(data, proto$3, { name });
149
- }
150
- }
151
-
152
- var proto$2 = {
153
- hash: String(),
154
- data: new Uint8Array(),
155
- };
156
-
157
- class DataMessageResponse extends FormatInterface {
158
- get messageName() {
159
- return 'PeernetDataMessageResponse';
160
- }
161
- constructor(data) {
162
- const name = 'peernet-data-response';
163
- super(data, proto$2, { name });
164
- }
165
- }
166
-
167
- var proto$1 = {
168
- value: String(),
169
- author: String(),
170
- timestamp: Number(),
171
- files: [String()],
172
- };
173
-
174
- class ChatMessage extends FormatInterface {
175
- get messageName() {
176
- return 'ChatMessage';
177
- }
178
- constructor(buffer) {
179
- const name = 'chat-message';
180
- super(buffer, proto$1, { name });
181
- }
182
- }
183
-
184
- var proto = {
185
- path: String(),
186
- 'content?': '',
187
- 'links?': []
188
- };
189
-
190
- /**
191
- * @extends {CodecFormat}
192
- */
193
- class PeernetFile extends FormatInterface {
194
- get messageName() {
195
- return 'PeernetFile';
196
- }
197
- /**
198
- * @param {Buffer|String|Object|DataMessage} data - The data needed to create the DataMessage
199
- */
200
- constructor(data) {
201
- super(data, proto, { name: 'peernet-file' });
202
- }
203
- }
204
-
205
- export { ChatMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PeerMessage, PeerMessageResponse, PeernetFile, PeernetMessage, PsMessage, RequestMessage, ResponseMessage };
@@ -1,71 +0,0 @@
1
- import { BigNumberish } from '@ethersproject/bignumber';
2
- import State from './state.js';
3
- export default class Chain extends State {
4
- #private;
5
- id: string;
6
- utils: {};
7
- constructor();
8
- get nativeToken(): any;
9
- get validators(): any[];
10
- hasTransactionToHandle(): Promise<boolean>;
11
- participate(address: any): Promise<void>;
12
- /**
13
- * every tx done is trough contracts so no need for amount
14
- * data is undefined when nothing is returned
15
- * error is thrown on error so undefined data doesn't mean there is an error...
16
- **/
17
- sendTransaction(transaction: any): Promise<{
18
- hash: any;
19
- data: any;
20
- fee: any;
21
- wait: Promise<unknown>;
22
- message: any;
23
- }>;
24
- addContract(transaction: any, contractMessage: any): Promise<{
25
- hash: any;
26
- data: any;
27
- fee: any;
28
- wait: Promise<unknown>;
29
- message: any;
30
- }>;
31
- /**
32
- *
33
- * @param {Address} sender
34
- * @param {Address} contract
35
- * @param {String} method
36
- * @param {Array} parameters
37
- * @returns
38
- */
39
- internalCall(sender: any, contract: any, method: any, parameters: any): Promise<any>;
40
- /**
41
- *
42
- * @param {Address} contract
43
- * @param {String} method
44
- * @param {Array} parameters
45
- * @returns
46
- */
47
- call(contract: any, method: any, parameters: any): Promise<any>;
48
- staticCall(contract: any, method: any, parameters?: any): Promise<any>;
49
- delegate(contract: any, method: any, parameters: any): Promise<any>;
50
- staticDelegate(contract: Address, method: string, parameters: []): any;
51
- mint(to: string, amount: BigNumberish): Promise<any>;
52
- transfer(from: string, to: string, amount: BigNumberish): Promise<any>;
53
- get balances(): Promise<{
54
- address: BigNumberish;
55
- }[]>;
56
- get contracts(): Promise<any>;
57
- deleteAll(): Promise<any>;
58
- /**
59
- * lookup an address for a registered name using the builtin nameService
60
- * @check nameService
61
- *
62
- * @param {String} - contractName
63
- * @returns {String} - address
64
- *
65
- * @example chain.lookup('myCoolContractName') // qmqsfddfdgfg...
66
- */
67
- lookup(name: any): Promise<{
68
- owner: string;
69
- address: string;
70
- }>;
71
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- declare namespace _default {
2
- const datadir: string;
3
- const configPath: string;
4
- }
5
- export default _default;
@@ -1,6 +0,0 @@
1
- declare namespace _default {
2
- namespace block {
3
- const size: number;
4
- }
5
- }
6
- export default _default;
@@ -1,31 +0,0 @@
1
- /**
2
- * @extends {Transaction}
3
- */
4
- export default class Contract extends Transaction {
5
- init(): Promise<void>;
6
- /**
7
- *
8
- * @param {Address} creator
9
- * @param {String} contract
10
- * @param {Array} constructorParameters
11
- * @returns lib.createContractMessage
12
- */
13
- createContractMessage(creator: Address, contract: string, constructorParameters?: any[]): Promise<import("@leofcoin/messages").ContractMessage>;
14
- /**
15
- *
16
- * @param {Address} creator
17
- * @param {String} contract
18
- * @param {Array} constructorParameters
19
- * @returns {Address}
20
- */
21
- createContractAddress(creator: Address, contract: string, constructorParameters?: any[]): Address;
22
- /**
23
- *
24
- * @param {String} contract
25
- * @param {Array} parameters
26
- * @returns
27
- */
28
- deployContract(contract: string, constructorParameters?: any[]): Promise<any>;
29
- deployContractMessage(message: any): Promise<void>;
30
- }
31
- import Transaction from "./transaction.js";
@@ -1,4 +0,0 @@
1
- declare namespace _default {
2
- const deployment: number;
3
- }
4
- export default _default;
@@ -1,26 +0,0 @@
1
- export default class Machine {
2
- constructor(blocks: any);
3
- lastBlock: {
4
- index: number;
5
- hash: string;
6
- previousHash: string;
7
- };
8
- worker: any;
9
- /**
10
- *
11
- * @param {Address} contract
12
- * @param {String} method
13
- * @param {Array} parameters
14
- * @returns Promise<message>
15
- */
16
- execute(contract: Address, method: string, parameters: any[]): Promise<any>;
17
- get(contract: any, method: any, parameters: any): Promise<any>;
18
- has(address: any): Promise<any>;
19
- delete(hash: any): Promise<any>;
20
- /**
21
- *
22
- * @returns Promise
23
- */
24
- deleteAll(): Promise<any>;
25
- #private;
26
- }
@@ -1,6 +0,0 @@
1
- declare namespace _default {
2
- export function isType(type: any, value: any): any;
3
- export { isAddress };
4
- }
5
- export default _default;
6
- declare function isAddress(address: any): boolean;