@leofcoin/endpoints 0.1.1 → 0.1.3
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/ws.js +8 -8
- package/package.json +1 -1
package/exports/ws.js
CHANGED
|
@@ -26,9 +26,9 @@ export default (chain, port, protocol) => {
|
|
|
26
26
|
send(chain.blocks[index]),
|
|
27
27
|
blocks:({amount}, {send}) => {
|
|
28
28
|
send(chain.blocks.slice(amount))},
|
|
29
|
-
createTransactionFrom: async (
|
|
29
|
+
createTransactionFrom: async ({from, to, method, parameters, nonce}, {send}) => {
|
|
30
30
|
try {
|
|
31
|
-
const tx = await chain.createTransactionFrom(
|
|
31
|
+
const tx = await chain.createTransactionFrom(from, to, method, parameters, nonce)
|
|
32
32
|
await tx.wait()
|
|
33
33
|
send(tx)
|
|
34
34
|
} catch (error) {
|
|
@@ -41,10 +41,10 @@ export default (chain, port, protocol) => {
|
|
|
41
41
|
send(node.peers),
|
|
42
42
|
validators: ({send}) =>
|
|
43
43
|
send(chain.validators),
|
|
44
|
-
lookup: ({name}, {send}) =>
|
|
45
|
-
send(chain.lookup(name)),
|
|
46
|
-
staticCall: ({contract, method, params}, {send}) =>
|
|
47
|
-
send(chain.staticCall(contract, method, params)),
|
|
44
|
+
lookup: async ({name}, {send}) =>
|
|
45
|
+
send(await chain.lookup(name)),
|
|
46
|
+
staticCall: async({contract, method, params}, {send}) =>
|
|
47
|
+
send(await chain.staticCall(contract, method, params)),
|
|
48
48
|
nativeBurns: ({send}) =>
|
|
49
49
|
send(chain.nativeBurns),
|
|
50
50
|
contracts: ({send}) =>
|
|
@@ -65,8 +65,8 @@ export default (chain, port, protocol) => {
|
|
|
65
65
|
send(chain.nativeCalls),
|
|
66
66
|
participating: ({send}) =>
|
|
67
67
|
send(chain.participating),
|
|
68
|
-
participate: ({address}, {send}) =>
|
|
69
|
-
send(chain.participate(address)),
|
|
68
|
+
participate: async ({address}, {send}) =>
|
|
69
|
+
send(await chain.participate(address)),
|
|
70
70
|
deployContract: async ({code, params}, {send}) => {
|
|
71
71
|
try {
|
|
72
72
|
const tx = await chain.deployContract(code, params)
|