Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Remove amount param from coinbase widget #347

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/client/lib/thirdparty/coinbase-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CoinBaseWidget = function(buttonElem, params) {
};

self.generateParams = function() {
return "?address=" + encodeURIComponent(params.address) + ("&amount=" + encodeURIComponent(params.amount)) + ("&code=" + encodeURIComponent(params.code)) + ("&currency=" + encodeURIComponent(params.currency)) + ("&crypto_currency=" + encodeURIComponent(params.crypto_currency)) + ("&state=" + encodeURIComponent(params.state));
return "?address=" + encodeURIComponent(params.address) + ("&code=" + encodeURIComponent(params.code)) + ("&currency=" + encodeURIComponent(params.currency)) + ("&crypto_currency=" + encodeURIComponent(params.crypto_currency)) + ("&state=" + encodeURIComponent(params.state));
};

self.modalIframeStyle = function() {
Expand Down
6 changes: 6 additions & 0 deletions app/client/templates/elements/executeContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Template['elements_executeContract_constant'].onCreated(function(){
// get args for the constant function and add callback
var args = TemplateVar.get('inputs').concat(function(e, r) {
if(!e) {
console.log('r', r);
var outputs = [];
// single return value
if(template.data.outputs.length === 1) {
Expand All @@ -161,6 +162,7 @@ Template['elements_executeContract_constant'].onCreated(function(){
}
});

console.log('contractInstance[\''+template.data.name+'\'].apply(null, ' + JSON.stringify(args) + ')');
template.data.contractInstance[template.data.name].apply(null, args);

});
Expand Down Expand Up @@ -204,6 +206,10 @@ Template['elements_executeContract_constant'].events({
*/
'change .abi-input, input .abi-input': function(e, template) {
var inputs = Helpers.addInputValue(template.data.inputs, this, e.currentTarget);
_.each(inputs, function(e,i){
console.log('input:', e,i, typeof i);
})
console.log('inputs', inputs);
TemplateVar.set('inputs', inputs);
}
});
Expand Down
1 change: 0 additions & 1 deletion app/client/templates/views/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ Template['views_account'].events({

(new CoinBaseWidget(e.currentTarget, {
address: this.address,
amount: "5",
code: "eb44c52c-9c3f-5fb6-8b11-fc3ec3022519",
currency: "USD",
crypto_currency: "ETH",
Expand Down