@depay/widgets 4.4.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1028,6 +1028,8 @@ var react = createCommonjsModule$4(function (module) {
1028
1028
 
1029
1029
  var ClosableContext = /*#__PURE__*/react.createContext();
1030
1030
 
1031
+ var UpdatableContext = /*#__PURE__*/react.createContext();
1032
+
1031
1033
  var ClosableProvider = (function (props) {
1032
1034
  var _useState = react.useState(true),
1033
1035
  _useState2 = _slicedToArray(_useState, 2),
@@ -1039,11 +1041,15 @@ var ClosableProvider = (function (props) {
1039
1041
  open = _useState4[0],
1040
1042
  setOpen = _useState4[1];
1041
1043
 
1044
+ var _useContext = react.useContext(UpdatableContext),
1045
+ setUpdatable = _useContext.setUpdatable;
1046
+
1042
1047
  var close = function close() {
1043
1048
  if (!closable) {
1044
1049
  return;
1045
1050
  }
1046
1051
 
1052
+ setUpdatable(false);
1047
1053
  setOpen(false);
1048
1054
  setTimeout(props.unmount, 300);
1049
1055
  };
@@ -1989,12 +1995,7 @@ var Dialog = (function (props) {
1989
1995
  className: "DialogBody"
1990
1996
  }, props.body), /*#__PURE__*/react.createElement("div", {
1991
1997
  className: "DialogFooter"
1992
- }, props.footer, /*#__PURE__*/react.createElement("a", {
1993
- href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
1994
- rel: "noopener noreferrer",
1995
- target: "_blank",
1996
- className: "FooterLink"
1997
- }, "by DePay")));
1998
+ }, props.footer));
1998
1999
  });
1999
2000
 
2000
2001
  var ConnectingWalletDialog = (function (props) {
@@ -2044,9 +2045,9 @@ var ConnectingWalletDialog = (function (props) {
2044
2045
  className: "TextButton"
2045
2046
  }, "Connect with another wallet")))),
2046
2047
  footer: /*#__PURE__*/react.createElement("div", {
2047
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
2048
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
2048
2049
  }, /*#__PURE__*/react.createElement("button", {
2049
- className: "ButtonPrimary wide",
2050
+ className: "ButtonPrimary",
2050
2051
  onClick: function onClick() {
2051
2052
  return props.connect(wallet);
2052
2053
  }
@@ -30524,6 +30525,8 @@ let balance = ({ address, provider }) => {
30524
30525
  var request$1 = async ({ provider, address, api, method, params }) => {
30525
30526
  if (api) {
30526
30527
  return contractCall({ address, api, method, params, provider })
30528
+ } else if (method === 'latestBlockNumber') {
30529
+ return provider.getBlockNumber()
30527
30530
  } else if (method === 'balance') {
30528
30531
  return balance({ address, provider })
30529
30532
  }
@@ -30580,8 +30583,20 @@ var parseUrl = (url) => {
30580
30583
  if (typeof url == 'object') {
30581
30584
  return url
30582
30585
  }
30583
- let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<address>[\w\d]+)\/(?<method>[\w\d]+)/);
30584
- return deconstructed.groups
30586
+ let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+))?/);
30587
+
30588
+ if(deconstructed.groups.part2 == undefined) {
30589
+ return {
30590
+ blockchain: deconstructed.groups.blockchain,
30591
+ method: deconstructed.groups.part1
30592
+ }
30593
+ } else {
30594
+ return {
30595
+ blockchain: deconstructed.groups.blockchain,
30596
+ address: deconstructed.groups.part1,
30597
+ method: deconstructed.groups.part2
30598
+ }
30599
+ }
30585
30600
  };
30586
30601
 
