@directcryptopay/sdk 0.2.4 → 0.3.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.
Files changed (127) hide show
  1. package/README.md +51 -87
  2. package/dist/core/config.d.ts +9 -46
  3. package/dist/core/iframe.d.ts +16 -0
  4. package/dist/dcp-sdk.umd.js +1 -12811
  5. package/dist/dcp.d.ts +12 -5
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +219 -2
  8. package/dist/types.d.ts +26 -164
  9. package/package.json +3 -13
  10. package/dist/ExchangeController-CbO41bcH.js +0 -217
  11. package/dist/HelpersUtil-DHm6EVSE.js +0 -120
  12. package/dist/NavigationUtil-kj9LEOOd.js +0 -8
  13. package/dist/PhArrowCircleDown-lsK25DCk.js +0 -73
  14. package/dist/PhArrowClockwise-NeKHZ1co.js +0 -73
  15. package/dist/PhArrowDown-C9AkNvLs.js +0 -73
  16. package/dist/PhArrowLeft-RNfIQP1X.js +0 -73
  17. package/dist/PhArrowRight-DM1tna0G.js +0 -73
  18. package/dist/PhArrowSquareOut-S5XYbAZj.js +0 -73
  19. package/dist/PhArrowUp-DmktzOWy.js +0 -73
  20. package/dist/PhArrowUpRight-BkNeW_5i.js +0 -73
  21. package/dist/PhArrowsClockwise-CQ4pG76b.js +0 -73
  22. package/dist/PhArrowsDownUp-H6gxaNM6.js +0 -73
  23. package/dist/PhArrowsLeftRight-DZSsfMR6.js +0 -73
  24. package/dist/PhBank-4_9QzqIB.js +0 -73
  25. package/dist/PhBrowser-B-JSznId.js +0 -73
  26. package/dist/PhCaretDown-vV5oHMNi.js +0 -73
  27. package/dist/PhCaretLeft-BLo6Y_f4.js +0 -73
  28. package/dist/PhCaretRight-CqQN4TT3.js +0 -73
  29. package/dist/PhCaretUp-Df7UCAHy.js +0 -73
  30. package/dist/PhCheck-gtpfK4ed.js +0 -73
  31. package/dist/PhCircleHalf-Uq7dwDYw.js +0 -73
  32. package/dist/PhClock-SDCW-NmF.js +0 -73
  33. package/dist/PhCompass-B7hgtdx-.js +0 -73
  34. package/dist/PhCopy-BcnhyXCy.js +0 -73
  35. package/dist/PhCreditCard-BJjByVgu.js +0 -73
  36. package/dist/PhCurrencyDollar-B7ZXqXBy.js +0 -73
  37. package/dist/PhDesktop-B3VKPuJx.js +0 -73
  38. package/dist/PhDeviceMobile-Bnd0TYEH.js +0 -73
  39. package/dist/PhDotsThree-yyMWyZ-R.js +0 -73
  40. package/dist/PhEnvelope-67uzHbI9.js +0 -73
  41. package/dist/PhFunnelSimple-B-DCsloI.js +0 -73
  42. package/dist/PhGlobe-TMm_6qGk.js +0 -73
  43. package/dist/PhIdentificationCard-CePPD2xc.js +0 -73
  44. package/dist/PhImage-gY96WtHR.js +0 -73
  45. package/dist/PhInfo-DRQM_ZDP.js +0 -73
  46. package/dist/PhLightbulb-B0TxPfZ1.js +0 -73
  47. package/dist/PhMagnifyingGlass-B8si5_6W.js +0 -73
  48. package/dist/PhPaperPlaneRight-DVu5PLYd.js +0 -73
  49. package/dist/PhPlus-BfTsQnUz.js +0 -73
  50. package/dist/PhPower-CxYUGOWn.js +0 -73
  51. package/dist/PhPuzzlePiece-CQ4wh0gV.js +0 -73
  52. package/dist/PhQrCode-BuJ97NYJ.js +0 -73
  53. package/dist/PhQuestion-kJoP8Mja.js +0 -73
  54. package/dist/PhQuestionMark-C46ZkFpu.js +0 -73
  55. package/dist/PhSealCheck-Eh8jVqSN.js +0 -73
  56. package/dist/PhSignOut-jk97OSVt.js +0 -73
  57. package/dist/PhSpinner-CiYOhwMg.js +0 -73
  58. package/dist/PhTrash-pxerMqzd.js +0 -73
  59. package/dist/PhUser-BMg0VV4A.js +0 -73
  60. package/dist/PhVault-DYQvx5A-.js +0 -73
  61. package/dist/PhWarning-NLC5Mj87.js +0 -73
  62. package/dist/PhWarningCircle-Ch2jU9fA.js +0 -73
  63. package/dist/PhX-Bx4wpwm3.js +0 -73
  64. package/dist/SwapController-Ch0FFTEt.js +0 -457
  65. package/dist/ccip-BrGhNXIM.js +0 -150
  66. package/dist/core/api.d.ts +0 -39
  67. package/dist/core/logic.d.ts +0 -2
  68. package/dist/core/wallet.d.ts +0 -55
  69. package/dist/data-capture-CpafmuCb.js +0 -490
  70. package/dist/email-Dcg4jlai.js +0 -344
  71. package/dist/embedded-wallet-DeoRdAPw.js +0 -820
  72. package/dist/features-B9Nde43h.js +0 -274
  73. package/dist/hashTypedData-a7b8tdkO.js +0 -197
  74. package/dist/if-defined-k21LutCn.js +0 -10
  75. package/dist/index-9vLw53Xl.js +0 -228
  76. package/dist/index-B5wUyynz.js +0 -107
  77. package/dist/index-B8LkUrww.js +0 -86
  78. package/dist/index-BA0VwKg0.js +0 -8189
  79. package/dist/index-BB9JJ24N.js +0 -125
  80. package/dist/index-BCkEvPQ6.js +0 -172
  81. package/dist/index-BDeO_csr.js +0 -171
  82. package/dist/index-Bb7babLF.js +0 -1281
  83. package/dist/index-BjOhprVS.js +0 -199
  84. package/dist/index-BjyMgZsf.js +0 -218
  85. package/dist/index-BkThIDLX.js +0 -159
  86. package/dist/index-BmFs6nb7.js +0 -209
  87. package/dist/index-C1QEJL-2.js +0 -572
  88. package/dist/index-C4qc4PdD.js +0 -387
  89. package/dist/index-CAPvUh14.js +0 -1750
  90. package/dist/index-CBMU3PTE.js +0 -65
  91. package/dist/index-CGwPkJLF.js +0 -355
  92. package/dist/index-CNGEqX3D.js +0 -153
  93. package/dist/index-CRlCq6IB.js +0 -7981
  94. package/dist/index-Cg_o-i9X.js +0 -118
  95. package/dist/index-D1BvhCbI.js +0 -62
  96. package/dist/index-DFi8TiHc.js +0 -128
  97. package/dist/index-DLwuveL9.js +0 -555
  98. package/dist/index-DMn7ktUQ.js +0 -56
  99. package/dist/index-DOXwtuwa.js +0 -117
  100. package/dist/index-DPPOW_Tp.js +0 -118
  101. package/dist/index-DQpzHpW-.js +0 -517
  102. package/dist/index-DXHg5C-W.js +0 -276
  103. package/dist/index-DcYjZV4H.js +0 -110
  104. package/dist/index-DeL88Lwc.js +0 -41655
  105. package/dist/index-DrWVlf8b.js +0 -46
  106. package/dist/index-Dsfuc4rB.js +0 -123
  107. package/dist/index-DuTny38n.js +0 -1175
  108. package/dist/index-Nfjb6bV0.js +0 -21991
  109. package/dist/index-WwwdQSN2.js +0 -85
  110. package/dist/index-Yha9Afch.js +0 -174
  111. package/dist/index-cbQHN7GC.js +0 -100
  112. package/dist/index-hyG3cYsv.js +0 -1083
  113. package/dist/index-qLxmmPaL.js +0 -257
  114. package/dist/localBatchGatewayRequest-vfcvRH0G.js +0 -91
  115. package/dist/onramp-BSiyOX4L.js +0 -855
  116. package/dist/parseSignature-CdCMAPZN.js +0 -3304
  117. package/dist/pay-with-exchange-CduNoMEz.js +0 -525
  118. package/dist/property-Bd8U3_QP.js +0 -618
  119. package/dist/receive-CrmptJlq.js +0 -232
  120. package/dist/ref-SOwYtCZb.js +0 -107
  121. package/dist/send-oMcHMEr6.js +0 -1166
  122. package/dist/socials-C0A4-FbY.js +0 -620
  123. package/dist/swaps-CbJJ9Ciu.js +0 -1760
  124. package/dist/transactions-BDfCoBS5.js +0 -37
  125. package/dist/ui/Modal.d.ts +0 -9
  126. package/dist/ui/index.d.ts +0 -6
  127. package/dist/w3m-modal-BjsTkny7.js +0 -1706
