aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/web3ext/web3ext.go160
1 files changed, 151 insertions, 9 deletions
diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go
index 748b37c84..04b13e483 100644
--- a/internal/web3ext/web3ext.go
+++ b/internal/web3ext/web3ext.go
@@ -18,17 +18,159 @@
package web3ext
var Modules = map[string]string{
- "admin": Admin_JS,
- "debug": Debug_JS,
- "eth": Eth_JS,
- "miner": Miner_JS,
- "net": Net_JS,
- "personal": Personal_JS,
- "rpc": RPC_JS,
- "shh": Shh_JS,
- "txpool": TxPool_JS,
+ "admin": Admin_JS,
+ "bzz": Bzz_JS,
+ "chequebook": Chequebook_JS,
+ "debug": Debug_JS,
+ "ens": ENS_JS,
+ "eth": Eth_JS,
+ "miner": Miner_JS,
+ "net": Net_JS,
+ "personal": Personal_JS,
+ "rpc": RPC_JS,
+ "shh": Shh_JS,
+ "txpool": TxPool_JS,
}
+const Bzz_JS = `
+web3._extend({
+ property: 'bzz',
+ methods:
+ [
+ new web3._extend.Method({
+ name: 'blockNetworkRead',
+ call: 'bzz_blockNetworkRead',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'syncEnabled',
+ call: 'bzz_syncEnabled',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'swapEnabled',
+ call: 'bzz_swapEnabled',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'download',
+ call: 'bzz_download',
+ params: 2,
+ inputFormatter: [null, null]
+ }),
+ new web3._extend.Method({
+ name: 'upload',
+ call: 'bzz_upload',
+ params: 2,
+ inputFormatter: [null, null]
+ }),
+ new web3._extend.Method({
+ name: 'retrieve',
+ call: 'bzz_retrieve',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'store',
+ call: 'bzz_store',
+ params: 2,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'get',
+ call: 'bzz_get',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'put',
+ call: 'bzz_put',
+ params: 2,
+ inputFormatter: [null, null]
+ }),
+ new web3._extend.Method({
+ name: 'modify',
+ call: 'bzz_modify',
+ params: 4,
+ inputFormatter: [null, null, null, null]
+ })
+ ],
+ properties:
+ [
+ new web3._extend.Property({
+ name: 'hive',
+ getter: 'bzz_hive'
+ }),
+ new web3._extend.Property({
+ name: 'info',
+ getter: 'bzz_info',
+ }),
+ ]
+});
+`
+
+const ENS_JS = `
+web3._extend({
+ property: 'ens',
+ methods:
+ [
+ new web3._extend.Method({
+ name: 'register',
+ call: 'ens_register',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'setContentHash',
+ call: 'ens_setContentHash',
+ params: 2,
+ inputFormatter: [null, null]
+ }),
+ new web3._extend.Method({
+ name: 'resolve',
+ call: 'ens_resolve',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ ]
+})
+`
+
+const Chequebook_JS = `
+web3._extend({
+ property: 'chequebook',
+ methods:
+ [
+ new web3._extend.Method({
+ name: 'deposit',
+ call: 'chequebook_deposit',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Property({
+ name: 'balance',
+ getter: 'chequebook_balance',
+ outputFormatter: web3._extend.utils.toDecimal
+ }),
+ new web3._extend.Method({
+ name: 'cash',
+ call: 'chequebook_cash',
+ params: 1,
+ inputFormatter: [null]
+ }),
+ new web3._extend.Method({
+ name: 'issue',
+ call: 'chequebook_issue',
+ params: 2,
+ inputFormatter: [null, null]
+ }),
+ ]
+});
+`
+
const Admin_JS = `
web3._extend({
property: 'admin',