@leofcoin/chain 1.4.77 → 1.4.79
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/exports/browser/chain.js +2 -1
- package/exports/browser/{index-502d190c-60cfcc02.js → index-b203939f-54b1df28.js} +2 -2
- package/exports/browser/{index-fa2c6beb.js → index-c3f4012c.js} +2 -0
- package/exports/browser/{messages-cd01524c-8d88d84b.js → messages-7138679c-83b46e4a.js} +2 -2
- package/exports/browser/{node-browser-b35d8f46.js → node-browser-44a01a16.js} +52 -52
- package/exports/browser/node-browser.js +2 -2
- package/exports/browser/workers/block-worker.js +2 -0
- package/exports/browser/workers/machine-worker.js +2 -0
- package/exports/chain.js +1 -0
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BigNumber, L as Logger, v as version$1, h as hexZeroPad, i as isBigNumberish, a as arrayify, b as isBytes, C as ContractMessage, T as TransactionMessage, R as RawTransactionMessage, g as getDefaultExportFromCjs, c as BlockMessage, d as BWMessage, e as BWRequestMessage } from './index-
|
|
1
|
+
import { B as BigNumber, L as Logger, v as version$1, h as hexZeroPad, i as isBigNumberish, a as arrayify, b as isBytes, C as ContractMessage, T as TransactionMessage, R as RawTransactionMessage, g as getDefaultExportFromCjs, c as BlockMessage, d as BWMessage, e as BWRequestMessage } from './index-c3f4012c.js';
|
|
2
2
|
|
|
3
3
|
const logger$1 = new Logger(version$1);
|
|
4
4
|
const _constructorGuard = {};
|
|
@@ -1952,6 +1952,7 @@ class State extends Contract {
|
|
|
1952
1952
|
catch (error) {
|
|
1953
1953
|
console.log({ e: error });
|
|
1954
1954
|
}
|
|
1955
|
+
globalThis.pubsub.publish('lastBlock', this.lastBlock);
|
|
1955
1956
|
// load local blocks
|
|
1956
1957
|
await this.resolveBlocks();
|
|
1957
1958
|
this.#machine = await new Machine(this.#blocks);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-
|
|
2
|
-
import './index-
|
|
1
|
+
import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-44a01a16.js';
|
|
2
|
+
import './index-c3f4012c.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @params {String} network
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ContractMessage, T as TransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage, V as ValidatorMessage } from './index-
|
|
1
|
+
import { C as ContractMessage, T as TransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage, V as ValidatorMessage } from './index-c3f4012c.js';
|
|
2
2
|
|
|
3
3
|
var nodeConfig = async (config = {
|
|
4
4
|
network: 'leofcoin:peach',
|
|
@@ -91,55 +91,55 @@ globalThis.debug = text => {
|
|
|
91
91
|
if (globalThis.DEBUG) console.log('\x1b[34m\x1b[1m%s', text, '\x1b[0m'); // bright blue
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
class LittlePubSub {
|
|
95
|
-
subscribers = {};
|
|
96
|
-
verbose;
|
|
97
|
-
constructor(verbose
|
|
98
|
-
this.verbose = verbose;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (typeof context === 'undefined') {
|
|
102
|
-
context = handler;
|
|
103
|
-
}
|
|
104
|
-
return context;
|
|
105
|
-
}
|
|
106
|
-
hasSubscribers(event) {
|
|
107
|
-
return this.subscribers[event] ? true : false;
|
|
108
|
-
}
|
|
109
|
-
subscribe(event, handler, context) {
|
|
110
|
-
if (!this.hasSubscribers(event))
|
|
111
|
-
this.subscribers[event] = { handlers: [], value: undefined };
|
|
112
|
-
context = this
|
|
113
|
-
this.subscribers[event].handlers.push(handler.bind(context));
|
|
114
|
-
}
|
|
115
|
-
unsubscribe(event, handler, context) {
|
|
116
|
-
if (!this.hasSubscribers(event))
|
|
117
|
-
return;
|
|
118
|
-
context = this
|
|
119
|
-
const index = this.subscribers[event].handlers.indexOf(handler.bind(context));
|
|
120
|
-
this.subscribers[event].handlers.splice(index);
|
|
121
|
-
if (this.subscribers[event].handlers.length === 0)
|
|
122
|
-
delete this.subscribers[event];
|
|
123
|
-
}
|
|
124
|
-
publish(event, change) {
|
|
125
|
-
if (!this.hasSubscribers(event))
|
|
126
|
-
return;
|
|
127
|
-
if (this.verbose || this.subscribers[event]
|
|
128
|
-
this.subscribers[event].value = change;
|
|
129
|
-
this.subscribers[event].handlers.forEach((handler) => {
|
|
130
|
-
handler(change, this.subscribers[event].value);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
once(event) {
|
|
135
|
-
return new Promise((resolve) => {
|
|
136
|
-
const cb = (value) => {
|
|
137
|
-
this.unsubscribe(event, cb);
|
|
138
|
-
resolve(value);
|
|
139
|
-
};
|
|
140
|
-
this.subscribe(event, cb);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
94
|
+
class LittlePubSub {
|
|
95
|
+
subscribers = {};
|
|
96
|
+
verbose;
|
|
97
|
+
constructor(verbose) {
|
|
98
|
+
this.verbose = verbose;
|
|
99
|
+
}
|
|
100
|
+
_handleContext(handler, context) {
|
|
101
|
+
if (typeof context === 'undefined') {
|
|
102
|
+
context = handler;
|
|
103
|
+
}
|
|
104
|
+
return context;
|
|
105
|
+
}
|
|
106
|
+
hasSubscribers(event) {
|
|
107
|
+
return this.subscribers[event] ? true : false;
|
|
108
|
+
}
|
|
109
|
+
subscribe(event, handler, context) {
|
|
110
|
+
if (!this.hasSubscribers(event))
|
|
111
|
+
this.subscribers[event] = { handlers: [], value: undefined };
|
|
112
|
+
context = this._handleContext(handler, context);
|
|
113
|
+
this.subscribers[event].handlers.push(handler.bind(context));
|
|
114
|
+
}
|
|
115
|
+
unsubscribe(event, handler, context) {
|
|
116
|
+
if (!this.hasSubscribers(event))
|
|
117
|
+
return;
|
|
118
|
+
context = this._handleContext(handler, context);
|
|
119
|
+
const index = this.subscribers[event].handlers.indexOf(handler.bind(context));
|
|
120
|
+
this.subscribers[event].handlers.splice(index);
|
|
121
|
+
if (this.subscribers[event].handlers.length === 0)
|
|
122
|
+
delete this.subscribers[event];
|
|
123
|
+
}
|
|
124
|
+
publish(event, change) {
|
|
125
|
+
if (!this.hasSubscribers(event))
|
|
126
|
+
return;
|
|
127
|
+
if (this.verbose || this.subscribers[event]?.value !== change) {
|
|
128
|
+
this.subscribers[event].value = change;
|
|
129
|
+
this.subscribers[event].handlers.forEach((handler) => {
|
|
130
|
+
handler(change, this.subscribers[event].value);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
once(event) {
|
|
135
|
+
return new Promise((resolve) => {
|
|
136
|
+
const cb = (value) => {
|
|
137
|
+
this.unsubscribe(event, cb);
|
|
138
|
+
resolve(value);
|
|
139
|
+
};
|
|
140
|
+
this.subscribe(event, cb);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
// base-x encoding / decoding
|
|
@@ -20257,7 +20257,7 @@ class Identity {
|
|
|
20257
20257
|
globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
|
|
20258
20258
|
}
|
|
20259
20259
|
else {
|
|
20260
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-
|
|
20260
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-b203939f-54b1df28.js');
|
|
20261
20261
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
20262
20262
|
await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
|
|
20263
20263
|
await globalThis.walletStore.put('version', String(1));
|
|
@@ -20428,7 +20428,7 @@ class Peernet {
|
|
|
20428
20428
|
this.root = options.root;
|
|
20429
20429
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
20430
20430
|
// FolderMessageResponse
|
|
20431
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
20431
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-7138679c-83b46e4a.js');
|
|
20432
20432
|
/**
|
|
20433
20433
|
* proto Object containing protos
|
|
20434
20434
|
* @type {Object}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { N as default } from './node-browser-
|
|
2
|
-
import './index-
|
|
1
|
+
export { N as default } from './node-browser-44a01a16.js';
|
|
2
|
+
import './index-c3f4012c.js';
|
package/exports/chain.js
CHANGED
|
@@ -578,6 +578,7 @@ class State extends Contract {
|
|
|
578
578
|
catch (error) {
|
|
579
579
|
console.log({ e: error });
|
|
580
580
|
}
|
|
581
|
+
globalThis.pubsub.publish('lastBlock', this.lastBlock);
|
|
581
582
|
// load local blocks
|
|
582
583
|
await this.resolveBlocks();
|
|
583
584
|
this.#machine = await new Machine(this.#blocks);
|