diff --git a/package-lock.json b/package-lock.json index 4de1eb4ee..b6b3d00ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,9 +70,9 @@ } }, "@types/eventsource": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.2.tgz", - "integrity": "sha512-4AKWJ6tvEU4fk0770oAK4Z0lQUuSnc5ljHTcYZhQtdP7XMDKKvegGUC6xGD8+4+F+svZKAzlxbKnuGWfgMtgVA==" + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.5.tgz", + "integrity": "sha512-BA9q9uC2PAMkUS7DunHTxWZZaVpeNzDG8lkBxcKwzKJClfDQ4Z59/Csx7HSH/SIqFN2JWh0tAKAM6k/wRR0OZg==" }, "@types/node": { "version": "10.5.2", @@ -88,9 +88,9 @@ } }, "@types/urijs": { - "version": "1.19.8", - "resolved": "https://registry.npmjs.org/@types/urijs/-/urijs-1.19.8.tgz", - "integrity": "sha512-SVQd2Qq0oL+b8VtJbQyv0cMIdU7fbRDcg2JIpcBvv+GUayJ3c5Ll1K+iivZl6ifcI6NbYcwjqDjljDFSiSGOeA==" + "version": "1.19.15", + "resolved": "https://registry.npmjs.org/@types/urijs/-/urijs-1.19.15.tgz", + "integrity": "sha512-pEDVREIvkyRtzpWlO5nqsUgR/JpLv9+lAzvkERCwoH2jXxl+TmaTNshhL7gjQLhfqgFUzCM6ovmoB1JssTop1A==" }, "accepts": { "version": "1.3.5", @@ -575,11 +575,18 @@ "dev": true }, "axios": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", - "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { - "follow-redirects": "1.5.10" + "follow-redirects": "^1.10.0" + }, + "dependencies": { + "follow-redirects": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", + "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==" + } } }, "axobject-query": { @@ -3411,11 +3418,6 @@ "array-find-index": "^1.0.1" } }, - "cursor": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/cursor/-/cursor-0.1.5.tgz", - "integrity": "sha1-6neMKwnTPC5WT9khRwdnUEg+uyw=" - }, "d": { "version": "1.0.0", "resolved": "http://registry.npmjs.org/d/-/d-1.0.0.tgz", @@ -5139,6 +5141,7 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "dev": true, "requires": { "debug": "=3.1.0" }, @@ -5147,6 +5150,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "dev": true, "requires": { "ms": "2.0.0" } @@ -9125,11 +9129,10 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, "js-xdr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/js-xdr/-/js-xdr-1.1.4.tgz", - "integrity": "sha512-Xhwys9hyDZQDisxCKZi2nDhvGg6fKhsEgAUaJlzjwo32mZ2gZVIQl3+w4Le5SX5dsKDsboFdM2gnu5JALWetTg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/js-xdr/-/js-xdr-1.3.0.tgz", + "integrity": "sha512-fjLTm2uBtFvWsE3l2J14VjTuuB8vJfeTtYuNS7LiLHDWIX2kt0l1pqq9334F8kODUkKPMuULjEcbGbkFFwhx5g==", "requires": { - "cursor": "^0.1.5", "lodash": "^4.17.5", "long": "^2.2.3" } @@ -9827,7 +9830,8 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true }, "multicast-dns": { "version": "6.2.3", @@ -9964,9 +9968,9 @@ "dev": true }, "node-gyp-build": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.2.tgz", - "integrity": "sha512-Lqh7mrByWCM8Cf9UPqpeoVBBo5Ugx+RKu885GAzmLBVYjeywScxHXPGLa4JfYNZmcNGwzR0Glu5/9GaQZMFqyA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", "optional": true }, "node-int64": { @@ -14244,9 +14248,9 @@ "dev": true }, "stellar-base": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/stellar-base/-/stellar-base-3.0.2.tgz", - "integrity": "sha512-ZZji4go8gRT932OTuUSggohWWuRIs11C99ShokoIurmWPwh0NsvkxN2cBxfEfQi/TdiO1/DiteCzz7w233AfXA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/stellar-base/-/stellar-base-5.1.0.tgz", + "integrity": "sha512-J0hdF2UGKlRmwaQCpL5IedetJMDBvxTmoFEnvwHMxZBeSNfGt3+pjLi+dghURiWyuBOF9ZeyS8lUBeOhy/tOpA==", "requires": { "base32.js": "^0.1.0", "bignumber.js": "^4.0.0", @@ -14266,22 +14270,22 @@ } }, "stellar-sdk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/stellar-sdk/-/stellar-sdk-5.0.1.tgz", - "integrity": "sha512-O+ZZubTgIApvdJpXoLfiokvhRDhlMPFwd68UmCup+qTLouJSvV0Nmv8bg9tXxc7YtSJy3NECd/ShGDTPf98KeA==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/stellar-sdk/-/stellar-sdk-8.1.1.tgz", + "integrity": "sha512-crZSONO1lDEg2TP2wsslB7kcBopP6r2jzA5fC7JNvFZMMf0yq14fGDOwQerWI9XaxzpXOJxuQ1ZP3yB93Ds0+Q==", "requires": { "@types/eventsource": "^1.1.2", "@types/node": ">= 8", "@types/randombytes": "^2.0.0", "@types/urijs": "^1.19.6", - "axios": "^0.19.0", + "axios": "0.21.1", "bignumber.js": "^4.0.0", "detect-node": "^2.0.4", "es6-promise": "^4.2.4", "eventsource": "^1.0.7", "lodash": "^4.17.11", "randombytes": "^2.1.0", - "stellar-base": "^3.0.0", + "stellar-base": "^5.1.0", "toml": "^2.3.0", "tslib": "^1.10.0", "urijs": "^1.19.1", @@ -14289,9 +14293,9 @@ }, "dependencies": { "eventsource": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", - "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", + "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", "requires": { "original": "^1.0.0" } @@ -14790,9 +14794,9 @@ "dev": true }, "tslib": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.2.tgz", - "integrity": "sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==" + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "tty-browserify": { "version": "0.0.0", diff --git a/package.json b/package.json index addcf7d15..ca82d9bf8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "stellarexplorer", "description": "Ledger explorer for the Stellar network", - "version": "1.3.0", + "version": "1.4.0", "license": "Apache-2.0", "author": "Chris Hatch ", "homepage": "https://steexp.com", @@ -36,7 +36,7 @@ "react-router-bootstrap": "^0.24.4", "react-router-dom": "^4.2.2", "recompose": "^0.26.0", - "stellar-sdk": "^5.0.1", + "stellar-sdk": "^8.1.1", "whatwg-fetch": "2.0.3" }, "devDependencies": { diff --git a/src/components/Effect.js b/src/components/Effect.js index 816fc1b15..683ada90e 100644 --- a/src/components/Effect.js +++ b/src/components/Effect.js @@ -186,6 +186,9 @@ const Thresholds = ({lowThreshold, medThreshold, highThreshold}) => ( ) const effectTypeComponentMap = { + sequence_bumped: SequenceBumped, + + // Account Effects account_created: AccountCreated, account_removed: AccountRemoved, account_credited: Amount, @@ -193,27 +196,56 @@ const effectTypeComponentMap = { account_thresholds_updated: Thresholds, account_home_domain_updated: AccountHomeDomainUpdated, account_flags_updated: AccountFlagsUpdated, - sequence_bumped: SequenceBumped, + + // Signer Effects signer_created: Signer, signer_removed: Signer, signer_updated: Signer, + + // Trustline Effects trustline_created: Trustline, trustline_removed: AssetWrap, trustline_updated: Trustline, trustline_authorized: Trustline, trustline_deauthorized: Trustline, + + // Trading Effects offer_created: Offer, offer_removed: Offer, offer_updated: Offer, trade: Trade, + + // Data Effects data_created: Data, data_removed: Data, data_updated: Data, + + // // Claimable Balance Effects + // claimable_balance_created: CreateMe, + // claimable_balance_claimed: CreateMe, + // claimable_balance_claimant_created: CreateMe, + + // // Sponsorship Effects + // account_sponsorship_created: CreateMe, + // account_sponsorship_updated: CreateMe, + // account_sponsorship_removed: CreateMe, + // trustline_sponsorship_created: CreateMe, + // trustline_sponsorship_updated: CreateMe, + // trustline_sponsorship_removed: CreateMe, + // data_sponsorship_created: CreateMe, + // data_sponsorship_updated: CreateMe, + // data_sponsorship_removed: CreateMe, + // claimable_balance_sponsorship_created: CreateMe, + // claimable_balance_sponsorship_updated: CreateMe, + // claimable_balance_sponsorship_removed: CreateMe, + // signer_sponsorship_created: CreateMe, + // signer_sponsorship_updated: CreateMe, + // signer_sponsorship_removed: CreateMe, } const EffectDetails = ({effect, op}) => { const SubEffectComponent = effectTypeComponentMap[effect.type] - if (!SubEffectComponent) return {effect.type} + if (!SubEffectComponent) return {effect.type} ALL: {JSON.stringify(effect)} return } diff --git a/src/components/operations/ClaimClaimableBalance.js b/src/components/operations/ClaimClaimableBalance.js new file mode 100644 index 000000000..46d0916cf --- /dev/null +++ b/src/components/operations/ClaimClaimableBalance.js @@ -0,0 +1,20 @@ +import React from 'react' +import {FormattedMessage} from 'react-intl' + +import AccountLink from '../shared/AccountLink' + +const FormattedBalanceId = ({balanceId}) => balanceId.replace(/^0*/, '') + +const ClaimClaimableBalance = ({balanceId, claimant}) => { + return ( + , + balanceId: , + }} + /> + ) +} + +export default ClaimClaimableBalance diff --git a/src/components/operations/Operation.js b/src/components/operations/Operation.js index b74a36ad7..49c729008 100644 --- a/src/components/operations/Operation.js +++ b/src/components/operations/Operation.js @@ -11,6 +11,7 @@ import AccountMerge from './AccountMerge' import AllowTrust from './AllowTrust' import BumpSequence from './BumpSequence' import ChangeTrust from './ChangeTrust' +import ClaimClaimableBalance from './ClaimClaimableBalance' import CreateAccount from './CreateAccount' import Inflation from './Inflation' import ManageData from './ManageData' @@ -43,11 +44,21 @@ const opTypeComponentMap = { payment: Payment, set_options: SetOptions, + + create_claimable_balance: ClaimClaimableBalance, + + // TODO: handle these operation types (#238): + + // claim_claimable_balance + // begin_sponsoring_future_reserves + // end_sponsoring_future_reserves + // revoke_sponsorship } const opTypes = Object.keys(opTypeComponentMap) const SubOperation = ({op}) => { + opTypeComponentMap[op.type] || console.log(JSON.stringify(op, null, 2)) const SubOpComponent = opTypeComponentMap[op.type] || Unrecognized return } diff --git a/src/languages/en.json b/src/languages/en.json index b04909600..d49be08a8 100644 --- a/src/languages/en.json +++ b/src/languages/en.json @@ -111,6 +111,7 @@ "operation.account.create": "Created Account {account} with balance {balance}", "operation.account.merge": "Account merged into {account}", "operation.bump": "Bumped sequence to {sequence}", + "operation.claimable.claim": "{claimant} claimed balance {balanceId}", "operation.inflation": "Inflation run", "operation.manage.data.remove": "Remove Key {name}", "operation.manage.data.set": "Set Key {name}",