@@ -1,257 +0,0 @@
1
- import { cC as g, cR as C, cS as w, cU as k, cV as $, cX as m, cY as d, cM as l } from "./index-DeL88Lwc.js";
2
- import { n as x, c as f, r as v } from "./index-DuTny38n.js";
3
- import { o as z } from "./if-defined-k21LutCn.js";
4
- import { e as _, n as E } from "./ref-SOwYtCZb.js";
5
- const h = g({
6
- isLegalCheckboxChecked: !1
7
- }), u = {
8
- state: h,
9
- subscribe(e) {
10
- return w(h, () => e(h));
11
- },
12
- subscribeKey(e, t) {
13
- return C(h, e, t);
14
- },
15
- setIsLegalCheckboxChecked(e) {
16
- h.isLegalCheckboxChecked = e;
17
- }
18
- }, O = k`
19
- label {
20
- display: inline-flex;
21
- align-items: center;
22
- cursor: pointer;
23
- user-select: none;
24
- column-gap: ${({ spacing: e }) => e[2]};
25
- }
26
-
27
- label > input[type='checkbox'] {
28
- height: 0;
29
- width: 0;
30
- opacity: 0;
31
- position: absolute;
32
- }
33
-
34
- label > span {
35
- display: flex;
36
- align-items: center;
37
- justify-content: center;
38
- height: 100%;
39
- width: 100%;
40
- border: 1px solid ${({ colors: e }) => e.neutrals400};
41
- color: ${({ colors: e }) => e.white};
42
- background-color: transparent;
43
- will-change: border-color, background-color;
44
- }
45
-
46
- label > span > wui-icon {
47
- opacity: 0;
48
- will-change: opacity;
49
- }
50
-
51
- label > input[type='checkbox']:checked + span > wui-icon {
52
- color: ${({ colors: e }) => e.white};
53
- }
54
-
55
- label > input[type='checkbox']:not(:checked) > span > wui-icon {
56
- color: ${({ colors: e }) => e.neutrals900};
57
- }
58
-
59
- label > input[type='checkbox']:checked + span > wui-icon {
60
- opacity: 1;
61
- }
62
-
63
- /* -- Sizes --------------------------------------------------- */
64
- label[data-size='lg'] > span {
65
- width: 24px;
66
- height: 24px;
67
- min-width: 24px;
68
- min-height: 24px;
69
- border-radius: ${({ borderRadius: e }) => e[10]};
70
- }
71
-
72
- label[data-size='md'] > span {
73
- width: 20px;
74
- height: 20px;
75
- min-width: 20px;
76
- min-height: 20px;
77
- border-radius: ${({ borderRadius: e }) => e[2]};
78
- }
79
-
80
- label[data-size='sm'] > span {
81
- width: 16px;
82
- height: 16px;
83
- min-width: 16px;
84
- min-height: 16px;
85
- border-radius: ${({ borderRadius: e }) => e[1]};
86
- }
87
-
88
- /* -- Focus states --------------------------------------------------- */
89
- label > input[type='checkbox']:focus-visible + span,
90
- label > input[type='checkbox']:focus + span {
91
- border: 1px solid ${({ tokens: e }) => e.core.borderAccentPrimary};
92
- box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
93
- }
94
-
95
- /* -- Checked states --------------------------------------------------- */
96
- label > input[type='checkbox']:checked + span {
97
- background-color: ${({ tokens: e }) => e.core.iconAccentPrimary};
98
- border: 1px solid transparent;
99
- }
100
-
101
- /* -- Hover states --------------------------------------------------- */
102
- input[type='checkbox']:not(:checked):not(:disabled) + span:hover {
103
- border: 1px solid ${({ colors: e }) => e.neutrals700};
104
- background-color: ${({ colors: e }) => e.neutrals800};
105
- box-shadow: none;
106
- }
107
-
108
- input[type='checkbox']:checked:not(:disabled) + span:hover {
109
- border: 1px solid transparent;
110
- background-color: ${({ colors: e }) => e.accent080};
111
- box-shadow: none;
112
- }
113
-
114
- /* -- Disabled state --------------------------------------------------- */
115
- label > input[type='checkbox']:checked:disabled + span {
116
- border: 1px solid transparent;
117
- opacity: 0.3;
118
- }
119
-
120
- label > input[type='checkbox']:not(:checked):disabled + span {
121
- border: 1px solid ${({ colors: e }) => e.neutrals700};
122
- }
123
-
124
- label:has(input[type='checkbox']:disabled) {
125
- cursor: auto;
126
- }
127
-
128
- label > input[type='checkbox']:disabled + span {
129
- cursor: not-allowed;
130
- }
131
- `;
132
- var b = function(e, t, o, s) {
133
- var n = arguments.length, c = n < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, o) : s, i;
134
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(e, t, o, s);
135
- else for (var r = e.length - 1; r >= 0; r--) (i = e[r]) && (c = (n < 3 ? i(c) : n > 3 ? i(t, o, c) : i(t, o)) || c);
136
- return n > 3 && c && Object.defineProperty(t, o, c), c;
137
- };
138
- const R = {
139
- lg: "md",
140
- md: "sm",
141
- sm: "sm"
142
- };
143
- let a = class extends m {
144
- constructor() {
145
- super(...arguments), this.inputElementRef = _(), this.checked = void 0, this.disabled = !1, this.size = "md";
146
- }
147
- render() {
148
- const t = R[this.size];
149
- return d`
150
- <label data-size=${this.size}>
151
- <input
152
- ${E(this.inputElementRef)}
153
- ?checked=${z(this.checked)}
154
- ?disabled=${this.disabled}
155
- type="checkbox"
156
- @change=${this.dispatchChangeEvent}
157
- />
158
- <span>
159
- <wui-icon name="checkmarkBold" size=${t}></wui-icon>
160
- </span>
161
- <slot></slot>
162
- </label>
163
- `;
164
- }
165
- dispatchChangeEvent() {
166
- var t;
167
- this.dispatchEvent(new CustomEvent("checkboxChange", {
168
- detail: (t = this.inputElementRef.value) == null ? void 0 : t.checked,
169
- bubbles: !0,
170
- composed: !0
171
- }));
172
- }
173
- };
174
- a.styles = [$, O];
175
- b([
176
- x({ type: Boolean })
177
- ], a.prototype, "checked", void 0);
178
- b([
179
- x({ type: Boolean })
180
- ], a.prototype, "disabled", void 0);
181
- b([
182
- x()
183
- ], a.prototype, "size", void 0);
184
- a = b([
185
- f("wui-checkbox")
186
- ], a);
187
- const P = k`
188
- :host {
189
- display: flex;
190
- align-items: center;
191
- justify-content: center;
192
- }
193
- wui-checkbox {
194
- padding: ${({ spacing: e }) => e[3]};
195
- }
196
- a {
197
- text-decoration: none;
198
- color: ${({ tokens: e }) => e.theme.textSecondary};
199
- font-weight: 500;
200
- }
201
- `;
202
- var y = function(e, t, o, s) {
203
- var n = arguments.length, c = n < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, o) : s, i;
204
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(e, t, o, s);
205
- else for (var r = e.length - 1; r >= 0; r--) (i = e[r]) && (c = (n < 3 ? i(c) : n > 3 ? i(t, o, c) : i(t, o)) || c);
206
- return n > 3 && c && Object.defineProperty(t, o, c), c;
207
- };
208
- let p = class extends m {
209
- constructor() {
210
- super(), this.unsubscribe = [], this.checked = u.state.isLegalCheckboxChecked, this.unsubscribe.push(u.subscribeKey("isLegalCheckboxChecked", (t) => {
211
- this.checked = t;
212
- }));
213
- }
214
- disconnectedCallback() {
215
- this.unsubscribe.forEach((t) => t());
216
- }
217
- render() {
218
- var n;
219
- const { termsConditionsUrl: t, privacyPolicyUrl: o } = l.state, s = (n = l.state.features) == null ? void 0 : n.legalCheckbox;
220
- return !t && !o || !s ? null : d`
221
- <wui-checkbox
222
- ?checked=${this.checked}
223
- @checkboxChange=${this.onCheckboxChange.bind(this)}
224
- data-testid="wui-checkbox"
225
- >
226
- <wui-text color="secondary" variant="sm-regular" align="left">
227
- I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
228
- </wui-text>
229
- </wui-checkbox>
230
- `;
231
- }
232
- andTemplate() {
233
- const { termsConditionsUrl: t, privacyPolicyUrl: o } = l.state;
234
- return t && o ? "and" : "";
235
- }
236
- termsTemplate() {
237
- const { termsConditionsUrl: t } = l.state;
238
- return t ? d`<a rel="noreferrer" target="_blank" href=${t}>terms of service</a>` : null;
239
- }
240
- privacyTemplate() {
241
- const { privacyPolicyUrl: t } = l.state;
242
- return t ? d`<a rel="noreferrer" target="_blank" href=${t}>privacy policy</a>` : null;
243
- }
244
- onCheckboxChange() {
245
- u.setIsLegalCheckboxChecked(!this.checked);
246
- }
247
- };
248
- p.styles = [P];
249
- y([
250
- v()
251
- ], p.prototype, "checked", void 0);
252
- p = y([
253
- f("w3m-legal-checkbox")
254
- ], p);
255
- export {
256
- u as O
257
- };
@@ -1,91 +0,0 @@
1
- import { bJ as l, ck as p, dj as w, R as y, be as A, bl as g, K as b, J as F, bi as E, bD as N, P as h, Q as P, Z as R, dk as f, dl as I } from "./index-DeL88Lwc.js";
2
- function q(n) {
3
- const { abi: r, data: a } = n, e = l(a, 0, 4), t = r.find((o) => o.type === "function" && e === p(w(o)));
4
- if (!t)
5
- throw new y(e, {
6
- docsPath: "/docs/contract/decodeFunctionData"
7
- });
8
- return {
9
- functionName: t.name,
10
- args: "inputs" in t && t.inputs && t.inputs.length > 0 ? A(t.inputs, l(a, 4)) : void 0
11
- };
12
- }
13
- const u = "/docs/contract/encodeErrorResult";
14
- function m(n) {
15
- const { abi: r, errorName: a, args: e } = n;
16
- let t = r[0];
17
- if (a) {
18
- const c = g({ abi: r, args: e, name: a });
19
- if (!c)
20
- throw new b(a, { docsPath: u });
21
- t = c;
22
- }
23
- if (t.type !== "error")
24
- throw new b(void 0, { docsPath: u });
25
- const o = w(t), s = p(o);
26
- let i = "0x";
27
- if (e && e.length > 0) {
28
- if (!t.inputs)
29
- throw new F(t.name, { docsPath: u });
30
- i = E(t.inputs, e);
31
- }
32
- return N([s, i]);
33
- }
34
- const d = "/docs/contract/encodeFunctionResult";
35
- function x(n) {
36
- const { abi: r, functionName: a, result: e } = n;
37
- let t = r[0];
38
- if (a) {
39
- const s = g({ abi: r, name: a });
40
- if (!s)
41
- throw new h(a, { docsPath: d });
42
- t = s;
43
- }
44
- if (t.type !== "function")
45
- throw new h(void 0, { docsPath: d });
46
- if (!t.outputs)
47
- throw new P(t.name, { docsPath: d });
48
- const o = (() => {
49
- if (t.outputs.length === 0)
50
- return [];
51
- if (t.outputs.length === 1)
52
- return [e];
53
- if (Array.isArray(e))
54
- return e;
55
- throw new R(e);
56
- })();
57
- return E(t.outputs, o);
58
- }
59
- const D = "x-batch-gateway:true";
60
- async function G(n) {
61
- const { data: r, ccipRequest: a } = n, { args: [e] } = q({ abi: f, data: r }), t = [], o = [];
62
- return await Promise.all(e.map(async (s, i) => {
63
- try {
64
- o[i] = s.urls.includes(D) ? await G({ data: s.data, ccipRequest: a }) : await a(s), t[i] = !1;
65
- } catch (c) {
66
- t[i] = !0, o[i] = H(c);
67
- }
68
- })), x({
69
- abi: f,
70
- functionName: "query",
71
- result: [t, o]
72
- });
73
- }
74
- function H(n) {
75
- return n.name === "HttpRequestError" && n.status ? m({
76
- abi: f,
77
- errorName: "HttpError",
78
- args: [n.status, n.shortMessage]
79
- }) : m({
80
- abi: [I],
81
- errorName: "Error",
82
- args: ["shortMessage" in n ? n.shortMessage : n.message]
83
- });
84
- }
85
- export {
86
- x as a,
87
- G as b,
88
- q as d,
89
- m as e,
90
- D as l
91
- };