Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
fa33920
changes
sandip0721 Apr 18, 2022
6fd2e40
update version
khanaamir99 Apr 25, 2022
926768a
update version
khanaamir99 Apr 25, 2022
a685d84
UI bug fixes
lhtHimanshuKushwaha May 3, 2022
b1417bf
language dropdown
lhtHimanshuKushwaha May 4, 2022
bea83cb
intergrating inbound and some bug fixes
lhtYashMohan May 5, 2022
9e36686
Merge branch 'development' of https://bitbucket.org/leewayhertz/xinfi…
lhtYashMohan May 5, 2022
79f3f68
comment removed
lhtYashMohan May 5, 2022
a8309e4
bulk pvt key is in progress
lhtHimanshuKushwaha May 5, 2022
3dae503
export account initiating
lhtHimanshuKushwaha May 6, 2022
a5b65f9
tooltip
khanaamir99 May 6, 2022
344a3ae
inbound tnx fixing in progress
lhtYashMohan May 9, 2022
e48a5ad
testing
lhtHimanshuKushwaha May 9, 2022
0b0f0c3
Merge branch 'xx-1283' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtHimanshuKushwaha May 9, 2022
d04ce1a
UI bug fixes
lhtHimanshuKushwaha May 11, 2022
a61842c
bugs fixed
lhtHimanshuKushwaha May 12, 2022
b5f4b86
Transaction details bug fixed
lhtHimanshuKushwaha May 12, 2022
01fa92e
Inbound Transactions
lhtYashMohan May 16, 2022
58e7f41
Merge branch 'expandedView' of https://bitbucket.org/leewayhertz/xinf…
lhtYashMohan May 16, 2022
92bd23b
changes
khanaamir99 May 16, 2022
873e16f
reverting back scrolling
lhtYashMohan May 16, 2022
46dd673
comment removed
lhtYashMohan May 16, 2022
dab7712
changes in Tooltip
khanaamir99 May 16, 2022
bc5c204
version review
lhtHimanshuKushwaha May 18, 2022
ae81374
Update login screen
lhtHimanshuKushwaha May 18, 2022
34850dc
Merge branch 'expandedView' of https://bitbucket.org/leewayhertz/xinf…
lhtHimanshuKushwaha May 18, 2022
24f9c1c
merge changes
lhtHimanshuKushwaha May 18, 2022
4d07b0c
React upgrade with whole application tooltip
lhtYashMohan May 18, 2022
ad65eec
Merge branch 'xx-1283' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtYashMohan May 18, 2022
d43146d
bug fixing
lhtHimanshuKushwaha May 18, 2022
42e14f9
Merge branch 'xx-1283' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtHimanshuKushwaha May 18, 2022
7879925
bug fixes
lhtHimanshuKushwaha May 18, 2022
b362f40
fixes
lhtHimanshuKushwaha May 18, 2022
6f0e2d5
expandedUI removed from reducer
lhtHimanshuKushwaha May 18, 2022
9c36548
bug fixes
lhtHimanshuKushwaha May 20, 2022
b8d2d96
fix
lhtHimanshuKushwaha May 20, 2022
4d33be1
Tooltip implementation completed for all browser
lhtYashMohan May 20, 2022
d70d3f9
scroll fix
lhtYashMohan May 23, 2022
12dc476
Merge branch 'XX-1123' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtYashMohan May 23, 2022
c50cad4
Auto Lock timer
lhtHimanshuKushwaha May 23, 2022
6cf8bb8
Merge branch 'xx-1283' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtHimanshuKushwaha May 23, 2022
b4197f9
Merge branch 'xx-1358' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtYashMohan May 23, 2022
07c8708
( removed
lhtYashMohan May 23, 2022
016bb98
Release bug fixes
lhtHimanshuKushwaha May 23, 2022
3c80b7c
bugs fixes
lhtHimanshuKushwaha May 26, 2022
1ff78ce
bug fixes
lhtHimanshuKushwaha May 27, 2022
539995f
bugs resolved and inbound tx commented
lhtYashMohan May 30, 2022
06ad279
Date Format update
lhtHimanshuKushwaha May 30, 2022
29a38fd
Merge branch 'XX-1378' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtHimanshuKushwaha May 30, 2022
e62c202
Merge branch 'xx-1358' of https://bitbucket.org/leewayhertz/xinfin-xi…
lhtHimanshuKushwaha May 30, 2022
284c9be
minor changes
lhtHimanshuKushwaha May 31, 2022
97981c3
bug fixes
lhtHimanshuKushwaha Jun 1, 2022
f5a2df1
Merge branch 'console-warnings' of https://bitbucket.org/leewayhertz/…
lhtHimanshuKushwaha Jun 1, 2022
9d59180
Bug Fixes
lhtHimanshuKushwaha Jun 2, 2022
74d7017
font-brave fix
lhtHimanshuKushwaha Jun 2, 2022
673268e
Auto lock removed for release
lhtHimanshuKushwaha Jun 3, 2022
f554e96
Merged xx-1358 into development
lhtHimanshuKushwaha Jun 3, 2022
72d7eec
Bug Fixes
lhtHimanshuKushwaha Jun 6, 2022
060c82d
Create README.md
lhtkamleshkulkrni Jun 13, 2022
15e06ea
Merge remote-tracking branch 'origin/xx-1358' into XX-kajal
lhtkajalbobal Jun 14, 2022
fdd2e48
Merge remote-tracking branch 'origin/xx-1358' into XX-kajal
lhtkajalbobal Jun 16, 2022
120f3d5
bug fix
lhtkajalbobal Jun 16, 2022
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 .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"templateStrings": true,
"classes": true,
"jsx": true
},
}
},