30587
30602
  let request = async function (url, options) {
@@ -51562,10 +51577,11 @@ function parseUnits$1(value, unitName) {
51562
51577
  function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
51563
51578
  class Transaction {
51564
51579
 
51565
- constructor({ blockchain, from, to, api, method, params, value, sent, confirmed, ensured, failed }) {
51580
+ constructor({ blockchain, from, nonce, to, api, method, params, value, sent, confirmed, ensured, failed }) {
51566
51581
 
51567
51582
  this.blockchain = blockchain;
51568
51583
  this.from = from;
51584
+ this.nonce = nonce;
51569
51585
  this.to = to;
51570
51586
  this.api = api;
51571
51587
  this.method = method;
@@ -51673,6 +51689,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
51673
51689
  await executeSubmit$1({ transaction, provider, signer }).then((sentTransaction)=>{
51674
51690
  if (sentTransaction) {
51675
51691
  transaction.id = sentTransaction.hash;
51692
+ transaction.nonce = sentTransaction.nonce;
51676
51693
  transaction.url = Blockchain.findByName(transaction.blockchain).explorerUrlFor({ transaction });
51677
51694
  if (transaction.sent) transaction.sent(transaction);
51678
51695
  sentTransaction.wait(1).then(() => {
@@ -51873,6 +51890,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
51873
51890
  transaction.url = blockchain.explorerUrlFor({ transaction });
51874
51891
  if (transaction.sent) transaction.sent(transaction);
51875
51892
  let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
51893
+ transaction.nonce = sentTransaction.nonce;
51876
51894
  if(!sentTransaction) {
51877
51895
  transaction._failed = true;
51878
51896
  console.log('Error retrieving transaction');
@@ -52160,7 +52178,7 @@ var SelectWalletDialog = (function (props) {
52160
52178
  return connect(wallet);
52161
52179
  }
52162
52180
  }, /*#__PURE__*/react.createElement("div", {
52163
- className: "CardImage PaddingLeftM"
52181
+ className: "CardImage"
52164
52182
  }, /*#__PURE__*/react.createElement("img", {
52165
52183
  src: wallet.logo
52166
52184
  })), /*#__PURE__*/react.createElement("div", {
@@ -52173,9 +52191,9 @@ var SelectWalletDialog = (function (props) {
52173
52191
  });
52174
52192
  return /*#__PURE__*/react.createElement(Dialog, {
52175
52193
  header: /*#__PURE__*/react.createElement("div", {
52176
- className: "PaddingTopS PaddingLeftM PaddingRightM"
52194
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
52177
52195
  }, /*#__PURE__*/react.createElement("h1", {
52178
- className: "LineHeightL FontSizeL TextLeft"
52196
+ className: "LineHeightL FontSizeL"
52179
52197
  }, "Select a wallet")),
52180
52198
  body: /*#__PURE__*/react.createElement("div", {
52181
52199
  className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
@@ -52183,11 +52201,13 @@ var SelectWalletDialog = (function (props) {
52183
52201
  footer: /*#__PURE__*/react.createElement("div", {
52184
52202
  className: "PaddingBottomS"
52185
52203
  }, /*#__PURE__*/react.createElement("button", {
52186
- className: "FontSizeS FontWeightBold TextGrey TextButton",
52204
+ className: "FontSizeS FontWeightBold TextButton",
52187
52205
  onClick: function onClick() {
52188
52206
  return setShowExplanation(!showExplanation);
52189
52207
  }
52190
- }, /*#__PURE__*/react.createElement("strong", null, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
52208
+ }, /*#__PURE__*/react.createElement("strong", {
52209
+ className: "Opacity05"
52210
+ }, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
52191
52211
  className: "PaddingLeftM PaddingRightM"
52192
52212
  }, "Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))
52193
52213
  });
@@ -52465,7 +52485,7 @@ var ErrorProvider = (function (props) {
52465
52485
  })), /*#__PURE__*/react.createElement("div", {
52466
52486
  className: "DialogBody"
52467
52487
  }, /*#__PURE__*/react.createElement("div", {
52468
- className: "GraphicWrapper"
52488
+ className: "GraphicWrapper PaddingTopS"
52469
52489
  }, /*#__PURE__*/react.createElement("img", {
52470
52490
  className: "Graphic",
52471
52491
  src: ErrorGraphic
@@ -52483,15 +52503,12 @@ var ErrorProvider = (function (props) {
52483
52503
  className: "FontSizeM PaddingTopS"
52484
52504
  }, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
52485
52505
  className: "DialogFooter"
52486
- }, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
52506
+ }, /*#__PURE__*/react.createElement("div", {
52507
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
52508
+ }, /*#__PURE__*/react.createElement("button", {
52487
52509
  className: "ButtonPrimary",
52488
52510
  onClick: close
52489
- }, "Try again")), /*#__PURE__*/react.createElement("a", {
52490
- href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
52491
- rel: "noopener noreferrer",
52492
- target: "_blank",
52493
- className: "FooterLink"
52494
- }, "by DePay"))));
52511
+ }, "Try again")))));
52495
52512
  } else {
52496
52513
  return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
52497
52514
  value: {
@@ -52503,28 +52520,28 @@ var ErrorProvider = (function (props) {
52503
52520
  }
52504
52521
  });
52505
52522
 
52523
+ var BlockchainLogoStyle = (function (style) {
52524
+ return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
52525
+ });
52526
+
52506
52527
  var ButtonCircularStyle = (function () {
52507
52528
  return "\n\n .ButtonCircular {\n border-radius: 99rem;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n ";
52508
52529
  });
52509
52530
 
52510
52531
  var ButtonPrimaryStyle = (function (style) {
52511
- return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius: 9999rem;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 1.3rem;\n font-weight: 400;\n height: 2.8rem;\n line-height: 2.8rem;\n justify-content: center;\n min-width: 12rem;\n overflow: hidden;\n padding: 0 1.4rem;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(style.colors.buttonText, ";\n }\n\n .ButtonPrimary.round {\n padding: 0;\n width: 3.4rem;\n min-width: 3.4rem;\n }\n\n .ButtonPrimary.wide {\n border-radius: 0.8rem;\n width: 100%;\n display: block;\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ");
52532
+ return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius: 0.8rem;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 1.3rem;\n font-weight: 400;\n line-height: 2.8rem;\n height: 3.6rem;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n padding: 0.4rem 0;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(style.colors.buttonText, ";\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ");
52512
52533
  });
52513
52534
 
52514
52535
  var CardStyle = (function (style) {
52515
- return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.6rem 0.6rem;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.1rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
52536
+ return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.5rem 0.5rem;\n margin: 0;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 3.6rem;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.1rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
52516
52537
  });
52517
52538
 
52518
52539
  var DialogStyle = (function (style) {
52519
- return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .FooterLink {\n bottom: 0;\n left: 0;\n position: absolute;\n padding-bottom: 1rem;\n right: 0;\n width: 100%;\n }\n\n .DialogFooter {\n padding-bottom: 50px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !important;\n max-height: 66vh !important;\n top: inherit !important;\n transition: opacity 0.4s ease, bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n .DialogBody {\n background: rgb(248,248,248);\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.HeightAuto {\n height: auto;\n }\n\n .DialogHeader {\n background: rgb(248,248,248);\n border-top-left-radius: 0.8rem;\n border-top-right-radius: 0.8rem;\n display: flex;\n flex-direction: row;\n position: relative;\n }\n\n .DialogHeaderTitle {\n flex-basis: auto;\n flex-grow: 1;\n }\n \n .DialogHeaderAction {\n height: 3rem;\n }\n\n .DialogFooter {\n background: rgb(248,248,248);\n border-bottom-left-radius: 0.8rem;\n border-bottom-right-radius: 0.8rem;\n line-height: 1.5rem;\n min-height: 2rem;\n position: relative;\n text-align: center;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n display: table;\n }\n\n ";
52540
+ return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .DialogFooter {\n padding-bottom: 50px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !important;\n max-height: 66vh !important;\n top: inherit !important;\n transition: opacity 0.4s ease, bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n .DialogBody {\n background: rgb(248,248,248);\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.HeightAuto {\n height: auto;\n }\n\n .DialogHeader {\n background: rgb(248,248,248);\n border-top-left-radius: 0.8rem;\n border-top-right-radius: 0.8rem;\n display: flex;\n flex-direction: row;\n position: relative;\n }\n\n .DialogHeaderTitle {\n flex-basis: auto;\n flex-grow: 1;\n }\n \n .DialogHeaderAction {\n height: 3rem;\n }\n\n .DialogFooter {\n background: rgb(248,248,248);\n border-bottom-left-radius: 0.8rem;\n border-bottom-right-radius: 0.8rem;\n line-height: 1.5rem;\n min-height: 2rem;\n position: relative;\n text-align: center;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n display: table;\n }\n\n ";
52520
52541
  });
52521
52542
 
52522
52543
  var FontStyle = (function (style) {
52523
- return "\n\n .Dialog, * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 1rem;\n }\n\n .FontSizeM {\n font-size: 1.2rem;\n }\n\n .FontSizeL {\n font-size: 1.4rem;\n }\n\n .FontSizeXL {\n font-size: 2.0rem;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
52524
- });
52525
-
52526
- var FooterStyle = (function (style) {
52527
- return "\n\n .FooterLink {\n color: rgba(0,0,0,0.2);\n display: inline-block;\n font-size: 0.9rem;\n text-decoration: none;\n }\n\n .FooterLink:hover, .FooterLink:active {\n color: ".concat(style.colors.primary, ";\n }\n ");
52544
+ return "\n\n *, div, div * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 1rem;\n }\n\n .FontSizeM {\n font-size: 1.2rem;\n }\n\n .FontSizeL {\n font-size: 1.4rem;\n }\n\n .FontSizeXL {\n font-size: 2.0rem;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
52528
52545
  });
52529
52546
 
52530
52547
  var GraphicStyle = (function () {
@@ -52536,7 +52553,7 @@ var HeightStyle = (function () {
52536
52553
  });
52537
52554
 
52538
52555
  var IconStyle = (function (style) {
52539
- return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 1.4rem;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 1.4rem;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n \n ");
52556
+ return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n\n .Loading {\n border: 3px solid ").concat(style.colors.primary, ";\n border-top: 3px solid rgba(0,0,0,0.1);\n border-radius: 100%;\n position: relative;\n left: -1px;\n width: 18px;\n height: 18px;\n animation: spin 1.5s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ");
52540
52557
  });
52541
52558
 
52542
52559
  var ImageStyle = (function (style) {
@@ -52555,10 +52572,18 @@ var LoadingTextStyle = (function (style) {
52555
52572
  return "\n\n .LoadingText {\n color: ".concat(style.colors.buttonText, ";\n display: inline-block;\n text-decoration: none;\n }\n\n @keyframes blink {\n 0% { opacity: .2; }\n 20% { opacity: 1; }\n 100% { opacity: .2; }\n }\n \n .LoadingText .dot {\n animation-name: blink;\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n }\n \n .LoadingText .dot:nth-child(2) {\n animation-delay: .2s;\n }\n \n .LoadingText .dot:nth-child(3) {\n animation-delay: .4s;\n }\n ");
52556
52573
  });
52557
52574
 
52575
+ var OpacityStyle = (function (style) {
52576
+ return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
52577
+ });
52578
+
52558
52579
  var PaddingStyle = (function () {
52559
52580
  return "\n\n .PaddingTopXS {\n padding-top: 0.2rem;\n }\n\n .PaddingRightXS {\n padding-right: 0.2rem;\n }\n\n .PaddingBottomXS {\n padding-bottom: 0.2rem;\n }\n\n .PaddingLeftXS {\n padding-left: 0.2rem; \n }\n\n .PaddingTopS {\n padding-top: 0.8rem;\n }\n\n .PaddingRightS {\n padding-right: 0.8rem;\n }\n\n .PaddingBottomS {\n padding-bottom: 0.8rem;\n }\n\n .PaddingLeftS {\n padding-left: 0.8rem; \n }\n\n .PaddingTopM {\n padding-top: 1.2rem;\n }\n\n .PaddingRightM {\n padding-right: 1.2rem;\n }\n\n .PaddingBottomM {\n padding-bottom: 1.2rem;\n }\n\n .PaddingLeftM {\n padding-left: 1.2rem; \n }\n\n .PaddingTopL {\n padding-top: 1.8rem;\n }\n\n .PaddingRightL {\n padding-right: 1.8rem;\n }\n\n .PaddingBottomL {\n padding-bottom: 1.8rem;\n }\n\n .PaddingLeftL {\n padding-left: 1.28em; \n }\n ";
52560
52581
  });
52561
52582
 
52583
+ var PoweredByStyle = (function (style) {
52584
+ return "\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 0.2rem;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .PoweredByLink {\n color: white;\n opacity: 0.4;\n display: inline-block;\n font-size: 0.78rem;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 0.5rem;\n text-decoration: none;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: ".concat(style.colors.primary, ";\n }\n ");
52585
+ });
52586
+
52562
52587
  var RangeSliderStyle = (function (style) {
52563
52588
  return "\n\n .rangeslider {\n margin: 20px 0;\n position: relative;\n background: #e6e6e6;\n -ms-touch-action: none;\n touch-action: none;\n }\n\n .rangeslider,\n .rangeslider__fill {\n display: block;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);\n }\n\n .rangeslider__handle {\n outline: none;\n cursor: pointer;\n display: inline-block;\n position: absolute;\n border-radius: 50%;\n background-color: " + style.colors.primary + ";\n border: 1px solid white;\n box-shadow: 0 0 8px rgba(0,0,0,0.1);\n }\n\n .rangeslider__handle:hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n\n .rangeslider__handle:active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.3);\n }\n\n .rangeslider__active {\n opacity: 1;\n }\n\n .rangeslider__handle-tooltip {\n display: none;\n }\n\n .rangeslider-horizontal {\n height: 12px;\n border-radius: 10px;\n }\n\n .rangeslider-horizontal .rangeslider__fill {\n height: 100%;\n background-color: " + style.colors.primary + ";\n border-radius: 10px;\n top: 0;\n }\n .rangeslider-horizontal .rangeslider__handle {\n width: 18px;\n height: 18px;\n border-radius: 30px;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n\n\n .rangeslider-horizontal .rangeslider__handle-tooltip {\n top: -55px;\n }\n\n ";
52564
52589
  });
@@ -52568,15 +52593,15 @@ var ResetStyle = (function () {
52568
52593
  });
52569
52594
 
52570
52595
  var SkeletonStyle = (function () {
52571
- return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
52596
+ return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
52572
52597
  });
52573
52598
 
52574
52599
  var TextButtonStyle = (function (style) {
52575
- return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton.TextGrey {\n color: grey;\n }\n \n .TextButton.TextGrey:hover {\n color: ").concat(style.colors.primary, "\n }\n ");
52600
+ return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton:hover * {\n opacity: 1.0;\n }\n ");
52576
52601
  });
52577
52602
 
52578
52603
  var TextStyle = (function (style) {
52579
- return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .TextGrey {\n color: grey;\n }\n\n .LineHeightL {\n line-height: 2.0rem;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 1.2rem;\n border: 0.5rem solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 0.9rem;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ");
52604
+ return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n h1, h2, h3, h4, h5, h6 {\n display: block;\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .LineHeightL {\n line-height: 2.0rem;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 1.2rem;\n border: 0.5rem solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 0.9rem;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ");
52580
52605
  });
52581
52606
 
52582
52607
  var TokenAmountStyle = (function () {
@@ -52593,7 +52618,7 @@ var styleRenderer = (function (style) {
52593
52618
  },
52594
52619
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
52595
52620
  }, style);
52596
- return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), FooterStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), IconStyle(style), PaddingStyle(), HeightStyle(), LabelStyle(style), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle()].join('');
52621
+ return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), PoweredByStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), IconStyle(style), OpacityStyle(), PaddingStyle(), HeightStyle(), LabelStyle(style), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle(), BlockchainLogoStyle()].join('');
52597
52622
  });
52598
52623
 
52599
52624
  function _interopDefaultLegacy$1 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -52713,6 +52738,31 @@ var mount = (function (_ref, content) {
52713
52738
  return unmount;
52714
52739
  });
52715
52740
 
52741
+ var PoweredBy = (function () {
52742
+ return /*#__PURE__*/react.createElement("div", {
52743
+ className: "PoweredByWrapper"
52744
+ }, /*#__PURE__*/react.createElement("a", {
52745
+ href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
52746
+ rel: "noopener noreferrer",
52747
+ target: "_blank",
52748
+ className: "PoweredByLink"
52749
+ }, "by DePay"));
52750
+ });
52751
+
52752
+ var UpdatableProvider = (function (props) {
52753
+ var _useState = react.useState(true),
52754
+ _useState2 = _slicedToArray(_useState, 2),
52755
+ updatable = _useState2[0],
52756
+ setUpdatable = _useState2[1];
52757
+
52758
+ return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
52759
+ value: {
52760
+ updatable: updatable,
52761
+ setUpdatable: setUpdatable
52762
+ }
52763
+ }, props.children);
52764
+ });
52765
+
52716
52766
  var Connect = function Connect(options) {
52717
52767
  var style, error, document;
52718
52768
 
@@ -52768,7 +52818,7 @@ var Connect = function Connect(options) {
52768
52818
  error: error,
52769
52819
  container: container,
52770
52820
  unmount: unmount
52771
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
52821
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
52772
52822
  unmount: rejectBeforeUnmount
52773
52823
  }, /*#__PURE__*/react.createElement(ConnectStack, {
52774
52824
  document: document,
@@ -52776,7 +52826,7 @@ var Connect = function Connect(options) {
52776
52826
  resolve: resolve,
52777
52827
  reject: reject,
52778
52828
  autoClose: true
52779
- })));
52829
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))));
52780
52830
  };
52781
52831
  });
52782
52832
 
@@ -65363,7 +65413,9 @@ var NoPaymentMethodFoundDialog = (function () {
65363
65413
  }, /*#__PURE__*/react.createElement("strong", {
65364
65414
  className: "FontSizeM"
65365
65415
  }, "We were not able to find any asset of value in your wallet. Please top up your account in order to proceed with this payment."))),
65366
- footer: /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
65416
+ footer: /*#__PURE__*/react.createElement("div", {
65417
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
65418
+ }, /*#__PURE__*/react.createElement("button", {
65367
65419
  className: "ButtonPrimary",
65368
65420
  onClick: close
65369
65421
  }, "Ok"))
@@ -65374,7 +65426,7 @@ var PaymentContext = /*#__PURE__*/react.createContext();
65374
65426
 
65375
65427
  var PaymentRoutingContext = /*#__PURE__*/react.createContext();
65376
65428
 
65377
- var UpdateContext = /*#__PURE__*/react.createContext();
65429
+ var TrackingContext = /*#__PURE__*/react.createContext();
65378
65430
 
65379
65431
  var PaymentProvider = (function (props) {
65380
65432
  var _useContext = react.useContext(ErrorContext),
@@ -65383,7 +65435,6 @@ var PaymentProvider = (function (props) {
65383
65435
  var _useContext2 = react.useContext(ConfigurationContext),
65384
65436
  _sent = _useContext2.sent,
65385
65437
  _confirmed = _useContext2.confirmed,
65386
- _ensured = _useContext2.ensured,
65387
65438
  _failed = _useContext2.failed;
65388
65439
 
65389
65440
  var _useContext3 = react.useContext(PaymentRoutingContext),
@@ -65397,13 +65448,17 @@ var PaymentProvider = (function (props) {
65397
65448
  var _useContext5 = react.useContext(PaymentRoutingContext),
65398
65449
  allRoutes = _useContext5.allRoutes;
65399
65450
 
65400
- var _useContext6 = react.useContext(UpdateContext);
65401
- _useContext6.update;
65402
- var setUpdate = _useContext6.setUpdate;
65451
+ var _useContext6 = react.useContext(UpdatableContext),
65452
+ setUpdatable = _useContext6.setUpdatable;
65403
65453
 
65404
65454
  var _useContext7 = react.useContext(WalletContext),
65405
65455
  wallet = _useContext7.wallet;
65406
65456
 
65457
+ var _useContext8 = react.useContext(TrackingContext),
65458
+ forward = _useContext8.forward,
65459
+ tracking = _useContext8.tracking,
65460
+ initializeTracking = _useContext8.initializeTracking;
65461
+
65407
65462
  var _useState = react.useState(),
65408
65463
  _useState2 = _slicedToArray(_useState, 2),
65409
65464
  payment = _useState2[0],
@@ -65424,53 +65479,81 @@ var PaymentProvider = (function (props) {
65424
65479
  paymentState = _useState8[0],
65425
65480
  setPaymentState = _useState8[1];
65426
65481
 
65427
- var pay = function pay(_ref) {
65428
- var navigate = _ref.navigate;
65429
- setClosable(false);
65430
- setPaymentState('paying');
65431
- setUpdate(false);
65432
- wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
65433
- sent: function sent(transaction) {
65434
- if (_sent) {
65435
- _sent(transaction);
65436
- }
65437
- },
65438
- confirmed: function confirmed(transaction) {
65439
- setClosable(true);
65440
- setPaymentState('confirmed');
65482
+ var pay = /*#__PURE__*/function () {
65483
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
65484
+ var navigate, currentBlock;
65485
+ return regenerator.wrap(function _callee$(_context) {
65486
+ while (1) {
65487
+ switch (_context.prev = _context.next) {
65488
+ case 0:
65489
+ navigate = _ref.navigate;
65490
+ setClosable(false);
65491
+ setPaymentState('paying');
65492
+ setUpdatable(false);
65493
+ _context.next = 6;
65494
+ return request({
65495
+ blockchain: payment.route.transaction.blockchain,
65496
+ method: 'latestBlockNumber'
65497
+ });
65441
65498
 
65442
- if (_confirmed) {
65443
- _confirmed(transaction);
65444
- }
65445
- },
65446
- ensured: function ensured(transaction) {
65447
- if (_ensured) {
65448
- _ensured(transaction);
65449
- }
65450
- },
65451
- failed: function failed(transaction, error) {
65452
- if (_failed) {
65453
- _failed(transaction, error);
65454
- }
65499
+ case 6:
65500
+ currentBlock = _context.sent;
65501
+ wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
65502
+ sent: function sent(transaction) {
65503
+ if (_sent) {
65504
+ _sent(transaction);
65505
+ }
65506
+ },
65507
+ confirmed: function confirmed(transaction) {
65508
+ if (tracking != true) {
65509
+ setClosable(true);
65510
+ }
65455
65511
 
65456
- setPaymentState('initialized');
65457
- setClosable(true);
65458
- setUpdate(true);
65459
- navigate('PaymentError');
65460
- }
65461
- })).then(function (sentTransaction) {
65462
- setTransaction(sentTransaction);
65463
- })["catch"](function (error) {
65464
- console.log('error', error);
65465
- setPaymentState('initialized');
65466
- setClosable(true);
65467
- setUpdate(true);
65512
+ setPaymentState('confirmed');
65468
65513
 
65469
- if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
65470
- navigate('WrongNetwork');
65471
- }
65472
- });
65473
- };
65514
+ if (_confirmed) {
65515
+ _confirmed(transaction);
65516
+ }
65517
+ },
65518
+ failed: function failed(transaction, error) {
65519
+ if (_failed) {
65520
+ _failed(transaction, error);
65521
+ }
65522
+
65523
+ setPaymentState('initialized');
65524
+ setClosable(true);
65525
+ setUpdatable(true);
65526
+ navigate('PaymentError');
65527
+ }
65528
+ })).then(function (sentTransaction) {
65529
+ if (tracking) {
65530
+ initializeTracking(sentTransaction, currentBlock);
65531
+ }
65532
+
65533
+ setTransaction(sentTransaction);
65534
+ })["catch"](function (error) {
65535
+ console.log('error', error);
65536
+ setPaymentState('initialized');
65537
+ setClosable(true);
65538
+ setUpdatable(true);
65539
+
65540
+ if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
65541
+ navigate('WrongNetwork');
65542
+ }
65543
+ });
65544
+
65545
+ case 8:
65546
+ case "end":
65547
+ return _context.stop();
65548
+ }
65549
+ }
65550
+ }, _callee);
65551
+ }));
65552
+
65553
+ return function pay(_x) {
65554
+ return _ref2.apply(this, arguments);
65555
+ };
65556
+ }();
65474
65557
 
65475
65558
  var approve = function approve() {
65476
65559
  setClosable(false);
@@ -65491,15 +65574,20 @@ var PaymentProvider = (function (props) {
65491
65574
  });
65492
65575
  };
65493
65576
 
65577
+ react.useEffect(function () {
65578
+ if (forward) {
65579
+ setPaymentState('confirmed');
65580
+ }
65581
+ }, [forward]);
65494
65582
  react.useEffect(function () {
65495
65583
  if (selectedRoute) {
65496
65584
  var fromToken = selectedRoute.fromToken;
65497
65585
  selectedRoute.transaction.params;
65498
- Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref2) {
65499
- var _ref3 = _slicedToArray(_ref2, 3),
65500
- name = _ref3[0],
65501
- symbol = _ref3[1],
65502
- amount = _ref3[2];
65586
+ Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
65587
+ var _ref4 = _slicedToArray(_ref3, 3),
65588
+ name = _ref4[0],
65589
+ symbol = _ref4[1],
65590
+ amount = _ref4[2];
65503
65591
 
65504
65592
  setPayment({
65505
65593
  route: selectedRoute,
@@ -65515,9 +65603,9 @@ var PaymentProvider = (function (props) {
65515
65603
  }, [selectedRoute]);
65516
65604
  react.useEffect(function () {
65517
65605
  if (allRoutes && allRoutes.length == 0) {
65518
- setUpdate(false);
65606
+ setUpdatable(false);
65519
65607
  } else if (allRoutes && allRoutes.length > 0) {
65520
- setUpdate(true);
65608
+ setUpdatable(true);
65521
65609
  }
65522
65610
  }, [allRoutes]);
65523
65611
 
@@ -70339,8 +70427,8 @@ var PaymentRoutingProvider = (function (props) {
70339
70427
  var _useContext = react.useContext(WalletContext),
70340
70428
  account = _useContext.account;
70341
70429
 
70342
- var _useContext2 = react.useContext(UpdateContext),
70343
- update = _useContext2.update;
70430
+ var _useContext2 = react.useContext(UpdatableContext),
70431
+ updatable = _useContext2.updatable;
70344
70432
 
70345
70433
  var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
70346
70434
  var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
@@ -70355,9 +70443,9 @@ var PaymentRoutingProvider = (function (props) {
70355
70443
  var getPaymentRoutes = function getPaymentRoutes(_ref) {
70356
70444
  var allRoutes = _ref.allRoutes,
70357
70445
  selectedRoute = _ref.selectedRoute,
70358
- update = _ref.update;
70446
+ updatable = _ref.updatable;
70359
70447
 
70360
- if (update == false || !props.accept || !account) {
70448
+ if (updatable == false || !props.accept || !account) {
70361
70449
  return;
70362
70450
  }
70363
70451
 
@@ -70460,13 +70548,13 @@ var PaymentRoutingProvider = (function (props) {
70460
70548
  getPaymentRoutes({
70461
70549
  allRoutes: allRoutes,
70462
70550
  selectedRoute: selectedRoute,
70463
- update: update
70551
+ updatable: updatable
70464
70552
  });
70465
70553
  }, 15000);
70466
70554
  return function () {
70467
70555
  return clearTimeout(timeout);
70468
70556
  };
70469
- }, [reloadCount, allRoutes, selectedRoute, update]);
70557
+ }, [reloadCount, allRoutes, selectedRoute, updatable]);
70470
70558
  react.useEffect(function () {
70471
70559
  if (account && props.accept) {
70472
70560
  setAllRoutes(undefined);
@@ -70496,8 +70584,8 @@ var PaymentValueProvider = (function (props) {
70496
70584
  var _useContext2 = react.useContext(WalletContext),
70497
70585
  account = _useContext2.account;
70498
70586
 
70499
- var _useContext3 = react.useContext(UpdateContext),
70500
- update = _useContext3.update;
70587
+ var _useContext3 = react.useContext(UpdatableContext),
70588
+ updatable = _useContext3.updatable;
70501
70589
 
70502
70590
  var _useContext4 = react.useContext(PaymentContext),
70503
70591
  payment = _useContext4.payment;
@@ -70516,10 +70604,10 @@ var PaymentValueProvider = (function (props) {
70516
70604
  setReloadCount = _useState4[1];
70517
70605
 
70518
70606
  var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
70519
- var update = _ref.update,
70607
+ var updatable = _ref.updatable,
70520
70608
  payment = _ref.payment;
70521
70609
 
70522
- if (update == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
70610
+ if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
70523
70611
  return;
70524
70612
  }
70525
70613
 
@@ -70562,7 +70650,7 @@ var PaymentValueProvider = (function (props) {
70562
70650
  react.useEffect(function () {
70563
70651
  if (account && payment) {
70564
70652
  getToTokenLocalValue({
70565
- update: update,
70653
+ updatable: updatable,
70566
70654
  payment: payment
70567
70655
  });
70568
70656
  }
@@ -70571,13 +70659,13 @@ var PaymentValueProvider = (function (props) {
70571
70659
  var timeout = setTimeout(function () {
70572
70660
  setReloadCount(reloadCount + 1);
70573
70661
  getToTokenLocalValue({
70574
- update: update
70662
+ updatable: updatable
70575
70663
  });
70576
70664
  }, 15000);
70577
70665
  return function () {
70578
70666
  return clearTimeout(timeout);
70579
70667
  };
70580
- }, [reloadCount, update]);
70668
+ }, [reloadCount, updatable]);
70581
70669
  return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
70582
70670
  value: {
70583
70671
  paymentValue: paymentValue
@@ -72464,7 +72552,9 @@ var ChangeAmountDialog = (function (props) {
72464
72552
  changeAmount(toValidValue(maxAmount));
72465
72553
  }
72466
72554
  }, "(Max)")))))),
72467
- footer: /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
72555
+ footer: /*#__PURE__*/react.createElement("div", {
72556
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72557
+ }, /*#__PURE__*/react.createElement("button", {
72468
72558
  className: "ButtonPrimary",
72469
72559
  onClick: changeAmountAndGoBack
72470
72560
  }, "Done"))
@@ -72551,6 +72641,7 @@ var ChangePaymentDialog = (function (props) {
72551
72641
  }, [allRoutes]);
72552
72642
  react.useEffect(function () {
72553
72643
  setCards(allPaymentRoutesWithData.map(function (payment, index) {
72644
+ var blockchain = Blockchain.findByName(payment.route.blockchain);
72554
72645
  return /*#__PURE__*/react.createElement("div", {
72555
72646
  key: index,
72556
72647
  className: "Card",
@@ -72564,6 +72655,11 @@ var ChangePaymentDialog = (function (props) {
72564
72655
  }, /*#__PURE__*/react.createElement(TokenImage_1, {
72565
72656
  blockchain: payment.route.blockchain,
72566
72657
  address: payment.route.fromToken.address
72658
+ }), /*#__PURE__*/react.createElement("img", {
72659
+ className: "BlockchainLogo small",
72660
+ src: blockchain.logo,
72661
+ alt: blockchain.label,
72662
+ title: blockchain.label
72567
72663
  })), /*#__PURE__*/react.createElement("div", {
72568
72664
  className: "CardBody"
72569
72665
  }, /*#__PURE__*/react.createElement("div", {
@@ -72604,25 +72700,12 @@ var ChangePaymentDialog = (function (props) {
72604
72700
  });
72605
72701
  });
72606
72702
 
72607
- var Checkmark = (function () {
72608
- return /*#__PURE__*/react.createElement("svg", {
72609
- className: "Checkmark Icon",
72610
- version: "1.1",
72611
- xmlns: "http://www.w3.org/2000/svg",
72612
- x: "0px",
72613
- y: "0px",
72614
- viewBox: "0 0 24 24"
72615
- }, /*#__PURE__*/react.createElement("path", {
72616
- d: "M20,4.9L9.2,16l-5.4-3.9c-0.7-0.5-1.6-0.3-2.1,0.3c-0.5,0.7-0.3,1.6,0.3,2.1l6.4,4.7c0.3,0.2,0.6,0.3,0.9,0.3 c0.4,0,0.8-0.2,1.1-0.5l11.7-12c0.6-0.6,0.6-1.6,0-2.2C21.6,4.3,20.6,4.3,20,4.9z"
72617
- }));
72618
- });
72619
-
72620
72703
  var DonationOverviewSkeleton = (function (props) {
72621
72704
  return /*#__PURE__*/react.createElement(Dialog, {
72622
72705
  header: /*#__PURE__*/react.createElement("div", {
72623
- className: "PaddingTopS PaddingLeftM PaddingRightM"
72706
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72624
72707
  }, /*#__PURE__*/react.createElement("h1", {
72625
- className: "LineHeightL FontSizeL TextLeft"
72708
+ className: "LineHeightL FontSizeL"
72626
72709
  }, "Donation")),
72627
72710
  body: /*#__PURE__*/react.createElement("div", {
72628
72711
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72636,7 +72719,7 @@ var DonationOverviewSkeleton = (function (props) {
72636
72719
  className: "SkeletonBackground"
72637
72720
  }))),
72638
72721
  footer: /*#__PURE__*/react.createElement("div", {
72639
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
72722
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72640
72723
  }, /*#__PURE__*/react.createElement("div", {
72641
72724
  className: "SkeletonWrapper"
72642
72725
  }, /*#__PURE__*/react.createElement("div", {
@@ -72647,6 +72730,60 @@ var DonationOverviewSkeleton = (function (props) {
72647
72730
  });
72648
72731
  });
72649
72732
 
72733
+ var Checkmark = (function (props) {
72734
+ return /*#__PURE__*/react.createElement("svg", {
72735
+ className: "Checkmark Icon " + props.className,
72736
+ version: "1.1",
72737
+ xmlns: "http://www.w3.org/2000/svg",
72738
+ x: "0px",
72739
+ y: "0px",
72740
+ viewBox: "0 0 24 24"
72741
+ }, /*#__PURE__*/react.createElement("path", {
72742
+ d: "M20,4.9L9.2,16l-5.4-3.9c-0.7-0.5-1.6-0.3-2.1,0.3c-0.5,0.7-0.3,1.6,0.3,2.1l6.4,4.7c0.3,0.2,0.6,0.3,0.9,0.3 c0.4,0,0.8-0.2,1.1-0.5l11.7-12c0.6-0.6,0.6-1.6,0-2.2C21.6,4.3,20.6,4.3,20,4.9z"
72743
+ }));
72744
+ });
72745
+
72746
+ var DigitalWalletIcon = (function (props) {
72747
+ return /*#__PURE__*/react.createElement("svg", {
72748
+ className: "DigitalWalletIcon Icon " + props.className,
72749
+ version: "1.1",
72750
+ xmlns: "http://www.w3.org/2000/svg",
72751
+ height: "24",
72752
+ width: "24",
72753
+ viewBox: "0 0 24 24"
72754
+ }, /*#__PURE__*/react.createElement("path", {
72755
+ d: "M8.51,4.84l-.39-.53,4-2.89a2.2,2.2,0,0,1,3.06.48l.4.56-.53.39-.4-.56A1.54,1.54,0,0,0,12.5,2Z",
72756
+ transform: "translate(-0.81 -1)"
72757
+ }), /*#__PURE__*/react.createElement("path", {
72758
+ d: "M9.77,4.89l-.21-.62,6.31-2.13h0a2.18,2.18,0,0,1,.67-.1h0a2.21,2.21,0,0,1,2.08,1.49l.32.95-.63.21L18,3.73a1.53,1.53,0,0,0-1.45-1h0a1.61,1.61,0,0,0-.48.08h0Z",
72759
+ transform: "translate(-0.81 -1)"
72760
+ }), /*#__PURE__*/react.createElement("path", {
72761
+ d: "M19.72,16.2H18.27a3.28,3.28,0,1,1,0-6.56h1.45a3.21,3.21,0,0,1,1.33.28h0a3.28,3.28,0,0,1,0,6A3.21,3.21,0,0,1,19.72,16.2Zm-1.45-5.9a2.63,2.63,0,0,0,0,5.25h1.45a2.56,2.56,0,0,0,1.06-.23,2.62,2.62,0,0,0,0-4.8,2.55,2.55,0,0,0-1.06-.22ZM19,14.53a1.61,1.61,0,1,1,1.61-1.61A1.62,1.62,0,0,1,19,14.53ZM19,12a1,1,0,1,0,.95.95A1,1,0,0,0,19,12Z",
72762
+ transform: "translate(-0.81 -1)"
72763
+ }), /*#__PURE__*/react.createElement("path", {
72764
+ d: "M10.49,19.69a1.58,1.58,0,1,1,1.58-1.57A1.57,1.57,0,0,1,10.49,19.69Zm0-2.49a.92.92,0,1,0,.92.92A.92.92,0,0,0,10.49,17.2Z",
72765
+ transform: "translate(-0.81 -1)"
72766
+ }), /*#__PURE__*/react.createElement("path", {
72767
+ d: "M19.09,22.14H2.79a2,2,0,0,1-2-2V6.25a2.1,2.1,0,0,1,0-.43,2,2,0,0,1,.48-.92,2,2,0,0,1,1.48-.65H19.09a2,2,0,0,1,.64.1,2,2,0,0,1,1.36,1.79v0a.28.28,0,0,1,0,.09v3.91h-.66v-4a1.49,1.49,0,0,0-.23-.69A1.35,1.35,0,0,0,19.52,5a1.26,1.26,0,0,0-.43-.08H2.82a1.34,1.34,0,0,0-1,.44A1.49,1.49,0,0,0,1.5,6a1.5,1.5,0,0,0,0,.29V20.13a1.36,1.36,0,0,0,1.34,1.35H19.09a1.35,1.35,0,0,0,1.35-1.35V15.68h.66v4.45A2,2,0,0,1,19.09,22.14Z",
72768
+ transform: "translate(-0.81 -1)"
72769
+ }), /*#__PURE__*/react.createElement("path", {
72770
+ d: "M9.27,9.31a1.58,1.58,0,1,1,0-3.15,1.58,1.58,0,0,1,0,3.15Zm0-2.5a.92.92,0,1,0,.92.92A.92.92,0,0,0,9.27,6.81Z",
72771
+ transform: "translate(-0.81 -1)"
72772
+ }), /*#__PURE__*/react.createElement("path", {
72773
+ d: "M7.11,14.67A1.58,1.58,0,1,1,8.69,13.1,1.57,1.57,0,0,1,7.11,14.67Zm0-2.49A.92.92,0,1,0,8,13.1.92.92,0,0,0,7.11,12.18Z",
72774
+ transform: "translate(-0.81 -1)"
72775
+ }), /*#__PURE__*/react.createElement("rect", {
72776
+ x: "0.33",
72777
+ y: "11.77",
72778
+ width: "4.72",
72779
+ height: "0.66"
72780
+ }), /*#__PURE__*/react.createElement("polygon", {
72781
+ points: "2.08 9.53 0.33 9.53 0.33 8.87 1.8 8.87 4.28 6.39 7.21 6.39 7.21 7.05 4.55 7.05 2.08 9.53"
72782
+ }), /*#__PURE__*/react.createElement("polygon", {
72783
+ points: "8.43 17.45 4.53 17.45 2.63 15.55 0.33 15.55 0.33 14.89 2.9 14.89 4.8 16.79 8.43 16.79 8.43 17.45"
72784
+ }));
72785
+ });
72786
+
72650
72787
  var LoadingText = (function (props) {
72651
72788
  return /*#__PURE__*/react.createElement("div", {
72652
72789
  className: "LoadingText"
@@ -72659,26 +72796,143 @@ var LoadingText = (function (props) {
72659
72796
  }, "."));
72660
72797
  });
72661
72798
 
72662
- var DonationOverviewDialog = (function (props) {
72799
+ var Footer = (function () {
72663
72800
  var _useContext = react.useContext(ConfigurationContext),
72664
72801
  currencyCode = _useContext.currencyCode;
72665
72802
 
72666
72803
  var _useContext2 = react.useContext(ChangableAmountContext),
72667
72804
  amount = _useContext2.amount;
72805
+ _useContext2.amountsMissing;
72668
72806
 
72669
- var _useContext3 = react.useContext(PaymentContext),
72670
- payment = _useContext3.payment,
72671
- paymentState = _useContext3.paymentState,
72672
- pay = _useContext3.pay,
72673
- transaction = _useContext3.transaction,
72674
- approve = _useContext3.approve,
72675
- approvalTransaction = _useContext3.approvalTransaction;
72807
+ var _useContext3 = react.useContext(TrackingContext),
72808
+ tracking = _useContext3.tracking,
72809
+ forward = _useContext3.forward,
72810
+ forwardTo = _useContext3.forwardTo;
72676
72811
 
72677
- var _useContext4 = react.useContext(NavigateStackContext_1),
72678
- navigate = _useContext4.navigate;
72812
+ var _useContext4 = react.useContext(PaymentContext),
72813
+ payment = _useContext4.payment,
72814
+ paymentState = _useContext4.paymentState,
72815
+ pay = _useContext4.pay,
72816
+ transaction = _useContext4.transaction,
72817
+ approve = _useContext4.approve,
72818
+ approvalTransaction = _useContext4.approvalTransaction;
72819
+
72820
+ var _useContext5 = react.useContext(PaymentValueContext),
72821
+ paymentValue = _useContext5.paymentValue;
72679
72822
 
72680
- var _useContext5 = react.useContext(ClosableContext),
72681
- close = _useContext5.close;
72823
+ var _useContext6 = react.useContext(NavigateStackContext_1),
72824
+ navigate = _useContext6.navigate;
72825
+
72826
+ var _useContext7 = react.useContext(ClosableContext),
72827
+ close = _useContext7.close;
72828
+
72829
+ var trackingInfo = function trackingInfo() {
72830
+ if (tracking != true) {
72831
+ return null;
72832
+ }
72833
+
72834
+ if (forward) {
72835
+ return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72836
+ className: "Card transparent small disabled"
72837
+ }, /*#__PURE__*/react.createElement("div", {
72838
+ className: "CardImage"
72839
+ }, /*#__PURE__*/react.createElement("div", {
72840
+ className: "TextCenter Opacity05"
72841
+ }, /*#__PURE__*/react.createElement(Checkmark, {
72842
+ className: "small"
72843
+ }))), /*#__PURE__*/react.createElement("div", {
72844
+ className: "CardBody"
72845
+ }, /*#__PURE__*/react.createElement("div", {
72846
+ className: "CardBodyWrapper"
72847
+ }, /*#__PURE__*/react.createElement("div", {
72848
+ className: "Opacity05"
72849
+ }, "Payment confirmation has been stored")))));
72850
+ } else {
72851
+ return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72852
+ className: "Card transparent small disabled"
72853
+ }, /*#__PURE__*/react.createElement("div", {
72854
+ className: "CardImage"
72855
+ }, /*#__PURE__*/react.createElement("div", {
72856
+ className: "TextCenter"
72857
+ }, /*#__PURE__*/react.createElement("div", {
72858
+ className: "Loading Icon"
72859
+ }))), /*#__PURE__*/react.createElement("div", {
72860
+ className: "CardBody"
72861
+ }, /*#__PURE__*/react.createElement("div", {
72862
+ className: "CardBodyWrapper"
72863
+ }, /*#__PURE__*/react.createElement("div", {
72864
+ className: "Opacity05"
72865
+ }, "Storing payment confirmation")))));
72866
+ }
72867
+ };
72868
+
72869
+ var additionalPaymentInformation = function additionalPaymentInformation() {
72870
+ if (paymentState == 'paying' && transaction == undefined) {
72871
+ return /*#__PURE__*/react.createElement("div", {
72872
+ className: "PaddingBottomS"
72873
+ }, /*#__PURE__*/react.createElement("div", {
72874
+ className: "Card transparent disabled small"
72875
+ }, /*#__PURE__*/react.createElement("div", {
72876
+ className: "CardImage"
72877
+ }, /*#__PURE__*/react.createElement("div", {
72878
+ className: "TextCenter Opacity05"
72879
+ }, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
72880
+ className: "small"
72881
+ }))), /*#__PURE__*/react.createElement("div", {
72882
+ className: "CardBody"
72883
+ }, /*#__PURE__*/react.createElement("div", {
72884
+ className: "CardBodyWrapper"
72885
+ }, /*#__PURE__*/react.createElement("div", {
72886
+ className: "Opacity05"
72887
+ }, "Confirm transaction in your wallet")))));
72888
+ } else if (paymentState == 'confirmed') {
72889
+ return /*#__PURE__*/react.createElement("div", {
72890
+ className: "PaddingBottomS"
72891
+ }, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72892
+ className: "Card transparent small",
72893
+ title: "Payment has been confirmed by the network",
72894
+ href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
72895
+ target: "_blank",
72896
+ rel: "noopener noreferrer"
72897
+ }, /*#__PURE__*/react.createElement("div", {
72898
+ className: "CardImage"
72899
+ }, /*#__PURE__*/react.createElement("div", {
72900
+ className: "TextCenter Opacity05"
72901
+ }, /*#__PURE__*/react.createElement(Checkmark, {
72902
+ className: "small"
72903
+ }))), /*#__PURE__*/react.createElement("div", {
72904
+ className: "CardBody"
72905
+ }, /*#__PURE__*/react.createElement("div", {
72906
+ className: "CardBodyWrapper"
72907
+ }, /*#__PURE__*/react.createElement("div", {
72908
+ className: "Opacity05"
72909
+ }, "Payment has been confirmed"))))), trackingInfo());
72910
+ }
72911
+ };
72912
+
72913
+ var approvalButton = function approvalButton() {
72914
+ if (!payment.route.approvalRequired || payment.route.directTransfer) {
72915
+ return null;
72916
+ } else if (paymentState == 'initialized') {
72917
+ return /*#__PURE__*/react.createElement("div", {
72918
+ className: "PaddingBottomS"
72919
+ }, /*#__PURE__*/react.createElement("button", {
72920
+ className: "ButtonPrimary",
72921
+ onClick: approve,
72922
+ title: "Allow ".concat(payment.symbol, " to be used as payment")
72923
+ }, "Allow ", payment.symbol, " to be used as payment"));
72924
+ } else if (paymentState == 'approving') {
72925
+ return /*#__PURE__*/react.createElement("div", {
72926
+ className: "PaddingBottomS"
72927
+ }, /*#__PURE__*/react.createElement("a", {
72928
+ className: "ButtonPrimary",
72929
+ title: "Approving payment token - please wait",
72930
+ href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
72931
+ target: "_blank",
72932
+ rel: "noopener noreferrer"
72933
+ }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
72934
+ }
72935
+ };
72682
72936
 
72683
72937
  var mainAction = function mainAction() {
72684
72938
  if (paymentState == 'initialized' || paymentState == 'approving') {
@@ -72693,10 +72947,10 @@ var DonationOverviewDialog = (function (props) {
72693
72947
  navigate: navigate
72694
72948
  });
72695
72949
  }
72696
- }, "Pay ", new Currency({
72950
+ }, "Pay ", amount ? new Currency({
72697
72951
  amount: amount.toFixed(2),
72698
72952
  code: currencyCode
72699
- }).toString());
72953
+ }).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
72700
72954
  } else if (paymentState == 'paying') {
72701
72955
  return /*#__PURE__*/react.createElement("a", {
72702
72956
  className: "ButtonPrimary",
@@ -72706,39 +72960,51 @@ var DonationOverviewDialog = (function (props) {
72706
72960
  rel: "noopener noreferrer"
72707
72961
  }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
72708
72962
  } else if (paymentState == 'confirmed') {
72709
- return /*#__PURE__*/react.createElement("button", {
72710
- className: "ButtonPrimary round",
72711
- title: "Done",
72712
- onClick: close
72713
- }, /*#__PURE__*/react.createElement(Checkmark, null));
72963
+ if (tracking == true) {
72964
+ if (forward) {
72965
+ if (forwardTo) {
72966
+ return /*#__PURE__*/react.createElement("a", {
72967
+ className: "ButtonPrimary",
72968
+ href: forwardTo,
72969
+ rel: "noopener noreferrer"
72970
+ }, "Continue");
72971
+ } else {
72972
+ return /*#__PURE__*/react.createElement("button", {
72973
+ className: "ButtonPrimary",
72974
+ onClick: close
72975
+ }, "Continue");
72976
+ }
72977
+ } else {
72978
+ return /*#__PURE__*/react.createElement("button", {
72979
+ className: "ButtonPrimary disabled",
72980
+ onClick: function onClick() {}
72981
+ }, "Continue");
72982
+ }
72983
+ } else {
72984
+ return /*#__PURE__*/react.createElement("button", {
72985
+ className: "ButtonPrimary",
72986
+ onClick: close
72987
+ }, "Close");
72988
+ }
72714
72989
  }
72715
72990
  };
72716
72991
 
72717
- var approvalAction = function approvalAction() {
72718
- if (paymentState == 'initialized') {
72719
- return /*#__PURE__*/react.createElement("div", {
72720
- className: "PaddingBottomS"
72721
- }, /*#__PURE__*/react.createElement("button", {
72722
- className: "ButtonPrimary wide",
72723
- onClick: approve,
72724
- title: "Allow ".concat(payment.symbol, " to be used as payment")
72725
- }, "Allow ", payment.symbol, " to be used as payment"));
72726
- } else if (paymentState == 'approving') {
72727
- return /*#__PURE__*/react.createElement("div", {
72728
- className: "PaddingBottomS"
72729
- }, /*#__PURE__*/react.createElement("a", {
72730
- className: "ButtonPrimary wide",
72731
- title: "Approving payment token - please wait",
72732
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
72733
- target: "_blank",
72734
- rel: "noopener noreferrer"
72735
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
72736
- }
72737
- };
72992
+ return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
72993
+ });
72738
72994
 
72739
- var actions = function actions() {
72740
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
72741
- };
72995
+ var DonationOverviewDialog = (function (props) {
72996
+ var _useContext = react.useContext(ConfigurationContext),
72997
+ currencyCode = _useContext.currencyCode;
72998
+
72999
+ var _useContext2 = react.useContext(ChangableAmountContext),
73000
+ amount = _useContext2.amount;
73001
+
73002
+ var _useContext3 = react.useContext(PaymentContext),
73003
+ payment = _useContext3.payment,
73004
+ paymentState = _useContext3.paymentState;
73005
+
73006
+ var _useContext4 = react.useContext(NavigateStackContext_1),
73007
+ navigate = _useContext4.navigate;
72742
73008
 
72743
73009
  if (payment == undefined) {
72744
73010
  return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
@@ -72746,9 +73012,9 @@ var DonationOverviewDialog = (function (props) {
72746
73012
 
72747
73013
  return /*#__PURE__*/react.createElement(Dialog, {
72748
73014
  header: /*#__PURE__*/react.createElement("div", {
72749
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73015
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72750
73016
  }, /*#__PURE__*/react.createElement("h1", {
72751
- className: "LineHeightL FontSizeL TextLeft"
73017
+ className: "LineHeightL FontSizeL"
72752
73018
  }, "Donation")),
72753
73019
  body: /*#__PURE__*/react.createElement("div", {
72754
73020
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72811,8 +73077,8 @@ var DonationOverviewDialog = (function (props) {
72811
73077
  className: "CardAction"
72812
73078
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
72813
73079
  footer: /*#__PURE__*/react.createElement("div", {
72814
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
72815
- }, actions())
73080
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73081
+ }, /*#__PURE__*/react.createElement(Footer, null))
72816
73082
  });
72817
73083
  });
72818
73084
 
@@ -72849,9 +73115,9 @@ var PaymentErrorDialog = (function () {
72849
73115
  rel: "noopener noreferrer"
72850
73116
  }, "View on explorer")))),
72851
73117
  footer: /*#__PURE__*/react.createElement("div", {
72852
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73118
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72853
73119
  }, /*#__PURE__*/react.createElement("button", {
72854
- className: "ButtonPrimary wide",
73120
+ className: "ButtonPrimary",
72855
73121
  onClick: function onClick() {
72856
73122
  return navigate('back');
72857
73123
  }
@@ -72872,9 +73138,9 @@ var WrongNetworkDialog = (function (props) {
72872
73138
  return /*#__PURE__*/react.createElement(Dialog, {
72873
73139
  stacked: true,
72874
73140
  header: /*#__PURE__*/react.createElement("div", {
72875
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73141
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72876
73142
  }, /*#__PURE__*/react.createElement("h1", {
72877
- className: "LineHeightL FontSizeL TextLeft"
73143
+ className: "LineHeightL FontSizeL"
72878
73144
  }, "Wrong Network")),
72879
73145
  body: /*#__PURE__*/react.createElement("div", {
72880
73146
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72891,7 +73157,7 @@ var WrongNetworkDialog = (function (props) {
72891
73157
  className: "FontSizeM"
72892
73158
  }, "Please make sure you connect your wallet to the correct network before you try again!"))),
72893
73159
  footer: /*#__PURE__*/react.createElement("div", {
72894
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73160
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72895
73161
  }, /*#__PURE__*/react.createElement("button", {
72896
73162
  className: "ButtonPrimary",
72897
73163
  onClick: function onClick() {
@@ -72922,16 +73188,122 @@ var DonationStack = (function (props) {
72922
73188
  });
72923
73189
  });
72924
73190
 
72925
- var UpdateProvider = (function (props) {
72926
- var _useState = react.useState(true),
73191
+ var TrackingProvider = (function (props) {
73192
+ var _useContext = react.useContext(ConfigurationContext),
73193
+ track = _useContext.track;
73194
+
73195
+ var _useState = react.useState(track && !!track.endpoint),
72927
73196
  _useState2 = _slicedToArray(_useState, 2),
72928
- update = _useState2[0],
72929
- setUpdate = _useState2[1];
73197
+ tracking = _useState2[0],
73198
+ setTracking = _useState2[1];
72930
73199
 
72931
- return /*#__PURE__*/react.createElement(UpdateContext.Provider, {
73200
+ var _useState3 = react.useState(false),
73201
+ _useState4 = _slicedToArray(_useState3, 2),
73202
+ forward = _useState4[0],
73203
+ setForward = _useState4[1];
73204
+
73205
+ var _useState5 = react.useState(),
73206
+ _useState6 = _slicedToArray(_useState5, 2),
73207
+ forwardTo = _useState6[0],
73208
+ setForwardTo = _useState6[1];
73209
+
73210
+ var _useContext2 = react.useContext(ClosableContext),
73211
+ setClosable = _useContext2.setClosable;
73212
+
73213
+ react.useEffect(function () {
73214
+ setTracking(track && !!track.endpoint);
73215
+ }, [track]);
73216
+
73217
+ var openSocket = function openSocket(transaction) {
73218
+ var socket = new WebSocket('wss://integrate.depay.fi/cable');
73219
+
73220
+ socket.onopen = function (event) {
73221
+ var msg = {
73222
+ command: 'subscribe',
73223
+ identifier: JSON.stringify({
73224
+ blockchain: transaction.blockchain,
73225
+ sender: transaction.from.toLowerCase(),
73226
+ nonce: transaction.nonce,
73227
+ channel: 'PaymentChannel'
73228
+ })
73229
+ };
73230
+ socket.send(JSON.stringify(msg));
73231
+ };
73232
+
73233
+ socket.onclose = function (event) {};
73234
+
73235
+ socket.onmessage = function (event) {
73236
+ var item = JSON.parse(event.data);
73237
+
73238
+ if (item.type === "ping") {
73239
+ return;
73240
+ }
73241
+
73242
+ if (item.message && item.message.forward) {
73243
+ setClosable(!item.message.forward_to);
73244
+ setForwardTo(item.message.forward_to);
73245
+ setForward(item.message.forward);
73246
+ socket.close();
73247
+
73248
+ if (!!item.message.forward_to) {
73249
+ setTimeout(function () {
73250
+ props.document.location.href = item.message.forward_to;
73251
+ }, 500);
73252
+ }
73253
+ }
73254
+ };
73255
+
73256
+ socket.onerror = function (error) {
73257
+ console.log('WebSocket Error: ' + error);
73258
+ };
73259
+ };
73260
+
73261
+ var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
73262
+ attempt = parseInt(attempt || 1, 10);
73263
+ console.log('RETRY TRACKING ATTEMPT ', attempt);
73264
+
73265
+ if (attempt < 3) {
73266
+ setTimeout(function () {
73267
+ startTracking(transaction, afterBlock, attempt + 1);
73268
+ }, 3000);
73269
+ } else {
73270
+ console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
73271
+ }
73272
+ };
73273
+
73274
+ var startTracking = function startTracking(transaction, afterBlock, attempt) {
73275
+ fetch(track.endpoint, {
73276
+ method: 'POST',
73277
+ body: JSON.stringify({
73278
+ blockchain: transaction.blockchain,
73279
+ transaction: transaction.id.toLowerCase(),
73280
+ sender: transaction.from.toLowerCase(),
73281
+ nonce: transaction.nonce,
73282
+ after_block: afterBlock
73283
+ })
73284
+ }).then(function (response) {
73285
+ if (response.status == 200) {
73286
+ console.log('TRACKING INITIALIZED');
73287
+ } else {
73288
+ retryStartTracking(transaction, afterBlock, attempt);
73289
+ }
73290
+ })["catch"](function (error) {
73291
+ console.log('TRACKING FAILED', error);
73292
+ retryStartTracking(transaction, afterBlock, attempt);
73293
+ });
73294
+ };
73295
+
73296
+ var initializeTracking = function initializeTracking(transaction, afterBlock) {
73297
+ openSocket(transaction);
73298
+ startTracking(transaction, afterBlock);
73299
+ };
73300
+
73301
+ return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
72932
73302
  value: {
72933
- update: update,
72934
- setUpdate: setUpdate
73303
+ tracking: tracking,
73304
+ initializeTracking: initializeTracking,
73305
+ forward: forward,
73306
+ forwardTo: forwardTo
72935
73307
  }
72936
73308
  }, props.children);
72937
73309
  });
@@ -73034,12 +73406,12 @@ var preflight$2 = /*#__PURE__*/function () {
73034
73406
 
73035
73407
  var Donation = /*#__PURE__*/function () {
73036
73408
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73037
- var amount, accept, event, sent, confirmed, ensured, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
73409
+ var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
73038
73410
  return regenerator.wrap(function _callee2$(_context2) {
73039
73411
  while (1) {
73040
73412
  switch (_context2.prev = _context2.next) {
73041
73413
  case 0:
73042
- amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, ensured = _ref3.ensured, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, document = _ref3.document;
73414
+ amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, document = _ref3.document;
73043
73415
  _context2.prev = 1;
73044
73416
  _context2.next = 4;
73045
73417
  return preflight$2({
@@ -73065,26 +73437,27 @@ var Donation = /*#__PURE__*/function () {
73065
73437
  event: event,
73066
73438
  sent: sent,
73067
73439
  confirmed: confirmed,
73068
- ensured: ensured,
73069
73440
  failed: failed,
73070
73441
  blacklist: blacklist,
73071
73442
  providers: providers
73072
73443
  }
73073
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
73444
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73074
73445
  unmount: unmount
73075
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
73446
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73076
73447
  container: container,
73077
73448
  connected: connected,
73078
73449
  unmount: unmount
73079
73450
  }, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
73080
73451
  accept: accept
73452
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
73453
+ document: ensureDocument(document)
73081
73454
  }, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
73082
73455
  container: container,
73083
73456
  document: document
73084
73457
  }, /*#__PURE__*/react.createElement(DonationStack, {
73085
73458
  document: document,
73086
73459
  container: container
73087
- })))))))));
73460
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
73088
73461
  };
73089
73462
  });
73090
73463
  return _context2.abrupt("return", {
@@ -73152,9 +73525,9 @@ var PaymentOverviewSkeleton = (function (props) {
73152
73525
 
73153
73526
  return /*#__PURE__*/react.createElement(Dialog, {
73154
73527
  header: /*#__PURE__*/react.createElement("div", {
73155
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73528
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73156
73529
  }, /*#__PURE__*/react.createElement("h1", {
73157
- className: "LineHeightL FontSizeL TextLeft"
73530
+ className: "LineHeightL FontSizeL"
73158
73531
  }, "Payment")),
73159
73532
  body: /*#__PURE__*/react.createElement("div", {
73160
73533
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73168,7 +73541,7 @@ var PaymentOverviewSkeleton = (function (props) {
73168
73541
  className: "SkeletonBackground"
73169
73542
  }))),
73170
73543
  footer: /*#__PURE__*/react.createElement("div", {
73171
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73544
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73172
73545
  }, /*#__PURE__*/react.createElement("div", {
73173
73546
  className: "SkeletonWrapper"
73174
73547
  }, /*#__PURE__*/react.createElement("div", {
@@ -73183,17 +73556,13 @@ var PaymentOverviewDialog = (function (props) {
73183
73556
  var _useContext = react.useContext(ConfigurationContext),
73184
73557
  currencyCode = _useContext.currencyCode;
73185
73558
 
73186
- var _useContext2 = react.useContext(ChangableAmountContext),
73187
- amount = _useContext2.amount,
73188
- amountsMissing = _useContext2.amountsMissing;
73559
+ var _useContext2 = react.useContext(PaymentContext),
73560
+ payment = _useContext2.payment,
73561
+ paymentState = _useContext2.paymentState;
73189
73562
 
73190
- var _useContext3 = react.useContext(PaymentContext),
73191
- payment = _useContext3.payment,
73192
- paymentState = _useContext3.paymentState,
73193
- pay = _useContext3.pay,
73194
- transaction = _useContext3.transaction,
73195
- approve = _useContext3.approve,
73196
- approvalTransaction = _useContext3.approvalTransaction;
73563
+ var _useContext3 = react.useContext(ChangableAmountContext),
73564
+ amount = _useContext3.amount,
73565
+ amountsMissing = _useContext3.amountsMissing;
73197
73566
 
73198
73567
  var _useContext4 = react.useContext(PaymentValueContext),
73199
73568
  paymentValue = _useContext4.paymentValue;
@@ -73201,78 +73570,15 @@ var PaymentOverviewDialog = (function (props) {
73201
73570
  var _useContext5 = react.useContext(NavigateStackContext_1),
73202
73571
  navigate = _useContext5.navigate;
73203
73572
 
73204
- var _useContext6 = react.useContext(ClosableContext),
73205
- close = _useContext6.close;
73206
-
73207
- var mainAction = function mainAction() {
73208
- if (paymentState == 'initialized' || paymentState == 'approving') {
73209
- return /*#__PURE__*/react.createElement("button", {
73210
- className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
73211
- onClick: function onClick() {
73212
- if (payment.route.approvalRequired && !payment.route.directTransfer) {
73213
- return;
73214
- }
73215
-
73216
- pay({
73217
- navigate: navigate
73218
- });
73219
- }
73220
- }, "Pay ", amount ? new Currency({
73221
- amount: amount.toFixed(2),
73222
- code: currencyCode
73223
- }).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
73224
- } else if (paymentState == 'paying') {
73225
- return /*#__PURE__*/react.createElement("a", {
73226
- className: "ButtonPrimary",
73227
- title: "Performing the payment - please wait",
73228
- href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
73229
- target: "_blank",
73230
- rel: "noopener noreferrer"
73231
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
73232
- } else if (paymentState == 'confirmed') {
73233
- return /*#__PURE__*/react.createElement("button", {
73234
- className: "ButtonPrimary round",
73235
- title: "Done",
73236
- onClick: close
73237
- }, /*#__PURE__*/react.createElement(Checkmark, null));
73238
- }
73239
- };
73240
-
73241
- var approvalAction = function approvalAction() {
73242
- if (paymentState == 'initialized') {
73243
- return /*#__PURE__*/react.createElement("div", {
73244
- className: "PaddingBottomS"
73245
- }, /*#__PURE__*/react.createElement("button", {
73246
- className: "ButtonPrimary wide",
73247
- onClick: approve,
73248
- title: "Allow ".concat(payment.symbol, " to be used as payment")
73249
- }, "Allow ", payment.symbol, " to be used as payment"));
73250
- } else if (paymentState == 'approving') {
73251
- return /*#__PURE__*/react.createElement("div", {
73252
- className: "PaddingBottomS"
73253
- }, /*#__PURE__*/react.createElement("a", {
73254
- className: "ButtonPrimary wide",
73255
- title: "Approving payment token - please wait",
73256
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
73257
- target: "_blank",
73258
- rel: "noopener noreferrer"
73259
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
73260
- }
73261
- };
73262
-
73263
- var actions = function actions() {
73264
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
73265
- };
73266
-
73267
73573
  if (payment == undefined || paymentValue == undefined) {
73268
73574
  return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
73269
73575
  }
73270
73576
 
73271
73577
  return /*#__PURE__*/react.createElement(Dialog, {
73272
73578
  header: /*#__PURE__*/react.createElement("div", {
73273
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73579
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73274
73580
  }, /*#__PURE__*/react.createElement("h1", {
73275
- className: "LineHeightL FontSizeL TextLeft"
73581
+ className: "LineHeightL FontSizeL"
73276
73582
  }, "Payment")),
73277
73583
  body: /*#__PURE__*/react.createElement("div", {
73278
73584
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73335,8 +73641,8 @@ var PaymentOverviewDialog = (function (props) {
73335
73641
  className: "CardAction"
73336
73642
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
73337
73643
  footer: /*#__PURE__*/react.createElement("div", {
73338
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73339
- }, actions())
73644
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73645
+ }, /*#__PURE__*/react.createElement(Footer, null))
73340
73646
  });
73341
73647
  });
73342
73648
 
@@ -73402,12 +73708,12 @@ var preflight$1 = /*#__PURE__*/function () {
73402
73708
 
73403
73709
  var Payment = /*#__PURE__*/function () {
73404
73710
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73405
- var accept, amount, event, sent, confirmed, ensured, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, document, unmount;
73711
+ var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
73406
73712
  return regenerator.wrap(function _callee2$(_context2) {
73407
73713
  while (1) {
73408
73714
  switch (_context2.prev = _context2.next) {
73409
73715
  case 0:
73410
- accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, ensured = _ref3.ensured, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, whitelist = _ref3.whitelist, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, document = _ref3.document;
73716
+ accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, whitelist = _ref3.whitelist, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, document = _ref3.document;
73411
73717
  _context2.prev = 1;
73412
73718
  _context2.next = 4;
73413
73719
  return preflight$1({
@@ -73433,15 +73739,15 @@ var Payment = /*#__PURE__*/function () {
73433
73739
  event: event,
73434
73740
  sent: sent,
73435
73741
  confirmed: confirmed,
73436
- ensured: ensured,
73437
73742
  failed: failed,
73438
73743
  whitelist: whitelist,
73439
73744
  blacklist: blacklist,
73440
- providers: providers
73745
+ providers: providers,
73746
+ track: track
73441
73747
  }
73442
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
73748
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73443
73749
  unmount: unmount
73444
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
73750
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73445
73751
  document: document,
73446
73752
  container: container,
73447
73753
  connected: connected,
@@ -73453,13 +73759,15 @@ var Payment = /*#__PURE__*/function () {
73453
73759
  whitelist: whitelist,
73454
73760
  blacklist: blacklist,
73455
73761
  event: event
73762
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
73763
+ document: ensureDocument(document)
73456
73764
  }, /*#__PURE__*/react.createElement(PaymentProvider, {
73457
73765
  container: container,
73458
73766
  document: document
73459
73767
  }, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
73460
73768
  document: document,
73461
73769
  container: container
73462
- })))))))))));
73770
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
73463
73771
  };
73464
73772
  });
73465
73773
  return _context2.abrupt("return", {
@@ -73569,9 +73877,9 @@ var SaleRoutingProvider = (function (props) {
73569
73877
  var SaleOverviewSkeleton = (function (props) {
73570
73878
  return /*#__PURE__*/react.createElement(Dialog, {
73571
73879
  header: /*#__PURE__*/react.createElement("div", {
73572
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73880
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73573
73881
  }, /*#__PURE__*/react.createElement("h1", {
73574
- className: "LineHeightL FontSizeL TextLeft"
73882
+ className: "LineHeightL FontSizeL"
73575
73883
  }, "Purchase")),
73576
73884
  body: /*#__PURE__*/react.createElement("div", {
73577
73885
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73588,7 +73896,7 @@ var SaleOverviewSkeleton = (function (props) {
73588
73896
  className: "SkeletonBackground"
73589
73897
  }))),
73590
73898
  footer: /*#__PURE__*/react.createElement("div", {
73591
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73899
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73592
73900
  }, /*#__PURE__*/react.createElement("div", {
73593
73901
  className: "SkeletonWrapper"
73594
73902
  }, /*#__PURE__*/react.createElement("div", {
@@ -73600,11 +73908,10 @@ var SaleOverviewSkeleton = (function (props) {
73600
73908
  });
73601
73909
 
73602
73910
  var SaleOverviewDialog = (function (props) {
73603
- var _useContext = react.useContext(ChangableAmountContext),
73604
- amount = _useContext.amount;
73911
+ var _useContext = react.useContext(ChangableAmountContext);
73912
+ _useContext.amount;
73605
73913
 
73606
73914
  var _useContext2 = react.useContext(ConfigurationContext),
73607
- currencyCode = _useContext2.currencyCode,
73608
73915
  tokenImage = _useContext2.tokenImage;
73609
73916
 
73610
73917
  var _useContext3 = react.useContext(PaymentValueContext),
@@ -73612,87 +73919,20 @@ var SaleOverviewDialog = (function (props) {
73612
73919
 
73613
73920
  var _useContext4 = react.useContext(PaymentContext),
73614
73921
  payment = _useContext4.payment,
73615
- paymentState = _useContext4.paymentState,
73616
- pay = _useContext4.pay,
73617
- transaction = _useContext4.transaction,
73618
- approve = _useContext4.approve,
73619
- approvalTransaction = _useContext4.approvalTransaction;
73922
+ paymentState = _useContext4.paymentState;
73620
73923
 
73621
73924
  var _useContext5 = react.useContext(NavigateStackContext_1),
73622
73925
  navigate = _useContext5.navigate;
73623
73926
 
73624
- var _useContext6 = react.useContext(ClosableContext),
73625
- close = _useContext6.close;
73626
-
73627
- var _useContext7 = react.useContext(ToTokenContext),
73628
- toToken = _useContext7.toToken,
73629
- toTokenReadableAmount = _useContext7.toTokenReadableAmount;
73927
+ var _useContext6 = react.useContext(ToTokenContext),
73928
+ toToken = _useContext6.toToken,
73929
+ toTokenReadableAmount = _useContext6.toTokenReadableAmount;
73630
73930
 
73631
73931
  var _useState = react.useState(),
73632
73932
  _useState2 = _slicedToArray(_useState, 2),
73633
73933
  salePerTokenValue = _useState2[0],
73634
73934
  setSalePerTokenValue = _useState2[1];
73635
73935
 
73636
- var mainAction = function mainAction() {
73637
- if (paymentState == 'initialized' || paymentState == 'approving') {
73638
- return /*#__PURE__*/react.createElement("button", {
73639
- className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
73640
- onClick: function onClick() {
73641
- if (payment.route.approvalRequired && !payment.route.directTransfer) {
73642
- return;
73643
- }
73644
-
73645
- pay({
73646
- navigate: navigate
73647
- });
73648
- }
73649
- }, "Pay ", new Currency({
73650
- amount: amount.toFixed(2),
73651
- code: currencyCode
73652
- }).toString());
73653
- } else if (paymentState == 'paying') {
73654
- return /*#__PURE__*/react.createElement("a", {
73655
- className: "ButtonPrimary",
73656
- title: "Performing the payment - please wait",
73657
- href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
73658
- target: "_blank",
73659
- rel: "noopener noreferrer"
73660
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
73661
- } else if (paymentState == 'confirmed') {
73662
- return /*#__PURE__*/react.createElement("button", {
73663
- className: "ButtonPrimary round",
73664
- title: "Done",
73665
- onClick: close
73666
- }, /*#__PURE__*/react.createElement(Checkmark, null));
73667
- }
73668
- };
73669
-
73670
- var approvalAction = function approvalAction() {
73671
- if (paymentState == 'initialized') {
73672
- return /*#__PURE__*/react.createElement("div", {
73673
- className: "PaddingBottomS"
73674
- }, /*#__PURE__*/react.createElement("button", {
73675
- className: "ButtonPrimary wide",
73676
- onClick: approve,
73677
- title: "Allow ".concat(payment.symbol, " to be used as payment")
73678
- }, "Allow ", payment.symbol, " to be used as payment"));
73679
- } else if (paymentState == 'approving') {
73680
- return /*#__PURE__*/react.createElement("div", {
73681
- className: "PaddingBottomS"
73682
- }, /*#__PURE__*/react.createElement("a", {
73683
- className: "ButtonPrimary wide",
73684
- title: "Approving payment token - please wait",
73685
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
73686
- target: "_blank",
73687
- rel: "noopener noreferrer"
73688
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
73689
- }
73690
- };
73691
-
73692
- var actions = function actions() {
73693
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
73694
- };
73695
-
73696
73936
  react.useEffect(function () {
73697
73937
  if (paymentValue) {
73698
73938
  setSalePerTokenValue(new Currency({
@@ -73721,9 +73961,9 @@ var SaleOverviewDialog = (function (props) {
73721
73961
 
73722
73962
  return /*#__PURE__*/react.createElement(Dialog, {
73723
73963
  header: /*#__PURE__*/react.createElement("div", {
73724
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73964
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73725
73965
  }, /*#__PURE__*/react.createElement("h1", {
73726
- className: "LineHeightL FontSizeL TextLeft"
73966
+ className: "LineHeightL FontSizeL"
73727
73967
  }, "Purchase")),
73728
73968
  body: /*#__PURE__*/react.createElement("div", {
73729
73969
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73792,8 +74032,8 @@ var SaleOverviewDialog = (function (props) {
73792
74032
  className: "CardAction"
73793
74033
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
73794
74034
  footer: /*#__PURE__*/react.createElement("div", {
73795
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73796
- }, actions())
74035
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
74036
+ }, /*#__PURE__*/react.createElement(Footer, null))
73797
74037
  });
73798
74038
  });
73799
74039
 
@@ -73866,12 +74106,12 @@ var preflight = /*#__PURE__*/function () {
73866
74106
 
73867
74107
  var Sale = /*#__PURE__*/function () {
73868
74108
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73869
- var amount, sell, sent, confirmed, ensured, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
74109
+ var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
73870
74110
  return regenerator.wrap(function _callee2$(_context2) {
73871
74111
  while (1) {
73872
74112
  switch (_context2.prev = _context2.next) {
73873
74113
  case 0:
73874
- amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed, ensured = _ref3.ensured, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, tokenImage = _ref3.tokenImage, document = _ref3.document;
74114
+ amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, tokenImage = _ref3.tokenImage, document = _ref3.document;
73875
74115
  _context2.prev = 1;
73876
74116
  _context2.next = 4;
73877
74117
  return preflight({
@@ -73903,26 +74143,27 @@ var Sale = /*#__PURE__*/function () {
73903
74143
  currency: currency,
73904
74144
  sent: sent,
73905
74145
  confirmed: confirmed,
73906
- ensured: ensured,
73907
74146
  failed: failed,
73908
74147
  blacklist: blacklist,
73909
74148
  providers: providers
73910
74149
  }
73911
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
74150
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73912
74151
  unmount: unmount
73913
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
74152
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73914
74153
  container: container,
73915
74154
  connected: connected,
73916
74155
  unmount: unmount
73917
74156
  }, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
73918
74157
  accept: accept
74158
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
74159
+ document: ensureDocument(document)
73919
74160
  }, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
73920
74161
  container: container,
73921
74162
  document: document
73922
74163
  }, /*#__PURE__*/react.createElement(SaleStack, {
73923
74164
  document: document,
73924
74165
  container: container
73925
- })))))))));
74166
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
73926
74167
  };
73927
74168
  });
73928
74169
  return _context2.abrupt("return", {