@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,232 +0,0 @@
1
- import { cU as y, cV as v, cW as N, cX as k, cY as u, cE as c, cH as w, dh as h, di as f, d3 as R, d4 as A, d0 as S, cG as I } from "./index-DeL88Lwc.js";
2
- import { n as $, c as C, U as T, r as b } from "./index-DuTny38n.js";
3
- import { o as E } from "./if-defined-k21LutCn.js";
4
- import "./index-DFi8TiHc.js";
5
- import "./index-CAPvUh14.js";
6
- const O = y`
7
- button {
8
- width: 100%;
9
- display: flex;
10
- align-items: center;
11
- justify-content: space-between;
12
- gap: ${({ spacing: e }) => e[4]};
13
- background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
14
- border-radius: ${({ borderRadius: e }) => e[3]};
15
- border: none;
16
- padding: ${({ spacing: e }) => e[3]};
17
- transition: background-color ${({ durations: e }) => e.lg}
18
- ${({ easings: e }) => e["ease-out-power-2"]};
19
- will-change: background-color;
20
- }
21
-
22
- /* -- Hover & Active states ----------------------------------------------------------- */
23
- button:hover:enabled,
24
- button:active:enabled {
25
- background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
26
- }
27
-
28
- wui-text {
29
- flex: 1;
30
- color: ${({ tokens: e }) => e.theme.textSecondary};
31
- }
32
-
33
- wui-flex {
34
- width: auto;
35
- display: flex;
36
- align-items: center;
37
- gap: ${({ spacing: e }) => e["01"]};
38
- }
39
-
40
- wui-icon {
41
- color: ${({ tokens: e }) => e.theme.iconDefault};
42
- }
43
-
44
- .network-icon {
45
- position: relative;
46
- width: 20px;
47
- height: 20px;
48
- border-radius: ${({ borderRadius: e }) => e[4]};
49
- overflow: hidden;
50
- margin-left: -8px;
51
- }
52
-
53
- .network-icon:first-child {
54
- margin-left: 0px;
55
- }
56
-
57
- .network-icon:after {
58
- position: absolute;
59
- inset: 0;
60
- content: '';
61
- display: block;
62
- height: 100%;
63
- width: 100%;
64
- border-radius: ${({ borderRadius: e }) => e[4]};
65
- box-shadow: inset 0 0 0 1px ${({ tokens: e }) => e.core.glass010};
66
- }
67
- `;
68
- var g = function(e, t, o, i) {
69
- var s = arguments.length, r = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, n;
70
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(e, t, o, i);
71
- else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) && (r = (s < 3 ? n(r) : s > 3 ? n(t, o, r) : n(t, o)) || r);
72
- return s > 3 && r && Object.defineProperty(t, o, r), r;
73
- };
74
- let p = class extends k {
75
- constructor() {
76
- super(...arguments), this.networkImages = [""], this.text = "";
77
- }
78
- render() {
79
- return u`
80
- <button>
81
- <wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
82
- <wui-flex>
83
- ${this.networksTemplate()}
84
- <wui-icon name="chevronRight" size="sm" color="inherit"></wui-icon>
85
- </wui-flex>
86
- </button>
87
- `;
88
- }
89
- networksTemplate() {
90
- const t = this.networkImages.slice(0, 5);
91
- return u` <wui-flex class="networks">
92
- ${t == null ? void 0 : t.map((o) => u` <wui-flex class="network-icon"> <wui-image src=${o}></wui-image> </wui-flex>`)}
93
- </wui-flex>`;
94
- }
95
- };
96
- p.styles = [v, N, O];
97
- g([
98
- $({ type: Array })
99
- ], p.prototype, "networkImages", void 0);
100
- g([
101
- $()
102
- ], p.prototype, "text", void 0);
103
- p = g([
104
- C("wui-compatible-network")
105
- ], p);
106
- const _ = y`
107
- wui-compatible-network {
108
- margin-top: ${({ spacing: e }) => e[4]};
109
- width: 100%;
110
- }
111
-
112
- wui-qr-code {
113
- width: unset !important;
114
- height: unset !important;
115
- }
116
-
117
- wui-icon {
118
- align-items: normal;
119
- }
120
- `;
121
- var m = function(e, t, o, i) {
122
- var s = arguments.length, r = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, n;
123
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(e, t, o, i);
124
- else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) && (r = (s < 3 ? n(r) : s > 3 ? n(t, o, r) : n(t, o)) || r);
125
- return s > 3 && r && Object.defineProperty(t, o, r), r;
126
- };
127
- let d = class extends k {
128
- constructor() {
129
- var t, o;
130
- super(), this.unsubscribe = [], this.address = (t = c.getAccountData()) == null ? void 0 : t.address, this.profileName = (o = c.getAccountData()) == null ? void 0 : o.profileName, this.network = c.state.activeCaipNetwork, this.unsubscribe.push(c.subscribeChainProp("accountState", (i) => {
131
- i ? (this.address = i.address, this.profileName = i.profileName) : w.showError("Account not found");
132
- }), c.subscribeKey("activeCaipNetwork", (i) => {
133
- i != null && i.id && (this.network = i);
134
- }));
135
- }
136
- disconnectedCallback() {
137
- this.unsubscribe.forEach((t) => t());
138
- }
139
- render() {
140
- if (!this.address)
141
- throw new Error("w3m-wallet-receive-view: No account provided");
142
- const t = h.getNetworkImage(this.network);
143
- return u` <wui-flex
144
- flexDirection="column"
145
- .padding=${["0", "4", "4", "4"]}
146
- alignItems="center"
147
- >
148
- <wui-chip-button
149
- data-testid="receive-address-copy-button"
150
- @click=${this.onCopyClick.bind(this)}
151
- text=${T.getTruncateString({
152
- string: this.profileName || this.address || "",
153
- charsStart: this.profileName ? 18 : 4,
154
- charsEnd: this.profileName ? 0 : 4,
155
- truncate: this.profileName ? "end" : "middle"
156
- })}
157
- icon="copy"
158
- size="sm"
159
- imageSrc=${t || ""}
160
- variant="gray"
161
- ></wui-chip-button>
162
- <wui-flex
163
- flexDirection="column"
164
- .padding=${["4", "0", "0", "0"]}
165
- alignItems="center"
166
- gap="4"
167
- >
168
- <wui-qr-code
169
- size=${232}
170
- theme=${f.state.themeMode}
171
- uri=${this.address}
172
- ?arenaClear=${!0}
173
- color=${E(f.state.themeVariables["--apkt-qr-color"] ?? f.state.themeVariables["--w3m-qr-color"])}
174
- data-testid="wui-qr-code"
175
- ></wui-qr-code>
176
- <wui-text variant="lg-regular" color="primary" align="center">
177
- Copy your address or scan this QR code
178
- </wui-text>
179
- <wui-button @click=${this.onCopyClick.bind(this)} size="sm" variant="neutral-secondary">
180
- <wui-icon slot="iconLeft" size="sm" color="inherit" name="copy"></wui-icon>
181
- <wui-text variant="md-regular" color="inherit">Copy address</wui-text>
182
- </wui-button>
183
- </wui-flex>
184
- ${this.networkTemplate()}
185
- </wui-flex>`;
186
- }
187
- networkTemplate() {
188
- var a;
189
- const t = c.getAllRequestedCaipNetworks(), o = c.checkIfSmartAccountEnabled(), i = c.state.activeCaipNetwork, s = t.filter((l) => (l == null ? void 0 : l.chainNamespace) === (i == null ? void 0 : i.chainNamespace));
190
- if (R(i == null ? void 0 : i.chainNamespace) === A.ACCOUNT_TYPES.SMART_ACCOUNT && o)
191
- return i ? u`<wui-compatible-network
192
- @click=${this.onReceiveClick.bind(this)}
193
- text="Only receive assets on this network"
194
- .networkImages=${[h.getNetworkImage(i) ?? ""]}
195
- ></wui-compatible-network>` : null;
196
- const n = ((a = s == null ? void 0 : s.filter((l) => {
197
- var x;
198
- return (x = l == null ? void 0 : l.assets) == null ? void 0 : x.imageId;
199
- })) == null ? void 0 : a.slice(0, 5)).map(h.getNetworkImage).filter(Boolean);
200
- return u`<wui-compatible-network
201
- @click=${this.onReceiveClick.bind(this)}
202
- text="Only receive assets on these networks"
203
- .networkImages=${n}
204
- ></wui-compatible-network>`;
205
- }
206
- onReceiveClick() {
207
- S.push("WalletCompatibleNetworks");
208
- }
209
- onCopyClick() {
210
- try {
211
- this.address && (I.copyToClopboard(this.address), w.showSuccess("Address copied"));
212
- } catch {
213
- w.showError("Failed to copy");
214
- }
215
- }
216
- };
217
- d.styles = _;
218
- m([
219
- b()
220
- ], d.prototype, "address", void 0);
221
- m([
222
- b()
223
- ], d.prototype, "profileName", void 0);
224
- m([
225
- b()
226
- ], d.prototype, "network", void 0);
227
- d = m([
228
- C("w3m-wallet-receive-view")
229
- ], d);
230
- export {
231
- d as W3mWalletReceiveView
232
- };
@@ -1,107 +0,0 @@
1
- import { cT as l } from "./index-DeL88Lwc.js";
2
- import { i as $, t as a, e as f } from "./index-DuTny38n.js";
3
- /**
4
- * @license
5
- * Copyright 2020 Google LLC
6
- * SPDX-License-Identifier: BSD-3-Clause
7
- */
8
- const _ = (t) => t.strings === void 0;
9
- /**
10
- * @license
11
- * Copyright 2017 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */
14
- const o = (t, s) => {
15
- var i;
16
- const e = t._$AN;
17
- if (e === void 0) return !1;
18
- for (const h of e) (i = h._$AO) == null || i.call(h, s, !1), o(h, s);
19
- return !0;
20
- }, c = (t) => {
21
- let s, e;
22
- do {
23
- if ((s = t._$AM) === void 0) break;
24
- e = s._$AN, e.delete(t), t = s;
25
- } while ((e == null ? void 0 : e.size) === 0);
26
- }, d = (t) => {
27
- for (let s; s = t._$AM; t = s) {
28
- let e = s._$AN;
29
- if (e === void 0) s._$AN = e = /* @__PURE__ */ new Set();
30
- else if (e.has(t)) break;
31
- e.add(t), v(s);
32
- }
33
- };
34
- function A(t) {
35
- this._$AN !== void 0 ? (c(this), this._$AM = t, d(this)) : this._$AM = t;
36
- }
37
- function u(t, s = !1, e = 0) {
38
- const i = this._$AH, h = this._$AN;
39
- if (h !== void 0 && h.size !== 0) if (s) if (Array.isArray(i)) for (let n = e; n < i.length; n++) o(i[n], !1), c(i[n]);
40
- else i != null && (o(i, !1), c(i));
41
- else o(this, t);
42
- }
43
- const v = (t) => {
44
- t.type == a.CHILD && (t._$AP ?? (t._$AP = u), t._$AQ ?? (t._$AQ = A));
45
- };
46
- class p extends $ {
47
- constructor() {
48
- super(...arguments), this._$AN = void 0;
49
- }
50
- _$AT(s, e, i) {
51
- super._$AT(s, e, i), d(this), this.isConnected = s._$AU;
52
- }
53
- _$AO(s, e = !0) {
54
- var i, h;
55
- s !== this.isConnected && (this.isConnected = s, s ? (i = this.reconnected) == null || i.call(this) : (h = this.disconnected) == null || h.call(this)), e && (o(this, s), c(this));
56
- }
57
- setValue(s) {
58
- if (_(this._$Ct)) this._$Ct._$AI(s, this);
59
- else {
60
- const e = [...this._$Ct._$AH];
61
- e[this._$Ci] = s, this._$Ct._$AI(e, this, 0);
62
- }
63
- }
64
- disconnected() {
65
- }
66
- reconnected() {
67
- }
68
- }
69
- /**
70
- * @license
71
- * Copyright 2020 Google LLC
72
- * SPDX-License-Identifier: BSD-3-Clause
73
- */
74
- const N = () => new G();
75
- class G {
76
- }
77
- const r = /* @__PURE__ */ new WeakMap(), m = f(class extends p {
78
- render(t) {
79
- return l;
80
- }
81
- update(t, [s]) {
82
- var i;
83
- const e = s !== this.G;
84
- return e && this.G !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.G = s, this.ht = (i = t.options) == null ? void 0 : i.host, this.rt(this.ct = t.element)), l;
85
- }
86
- rt(t) {
87
- if (this.isConnected || (t = void 0), typeof this.G == "function") {
88
- const s = this.ht ?? globalThis;
89
- let e = r.get(s);
90
- e === void 0 && (e = /* @__PURE__ */ new WeakMap(), r.set(s, e)), e.get(this.G) !== void 0 && this.G.call(this.ht, void 0), e.set(this.G, t), t !== void 0 && this.G.call(this.ht, t);
91
- } else this.G.value = t;
92
- }
93
- get lt() {
94
- var t, s;
95
- return typeof this.G == "function" ? (t = r.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.G) : (s = this.G) == null ? void 0 : s.value;
96
- }
97
- disconnected() {
98
- this.lt === this.ct && this.rt(void 0);
99
- }
100
- reconnected() {
101
- this.rt(this.ct);
102
- }
103
- });
104
- export {
105
- N as e,
106
- m as n
107
- };