@rango-dev/widget-embedded 0.1.11-next.22 → 0.1.11-next.24
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/dist/App.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +2 -2
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib.d.ts +4 -2
- package/dist/lib.d.ts.map +1 -1
- package/dist/types/config.d.ts +77 -9
- package/dist/types/config.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +8 -2
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +8 -2
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +3 -2
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/App.tsx +1 -15
- package/src/hooks/useTheme.ts +2 -2
- package/src/index.tsx +1 -1
- package/src/lib.tsx +6 -14
- package/src/types/config.ts +78 -12
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["src/App.tsx"],"names":[],"mappings":";AAIA,OAAO,WAAW,CAAC;AAenB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,QAAQ,CAAC;AAOhB,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["src/App.tsx"],"names":[],"mappings":";AAIA,OAAO,WAAW,CAAC;AAenB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,QAAQ,CAAC;AAOhB,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,eA4F1C"}
|
package/dist/hooks/useTheme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useTheme({ colors: themeColors, fontFamily, borderRadius, mode, }:
|
|
1
|
+
import { WidgetTheme } from '../types';
|
|
2
|
+
export declare function useTheme({ colors: themeColors, fontFamily, borderRadius, mode, }: WidgetTheme): {
|
|
3
3
|
activeTheme: any;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/hooks/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/hooks/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EAAE,WAAW,EACnB,UAAoB,EACpB,YAAgB,EAChB,IAAa,GACd,EAAE,WAAW;;EA6Hb"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Widget } from './lib';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC"}
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
+
import { WidgetTheme, WidgetConfig, WidgetColors, BlockchainAndTokenConfig } from './types';
|
|
3
4
|
import './i18n';
|
|
5
|
+
export { WidgetConfig, WalletType, WidgetTheme, WidgetColors, BlockchainAndTokenConfig };
|
|
4
6
|
export declare type WidgetProps = {
|
|
5
7
|
config?: WidgetConfig;
|
|
6
8
|
};
|
|
7
|
-
export declare const
|
|
9
|
+
export declare const Widget: React.FC<WidgetProps>;
|
|
8
10
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["src/lib.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["src/lib.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAW,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAUhE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAE5F,OAAO,QAAQ,CAAC;AAOhB,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAG,wBAAwB,EAAC,CAAA;AAEvF,oBAAY,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAuGxC,CAAC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,38 +1,106 @@
|
|
|
1
1
|
import { Asset } from 'rango-sdk';
|
|
2
2
|
import { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The above type defines a set of optional color properties for a widget.
|
|
5
|
+
* @property {string} background
|
|
6
|
+
* @property {string} foreground
|
|
7
|
+
* @property {string} primary
|
|
8
|
+
* @property {string} success
|
|
9
|
+
* @property {string} error
|
|
10
|
+
* @property {string} warning
|
|
11
|
+
*/
|
|
12
|
+
export declare type WidgetColors = {
|
|
4
13
|
background?: string;
|
|
5
|
-
primary?: string;
|
|
6
14
|
foreground?: string;
|
|
15
|
+
primary?: string;
|
|
7
16
|
success?: string;
|
|
8
17
|
error?: string;
|
|
9
18
|
warning?: string;
|
|
10
19
|
};
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The `WidgetTheme` defines the properties of a widget theme, including mode, font family, colors, border
|
|
22
|
+
* radius, width, and height.
|
|
23
|
+
* @property {'auto' | 'light' | 'dark'} mode - The mode property is used to specify the default theme for
|
|
24
|
+
* the widget.
|
|
25
|
+
* @property {string} fontFamily - The font family to be used in the widget.
|
|
26
|
+
* @property {Colors} colors - The `colors` property is a sub-property of the `WidgetTheme` object that
|
|
27
|
+
* defines the color scheme for the widget. It is of type `Colors`, which is likely another object that
|
|
28
|
+
* contains specific color values for various parts of the widget (e.g. background color, text color,
|
|
29
|
+
* border color
|
|
30
|
+
* @property {number} borderRadius - `borderRadius` is a property of the `WidgetTheme` type that
|
|
31
|
+
* specifies the radius of the corners of a widget.
|
|
32
|
+
* @property {number} width - The `width` property is a number that represents the width of the widget.
|
|
33
|
+
* @property {number} height - The `height` property is a number that specifies the height of the widget.
|
|
34
|
+
*/
|
|
35
|
+
export declare type WidgetTheme = {
|
|
36
|
+
mode?: 'auto' | 'light' | 'dark';
|
|
13
37
|
fontFamily?: string;
|
|
14
|
-
colors?:
|
|
38
|
+
colors?: WidgetColors;
|
|
15
39
|
borderRadius?: number;
|
|
16
40
|
width?: number;
|
|
17
41
|
height?: number;
|
|
18
42
|
};
|
|
19
|
-
|
|
43
|
+
/**
|
|
44
|
+
* `BlockchainAndTokenConfig`
|
|
45
|
+
*
|
|
46
|
+
* @property {string} blockchain - This property is optional and represents the default selected blockchain.
|
|
47
|
+
* @property {Asset} token - The `token` property is a type of `Asset` and represents the default token
|
|
48
|
+
* which is selected. e.g. {blockchain: 'BSC', symbol: 'BNB', address: null}
|
|
49
|
+
* @property {string[]} blockchains - An optional array of strings representing the supported
|
|
50
|
+
* blockchains. e.g. ['BSC','ETHEREUM']
|
|
51
|
+
* @property {Asset[]} tokens - The `tokens` property is an optional array of `Asset` objects that
|
|
52
|
+
* you could use that to limit tokens to some limited ones.
|
|
53
|
+
*/
|
|
54
|
+
export declare type BlockchainAndTokenConfig = {
|
|
20
55
|
blockchain?: string;
|
|
21
56
|
token?: Asset;
|
|
22
57
|
blockchains?: string[];
|
|
23
58
|
tokens?: Asset[];
|
|
24
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* The type WidgetConfig defines the configuration options for a widget, including API key, affiliate
|
|
62
|
+
* reference, amount, blockchain and token configurations, liquidity sources, wallet types, language,
|
|
63
|
+
* and theme.
|
|
64
|
+
*
|
|
65
|
+
* @property {string} apiKey - The API key used to communicate with Rango API
|
|
66
|
+
* @property {string} affiliateRef - The affiliate reference is an optional string property in the
|
|
67
|
+
* WidgetConfig type. It is used to set and track referrals or affiliations for the dApps.
|
|
68
|
+
* @property {number} amount - The default input amount.
|
|
69
|
+
* @property {BlockchainAndTokenConfig} from - The `from` property is an optional property of type
|
|
70
|
+
* `BlockchainAndTokenConfig` that specifies the default blockchain and token from which the user wants to
|
|
71
|
+
* exchange.It can also used to limit source swap blockchains/tokens to some limited ones.
|
|
72
|
+
* @property {BlockchainAndTokenConfig} to - The "to" property is an optional property of type
|
|
73
|
+
* "BlockchainAndTokenConfig" that specifies the default blockchain and token to which the user wants to
|
|
74
|
+
* exchange.It can also used to limit destination swap blockchains/tokens to some limited ones.
|
|
75
|
+
* blockchain during the transaction.
|
|
76
|
+
* @property {string[]} liquiditySources - The `liquiditySources` property is an optional array of
|
|
77
|
+
* strings that specifies the liquidity sources allowed dexes and bridges for the routing
|
|
78
|
+
* @property {WalletType[]} wallets - The `wallets` property is an optional array of `WalletType`
|
|
79
|
+
* values that represent the types of wallets that the widget should support. For example, it could
|
|
80
|
+
* include values like `"metamask"`, `"kepler"`, or `"phantom"`.
|
|
81
|
+
* @property {boolean} multiWallets - The `multiWallets` property is a boolean value that indicates
|
|
82
|
+
* whether the widget should allow the user to select multiple wallets for the transaction.
|
|
83
|
+
* @property {boolean} customAddress - A boolean value indicating whether the user can input a custom
|
|
84
|
+
* address for the transaction. If set to true, the widget will allow the user to input a custom
|
|
85
|
+
* address for the destination.
|
|
86
|
+
* @property {string} language - The language property is an optional string that specifies the
|
|
87
|
+
* default language in which the widget should be displayed. If not provided, the widget will default to the
|
|
88
|
+
* language of the user's browser.
|
|
89
|
+
* @property {WidgetTheme} theme - The `theme` property is a part of the `WidgetConfig` type and is
|
|
90
|
+
* used to specify the visual theme of the widget. It is of type `WidgetTheme`, which is an interface
|
|
91
|
+
* that defines the various properties of the theme, such as colors, fonts, and others.
|
|
92
|
+
*/
|
|
25
93
|
export declare type WidgetConfig = {
|
|
26
94
|
apiKey: string;
|
|
27
95
|
affiliateRef?: string;
|
|
28
96
|
amount?: number;
|
|
29
|
-
from?:
|
|
30
|
-
to?:
|
|
97
|
+
from?: BlockchainAndTokenConfig;
|
|
98
|
+
to?: BlockchainAndTokenConfig;
|
|
31
99
|
liquiditySources?: string[];
|
|
32
100
|
wallets?: WalletType[];
|
|
33
101
|
multiWallets?: boolean;
|
|
34
102
|
customAddress?: boolean;
|
|
35
103
|
language?: string;
|
|
36
|
-
theme?:
|
|
104
|
+
theme?: WidgetTheme;
|
|
37
105
|
};
|
|
38
106
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,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E,wBAAwB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC"}
|
|
@@ -3400,7 +3400,7 @@ function QueueManager(props) {
|
|
|
3400
3400
|
}, props.children);
|
|
3401
3401
|
}
|
|
3402
3402
|
|
|
3403
|
-
const
|
|
3403
|
+
const Widget = _ref => {
|
|
3404
3404
|
let {
|
|
3405
3405
|
config
|
|
3406
3406
|
} = _ref;
|
|
@@ -3484,5 +3484,11 @@ const SwapBox = _ref => {
|
|
|
3484
3484
|
}))))));
|
|
3485
3485
|
};
|
|
3486
3486
|
|
|
3487
|
-
exports
|
|
3487
|
+
Object.defineProperty(exports, 'WalletType', {
|
|
3488
|
+
enumerable: true,
|
|
3489
|
+
get: function () {
|
|
3490
|
+
return walletsShared.WalletType;
|
|
3491
|
+
}
|
|
3492
|
+
});
|
|
3493
|
+
exports.Widget = Widget;
|
|
3488
3494
|
//# sourceMappingURL=widget-embedded.cjs.development.js.map
|