Skip to content

Commit

Permalink
Merge pull request #261 from TokelPlatform/development
Browse files Browse the repository at this point in the history
Release v1.2.1: Bug fixes
  • Loading branch information
lenilsonjr authored Feb 3, 2022
2 parents e72357f + 803470d commit efb48c0
Show file tree
Hide file tree
Showing 20 changed files with 2,908 additions and 2,795 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 15
node-version: 16
cache: yarn

- name: Install packages with Yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 15
node-version: 16
cache: yarn

- name: Install packages with Yarn
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Make sure you are runing node 15.
yarn
```

The application is using [libnspv](https://github.com/KomodoPlatform/libnspv).
The application is using [nspv-js](https://github.com/tokelPlatform/nspv-js/).


## Starting Development
Expand Down Expand Up @@ -81,7 +81,7 @@ The `tokel_app` project has a Github Action which allows builds for Linux/Mac/Wi

## Docs

### Libnspv
### nSPV

[SPV technology](https://hackernoon.com/spv-proofs-explained-qd1p3r1q)
[Bitcoin Wiki - SPV](https://en.bitcoin.it/wiki/Scalability#Simplified_payment_verification)
Expand Down
77 changes: 17 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,12 @@
"package:all": "yarn build && concurrently \"yarn package:windows\" \"yarn package:mac\" \"yarn package:linux\""
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"cross-env NODE_ENV=development eslint --cache"
],
"*.{js,jsx,ts,tsx}": ["cross-env NODE_ENV=development eslint --cache"],
"{*.json,.{babelrc,eslintrc,prettierrc}}": [
"prettier --ignore-path .eslintignore --parser json --write"
],
"*.{css,scss}": [
"prettier --ignore-path .eslintignore --single-quote --write"
],
"*.{html,md,yml}": [
"prettier --ignore-path .eslintignore --single-quote --write"
]
"*.{css,scss}": ["prettier --ignore-path .eslintignore --single-quote --write"],
"*.{html,md,yml}": ["prettier --ignore-path .eslintignore --single-quote --write"]
},
"build": {
"asar": false,
Expand All @@ -65,9 +59,7 @@
"nspv-bitgo.js",
"node_modules"
],
"extraResources": [
"assets"
],
"extraResources": ["assets"],
"publish": {
"provider": "github",
"owner": "TokelPlatform",
Expand All @@ -77,9 +69,7 @@
},
"mac": {
"identity": null,
"target": [
"dmg"
],
"target": ["dmg"],
"type": "distribution",
"hardenedRuntime": true,
"entitlements": "assets/entitlements.mac.plist",
Expand All @@ -104,18 +94,14 @@
},
"win": {
"icon": "icon.ico",
"target": [
"nsis"
]
"target": ["nsis"]
},
"nsis": {
"differentialPackage": false
},
"linux": {
"icon": "icon.png",
"target": [
"AppImage"
],
"target": ["AppImage"],
"category": "Development"
}
},
Expand All @@ -133,15 +119,7 @@
"bugs": {
"url": "https://github.com/TokelPlatform/tokel_app/issues"
},
"keywords": [
"tokel",
"komodo",
"nftmarketplace",
"dex",
"token",
"wallet",
"crypto"
],
"keywords": ["tokel", "komodo", "nftmarketplace", "dex", "token", "wallet", "crypto"],
"homepage": "https://github.com/TokelPlatform/tokel_app#readme",
"jest": {
"testURL": "http://localhost/",
Expand All @@ -158,29 +136,12 @@
"^util/(.*)$": "<rootDir>/src/util/$1",
"^vars/(.*)$": "<rootDir>/src/vars/$1"
},
"testPathIgnorePatterns": [
"<rootDir>/release/"
],
"modulePathIgnorePatterns": [
"<rootDir>/release/"
],
"moduleFileExtensions": [
"js",
"jsx",
"ts",
"tsx",
"json"
],
"moduleDirectories": [
"node_modules",
"src/electron/node_modules"
],
"setupFiles": [
"./config/scripts/CheckBuildsExist.js"
],
"transformIgnorePatterns": [
"node_modules/?!(minidenticon)"
]
"testPathIgnorePatterns": ["<rootDir>/release/"],
"modulePathIgnorePatterns": ["<rootDir>/release/"],
"moduleFileExtensions": ["js", "jsx", "ts", "tsx", "json"],
"moduleDirectories": ["node_modules", "src/electron/node_modules"],
"setupFiles": ["./config/scripts/CheckBuildsExist.js"],
"transformIgnorePatterns": ["node_modules/?!(minidenticon)"]
},
"devDependencies": {
"@babel/core": "^7.12.9",
Expand Down Expand Up @@ -269,7 +230,7 @@
"jest": "^26.1.0",
"lint-staged": "^10.2.11",
"mini-css-extract-plugin": "^1.3.1",
"node-sass": "^5.0.0",
"node-sass": "^6.0.0",
"opencollective-postinstall": "^2.0.3",
"prettier": "^2.2.1",
"react-refresh": "^0.9.0",
Expand Down Expand Up @@ -333,12 +294,8 @@
},
"browserslist": [],
"renovate": {
"extends": [
"bliss"
],
"baseBranches": [
"next"
]
"extends": ["bliss"],
"baseBranches": ["next"]
},
"husky": {
"hooks": {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreateToken/ConfirmTokenCreationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Responsive } from 'util/helpers';
import formatTokenFormIntoStandard from 'util/formatTokenFormIntoStandard';
import { V } from 'util/theming';
import { BitgoAction, sendToBitgo } from 'util/bitgoHelper';
import { FEE, ModalName, TICKER } from 'vars/defines';
import { FEE, ModalName, TICKER, TOKEN_MARKER_FEE } from 'vars/defines';
import TokenType from 'util/types/TokenType';

const MediaPreviewContainer = styled.div`
Expand Down Expand Up @@ -80,7 +80,7 @@ const ConfirmTokenCreationModal: React.FC = () => {
const tokenTypeName = tokenType === TokenType.NFT ? 'NFT' : 'token';
const tokenTypeNameCapitalized = tokenType === TokenType.NFT ? 'NFT' : 'Token';

const cost = toBitcoin(String(toSatoshi(FEE) + Number(token.supply)));
const cost = toBitcoin(String(toSatoshi(FEE + TOKEN_MARKER_FEE) + Number(token.supply)));

const collectionAttributes =
tokenType === TokenType.NFT
Expand Down
6 changes: 3 additions & 3 deletions src/components/CreateToken/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const CreateTokenForm: React.FC<CreateTokenFormProps> = ({ tokenType }) => {
type="text"
label="Media URL (optional)"
placeholder={`Image, video, or audio URL representing your ${tokenTypeDisplay}`}
help={`An image, video or audio file representing this ${tokenTypeDisplay}. We recommend using IPFS or other permantent file storage solution so your ${tokenTypeDisplay} doesn't get lost in time!`}
help={`An image, video or audio file representing this ${tokenTypeDisplay}. We recommend using IPFS or other permanent file storage solution so your ${tokenTypeDisplay} doesn't get lost in time!`}
onFocus={handleMediaFieldFocus}
/>

Expand All @@ -212,7 +212,7 @@ const CreateTokenForm: React.FC<CreateTokenFormProps> = ({ tokenType }) => {
type="number"
label="Royalty (optional)"
placeholder="0"
help={`Anytime this ${tokenTypeDisplay} is sold through the Tokel DEX, you can make a comission, even if you're not participating in the sale. Can range from 1% to 99.9%`}
help={`Anytime this ${tokenTypeDisplay} is sold through the Tokel DEX, you can make a commission, even if you're not participating in the sale. Can range from 1% to 99.9%`}
append="%"
/>

Expand Down Expand Up @@ -256,7 +256,7 @@ const CreateTokenForm: React.FC<CreateTokenFormProps> = ({ tokenType }) => {
<MultiKeyValue
name="arbitraryAsJsonUnformatted"
label="Custom Attributes (optional)"
help={`You can use this field to add any property to your ${tokenTypeDisplay}, in a key-value fashion. Think of attributes like strenght, luck, color, etc.`}
help={`You can use this field to add any property to your ${tokenTypeDisplay}, in a key-value fashion. Think of attributes like strength, luck, color, etc.`}
/>
</Column>
</Columns>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Dashboard/widgets/Embeds/ActivityListEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import receiveIcon from 'assets/receiveIcon.svg';
import withdrawIcon from 'assets/withdrawIcon.svg';
import { dispatch } from 'store/rematch';
import { selectTokelPriceUSD } from 'store/selectors';
import { formatDate, getUsdValue, toBitcoinAmount } from 'util/helpers';
import { formatDate, getUsdValue, toBitcoinAmount, processPossibleBN } from 'util/helpers';
import { TxType } from 'util/nspvlib-mock';
import { V } from 'util/theming';
import { ModalName, ResourceType, TICKER } from 'vars/defines';
Expand Down Expand Up @@ -141,11 +141,11 @@ const ActivityList = ({ transactions = [], resourceType }: ActivityListProps): R
/>
<TriCell
primary={` ${tx.received ? '+' : '-'}${toBitcoinAmount(
tx.value.toString()
processPossibleBN(tx.value)
)} ${TICKER}`}
secondary={
resourceType === ResourceType.TOKEL
? `$${getUsdValue(tx.value.toString(), tokelPriceUSD)}`
? `$${getUsdValue(processPossibleBN(tx.value), tokelPriceUSD)}`
: ''
}
justify="flex-end"
Expand Down
3 changes: 2 additions & 1 deletion src/components/Modal/content/TxDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { useSelector } from 'react-redux';
import { selectChosenTransaction } from 'store/selectors';

import TxInformation from 'components/Dashboard/widgets/Wallet/TxInformation';
import { processPossibleBN } from 'util/helpers';

const TxDetail = () => {
const chosenTx = useSelector(selectChosenTransaction);
return (
<TxInformation
recipient={chosenTx.recipient}
amountInSatoshi={String(chosenTx.value)}
amountInSatoshi={processPossibleBN(chosenTx.value)}
txid={chosenTx.txid}
from={chosenTx.from}
timestamp={chosenTx.timestamp}
Expand Down
16 changes: 9 additions & 7 deletions src/components/_General/TokenMediaDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ipcRenderer } from 'electron';

import { Responsive, extractIPFSHash } from 'util/helpers';
import { V } from 'util/theming';
import { IPFS_IPC_ID, IpfsAction } from 'vars/defines';
import { IPFS_IPC_ID, IpfsAction, DEFAULT_IPFS_FALLBACK_GATEWAY } from 'vars/defines';

const MediaContent = styled.div`
overflow-y: auto;
Expand Down Expand Up @@ -41,11 +41,9 @@ const TokenMediaDisplay: React.FC<TokenMediaDisplayProps> = ({ url }) => {
const ipfsId = useMemo(() => extractIPFSHash(url), [url]);

useEffect(() => {
if (!url) {
setIframeLoaded(false);
setIframeHeight('unset');
setMediaUrl(null);
}
setIframeHeight('unset');
setMediaUrl(null);
iframeRef.current?.contentWindow.postMessage({ mediaUrl: '', width: 0 });
}, [url]);

// Request IPFS file if it's an IPFS link. Set link meanwhile anyway
Expand All @@ -57,8 +55,12 @@ const TokenMediaDisplay: React.FC<TokenMediaDisplayProps> = ({ url }) => {
ipfsId,
},
});

// Set fallback in case IPFS data never streams to our node
setMediaUrl(`${DEFAULT_IPFS_FALLBACK_GATEWAY}/${ipfsId}`);
} else {
setMediaUrl(url);
}
setMediaUrl(url);
}, [url, ipfsId]);

// Listen for IPFS files
Expand Down
Loading

0 comments on commit efb48c0

Please sign in to comment.