"extends": ["plugin:react/recommended"],
Expand Down
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# XDCPay Browser Extension

## Introduction

[Internal documentation](./docs#documentation)

## Building locally

- Install [Node.js](https://nodejs.org/en/) version 14.17.3 and npm version 6.14.16
- If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you.
- Select npm 6.14.16: ```npm install -g npm@6.14.16```
- Install dependencies: ```npm install```
- Install gulp globally with `npm install -g gulp-cli`.
- Build the project to the `./dist/` folder with `gulp build`.
- Optionally, to rebuild on file changes, run `gulp dev`.
- To package .zip files for distribution, run `gulp zip`, or run the full build & zip with `gulp dist`.

Uncompressed builds can be found in `/dist`, compressed builds can be found in `/builds` once they're built.

## Contributing

You can re-generate the docs locally by running `npm run doc`, and contributors can update the hosted docs by running `npm run publish-docs`.

### Running Tests

Requires `mocha` installed. Run `npm install -g mocha`.

Then just run `npm test`.

You can also test with a continuously watching process, via `npm run watch`.

You can run the linter by itself with `gulp lint`.

## Architecture

[![Architecture Diagram](./docs/architecture.png)][1]

## Development

```bash
npm install
npm start
```

## Build for Publishing

```bash
npm run dist
```

#### Writing Browser Tests

To write tests that will be run in the browser using QUnit, add your test files to `test/integration/lib`.

## Other Docs

- [How to add custom build to Chrome](./docs/add-to-chrome.md)
- [How to add custom build to Firefox](./docs/add-to-firefox.md)
- [How to develop a live-reloading UI](./docs/ui-dev-mode.md)
- [How to develop an in-browser mocked UI](./docs/ui-mock-mode.md)
- [How to live reload on local dependency changes](./docs/developing-on-deps.md)
- [How to manage notices that appear when the app starts up](./docs/notices.md)
- [How to use the TREZOR emulator](./docs/trezor-emulator.md)
- [How to generate a visualization of this repository's development](./docs/development-visualization.md)

[1]: http://www.nomnoml.com/#view/%5B%3Cactor%3Euser%5D%0A%0A%5Bmetamask-ui%7C%0A%20%20%20%5Btools%7C%0A%20%20%20%20%20react%0A%20%20%20%20%20redux%0A%20%20%20%20%20thunk%0A%20%20%20%20%20ethUtils%0A%20%20%20%20%20jazzicon%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20account-detail%0A%20%20%20%20%20accounts%0A%20%20%20%20%20locked-screen%0A%20%20%20%20%20restore-vault%0A%20%20%20%20%20identicon%0A%20%20%20%20%20config%0A%20%20%20%20%20info%0A%20%20%20%5D%0A%20%20%20%5Breducers%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20metamask%0A%20%20%20%20%20identities%0A%20%20%20%5D%0A%20%20%20%5Bactions%7C%0A%20%20%20%20%20%5BaccountManager%5D%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%5D%3A-%3E%5Bactions%5D%0A%20%20%20%5Bactions%5D%3A-%3E%5Breducers%5D%0A%20%20%20%5Breducers%5D%3A-%3E%5Bcomponents%5D%0A%5D%0A%0A%5Bweb%20dapp%7C%0A%20%20%5Bui%20code%5D%0A%20%20%5Bweb3%5D%0A%20%20%5Bmetamask-inpage%5D%0A%20%20%0A%20%20%5B%3Cactor%3Eui%20developer%5D%0A%20%20%5Bui%20developer%5D-%3E%5Bui%20code%5D%0A%20%20%5Bui%20code%5D%3C-%3E%5Bweb3%5D%0A%20%20%5Bweb3%5D%3C-%3E%5Bmetamask-inpage%5D%0A%5D%0A%0A%5Bmetamask-background%7C%0A%20%20%5Bprovider-engine%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bid%20store%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%3E%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%3C-%3E%5Bid%20store%5D%0A%20%20%5Bconfig%20manager%7C%0A%20%20%20%20%5Brpc%20configuration%5D%0A%20%20%20%20%5Bencrypted%20keys%5D%0A%20%20%20%20%5Bwallet%20nicknames%5D%0A%20%20%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%5Bconfig%20manager%5D%0A%20%20%5Bid%20store%5D%3C-%3E%5Bconfig%20manager%5D%0A%5D%0A%0A%5Buser%5D%3C-%3E%5Bmetamask-ui%5D%0A%0A%5Buser%5D%3C%3A--%3A%3E%5Bweb%20dapp%5D%0A%0A%5Bmetamask-contentscript%7C%0A%20%20%5Bplugin%20restart%20detector%5D%0A%20%20%5Brpc%20passthrough%5D%0A%5D%0A%0A%5Brpc%20%7C%0A%20%20%5Bethereum%20blockchain%20%7C%0A%20%20%20%20%5Bcontracts%5D%0A%20%20%20%20%5Baccounts%5D%0A%20%20%5D%0A%5D%0A%0A%5Bweb%20dapp%5D%3C%3A--%3A%3E%5Bmetamask-contentscript%5D%0A%5Bmetamask-contentscript%5D%3C-%3E%5Bmetamask-background%5D%0A%5Bmetamask-background%5D%3C-%3E%5Bmetamask-ui%5D%0A%5Bmetamask-background%5D%3C-%3E%5Brpc%5D%0A



--------------------
18 changes: 9 additions & 9 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@
"message": "Copy"
},
"copyAddress": {
"message": "Copy Address to clipboard"
"message": "Copy Address to Clipboard"
},
"copyToClipboard": {
"message": "Copy to clipboard"
"message": "Copy to Clipboard"
},
"copyButton": {
"message": " Copy "
Expand Down Expand Up @@ -618,7 +618,7 @@
"message": "Loose"
},
"loweCaseWords": {
"message": "seed words only have lowercase characters"
"message": "seed phrase only have lowercase characters"
},
"mainnet": {
"message": "Main Ethereum Network"
Expand All @@ -633,7 +633,7 @@
"message": "XDCPay is a secure identity vault for Ethereum."
},
"metamaskSeedWords": {
"message": "XDCPay Seed Words"
"message": "XDCPay Seed Phrase"
},
"metamaskVersion": {
"message": "XDCPay Version"
Expand Down Expand Up @@ -882,7 +882,7 @@
"message": "Restore"
},
"revealSeedWords": {
"message": "Reveal Seed Words"
"message": "Reveal Seed Phrase"
},
"revealSeedWordsTitle": {
"message": "Seed Phrase"
Expand All @@ -891,7 +891,7 @@
"message": "If you ever change browsers or move computers, you will need this seed phrase to access your accounts. Save them somewhere safe and secret."
},
"getYourSeedWords": {
"message": "Get your secret seed words by entering your password."
"message": "Get your secret seed phrase by entering your password."
},
"revealSeedWordsWarningTitle": {
"message": "DO NOT share this phrase with anyone!"
Expand Down Expand Up @@ -947,7 +947,7 @@
"description": "Account export process"
},
"saveSeedAsFile": {
"message": "Save Seed Words As File"
"message": "Save Seed Phrase As File"
},
"scanInstructions": {
"message": "Place the QR code in front of your camera"
Expand Down Expand Up @@ -1424,10 +1424,10 @@
"message": "Connected Sites"
},
"advancedGasControls": {
"message": "Advanced gas controls"
"message": "Advanced Gas Controls"
},
"advancedGasControlsDesc": {
"message": "Select this to show gas price and limit controls directly on the send and confirm screens."
"message": "Select this to show gas price and limit controls directly on the confirm screen."
},
"infoDesc": {
"message": "The XDCPay is an extension for accessing XDC’s XDPoS enabled distributed applications or “Dapps” in your browser!"
Expand Down
2 changes: 1 addition & 1 deletion app/_locales/ht/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"message": "Kopye"
},
"copyAddress": {
"message": "Kopi adrès clipboard"
"message": "Kopi adrès Clipboard"
},
"copyToClipboard": {
"message": "Kopi clipboard"
Expand Down
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
"version": "6.2.10",
"version": "6.3.0",
"manifest_version": 2,
"author": "XinFin Network",
"description": "__MSG_appDescription__",
Expand Down
2 changes: 1 addition & 1 deletion app/notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
</style>
</head>
<body class="notification" style="height:600px;">
<body class="notification" style="height:1009px;">
<div id="app-content"></div>
<script src="./ui.js" type="text/javascript" charset="utf-8"></script>
</body>
Expand Down
23 changes: 13 additions & 10 deletions app/popup.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<!doctype html>
<html style="width:357px; height:600px;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<title>XDCPay</title>
</head>
<body class="ff-body-style">
<div id="app-content"></div>
<script src="./ui.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<title>XDCPay</title>
</head>

<body class="ff-body-style bodyStyle">
<div id="app-content"></div>
<script src="./ui.js" type="text/javascript" charset="utf-8"></script>
</body>

</html>
1 change: 1 addition & 0 deletions app/scripts/controllers/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class BalanceController {
})
}


/**
* Sets up listeners and subscriptions which should trigger an update of ethBalance. These updates include:
* - when a transaction changes state to 'submitted', 'confirmed' or 'failed'
Expand Down
53 changes: 53 additions & 0 deletions app/scripts/controllers/inboundtx.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const Web3 = require("web3");

class Inboundtransaction {

fetchInbound = async (myaccount) => {
try {
const response = await fetch(`https://xdc.blocksscan.io/api/txs/listByAccount/${myaccount}?page=1&limit=20&tx_type=in`)
const json = await response.json()
return json.items;
} catch (error) {
return "no result found"
}
}

// startListener = async (myaccount, rpcurl) => {
// var endBlockNumber, startBlockNumber, callback;

// const web3 = new Web3(new Web3.providers.HttpProvider(rpcurl))
// await this.inboundTransactions(web3).then(block => {
// endBlockNumber = block.number
// });
// startBlockNumber = endBlockNumber - 4;
// // console.log("Searching for transactions to/from account \"" + myaccount + "\" within blocks " + startBlockNumber + " and " + endBlockNumber);
// for (var i = startBlockNumber; i <= endBlockNumber; i++) {
// await this.blockResult(i, web3, myaccount).then(result => {
// if (typeof result != "undefined") {
// callback = result;
// }
// })
// }
// return callback;
// };

// async inboundTransactions(web3) {
// let block = await web3.eth.getBlock('latest')
// return block;
// }

// async blockResult(i, web3, myaccount) {
// var result;
// var block = await web3.eth.getBlock(i, true);
// if (block != null && block.transactions != null) {
// block.transactions.forEach((e) => {
// if (myaccount == e.to.toLowerCase()) {
// result = e;
// }
// })
// }
// return result;
// }
}

module.exports = Inboundtransaction
19 changes: 13 additions & 6 deletions app/scripts/controllers/network/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const testMode = (METAMASK_DEBUG || env === 'test')
const defaultProviderConfig = {
type: testMode ? XDC : XDC_TESTNET,
}
var url;

module.exports = class NetworkController extends EventEmitter {

Expand Down Expand Up @@ -110,15 +111,15 @@ module.exports = class NetworkController extends EventEmitter {
}
const ethQuery = new EthQuery(this._provider)
ethQuery.sendAsync({ method: 'net_version' }, (err, network) => {
if (err && type === XDC ) {
if (err && type === XDC) {
network = XDC_CODE.toString()
this._configureStandardProvider({rpcUrl : XDC_RPC_FALLBACK_ENDPOINT})
this._configureStandardProvider({ rpcUrl: XDC_RPC_FALLBACK_ENDPOINT })
}
else if (err && type === XDC_TESTNET) {
network = XDC_TESTNET_CODE.toString()
this._configureStandardProvider({rpcUrl : XDC_TESTNET_FALLBACK_ENDPOINT})
this._configureStandardProvider({ rpcUrl: XDC_TESTNET_FALLBACK_ENDPOINT })
}
else if(err) return this.setNetworkState('loading')
else if (err) return this.setNetworkState('loading')
const targetHost = parse(rpcTarget, true).host
const classicHost = parse(ethNetProps.RPCEndpoints(CLASSIC_CODE)[0], true).host
if (type === CLASSIC || targetHost === classicHost) {
Expand All @@ -129,7 +130,7 @@ module.exports = class NetworkController extends EventEmitter {
})
}

setRpcTarget (rpcTarget) {
setRpcTarget(rpcTarget) {
const providerConfig = {
type: 'rpc',
rpcTarget,
Expand Down Expand Up @@ -224,10 +225,16 @@ module.exports = class NetworkController extends EventEmitter {

_configureStandardProvider({ rpcUrl }) {
log.info('NetworkController - configureStandardProvider', rpcUrl)
this.rpcUrlCall(rpcUrl);
const networkClient = createJsonRpcClient({ rpcUrl })
this._setNetworkClient(networkClient)
}

rpcUrlCall(rpcUrl) {
if (rpcUrl != null) {
url = rpcUrl
}
return url;
}
_setNetworkClient({ networkMiddleware, blockTracker }) {
const metamaskMiddleware = createMetamaskMiddleware(this._baseProviderParams)
const engine = new JsonRpcEngine()
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class PreferencesController {
if (remove && index !== -1) {
rpcList.splice(index, 1)
}
if (index == -1 && !remove && customRPCObject.rpcURL !== 'http://localhost:8545') {
if (index == -1 && !remove && customRPCObject.rpcURL !== ('https://localhost:8545' || 'http://localhost:8545')) {
rpcList.push(customRPCObject)
}
return Promise.resolve(rpcList)
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/shapeshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ShapeshiftController {
const index = shapeShiftTxList.indexOf(tx)
if (index !== -1) {
shapeShiftTxList[index] = tx
this.store.updateState({ shapeShiftTxList })
this.store.update({ shapeShiftTxList })
}
}

Expand Down
Loading