From 08d72a9245ce6f1e11f84a6b59d66cb083bea9f9 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 9 Jun 2015 10:59:44 +0200 Subject: added personal API --- rpc/api/personal_js.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 rpc/api/personal_js.go (limited to 'rpc/api/personal_js.go') diff --git a/rpc/api/personal_js.go b/rpc/api/personal_js.go new file mode 100644 index 000000000..7fd9a2dea --- /dev/null +++ b/rpc/api/personal_js.go @@ -0,0 +1,34 @@ +package api + +const Personal_JS = ` +web3.extend({ + property: 'personal', + methods: + [ + new web3.extend.Method({ + name: 'listAccounts', + call: 'personal_listAccounts', + params: 0, + inputFormatter: [], + outputFormatter: function(obj) { return obj; } + }), + new web3.extend.Method({ + name: 'newAccount', + call: 'personal_newAccount', + params: 1, + inputFormatter: [web3.extend.formatters.formatInputString], + outputFormatter: web3.extend.formatters.formatOutputString + }), + new web3.extend.Method({ + name: 'unlockAccount', + call: 'personal_unlockAccount', + params: 3, + inputFormatter: [web3.extend.formatters.formatInputString,web3.extend.formatters.formatInputString,web3.extend.formatters.formatInputInt], + outputFormatter: web3.extend.formatters.formatOutputBool + }) + ], + properties: + [ + ] +}); +` -- cgit v1.2.3 From 5f8e5a487588bab49fb3c9321fd8903132426c47 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Wed, 10 Jun 2015 09:42:14 +0200 Subject: upgrade web3.js with _extend support --- rpc/api/personal_js.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'rpc/api/personal_js.go') diff --git a/rpc/api/personal_js.go b/rpc/api/personal_js.go index 7fd9a2dea..f9fa60e78 100644 --- a/rpc/api/personal_js.go +++ b/rpc/api/personal_js.go @@ -1,30 +1,30 @@ package api const Personal_JS = ` -web3.extend({ +web3._extend({ property: 'personal', methods: [ - new web3.extend.Method({ + new web3._extend.Method({ name: 'listAccounts', call: 'personal_listAccounts', params: 0, inputFormatter: [], outputFormatter: function(obj) { return obj; } }), - new web3.extend.Method({ + new web3._extend.Method({ name: 'newAccount', call: 'personal_newAccount', params: 1, - inputFormatter: [web3.extend.formatters.formatInputString], - outputFormatter: web3.extend.formatters.formatOutputString + inputFormatter: [web3._extend.formatters.formatInputString], + outputFormatter: web3._extend.formatters.formatOutputString }), - new web3.extend.Method({ + new web3._extend.Method({ name: 'unlockAccount', call: 'personal_unlockAccount', params: 3, - inputFormatter: [web3.extend.formatters.formatInputString,web3.extend.formatters.formatInputString,web3.extend.formatters.formatInputInt], - outputFormatter: web3.extend.formatters.formatOutputBool + inputFormatter: [web3._extend.formatters.formatInputString,web3._extend.formatters.formatInputString,web3._extend.formatters.formatInputInt], + outputFormatter: web3._extend.formatters.formatOutputBool }) ], properties: -- cgit v1.2.3 From bd38428f33b127e9c60d26127695e50c55798fcd Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Wed, 10 Jun 2015 11:29:52 +0200 Subject: cleanup of javascript API --- rpc/api/personal_js.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'rpc/api/personal_js.go') diff --git a/rpc/api/personal_js.go b/rpc/api/personal_js.go index f9fa60e78..ddd47f6a4 100644 --- a/rpc/api/personal_js.go +++ b/rpc/api/personal_js.go @@ -5,13 +5,6 @@ web3._extend({ property: 'personal', methods: [ - new web3._extend.Method({ - name: 'listAccounts', - call: 'personal_listAccounts', - params: 0, - inputFormatter: [], - outputFormatter: function(obj) { return obj; } - }), new web3._extend.Method({ name: 'newAccount', call: 'personal_newAccount', @@ -29,6 +22,11 @@ web3._extend({ ], properties: [ + new web3._extend.Property({ + name: 'accounts', + getter: 'personal_listAccounts', + outputFormatter: function(obj) { return obj; } + }) ] }); ` -- cgit v1.2.3 From 7584e68c21cfd155a9e72b29422d8d458691d4ae Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Wed, 10 Jun 2015 09:42:14 +0200 Subject: upgrade web3.js with _extend support --- rpc/api/personal_js.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc/api/personal_js.go') diff --git a/rpc/api/personal_js.go b/rpc/api/personal_js.go index ddd47f6a4..463a2c7f5 100644 --- a/rpc/api/personal_js.go +++ b/rpc/api/personal_js.go @@ -23,7 +23,7 @@ web3._extend({ properties: [ new web3._extend.Property({ - name: 'accounts', + name: 'listAccounts', getter: 'personal_listAccounts', outputFormatter: function(obj) { return obj; } }) -- cgit v1.2.3