Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian committed Aug 28, 2020
1 parent f1c6dd1 commit 64f0c94
Show file tree
Hide file tree
Showing 13 changed files with 260 additions and 231 deletions.
38 changes: 19 additions & 19 deletions package.json
Expand Up @@ -118,25 +118,25 @@
"testRunner": "jest-circus/runner"
},
"dependencies": {
"@arkecosystem/platform-sdk": "^0.9.308",
"@arkecosystem/platform-sdk-ada": "^0.9.308",
"@arkecosystem/platform-sdk-ark": "^0.9.308",
"@arkecosystem/platform-sdk-atom": "^0.9.308",
"@arkecosystem/platform-sdk-btc": "^0.9.308",
"@arkecosystem/platform-sdk-crypto": "^0.9.308",
"@arkecosystem/platform-sdk-eos": "^0.9.308",
"@arkecosystem/platform-sdk-eth": "^0.9.308",
"@arkecosystem/platform-sdk-intl": "^0.9.308",
"@arkecosystem/platform-sdk-lsk": "^0.9.308",
"@arkecosystem/platform-sdk-markets": "^0.9.308",
"@arkecosystem/platform-sdk-neo": "^0.9.308",
"@arkecosystem/platform-sdk-news": "^0.9.308",
"@arkecosystem/platform-sdk-profiles": "^0.9.308",
"@arkecosystem/platform-sdk-support": "^0.9.308",
"@arkecosystem/platform-sdk-trx": "^0.9.308",
"@arkecosystem/platform-sdk-xlm": "^0.9.308",
"@arkecosystem/platform-sdk-xmr": "^0.9.308",
"@arkecosystem/platform-sdk-xrp": "^0.9.308",
"@arkecosystem/platform-sdk": "^0.9.316",
"@arkecosystem/platform-sdk-ada": "^0.9.316",
"@arkecosystem/platform-sdk-ark": "^0.9.316",
"@arkecosystem/platform-sdk-atom": "^0.9.316",
"@arkecosystem/platform-sdk-btc": "^0.9.316",
"@arkecosystem/platform-sdk-crypto": "^0.9.316",
"@arkecosystem/platform-sdk-eos": "^0.9.316",
"@arkecosystem/platform-sdk-eth": "^0.9.316",
"@arkecosystem/platform-sdk-intl": "^0.9.316",
"@arkecosystem/platform-sdk-lsk": "^0.9.316",
"@arkecosystem/platform-sdk-markets": "^0.9.316",
"@arkecosystem/platform-sdk-neo": "^0.9.316",
"@arkecosystem/platform-sdk-news": "^0.9.316",
"@arkecosystem/platform-sdk-profiles": "^0.9.316",
"@arkecosystem/platform-sdk-support": "^0.9.316",
"@arkecosystem/platform-sdk-trx": "^0.9.316",
"@arkecosystem/platform-sdk-xlm": "^0.9.316",
"@arkecosystem/platform-sdk-xmr": "^0.9.316",
"@arkecosystem/platform-sdk-xrp": "^0.9.316",
"@arkecosystem/utils": "^1.2.0",
"@tippyjs/react": "^4.0.5",
"@types/react-linkify": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/WalletCard/WalletCard.tsx
Expand Up @@ -67,7 +67,7 @@ export const WalletCard = ({
}

const coinName = wallet?.manifest().get<string>("name");
const ticker = wallet!.network().currency.ticker;
const ticker = wallet!.network().ticker();

const walletTypes = ["Ledger", "MultiSignature", "Starred"];

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/WalletListItem/WalletListItem.tsx
Expand Up @@ -89,7 +89,7 @@ export const WalletListItem = ({
</div>
</td>
<td className="font-semibold text-right">
<Amount value={wallet.balance()} ticker={wallet.network().currency.ticker} />
<Amount value={wallet.balance()} ticker={wallet.network().ticker()} />
</td>
<td className="text-right text-theme-neutral-light">
<Amount value={wallet.convertedBalance()} ticker={exchangeCurrency!} />
Expand Down
Expand Up @@ -231,7 +231,7 @@ export const DelegateRegistrationForm: RegistrationForm = {
},
});

await senderWallet.transaction().broadcast([transactionId]);
await senderWallet.transaction().broadcast(transactionId);

await env.persist();

Expand Down
Expand Up @@ -94,7 +94,7 @@ describe("SendTransactionForm", () => {
form.current.setValue("senderAddress", wallet.address());

for (const network of env.availableNetworks()) {
if (network.id() === wallet.network().id && network.coin() === wallet.manifest().get<string>("name")) {
if (network.id() === wallet.network().id() && network.coin() === wallet.coinId()) {
form.current.setValue("network", network, true);

break;
Expand Down
5 changes: 1 addition & 4 deletions src/domains/transaction/pages/Registration/Registration.tsx
Expand Up @@ -226,10 +226,7 @@ export const Registration = () => {
setValue("senderAddress", activeWallet.address(), true);

for (const network of networks) {
if (
network.id() === activeWallet.network().id &&
network.coin() === activeWallet.manifest().get<string>("name")
) {
if (network.coin() === activeWallet.coinId() && network.id() === activeWallet.networkId()) {
setValue("network", network, true);

break;
Expand Down
Expand Up @@ -77,7 +77,7 @@ export const SecondStep = ({ wallet }: { wallet: ReadWriteWallet }) => {
<h1 className="mb-0">{t("TRANSACTION.PAGE_IPFS.SECOND_STEP.TITLE")}</h1>
<div className="text-theme-neutral-dark">{t("TRANSACTION.PAGE_IPFS.SECOND_STEP.DESCRIPTION")}</div>

<div className="mt-4 grid grid-flow-row gap-2">
<div className="grid grid-flow-row gap-2 mt-4">
<TransactionDetail
border={false}
label={t("TRANSACTION.NETWORK")}
Expand Down Expand Up @@ -182,10 +182,7 @@ export const SendIPFSTransaction = () => {
setValue("senderAddress", activeWallet.address(), true);

for (const network of networks) {
if (
network.id() === activeWallet.network().id &&
network.coin() === activeWallet.manifest().get<string>("name")
) {
if (network.coin() === activeWallet.coinId() && network.id() === activeWallet.networkId()) {
setValue("network", network, true);

break;
Expand All @@ -210,7 +207,7 @@ export const SendIPFSTransaction = () => {
},
});

await senderWallet!.transaction().broadcast([transactionId]);
await senderWallet!.transaction().broadcast(transactionId);

await env.persist();

Expand Down
Expand Up @@ -77,7 +77,7 @@ export const FirstStep = ({
<h1 className="mb-0">{t("TRANSACTION.PAGE_VOTE.FIRST_STEP.TITLE")}</h1>
<div className="text-theme-neutral-dark">{t("TRANSACTION.PAGE_VOTE.FIRST_STEP.DESCRIPTION")}</div>

<div className="mt-4 grid grid-flow-row gap-2">
<div className="grid grid-flow-row gap-2 mt-4">
<TransactionDetail
border={false}
label={t("TRANSACTION.NETWORK")}
Expand Down Expand Up @@ -156,7 +156,7 @@ export const SecondStep = ({
<p className="text-theme-neutral-dark">{t("TRANSACTION.PAGE_VOTE.SECOND_STEP.DESCRIPTION")}</p>
</div>

<div className="mt-4 grid grid-flow-row gap-2">
<div className="grid grid-flow-row gap-2 mt-4">
<TransactionDetail
border={false}
label={t("TRANSACTION.NETWORK")}
Expand Down Expand Up @@ -282,10 +282,7 @@ export const SendVoteTransaction = () => {
setValue("vote", voteId, true);

for (const network of networks) {
if (
network.id() === activeWallet.network().id &&
network.coin() === activeWallet.manifest().get<string>("name")
) {
if (network.coin() === activeWallet.coinId() && network.id() === activeWallet.networkId()) {
setValue("network", network, true);

break;
Expand Down Expand Up @@ -333,7 +330,7 @@ export const SendVoteTransaction = () => {
},
});

await senderWallet!.transaction().broadcast([transactionId]);
await senderWallet!.transaction().broadcast(transactionId);

await env.persist();

Expand Down
Expand Up @@ -106,7 +106,7 @@ export const SecondStep = ({ wallet }: { wallet: ReadWriteWallet }) => {
</div>
</div>

<div className="mt-4 grid grid-flow-row gap-2">
<div className="grid grid-flow-row gap-2 mt-4">
<TransactionDetail
border={false}
label={t("TRANSACTION.NETWORK")}
Expand Down Expand Up @@ -242,10 +242,7 @@ export const TransactionSend = () => {
setValue("senderAddress", activeWallet.address(), true);

for (const network of networks) {
if (
network.id() === activeWallet.network().id &&
network.coin() === activeWallet.manifest().get<string>("name")
) {
if (network.coin() === activeWallet.coinId() && network.id() === activeWallet.networkId()) {
setValue("network", network, true);

break;
Expand Down Expand Up @@ -292,7 +289,7 @@ export const TransactionSend = () => {
});
}

await senderWallet!.transaction().broadcast([transactionId]);
await senderWallet!.transaction().broadcast(transactionId);

await env.persist();

Expand Down
Expand Up @@ -96,7 +96,7 @@ export const AddressRow = ({ index, wallet, isLoading, onSelect }: AddressRowPro
</td>

<td className="py-5 font-bold text-theme-neutral-dark">
<Amount value={wallet.balance()} ticker={wallet.network().currency.ticker} />
<Amount value={wallet.balance()} ticker={wallet.network().ticker()} />
</td>

<td className="py-5">
Expand Down
7 changes: 2 additions & 5 deletions src/domains/vote/pages/Votes/Votes.tsx
Expand Up @@ -78,10 +78,7 @@ export const Votes = () => {
useEffect(() => {
if (hasWalletId) {
for (const network of networks) {
if (
network.id() === activeWallet.network().id &&
network.coin() === activeWallet.manifest().get<string>("name")
) {
if (network.coin() === activeWallet.coinId() && network.id() === activeWallet.networkId()) {
setNetwork(network);

break;
Expand Down Expand Up @@ -139,7 +136,7 @@ export const Votes = () => {
</Section>

<div className="container mx-auto px-14">
<div className="-my-5 grid grid-flow-col grid-cols-2 gap-6">
<div className="grid grid-flow-col grid-cols-2 gap-6 -my-5">
<TransactionDetail border={false} label={t("COMMON.NETWORK")}>
<SelectNetwork
id="Votes__network"
Expand Down
62 changes: 49 additions & 13 deletions src/tests/fixtures/env/storage.json
Expand Up @@ -12,17 +12,29 @@
"type": "test",
"name": "Devnet",
"explorer": "https://dexplorer.ark.io/",
"currency": { "ticker": "DARK", "symbol": "" },
"crypto": { "slip44": 111 },
"currency": {
"ticker": "DARK",
"symbol": ""
},
"crypto": {
"slip44": 111
},
"hosts": ["https://dwallets.ark.io"],
"hostsMultiSignature": [],
"voting": { "enabled": true, "singular": true }
"voting": {
"enabled": true,
"maximum": 1,
"maximumPerTransaction": 1
}
}
},
"network": "devnet",
"address": "D8rr7B1d6TL6pf14LgMz4sKp1VBMs6YUYD",
"publicKey": "03df6cd794a7d404db4f1b25816d8976d0e72c5177d17ac9b19a92703b62cdbbbc",
"data": { "BALANCE": "3375089801", "SEQUENCE": "245" },
"data": {
"BALANCE": "3375089801",
"SEQUENCE": "245"
},
"settings": {
"AVATAR": "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\" viewBox=\"0 0 100 100\"><style>circle{mix-blend-mode:soft-light;}</style><rect fill=\"rgb(0, 150, 136)\" width=\"100\" height=\"100\"/><circle r=\"50\" cx=\"80\" cy=\"50\" fill=\"rgb(76, 175, 80)\"/><circle r=\"35\" cx=\"100\" cy=\"40\" fill=\"rgb(156, 39, 176)\"/><circle r=\"40\" cx=\"90\" cy=\"70\" fill=\"rgb(3, 169, 244)\"/></svg>",
"ALIAS": "ARK Wallet 1"
Expand All @@ -37,17 +49,29 @@
"type": "test",
"name": "Devnet",
"explorer": "https://dexplorer.ark.io/",
"currency": { "ticker": "DARK", "symbol": "" },
"crypto": { "slip44": 111 },
"currency": {
"ticker": "DARK",
"symbol": ""
},
"crypto": {
"slip44": 111
},
"hosts": ["https://dwallets.ark.io"],
"hostsMultiSignature": [],
"voting": { "enabled": true, "singular": true }
"voting": {
"enabled": true,
"maximum": 1,
"maximumPerTransaction": 1
}
}
},
"network": "devnet",
"address": "D5sRKWckH4rE1hQ9eeMeHAepgyC3cvJtwb",
"publicKey": "03af2feb4fc97301e16d6a877d5b135417e8f284d40fac0f84c09ca37f82886c51",
"data": { "BALANCE": "5768000000", "SEQUENCE": "12" },
"data": {
"BALANCE": "5768000000",
"SEQUENCE": "12"
},
"settings": {
"AVATAR": "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\" viewBox=\"0 0 100 100\"><style>circle{mix-blend-mode:soft-light;}</style><rect fill=\"rgb(244, 67, 54)\" width=\"100\" height=\"100\"/><circle r=\"50\" cx=\"20\" cy=\"50\" fill=\"rgb(205, 220, 57)\"/><circle r=\"60\" cx=\"0\" cy=\"70\" fill=\"rgb(0, 188, 212)\"/><circle r=\"55\" cx=\"80\" cy=\"30\" fill=\"rgb(76, 175, 80)\"/></svg>",
"ALIAS": "ARK Wallet 2"
Expand Down Expand Up @@ -79,8 +103,13 @@
"action": "Read Changelog"
}
},
"plugins": { "data": {}, "blacklist": [] },
"data": { "key": "value" },
"plugins": {
"data": {},
"blacklist": []
},
"data": {
"key": "value"
},
"settings": {
"ADVANCED_MODE": false,
"AUTOMATIC_SIGN_OUT_PERIOD": 1,
Expand All @@ -100,8 +129,13 @@
"wallets": {},
"contacts": {},
"notifications": {},
"plugins": { "data": {}, "blacklist": [] },
"data": { "key": "value" },
"plugins": {
"data": {},
"blacklist": []
},
"data": {
"key": "value"
},
"settings": {
"ADVANCED_MODE": false,
"AUTOMATIC_SIGN_OUT_PERIOD": 1,
Expand All @@ -118,5 +152,7 @@
}
}
},
"data": { "key": "value" }
"data": {
"key": "value"
}
}

0 comments on commit 64f0c94

Please sign in to comment.