Skip to content

Commit

Permalink
0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fabcotech committed Feb 16, 2022
1 parent 92ffcbf commit 8e95491
Show file tree
Hide file tree
Showing 34 changed files with 1,278 additions and 1,037 deletions.
1 change: 0 additions & 1 deletion build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ directories:
output: ./output
files:
# TODO exclude not needed stuff in 'files:' section to reduce app packages size, can save megabytes, so a significant improvement
- "dapps/**/*"
- "dist/**/*"
- "icons/**/*"
- "main.js"
Expand Down
15 changes: 15 additions & 0 deletions dapp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>

<head>
<script type="text/javascript">
window.write = (html) => {
document.open();
document.write(decodeURIComponent(html));
document.close();
}
</script>
</head>

<body></body>

</html>
Binary file added dist/arbitrum120x120.541afdd9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/avalanche120x120.2fdfbe7f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/binance120x120.068872ac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions dist/dapp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>

<head>
<script type="text/javascript">
window.write = (html) => {
document.open();
document.write(decodeURIComponent(html));
document.close();
}
</script>
</head>

<body></body>

</html>
Binary file added dist/ethereum120x120.b28ba887.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/evmos120x120.16eb0009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/fantom120x120.cc3141c7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="initial-scale=1"><meta name="theme-color" content="#036873"><link rel="icon" type="image/png" sizes="512x512" href="icon-512.2f97593a.png"><link rel="stylesheet" href="all.min.a2971c96.css"><title>dappy</title><script src="src.106d7f24.js"></script><link rel="stylesheet" href="src.e84b4155.css"></head><body> <div id="root"></div> </body></html>
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="initial-scale=1"><meta name="theme-color" content="#036873"><link rel="icon" type="image/png" sizes="512x512" href="icon-512.2f97593a.png"><link rel="stylesheet" href="all.min.a2971c96.css"><title>dappy</title><script src="src.efa4b2d6.js"></script><link rel="stylesheet" href="src.d4d5564e.css"></head><body> <div id="root"></div> </body></html>
180 changes: 180 additions & 0 deletions dist/js/dappy-ethereum@0.1.0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
var DappyEthereum = (function () {
'use strict';

var IDENTIFY_FROM_SANDBOX = '[Common] Identify from sandbox';
var SIGN_ETHEREUM_TRANSACTION_FROM_SANDBOX = '[Common] Sign Ethereum transaction from sandbox';
var SEND_ETHEREUM_PAYMENT_REQUEST_FROM_SANDBOX = '[Common] Send Ethereum payment request from sandbox';
var signEthereumTransactionFromSandboxAction = function (values) {
return {
type: SIGN_ETHEREUM_TRANSACTION_FROM_SANDBOX,
payload: values,
};
};
var sendEthereumPaymentRequestFromSandboxAction = function (values) {
return {
type: SEND_ETHEREUM_PAYMENT_REQUEST_FROM_SANDBOX,
payload: values,
};
};
var identifyFromSandboxAction = function (values) {
return {
type: IDENTIFY_FROM_SANDBOX,
payload: values,
};
};

var default_1 = /** @class */ (function () {
function default_1() {
var _this = this;
this.identifications = {};
this.transactions = {};
this.sendMessageToHost = function (m) {
return new Promise(function (resolve, reject) {
var interProcess2 = new XMLHttpRequest();
interProcess2.open('POST', 'interprocessdapp://message-from-dapp-sandboxed');
interProcess2.setRequestHeader('Data', JSON.stringify({
action: m,
}));
interProcess2.send();
interProcess2.onloadend = function () {
if (interProcess2.responseText && interProcess2.responseText.length) {
reject(interProcess2.responseText);
}
else {
resolve(undefined);
}
};
});
};
this.requestTransactions = function () {
var interProcess = new XMLHttpRequest();
interProcess.open('POST', 'interprocessdapp://get-transactions');
interProcess.send();
interProcess.onload = function (a) {
try {
var r = JSON.parse(a.target.responseText);
var payload = r;
if (payload.transactions) {
_this.updateTransactions(payload.transactions);
}
}
catch (e) {
console.log(e);
}
};
};
this.requestIdentifications = function () {
var interProcess = new XMLHttpRequest();
interProcess.open('POST', 'interprocessdapp://get-identifications');
interProcess.send();
interProcess.onload = function (a) {
try {
var r = JSON.parse(a.target.responseText);
var payload = r;
if (payload.identifications) {
_this.updateIdentifications(payload.identifications);
}
}
catch (e) {
console.log(e);
}
};
};
}
default_1.prototype.identify = function (parameters) {
var _this = this;
var promise = new Promise(function (resolve, reject) {
var params = parameters;
if (!params || !params.publicKey) {
params = {
publicKey: '',
};
}
var callId = new Date().valueOf().toString() + Math.round(Math.random() * 1000000).toString();
_this.sendMessageToHost(identifyFromSandboxAction({
parameters: params,
callId: callId,
resourceId: '',
})).then(function () {
_this.identifications[callId] = {
resolve: resolve,
reject: reject,
};
})
.catch(function (err) {
reject(err);
});
});
return promise;
};
default_1.prototype.signTransaction = function (txData) {
var _this = this;
var promise = new Promise(function (resolve, reject) {
var callId = new Date().valueOf().toString() + Math.round(Math.random() * 1000000).toString();
_this.sendMessageToHost(signEthereumTransactionFromSandboxAction({
parameters: txData,
callId: callId,
})).then(function () {
_this.transactions[callId] = {
resolve: resolve,
reject: reject,
};
})
.catch(function (err) {
reject(err);
});
});
return promise;
};
default_1.prototype.requestPayment = function (parameters) {
var _this = this;
var promise = new Promise(function (resolve, reject) {
var callId = new Date().valueOf().toString() + Math.round(Math.random() * 1000000).toString();
_this.sendMessageToHost(sendEthereumPaymentRequestFromSandboxAction({
parameters: parameters,
callId: callId,
}));
_this.transactions[callId] = {
resolve: resolve,
reject: reject,
};
});
return promise;
};
default_1.prototype.updateTransactions = function (transactions) {
var _this = this;
Object.keys(this.transactions).forEach(function (key) {
var callTransaction = Object.values(transactions).find(function (t) { return t.origin.origin === 'dapp' && t.origin.callId === key; });
if (callTransaction) {
if (callTransaction.status === 'abandonned' || callTransaction.status === 'failed') {
_this.transactions[key].reject({
error: "transaction ".concat(callTransaction.status),
transaction: callTransaction,
});
}
else {
_this.transactions[key].resolve(callTransaction);
}
}
});
};
default_1.prototype.updateIdentifications = function (identifications) {
var _this = this;
Object.keys(this.identifications).forEach(function (key) {
var callIdentification = identifications[key];
if (callIdentification) {
if (callIdentification.identified) {
_this.identifications[key].resolve(callIdentification);
}
else {
_this.identifications[key].reject(callIdentification);
}
}
});
};
return default_1;
}());

return default_1;

}());
52 changes: 35 additions & 17 deletions dist/js/dappy-rchain@0.1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,22 @@ var DappyRChain = (function () {
this.identifications = {};
this.transactions = {};
this.sendMessageToHost = function (m) {
var interProcess2 = new XMLHttpRequest();
interProcess2.open('POST', 'interprocessdapp://message-from-dapp-sandboxed');
interProcess2.setRequestHeader('Data', JSON.stringify({
action: m,
}));
interProcess2.send();
return new Promise(function (resolve, reject) {
var interProcess2 = new XMLHttpRequest();
interProcess2.open('POST', 'interprocessdapp://message-from-dapp-sandboxed');
interProcess2.setRequestHeader('Data', JSON.stringify({
action: m,
}));
interProcess2.send();
interProcess2.onloadend = function () {
if (interProcess2.responseText && interProcess2.responseText.length) {
reject(interProcess2.responseText);
}
else {
resolve(undefined);
}
};
});
};
this.initialState = {
transactions: [],
Expand Down Expand Up @@ -486,11 +496,15 @@ var DappyRChain = (function () {
parameters: params,
callId: callId,
resourceId: '',
}));
_this.identifications[callId] = {
resolve: resolve,
reject: reject,
};
})).then(function () {
_this.identifications[callId] = {
resolve: resolve,
reject: reject,
};
})
.catch(function (err) {
reject(err);
});
});
return promise;
};
Expand All @@ -501,11 +515,15 @@ var DappyRChain = (function () {
_this.sendMessageToHost(sendRChainTransactionFromSandboxAction({
parameters: parameters,
callId: callId,
}));
_this.transactions[callId] = {
resolve: resolve,
reject: reject,
};
})).then(function () {
_this.transactions[callId] = {
resolve: resolve,
reject: reject,
};
})
.catch(function (err) {
reject(err);
});
});
return promise;
};
Expand Down Expand Up @@ -534,7 +552,7 @@ var DappyRChain = (function () {
}
else if (callTransaction.status === 'abandonned' || callTransaction.status === 'failed') {
_this.transactions[key].reject({
error: "transaction " + callTransaction.status,
error: "transaction ".concat(callTransaction.status),
transaction: callTransaction,
});
}
Expand Down
57 changes: 57 additions & 0 deletions dist/js/web3@1.6.1.js

Large diffs are not rendered by default.

Binary file added dist/moonbeam120x120.9b620c26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/moonriver120x120.14fe7b44.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/polygon120x120.0b89104e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion dist/src.106d7f24.js.map

This file was deleted.

6 changes: 3 additions & 3 deletions dist/src.e84b4155.css → dist/src.d4d5564e.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/src.d4d5564e.css.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/src.e84b4155.css.map

This file was deleted.

Loading

0 comments on commit 8e95491

Please sign in to comment.