@rango-dev/widget-embedded 0.56.1-next.5 → 0.56.1-next.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.56.1-next.5",
3
+ "version": "0.56.1-next.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -30,7 +30,7 @@
30
30
  "@rango-dev/queue-manager-rango-preset": "^0.58.1-next.0",
31
31
  "@rango-dev/queue-manager-react": "^0.33.0",
32
32
  "@rango-dev/signer-solana": "^0.46.1",
33
- "@rango-dev/ui": "^0.59.1-next.1",
33
+ "@rango-dev/ui": "^0.59.1-next.2",
34
34
  "@rango-dev/wallets-core": "^0.55.1-next.0",
35
35
  "@rango-dev/wallets-react": "^0.42.1-next.1",
36
36
  "@rango-dev/wallets-shared": "^0.56.1-next.0",
@@ -5,6 +5,7 @@ import type { SwapResult } from 'rango-sdk';
5
5
  import { i18n } from '@lingui/core';
6
6
  import {
7
7
  Alert,
8
+ CampaignQuoteTag,
8
9
  Divider,
9
10
  FullExpandedQuote,
10
11
  InfoIcon,
@@ -110,6 +111,10 @@ export function Quote(props: QuoteProps) {
110
111
  USD_VALUE_MAX_DECIMALS
111
112
  )
112
113
  : '';
114
+ const {
115
+ config: { __UNSTABLE_OR_INTERNAL__ },
116
+ } = useAppStore();
117
+
113
118
  const priceImpact = getPriceImpact(input.usdValue, output.usdValue ?? null);
114
119
  const percentageChange = numberToString(
115
120
  priceImpact,
@@ -350,6 +355,7 @@ export function Quote(props: QuoteProps) {
350
355
  tooltipContainer={getExpanded()}
351
356
  steps={steps}
352
357
  tags={sortedQuoteTags}
358
+ campaignTag={__UNSTABLE_OR_INTERNAL__?.campaignTag}
353
359
  id="widget-quote-full-expanded-quote-container"
354
360
  quoteCost={
355
361
  <QuoteCostDetails
@@ -384,9 +390,18 @@ export function Quote(props: QuoteProps) {
384
390
  <TagContainer>
385
391
  {sortedQuoteTags.map((tag, index) => {
386
392
  const key = `${tag.value}_${index}`;
393
+
387
394
  return (
388
395
  <React.Fragment key={key}>
389
- <QuoteTag label={tag.label} value={tag.value} />
396
+ {tag.value == 'CAMPAIGN' &&
397
+ __UNSTABLE_OR_INTERNAL__?.campaignTag ? (
398
+ <CampaignQuoteTag
399
+ routeTag={tag}
400
+ {...__UNSTABLE_OR_INTERNAL__.campaignTag}
401
+ />
402
+ ) : (
403
+ <QuoteTag label={tag.label} value={tag.value} />
404
+ )}
390
405
  <Divider size={4} direction="horizontal" />
391
406
  </React.Fragment>
392
407
  );
@@ -43,6 +43,9 @@ export function Quotes(props: PropTypes) {
43
43
  const container = propContainer || getContainer();
44
44
  const hasQuotes = !!quotes && quotes.results.length;
45
45
  const userSlippage = customSlippage ?? slippage;
46
+ const {
47
+ config: { __UNSTABLE_OR_INTERNAL__ },
48
+ } = useAppStore();
46
49
  const getQuoteWarning = (quote: MultiRouteSimulationResult) => {
47
50
  if (!fromToken || !toToken || !quotes) {
48
51
  return null;
@@ -85,7 +88,10 @@ export function Quotes(props: PropTypes) {
85
88
  Array.from({ length: ITEM_SKELETON_COUNT }, (_, index) => (
86
89
  <React.Fragment key={index}>
87
90
  {fullExpandedMode ? (
88
- <FullExpandedQuote loading />
91
+ <FullExpandedQuote
92
+ campaignTag={__UNSTABLE_OR_INTERNAL__?.campaignTag}
93
+ loading
94
+ />
89
95
  ) : (
90
96
  <QuoteSkeleton
91
97
  tagHidden={false}
@@ -275,6 +275,13 @@ export type WidgetConfig = {
275
275
  __UNSTABLE_OR_INTERNAL__?: {
276
276
  walletConnectListedDesktopWalletLink?: string;
277
277
  autoUpdateSettings?: boolean; // If true, settings will be updated automatically based on the configuration.
278
+ campaignTag?: {
279
+ backgroundUrl: string;
280
+ linkUrl: string;
281
+ iconUrl: string;
282
+ title: string;
283
+ id: string;
284
+ };
278
285
  swapBoxBanner?: {
279
286
  element: ReactElement;
280
287
  routes?: string[];