@leofcoin/endpoints 0.1.3 → 0.1.4

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 (2) hide show
  1. package/exports/http.js +20 -0
  2. package/package.json +1 -1
package/exports/http.js CHANGED
@@ -30,6 +30,26 @@ export default (chain, port, networkVersion) => {
30
30
  return
31
31
  })
32
32
 
33
+ router.get('/deployContract', async ctx => {
34
+ try {
35
+ const tx = await chain.deployContract(ctx.query.code, ctx.query.params)
36
+ await tx.wait()
37
+ delete tx.wait
38
+ ctx.body = tx
39
+ } catch (error) {
40
+
41
+ }
42
+ })
43
+
44
+ router.get('/createContractAddress', async ctx => {
45
+ try {
46
+ const address = await chain.createContractAddress(ctx.query.owner, ctx.query.code, ctx.query.params)
47
+ ctx.body = address
48
+ } catch (error) {
49
+
50
+ }
51
+ })
52
+
33
53
  // todo finish ...
34
54
  api.use(cors('*'))
35
55
  api.use(router.routes())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/endpoints",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {