@depay/widgets 11.5.0 → 11.6.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.
@@ -0,0 +1,184 @@
1
+ declare namespace DePayWidgets {
2
+
3
+ interface ColorsOptions {
4
+ primary?: string;
5
+ text?: string;
6
+ buttonText?: string;
7
+ icons?: string;
8
+ }
9
+
10
+ interface StyleOptions {
11
+ colors?: ColorsOptions;
12
+ fontFamily?: string;
13
+ css?: string;
14
+ }
15
+
16
+ interface AcceptOptions {
17
+ blockchain: string;
18
+ token: string;
19
+ receiver: string;
20
+ amount?: number;
21
+ fee?: {
22
+ amount: string;
23
+ receiver: string;
24
+ };
25
+ }
26
+
27
+ interface BlockchainStringListOptions {
28
+ ethereum?: string[];
29
+ bsc?: string[];
30
+ polygon?: string[];
31
+ solana?: string[];
32
+ }
33
+
34
+ interface BlockchainStringOptions {
35
+ ethereum?: string;
36
+ bsc?: string;
37
+ polygon?: string;
38
+ solana?: string;
39
+ }
40
+
41
+ interface PaymentOptions {
42
+ accept: AcceptOptions[];
43
+ amount?: {
44
+ currency?: string;
45
+ fix?: number;
46
+ };
47
+ sent?: (transaction: any) => void;
48
+ succeeded?: (transaction: any) => void;
49
+ validated?: (successful: boolean, transaction: any) => void;
50
+ failed?: (transaction: any) => void;
51
+ error?: (error: any) => void;
52
+ critical?: (error: any) => void;
53
+ style?: StyleOptions;
54
+ whitelist?: BlockchainStringListOptions;
55
+ blacklist?: BlockchainStringListOptions;
56
+ providers?: BlockchainStringListOptions;
57
+ currency?: string;
58
+ connected?: (address: string) => void;
59
+ closed?: () => void;
60
+ track?: {
61
+ endpoint?: string;
62
+ method?: (payment: any) => void;
63
+ poll?: {
64
+ endpoint?: string;
65
+ method?: (payment: any) => void;
66
+ };
67
+ };
68
+ recover?: {
69
+ blockchain: string;
70
+ transaction: string;
71
+ sender: string;
72
+ nonce: number;
73
+ afterBlock: number;
74
+ token: string;
75
+ amount: number;
76
+ };
77
+ closable?: boolean;
78
+ integration?: string;
79
+ container?: HTMLElement;
80
+ before?: (payment: any) => Promise<void>;
81
+ wallet?: any;
82
+ title?: string;
83
+ action?: string;
84
+ document?: HTMLElement;
85
+ }
86
+
87
+ interface PaymentResponse {
88
+ unmount: () => void;
89
+ }
90
+
91
+ const Payment: (options: PaymentOptions) => Promise<PaymentResponse>;
92
+
93
+ interface ConnectOptions {
94
+ style?: StyleOptions;
95
+ error?: (error: any) => void;
96
+ document?: HTMLElement;
97
+ }
98
+
99
+ interface ConnectResponse {
100
+ account: string;
101
+ wallet: any;
102
+ }
103
+
104
+ const Connect: (options: ConnectOptions) => Promise<ConnectResponse>;
105
+
106
+ interface LoginOptions {
107
+ message: string;
108
+ endpoint?: string;
109
+ recover?: (message: string, signature: string) => void;
110
+ wallet?: any;
111
+ style?: StyleOptions;
112
+ error?: (error: any) => void;
113
+ document?: HTMLElement;
114
+ }
115
+
116
+ interface LoginResponse {
117
+ account: string;
118
+ wallet: any;
119
+ }
120
+
121
+ const Login: (options: LoginOptions) => Promise<LoginResponse>;
122
+
123
+ interface SaleOptions {
124
+ sell: BlockchainStringOptions;
125
+ amount?: {
126
+ start?: number;
127
+ min?: number;
128
+ step?: number;
129
+ token?: boolean;
130
+ };
131
+ sent?: (transaction: any) => void;
132
+ succeeded?: (transaction: any) => void;
133
+ failed?: (transaction: any) => void;
134
+ error?: (error: any) => void;
135
+ critical?: (error: any) => void;
136
+ style?: StyleOptions;
137
+ blacklist?: BlockchainStringListOptions;
138
+ providers?: BlockchainStringListOptions;
139
+ currency?: string;
140
+ connected?: (address: string) => void;
141
+ closed?: () => void;
142
+ tokenImage: string;
143
+ closable?: boolean;
144
+ integration?: string;
145
+ wallet?: any;
146
+ document?: HTMLElement;
147
+ }
148
+
149
+ interface SaleResponse {
150
+ unmount: () => void;
151
+ }
152
+
153
+ const Sale: (options: SaleOptions) => Promise<SaleResponse>;
154
+
155
+ interface SelectOptions {
156
+ what: string;
157
+ style?: StyleOptions;
158
+ error?: (error: any) => void;
159
+ document?: HTMLElement;
160
+ }
161
+
162
+ const Select: (options: SelectOptions) => Promise<any>;
163
+
164
+ interface LoadingOptions {
165
+ text: string;
166
+ style?: StyleOptions;
167
+ error?: (error: any) => void;
168
+ critical?: (error: any) => void;
169
+ document?: HTMLElement;
170
+ }
171
+
172
+ const Loading: (options: LoadingOptions) => Promise<any>;
173
+ }
174
+
175
+ declare const DePayWidgets: {
176
+ Connect: DePayWidgets.Connect;
177
+ Login: DePayWidgets.Login;
178
+ Payment: DePayWidgets.Payment;
179
+ Sale: DePayWidgets.Sale;
180
+ Select: DePayWidgets.Select;
181
+ Loading: DePayWidgets.Loading;
182
+ };
183
+
184
+ export default DePayWidgets;
@@ -0,0 +1,184 @@
1
+ declare namespace DePayWidgets {
2
+
3
+ interface ColorsOptions {
4
+ primary?: string;
5
+ text?: string;
6
+ buttonText?: string;
7
+ icons?: string;
8
+ }
9
+
10
+ interface StyleOptions {
11
+ colors?: ColorsOptions;
12
+ fontFamily?: string;
13
+ css?: string;
14
+ }
15
+
16
+ interface AcceptOptions {
17
+ blockchain: string;
18
+ token: string;
19
+ receiver: string;
20
+ amount?: number;
21
+ fee?: {
22
+ amount: string;
23
+ receiver: string;
24
+ };
25
+ }
26
+
27
+ interface BlockchainStringListOptions {
28
+ ethereum?: string[];
29
+ bsc?: string[];
30
+ polygon?: string[];
31
+ solana?: string[];
32
+ }
33
+
34
+ interface BlockchainStringOptions {
35
+ ethereum?: string;
36
+ bsc?: string;
37
+ polygon?: string;
38
+ solana?: string;
39
+ }
40
+
41
+ interface PaymentOptions {
42
+ accept: AcceptOptions[];
43
+ amount?: {
44
+ currency?: string;
45
+ fix?: number;
46
+ };
47
+ sent?: (transaction: any) => void;
48
+ succeeded?: (transaction: any) => void;
49
+ validated?: (successful: boolean, transaction: any) => void;
50
+ failed?: (transaction: any) => void;
51
+ error?: (error: any) => void;
52
+ critical?: (error: any) => void;
53
+ style?: StyleOptions;
54
+ whitelist?: BlockchainStringListOptions;
55
+ blacklist?: BlockchainStringListOptions;
56
+ providers?: BlockchainStringListOptions;
57
+ currency?: string;
58
+ connected?: (address: string) => void;
59
+ closed?: () => void;
60
+ track?: {
61
+ endpoint?: string;
62
+ method?: (payment: any) => void;
63
+ poll?: {
64
+ endpoint?: string;
65
+ method?: (payment: any) => void;
66
+ };
67
+ };
68
+ recover?: {
69
+ blockchain: string;
70
+ transaction: string;
71
+ sender: string;
72
+ nonce: number;
73
+ afterBlock: number;
74
+ token: string;
75
+ amount: number;
76
+ };
77
+ closable?: boolean;
78
+ integration?: string;
79
+ container?: HTMLElement;
80
+ before?: (payment: any) => Promise<void>;
81
+ wallet?: any;
82
+ title?: string;
83
+ action?: string;
84
+ document?: HTMLElement;
85
+ }
86
+
87
+ interface PaymentResponse {
88
+ unmount: () => void;
89
+ }
90
+
91
+ const Payment: (options: PaymentOptions) => Promise<PaymentResponse>;
92
+
93
+ interface ConnectOptions {
94
+ style?: StyleOptions;
95
+ error?: (error: any) => void;
96
+ document?: HTMLElement;
97
+ }
98
+
99
+ interface ConnectResponse {
100
+ account: string;
101
+ wallet: any;
102
+ }
103
+
104
+ const Connect: (options: ConnectOptions) => Promise<ConnectResponse>;
105
+
106
+ interface LoginOptions {
107
+ message: string;
108
+ endpoint?: string;
109
+ recover?: (message: string, signature: string) => void;
110
+ wallet?: any;
111
+ style?: StyleOptions;
112
+ error?: (error: any) => void;
113
+ document?: HTMLElement;
114
+ }
115
+
116
+ interface LoginResponse {
117
+ account: string;
118
+ wallet: any;
119
+ }
120
+
121
+ const Login: (options: LoginOptions) => Promise<LoginResponse>;
122
+
123
+ interface SaleOptions {
124
+ sell: BlockchainStringOptions;
125
+ amount?: {
126
+ start?: number;
127
+ min?: number;
128
+ step?: number;
129
+ token?: boolean;
130
+ };
131
+ sent?: (transaction: any) => void;
132
+ succeeded?: (transaction: any) => void;
133
+ failed?: (transaction: any) => void;
134
+ error?: (error: any) => void;
135
+ critical?: (error: any) => void;
136
+ style?: StyleOptions;
137
+ blacklist?: BlockchainStringListOptions;
138
+ providers?: BlockchainStringListOptions;
139
+ currency?: string;
140
+ connected?: (address: string) => void;
141
+ closed?: () => void;
142
+ tokenImage: string;
143
+ closable?: boolean;
144
+ integration?: string;
145
+ wallet?: any;
146
+ document?: HTMLElement;
147
+ }
148
+
149
+ interface SaleResponse {
150
+ unmount: () => void;
151
+ }
152
+
153
+ const Sale: (options: SaleOptions) => Promise<SaleResponse>;
154
+
155
+ interface SelectOptions {
156
+ what: string;
157
+ style?: StyleOptions;
158
+ error?: (error: any) => void;
159
+ document?: HTMLElement;
160
+ }
161
+
162
+ const Select: (options: SelectOptions) => Promise<any>;
163
+
164
+ interface LoadingOptions {
165
+ text: string;
166
+ style?: StyleOptions;
167
+ error?: (error: any) => void;
168
+ critical?: (error: any) => void;
169
+ document?: HTMLElement;
170
+ }
171
+
172
+ const Loading: (options: LoadingOptions) => Promise<any>;
173
+ }
174
+
175
+ declare const DePayWidgets: {
176
+ Connect: DePayWidgets.Connect;
177
+ Login: DePayWidgets.Login;
178
+ Payment: DePayWidgets.Payment;
179
+ Sale: DePayWidgets.Sale;
180
+ Select: DePayWidgets.Select;
181
+ Loading: DePayWidgets.Loading;
182
+ };
183
+
184
+ export default DePayWidgets;
@@ -23050,13 +23050,17 @@
23050
23050
  }
23051
23051
 
23052
23052
  componentDidMount() {
23053
- this.setState({ open: false }, () => {
23053
+ if(this.props.animate === false) {
23054
+ this.setState({ open: true });
23055
+ } else {
23054
23056
  // make sure state is false first before opening the dialog
23055
23057
  // to ensure opening is animated
23056
- setTimeout(() => {
23057
- this.setState({ open: true });
23058
- }, 10);
23059
- });
23058
+ this.setState({ open: false }, () => {
23059
+ setTimeout(() => {
23060
+ this.setState({ open: true });
23061
+ }, 10);
23062
+ });
23063
+ }
23060
23064
  this.props.document.addEventListener('keydown', this.handler, true);
23061
23065
  }
23062
23066
 
@@ -23068,10 +23072,10 @@
23068
23072
  const classNames = ['ReactDialog', this.state.open ? 'ReactDialogOpen' : ''];
23069
23073
  const style = ReactDialogStyle({ background: this.props.background });
23070
23074
  return (
23071
- React__default["default"].createElement('div', { key: this.props.dialogKey, className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 55}}
23072
- , React__default["default"].createElement('style', {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 56}}, style)
23073
- , React__default["default"].createElement('div', { className: "ReactDialogInner", __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 57}}
23074
- , React__default["default"].createElement('div', { className: "ReactDialogBackground", onClick: this.onClickBackground.bind(this), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 58}} )
23075
+ React__default["default"].createElement('div', { key: this.props.dialogKey, className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 59}}
23076
+ , React__default["default"].createElement('style', {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 60}}, style)
23077
+ , React__default["default"].createElement('div', { className: "ReactDialogInner", __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 61}}
23078
+ , React__default["default"].createElement('div', { className: "ReactDialogBackground", onClick: this.onClickBackground.bind(this), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 62}} )
23075
23079
  , this.props.children
23076
23080
  )
23077
23081
  )
@@ -23108,7 +23112,8 @@
23108
23112
  background: this.props.background,
23109
23113
  close: this.props.close,
23110
23114
  document: _document,
23111
- open: this.props.open, __self: this, __source: {fileName: _jsxFileName, lineNumber: 29}}
23115
+ open: this.props.open,
23116
+ animate: this.props.animate, __self: this, __source: {fileName: _jsxFileName, lineNumber: 29}}
23112
23117
 
23113
23118
  , this.props.children
23114
23119
  ),