@imtbl/auth 2.10.7-alpha.2 → 2.10.7-alpha.3
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/node/index.cjs +416 -0
- package/dist/node/index.js +9 -28
- package/package.json +19 -13
- package/dist/node/index.mjs +0 -397
- /package/dist/browser/{index.mjs → index.js} +0 -0
package/dist/node/index.mjs
DELETED
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { UserManager, User, ErrorTimeout, ErrorResponse, InMemoryWebStorage, WebStorageStateStore } from 'oidc-client-ts';
|
|
2
|
-
import m, { isAxiosError } from 'axios';
|
|
3
|
-
import vt from 'jwt-decode';
|
|
4
|
-
import { getDetail, Detail, trackError } from '@imtbl/metrics';
|
|
5
|
-
import ka from 'localforage';
|
|
6
|
-
|
|
7
|
-
var dt="pkce_state",ct="pkce_verifier",Oa=3600,ve=class{isTokenValid(a){try{let i=vt(a).exp??0,r=Date.now()/1e3+Oa;return i>r}catch{return !1}}savePKCEData(a){localStorage.setItem(dt,a.state),localStorage.setItem(ct,a.verifier);}getPKCEData(){let a=localStorage.getItem(dt),t=localStorage.getItem(ct);return a&&t?{state:a,verifier:t}:null}};var Ia=(...e)=>{if(typeof process>"u")return;process?.env?.JEST_WORKER_ID===void 0&&console.warn(...e);},Ee={warn:Ia};function lt(e){try{let a=vt(e),t=Math.floor(Date.now()/1e3);return a.exp?a.exp<=t+30:!0}catch{return !0}}function ht(e){let{id_token:a,access_token:t}=e;return !t||!a?!0:lt(t)||lt(a)}var xe=(N=>(N.AUTHENTICATION_ERROR="AUTHENTICATION_ERROR",N.INVALID_CONFIGURATION="INVALID_CONFIGURATION",N.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR",N.NOT_LOGGED_IN_ERROR="NOT_LOGGED_IN_ERROR",N.SILENT_LOGIN_ERROR="SILENT_LOGIN_ERROR",N.REFRESH_TOKEN_ERROR="REFRESH_TOKEN_ERROR",N.USER_REGISTRATION_ERROR="USER_REGISTRATION_ERROR",N.USER_NOT_REGISTERED_ERROR="USER_NOT_REGISTERED_ERROR",N.LOGOUT_ERROR="LOGOUT_ERROR",N.TRANSFER_ERROR="TRANSFER_ERROR",N.CREATE_ORDER_ERROR="CREATE_ORDER_ERROR",N.CANCEL_ORDER_ERROR="CANCEL_ORDER_ERROR",N.EXCHANGE_TRANSFER_ERROR="EXCHANGE_TRANSFER_ERROR",N.CREATE_TRADE_ERROR="CREATE_TRADE_ERROR",N.OPERATION_NOT_SUPPORTED_ERROR="OPERATION_NOT_SUPPORTED_ERROR",N.LINK_WALLET_ALREADY_LINKED_ERROR="LINK_WALLET_ALREADY_LINKED_ERROR",N.LINK_WALLET_MAX_WALLETS_LINKED_ERROR="LINK_WALLET_MAX_WALLETS_LINKED_ERROR",N.LINK_WALLET_VALIDATION_ERROR="LINK_WALLET_VALIDATION_ERROR",N.LINK_WALLET_DUPLICATE_NONCE_ERROR="LINK_WALLET_DUPLICATE_NONCE_ERROR",N.LINK_WALLET_GENERIC_ERROR="LINK_WALLET_GENERIC_ERROR",N.SERVICE_UNAVAILABLE_ERROR="SERVICE_UNAVAILABLE_ERROR",N))(xe||{});function Pa(e){return "code"in e&&"message"in e}var K=class extends Error{type;constructor(a,t){super(a),this.type=t;}},Q=async(e,a)=>{try{return await e()}catch(t){let i;throw t instanceof K&&t.type==="SERVICE_UNAVAILABLE_ERROR"?new K(t.message,t.type):(isAxiosError(t)&&t.response?.data&&Pa(t.response.data)?i=t.response.data.message:i=t.message,new K(i,a))}};var ut=(t=>(t.IMX="imx",t.ZKEVM="zkEvm",t))(ut||{}),je=e=>!!e.zkEvm,Ke=e=>!!e.imx,pt=(t=>(t.OptedIn="opted_in",t.Unsubscribed="unsubscribed",t))(pt||{});var me="passport-overlay",_e="passport-overlay-contents",Me=`${me}-close`,Ne=`${me}-try-again`,gt=`
|
|
8
|
-
<svg
|
|
9
|
-
viewBox="0 0 20 20"
|
|
10
|
-
fill="none"
|
|
11
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
-
style="width: 20px !important;"
|
|
13
|
-
>
|
|
14
|
-
<path
|
|
15
|
-
d="M16.25 5.75833L14.2417 3.75L10 7.99167L5.75833 3.75L3.75 5.75833L7.99167 10L3.75 14.2417L5.75833 16.25L10 12.0083L14.2417 16.25L16.25 14.2417L12.0083 10L16.25 5.75833Z"
|
|
16
|
-
fill="#F3F3F3"
|
|
17
|
-
/>
|
|
18
|
-
</svg>
|
|
19
|
-
`,mt=`
|
|
20
|
-
<svg
|
|
21
|
-
viewBox="0 0 17 16"
|
|
22
|
-
fill="none"
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
style="width: 16px !important;"
|
|
25
|
-
>
|
|
26
|
-
<path
|
|
27
|
-
fill-rule="evenodd"
|
|
28
|
-
clip-rule="evenodd"
|
|
29
|
-
d="M0.5 14.3333L8.5 0.333336L16.5 14.3333H0.5ZM9.16667 10.6667V12H7.83333V10.6667H9.16667ZM9.16667 5.33334L9.16667 9.33334H7.83333L7.83333 5.33334H9.16667Z"
|
|
30
|
-
fill="#E01A3D"
|
|
31
|
-
/>
|
|
32
|
-
</svg>
|
|
33
|
-
`,$e=`
|
|
34
|
-
<svg
|
|
35
|
-
style="
|
|
36
|
-
max-width: 123px !important;
|
|
37
|
-
margin-bottom: 24px !important;
|
|
38
|
-
"
|
|
39
|
-
viewBox="0 0 124 112"
|
|
40
|
-
fill="none"
|
|
41
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
42
|
-
>
|
|
43
|
-
<g clip-path="url(#clip0_332_47939)">
|
|
44
|
-
<g clip-path="url(#clip1_332_47939)">
|
|
45
|
-
<path
|
|
46
|
-
d="M4.10008 74.9453H0.5V93.6041H4.10008V74.9453Z"
|
|
47
|
-
fill="#F3F3F3"
|
|
48
|
-
/>
|
|
49
|
-
<path
|
|
50
|
-
d="M22.9585 80.0212C21.1727 80.0212 19.5283 80.7622 18.5505 82.3115C17.8209 80.8013 16.3595 80.0212 14.4691 80.0212C12.864 80.0212 11.3786 80.7231 10.4792 82.1681V80.282H7.00976V93.6063H10.4792V86.2032C10.4792 84.3432 11.7445 82.9503 13.3475 82.9503H13.5565C14.9787 82.9503 15.643 83.8477 15.643 85.6187V93.6085H19.1124V86.2054C19.1124 84.3453 20.3647 82.9525 21.9676 82.9525H22.1767C23.5989 82.9525 24.237 83.8499 24.237 85.6208V93.6106H27.7064V85.2188C27.7064 83.6435 27.3274 82.3832 26.5717 81.4315C25.8029 80.4949 24.6029 80.0256 22.9585 80.0256V80.0212Z"
|
|
51
|
-
fill="#F3F3F3"
|
|
52
|
-
/>
|
|
53
|
-
<path
|
|
54
|
-
d="M46.0291 80.0212C44.2432 80.0212 42.5989 80.7622 41.621 82.3115C40.8914 80.8013 39.43 80.0212 37.5396 80.0212C35.9345 80.0212 34.4492 80.7231 33.5497 82.1681V80.282H30.0803V93.6063H33.5497V86.2032C33.5497 84.3432 34.8151 82.9503 36.418 82.9503H36.6271C38.0493 82.9503 38.7135 83.8477 38.7135 85.6187V93.6085H42.1829V86.2054C42.1829 84.3453 43.4352 82.9525 45.0381 82.9525H45.2472C46.6694 82.9525 47.3075 83.8499 47.3075 85.6208V93.6106H50.7769V85.2188C50.7769 83.6435 50.398 82.3832 49.6422 81.4315C48.8734 80.4949 47.6734 80.0256 46.0291 80.0256V80.0212Z"
|
|
55
|
-
fill="#F3F3F3"
|
|
56
|
-
/>
|
|
57
|
-
<path
|
|
58
|
-
d="M72.3077 89.2061V83.0785H75.2936V80.282H72.3077V75.9622H68.8383V80.282H61.4312V87.6851C61.4312 89.5451 60.192 91.0683 58.6805 91.0683H58.4715C57.2061 91.0683 56.4896 90.1318 56.4896 88.413V80.282H53.0202V88.8041C53.0202 90.3534 53.3991 91.5746 54.1549 92.4872C54.8975 93.4107 56.0322 93.867 57.5328 93.867C59.188 93.867 60.6102 93.0218 61.4312 91.655V93.6063H64.9006V83.0807H68.8405V90.1448C68.8405 92.396 70.0536 93.6063 72.3099 93.6063H75.7009V90.6794H73.7843C72.5582 90.6794 72.3099 90.4317 72.3099 89.2083L72.3077 89.2061Z"
|
|
59
|
-
fill="#F3F3F3"
|
|
60
|
-
/>
|
|
61
|
-
<path
|
|
62
|
-
d="M88.0757 84.8082C88.0757 81.7378 85.8325 80.0191 82.4676 80.0191C79.1027 80.0191 77.0033 81.8791 76.7158 84.404H80.1982C80.2766 83.5979 81.0977 82.8156 82.35 82.8156H82.5722C83.8506 82.8156 84.7109 83.7391 84.7109 84.9364V85.2623L81.346 85.5622C79.9108 85.6795 78.7369 86.0945 77.8243 86.8246C76.9118 87.5525 76.4544 88.5934 76.4544 89.9471C76.4152 92.2895 78.4363 93.8888 80.8364 93.8627C82.5438 93.8627 83.9529 93.1348 84.7871 91.9766C84.8132 92.6785 84.8655 93.226 84.9439 93.6019H88.2042C88.1127 92.9783 88.0735 92.0005 88.0735 90.675V84.806L88.0757 84.8082ZM84.7109 88.1653C84.7109 89.8428 83.3148 91.0661 81.738 91.0661H81.5289C80.5772 91.0661 79.8737 90.5316 79.8737 89.7124C79.8737 89.204 80.0697 88.8281 80.4596 88.5543C80.8516 88.2805 81.3068 88.124 81.8164 88.0849L84.7109 87.785V88.1653Z"
|
|
63
|
-
fill="#F3F3F3"
|
|
64
|
-
/>
|
|
65
|
-
<path
|
|
66
|
-
d="M97.7935 80.0212C96.0076 80.0212 94.5201 81.036 93.9452 82.0116V74.9475H90.4758V93.6063H93.9452V91.8766C94.5201 92.8523 96.0055 93.867 97.7935 93.867C101.537 93.9322 103.765 90.5881 103.726 86.9441C103.765 83.3002 101.535 79.956 97.7935 80.0212ZM97.2055 91.0683H96.9964C95.4044 91.1074 93.919 89.3908 93.9452 86.9441C93.919 84.4974 95.4065 82.7808 96.9964 82.8199H97.2055C98.9522 82.8199 100.257 84.4192 100.257 86.9181C100.257 89.4169 98.9391 91.0683 97.2055 91.0683Z"
|
|
67
|
-
fill="#F3F3F3"
|
|
68
|
-
/>
|
|
69
|
-
<path
|
|
70
|
-
d="M108.931 74.9453H105.462V93.6041H108.931V74.9453Z"
|
|
71
|
-
fill="#F3F3F3"
|
|
72
|
-
/>
|
|
73
|
-
<path
|
|
74
|
-
d="M117.057 80.0212C113.146 79.9691 110.667 82.9612 110.706 86.9441C110.641 91.1987 113.705 93.9192 117.057 93.867C120.33 93.867 122.443 92.0461 123.094 89.3908H119.651C119.403 90.3665 118.555 91.0683 117.303 91.0683H117.081C115.633 91.0683 114.2 89.8189 114.069 88.0371H123.094C123.133 87.4656 123.147 87.0484 123.147 86.7877C123.186 82.8982 120.956 79.9821 117.057 80.0212ZM114.071 85.3688C114.15 83.7934 115.363 82.8178 116.824 82.8178H117.033C118.495 82.8178 119.708 83.7934 119.784 85.3688H114.071Z"
|
|
75
|
-
fill="#F3F3F3"
|
|
76
|
-
/>
|
|
77
|
-
</g>
|
|
78
|
-
<path
|
|
79
|
-
d="M30.4851 101.025V109H32.0581V106.195H33.2571C35.0941 106.195 36.7221 105.7 36.7221 103.665C36.7221 101.256 34.8521 101.025 33.2131 101.025H30.4851ZM33.2461 102.257C34.1041 102.257 35.1051 102.367 35.1051 103.676C35.1051 104.732 34.3351 104.974 33.3561 104.974H32.0581V102.257H33.2461Z"
|
|
80
|
-
fill="#F3F3F3"
|
|
81
|
-
/>
|
|
82
|
-
<path
|
|
83
|
-
d="M36.9683 109H38.5743L39.1353 107.383H42.2373L42.7983 109H44.5034L41.5224 101.025H39.9383L36.9683 109ZM40.6863 102.95L41.7863 106.096H39.5863L40.6863 102.95Z"
|
|
84
|
-
fill="#F3F3F3"
|
|
85
|
-
/>
|
|
86
|
-
<path
|
|
87
|
-
d="M49.1875 105.689C50.0345 105.843 50.6615 106.096 50.6615 106.778C50.6615 107.636 49.7705 107.889 49.0665 107.889C48.1205 107.889 47.3065 107.537 47.1305 106.371H45.6125C45.7555 108.087 47.0535 109.143 49.0115 109.143C50.6175 109.143 52.2455 108.34 52.2455 106.701C52.2455 105.051 50.8155 104.534 49.5175 104.303L48.4725 104.116C47.8345 103.995 47.3615 103.687 47.3615 103.126C47.3615 102.411 48.1755 102.136 48.9015 102.136C49.6495 102.136 50.4635 102.444 50.5845 103.379H52.1025C52.0255 101.85 50.6175 100.882 48.9675 100.882C47.4935 100.882 45.7885 101.586 45.7885 103.192C45.7885 104.578 46.8775 105.249 48.1755 105.502L49.1875 105.689Z"
|
|
88
|
-
fill="#F3F3F3"
|
|
89
|
-
/>
|
|
90
|
-
<path
|
|
91
|
-
d="M57.5244 105.689C58.3714 105.843 58.9984 106.096 58.9984 106.778C58.9984 107.636 58.1074 107.889 57.4034 107.889C56.4574 107.889 55.6434 107.537 55.4674 106.371H53.9494C54.0924 108.087 55.3904 109.143 57.3484 109.143C58.9544 109.143 60.5824 108.34 60.5824 106.701C60.5824 105.051 59.1524 104.534 57.8544 104.303L56.8094 104.116C56.1714 103.995 55.6984 103.687 55.6984 103.126C55.6984 102.411 56.5124 102.136 57.2384 102.136C57.9864 102.136 58.8004 102.444 58.9214 103.379H60.4394C60.3624 101.85 58.9544 100.882 57.3044 100.882C55.8304 100.882 54.1254 101.586 54.1254 103.192C54.1254 104.578 55.2144 105.249 56.5124 105.502L57.5244 105.689Z"
|
|
92
|
-
fill="#F3F3F3"
|
|
93
|
-
/>
|
|
94
|
-
<path
|
|
95
|
-
d="M62.5544 101.025V109H64.1274V106.195H65.3264C67.1634 106.195 68.7914 105.7 68.7914 103.665C68.7914 101.256 66.9214 101.025 65.2824 101.025H62.5544ZM65.3154 102.257C66.1734 102.257 67.1744 102.367 67.1744 103.676C67.1744 104.732 66.4044 104.974 65.4254 104.974H64.1274V102.257H65.3154Z"
|
|
96
|
-
fill="#F3F3F3"
|
|
97
|
-
/>
|
|
98
|
-
<path
|
|
99
|
-
d="M71.8888 105.007C71.8888 103.137 72.9228 102.136 74.1658 102.136C75.4088 102.136 76.4428 103.137 76.4428 105.007C76.4428 106.877 75.4088 107.889 74.1658 107.889C72.9228 107.889 71.8888 106.877 71.8888 105.007ZM78.0708 105.007C78.0708 102.532 76.5418 100.882 74.1658 100.882C71.7898 100.882 70.2608 102.532 70.2608 105.007C70.2608 107.482 71.7898 109.143 74.1658 109.143C76.5418 109.143 78.0708 107.482 78.0708 105.007Z"
|
|
100
|
-
fill="#F3F3F3"
|
|
101
|
-
/>
|
|
102
|
-
<path
|
|
103
|
-
d="M85.0133 109H86.7623L84.9913 105.546C85.9813 105.128 86.4323 104.358 86.4323 103.445C86.4323 101.773 85.4313 101.025 82.8023 101.025H80.1843V109H81.7573V105.876H83.0553H83.4293L85.0133 109ZM82.9783 102.257C84.0453 102.257 84.8153 102.532 84.8153 103.456C84.8153 104.237 84.2763 104.655 83.0553 104.655H81.7573V102.257H82.9783Z"
|
|
104
|
-
fill="#F3F3F3"
|
|
105
|
-
/>
|
|
106
|
-
<path
|
|
107
|
-
d="M90.1424 109H91.7154V102.301H94.1794V101.025H87.6894V102.301H90.1424V109Z"
|
|
108
|
-
fill="#F3F3F3"
|
|
109
|
-
/>
|
|
110
|
-
<g clip-path="url(#clip2_332_47939)">
|
|
111
|
-
<circle
|
|
112
|
-
cx="61.5"
|
|
113
|
-
cy="30"
|
|
114
|
-
r="28.125"
|
|
115
|
-
fill="url(#paint0_radial_332_47939)"
|
|
116
|
-
/>
|
|
117
|
-
<circle
|
|
118
|
-
cx="61.5"
|
|
119
|
-
cy="30"
|
|
120
|
-
r="28.125"
|
|
121
|
-
fill="url(#paint1_radial_332_47939)"
|
|
122
|
-
/>
|
|
123
|
-
<path
|
|
124
|
-
d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM60.3397 11.4576C61.1729 11.0494 62.0508 11.0774 62.8588 11.5359C65.6603 13.1323 68.4534 14.7428 71.2325 16.37C72.1272 16.8956 72.5857 17.7372 72.5885 18.7717C72.6053 22.3979 72.5997 26.0214 72.5885 29.6477C72.5885 29.7819 72.5019 29.9776 72.3928 30.0419C71.3164 30.685 70.226 31.3029 69.0433 31.9851V31.4147C69.0433 27.685 69.0322 23.9581 69.0517 20.2283C69.0545 19.5126 68.8085 19.0513 68.1738 18.6906C64.9222 16.8425 61.6873 14.9609 58.4469 13.0904C58.3071 13.0093 58.1701 12.9226 57.9576 12.794C58.7908 12.3215 59.5401 11.8462 60.3341 11.4576H60.3397ZM59.7442 48.5564C59.5624 48.4641 59.4282 48.3998 59.2968 48.3243C55.0051 45.8499 50.719 43.3588 46.4133 40.904C45.2055 40.2162 44.6547 39.2349 44.6687 37.8565C44.6938 34.9264 44.6855 31.9963 44.6715 29.0634C44.6659 27.7409 45.2027 26.7819 46.3658 26.1221C49.3882 24.4026 52.3938 22.658 55.3993 20.9105C55.6594 20.7596 55.8495 20.7344 56.1207 20.8966C57.158 21.52 58.2148 22.1156 59.3192 22.753C59.1095 22.8788 58.9501 22.9739 58.788 23.069C55.5335 24.9478 52.2847 26.8322 49.0219 28.6999C48.4879 29.0047 48.239 29.4017 48.2446 30.0224C48.2614 32.3318 48.2642 34.6412 48.2446 36.9506C48.239 37.5881 48.4935 37.9935 49.0415 38.3066C52.4832 40.2749 55.911 42.2656 59.35 44.2395C59.6407 44.4073 59.7637 44.5806 59.7582 44.9273C59.733 46.11 59.7498 47.2954 59.7498 48.5592L59.7442 48.5564ZM59.7442 41.9413C59.445 41.7707 59.2297 41.6505 59.0144 41.5247C56.2856 39.9506 53.5596 38.3709 50.8253 36.808C50.5289 36.6403 50.4199 36.4585 50.4226 36.1146C50.4422 34.3392 50.4338 32.5638 50.4282 30.7884C50.4282 30.548 50.4646 30.383 50.7022 30.2488C51.7088 29.6869 52.7041 29.0997 53.7022 28.5266C53.7749 28.4846 53.8532 28.4539 53.9846 28.3896V30.383C53.9846 31.4623 54.0014 32.5443 53.979 33.6235C53.9651 34.2386 54.2027 34.6552 54.7395 34.9571C56.2856 35.8294 57.8122 36.7353 59.3583 37.6048C59.6631 37.7754 59.7554 37.9655 59.7498 38.301C59.7302 39.4809 59.7414 40.6636 59.7414 41.9385L59.7442 41.9413ZM56.5932 18.6375C56.0144 18.2964 55.5196 18.2992 54.9408 18.6375C51.6976 20.5331 48.4404 22.4035 45.1859 24.2824C45.0489 24.3635 44.9063 24.4362 44.6631 24.5676C44.7498 23.3318 44.4842 22.1659 44.9063 21.0363C45.1356 20.4185 45.5662 19.9543 46.1365 19.6244C48.8514 18.0559 51.5634 16.4846 54.2838 14.9245C55.2763 14.3541 56.2884 14.3681 57.281 14.9413C60.3705 16.7195 63.4571 18.5033 66.5382 20.2926C66.6696 20.3681 66.8346 20.5387 66.8346 20.6673C66.8569 21.9366 66.8486 23.2088 66.8486 24.5704C65.7274 23.9245 64.6929 23.3262 63.6584 22.7279C61.3015 21.3663 58.939 20.0186 56.5932 18.6375ZM78.3033 38.5974C78.2223 39.5955 77.6379 40.3029 76.774 40.8006C73.4664 42.7018 70.1617 44.6142 66.8569 46.521C65.8197 47.1193 64.7824 47.7176 63.7423 48.3159C63.6165 48.3886 63.4879 48.4501 63.3173 48.5396C63.3061 48.3663 63.2922 48.2404 63.2922 48.1146C63.2922 47.0186 63.2978 45.9254 63.2866 44.8294C63.2866 44.5806 63.3453 44.4296 63.5746 44.2982C68.3947 41.5247 73.212 38.7428 78.0266 35.9637C78.0993 35.9217 78.1803 35.8882 78.3173 35.8239C78.3173 36.7968 78.3732 37.7027 78.3033 38.5974ZM78.3285 31.6971C78.3201 32.8322 77.7078 33.6291 76.7377 34.1883C72.9688 36.3551 69.2027 38.5331 65.4366 40.7083C64.7488 41.1053 64.0582 41.4995 63.3201 41.9245C63.3089 41.7372 63.295 41.6142 63.295 41.4883C63.295 40.4091 63.3062 39.3271 63.2866 38.2479C63.281 37.9404 63.3844 37.7782 63.65 37.6244C67.075 35.6589 70.4888 33.671 73.9194 31.7167C74.5289 31.37 74.7973 30.9422 74.7917 30.2265C74.7665 26.4967 74.7805 22.767 74.7805 19.0373V18.3858C75.6752 18.9254 76.514 19.37 77.2801 19.9124C77.979 20.4073 78.3313 21.1566 78.3341 22.0205C78.3453 25.247 78.3537 28.4734 78.3313 31.6999L78.3285 31.6971Z"
|
|
125
|
-
fill="#131313"
|
|
126
|
-
/>
|
|
127
|
-
<path
|
|
128
|
-
fill-rule="evenodd"
|
|
129
|
-
clip-rule="evenodd"
|
|
130
|
-
d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM61.5 2.5C46.3122 2.5 34 14.8122 34 30C34 45.1878 46.3122 57.5 61.5 57.5C76.6878 57.5 89 45.1878 89 30C89 14.8122 76.6878 2.5 61.5 2.5Z"
|
|
131
|
-
fill="url(#paint2_radial_332_47939)"
|
|
132
|
-
/>
|
|
133
|
-
<path
|
|
134
|
-
fill-rule="evenodd"
|
|
135
|
-
clip-rule="evenodd"
|
|
136
|
-
d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM61.5 2.5C46.3122 2.5 34 14.8122 34 30C34 45.1878 46.3122 57.5 61.5 57.5C76.6878 57.5 89 45.1878 89 30C89 14.8122 76.6878 2.5 61.5 2.5Z"
|
|
137
|
-
fill="url(#paint3_radial_332_47939)"
|
|
138
|
-
/>
|
|
139
|
-
</g>
|
|
140
|
-
</g>
|
|
141
|
-
<defs>
|
|
142
|
-
<radialGradient
|
|
143
|
-
id="paint0_radial_332_47939"
|
|
144
|
-
cx="0"
|
|
145
|
-
cy="0"
|
|
146
|
-
r="1"
|
|
147
|
-
gradientUnits="userSpaceOnUse"
|
|
148
|
-
gradientTransform="translate(48.3053 16.7373) rotate(44.9817) scale(58.4359 123.929)"
|
|
149
|
-
>
|
|
150
|
-
<stop stop-color="#A3EEF8" />
|
|
151
|
-
<stop offset="0.177083" stop-color="#A4DCF5" />
|
|
152
|
-
<stop offset="0.380208" stop-color="#A6AEEC" />
|
|
153
|
-
<stop offset="1" stop-color="#ECBEE1" />
|
|
154
|
-
</radialGradient>
|
|
155
|
-
<radialGradient
|
|
156
|
-
id="paint1_radial_332_47939"
|
|
157
|
-
cx="0"
|
|
158
|
-
cy="0"
|
|
159
|
-
r="1"
|
|
160
|
-
gradientUnits="userSpaceOnUse"
|
|
161
|
-
gradientTransform="translate(63.9394 54.6335) rotate(84.265) scale(30.2672 57.9018)"
|
|
162
|
-
>
|
|
163
|
-
<stop stop-color="#FCF5EE" />
|
|
164
|
-
<stop offset="0.715135" stop-color="#ECBEE1" stop-opacity="0" />
|
|
165
|
-
</radialGradient>
|
|
166
|
-
<radialGradient
|
|
167
|
-
id="paint2_radial_332_47939"
|
|
168
|
-
cx="0"
|
|
169
|
-
cy="0"
|
|
170
|
-
r="1"
|
|
171
|
-
gradientUnits="userSpaceOnUse"
|
|
172
|
-
gradientTransform="translate(47.4257 15.8532) rotate(44.9817) scale(62.3316 132.191)"
|
|
173
|
-
>
|
|
174
|
-
<stop stop-color="#A3EEF8" />
|
|
175
|
-
<stop offset="0.177083" stop-color="#A4DCF5" />
|
|
176
|
-
<stop offset="0.380208" stop-color="#A6AEEC" />
|
|
177
|
-
<stop offset="1" stop-color="#ECBEE1" />
|
|
178
|
-
</radialGradient>
|
|
179
|
-
<radialGradient
|
|
180
|
-
id="paint3_radial_332_47939"
|
|
181
|
-
cx="0"
|
|
182
|
-
cy="0"
|
|
183
|
-
r="1"
|
|
184
|
-
gradientUnits="userSpaceOnUse"
|
|
185
|
-
gradientTransform="translate(64.102 56.2758) rotate(84.265) scale(32.2851 61.7619)"
|
|
186
|
-
>
|
|
187
|
-
<stop stop-color="#FCF5EE" />
|
|
188
|
-
<stop offset="0.715135" stop-color="#ECBEE1" stop-opacity="0" />
|
|
189
|
-
</radialGradient>
|
|
190
|
-
<clipPath id="clip0_332_47939">
|
|
191
|
-
<rect
|
|
192
|
-
width="123"
|
|
193
|
-
height="112"
|
|
194
|
-
fill="white"
|
|
195
|
-
transform="translate(0.5)"
|
|
196
|
-
/>
|
|
197
|
-
</clipPath>
|
|
198
|
-
<clipPath id="clip1_332_47939">
|
|
199
|
-
<rect
|
|
200
|
-
width="123"
|
|
201
|
-
height="19"
|
|
202
|
-
fill="white"
|
|
203
|
-
transform="translate(0.5 75)"
|
|
204
|
-
/>
|
|
205
|
-
</clipPath>
|
|
206
|
-
<clipPath id="clip2_332_47939">
|
|
207
|
-
<rect
|
|
208
|
-
width="60"
|
|
209
|
-
height="60"
|
|
210
|
-
fill="white"
|
|
211
|
-
transform="translate(31.5)"
|
|
212
|
-
/>
|
|
213
|
-
</clipPath>
|
|
214
|
-
</defs>
|
|
215
|
-
</svg>
|
|
216
|
-
`;var xa=()=>`
|
|
217
|
-
<button
|
|
218
|
-
id="${Me}"
|
|
219
|
-
style="
|
|
220
|
-
background: #f3f3f326 !important;
|
|
221
|
-
border: none !important;
|
|
222
|
-
border-radius: 50% !important;
|
|
223
|
-
width: 48px !important;
|
|
224
|
-
height: 48px !important;
|
|
225
|
-
position: absolute !important;
|
|
226
|
-
top: 40px !important;
|
|
227
|
-
right: 40px !important;
|
|
228
|
-
cursor: pointer !important;
|
|
229
|
-
display: flex !important;
|
|
230
|
-
align-items: center !important;
|
|
231
|
-
justify-content: center !important;
|
|
232
|
-
"
|
|
233
|
-
>
|
|
234
|
-
${gt}
|
|
235
|
-
</button>
|
|
236
|
-
`,ft=()=>`
|
|
237
|
-
<button
|
|
238
|
-
id="${Ne}"
|
|
239
|
-
style="
|
|
240
|
-
margin-top: 27px !important;
|
|
241
|
-
color: #f3f3f3 !important;
|
|
242
|
-
background: transparent !important;
|
|
243
|
-
padding: 12px 24px !important;
|
|
244
|
-
border-radius: 30px !important;
|
|
245
|
-
border: 2px solid #f3f3f3 !important;
|
|
246
|
-
font-size: 1em !important;
|
|
247
|
-
font-weight: 500 !important;
|
|
248
|
-
cursor: pointer !important;
|
|
249
|
-
"
|
|
250
|
-
>
|
|
251
|
-
Try again
|
|
252
|
-
</button>
|
|
253
|
-
`,Ma=()=>`
|
|
254
|
-
${$e}
|
|
255
|
-
<div
|
|
256
|
-
style="
|
|
257
|
-
color: #e01a3d !important;
|
|
258
|
-
display: flex !important;
|
|
259
|
-
align-items: center !important;
|
|
260
|
-
gap: 4px !important;
|
|
261
|
-
margin-bottom: 10px !important;
|
|
262
|
-
"
|
|
263
|
-
>
|
|
264
|
-
${mt}
|
|
265
|
-
Pop-up blocked
|
|
266
|
-
</div>
|
|
267
|
-
<p style="
|
|
268
|
-
color: #b6b6b6 !important;
|
|
269
|
-
text-align: center !important;
|
|
270
|
-
margin: 0 !important;
|
|
271
|
-
"
|
|
272
|
-
>
|
|
273
|
-
Please try again below.<br />
|
|
274
|
-
If the problem continues, adjust your<br />
|
|
275
|
-
browser settings.
|
|
276
|
-
</p>
|
|
277
|
-
${ft()}
|
|
278
|
-
`,Na=()=>`
|
|
279
|
-
${$e}
|
|
280
|
-
<p style="
|
|
281
|
-
color: #b6b6b6 !important;
|
|
282
|
-
text-align: center !important;
|
|
283
|
-
margin: 0 !important;
|
|
284
|
-
"
|
|
285
|
-
>
|
|
286
|
-
Secure pop-up not showing?<br />We'll help you re-launch
|
|
287
|
-
</p>
|
|
288
|
-
${ft()}
|
|
289
|
-
`,yt=e=>`
|
|
290
|
-
<div
|
|
291
|
-
id="${me}"
|
|
292
|
-
style="
|
|
293
|
-
position: fixed !important;
|
|
294
|
-
top: 0 !important;
|
|
295
|
-
left: 0 !important;
|
|
296
|
-
width: 100% !important;
|
|
297
|
-
height: 100% !important;
|
|
298
|
-
background: rgba(13, 13, 13, 0.48) !important;
|
|
299
|
-
backdrop-filter: blur(28px) !important;
|
|
300
|
-
-webkit-backdrop-filter: blur(28px) !important;
|
|
301
|
-
display: flex !important;
|
|
302
|
-
flex-direction: column !important;
|
|
303
|
-
justify-content: center !important;
|
|
304
|
-
align-items: center !important;
|
|
305
|
-
font-size: 16px !important;
|
|
306
|
-
line-height: 1.5 !important;
|
|
307
|
-
font-family: Roboto !important;
|
|
308
|
-
font-style: normal !important;
|
|
309
|
-
font-weight: 400 !important;
|
|
310
|
-
font-feature-settings: 'clig' off, 'liga' off !important;
|
|
311
|
-
z-index: 2147483647 !important;
|
|
312
|
-
"
|
|
313
|
-
>
|
|
314
|
-
${xa()}
|
|
315
|
-
<div
|
|
316
|
-
id="${_e}"
|
|
317
|
-
style="
|
|
318
|
-
display: flex !important;
|
|
319
|
-
flex-direction: column !important;
|
|
320
|
-
align-items: center !important;
|
|
321
|
-
max-width: 400px !important;
|
|
322
|
-
"
|
|
323
|
-
>
|
|
324
|
-
${e??""}
|
|
325
|
-
</div>
|
|
326
|
-
</div>
|
|
327
|
-
`,Ct=()=>`
|
|
328
|
-
<div
|
|
329
|
-
id="${me}"
|
|
330
|
-
style="
|
|
331
|
-
position: fixed;
|
|
332
|
-
top: 0;
|
|
333
|
-
left: 0;
|
|
334
|
-
width: 100%;
|
|
335
|
-
height: 100%;
|
|
336
|
-
display: flex;
|
|
337
|
-
flex-direction: column;
|
|
338
|
-
justify-content: center;
|
|
339
|
-
align-items: center;
|
|
340
|
-
z-index: 2147483647;
|
|
341
|
-
background: rgba(247, 247, 247, 0.24);
|
|
342
|
-
animation-name: passportEmbeddedLoginPromptOverlayFadeIn;
|
|
343
|
-
animation-duration: 0.8s;
|
|
344
|
-
"
|
|
345
|
-
>
|
|
346
|
-
<div
|
|
347
|
-
id="${_e}"
|
|
348
|
-
style="
|
|
349
|
-
display: flex;
|
|
350
|
-
flex-direction: column;
|
|
351
|
-
align-items: center;
|
|
352
|
-
width: 100%;
|
|
353
|
-
"
|
|
354
|
-
/>
|
|
355
|
-
</div>
|
|
356
|
-
`;function ke({id:e,href:a,rel:t,crossOrigin:i}){let r=`${me}-${e}`;if(!document.getElementById(r)){let n=document.createElement("link");n.id=r,n.href=a,t&&(n.rel=t),i&&(n.crossOrigin=i),document.head.appendChild(n);}}var Tt=()=>yt(Ma()),Rt=()=>yt(Na());var X=class{disableGenericPopupOverlay;disableBlockedPopupOverlay;overlay;isBlockedOverlay;tryAgainListener;onCloseListener;constructor(a,t=!1){this.disableBlockedPopupOverlay=a.disableBlockedPopupOverlay||!1,this.disableGenericPopupOverlay=a.disableGenericPopupOverlay||!1,this.isBlockedOverlay=t;}append(a,t){this.shouldAppendOverlay()&&(this.appendOverlay(),this.updateTryAgainButton(a),this.updateCloseButton(t));}update(a){this.updateTryAgainButton(a);}remove(){this.overlay&&this.overlay.remove();}shouldAppendOverlay(){return !(this.disableGenericPopupOverlay&&this.disableBlockedPopupOverlay||this.disableGenericPopupOverlay&&!this.isBlockedOverlay||this.disableBlockedPopupOverlay&&this.isBlockedOverlay)}appendOverlay(){if(!this.overlay){ke({id:"link-googleapis",href:"https://fonts.googleapis.com"}),ke({id:"link-gstatic",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),ke({id:"link-roboto",href:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap",rel:"stylesheet"});let t=document.createElement("div");t.innerHTML=this.isBlockedOverlay?Tt():Rt(),document.body.insertAdjacentElement("beforeend",t),this.overlay=t;}}updateTryAgainButton(a){let t=document.getElementById(Ne);t&&(this.tryAgainListener&&t.removeEventListener("click",this.tryAgainListener),this.tryAgainListener=a,t.addEventListener("click",a));}updateCloseButton(a){let t=document.getElementById(Me);t&&(this.onCloseListener&&t.removeEventListener("click",this.onCloseListener),this.onCloseListener=a,t.addEventListener("click",a));}};var Ue=class{storage;constructor(a,t){this.storage=ka.createInstance({name:a,driver:t});}get length(){return this.storage.length()}clear(){return this.storage.clear()}getItem(a){return this.storage.getItem(a)}key(a){return this.storage.key(a)}async removeItem(a){await this.storage.removeItem(a);}async setItem(a,t){await this.storage.setItem(a,t);}};var za=500,ja={headers:{"Content-Type":"application/x-www-form-urlencoded"}},Ka="/v2/logout",$a="/im-logged-out",Xa="/authorize",Za=e=>e?$a:Ka,Ya=e=>{let{authenticationDomain:a,oidcConfiguration:t}=e,i;e.crossSdkBridgeEnabled?i=new Ue("ImmutableSDKPassport",ka.INDEXEDDB):typeof window<"u"?i=window.localStorage:i=new InMemoryWebStorage;let r=new WebStorageStateStore({store:i}),n=new URL(Za(e.crossSdkBridgeEnabled),a.replace(/^(?:https?:\/\/)?(.*)/,"https://$1"));return n.searchParams.set("client_id",t.clientId),t.logoutRedirectUri&&n.searchParams.set("returnTo",t.logoutRedirectUri),{authority:a,redirect_uri:t.redirectUri,popup_redirect_uri:t.popupRedirectUri||t.redirectUri,client_id:t.clientId,metadata:{authorization_endpoint:`${a}/authorize`,token_endpoint:`${a}/oauth/token`,userinfo_endpoint:`${a}/userinfo`,end_session_endpoint:n.toString(),revocation_endpoint:`${a}/oauth/revoke`},automaticSilentRenew:!1,scope:t.scope,userStore:r,revokeTokenTypes:["refresh_token"],extraQueryParams:{...t.audience?{audience:t.audience}:{}}}};function Xe(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}async function Qa(e){let t=new TextEncoder().encode(e);return await window.crypto.subtle.digest("SHA-256",t)}var Le=class e{userManager;deviceCredentialsManager;config;embeddedLoginPrompt;logoutMode;refreshingPromise=null;constructor(a,t){this.config=a,this.userManager=new UserManager(Ya(a)),this.deviceCredentialsManager=new ve,this.embeddedLoginPrompt=t,this.logoutMode=a.oidcConfiguration.logoutMode||"redirect";}static mapOidcUserToDomainModel=a=>{let t;a.id_token&&(t=vt(a.id_token)?.passport);let i={expired:a.expired,idToken:a.id_token,accessToken:a.access_token,refreshToken:a.refresh_token,profile:{sub:a.profile.sub,email:a.profile.email,nickname:a.profile.nickname}};return t?.imx_eth_address&&(i.imx={ethAddress:t.imx_eth_address,starkAddress:t.imx_stark_address,userAdminAddress:t.imx_user_admin_address}),t?.zkevm_eth_address&&(i.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),i};static mapDeviceTokenResponseToOidcUser=a=>{let t=vt(a.id_token);return new User({id_token:a.id_token,access_token:a.access_token,refresh_token:a.refresh_token,token_type:a.token_type,profile:{sub:t.sub,iss:t.iss,aud:t.aud,exp:t.exp,iat:t.iat,email:t.email,nickname:t.nickname,passport:t.passport}})};buildExtraQueryParams(a,t,i){let r={...this.userManager.settings?.extraQueryParams??{},rid:getDetail(Detail.RUNTIME_ID)||"",third_party_a_id:a||""};if(t){if(t.directLoginMethod==="email"){let n=t.email;n&&(r.direct=t.directLoginMethod,r.email=n);}else r.direct=t.directLoginMethod;t.marketingConsentStatus&&(r.marketingConsent=t.marketingConsentStatus);}return i&&(r.im_passport_trace_id=i),r}async loginWithRedirect(a,t){return await this.userManager.clearStaleState(),Q(async()=>{let i=this.buildExtraQueryParams(a,t);await this.userManager.signinRedirect({extraQueryParams:i});},"AUTHENTICATION_ERROR")}async login(a,t){return Q(async()=>{let i,r;if(t)i=t;else if(!this.config.popupOverlayOptions?.disableHeadlessLoginPromptOverlay){let{imPassportTraceId:o,...d}=await this.embeddedLoginPrompt.displayEmbeddedLoginPrompt(a);i=d,r=o;}let n=window.crypto.randomUUID(),s=async()=>{let o=this.buildExtraQueryParams(a,i,r),d=this.userManager.signinPopup({extraQueryParams:o,popupWindowFeatures:{width:410,height:450},popupWindowTarget:n}),c=window.open("",n);if(c){let l=new Promise((h,u)=>{let p=setInterval(()=>{c.closed&&(clearInterval(p),u(new Error("Popup closed by user")));},za);d.finally(()=>{clearInterval(p),c.close();});});return Promise.race([d,l])}return d};return new Promise((o,d)=>{s().then(c=>{o(e.mapOidcUserToDomainModel(c));}).catch(c=>{if(!(c instanceof Error)||c.message!=="Attempted to navigate on a disposed window"){d(c);return}let l=!1,h=new X(this.config.popupOverlayOptions||{},!0);h.append(async()=>{try{if(l)window.open("",n);else {l=!0;let u=await s();h.remove(),o(e.mapOidcUserToDomainModel(u));}}catch(u){h.remove(),d(u);}},()=>{h.remove(),d(new Error("Popup closed by user"));});});})},"AUTHENTICATION_ERROR")}async getUserOrLogin(){let a=null;try{a=await this.getUser();}catch(t){Ee.warn("Failed to retrieve a cached user session",t);}return a||this.login()}static shouldUseSigninPopupCallback(){try{let i=`oidc.${new URLSearchParams(window.location.search).get("state")}`,r=localStorage.getItem(i);return JSON.parse(r||"{}")?.request_type==="si:p"}catch{return !1}}async loginCallback(){return Q(async()=>{if(e.shouldUseSigninPopupCallback()){await this.userManager.signinPopupCallback(void 0,!0);return}let a=await this.userManager.signinCallback();if(a)return e.mapOidcUserToDomainModel(a)},"AUTHENTICATION_ERROR")}async getPKCEAuthorizationUrl(a,t){let i=Xe(window.crypto.getRandomValues(new Uint8Array(32))),r=Xe(await Qa(i)),n=Xe(window.crypto.getRandomValues(new Uint8Array(32))),{redirectUri:s,scope:o,audience:d,clientId:c}=this.config.oidcConfiguration;this.deviceCredentialsManager.savePKCEData({state:n,verifier:i});let l=new URL(Xa,this.config.authenticationDomain);if(l.searchParams.set("response_type","code"),l.searchParams.set("code_challenge",r),l.searchParams.set("code_challenge_method","S256"),l.searchParams.set("client_id",c),l.searchParams.set("redirect_uri",s),l.searchParams.set("state",n),o&&l.searchParams.set("scope",o),d&&l.searchParams.set("audience",d),a){if(a.directLoginMethod==="email"){let h=a.email;h&&(l.searchParams.set("direct",a.directLoginMethod),l.searchParams.set("email",h));}else l.searchParams.set("direct",a.directLoginMethod);a.marketingConsentStatus&&l.searchParams.set("marketingConsent",a.marketingConsentStatus);}return t&&l.searchParams.set("im_passport_trace_id",t),l.toString()}async loginWithPKCEFlowCallback(a,t){return Q(async()=>{let i=this.deviceCredentialsManager.getPKCEData();if(!i)throw new Error("No code verifier or state for PKCE");if(t!==i.state)throw new Error("Provided state does not match stored state");let r=await this.getPKCEToken(a,i.verifier),n=e.mapDeviceTokenResponseToOidcUser(r),s=e.mapOidcUserToDomainModel(n);return await this.userManager.storeUser(n),s},"AUTHENTICATION_ERROR")}async getPKCEToken(a,t){return (await m.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"authorization_code",code_verifier:t,code:a,redirect_uri:this.config.oidcConfiguration.redirectUri},ja)).data}async storeTokens(a){return Q(async()=>{let t=e.mapDeviceTokenResponseToOidcUser(a),i=e.mapOidcUserToDomainModel(t);return await this.userManager.storeUser(t),i},"AUTHENTICATION_ERROR")}async logout(){return Q(async()=>{await this.userManager.revokeTokens(["refresh_token"]),this.logoutMode==="silent"?await this.userManager.signoutSilent():await this.userManager.signoutRedirect();},"LOGOUT_ERROR")}async logoutSilentCallback(a){return this.userManager.signoutSilentCallback(a)}async removeUser(){return this.userManager.removeUser()}async getLogoutUrl(){let a=this.userManager.settings?.metadata?.end_session_endpoint;return a||(Ee.warn("Failed to get logout URL"),null)}forceUserRefreshInBackground(){this.refreshTokenAndUpdatePromise().catch(a=>{Ee.warn("Failed to refresh user token",a);});}async forceUserRefresh(){return this.refreshTokenAndUpdatePromise().catch(a=>(Ee.warn("Failed to refresh user token",a),null))}async refreshTokenAndUpdatePromise(){return this.refreshingPromise?this.refreshingPromise:(this.refreshingPromise=new Promise(async(a,t)=>{try{let i=await this.userManager.signinSilent();if(i){a(e.mapOidcUserToDomainModel(i));return}a(null);}catch(i){let r="AUTHENTICATION_ERROR",n="Failed to refresh token",s=!0;if(i instanceof ErrorTimeout?(r="SILENT_LOGIN_ERROR",n=`${n}: ${i.message}`,s=!1):i instanceof ErrorResponse?(r="NOT_LOGGED_IN_ERROR",n=`${n}: ${i.message||i.error_description}`):i instanceof Error?n=`${n}: ${i.message}`:typeof i=="string"&&(n=`${n}: ${i}`),s)try{await this.userManager.removeUser();}catch(o){o instanceof Error&&(n=`${n}: Failed to remove user: ${o.message}`);}t(new K(n,r));}finally{this.refreshingPromise=null;}}),this.refreshingPromise)}async getUser(a=t=>!0){if(this.refreshingPromise){let i=await this.refreshingPromise;return i&&a(i)?i:null}let t=await this.userManager.getUser();if(!t)return null;if(!ht(t)){let i=e.mapOidcUserToDomainModel(t);if(i&&a(i))return i}if(t.refresh_token){let i=await this.refreshTokenAndUpdatePromise();if(i&&a(i))return i}return null}async getUserZkEvm(){let a=await this.getUser(je);if(!a)throw new Error("Failed to obtain a User with the required ZkEvm attributes");return a}async getUserImx(){let a=await this.getUser(Ke);if(!a)throw new Error("Failed to obtain a User with the required IMX attributes");return a}};var Ja=(e,a,t)=>{let i=a.map(r=>!e[r]&&r).filter(r=>r).join(", ");if(i!==""){let r=`${i} cannot be null`;throw new K(r,"INVALID_CONFIGURATION")}},Ze=class{authenticationDomain;passportDomain;oidcConfiguration;crossSdkBridgeEnabled;popupOverlayOptions;constructor({authenticationDomain:a,passportDomain:t,crossSdkBridgeEnabled:i,popupOverlayOptions:r,...n}){Ja(n,["clientId","redirectUri"]),this.oidcConfiguration=n,this.crossSdkBridgeEnabled=i||!1,this.popupOverlayOptions=r,this.authenticationDomain=a||"https://auth.immutable.com",this.passportDomain=t||"https://passport.immutable.com";}};var er=Object.defineProperty,Je=(e,a)=>{for(var t in a)er(e,t,{get:a[t],enumerable:!0});},tr={};Je(tr,{AssetsApi:()=>nr,AssetsApiAxiosParamCreator:()=>Et,AssetsApiFactory:()=>rr,AssetsApiFp:()=>De,BalancesApi:()=>ir,BalancesApiAxiosParamCreator:()=>_t,BalancesApiFactory:()=>sr,BalancesApiFp:()=>Fe,CollectionsApi:()=>dr,CollectionsApiAxiosParamCreator:()=>At,CollectionsApiFactory:()=>or,CollectionsApiFp:()=>J,Configuration:()=>Dr,CreateExchangeAndURLAPIRequestProviderEnum:()=>Fr,CreateExchangeAndURLAPIRequestTypeEnum:()=>Br,CreateProjectGroupRequestChainTypeEnum:()=>Vr,DepositsApi:()=>lr,DepositsApiAxiosParamCreator:()=>St,DepositsApiFactory:()=>cr,DepositsApiFp:()=>Ae,EncodeAssetRequestTokenTypeEnum:()=>qr,EncodingApi:()=>ur,EncodingApiAxiosParamCreator:()=>Ot,EncodingApiFactory:()=>hr,EncodingApiFp:()=>et,ExchangesApi:()=>gr,ExchangesApiAxiosParamCreator:()=>It,ExchangesApiFactory:()=>pr,ExchangesApiFp:()=>de,FeeTokenTypeEnum:()=>Wr,GetMetadataRefreshResponseStatusEnum:()=>Gr,MetadataApi:()=>fr,MetadataApiAxiosParamCreator:()=>bt,MetadataApiFactory:()=>mr,MetadataApiFp:()=>Se,MetadataRefreshExcludingSummaryStatusEnum:()=>Hr,MetadataRefreshesApi:()=>Cr,MetadataRefreshesApiAxiosParamCreator:()=>wt,MetadataRefreshesApiFactory:()=>yr,MetadataRefreshesApiFp:()=>fe,MetadataSchemaRequestTypeEnum:()=>zr,MintsApi:()=>Rr,MintsApiAxiosParamCreator:()=>Pt,MintsApiFactory:()=>Tr,MintsApiFp:()=>ye,NftCheckoutPrimaryApi:()=>Er,NftCheckoutPrimaryApiAxiosParamCreator:()=>xt,NftCheckoutPrimaryApiFactory:()=>vr,NftCheckoutPrimaryApiFp:()=>ce,OrdersApi:()=>Ar,OrdersApiAxiosParamCreator:()=>Mt,OrdersApiFactory:()=>_r,OrdersApiFp:()=>ee,ProjectsApi:()=>Or,ProjectsApiAxiosParamCreator:()=>Nt,ProjectsApiFactory:()=>Sr,ProjectsApiFp:()=>tt,TokensApi:()=>br,TokensApiAxiosParamCreator:()=>kt,TokensApiFactory:()=>Ir,TokensApiFp:()=>Be,TradesApi:()=>Pr,TradesApiAxiosParamCreator:()=>Ut,TradesApiFactory:()=>wr,TradesApiFp:()=>Ce,TransfersApi:()=>Mr,TransfersApiAxiosParamCreator:()=>Lt,TransfersApiFactory:()=>xr,TransfersApiFp:()=>te,UsersApi:()=>kr,UsersApiAxiosParamCreator:()=>Dt,UsersApiFactory:()=>Nr,UsersApiFp:()=>ae,WithdrawalsApi:()=>Lr,WithdrawalsApiAxiosParamCreator:()=>Ft,WithdrawalsApiFactory:()=>Ur,WithdrawalsApiFp:()=>re});var E="https://api.sandbox.x.immutable.com".replace(/\/+$/,""),G=class{constructor(e,a=E,t=m){this.basePath=a,this.axios=t,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath);}configuration},ar=class extends Error{constructor(e,a){super(a),this.field=e;}name="RequiredError"},_="https://example.com",C=function(e,a,t){if(t==null)throw new ar(a,`Required parameter ${a} was null or undefined when calling ${e}.`)};function Ye(e,a,t=""){typeof a=="object"?Array.isArray(a)?a.forEach(i=>Ye(e,i,t)):Object.keys(a).forEach(i=>Ye(e,a[i],`${t}${t!==""?".":""}${i}`)):e.has(t)?e.append(t,a):e.set(t,a);}var A=function(e,...a){let t=new URLSearchParams(e.search);Ye(t,a),e.search=t.toString();},D=function(e,a,t){let i=typeof e!="string";return (i&&t&&t.isJsonMime?t.isJsonMime(a.headers["Content-Type"]):i)?JSON.stringify(e!==void 0?e:{}):e||""},S=function(e){return e.pathname+e.search+e.hash},O=function(e,a,t,i){return (r=a,n=t)=>{let s={...e.options,url:(i?.basePath||n)+e.url};return r.request(s)}},Et=function(e){return {getAsset:async(a,t,i,r={})=>{C("getAsset","tokenAddress",a),C("getAsset","tokenId",t);let n="/v1/assets/{token_address}/{token_id}".replace("{token_address}",encodeURIComponent(String(a))).replace("{token_id}",encodeURIComponent(String(t))),s=new URL(n,_),o;e&&(o=e.baseOptions);let d={method:"GET",...o,...r},c={},l={};i!==void 0&&(l.include_fees=i),A(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},{url:S(s),options:d}},listAssets:async(a,t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v={})=>{let T="/v1/assets",b=new URL(T,_),k;e&&(k=e.baseOptions);let N={method:"GET",...k,...v},L={},U={};a!==void 0&&(U.page_size=a),t!==void 0&&(U.cursor=t),i!==void 0&&(U.order_by=i),r!==void 0&&(U.direction=r),n!==void 0&&(U.user=n),s!==void 0&&(U.status=s),o!==void 0&&(U.name=o),d!==void 0&&(U.metadata=d),c!==void 0&&(U.sell_orders=c),l!==void 0&&(U.buy_orders=l),h!==void 0&&(U.include_fees=h),u!==void 0&&(U.collection=u),p!==void 0&&(U.updated_min_timestamp=p),g!==void 0&&(U.updated_max_timestamp=g),y!==void 0&&(U.auxiliary_fee_percentages=y),R!==void 0&&(U.auxiliary_fee_recipients=R),A(b,U);let F=k&&k.headers?k.headers:{};return N.headers={...L,...F,...v.headers},{url:S(b),options:N}}}},De=function(e){let a=Et(e);return {async getAsset(t,i,r,n){let s=await a.getAsset(t,i,r,n);return O(s,m,E,e)},async listAssets(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T){let b=await a.listAssets(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T);return O(b,m,E,e)}}},rr=function(e,a,t){let i=De(e);return {getAsset(r,n,s,o){return i.getAsset(r,n,s,o).then(d=>d(t,a))},listAssets(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k){return i.listAssets(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k).then(N=>N(t,a))}}},nr=class extends G{getAsset(e,a){return De(this.configuration).getAsset(e.tokenAddress,e.tokenId,e.includeFees,a).then(t=>t(this.axios,this.basePath))}listAssets(e={},a){return De(this.configuration).listAssets(e.pageSize,e.cursor,e.orderBy,e.direction,e.user,e.status,e.name,e.metadata,e.sellOrders,e.buyOrders,e.includeFees,e.collection,e.updatedMinTimestamp,e.updatedMaxTimestamp,e.auxiliaryFeePercentages,e.auxiliaryFeeRecipients,a).then(t=>t(this.axios,this.basePath))}},_t=function(e){return {getBalance:async(a,t,i={})=>{C("getBalance","owner",a),C("getBalance","address",t);let r="/v2/balances/{owner}/{address}".replace("{owner}",encodeURIComponent(String(a))).replace("{address}",encodeURIComponent(String(t))),n=new URL(r,_),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};A(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:S(n),options:o}},listBalances:async(a,t,i,r,n,s={})=>{C("listBalances","owner",a);let o="/v2/balances/{owner}".replace("{owner}",encodeURIComponent(String(a))),d=new URL(o,_),c;e&&(c=e.baseOptions);let l={method:"GET",...c,...s},h={},u={};t!==void 0&&(u.page_size=t),i!==void 0&&(u.cursor=i),r!==void 0&&(u.order_by=r),n!==void 0&&(u.direction=n),A(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},{url:S(d),options:l}}}},Fe=function(e){let a=_t(e);return {async getBalance(t,i,r){let n=await a.getBalance(t,i,r);return O(n,m,E,e)},async listBalances(t,i,r,n,s,o){let d=await a.listBalances(t,i,r,n,s,o);return O(d,m,E,e)}}},sr=function(e,a,t){let i=Fe(e);return {getBalance(r,n,s){return i.getBalance(r,n,s).then(o=>o(t,a))},listBalances(r,n,s,o,d,c){return i.listBalances(r,n,s,o,d,c).then(l=>l(t,a))}}},ir=class extends G{getBalance(e,a){return Fe(this.configuration).getBalance(e.owner,e.address,a).then(t=>t(this.axios,this.basePath))}listBalances(e,a){return Fe(this.configuration).listBalances(e.owner,e.pageSize,e.cursor,e.orderBy,e.direction,a).then(t=>t(this.axios,this.basePath))}},At=function(e){return {createCollection:async(a,t,i,r,n={})=>{C("createCollection","iMXSignature",a),C("createCollection","iMXTimestamp",t),C("createCollection","createCollectionRequest",i);let s="/v1/collections",o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"POST",...d,...n},l={},h={};a!=null&&(l["IMX-Signature"]=String(a)),t!=null&&(l["IMX-Timestamp"]=String(t)),r!=null&&(l["x-immutable-api-key"]=String(r)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(i,c,e),{url:S(o),options:c}},getCollection:async(a,t={})=>{C("getCollection","address",a);let i="/v1/collections/{address}".replace("{address}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},listCollectionFilters:async(a,t,i,r={})=>{C("listCollectionFilters","address",a);let n="/v1/collections/{address}/filters".replace("{address}",encodeURIComponent(String(a))),s=new URL(n,_),o;e&&(o=e.baseOptions);let d={method:"GET",...o,...r},c={},l={};t!==void 0&&(l.page_size=t),i!==void 0&&(l.next_page_token=i),A(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},{url:S(s),options:d}},listCollections:async(a,t,i,r,n,s,o,d={})=>{let c="/v1/collections",l=new URL(c,_),h;e&&(h=e.baseOptions);let u={method:"GET",...h,...d},p={},g={};a!==void 0&&(g.page_size=a),t!==void 0&&(g.cursor=t),i!==void 0&&(g.order_by=i),r!==void 0&&(g.direction=r),n!==void 0&&(g.blacklist=n),s!==void 0&&(g.whitelist=s),o!==void 0&&(g.keyword=o),A(l,g);let y=h&&h.headers?h.headers:{};return u.headers={...p,...y,...d.headers},{url:S(l),options:u}},summarizeCollections:async(a,t={})=>{C("summarizeCollections","user",a);let i="/v1/collections-summary",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={},d={};a!==void 0&&(d.user=a),A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},{url:S(r),options:s}},updateCollection:async(a,t,i,r,n={})=>{C("updateCollection","address",a),C("updateCollection","iMXSignature",t),C("updateCollection","iMXTimestamp",i),C("updateCollection","updateCollectionRequest",r);let s="/v1/collections/{address}".replace("{address}",encodeURIComponent(String(a))),o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"PATCH",...d,...n},l={},h={};t!=null&&(l["IMX-Signature"]=String(t)),i!=null&&(l["IMX-Timestamp"]=String(i)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(r,c,e),{url:S(o),options:c}}}},J=function(e){let a=At(e);return {async createCollection(t,i,r,n,s){let o=await a.createCollection(t,i,r,n,s);return O(o,m,E,e)},async getCollection(t,i){let r=await a.getCollection(t,i);return O(r,m,E,e)},async listCollectionFilters(t,i,r,n){let s=await a.listCollectionFilters(t,i,r,n);return O(s,m,E,e)},async listCollections(t,i,r,n,s,o,d,c){let l=await a.listCollections(t,i,r,n,s,o,d,c);return O(l,m,E,e)},async summarizeCollections(t,i){let r=await a.summarizeCollections(t,i);return O(r,m,E,e)},async updateCollection(t,i,r,n,s){let o=await a.updateCollection(t,i,r,n,s);return O(o,m,E,e)}}},or=function(e,a,t){let i=J(e);return {createCollection(r,n,s,o,d){return i.createCollection(r,n,s,o,d).then(c=>c(t,a))},getCollection(r,n){return i.getCollection(r,n).then(s=>s(t,a))},listCollectionFilters(r,n,s,o){return i.listCollectionFilters(r,n,s,o).then(d=>d(t,a))},listCollections(r,n,s,o,d,c,l,h){return i.listCollections(r,n,s,o,d,c,l,h).then(u=>u(t,a))},summarizeCollections(r,n){return i.summarizeCollections(r,n).then(s=>s(t,a))},updateCollection(r,n,s,o,d){return i.updateCollection(r,n,s,o,d).then(c=>c(t,a))}}},dr=class extends G{createCollection(e,a){return J(this.configuration).createCollection(e.iMXSignature,e.iMXTimestamp,e.createCollectionRequest,e.xImmutableApiKey,a).then(t=>t(this.axios,this.basePath))}getCollection(e,a){return J(this.configuration).getCollection(e.address,a).then(t=>t(this.axios,this.basePath))}listCollectionFilters(e,a){return J(this.configuration).listCollectionFilters(e.address,e.pageSize,e.nextPageToken,a).then(t=>t(this.axios,this.basePath))}listCollections(e={},a){return J(this.configuration).listCollections(e.pageSize,e.cursor,e.orderBy,e.direction,e.blacklist,e.whitelist,e.keyword,a).then(t=>t(this.axios,this.basePath))}summarizeCollections(e,a){return J(this.configuration).summarizeCollections(e.user,a).then(t=>t(this.axios,this.basePath))}updateCollection(e,a){return J(this.configuration).updateCollection(e.address,e.iMXSignature,e.iMXTimestamp,e.updateCollectionRequest,a).then(t=>t(this.axios,this.basePath))}},St=function(e){return {getDeposit:async(a,t={})=>{C("getDeposit","id",a);let i="/v1/deposits/{id}".replace("{id}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},getSignableDeposit:async(a,t={})=>{C("getSignableDeposit","getSignableDepositRequest",a);let i="/v1/signable-deposit-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},listDeposits:async(a,t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v={})=>{let T="/v1/deposits",b=new URL(T,_),k;e&&(k=e.baseOptions);let N={method:"GET",...k,...v},L={},U={};a!==void 0&&(U.page_size=a),t!==void 0&&(U.cursor=t),i!==void 0&&(U.order_by=i),r!==void 0&&(U.direction=r),n!==void 0&&(U.user=n),s!==void 0&&(U.status=s),o!==void 0&&(U.min_timestamp=o),d!==void 0&&(U.max_timestamp=d),c!==void 0&&(U.token_type=c),l!==void 0&&(U.token_id=l),h!==void 0&&(U.asset_id=h),u!==void 0&&(U.token_address=u),p!==void 0&&(U.token_name=p),g!==void 0&&(U.min_quantity=g),y!==void 0&&(U.max_quantity=y),R!==void 0&&(U.metadata=R),A(b,U);let F=k&&k.headers?k.headers:{};return N.headers={...L,...F,...v.headers},{url:S(b),options:N}}}},Ae=function(e){let a=St(e);return {async getDeposit(t,i){let r=await a.getDeposit(t,i);return O(r,m,E,e)},async getSignableDeposit(t,i){let r=await a.getSignableDeposit(t,i);return O(r,m,E,e)},async listDeposits(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T){let b=await a.listDeposits(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T);return O(b,m,E,e)}}},cr=function(e,a,t){let i=Ae(e);return {getDeposit(r,n){return i.getDeposit(r,n).then(s=>s(t,a))},getSignableDeposit(r,n){return i.getSignableDeposit(r,n).then(s=>s(t,a))},listDeposits(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k){return i.listDeposits(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k).then(N=>N(t,a))}}},lr=class extends G{getDeposit(e,a){return Ae(this.configuration).getDeposit(e.id,a).then(t=>t(this.axios,this.basePath))}getSignableDeposit(e,a){return Ae(this.configuration).getSignableDeposit(e.getSignableDepositRequest,a).then(t=>t(this.axios,this.basePath))}listDeposits(e={},a){return Ae(this.configuration).listDeposits(e.pageSize,e.cursor,e.orderBy,e.direction,e.user,e.status,e.minTimestamp,e.maxTimestamp,e.tokenType,e.tokenId,e.assetId,e.tokenAddress,e.tokenName,e.minQuantity,e.maxQuantity,e.metadata,a).then(t=>t(this.axios,this.basePath))}},Ot=function(e){return {encodeAsset:async(a,t,i={})=>{C("encodeAsset","assetType",a),C("encodeAsset","encodeAssetRequest",t);let r="/v1/encode/{assetType}".replace("{assetType}",encodeURIComponent(String(a))),n=new URL(r,_),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};d["Content-Type"]="application/json",A(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=D(t,o,e),{url:S(n),options:o}}}},et=function(e){let a=Ot(e);return {async encodeAsset(t,i,r){let n=await a.encodeAsset(t,i,r);return O(n,m,E,e)}}},hr=function(e,a,t){let i=et(e);return {encodeAsset(r,n,s){return i.encodeAsset(r,n,s).then(o=>o(t,a))}}},ur=class extends G{encodeAsset(e,a){return et(this.configuration).encodeAsset(e.assetType,e.encodeAssetRequest,a).then(t=>t(this.axios,this.basePath))}},It=function(e){return {createExchange:async(a,t={})=>{C("createExchange","createExchangeAPIRequest",a);let i="/v3/exchanges",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},createExchangeTransfer:async(a,t,i,r,n,s={})=>{C("createExchangeTransfer","id",a),C("createExchangeTransfer","createTransferRequest",t);let o="/v2/exchanges/{id}/transfers".replace("{id}",encodeURIComponent(String(a))),d=new URL(o,_),c;e&&(c=e.baseOptions);let l={method:"POST",...c,...s},h={},u={};i!=null&&(h["x-imx-eth-address"]=String(i)),r!=null&&(h["x-imx-eth-signature"]=String(r)),n!=null&&(h.Authorization=String(n)),h["Content-Type"]="application/json",A(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},l.data=D(t,l,e),{url:S(d),options:l}},getExchange:async(a,t={})=>{C("getExchange","id",a);let i="/v3/exchanges/{id}".replace("{id}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},getExchangeSignableTransfer:async(a,t,i={})=>{C("getExchangeSignableTransfer","id",a),C("getExchangeSignableTransfer","getSignableTransferRequest",t);let r="/v2/exchanges/{id}/signable-transfer-details".replace("{id}",encodeURIComponent(String(a))),n=new URL(r,_),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};d["Content-Type"]="application/json",A(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=D(t,o,e),{url:S(n),options:o}},getExchanges:async(a,t,i,r,n,s,o,d,c,l={})=>{let h="/v3/exchanges",u=new URL(h,_),p;e&&(p=e.baseOptions);let g={method:"GET",...p,...l},y={},R={};a!==void 0&&(R.page_size=a),t!==void 0&&(R.cursor=t),i!==void 0&&(R.order_by=i),r!==void 0&&(R.direction=r),n!==void 0&&(R.id=n),s!==void 0&&(R.wallet_address=s),o!==void 0&&(R.status=o),d!==void 0&&(R.provider=d),c!==void 0&&(R.transfer_id=c),A(u,R);let v=p&&p.headers?p.headers:{};return g.headers={...y,...v,...l.headers},{url:S(u),options:g}}}},de=function(e){let a=It(e);return {async createExchange(t,i){let r=await a.createExchange(t,i);return O(r,m,E,e)},async createExchangeTransfer(t,i,r,n,s,o){let d=await a.createExchangeTransfer(t,i,r,n,s,o);return O(d,m,E,e)},async getExchange(t,i){let r=await a.getExchange(t,i);return O(r,m,E,e)},async getExchangeSignableTransfer(t,i,r){let n=await a.getExchangeSignableTransfer(t,i,r);return O(n,m,E,e)},async getExchanges(t,i,r,n,s,o,d,c,l,h){let u=await a.getExchanges(t,i,r,n,s,o,d,c,l,h);return O(u,m,E,e)}}},pr=function(e,a,t){let i=de(e);return {createExchange(r,n){return i.createExchange(r,n).then(s=>s(t,a))},createExchangeTransfer(r,n,s,o,d,c){return i.createExchangeTransfer(r,n,s,o,d,c).then(l=>l(t,a))},getExchange(r,n){return i.getExchange(r,n).then(s=>s(t,a))},getExchangeSignableTransfer(r,n,s){return i.getExchangeSignableTransfer(r,n,s).then(o=>o(t,a))},getExchanges(r,n,s,o,d,c,l,h,u,p){return i.getExchanges(r,n,s,o,d,c,l,h,u,p).then(g=>g(t,a))}}},gr=class extends G{createExchange(e,a){return de(this.configuration).createExchange(e.createExchangeAPIRequest,a).then(t=>t(this.axios,this.basePath))}createExchangeTransfer(e,a){return de(this.configuration).createExchangeTransfer(e.id,e.createTransferRequest,e.xImxEthAddress,e.xImxEthSignature,e.authorization,a).then(t=>t(this.axios,this.basePath))}getExchange(e,a){return de(this.configuration).getExchange(e.id,a).then(t=>t(this.axios,this.basePath))}getExchangeSignableTransfer(e,a){return de(this.configuration).getExchangeSignableTransfer(e.id,e.getSignableTransferRequest,a).then(t=>t(this.axios,this.basePath))}getExchanges(e={},a){return de(this.configuration).getExchanges(e.pageSize,e.cursor,e.orderBy,e.direction,e.id,e.walletAddress,e.status,e.provider,e.transferId,a).then(t=>t(this.axios,this.basePath))}},bt=function(e){return {addMetadataSchemaToCollection:async(a,t,i,r,n={})=>{C("addMetadataSchemaToCollection","address",a),C("addMetadataSchemaToCollection","iMXSignature",t),C("addMetadataSchemaToCollection","iMXTimestamp",i),C("addMetadataSchemaToCollection","addMetadataSchemaToCollectionRequest",r);let s="/v1/collections/{address}/metadata-schema".replace("{address}",encodeURIComponent(String(a))),o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"POST",...d,...n},l={},h={};t!=null&&(l["IMX-Signature"]=String(t)),i!=null&&(l["IMX-Timestamp"]=String(i)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(r,c,e),{url:S(o),options:c}},getMetadataSchema:async(a,t={})=>{C("getMetadataSchema","address",a);let i="/v1/collections/{address}/metadata-schema".replace("{address}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},updateMetadataSchemaByName:async(a,t,i,r,n,s={})=>{C("updateMetadataSchemaByName","address",a),C("updateMetadataSchemaByName","name",t),C("updateMetadataSchemaByName","iMXSignature",i),C("updateMetadataSchemaByName","iMXTimestamp",r),C("updateMetadataSchemaByName","metadataSchemaRequest",n);let o="/v1/collections/{address}/metadata-schema/{name}".replace("{address}",encodeURIComponent(String(a))).replace("{name}",encodeURIComponent(String(t))),d=new URL(o,_),c;e&&(c=e.baseOptions);let l={method:"PATCH",...c,...s},h={},u={};i!=null&&(h["IMX-Signature"]=String(i)),r!=null&&(h["IMX-Timestamp"]=String(r)),h["Content-Type"]="application/json",A(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},l.data=D(n,l,e),{url:S(d),options:l}}}},Se=function(e){let a=bt(e);return {async addMetadataSchemaToCollection(t,i,r,n,s){let o=await a.addMetadataSchemaToCollection(t,i,r,n,s);return O(o,m,E,e)},async getMetadataSchema(t,i){let r=await a.getMetadataSchema(t,i);return O(r,m,E,e)},async updateMetadataSchemaByName(t,i,r,n,s,o){let d=await a.updateMetadataSchemaByName(t,i,r,n,s,o);return O(d,m,E,e)}}},mr=function(e,a,t){let i=Se(e);return {addMetadataSchemaToCollection(r,n,s,o,d){return i.addMetadataSchemaToCollection(r,n,s,o,d).then(c=>c(t,a))},getMetadataSchema(r,n){return i.getMetadataSchema(r,n).then(s=>s(t,a))},updateMetadataSchemaByName(r,n,s,o,d,c){return i.updateMetadataSchemaByName(r,n,s,o,d,c).then(l=>l(t,a))}}},fr=class extends G{addMetadataSchemaToCollection(e,a){return Se(this.configuration).addMetadataSchemaToCollection(e.address,e.iMXSignature,e.iMXTimestamp,e.addMetadataSchemaToCollectionRequest,a).then(t=>t(this.axios,this.basePath))}getMetadataSchema(e,a){return Se(this.configuration).getMetadataSchema(e.address,a).then(t=>t(this.axios,this.basePath))}updateMetadataSchemaByName(e,a){return Se(this.configuration).updateMetadataSchemaByName(e.address,e.name,e.iMXSignature,e.iMXTimestamp,e.metadataSchemaRequest,a).then(t=>t(this.axios,this.basePath))}},wt=function(e){return {getAListOfMetadataRefreshes:async(a,t,i,r,n,s,o={})=>{C("getAListOfMetadataRefreshes","xImxEthSignature",a),C("getAListOfMetadataRefreshes","xImxEthTimestamp",t),C("getAListOfMetadataRefreshes","xImxEthAddress",i);let d="/v1/metadata-refreshes",c=new URL(d,_),l;e&&(l=e.baseOptions);let h={method:"GET",...l,...o},u={},p={};r!==void 0&&(p.page_size=r),n!==void 0&&(p.cursor=n),s!==void 0&&(p.collection_address=s),a!=null&&(u["x-imx-eth-signature"]=String(a)),t!=null&&(u["x-imx-eth-timestamp"]=String(t)),i!=null&&(u["x-imx-eth-address"]=String(i)),A(c,p);let g=l&&l.headers?l.headers:{};return h.headers={...u,...g,...o.headers},{url:S(c),options:h}},getMetadataRefreshErrors:async(a,t,i,r,n,s,o={})=>{C("getMetadataRefreshErrors","refreshId",a),C("getMetadataRefreshErrors","xImxEthSignature",t),C("getMetadataRefreshErrors","xImxEthTimestamp",i),C("getMetadataRefreshErrors","xImxEthAddress",r);let d="/v1/metadata-refreshes/{refresh_id}/errors".replace("{refresh_id}",encodeURIComponent(String(a))),c=new URL(d,_),l;e&&(l=e.baseOptions);let h={method:"GET",...l,...o},u={},p={};n!==void 0&&(p.page_size=n),s!==void 0&&(p.cursor=s),t!=null&&(u["x-imx-eth-signature"]=String(t)),i!=null&&(u["x-imx-eth-timestamp"]=String(i)),r!=null&&(u["x-imx-eth-address"]=String(r)),A(c,p);let g=l&&l.headers?l.headers:{};return h.headers={...u,...g,...o.headers},{url:S(c),options:h}},getMetadataRefreshResults:async(a,t,i,r,n={})=>{C("getMetadataRefreshResults","refreshId",a),C("getMetadataRefreshResults","xImxEthSignature",t),C("getMetadataRefreshResults","xImxEthTimestamp",i),C("getMetadataRefreshResults","xImxEthAddress",r);let s="/v1/metadata-refreshes/{refresh_id}".replace("{refresh_id}",encodeURIComponent(String(a))),o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"GET",...d,...n},l={},h={};t!=null&&(l["x-imx-eth-signature"]=String(t)),i!=null&&(l["x-imx-eth-timestamp"]=String(i)),r!=null&&(l["x-imx-eth-address"]=String(r)),A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},{url:S(o),options:c}},requestAMetadataRefresh:async(a,t,i,r,n={})=>{C("requestAMetadataRefresh","xImxEthSignature",a),C("requestAMetadataRefresh","xImxEthTimestamp",t),C("requestAMetadataRefresh","xImxEthAddress",i),C("requestAMetadataRefresh","createMetadataRefreshRequest",r);let s="/v1/metadata-refreshes",o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"POST",...d,...n},l={},h={};a!=null&&(l["x-imx-eth-signature"]=String(a)),t!=null&&(l["x-imx-eth-timestamp"]=String(t)),i!=null&&(l["x-imx-eth-address"]=String(i)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(r,c,e),{url:S(o),options:c}}}},fe=function(e){let a=wt(e);return {async getAListOfMetadataRefreshes(t,i,r,n,s,o,d){let c=await a.getAListOfMetadataRefreshes(t,i,r,n,s,o,d);return O(c,m,E,e)},async getMetadataRefreshErrors(t,i,r,n,s,o,d){let c=await a.getMetadataRefreshErrors(t,i,r,n,s,o,d);return O(c,m,E,e)},async getMetadataRefreshResults(t,i,r,n,s){let o=await a.getMetadataRefreshResults(t,i,r,n,s);return O(o,m,E,e)},async requestAMetadataRefresh(t,i,r,n,s){let o=await a.requestAMetadataRefresh(t,i,r,n,s);return O(o,m,E,e)}}},yr=function(e,a,t){let i=fe(e);return {getAListOfMetadataRefreshes(r,n,s,o,d,c,l){return i.getAListOfMetadataRefreshes(r,n,s,o,d,c,l).then(h=>h(t,a))},getMetadataRefreshErrors(r,n,s,o,d,c,l){return i.getMetadataRefreshErrors(r,n,s,o,d,c,l).then(h=>h(t,a))},getMetadataRefreshResults(r,n,s,o,d){return i.getMetadataRefreshResults(r,n,s,o,d).then(c=>c(t,a))},requestAMetadataRefresh(r,n,s,o,d){return i.requestAMetadataRefresh(r,n,s,o,d).then(c=>c(t,a))}}},Cr=class extends G{getAListOfMetadataRefreshes(e,a){return fe(this.configuration).getAListOfMetadataRefreshes(e.xImxEthSignature,e.xImxEthTimestamp,e.xImxEthAddress,e.pageSize,e.cursor,e.collectionAddress,a).then(t=>t(this.axios,this.basePath))}getMetadataRefreshErrors(e,a){return fe(this.configuration).getMetadataRefreshErrors(e.refreshId,e.xImxEthSignature,e.xImxEthTimestamp,e.xImxEthAddress,e.pageSize,e.cursor,a).then(t=>t(this.axios,this.basePath))}getMetadataRefreshResults(e,a){return fe(this.configuration).getMetadataRefreshResults(e.refreshId,e.xImxEthSignature,e.xImxEthTimestamp,e.xImxEthAddress,a).then(t=>t(this.axios,this.basePath))}requestAMetadataRefresh(e,a){return fe(this.configuration).requestAMetadataRefresh(e.xImxEthSignature,e.xImxEthTimestamp,e.xImxEthAddress,e.createMetadataRefreshRequest,a).then(t=>t(this.axios,this.basePath))}},Pt=function(e){return {getMint:async(a,t={})=>{C("getMint","id",a);let i="/v1/mints/{id}".replace("{id}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},getMintableTokenDetailsByClientTokenId:async(a,t,i={})=>{C("getMintableTokenDetailsByClientTokenId","tokenAddress",a),C("getMintableTokenDetailsByClientTokenId","tokenId",t);let r="/v1/mintable-token/{token_address}/{token_id}".replace("{token_address}",encodeURIComponent(String(a))).replace("{token_id}",encodeURIComponent(String(t))),n=new URL(r,_),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};A(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:S(n),options:o}},listMints:async(a,t,i,r,n,s,o,d,c,l,h,u,p,g,y,R={})=>{let v="/v1/mints",T=new URL(v,_),b;e&&(b=e.baseOptions);let k={method:"GET",...b,...R},N={},L={};a!==void 0&&(L.page_size=a),t!==void 0&&(L.cursor=t),i!==void 0&&(L.order_by=i),r!==void 0&&(L.direction=r),n!==void 0&&(L.user=n),s!==void 0&&(L.status=s),o!==void 0&&(L.min_timestamp=o),d!==void 0&&(L.max_timestamp=d),c!==void 0&&(L.token_type=c),l!==void 0&&(L.token_id=l),h!==void 0&&(L.token_name=h),u!==void 0&&(L.token_address=u),p!==void 0&&(L.min_quantity=p),g!==void 0&&(L.max_quantity=g),y!==void 0&&(L.metadata=y),A(T,L);let U=b&&b.headers?b.headers:{};return k.headers={...N,...U,...R.headers},{url:S(T),options:k}},mintTokens:async(a,t={})=>{C("mintTokens","mintTokensRequestV2",a);let i="/v2/mints",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}}}},ye=function(e){let a=Pt(e);return {async getMint(t,i){let r=await a.getMint(t,i);return O(r,m,E,e)},async getMintableTokenDetailsByClientTokenId(t,i,r){let n=await a.getMintableTokenDetailsByClientTokenId(t,i,r);return O(n,m,E,e)},async listMints(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v){let T=await a.listMints(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v);return O(T,m,E,e)},async mintTokens(t,i){let r=await a.mintTokens(t,i);return O(r,m,E,e)}}},Tr=function(e,a,t){let i=ye(e);return {getMint(r,n){return i.getMint(r,n).then(s=>s(t,a))},getMintableTokenDetailsByClientTokenId(r,n,s){return i.getMintableTokenDetailsByClientTokenId(r,n,s).then(o=>o(t,a))},listMints(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b){return i.listMints(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b).then(k=>k(t,a))},mintTokens(r,n){return i.mintTokens(r,n).then(s=>s(t,a))}}},Rr=class extends G{getMint(e,a){return ye(this.configuration).getMint(e.id,a).then(t=>t(this.axios,this.basePath))}getMintableTokenDetailsByClientTokenId(e,a){return ye(this.configuration).getMintableTokenDetailsByClientTokenId(e.tokenAddress,e.tokenId,a).then(t=>t(this.axios,this.basePath))}listMints(e={},a){return ye(this.configuration).listMints(e.pageSize,e.cursor,e.orderBy,e.direction,e.user,e.status,e.minTimestamp,e.maxTimestamp,e.tokenType,e.tokenId,e.tokenName,e.tokenAddress,e.minQuantity,e.maxQuantity,e.metadata,a).then(t=>t(this.axios,this.basePath))}mintTokens(e,a){return ye(this.configuration).mintTokens(e.mintTokensRequestV2,a).then(t=>t(this.axios,this.basePath))}},xt=function(e){return {createNftPrimary:async(a,t={})=>{C("createNftPrimary","createAPIRequest",a);let i="/v2/nft/primary",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getCurrenciesNFTCheckoutPrimary:async(a,t,i={})=>{let r="/v2/nft/primary/currencies",n=new URL(r,_),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={},c={};a!==void 0&&(c.provider=a),t!==void 0&&(c.include_limits=t),A(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},{url:S(n),options:o}},getNftPrimaryTransaction:async(a,t={})=>{C("getNftPrimaryTransaction","transactionId",a);let i="/v2/nft/primary/{transaction_id}".replace("{transaction_id}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},getNftPrimaryTransactions:async(a,t,i,r,n,s,o,d,c,l,h,u={})=>{let p="/v2/nft/primary",g=new URL(p,_),y;e&&(y=e.baseOptions);let R={method:"GET",...y,...u},v={},T={};a!==void 0&&(T.page_size=a),t!==void 0&&(T.cursor=t),i!==void 0&&(T.order_by=i),r!==void 0&&(T.direction=r),n!==void 0&&(T.transaction_id=n),s!==void 0&&(T.contract_address=s),o!==void 0&&(T.seller_wallet_address=o),d!==void 0&&(T.user_wallet_address=d),c!==void 0&&(T.status=c),l!==void 0&&(T.provider=l),h!==void 0&&(T.mint_id=h),A(g,T);let b=y&&y.headers?y.headers:{};return R.headers={...v,...b,...u.headers},{url:S(g),options:R}},registerNftPrimarySalesContract:async(a,t={})=>{C("registerNftPrimarySalesContract","createAPIRequest",a);let i="/v2/nft/primary/register",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}}}},ce=function(e){let a=xt(e);return {async createNftPrimary(t,i){let r=await a.createNftPrimary(t,i);return O(r,m,E,e)},async getCurrenciesNFTCheckoutPrimary(t,i,r){let n=await a.getCurrenciesNFTCheckoutPrimary(t,i,r);return O(n,m,E,e)},async getNftPrimaryTransaction(t,i){let r=await a.getNftPrimaryTransaction(t,i);return O(r,m,E,e)},async getNftPrimaryTransactions(t,i,r,n,s,o,d,c,l,h,u,p){let g=await a.getNftPrimaryTransactions(t,i,r,n,s,o,d,c,l,h,u,p);return O(g,m,E,e)},async registerNftPrimarySalesContract(t,i){let r=await a.registerNftPrimarySalesContract(t,i);return O(r,m,E,e)}}},vr=function(e,a,t){let i=ce(e);return {createNftPrimary(r,n){return i.createNftPrimary(r,n).then(s=>s(t,a))},getCurrenciesNFTCheckoutPrimary(r,n,s){return i.getCurrenciesNFTCheckoutPrimary(r,n,s).then(o=>o(t,a))},getNftPrimaryTransaction(r,n){return i.getNftPrimaryTransaction(r,n).then(s=>s(t,a))},getNftPrimaryTransactions(r,n,s,o,d,c,l,h,u,p,g,y){return i.getNftPrimaryTransactions(r,n,s,o,d,c,l,h,u,p,g,y).then(R=>R(t,a))},registerNftPrimarySalesContract(r,n){return i.registerNftPrimarySalesContract(r,n).then(s=>s(t,a))}}},Er=class extends G{createNftPrimary(e,a){return ce(this.configuration).createNftPrimary(e.createAPIRequest,a).then(t=>t(this.axios,this.basePath))}getCurrenciesNFTCheckoutPrimary(e={},a){return ce(this.configuration).getCurrenciesNFTCheckoutPrimary(e.provider,e.includeLimits,a).then(t=>t(this.axios,this.basePath))}getNftPrimaryTransaction(e,a){return ce(this.configuration).getNftPrimaryTransaction(e.transactionId,a).then(t=>t(this.axios,this.basePath))}getNftPrimaryTransactions(e={},a){return ce(this.configuration).getNftPrimaryTransactions(e.pageSize,e.cursor,e.orderBy,e.direction,e.transactionId,e.contractAddress,e.sellerWalletAddress,e.userWalletAddress,e.status,e.provider,e.mintId,a).then(t=>t(this.axios,this.basePath))}registerNftPrimarySalesContract(e,a){return ce(this.configuration).registerNftPrimarySalesContract(e.createAPIRequest,a).then(t=>t(this.axios,this.basePath))}},Mt=function(e){return {cancelOrderV3:async(a,t,i,r,n,s={})=>{C("cancelOrderV3","id",a),C("cancelOrderV3","cancelOrderRequest",t);let o="/v3/orders/{id}".replace("{id}",encodeURIComponent(String(a))),d=new URL(o,_),c;e&&(c=e.baseOptions);let l={method:"DELETE",...c,...s},h={},u={};i!=null&&(h["x-imx-eth-address"]=String(i)),r!=null&&(h["x-imx-eth-signature"]=String(r)),n!=null&&(h.Authorization=String(n)),h["Content-Type"]="application/json",A(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},l.data=D(t,l,e),{url:S(d),options:l}},createOrderV3:async(a,t,i,r,n={})=>{C("createOrderV3","createOrderRequest",a);let s="/v3/orders",o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"POST",...d,...n},l={},h={};t!=null&&(l["x-imx-eth-address"]=String(t)),i!=null&&(l["x-imx-eth-signature"]=String(i)),r!=null&&(l.Authorization=String(r)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(a,c,e),{url:S(o),options:c}},getOrderV3:async(a,t,i,r,n={})=>{C("getOrderV3","id",a);let s="/v3/orders/{id}".replace("{id}",encodeURIComponent(String(a))),o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"GET",...d,...n},l={},h={};t!==void 0&&(h.include_fees=t),i!==void 0&&(h.auxiliary_fee_percentages=i),r!==void 0&&(h.auxiliary_fee_recipients=r),A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},{url:S(o),options:c}},getSignableCancelOrderV3:async(a,t={})=>{C("getSignableCancelOrderV3","getSignableCancelOrderRequest",a);let i="/v3/signable-cancel-order-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getSignableOrder:async(a,t={})=>{C("getSignableOrder","getSignableOrderRequestV3",a);let i="/v3/signable-order-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},listOrdersV3:async(a,t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N,L,U,F,V,Y,le,he,ue,pe={})=>{let Re="/v3/orders",ge=new URL(Re,_),oe;e&&(oe=e.baseOptions);let Pe={method:"GET",...oe,...pe},_a={},B={};a!==void 0&&(B.page_size=a),t!==void 0&&(B.cursor=t),i!==void 0&&(B.order_by=i),r!==void 0&&(B.direction=r),n!==void 0&&(B.user=n),s!==void 0&&(B.status=s),o!==void 0&&(B.min_timestamp=o),d!==void 0&&(B.max_timestamp=d),c!==void 0&&(B.updated_min_timestamp=c),l!==void 0&&(B.updated_max_timestamp=l),h!==void 0&&(B.buy_token_type=h),u!==void 0&&(B.buy_token_id=u),p!==void 0&&(B.buy_asset_id=p),g!==void 0&&(B.buy_token_address=g),y!==void 0&&(B.buy_token_name=y),R!==void 0&&(B.buy_min_quantity=R),v!==void 0&&(B.buy_max_quantity=v),T!==void 0&&(B.buy_metadata=T),b!==void 0&&(B.sell_token_type=b),k!==void 0&&(B.sell_token_id=k),N!==void 0&&(B.sell_asset_id=N),L!==void 0&&(B.sell_token_address=L),U!==void 0&&(B.sell_token_name=U),F!==void 0&&(B.sell_min_quantity=F),V!==void 0&&(B.sell_max_quantity=V),Y!==void 0&&(B.sell_metadata=Y),le!==void 0&&(B.auxiliary_fee_percentages=le),he!==void 0&&(B.auxiliary_fee_recipients=he),ue!==void 0&&(B.include_fees=ue),A(ge,B);let Aa=oe&&oe.headers?oe.headers:{};return Pe.headers={..._a,...Aa,...pe.headers},{url:S(ge),options:Pe}}}},ee=function(e){let a=Mt(e);return {async cancelOrderV3(t,i,r,n,s,o){let d=await a.cancelOrderV3(t,i,r,n,s,o);return O(d,m,E,e)},async createOrderV3(t,i,r,n,s){let o=await a.createOrderV3(t,i,r,n,s);return O(o,m,E,e)},async getOrderV3(t,i,r,n,s){let o=await a.getOrderV3(t,i,r,n,s);return O(o,m,E,e)},async getSignableCancelOrderV3(t,i){let r=await a.getSignableCancelOrderV3(t,i);return O(r,m,E,e)},async getSignableOrder(t,i){let r=await a.getSignableOrder(t,i);return O(r,m,E,e)},async listOrdersV3(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N,L,U,F,V,Y,le,he,ue,pe,Re){let ge=await a.listOrdersV3(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N,L,U,F,V,Y,le,he,ue,pe,Re);return O(ge,m,E,e)}}},_r=function(e,a,t){let i=ee(e);return {cancelOrderV3(r,n,s,o,d,c){return i.cancelOrderV3(r,n,s,o,d,c).then(l=>l(t,a))},createOrderV3(r,n,s,o,d){return i.createOrderV3(r,n,s,o,d).then(c=>c(t,a))},getOrderV3(r,n,s,o,d){return i.getOrderV3(r,n,s,o,d).then(c=>c(t,a))},getSignableCancelOrderV3(r,n){return i.getSignableCancelOrderV3(r,n).then(s=>s(t,a))},getSignableOrder(r,n){return i.getSignableOrder(r,n).then(s=>s(t,a))},listOrdersV3(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N,L,U,F,V,Y,le,he,ue,pe,Re,ge,oe){return i.listOrdersV3(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N,L,U,F,V,Y,le,he,ue,pe,Re,ge,oe).then(Pe=>Pe(t,a))}}},Ar=class extends G{cancelOrderV3(e,a){return ee(this.configuration).cancelOrderV3(e.id,e.cancelOrderRequest,e.xImxEthAddress,e.xImxEthSignature,e.authorization,a).then(t=>t(this.axios,this.basePath))}createOrderV3(e,a){return ee(this.configuration).createOrderV3(e.createOrderRequest,e.xImxEthAddress,e.xImxEthSignature,e.authorization,a).then(t=>t(this.axios,this.basePath))}getOrderV3(e,a){return ee(this.configuration).getOrderV3(e.id,e.includeFees,e.auxiliaryFeePercentages,e.auxiliaryFeeRecipients,a).then(t=>t(this.axios,this.basePath))}getSignableCancelOrderV3(e,a){return ee(this.configuration).getSignableCancelOrderV3(e.getSignableCancelOrderRequest,a).then(t=>t(this.axios,this.basePath))}getSignableOrder(e,a){return ee(this.configuration).getSignableOrder(e.getSignableOrderRequestV3,a).then(t=>t(this.axios,this.basePath))}listOrdersV3(e={},a){return ee(this.configuration).listOrdersV3(e.pageSize,e.cursor,e.orderBy,e.direction,e.user,e.status,e.minTimestamp,e.maxTimestamp,e.updatedMinTimestamp,e.updatedMaxTimestamp,e.buyTokenType,e.buyTokenId,e.buyAssetId,e.buyTokenAddress,e.buyTokenName,e.buyMinQuantity,e.buyMaxQuantity,e.buyMetadata,e.sellTokenType,e.sellTokenId,e.sellAssetId,e.sellTokenAddress,e.sellTokenName,e.sellMinQuantity,e.sellMaxQuantity,e.sellMetadata,e.auxiliaryFeePercentages,e.auxiliaryFeeRecipients,e.includeFees,a).then(t=>t(this.axios,this.basePath))}},Nt=function(e){return {getProject:async(a,t,i,r={})=>{C("getProject","id",a),C("getProject","iMXSignature",t),C("getProject","iMXTimestamp",i);let n="/v1/projects/{id}".replace("{id}",encodeURIComponent(String(a))),s=new URL(n,_),o;e&&(o=e.baseOptions);let d={method:"GET",...o,...r},c={},l={};t!=null&&(c["IMX-Signature"]=String(t)),i!=null&&(c["IMX-Timestamp"]=String(i)),A(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},{url:S(s),options:d}}}},tt=function(e){let a=Nt(e);return {async getProject(t,i,r,n){let s=await a.getProject(t,i,r,n);return O(s,m,E,e)}}},Sr=function(e,a,t){let i=tt(e);return {getProject(r,n,s,o){return i.getProject(r,n,s,o).then(d=>d(t,a))}}},Or=class extends G{getProject(e,a){return tt(this.configuration).getProject(e.id,e.iMXSignature,e.iMXTimestamp,a).then(t=>t(this.axios,this.basePath))}},kt=function(e){return {getToken:async(a,t={})=>{C("getToken","address",a);let i="/v1/tokens/{address}".replace("{address}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},listTokens:async(a,t,i,r,n,s,o={})=>{let d="/v1/tokens",c=new URL(d,_),l;e&&(l=e.baseOptions);let h={method:"GET",...l,...o},u={},p={};a!==void 0&&(p.page_size=a),t!==void 0&&(p.cursor=t),i!==void 0&&(p.order_by=i),r!==void 0&&(p.direction=r),n!==void 0&&(p.address=n),s!==void 0&&(p.symbols=s),A(c,p);let g=l&&l.headers?l.headers:{};return h.headers={...u,...g,...o.headers},{url:S(c),options:h}}}},Be=function(e){let a=kt(e);return {async getToken(t,i){let r=await a.getToken(t,i);return O(r,m,E,e)},async listTokens(t,i,r,n,s,o,d){let c=await a.listTokens(t,i,r,n,s,o,d);return O(c,m,E,e)}}},Ir=function(e,a,t){let i=Be(e);return {getToken(r,n){return i.getToken(r,n).then(s=>s(t,a))},listTokens(r,n,s,o,d,c,l){return i.listTokens(r,n,s,o,d,c,l).then(h=>h(t,a))}}},br=class extends G{getToken(e,a){return Be(this.configuration).getToken(e.address,a).then(t=>t(this.axios,this.basePath))}listTokens(e={},a){return Be(this.configuration).listTokens(e.pageSize,e.cursor,e.orderBy,e.direction,e.address,e.symbols,a).then(t=>t(this.axios,this.basePath))}},Ut=function(e){return {createTradeV3:async(a,t,i,r,n={})=>{C("createTradeV3","createTradeRequest",a);let s="/v3/trades",o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"POST",...d,...n},l={},h={};t!=null&&(l["x-imx-eth-address"]=String(t)),i!=null&&(l["x-imx-eth-signature"]=String(i)),r!=null&&(l.Authorization=String(r)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(a,c,e),{url:S(o),options:c}},getSignableTrade:async(a,t={})=>{C("getSignableTrade","getSignableTradeRequest",a);let i="/v3/signable-trade-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getTradeV3:async(a,t={})=>{C("getTradeV3","id",a);let i="/v3/trades/{id}".replace("{id}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},listTradesV3:async(a,t,i,r,n,s,o,d,c,l,h,u={})=>{let p="/v3/trades",g=new URL(p,_),y;e&&(y=e.baseOptions);let R={method:"GET",...y,...u},v={},T={};a!==void 0&&(T.party_a_token_type=a),t!==void 0&&(T.party_a_token_address=t),i!==void 0&&(T.party_b_token_type=i),r!==void 0&&(T.party_b_token_address=r),n!==void 0&&(T.party_b_token_id=n),s!==void 0&&(T.page_size=s),o!==void 0&&(T.cursor=o),d!==void 0&&(T.order_by=d),c!==void 0&&(T.direction=c),l!==void 0&&(T.min_timestamp=l),h!==void 0&&(T.max_timestamp=h),A(g,T);let b=y&&y.headers?y.headers:{};return R.headers={...v,...b,...u.headers},{url:S(g),options:R}}}},Ce=function(e){let a=Ut(e);return {async createTradeV3(t,i,r,n,s){let o=await a.createTradeV3(t,i,r,n,s);return O(o,m,E,e)},async getSignableTrade(t,i){let r=await a.getSignableTrade(t,i);return O(r,m,E,e)},async getTradeV3(t,i){let r=await a.getTradeV3(t,i);return O(r,m,E,e)},async listTradesV3(t,i,r,n,s,o,d,c,l,h,u,p){let g=await a.listTradesV3(t,i,r,n,s,o,d,c,l,h,u,p);return O(g,m,E,e)}}},wr=function(e,a,t){let i=Ce(e);return {createTradeV3(r,n,s,o,d){return i.createTradeV3(r,n,s,o,d).then(c=>c(t,a))},getSignableTrade(r,n){return i.getSignableTrade(r,n).then(s=>s(t,a))},getTradeV3(r,n){return i.getTradeV3(r,n).then(s=>s(t,a))},listTradesV3(r,n,s,o,d,c,l,h,u,p,g,y){return i.listTradesV3(r,n,s,o,d,c,l,h,u,p,g,y).then(R=>R(t,a))}}},Pr=class extends G{createTradeV3(e,a){return Ce(this.configuration).createTradeV3(e.createTradeRequest,e.xImxEthAddress,e.xImxEthSignature,e.authorization,a).then(t=>t(this.axios,this.basePath))}getSignableTrade(e,a){return Ce(this.configuration).getSignableTrade(e.getSignableTradeRequest,a).then(t=>t(this.axios,this.basePath))}getTradeV3(e,a){return Ce(this.configuration).getTradeV3(e.id,a).then(t=>t(this.axios,this.basePath))}listTradesV3(e={},a){return Ce(this.configuration).listTradesV3(e.partyATokenType,e.partyATokenAddress,e.partyBTokenType,e.partyBTokenAddress,e.partyBTokenId,e.pageSize,e.cursor,e.orderBy,e.direction,e.minTimestamp,e.maxTimestamp,a).then(t=>t(this.axios,this.basePath))}},Lt=function(e){return {createTransfer:async(a,t,i,r,n={})=>{C("createTransfer","createTransferRequestV2",a);let s="/v2/transfers",o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"POST",...d,...n},l={},h={};t!=null&&(l["x-imx-eth-address"]=String(t)),i!=null&&(l["x-imx-eth-signature"]=String(i)),r!=null&&(l.Authorization=String(r)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(a,c,e),{url:S(o),options:c}},createTransferV1:async(a,t,i,r,n={})=>{C("createTransferV1","createTransferRequest",a);let s="/v1/transfers",o=new URL(s,_),d;e&&(d=e.baseOptions);let c={method:"POST",...d,...n},l={},h={};t!=null&&(l["x-imx-eth-address"]=String(t)),i!=null&&(l["x-imx-eth-signature"]=String(i)),r!=null&&(l.Authorization=String(r)),l["Content-Type"]="application/json",A(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},c.data=D(a,c,e),{url:S(o),options:c}},getSignableTransfer:async(a,t={})=>{C("getSignableTransfer","getSignableTransferRequestV2",a);let i="/v2/signable-transfer-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getSignableTransferV1:async(a,t={})=>{C("getSignableTransferV1","getSignableTransferRequest",a);let i="/v1/signable-transfer-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getTransfer:async(a,t={})=>{C("getTransfer","id",a);let i="/v1/transfers/{id}".replace("{id}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},listTransfers:async(a,t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T={})=>{let b="/v1/transfers",k=new URL(b,_),N;e&&(N=e.baseOptions);let L={method:"GET",...N,...T},U={},F={};a!==void 0&&(F.page_size=a),t!==void 0&&(F.cursor=t),i!==void 0&&(F.order_by=i),r!==void 0&&(F.direction=r),n!==void 0&&(F.user=n),s!==void 0&&(F.receiver=s),o!==void 0&&(F.status=o),d!==void 0&&(F.min_timestamp=d),c!==void 0&&(F.max_timestamp=c),l!==void 0&&(F.token_type=l),h!==void 0&&(F.token_id=h),u!==void 0&&(F.asset_id=u),p!==void 0&&(F.token_address=p),g!==void 0&&(F.token_name=g),y!==void 0&&(F.min_quantity=y),R!==void 0&&(F.max_quantity=R),v!==void 0&&(F.metadata=v),A(k,F);let V=N&&N.headers?N.headers:{};return L.headers={...U,...V,...T.headers},{url:S(k),options:L}}}},te=function(e){let a=Lt(e);return {async createTransfer(t,i,r,n,s){let o=await a.createTransfer(t,i,r,n,s);return O(o,m,E,e)},async createTransferV1(t,i,r,n,s){let o=await a.createTransferV1(t,i,r,n,s);return O(o,m,E,e)},async getSignableTransfer(t,i){let r=await a.getSignableTransfer(t,i);return O(r,m,E,e)},async getSignableTransferV1(t,i){let r=await a.getSignableTransferV1(t,i);return O(r,m,E,e)},async getTransfer(t,i){let r=await a.getTransfer(t,i);return O(r,m,E,e)},async listTransfers(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b){let k=await a.listTransfers(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b);return O(k,m,E,e)}}},xr=function(e,a,t){let i=te(e);return {createTransfer(r,n,s,o,d){return i.createTransfer(r,n,s,o,d).then(c=>c(t,a))},createTransferV1(r,n,s,o,d){return i.createTransferV1(r,n,s,o,d).then(c=>c(t,a))},getSignableTransfer(r,n){return i.getSignableTransfer(r,n).then(s=>s(t,a))},getSignableTransferV1(r,n){return i.getSignableTransferV1(r,n).then(s=>s(t,a))},getTransfer(r,n){return i.getTransfer(r,n).then(s=>s(t,a))},listTransfers(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N){return i.listTransfers(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N).then(L=>L(t,a))}}},Mr=class extends G{createTransfer(e,a){return te(this.configuration).createTransfer(e.createTransferRequestV2,e.xImxEthAddress,e.xImxEthSignature,e.authorization,a).then(t=>t(this.axios,this.basePath))}createTransferV1(e,a){return te(this.configuration).createTransferV1(e.createTransferRequest,e.xImxEthAddress,e.xImxEthSignature,e.authorization,a).then(t=>t(this.axios,this.basePath))}getSignableTransfer(e,a){return te(this.configuration).getSignableTransfer(e.getSignableTransferRequestV2,a).then(t=>t(this.axios,this.basePath))}getSignableTransferV1(e,a){return te(this.configuration).getSignableTransferV1(e.getSignableTransferRequest,a).then(t=>t(this.axios,this.basePath))}getTransfer(e,a){return te(this.configuration).getTransfer(e.id,a).then(t=>t(this.axios,this.basePath))}listTransfers(e={},a){return te(this.configuration).listTransfers(e.pageSize,e.cursor,e.orderBy,e.direction,e.user,e.receiver,e.status,e.minTimestamp,e.maxTimestamp,e.tokenType,e.tokenId,e.assetId,e.tokenAddress,e.tokenName,e.minQuantity,e.maxQuantity,e.metadata,a).then(t=>t(this.axios,this.basePath))}},Dt=function(e){return {getSignableRegistration:async(a,t={})=>{C("getSignableRegistration","getSignableRegistrationRequest",a);let i="/v1/signable-registration",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getSignableRegistrationOffchain:async(a,t={})=>{C("getSignableRegistrationOffchain","getSignableRegistrationRequest",a);let i="/v1/signable-registration-offchain",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getUsers:async(a,t={})=>{C("getUsers","user",a);let i="/v1/users/{user}".replace("{user}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},registerPassportUser:async(a,t,i={})=>{C("registerPassportUser","authorization",a),C("registerPassportUser","registerPassportUserRequest",t);let r="/v1/passport/users",n=new URL(r,_),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};a!=null&&(d.Authorization=String(a)),d["Content-Type"]="application/json",A(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=D(t,o,e),{url:S(n),options:o}},registerPassportUserV2:async(a,t,i={})=>{C("registerPassportUserV2","authorization",a),C("registerPassportUserV2","registerPassportUserRequest",t);let r="/v2/passport/users",n=new URL(r,_),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};a!=null&&(d.Authorization=String(a)),d["Content-Type"]="application/json",A(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=D(t,o,e),{url:S(n),options:o}},registerUser:async(a,t={})=>{C("registerUser","registerUserRequest",a);let i="/v1/users",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}}}},ae=function(e){let a=Dt(e);return {async getSignableRegistration(t,i){let r=await a.getSignableRegistration(t,i);return O(r,m,E,e)},async getSignableRegistrationOffchain(t,i){let r=await a.getSignableRegistrationOffchain(t,i);return O(r,m,E,e)},async getUsers(t,i){let r=await a.getUsers(t,i);return O(r,m,E,e)},async registerPassportUser(t,i,r){let n=await a.registerPassportUser(t,i,r);return O(n,m,E,e)},async registerPassportUserV2(t,i,r){let n=await a.registerPassportUserV2(t,i,r);return O(n,m,E,e)},async registerUser(t,i){let r=await a.registerUser(t,i);return O(r,m,E,e)}}},Nr=function(e,a,t){let i=ae(e);return {getSignableRegistration(r,n){return i.getSignableRegistration(r,n).then(s=>s(t,a))},getSignableRegistrationOffchain(r,n){return i.getSignableRegistrationOffchain(r,n).then(s=>s(t,a))},getUsers(r,n){return i.getUsers(r,n).then(s=>s(t,a))},registerPassportUser(r,n,s){return i.registerPassportUser(r,n,s).then(o=>o(t,a))},registerPassportUserV2(r,n,s){return i.registerPassportUserV2(r,n,s).then(o=>o(t,a))},registerUser(r,n){return i.registerUser(r,n).then(s=>s(t,a))}}},kr=class extends G{getSignableRegistration(e,a){return ae(this.configuration).getSignableRegistration(e.getSignableRegistrationRequest,a).then(t=>t(this.axios,this.basePath))}getSignableRegistrationOffchain(e,a){return ae(this.configuration).getSignableRegistrationOffchain(e.getSignableRegistrationRequest,a).then(t=>t(this.axios,this.basePath))}getUsers(e,a){return ae(this.configuration).getUsers(e.user,a).then(t=>t(this.axios,this.basePath))}registerPassportUser(e,a){return ae(this.configuration).registerPassportUser(e.authorization,e.registerPassportUserRequest,a).then(t=>t(this.axios,this.basePath))}registerPassportUserV2(e,a){return ae(this.configuration).registerPassportUserV2(e.authorization,e.registerPassportUserRequest,a).then(t=>t(this.axios,this.basePath))}registerUser(e,a){return ae(this.configuration).registerUser(e.registerUserRequest,a).then(t=>t(this.axios,this.basePath))}},Ft=function(e){return {createWithdrawal:async(a,t,i,r={})=>{C("createWithdrawal","xImxEthAddress",a),C("createWithdrawal","xImxEthSignature",t),C("createWithdrawal","createWithdrawalRequest",i);let n="/v1/withdrawals",s=new URL(n,_),o;e&&(o=e.baseOptions);let d={method:"POST",...o,...r},c={},l={};a!=null&&(c["x-imx-eth-address"]=String(a)),t!=null&&(c["x-imx-eth-signature"]=String(t)),c["Content-Type"]="application/json",A(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},d.data=D(i,d,e),{url:S(s),options:d}},createWithdrawalV2:async(a,t,i,r={})=>{C("createWithdrawalV2","xImxEthAddress",a),C("createWithdrawalV2","xImxEthSignature",t),C("createWithdrawalV2","createWithdrawalRequestV2",i);let n="/v2/withdrawals",s=new URL(n,_),o;e&&(o=e.baseOptions);let d={method:"POST",...o,...r},c={},l={};a!=null&&(c["x-imx-eth-address"]=String(a)),t!=null&&(c["x-imx-eth-signature"]=String(t)),c["Content-Type"]="application/json",A(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},d.data=D(i,d,e),{url:S(s),options:d}},getSignableWithdrawal:async(a,t={})=>{C("getSignableWithdrawal","getSignableWithdrawalRequest",a);let i="/v1/signable-withdrawal-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getSignableWithdrawalV2:async(a,t={})=>{C("getSignableWithdrawalV2","getSignableWithdrawalRequest",a);let i="/v2/signable-withdrawal-details",r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};o["Content-Type"]="application/json",A(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=D(a,s,e),{url:S(r),options:s}},getWithdrawal:async(a,t={})=>{C("getWithdrawal","id",a);let i="/v1/withdrawals/{id}".replace("{id}",encodeURIComponent(String(a))),r=new URL(i,_),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={};A(r,{});let d=n&&n.headers?n.headers:{};return s.headers={...o,...d,...t.headers},{url:S(r),options:s}},listWithdrawals:async(a,t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b={})=>{let k="/v1/withdrawals",N=new URL(k,_),L;e&&(L=e.baseOptions);let U={method:"GET",...L,...b},F={},V={};a!==void 0&&(V.withdrawn_to_wallet=a),t!==void 0&&(V.rollup_status=t),i!==void 0&&(V.page_size=i),r!==void 0&&(V.cursor=r),n!==void 0&&(V.order_by=n),s!==void 0&&(V.direction=s),o!==void 0&&(V.user=o),d!==void 0&&(V.status=d),c!==void 0&&(V.min_timestamp=c),l!==void 0&&(V.max_timestamp=l),h!==void 0&&(V.token_type=h),u!==void 0&&(V.token_id=u),p!==void 0&&(V.asset_id=p),g!==void 0&&(V.token_address=g),y!==void 0&&(V.token_name=y),R!==void 0&&(V.min_quantity=R),v!==void 0&&(V.max_quantity=v),T!==void 0&&(V.metadata=T),A(N,V);let Y=L&&L.headers?L.headers:{};return U.headers={...F,...Y,...b.headers},{url:S(N),options:U}}}},re=function(e){let a=Ft(e);return {async createWithdrawal(t,i,r,n){let s=await a.createWithdrawal(t,i,r,n);return O(s,m,E,e)},async createWithdrawalV2(t,i,r,n){let s=await a.createWithdrawalV2(t,i,r,n);return O(s,m,E,e)},async getSignableWithdrawal(t,i){let r=await a.getSignableWithdrawal(t,i);return O(r,m,E,e)},async getSignableWithdrawalV2(t,i){let r=await a.getSignableWithdrawalV2(t,i);return O(r,m,E,e)},async getWithdrawal(t,i){let r=await a.getWithdrawal(t,i);return O(r,m,E,e)},async listWithdrawals(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k){let N=await a.listWithdrawals(t,i,r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k);return O(N,m,E,e)}}},Ur=function(e,a,t){let i=re(e);return {createWithdrawal(r,n,s,o){return i.createWithdrawal(r,n,s,o).then(d=>d(t,a))},createWithdrawalV2(r,n,s,o){return i.createWithdrawalV2(r,n,s,o).then(d=>d(t,a))},getSignableWithdrawal(r,n){return i.getSignableWithdrawal(r,n).then(s=>s(t,a))},getSignableWithdrawalV2(r,n){return i.getSignableWithdrawalV2(r,n).then(s=>s(t,a))},getWithdrawal(r,n){return i.getWithdrawal(r,n).then(s=>s(t,a))},listWithdrawals(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N,L){return i.listWithdrawals(r,n,s,o,d,c,l,h,u,p,g,y,R,v,T,b,k,N,L).then(U=>U(t,a))}}},Lr=class extends G{createWithdrawal(e,a){return re(this.configuration).createWithdrawal(e.xImxEthAddress,e.xImxEthSignature,e.createWithdrawalRequest,a).then(t=>t(this.axios,this.basePath))}createWithdrawalV2(e,a){return re(this.configuration).createWithdrawalV2(e.xImxEthAddress,e.xImxEthSignature,e.createWithdrawalRequestV2,a).then(t=>t(this.axios,this.basePath))}getSignableWithdrawal(e,a){return re(this.configuration).getSignableWithdrawal(e.getSignableWithdrawalRequest,a).then(t=>t(this.axios,this.basePath))}getSignableWithdrawalV2(e,a){return re(this.configuration).getSignableWithdrawalV2(e.getSignableWithdrawalRequest,a).then(t=>t(this.axios,this.basePath))}getWithdrawal(e,a){return re(this.configuration).getWithdrawal(e.id,a).then(t=>t(this.axios,this.basePath))}listWithdrawals(e={},a){return re(this.configuration).listWithdrawals(e.withdrawnToWallet,e.rollupStatus,e.pageSize,e.cursor,e.orderBy,e.direction,e.user,e.status,e.minTimestamp,e.maxTimestamp,e.tokenType,e.tokenId,e.assetId,e.tokenAddress,e.tokenName,e.minQuantity,e.maxQuantity,e.metadata,a).then(t=>t(this.axios,this.basePath))}},Dr=class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor;}isJsonMime(e){let a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(a.test(e)||e.toLowerCase()==="application/json-patch+json")}},Fr={Moonpay:"moonpay",Layerswap:"layerswap"},Br={Onramp:"onramp",Offramp:"offramp"},Vr={Starkex:"starkex",Zkevm:"zkevm"},qr={Eth:"ETH",Erc20:"ERC20",Erc721:"ERC721"},Wr={Eth:"ETH",Erc20:"ERC20"},Gr={Queued:"queued",InProgress:"in_progress",Completed:"completed"},Hr={Queued:"queued",InProgress:"in_progress",Completed:"completed"},zr={Enum:"enum",Text:"text",Boolean:"boolean",Continuous:"continuous",Discrete:"discrete"},at={};Je(at,{APIError400AllOfCodeEnum:()=>kn,APIError401AllOfCodeEnum:()=>Un,APIError403AllOfCodeEnum:()=>Ln,APIError404AllOfCodeEnum:()=>Dn,APIError409AllOfCodeEnum:()=>Fn,APIError429AllOfCodeEnum:()=>Bn,APIError500AllOfCodeEnum:()=>Vn,APIError501AllOfCodeEnum:()=>qn,ActiveOrderStatusNameEnum:()=>Wn,ActivitiesApi:()=>$r,ActivitiesApiAxiosParamCreator:()=>Bt,ActivitiesApiFactory:()=>Kr,ActivitiesApiFp:()=>Oe,ActivityType:()=>Gn,AssetVerificationStatus:()=>Hn,CancelledOrderStatusCancellationTypeEnum:()=>jn,CancelledOrderStatusNameEnum:()=>zn,ChainsApi:()=>Zr,ChainsApiAxiosParamCreator:()=>Vt,ChainsApiFactory:()=>Xr,ChainsApiFp:()=>rt,CollectionContractType:()=>Kn,CollectionsApi:()=>Qr,CollectionsApiAxiosParamCreator:()=>qt,CollectionsApiFactory:()=>Yr,CollectionsApiFp:()=>Te,Configuration:()=>Nn,CraftingApi:()=>en,CraftingApiAxiosParamCreator:()=>Wt,CraftingApiFactory:()=>Jr,CraftingApiFp:()=>nt,ERC1155CollectionItemTypeEnum:()=>$n,ERC1155ItemTypeEnum:()=>Xn,ERC20ApproveMetadataTransactionTypeEnum:()=>Zn,ERC20ItemTypeEnum:()=>Yn,ERC20TransferFromMetadataTransactionTypeEnum:()=>Qn,ERC20TransferMetadataTransactionTypeEnum:()=>Jn,ERC721ApproveMetadataTransactionTypeEnum:()=>es,ERC721CollectionItemTypeEnum:()=>ts,ERC721ItemTypeEnum:()=>as,ERC721SafeTransferFromBatchMetadataTransactionTypeEnum:()=>rs,ERC721TransferFromMetadataTransactionTypeEnum:()=>ns,ExpiredOrderStatusNameEnum:()=>ss,FailedOrderCancellationReasonCodeEnum:()=>is,FeeTypeEnum:()=>os,FilledOrderStatusNameEnum:()=>ds,GetTransactionByIDChainTypeEnum:()=>rn,GuardianApi:()=>an,GuardianApiAxiosParamCreator:()=>Gt,GuardianApiFactory:()=>tn,GuardianApiFp:()=>j,ImmutableVerificationStatusEnum:()=>cs,InactiveOrderStatusNameEnum:()=>ls,ListBidsSortByEnum:()=>fn,ListBidsSortDirectionEnum:()=>yn,ListCollectionBidsSortByEnum:()=>Cn,ListCollectionBidsSortDirectionEnum:()=>Tn,ListListingsBuyItemTypeEnum:()=>Rn,ListListingsSortByEnum:()=>vn,ListListingsSortDirectionEnum:()=>En,ListTradesSortByEnum:()=>_n,ListTradesSortDirectionEnum:()=>An,MarketPriceERC20TokenTypeEnum:()=>hs,MarketPriceFeesTypeEnum:()=>us,MarketPriceNativeTokenTypeEnum:()=>ps,MarketplaceContractType:()=>gs,MessageEvaluationResponseConfirmationMethodEnum:()=>ms,MetadataApi:()=>sn,MetadataApiAxiosParamCreator:()=>Ht,MetadataApiFactory:()=>nn,MetadataApiFp:()=>ne,MetadataSearchApi:()=>dn,MetadataSearchApiAxiosParamCreator:()=>zt,MetadataSearchApiFactory:()=>on,MetadataSearchApiFp:()=>Ie,MintRequestStatus:()=>fs,NFTContractType:()=>ys,NFTMetadataAttributeDisplayTypeEnum:()=>Cs,NFTSetApprovalForAllMetadataTransactionTypeEnum:()=>Ts,NativeItemTypeEnum:()=>Rs,NftOwnersApi:()=>hn,NftOwnersApiAxiosParamCreator:()=>jt,NftOwnersApiFactory:()=>ln,NftOwnersApiFp:()=>be,NftsApi:()=>pn,NftsApiAxiosParamCreator:()=>Kt,NftsApiFactory:()=>un,NftsApiFp:()=>Z,OperatorAllowlistStatus:()=>vs,OrderStatusName:()=>_s,OrderTypeEnum:()=>Es,OrdersApi:()=>mn,OrdersApiAxiosParamCreator:()=>$t,OrdersApiFactory:()=>gn,OrdersApiFp:()=>H,OrganisationTier:()=>As,PassportApi:()=>On,PassportApiAxiosParamCreator:()=>Xt,PassportApiFactory:()=>Sn,PassportApiFp:()=>se,PassportProfileApi:()=>bn,PassportProfileApiAxiosParamCreator:()=>Zt,PassportProfileApiFactory:()=>In,PassportProfileApiFp:()=>Ve,PendingOrderStatusNameEnum:()=>Ss,PricingApi:()=>Pn,PricingApiAxiosParamCreator:()=>Yt,PricingApiFactory:()=>wn,PricingApiFp:()=>qe,ProtocolDataOrderTypeEnum:()=>Os,SaleFeeTypeEnum:()=>Is,SeaportCreateListingMetadataTypedDataTypeEnum:()=>bs,SeaportERC1155CollectionItemTypeEnum:()=>ws,SeaportERC1155ItemTypeEnum:()=>Ps,SeaportERC20ItemTypeEnum:()=>xs,SeaportERC721CollectionItemTypeEnum:()=>Ms,SeaportERC721ItemTypeEnum:()=>Ns,SeaportFeeTypeEnum:()=>ks,SeaportFulfillAvailableAdvancedOrdersMetadataTransactionTypeEnum:()=>Us,SeaportNativeItemTypeEnum:()=>Ls,SearchStacksSortByEnum:()=>cn,Severity:()=>Ds,StarkExTransactionEvaluationRequestChainTypeEnum:()=>Fs,TokenContractType:()=>Bs,TokensApi:()=>Mn,TokensApiAxiosParamCreator:()=>Qt,TokensApiFactory:()=>xn,TokensApiFp:()=>We,TransactionApprovalRequestChainTypeEnum:()=>Vs,TransactionEvaluationResponseConfirmationMethodEnum:()=>qs,UnknownMetadataTransactionTypeEnum:()=>Ws,UnknownTypedDataMetadataTypedDataTypeEnum:()=>Gs,ValidationStatus:()=>Hs,VerificationRequestContractType:()=>zs,VerificationRequestStatus:()=>js,ZkEvmTransactionEvaluationRequestChainTypeEnum:()=>Ks});var I="https://api.sandbox.immutable.com".replace(/\/+$/,""),z=class{constructor(e,a=I,t=m){this.basePath=a,this.axios=t,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath);}configuration},jr=class extends Error{constructor(e,a){super(a),this.field=e,this.name="RequiredError";}},w="https://example.com",f=function(e,a,t){if(t==null)throw new jr(a,`Required parameter ${a} was null or undefined when calling ${e}.`)},ie=async function(e,a,t){if(t&&t.apiKey){let i=typeof t.apiKey=="function"?await t.apiKey(a):await t.apiKey;e[a]=i;}},q=async function(e,a){if(a&&a.accessToken){let t=typeof a.accessToken=="function"?await a.accessToken():await a.accessToken;e.Authorization="Bearer "+t;}};function Qe(e,a,t=""){a!=null&&(typeof a=="object"?Array.isArray(a)?a.forEach(i=>Qe(e,i,t)):Object.keys(a).forEach(i=>Qe(e,a[i],`${t}${t!==""?".":""}${i}`)):e.has(t)?e.append(t,a):e.set(t,a));}var P=function(e,...a){let t=new URLSearchParams(e.search);Qe(t,a),e.search=t.toString();},W=function(e,a,t){let i=typeof e!="string";return (i&&t&&t.isJsonMime?t.isJsonMime(a.headers["Content-Type"]):i)?JSON.stringify(e!==void 0?e:{}):e||""},x=function(e){return e.pathname+e.search+e.hash},M=function(e,a,t,i){return (r=a,n=t)=>{let s={...e.options,url:(i?.basePath||r.defaults.baseURL||n)+e.url};return r.request(s)}},Bt=function(e){return {getActivity:async(a,t,i={})=>{f("getActivity","chainName",a),f("getActivity","activityId",t);let r="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(a))).replace("{activity_id}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},listActivities:async(a,t,i,r,n,s,o,d,c={})=>{f("listActivities","chainName",a);let l="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(a))),h=new URL(l,w),u;e&&(u=e.baseOptions);let p={method:"GET",...u,...c},g={},y={};t!==void 0&&(y.contract_address=t),i!==void 0&&(y.token_id=i),r!==void 0&&(y.account_address=r),n!==void 0&&(y.activity_type=n),s!==void 0&&(y.transaction_hash=s),o!==void 0&&(y.page_cursor=o),d!==void 0&&(y.page_size=d),P(h,y);let R=u&&u.headers?u.headers:{};return p.headers={...g,...R,...c.headers},{url:x(h),options:p}},listActivityHistory:async(a,t,i,r,n,s,o,d={})=>{f("listActivityHistory","chainName",a),f("listActivityHistory","fromUpdatedAt",t);let c="/v1/chains/{chain_name}/activity-history".replace("{chain_name}",encodeURIComponent(String(a))),l=new URL(c,w),h;e&&(h=e.baseOptions);let u={method:"GET",...h,...d},p={},g={};t!==void 0&&(g.from_updated_at=t instanceof Date?t.toISOString():t),i!==void 0&&(g.to_updated_at=i instanceof Date?i.toISOString():i),r!==void 0&&(g.contract_address=r),n!==void 0&&(g.activity_type=n),s!==void 0&&(g.page_cursor=s),o!==void 0&&(g.page_size=o),P(l,g);let y=h&&h.headers?h.headers:{};return u.headers={...p,...y,...d.headers},{url:x(l),options:u}}}},Oe=function(e){let a=Bt(e);return {async getActivity(t,i,r){let n=await a.getActivity(t,i,r);return M(n,m,I,e)},async listActivities(t,i,r,n,s,o,d,c,l){let h=await a.listActivities(t,i,r,n,s,o,d,c,l);return M(h,m,I,e)},async listActivityHistory(t,i,r,n,s,o,d,c){let l=await a.listActivityHistory(t,i,r,n,s,o,d,c);return M(l,m,I,e)}}},Kr=function(e,a,t){let i=Oe(e);return {getActivity(r,n){return i.getActivity(r.chainName,r.activityId,n).then(s=>s(t,a))},listActivities(r,n){return i.listActivities(r.chainName,r.contractAddress,r.tokenId,r.accountAddress,r.activityType,r.transactionHash,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listActivityHistory(r,n){return i.listActivityHistory(r.chainName,r.fromUpdatedAt,r.toUpdatedAt,r.contractAddress,r.activityType,r.pageCursor,r.pageSize,n).then(s=>s(t,a))}}},$r=class extends z{getActivity(e,a){return Oe(this.configuration).getActivity(e.chainName,e.activityId,a).then(t=>t(this.axios,this.basePath))}listActivities(e,a){return Oe(this.configuration).listActivities(e.chainName,e.contractAddress,e.tokenId,e.accountAddress,e.activityType,e.transactionHash,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listActivityHistory(e,a){return Oe(this.configuration).listActivityHistory(e.chainName,e.fromUpdatedAt,e.toUpdatedAt,e.contractAddress,e.activityType,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}},Vt=function(e){return {listChains:async(a,t,i={})=>{let r="/v1/chains",n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={},c={};a!==void 0&&(c.page_cursor=a),t!==void 0&&(c.page_size=t),P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},{url:x(n),options:o}}}},rt=function(e){let a=Vt(e);return {async listChains(t,i,r){let n=await a.listChains(t,i,r);return M(n,m,I,e)}}},Xr=function(e,a,t){let i=rt(e);return {listChains(r={},n){return i.listChains(r.pageCursor,r.pageSize,n).then(s=>s(t,a))}}},Zr=class extends z{listChains(e={},a){return rt(this.configuration).listChains(e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}},qt=function(e){return {getCollection:async(a,t,i={})=>{f("getCollection","contractAddress",a),f("getCollection","chainName",t);let r="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},listCollections:async(a,t,i,r,n,s,o={})=>{f("listCollections","chainName",a);let d="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(a))),c=new URL(d,w),l;e&&(l=e.baseOptions);let h={method:"GET",...l,...o},u={},p={};t&&(p.contract_address=t),i&&(p.verification_status=i),r!==void 0&&(p.from_updated_at=r instanceof Date?r.toISOString():r),n!==void 0&&(p.page_cursor=n),s!==void 0&&(p.page_size=s),P(c,p);let g=l&&l.headers?l.headers:{};return h.headers={...u,...g,...o.headers},{url:x(c),options:h}},listCollectionsByNFTOwner:async(a,t,i,r,n={})=>{f("listCollectionsByNFTOwner","accountAddress",a),f("listCollectionsByNFTOwner","chainName",t);let s="/v1/chains/{chain_name}/accounts/{account_address}/collections".replace("{account_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(s,w),d;e&&(d=e.baseOptions);let c={method:"GET",...d,...n},l={},h={};i!==void 0&&(h.page_cursor=i),r!==void 0&&(h.page_size=r),P(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},{url:x(o),options:c}},refreshCollectionMetadata:async(a,t,i,r={})=>{f("refreshCollectionMetadata","contractAddress",a),f("refreshCollectionMetadata","chainName",t),f("refreshCollectionMetadata","refreshCollectionMetadataRequest",i);let n="/v1/chains/{chain_name}/collections/{contract_address}/refresh-metadata".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),s=new URL(n,w),o;e&&(o=e.baseOptions);let d={method:"POST",...o,...r},c={},l={};await q(c,e),await ie(c,"x-immutable-api-key",e),await q(c,e),c["Content-Type"]="application/json",P(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},d.data=W(i,d,e),{url:x(s),options:d}}}},Te=function(e){let a=qt(e);return {async getCollection(t,i,r){let n=await a.getCollection(t,i,r);return M(n,m,I,e)},async listCollections(t,i,r,n,s,o,d){let c=await a.listCollections(t,i,r,n,s,o,d);return M(c,m,I,e)},async listCollectionsByNFTOwner(t,i,r,n,s){let o=await a.listCollectionsByNFTOwner(t,i,r,n,s);return M(o,m,I,e)},async refreshCollectionMetadata(t,i,r,n){let s=await a.refreshCollectionMetadata(t,i,r,n);return M(s,m,I,e)}}},Yr=function(e,a,t){let i=Te(e);return {getCollection(r,n){return i.getCollection(r.contractAddress,r.chainName,n).then(s=>s(t,a))},listCollections(r,n){return i.listCollections(r.chainName,r.contractAddress,r.verificationStatus,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listCollectionsByNFTOwner(r,n){return i.listCollectionsByNFTOwner(r.accountAddress,r.chainName,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},refreshCollectionMetadata(r,n){return i.refreshCollectionMetadata(r.contractAddress,r.chainName,r.refreshCollectionMetadataRequest,n).then(s=>s(t,a))}}},Qr=class extends z{getCollection(e,a){return Te(this.configuration).getCollection(e.contractAddress,e.chainName,a).then(t=>t(this.axios,this.basePath))}listCollections(e,a){return Te(this.configuration).listCollections(e.chainName,e.contractAddress,e.verificationStatus,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listCollectionsByNFTOwner(e,a){return Te(this.configuration).listCollectionsByNFTOwner(e.accountAddress,e.chainName,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}refreshCollectionMetadata(e,a){return Te(this.configuration).refreshCollectionMetadata(e.contractAddress,e.chainName,e.refreshCollectionMetadataRequest,a).then(t=>t(this.axios,this.basePath))}},Wt=function(e){return {signCraftingPayload:async(a,t,i={})=>{f("signCraftingPayload","chainName",a),f("signCraftingPayload","signCraftingRequest",t);let r="/v1/chains/{chain_name}/crafting/sign".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};await ie(d,"x-immutable-api-key",e),d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}}}},nt=function(e){let a=Wt(e);return {async signCraftingPayload(t,i,r){let n=await a.signCraftingPayload(t,i,r);return M(n,m,I,e)}}},Jr=function(e,a,t){let i=nt(e);return {signCraftingPayload(r,n){return i.signCraftingPayload(r.chainName,r.signCraftingRequest,n).then(s=>s(t,a))}}},en=class extends z{signCraftingPayload(e,a){return nt(this.configuration).signCraftingPayload(e.chainName,e.signCraftingRequest,a).then(t=>t(this.axios,this.basePath))}},Gt=function(e){return {approvePendingERC191Message:async(a,t={})=>{f("approvePendingERC191Message","messageID",a);let i="/guardian/v1/erc191-messages/{messageID}/approve".replace("{messageID}",encodeURIComponent(String(a))),r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};await q(o,e),P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},{url:x(r),options:s}},approvePendingMessage:async(a,t={})=>{f("approvePendingMessage","messageID",a);let i="/guardian/v1/messages/{messageID}/approve".replace("{messageID}",encodeURIComponent(String(a))),r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};await q(o,e),P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},{url:x(r),options:s}},approvePendingTransaction:async(a,t,i={})=>{f("approvePendingTransaction","payloadHash",a),f("approvePendingTransaction","transactionApprovalRequest",t);let r="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};await q(d,e),d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},evaluateErc191Message:async(a,t={})=>{f("evaluateErc191Message","eRC191MessageEvaluationRequest",a);let i="/guardian/v1/erc191-messages/evaluate",r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};await q(o,e),o["Content-Type"]="application/json",P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=W(a,s,e),{url:x(r),options:s}},evaluateMessage:async(a,t={})=>{f("evaluateMessage","messageEvaluationRequest",a);let i="/guardian/v1/messages/evaluate",r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};await q(o,e),o["Content-Type"]="application/json",P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=W(a,s,e),{url:x(r),options:s}},evaluateTransaction:async(a,t,i={})=>{f("evaluateTransaction","id",a),f("evaluateTransaction","transactionEvaluationRequest",t);let r="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};await q(d,e),d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},getErc191MessageByID:async(a,t={})=>{f("getErc191MessageByID","messageID",a);let i="/guardian/v1/erc191-messages/{messageID}".replace("{messageID}",encodeURIComponent(String(a))),r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={},d={};await q(o,e),P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},{url:x(r),options:s}},getMessageByID:async(a,t,i={})=>{f("getMessageByID","messageID",a);let r="/guardian/v1/messages/{messageID}".replace("{messageID}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={},c={};await q(d,e),t!==void 0&&(c.includeSimulation=t),P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},{url:x(n),options:o}},getTransactionByID:async(a,t,i,r,n={})=>{f("getTransactionByID","transactionID",a),f("getTransactionByID","chainType",t);let s="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(a))),o=new URL(s,w),d;e&&(d=e.baseOptions);let c={method:"GET",...d,...n},l={},h={};await q(l,e),t!==void 0&&(h.chainType=t),i!==void 0&&(h.chainID=i),r!==void 0&&(h.includeSimulation=r),P(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},{url:x(o),options:c}}}},j=function(e){let a=Gt(e);return {async approvePendingERC191Message(t,i){let r=await a.approvePendingERC191Message(t,i);return M(r,m,I,e)},async approvePendingMessage(t,i){let r=await a.approvePendingMessage(t,i);return M(r,m,I,e)},async approvePendingTransaction(t,i,r){let n=await a.approvePendingTransaction(t,i,r);return M(n,m,I,e)},async evaluateErc191Message(t,i){let r=await a.evaluateErc191Message(t,i);return M(r,m,I,e)},async evaluateMessage(t,i){let r=await a.evaluateMessage(t,i);return M(r,m,I,e)},async evaluateTransaction(t,i,r){let n=await a.evaluateTransaction(t,i,r);return M(n,m,I,e)},async getErc191MessageByID(t,i){let r=await a.getErc191MessageByID(t,i);return M(r,m,I,e)},async getMessageByID(t,i,r){let n=await a.getMessageByID(t,i,r);return M(n,m,I,e)},async getTransactionByID(t,i,r,n,s){let o=await a.getTransactionByID(t,i,r,n,s);return M(o,m,I,e)}}},tn=function(e,a,t){let i=j(e);return {approvePendingERC191Message(r,n){return i.approvePendingERC191Message(r.messageID,n).then(s=>s(t,a))},approvePendingMessage(r,n){return i.approvePendingMessage(r.messageID,n).then(s=>s(t,a))},approvePendingTransaction(r,n){return i.approvePendingTransaction(r.payloadHash,r.transactionApprovalRequest,n).then(s=>s(t,a))},evaluateErc191Message(r,n){return i.evaluateErc191Message(r.eRC191MessageEvaluationRequest,n).then(s=>s(t,a))},evaluateMessage(r,n){return i.evaluateMessage(r.messageEvaluationRequest,n).then(s=>s(t,a))},evaluateTransaction(r,n){return i.evaluateTransaction(r.id,r.transactionEvaluationRequest,n).then(s=>s(t,a))},getErc191MessageByID(r,n){return i.getErc191MessageByID(r.messageID,n).then(s=>s(t,a))},getMessageByID(r,n){return i.getMessageByID(r.messageID,r.includeSimulation,n).then(s=>s(t,a))},getTransactionByID(r,n){return i.getTransactionByID(r.transactionID,r.chainType,r.chainID,r.includeSimulation,n).then(s=>s(t,a))}}},an=class extends z{approvePendingERC191Message(e,a){return j(this.configuration).approvePendingERC191Message(e.messageID,a).then(t=>t(this.axios,this.basePath))}approvePendingMessage(e,a){return j(this.configuration).approvePendingMessage(e.messageID,a).then(t=>t(this.axios,this.basePath))}approvePendingTransaction(e,a){return j(this.configuration).approvePendingTransaction(e.payloadHash,e.transactionApprovalRequest,a).then(t=>t(this.axios,this.basePath))}evaluateErc191Message(e,a){return j(this.configuration).evaluateErc191Message(e.eRC191MessageEvaluationRequest,a).then(t=>t(this.axios,this.basePath))}evaluateMessage(e,a){return j(this.configuration).evaluateMessage(e.messageEvaluationRequest,a).then(t=>t(this.axios,this.basePath))}evaluateTransaction(e,a){return j(this.configuration).evaluateTransaction(e.id,e.transactionEvaluationRequest,a).then(t=>t(this.axios,this.basePath))}getErc191MessageByID(e,a){return j(this.configuration).getErc191MessageByID(e.messageID,a).then(t=>t(this.axios,this.basePath))}getMessageByID(e,a){return j(this.configuration).getMessageByID(e.messageID,e.includeSimulation,a).then(t=>t(this.axios,this.basePath))}getTransactionByID(e,a){return j(this.configuration).getTransactionByID(e.transactionID,e.chainType,e.chainID,e.includeSimulation,a).then(t=>t(this.axios,this.basePath))}},rn={Starkex:"starkex",Evm:"evm"},Ht=function(e){return {getMetadata:async(a,t,i,r={})=>{f("getMetadata","chainName",a),f("getMetadata","contractAddress",t),f("getMetadata","metadataId",i);let n="/v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id}".replace("{chain_name}",encodeURIComponent(String(a))).replace("{contract_address}",encodeURIComponent(String(t))).replace("{metadata_id}",encodeURIComponent(String(i))),s=new URL(n,w),o;e&&(o=e.baseOptions);let d={method:"GET",...o,...r},c={};P(s,{});let l=o&&o.headers?o.headers:{};return d.headers={...c,...l,...r.headers},{url:x(s),options:d}},listMetadata:async(a,t,i,r,n,s={})=>{f("listMetadata","chainName",a),f("listMetadata","contractAddress",t);let o="/v1/chains/{chain_name}/collections/{contract_address}/metadata".replace("{chain_name}",encodeURIComponent(String(a))).replace("{contract_address}",encodeURIComponent(String(t))),d=new URL(o,w),c;e&&(c=e.baseOptions);let l={method:"GET",...c,...s},h={},u={};i!==void 0&&(u.from_updated_at=i instanceof Date?i.toISOString():i),r!==void 0&&(u.page_cursor=r),n!==void 0&&(u.page_size=n),P(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},{url:x(d),options:l}},listMetadataForChain:async(a,t,i,r,n={})=>{f("listMetadataForChain","chainName",a);let s="/v1/chains/{chain_name}/metadata".replace("{chain_name}",encodeURIComponent(String(a))),o=new URL(s,w),d;e&&(d=e.baseOptions);let c={method:"GET",...d,...n},l={},h={};t!==void 0&&(h.from_updated_at=t instanceof Date?t.toISOString():t),i!==void 0&&(h.page_cursor=i),r!==void 0&&(h.page_size=r),P(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},{url:x(o),options:c}},listStacks:async(a,t,i={})=>{f("listStacks","chainName",a),f("listStacks","stackId",t);let r="/v1/chains/{chain_name}/stacks".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={},c={};t&&(c.stack_id=t),P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},{url:x(n),options:o}},refreshMetadataByID:async(a,t,i,r={})=>{f("refreshMetadataByID","chainName",a),f("refreshMetadataByID","contractAddress",t),f("refreshMetadataByID","refreshMetadataByIDRequest",i);let n="/v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata".replace("{chain_name}",encodeURIComponent(String(a))).replace("{contract_address}",encodeURIComponent(String(t))),s=new URL(n,w),o;e&&(o=e.baseOptions);let d={method:"POST",...o,...r},c={},l={};await ie(c,"x-immutable-api-key",e),c["Content-Type"]="application/json",P(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},d.data=W(i,d,e),{url:x(s),options:d}},refreshNFTMetadataByTokenID:async(a,t,i,r={})=>{f("refreshNFTMetadataByTokenID","contractAddress",a),f("refreshNFTMetadataByTokenID","chainName",t),f("refreshNFTMetadataByTokenID","refreshNFTMetadataByTokenIDRequest",i);let n="/v1/chains/{chain_name}/collections/{contract_address}/nfts/refresh-metadata".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),s=new URL(n,w),o;e&&(o=e.baseOptions);let d={method:"POST",...o,...r},c={},l={};await ie(c,"x-immutable-api-key",e),c["Content-Type"]="application/json",P(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},d.data=W(i,d,e),{url:x(s),options:d}}}},ne=function(e){let a=Ht(e);return {async getMetadata(t,i,r,n){let s=await a.getMetadata(t,i,r,n);return M(s,m,I,e)},async listMetadata(t,i,r,n,s,o){let d=await a.listMetadata(t,i,r,n,s,o);return M(d,m,I,e)},async listMetadataForChain(t,i,r,n,s){let o=await a.listMetadataForChain(t,i,r,n,s);return M(o,m,I,e)},async listStacks(t,i,r){let n=await a.listStacks(t,i,r);return M(n,m,I,e)},async refreshMetadataByID(t,i,r,n){let s=await a.refreshMetadataByID(t,i,r,n);return M(s,m,I,e)},async refreshNFTMetadataByTokenID(t,i,r,n){let s=await a.refreshNFTMetadataByTokenID(t,i,r,n);return M(s,m,I,e)}}},nn=function(e,a,t){let i=ne(e);return {getMetadata(r,n){return i.getMetadata(r.chainName,r.contractAddress,r.metadataId,n).then(s=>s(t,a))},listMetadata(r,n){return i.listMetadata(r.chainName,r.contractAddress,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listMetadataForChain(r,n){return i.listMetadataForChain(r.chainName,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listStacks(r,n){return i.listStacks(r.chainName,r.stackId,n).then(s=>s(t,a))},refreshMetadataByID(r,n){return i.refreshMetadataByID(r.chainName,r.contractAddress,r.refreshMetadataByIDRequest,n).then(s=>s(t,a))},refreshNFTMetadataByTokenID(r,n){return i.refreshNFTMetadataByTokenID(r.contractAddress,r.chainName,r.refreshNFTMetadataByTokenIDRequest,n).then(s=>s(t,a))}}},sn=class extends z{getMetadata(e,a){return ne(this.configuration).getMetadata(e.chainName,e.contractAddress,e.metadataId,a).then(t=>t(this.axios,this.basePath))}listMetadata(e,a){return ne(this.configuration).listMetadata(e.chainName,e.contractAddress,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listMetadataForChain(e,a){return ne(this.configuration).listMetadataForChain(e.chainName,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listStacks(e,a){return ne(this.configuration).listStacks(e.chainName,e.stackId,a).then(t=>t(this.axios,this.basePath))}refreshMetadataByID(e,a){return ne(this.configuration).refreshMetadataByID(e.chainName,e.contractAddress,e.refreshMetadataByIDRequest,a).then(t=>t(this.axios,this.basePath))}refreshNFTMetadataByTokenID(e,a){return ne(this.configuration).refreshNFTMetadataByTokenID(e.contractAddress,e.chainName,e.refreshNFTMetadataByTokenIDRequest,a).then(t=>t(this.axios,this.basePath))}},zt=function(e){return {listFilters:async(a,t,i={})=>{f("listFilters","chainName",a),f("listFilters","contractAddress",t);let r="/v1/chains/{chain_name}/search/filters/{contract_address}".replace("{chain_name}",encodeURIComponent(String(a))).replace("{contract_address}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},searchNFTs:async(a,t,i,r,n,s,o,d={})=>{f("searchNFTs","chainName",a),f("searchNFTs","contractAddress",t);let c="/v1/chains/{chain_name}/search/nfts".replace("{chain_name}",encodeURIComponent(String(a))),l=new URL(c,w),h;e&&(h=e.baseOptions);let u={method:"GET",...h,...d},p={},g={};t&&(g.contract_address=t),i!==void 0&&(g.account_address=i),r&&(g.stack_id=r),n!==void 0&&(g.only_include_owner_listings=n),s!==void 0&&(g.page_size=s),o!==void 0&&(g.page_cursor=o),P(l,g);let y=h&&h.headers?h.headers:{};return u.headers={...p,...y,...d.headers},{url:x(l),options:u}},searchStacks:async(a,t,i,r,n,s,o,d,c,l,h,u={})=>{f("searchStacks","chainName",a),f("searchStacks","contractAddress",t);let p="/v1/chains/{chain_name}/search/stacks".replace("{chain_name}",encodeURIComponent(String(a))),g=new URL(p,w),y;e&&(y=e.baseOptions);let R={method:"GET",...y,...u},v={},T={};t&&(T.contract_address=t),i!==void 0&&(T.account_address=i),r!==void 0&&(T.only_include_owner_listings=r),n!==void 0&&(T.only_if_has_active_listings=n),s!==void 0&&(T.traits=s),o!==void 0&&(T.keyword=o),d!==void 0&&(T.payment_token=d),c!==void 0&&(T.sort_by=c),l!==void 0&&(T.page_size=l),h!==void 0&&(T.page_cursor=h),P(g,T);let b=y&&y.headers?y.headers:{};return R.headers={...v,...b,...u.headers},{url:x(g),options:R}}}},Ie=function(e){let a=zt(e);return {async listFilters(t,i,r){let n=await a.listFilters(t,i,r);return M(n,m,I,e)},async searchNFTs(t,i,r,n,s,o,d,c){let l=await a.searchNFTs(t,i,r,n,s,o,d,c);return M(l,m,I,e)},async searchStacks(t,i,r,n,s,o,d,c,l,h,u,p){let g=await a.searchStacks(t,i,r,n,s,o,d,c,l,h,u,p);return M(g,m,I,e)}}},on=function(e,a,t){let i=Ie(e);return {listFilters(r,n){return i.listFilters(r.chainName,r.contractAddress,n).then(s=>s(t,a))},searchNFTs(r,n){return i.searchNFTs(r.chainName,r.contractAddress,r.accountAddress,r.stackId,r.onlyIncludeOwnerListings,r.pageSize,r.pageCursor,n).then(s=>s(t,a))},searchStacks(r,n){return i.searchStacks(r.chainName,r.contractAddress,r.accountAddress,r.onlyIncludeOwnerListings,r.onlyIfHasActiveListings,r.traits,r.keyword,r.paymentToken,r.sortBy,r.pageSize,r.pageCursor,n).then(s=>s(t,a))}}},dn=class extends z{listFilters(e,a){return Ie(this.configuration).listFilters(e.chainName,e.contractAddress,a).then(t=>t(this.axios,this.basePath))}searchNFTs(e,a){return Ie(this.configuration).searchNFTs(e.chainName,e.contractAddress,e.accountAddress,e.stackId,e.onlyIncludeOwnerListings,e.pageSize,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}searchStacks(e,a){return Ie(this.configuration).searchStacks(e.chainName,e.contractAddress,e.accountAddress,e.onlyIncludeOwnerListings,e.onlyIfHasActiveListings,e.traits,e.keyword,e.paymentToken,e.sortBy,e.pageSize,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}},cn={CheapestFirst:"cheapest_first"},jt=function(e){return {listAllNFTOwners:async(a,t,i,r,n={})=>{f("listAllNFTOwners","chainName",a);let s="/v1/chains/{chain_name}/nft-owners".replace("{chain_name}",encodeURIComponent(String(a))),o=new URL(s,w),d;e&&(d=e.baseOptions);let c={method:"GET",...d,...n},l={},h={};t!==void 0&&(h.from_updated_at=t instanceof Date?t.toISOString():t),i!==void 0&&(h.page_cursor=i),r!==void 0&&(h.page_size=r),P(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},{url:x(o),options:c}},listNFTOwners:async(a,t,i,r,n,s={})=>{f("listNFTOwners","contractAddress",a),f("listNFTOwners","tokenId",t),f("listNFTOwners","chainName",i);let o="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(a))).replace("{token_id}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(i))),d=new URL(o,w),c;e&&(c=e.baseOptions);let l={method:"GET",...c,...s},h={},u={};r!==void 0&&(u.page_cursor=r),n!==void 0&&(u.page_size=n),P(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},{url:x(d),options:l}},listOwnersByContractAddress:async(a,t,i,r,n,s,o={})=>{f("listOwnersByContractAddress","contractAddress",a),f("listOwnersByContractAddress","chainName",t);let d="/v1/chains/{chain_name}/collections/{contract_address}/owners".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),c=new URL(d,w),l;e&&(l=e.baseOptions);let h={method:"GET",...l,...o},u={},p={};i&&(p.account_address=i),r!==void 0&&(p.from_updated_at=r instanceof Date?r.toISOString():r),n!==void 0&&(p.page_cursor=n),s!==void 0&&(p.page_size=s),P(c,p);let g=l&&l.headers?l.headers:{};return h.headers={...u,...g,...o.headers},{url:x(c),options:h}}}},be=function(e){let a=jt(e);return {async listAllNFTOwners(t,i,r,n,s){let o=await a.listAllNFTOwners(t,i,r,n,s);return M(o,m,I,e)},async listNFTOwners(t,i,r,n,s,o){let d=await a.listNFTOwners(t,i,r,n,s,o);return M(d,m,I,e)},async listOwnersByContractAddress(t,i,r,n,s,o,d){let c=await a.listOwnersByContractAddress(t,i,r,n,s,o,d);return M(c,m,I,e)}}},ln=function(e,a,t){let i=be(e);return {listAllNFTOwners(r,n){return i.listAllNFTOwners(r.chainName,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listNFTOwners(r,n){return i.listNFTOwners(r.contractAddress,r.tokenId,r.chainName,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listOwnersByContractAddress(r,n){return i.listOwnersByContractAddress(r.contractAddress,r.chainName,r.accountAddress,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))}}},hn=class extends z{listAllNFTOwners(e,a){return be(this.configuration).listAllNFTOwners(e.chainName,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listNFTOwners(e,a){return be(this.configuration).listNFTOwners(e.contractAddress,e.tokenId,e.chainName,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listOwnersByContractAddress(e,a){return be(this.configuration).listOwnersByContractAddress(e.contractAddress,e.chainName,e.accountAddress,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}},Kt=function(e){return {createMintRequest:async(a,t,i,r={})=>{f("createMintRequest","contractAddress",a),f("createMintRequest","chainName",t),f("createMintRequest","createMintRequestRequest",i);let n="/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),s=new URL(n,w),o;e&&(o=e.baseOptions);let d={method:"POST",...o,...r},c={},l={};await ie(c,"x-immutable-api-key",e),c["Content-Type"]="application/json",P(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},d.data=W(i,d,e),{url:x(s),options:d}},getMintRequest:async(a,t,i,r={})=>{f("getMintRequest","contractAddress",a),f("getMintRequest","chainName",t),f("getMintRequest","referenceId",i);let n="/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests/{reference_id}".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))).replace("{reference_id}",encodeURIComponent(String(i))),s=new URL(n,w),o;e&&(o=e.baseOptions);let d={method:"GET",...o,...r},c={},l={};await ie(c,"x-immutable-api-key",e),P(s,l);let h=o&&o.headers?o.headers:{};return d.headers={...c,...h,...r.headers},{url:x(s),options:d}},getNFT:async(a,t,i,r={})=>{f("getNFT","contractAddress",a),f("getNFT","tokenId",t),f("getNFT","chainName",i);let n="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(a))).replace("{token_id}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(i))),s=new URL(n,w),o;e&&(o=e.baseOptions);let d={method:"GET",...o,...r},c={};P(s,{});let l=o&&o.headers?o.headers:{};return d.headers={...c,...l,...r.headers},{url:x(s),options:d}},listAllNFTs:async(a,t,i,r,n={})=>{f("listAllNFTs","chainName",a);let s="/v1/chains/{chain_name}/nfts".replace("{chain_name}",encodeURIComponent(String(a))),o=new URL(s,w),d;e&&(d=e.baseOptions);let c={method:"GET",...d,...n},l={},h={};t!==void 0&&(h.from_updated_at=t instanceof Date?t.toISOString():t),i!==void 0&&(h.page_cursor=i),r!==void 0&&(h.page_size=r),P(o,h);let u=d&&d.headers?d.headers:{};return c.headers={...l,...u,...n.headers},{url:x(o),options:c}},listMintRequests:async(a,t,i,r,n,s={})=>{f("listMintRequests","contractAddress",a),f("listMintRequests","chainName",t);let o="/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),d=new URL(o,w),c;e&&(c=e.baseOptions);let l={method:"GET",...c,...s},h={},u={};await ie(h,"x-immutable-api-key",e),i!==void 0&&(u.page_cursor=i),r!==void 0&&(u.page_size=r),n!==void 0&&(u.status=n),P(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},{url:x(d),options:l}},listNFTs:async(a,t,i,r,n,s,o={})=>{f("listNFTs","contractAddress",a),f("listNFTs","chainName",t);let d="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),c=new URL(d,w),l;e&&(l=e.baseOptions);let h={method:"GET",...l,...o},u={},p={};i&&(p.token_id=i),r!==void 0&&(p.from_updated_at=r instanceof Date?r.toISOString():r),n!==void 0&&(p.page_cursor=n),s!==void 0&&(p.page_size=s),P(c,p);let g=l&&l.headers?l.headers:{};return h.headers={...u,...g,...o.headers},{url:x(c),options:h}},listNFTsByAccountAddress:async(a,t,i,r,n,s,o,d={})=>{f("listNFTsByAccountAddress","accountAddress",a),f("listNFTsByAccountAddress","chainName",t);let c="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),l=new URL(c,w),h;e&&(h=e.baseOptions);let u={method:"GET",...h,...d},p={},g={};i!==void 0&&(g.contract_address=i),r&&(g.token_id=r),n!==void 0&&(g.from_updated_at=n instanceof Date?n.toISOString():n),s!==void 0&&(g.page_cursor=s),o!==void 0&&(g.page_size=o),P(l,g);let y=h&&h.headers?h.headers:{};return u.headers={...p,...y,...d.headers},{url:x(l),options:u}}}},Z=function(e){let a=Kt(e);return {async createMintRequest(t,i,r,n){let s=await a.createMintRequest(t,i,r,n);return M(s,m,I,e)},async getMintRequest(t,i,r,n){let s=await a.getMintRequest(t,i,r,n);return M(s,m,I,e)},async getNFT(t,i,r,n){let s=await a.getNFT(t,i,r,n);return M(s,m,I,e)},async listAllNFTs(t,i,r,n,s){let o=await a.listAllNFTs(t,i,r,n,s);return M(o,m,I,e)},async listMintRequests(t,i,r,n,s,o){let d=await a.listMintRequests(t,i,r,n,s,o);return M(d,m,I,e)},async listNFTs(t,i,r,n,s,o,d){let c=await a.listNFTs(t,i,r,n,s,o,d);return M(c,m,I,e)},async listNFTsByAccountAddress(t,i,r,n,s,o,d,c){let l=await a.listNFTsByAccountAddress(t,i,r,n,s,o,d,c);return M(l,m,I,e)}}},un=function(e,a,t){let i=Z(e);return {createMintRequest(r,n){return i.createMintRequest(r.contractAddress,r.chainName,r.createMintRequestRequest,n).then(s=>s(t,a))},getMintRequest(r,n){return i.getMintRequest(r.contractAddress,r.chainName,r.referenceId,n).then(s=>s(t,a))},getNFT(r,n){return i.getNFT(r.contractAddress,r.tokenId,r.chainName,n).then(s=>s(t,a))},listAllNFTs(r,n){return i.listAllNFTs(r.chainName,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listMintRequests(r,n){return i.listMintRequests(r.contractAddress,r.chainName,r.pageCursor,r.pageSize,r.status,n).then(s=>s(t,a))},listNFTs(r,n){return i.listNFTs(r.contractAddress,r.chainName,r.tokenId,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))},listNFTsByAccountAddress(r,n){return i.listNFTsByAccountAddress(r.accountAddress,r.chainName,r.contractAddress,r.tokenId,r.fromUpdatedAt,r.pageCursor,r.pageSize,n).then(s=>s(t,a))}}},pn=class extends z{createMintRequest(e,a){return Z(this.configuration).createMintRequest(e.contractAddress,e.chainName,e.createMintRequestRequest,a).then(t=>t(this.axios,this.basePath))}getMintRequest(e,a){return Z(this.configuration).getMintRequest(e.contractAddress,e.chainName,e.referenceId,a).then(t=>t(this.axios,this.basePath))}getNFT(e,a){return Z(this.configuration).getNFT(e.contractAddress,e.tokenId,e.chainName,a).then(t=>t(this.axios,this.basePath))}listAllNFTs(e,a){return Z(this.configuration).listAllNFTs(e.chainName,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listMintRequests(e,a){return Z(this.configuration).listMintRequests(e.contractAddress,e.chainName,e.pageCursor,e.pageSize,e.status,a).then(t=>t(this.axios,this.basePath))}listNFTs(e,a){return Z(this.configuration).listNFTs(e.contractAddress,e.chainName,e.tokenId,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}listNFTsByAccountAddress(e,a){return Z(this.configuration).listNFTsByAccountAddress(e.accountAddress,e.chainName,e.contractAddress,e.tokenId,e.fromUpdatedAt,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}},$t=function(e){return {cancelOrders:async(a,t,i={})=>{f("cancelOrders","chainName",a),f("cancelOrders","cancelOrdersRequestBody",t);let r="/v1/chains/{chain_name}/orders/cancel".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},createBid:async(a,t,i={})=>{f("createBid","chainName",a),f("createBid","createBidRequestBody",t);let r="/v1/chains/{chain_name}/orders/bids".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},createCollectionBid:async(a,t,i={})=>{f("createCollectionBid","chainName",a),f("createCollectionBid","createCollectionBidRequestBody",t);let r="/v1/chains/{chain_name}/orders/collection-bids".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},createListing:async(a,t,i={})=>{f("createListing","chainName",a),f("createListing","createListingRequestBody",t);let r="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},fulfillmentData:async(a,t,i={})=>{f("fulfillmentData","chainName",a),f("fulfillmentData","fulfillmentDataRequest",t);let r="/v1/chains/{chain_name}/orders/fulfillment-data".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},getBid:async(a,t,i={})=>{f("getBid","chainName",a),f("getBid","bidId",t);let r="/v1/chains/{chain_name}/orders/bids/{bid_id}".replace("{chain_name}",encodeURIComponent(String(a))).replace("{bid_id}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},getCollectionBid:async(a,t,i={})=>{f("getCollectionBid","chainName",a),f("getCollectionBid","collectionBidId",t);let r="/v1/chains/{chain_name}/orders/collection-bids/{collection_bid_id}".replace("{chain_name}",encodeURIComponent(String(a))).replace("{collection_bid_id}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},getListing:async(a,t,i={})=>{f("getListing","chainName",a),f("getListing","listingId",t);let r="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(a))).replace("{listing_id}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},getTrade:async(a,t,i={})=>{f("getTrade","chainName",a),f("getTrade","tradeId",t);let r="/v1/chains/{chain_name}/trades/{trade_id}".replace("{chain_name}",encodeURIComponent(String(a))).replace("{trade_id}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},listBids:async(a,t,i,r,n,s,o,d,c,l,h,u,p={})=>{f("listBids","chainName",a);let g="/v1/chains/{chain_name}/orders/bids".replace("{chain_name}",encodeURIComponent(String(a))),y=new URL(g,w),R;e&&(R=e.baseOptions);let v={method:"GET",...R,...p},T={},b={};t!==void 0&&(b.status=t),i!==void 0&&(b.buy_item_contract_address=i),r!==void 0&&(b.sell_item_contract_address=r),n!==void 0&&(b.account_address=n),s!==void 0&&(b.buy_item_metadata_id=s),o!==void 0&&(b.buy_item_token_id=o),d!==void 0&&(b.from_updated_at=d instanceof Date?d.toISOString():d),c!==void 0&&(b.page_size=c),l!==void 0&&(b.sort_by=l),h!==void 0&&(b.sort_direction=h),u!==void 0&&(b.page_cursor=u),P(y,b);let k=R&&R.headers?R.headers:{};return v.headers={...T,...k,...p.headers},{url:x(y),options:v}},listCollectionBids:async(a,t,i,r,n,s,o,d,c,l,h={})=>{f("listCollectionBids","chainName",a);let u="/v1/chains/{chain_name}/orders/collection-bids".replace("{chain_name}",encodeURIComponent(String(a))),p=new URL(u,w),g;e&&(g=e.baseOptions);let y={method:"GET",...g,...h},R={},v={};t!==void 0&&(v.status=t),i!==void 0&&(v.buy_item_contract_address=i),r!==void 0&&(v.sell_item_contract_address=r),n!==void 0&&(v.account_address=n),s!==void 0&&(v.from_updated_at=s instanceof Date?s.toISOString():s),o!==void 0&&(v.page_size=o),d!==void 0&&(v.sort_by=d),c!==void 0&&(v.sort_direction=c),l!==void 0&&(v.page_cursor=l),P(p,v);let T=g&&g.headers?g.headers:{};return y.headers={...R,...T,...h.headers},{url:x(p),options:y}},listListings:async(a,t,i,r,n,s,o,d,c,l,h,u,p,g={})=>{f("listListings","chainName",a);let y="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(a))),R=new URL(y,w),v;e&&(v=e.baseOptions);let T={method:"GET",...v,...g},b={},k={};t!==void 0&&(k.status=t),i!==void 0&&(k.sell_item_contract_address=i),r!==void 0&&(k.buy_item_type=r),n!==void 0&&(k.buy_item_contract_address=n),s!==void 0&&(k.account_address=s),o!==void 0&&(k.sell_item_metadata_id=o),d!==void 0&&(k.sell_item_token_id=d),c!==void 0&&(k.from_updated_at=c instanceof Date?c.toISOString():c),l!==void 0&&(k.page_size=l),h!==void 0&&(k.sort_by=h),u!==void 0&&(k.sort_direction=u),p!==void 0&&(k.page_cursor=p),P(R,k);let N=v&&v.headers?v.headers:{};return T.headers={...b,...N,...g.headers},{url:x(R),options:T}},listTrades:async(a,t,i,r,n,s,o,d,c={})=>{f("listTrades","chainName",a);let l="/v1/chains/{chain_name}/trades".replace("{chain_name}",encodeURIComponent(String(a))),h=new URL(l,w),u;e&&(u=e.baseOptions);let p={method:"GET",...u,...c},g={},y={};t!==void 0&&(y.account_address=t),i!==void 0&&(y.sell_item_contract_address=i),r!==void 0&&(y.from_indexed_at=r instanceof Date?r.toISOString():r),n!==void 0&&(y.page_size=n),s!==void 0&&(y.sort_by=s),o!==void 0&&(y.sort_direction=o),d!==void 0&&(y.page_cursor=d),P(h,y);let R=u&&u.headers?u.headers:{};return p.headers={...g,...R,...c.headers},{url:x(h),options:p}}}},H=function(e){let a=$t(e);return {async cancelOrders(t,i,r){let n=await a.cancelOrders(t,i,r);return M(n,m,I,e)},async createBid(t,i,r){let n=await a.createBid(t,i,r);return M(n,m,I,e)},async createCollectionBid(t,i,r){let n=await a.createCollectionBid(t,i,r);return M(n,m,I,e)},async createListing(t,i,r){let n=await a.createListing(t,i,r);return M(n,m,I,e)},async fulfillmentData(t,i,r){let n=await a.fulfillmentData(t,i,r);return M(n,m,I,e)},async getBid(t,i,r){let n=await a.getBid(t,i,r);return M(n,m,I,e)},async getCollectionBid(t,i,r){let n=await a.getCollectionBid(t,i,r);return M(n,m,I,e)},async getListing(t,i,r){let n=await a.getListing(t,i,r);return M(n,m,I,e)},async getTrade(t,i,r){let n=await a.getTrade(t,i,r);return M(n,m,I,e)},async listBids(t,i,r,n,s,o,d,c,l,h,u,p,g){let y=await a.listBids(t,i,r,n,s,o,d,c,l,h,u,p,g);return M(y,m,I,e)},async listCollectionBids(t,i,r,n,s,o,d,c,l,h,u){let p=await a.listCollectionBids(t,i,r,n,s,o,d,c,l,h,u);return M(p,m,I,e)},async listListings(t,i,r,n,s,o,d,c,l,h,u,p,g,y){let R=await a.listListings(t,i,r,n,s,o,d,c,l,h,u,p,g,y);return M(R,m,I,e)},async listTrades(t,i,r,n,s,o,d,c,l){let h=await a.listTrades(t,i,r,n,s,o,d,c,l);return M(h,m,I,e)}}},gn=function(e,a,t){let i=H(e);return {cancelOrders(r,n){return i.cancelOrders(r.chainName,r.cancelOrdersRequestBody,n).then(s=>s(t,a))},createBid(r,n){return i.createBid(r.chainName,r.createBidRequestBody,n).then(s=>s(t,a))},createCollectionBid(r,n){return i.createCollectionBid(r.chainName,r.createCollectionBidRequestBody,n).then(s=>s(t,a))},createListing(r,n){return i.createListing(r.chainName,r.createListingRequestBody,n).then(s=>s(t,a))},fulfillmentData(r,n){return i.fulfillmentData(r.chainName,r.fulfillmentDataRequest,n).then(s=>s(t,a))},getBid(r,n){return i.getBid(r.chainName,r.bidId,n).then(s=>s(t,a))},getCollectionBid(r,n){return i.getCollectionBid(r.chainName,r.collectionBidId,n).then(s=>s(t,a))},getListing(r,n){return i.getListing(r.chainName,r.listingId,n).then(s=>s(t,a))},getTrade(r,n){return i.getTrade(r.chainName,r.tradeId,n).then(s=>s(t,a))},listBids(r,n){return i.listBids(r.chainName,r.status,r.buyItemContractAddress,r.sellItemContractAddress,r.accountAddress,r.buyItemMetadataId,r.buyItemTokenId,r.fromUpdatedAt,r.pageSize,r.sortBy,r.sortDirection,r.pageCursor,n).then(s=>s(t,a))},listCollectionBids(r,n){return i.listCollectionBids(r.chainName,r.status,r.buyItemContractAddress,r.sellItemContractAddress,r.accountAddress,r.fromUpdatedAt,r.pageSize,r.sortBy,r.sortDirection,r.pageCursor,n).then(s=>s(t,a))},listListings(r,n){return i.listListings(r.chainName,r.status,r.sellItemContractAddress,r.buyItemType,r.buyItemContractAddress,r.accountAddress,r.sellItemMetadataId,r.sellItemTokenId,r.fromUpdatedAt,r.pageSize,r.sortBy,r.sortDirection,r.pageCursor,n).then(s=>s(t,a))},listTrades(r,n){return i.listTrades(r.chainName,r.accountAddress,r.sellItemContractAddress,r.fromIndexedAt,r.pageSize,r.sortBy,r.sortDirection,r.pageCursor,n).then(s=>s(t,a))}}},mn=class extends z{cancelOrders(e,a){return H(this.configuration).cancelOrders(e.chainName,e.cancelOrdersRequestBody,a).then(t=>t(this.axios,this.basePath))}createBid(e,a){return H(this.configuration).createBid(e.chainName,e.createBidRequestBody,a).then(t=>t(this.axios,this.basePath))}createCollectionBid(e,a){return H(this.configuration).createCollectionBid(e.chainName,e.createCollectionBidRequestBody,a).then(t=>t(this.axios,this.basePath))}createListing(e,a){return H(this.configuration).createListing(e.chainName,e.createListingRequestBody,a).then(t=>t(this.axios,this.basePath))}fulfillmentData(e,a){return H(this.configuration).fulfillmentData(e.chainName,e.fulfillmentDataRequest,a).then(t=>t(this.axios,this.basePath))}getBid(e,a){return H(this.configuration).getBid(e.chainName,e.bidId,a).then(t=>t(this.axios,this.basePath))}getCollectionBid(e,a){return H(this.configuration).getCollectionBid(e.chainName,e.collectionBidId,a).then(t=>t(this.axios,this.basePath))}getListing(e,a){return H(this.configuration).getListing(e.chainName,e.listingId,a).then(t=>t(this.axios,this.basePath))}getTrade(e,a){return H(this.configuration).getTrade(e.chainName,e.tradeId,a).then(t=>t(this.axios,this.basePath))}listBids(e,a){return H(this.configuration).listBids(e.chainName,e.status,e.buyItemContractAddress,e.sellItemContractAddress,e.accountAddress,e.buyItemMetadataId,e.buyItemTokenId,e.fromUpdatedAt,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}listCollectionBids(e,a){return H(this.configuration).listCollectionBids(e.chainName,e.status,e.buyItemContractAddress,e.sellItemContractAddress,e.accountAddress,e.fromUpdatedAt,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}listListings(e,a){return H(this.configuration).listListings(e.chainName,e.status,e.sellItemContractAddress,e.buyItemType,e.buyItemContractAddress,e.accountAddress,e.sellItemMetadataId,e.sellItemTokenId,e.fromUpdatedAt,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}listTrades(e,a){return H(this.configuration).listTrades(e.chainName,e.accountAddress,e.sellItemContractAddress,e.fromIndexedAt,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}},fn={CreatedAt:"created_at",UpdatedAt:"updated_at",SellItemAmount:"sell_item_amount"},yn={Asc:"asc",Desc:"desc"},Cn={CreatedAt:"created_at",UpdatedAt:"updated_at",SellItemAmount:"sell_item_amount"},Tn={Asc:"asc",Desc:"desc"},Rn={Native:"NATIVE",Erc20:"ERC20"},vn={CreatedAt:"created_at",UpdatedAt:"updated_at",BuyItemAmount:"buy_item_amount"},En={Asc:"asc",Desc:"desc"},_n={IndexedAt:"indexed_at"},An={Asc:"asc",Desc:"desc"},Xt=function(e){return {createCounterfactualAddressV2:async(a,t,i={})=>{f("createCounterfactualAddressV2","chainName",a),f("createCounterfactualAddressV2","createCounterfactualAddressRequest",t);let r="/v2/chains/{chain_name}/passport/counterfactual-address".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};await q(d,e),d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},getLinkedAddresses:async(a,t,i={})=>{f("getLinkedAddresses","userId",a),f("getLinkedAddresses","chainName",t);let r="/v1/chains/{chain_name}/passport/users/{user_id}/linked-addresses".replace("{user_id}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={},c={};await q(d,e),P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},{url:x(n),options:o}},getLinkedAddressesDeprecated:async(a,t={})=>{f("getLinkedAddressesDeprecated","userId",a);let i="/passport-mr/v1/users/{userId}/linked-addresses".replace("{userId}",encodeURIComponent(String(a))),r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={},d={};await q(o,e),P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},{url:x(r),options:s}},getTransactionMetadata:async(a,t,i={})=>{f("getTransactionMetadata","chainName",a),f("getTransactionMetadata","getTransactionMetadataRequest",t);let r="/v1/chains/{chain_name}/passport/transaction-metadata".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};await q(d,e),d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},getTypedDataMetadata:async(a,t,i={})=>{f("getTypedDataMetadata","chainName",a),f("getTypedDataMetadata","getTypedDataMetadataRequest",t);let r="/v1/chains/{chain_name}/passport/typeddata-metadata".replace("{chain_name}",encodeURIComponent(String(a))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...i},d={},c={};await q(d,e),d["Content-Type"]="application/json",P(n,c);let l=s&&s.headers?s.headers:{};return o.headers={...d,...l,...i.headers},o.data=W(t,o,e),{url:x(n),options:o}},getUserMetadata:async(a,t={})=>{f("getUserMetadata","userId",a);let i="/passport-mr/v1/users/{user_id}/metadata".replace("{user_id}",encodeURIComponent(String(a))),r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"GET",...n,...t},o={},d={};await ie(o,"x-immutable-api-key",e),P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},{url:x(r),options:s}}}},se=function(e){let a=Xt(e);return {async createCounterfactualAddressV2(t,i,r){let n=await a.createCounterfactualAddressV2(t,i,r);return M(n,m,I,e)},async getLinkedAddresses(t,i,r){let n=await a.getLinkedAddresses(t,i,r);return M(n,m,I,e)},async getLinkedAddressesDeprecated(t,i){let r=await a.getLinkedAddressesDeprecated(t,i);return M(r,m,I,e)},async getTransactionMetadata(t,i,r){let n=await a.getTransactionMetadata(t,i,r);return M(n,m,I,e)},async getTypedDataMetadata(t,i,r){let n=await a.getTypedDataMetadata(t,i,r);return M(n,m,I,e)},async getUserMetadata(t,i){let r=await a.getUserMetadata(t,i);return M(r,m,I,e)}}},Sn=function(e,a,t){let i=se(e);return {createCounterfactualAddressV2(r,n){return i.createCounterfactualAddressV2(r.chainName,r.createCounterfactualAddressRequest,n).then(s=>s(t,a))},getLinkedAddresses(r,n){return i.getLinkedAddresses(r.userId,r.chainName,n).then(s=>s(t,a))},getLinkedAddressesDeprecated(r,n){return i.getLinkedAddressesDeprecated(r.userId,n).then(s=>s(t,a))},getTransactionMetadata(r,n){return i.getTransactionMetadata(r.chainName,r.getTransactionMetadataRequest,n).then(s=>s(t,a))},getTypedDataMetadata(r,n){return i.getTypedDataMetadata(r.chainName,r.getTypedDataMetadataRequest,n).then(s=>s(t,a))},getUserMetadata(r,n){return i.getUserMetadata(r.userId,n).then(s=>s(t,a))}}},On=class extends z{createCounterfactualAddressV2(e,a){return se(this.configuration).createCounterfactualAddressV2(e.chainName,e.createCounterfactualAddressRequest,a).then(t=>t(this.axios,this.basePath))}getLinkedAddresses(e,a){return se(this.configuration).getLinkedAddresses(e.userId,e.chainName,a).then(t=>t(this.axios,this.basePath))}getLinkedAddressesDeprecated(e,a){return se(this.configuration).getLinkedAddressesDeprecated(e.userId,a).then(t=>t(this.axios,this.basePath))}getTransactionMetadata(e,a){return se(this.configuration).getTransactionMetadata(e.chainName,e.getTransactionMetadataRequest,a).then(t=>t(this.axios,this.basePath))}getTypedDataMetadata(e,a){return se(this.configuration).getTypedDataMetadata(e.chainName,e.getTypedDataMetadataRequest,a).then(t=>t(this.axios,this.basePath))}getUserMetadata(e,a){return se(this.configuration).getUserMetadata(e.userId,a).then(t=>t(this.axios,this.basePath))}},Zt=function(e){return {getUserInfo:async(a={})=>{let t="/passport-profile/v1/user/info",i=new URL(t,w),r;e&&(r=e.baseOptions);let n={method:"GET",...r,...a},s={},o={};await q(s,e),P(i,o);let d=r&&r.headers?r.headers:{};return n.headers={...s,...d,...a.headers},{url:x(i),options:n}},linkWalletV2:async(a,t={})=>{let i="/passport-profile/v2/linked-wallets",r=new URL(i,w),n;e&&(n=e.baseOptions);let s={method:"POST",...n,...t},o={},d={};await q(o,e),o["Content-Type"]="application/json",P(r,d);let c=n&&n.headers?n.headers:{};return s.headers={...o,...c,...t.headers},s.data=W(a,s,e),{url:x(r),options:s}}}},Ve=function(e){let a=Zt(e);return {async getUserInfo(t){let i=await a.getUserInfo(t);return M(i,m,I,e)},async linkWalletV2(t,i){let r=await a.linkWalletV2(t,i);return M(r,m,I,e)}}},In=function(e,a,t){let i=Ve(e);return {getUserInfo(r){return i.getUserInfo(r).then(n=>n(t,a))},linkWalletV2(r={},n){return i.linkWalletV2(r.linkWalletV2Request,n).then(s=>s(t,a))}}},bn=class extends z{getUserInfo(e){return Ve(this.configuration).getUserInfo(e).then(a=>a(this.axios,this.basePath))}linkWalletV2(e={},a){return Ve(this.configuration).linkWalletV2(e.linkWalletV2Request,a).then(t=>t(this.axios,this.basePath))}},Yt=function(e){return {quotesForNFTs:async(a,t,i,r,n,s={})=>{f("quotesForNFTs","chainName",a),f("quotesForNFTs","contractAddress",t),f("quotesForNFTs","tokenId",i);let o="/v1/chains/{chain_name}/quotes/{contract_address}/nfts".replace("{chain_name}",encodeURIComponent(String(a))).replace("{contract_address}",encodeURIComponent(String(t))),d=new URL(o,w),c;e&&(c=e.baseOptions);let l={method:"GET",...c,...s},h={},u={};i&&(u.token_id=i),r!==void 0&&(u.payment_token=r),n!==void 0&&(u.page_cursor=n),P(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},{url:x(d),options:l}},quotesForStacks:async(a,t,i,r,n,s={})=>{f("quotesForStacks","chainName",a),f("quotesForStacks","contractAddress",t),f("quotesForStacks","stackId",i);let o="/v1/chains/{chain_name}/quotes/{contract_address}/stacks".replace("{chain_name}",encodeURIComponent(String(a))).replace("{contract_address}",encodeURIComponent(String(t))),d=new URL(o,w),c;e&&(c=e.baseOptions);let l={method:"GET",...c,...s},h={},u={};i&&(u.stack_id=i),r!==void 0&&(u.payment_token=r),n!==void 0&&(u.page_cursor=n),P(d,u);let p=c&&c.headers?c.headers:{};return l.headers={...h,...p,...s.headers},{url:x(d),options:l}}}},qe=function(e){let a=Yt(e);return {async quotesForNFTs(t,i,r,n,s,o){let d=await a.quotesForNFTs(t,i,r,n,s,o);return M(d,m,I,e)},async quotesForStacks(t,i,r,n,s,o){let d=await a.quotesForStacks(t,i,r,n,s,o);return M(d,m,I,e)}}},wn=function(e,a,t){let i=qe(e);return {quotesForNFTs(r,n){return i.quotesForNFTs(r.chainName,r.contractAddress,r.tokenId,r.paymentToken,r.pageCursor,n).then(s=>s(t,a))},quotesForStacks(r,n){return i.quotesForStacks(r.chainName,r.contractAddress,r.stackId,r.paymentToken,r.pageCursor,n).then(s=>s(t,a))}}},Pn=class extends z{quotesForNFTs(e,a){return qe(this.configuration).quotesForNFTs(e.chainName,e.contractAddress,e.tokenId,e.paymentToken,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}quotesForStacks(e,a){return qe(this.configuration).quotesForStacks(e.chainName,e.contractAddress,e.stackId,e.paymentToken,e.pageCursor,a).then(t=>t(this.axios,this.basePath))}},Qt=function(e){return {getERC20Token:async(a,t,i={})=>{f("getERC20Token","contractAddress",a),f("getERC20Token","chainName",t);let r="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(a))).replace("{chain_name}",encodeURIComponent(String(t))),n=new URL(r,w),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...i},d={};P(n,{});let c=s&&s.headers?s.headers:{};return o.headers={...d,...c,...i.headers},{url:x(n),options:o}},listERC20Tokens:async(a,t,i,r,n,s,o={})=>{f("listERC20Tokens","chainName",a);let d="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(a))),c=new URL(d,w),l;e&&(l=e.baseOptions);let h={method:"GET",...l,...o},u={},p={};t!==void 0&&(p.from_updated_at=t instanceof Date?t.toISOString():t),i&&(p.verification_status=i),r!==void 0&&(p.is_canonical=r),n!==void 0&&(p.page_cursor=n),s!==void 0&&(p.page_size=s),P(c,p);let g=l&&l.headers?l.headers:{};return h.headers={...u,...g,...o.headers},{url:x(c),options:h}}}},We=function(e){let a=Qt(e);return {async getERC20Token(t,i,r){let n=await a.getERC20Token(t,i,r);return M(n,m,I,e)},async listERC20Tokens(t,i,r,n,s,o,d){let c=await a.listERC20Tokens(t,i,r,n,s,o,d);return M(c,m,I,e)}}},xn=function(e,a,t){let i=We(e);return {getERC20Token(r,n){return i.getERC20Token(r.contractAddress,r.chainName,n).then(s=>s(t,a))},listERC20Tokens(r,n){return i.listERC20Tokens(r.chainName,r.fromUpdatedAt,r.verificationStatus,r.isCanonical,r.pageCursor,r.pageSize,n).then(s=>s(t,a))}}},Mn=class extends z{getERC20Token(e,a){return We(this.configuration).getERC20Token(e.contractAddress,e.chainName,a).then(t=>t(this.axios,this.basePath))}listERC20Tokens(e,a){return We(this.configuration).listERC20Tokens(e.chainName,e.fromUpdatedAt,e.verificationStatus,e.isCanonical,e.pageCursor,e.pageSize,a).then(t=>t(this.axios,this.basePath))}},Nn=class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor;}isJsonMime(e){let a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(a.test(e)||e.toLowerCase()==="application/json-patch+json")}},kn={ValidationError:"VALIDATION_ERROR"},Un={UnauthorisedRequest:"UNAUTHORISED_REQUEST"},Ln={AuthenticationError:"AUTHENTICATION_ERROR"},Dn={ResourceNotFound:"RESOURCE_NOT_FOUND"},Fn={ConflictError:"CONFLICT_ERROR"},Bn={TooManyRequestsError:"TOO_MANY_REQUESTS_ERROR"},Vn={InternalServerError:"INTERNAL_SERVER_ERROR"},qn={NotImplementedError:"NOT_IMPLEMENTED_ERROR"},Wn={Active:"ACTIVE"},Gn={Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale",Deposit:"deposit",Withdrawal:"withdrawal"},Hn={Verified:"verified",Unverified:"unverified",Spam:"spam",Inactive:"inactive"},zn={Cancelled:"CANCELLED"},jn={OnChain:"ON_CHAIN",OffChain:"OFF_CHAIN",Underfunded:"UNDERFUNDED"},Kn={Erc721:"ERC721",Erc1155:"ERC1155"},$n={Erc1155Collection:"ERC1155_COLLECTION"},Xn={Erc1155:"ERC1155"},Zn={Erc20Approve:"ERC20_APPROVE"},Yn={Erc20:"ERC20"},Qn={Erc20TransferFrom:"ERC20_TRANSFER_FROM"},Jn={Erc20Transfer:"ERC20_TRANSFER"},es={Erc721Approve:"ERC721_APPROVE"},ts={Erc721Collection:"ERC721_COLLECTION",Erc1155Collection:"ERC1155_COLLECTION"},as={Erc721:"ERC721"},rs={Erc721SafeTransferFromBatch:"ERC721_SAFE_TRANSFER_FROM_BATCH"},ns={Erc721TransferFrom:"ERC721_TRANSFER_FROM"},ss={Expired:"EXPIRED"},is={Filled:"FILLED"},os={Royalty:"ROYALTY",MakerEcosystem:"MAKER_ECOSYSTEM",TakerEcosystem:"TAKER_ECOSYSTEM",Protocol:"PROTOCOL"},ds={Filled:"FILLED"},cs={Verified:"verified",Unverified:"unverified",Spam:"spam",Inactive:"inactive"},ls={Inactive:"INACTIVE"},hs={Erc20:"ERC20"},us={Royalty:"ROYALTY",MakerEcosystem:"MAKER_ECOSYSTEM",TakerEcosystem:"TAKER_ECOSYSTEM",Protocol:"PROTOCOL"},ps={Native:"NATIVE"},gs={Erc721:"ERC721",Erc1155:"ERC1155"},ms={Otp:"otp",Web:"web"},fs={Pending:"pending",Succeeded:"succeeded",Failed:"failed"},ys={Erc721:"ERC721",Erc1155:"ERC1155"},Cs={Number:"number",BoostPercentage:"boost_percentage",BoostNumber:"boost_number",Date:"date"},Ts={Erc721SetApprovalForAll:"ERC721_SET_APPROVAL_FOR_ALL",Erc1155SetApprovalForAll:"ERC1155_SET_APPROVAL_FOR_ALL"},Rs={Native:"NATIVE",Erc20:"ERC20",Erc721:"ERC721",Erc1155:"ERC1155",Erc721Collection:"ERC721_COLLECTION",Erc1155Collection:"ERC1155_COLLECTION"},vs={Requested:"requested",Approved:"approved",Rejected:"rejected",Removed:"removed",Added:"added"},Es={Listing:"LISTING",Bid:"BID",CollectionBid:"COLLECTION_BID"},_s={Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Expired:"EXPIRED",Cancelled:"CANCELLED"},As={Common:"common",Uncommon:"uncommon",Rare:"rare",Epic:"epic",Legendary:"legendary"},Ss={Pending:"PENDING"},Os={FullRestricted:"FULL_RESTRICTED",PartialRestricted:"PARTIAL_RESTRICTED"},Is={Royalty:"ROYALTY"},bs={SeaportCreateListingMetadata:"SEAPORT_CREATE_LISTING_METADATA"},ws={Erc1155Collection:"ERC1155Collection"},Ps={Erc1155:"ERC1155"},xs={Erc20:"ERC20"},Ms={Erc721Collection:"ERC721Collection"},Ns={Erc721:"ERC721"},ks={Erc20:"ERC20",Native:"NATIVE"},Us={SeaportFulfillAvailableAdvancedOrders:"SEAPORT_FULFILL_AVAILABLE_ADVANCED_ORDERS"},Ls={Native:"NATIVE"},Ds={Malicious:"malicious",Benign:"benign",Warning:"warning",Unknown:"unknown",Info:"info"},Fs={Starkex:"starkex"},Bs={Erc20:"ERC20"},Vs={Starkex:"starkex",Evm:"evm"},qs={Otp:"otp",Web:"web"},Ws={Unknown:"UNKNOWN"},Gs={Unknown:"UNKNOWN"},Hs={Success:"success",Error:"error",SimulationFailed:"simulation_failed"},zs={Erc20:"ERC20",Erc721:"ERC721",Erc1155:"ERC1155"},js={Completed:"completed",Pending:"pending"},Ks={Evm:"evm"},$s={};Je($s,{APIError400AllOfCodeEnum:()=>ea,APIError401AllOfCodeEnum:()=>ta,APIError403AllOfCodeEnum:()=>aa,APIError404AllOfCodeEnum:()=>ra,APIError409AllOfCodeEnum:()=>na,APIError429AllOfCodeEnum:()=>sa,APIError500AllOfCodeEnum:()=>ia,ActivityType:()=>oa,AssetVerificationStatus:()=>da,CollectionContractType:()=>ca,MarketPriceERC20TokenTypeEnum:()=>la,MarketPriceFeesTypeEnum:()=>ha,MarketPriceNativeTokenTypeEnum:()=>ua,MarketplaceContractType:()=>pa,MintRequestStatus:()=>ga,NFTContractType:()=>ma,NFTMetadataAttributeDisplayTypeEnum:()=>fa,SaleFeeTypeEnum:()=>ya,SearchStacksSortByEnum:()=>Jt,TokenContractType:()=>Ca});var Jt=(e=>(e.CheapestFirst="cheapest_first",e))(Jt||{}),ea=(e=>(e.ValidationError="VALIDATION_ERROR",e))(ea||{}),ta=(e=>(e.UnauthorisedRequest="UNAUTHORISED_REQUEST",e))(ta||{}),aa=(e=>(e.AuthenticationError="AUTHENTICATION_ERROR",e))(aa||{}),ra=(e=>(e.ResourceNotFound="RESOURCE_NOT_FOUND",e))(ra||{}),na=(e=>(e.ConflictError="CONFLICT_ERROR",e))(na||{}),sa=(e=>(e.TooManyRequestsError="TOO_MANY_REQUESTS_ERROR",e))(sa||{}),ia=(e=>(e.InternalServerError="INTERNAL_SERVER_ERROR",e))(ia||{}),oa=(e=>(e.Mint="mint",e.Burn="burn",e.Transfer="transfer",e.Sale="sale",e.Deposit="deposit",e.Withdrawal="withdrawal",e))(oa||{}),da=(e=>(e.Verified="verified",e.Unverified="unverified",e.Spam="spam",e.Inactive="inactive",e))(da||{}),ca=(e=>(e.Erc721="ERC721",e.Erc1155="ERC1155",e))(ca||{}),la=(e=>(e.Erc20="ERC20",e))(la||{}),ha=(e=>(e.Royalty="ROYALTY",e.MakerEcosystem="MAKER_ECOSYSTEM",e.TakerEcosystem="TAKER_ECOSYSTEM",e.Protocol="PROTOCOL",e))(ha||{}),ua=(e=>(e.Native="NATIVE",e))(ua||{}),pa=(e=>(e.Erc721="ERC721",e.Erc1155="ERC1155",e))(pa||{}),ga=(e=>(e.Pending="pending",e.Succeeded="succeeded",e.Failed="failed",e))(ga||{}),ma=(e=>(e.Erc721="ERC721",e.Erc1155="ERC1155",e))(ma||{}),fa=(e=>(e.Number="number",e.BoostPercentage="boost_percentage",e.BoostNumber="boost_number",e.Date="date",e))(fa||{}),ya=(e=>(e.Royalty="ROYALTY",e))(ya||{}),Ca=(e=>(e.Erc20="ERC20",e))(Ca||{});var we="imx_passport_confirmation",Ta="im_passport_embedded_login_prompt";var Ge=({url:e,title:a,width:t,height:i})=>{let r=Math.max(0,Math.round(window.screenX+(window.outerWidth-t)/2)),n=Math.max(0,Math.round(window.screenY+(window.outerHeight-i)/2)),s=window.open(e,a,`
|
|
357
|
-
scrollbars=yes,
|
|
358
|
-
width=${t},
|
|
359
|
-
height=${i},
|
|
360
|
-
top=${n},
|
|
361
|
-
left=${r}
|
|
362
|
-
`);if(!s)throw new Error("Failed to open confirmation screen");return s.focus(),s};var st="Confirm this transaction",it=720,ot=480,Ra=1e3;var He=class{config;confirmationWindow;popupOptions;overlay;overlayClosed;timer;constructor(a){this.config=a,this.overlayClosed=!1;}getHref(a,t){let i=`${this.config.passportDomain}/transaction-confirmation/${a}`;if(t){let r=t?Object.keys(t).map(n=>`${n}=${t[n]}`).join("&"):"";i=`${i}?${r}`;}return i}requestConfirmation(a,t,i,r){return new Promise((n,s)=>{let o=({data:c,origin:l})=>{if(!(l!==this.config.passportDomain||c.eventType!==we))switch(c.messageType){case"confirmation_window_ready":{this.confirmationWindow?.postMessage({eventType:we,messageType:"confirmation_start"},this.config.passportDomain);break}case"transaction_confirmed":{this.closeWindow(),n({confirmed:!0});break}case"transaction_rejected":{this.closeWindow(),n({confirmed:!1});break}case"transaction_error":{this.closeWindow(),s(new Error("Error during transaction confirmation"));break}default:this.closeWindow(),s(new Error("Unsupported message type"));}},d="";i===at.TransactionApprovalRequestChainTypeEnum.Starkex?d=this.getHref("transaction",{transactionId:a,etherAddress:t,chainType:i}):d=this.getHref("zkevm/transaction",{transactionID:a,etherAddress:t,chainType:i,chainID:r}),window.addEventListener("message",o),this.showConfirmationScreen(d,o,n);})}requestMessageConfirmation(a,t,i){return new Promise((r,n)=>{let s=({data:d,origin:c})=>{if(!(c!==this.config.passportDomain||d.eventType!==we))switch(d.messageType){case"confirmation_window_ready":{this.confirmationWindow?.postMessage({eventType:we,messageType:"confirmation_start"},this.config.passportDomain);break}case"message_confirmed":{this.closeWindow(),r({confirmed:!0});break}case"message_rejected":{this.closeWindow(),r({confirmed:!1});break}case"message_error":{this.closeWindow(),n(new Error("Error during message confirmation"));break}default:this.closeWindow(),n(new Error("Unsupported message type"));}};window.addEventListener("message",s);let o=this.getHref("zkevm/message",{messageID:a,etherAddress:t,...i?{messageType:i}:{}});this.showConfirmationScreen(o,s,r);})}showServiceUnavailable(){return new Promise((a,t)=>{this.showConfirmationScreen(this.getHref("unavailable"),()=>{},()=>{this.closeWindow(),t(new Error("Service unavailable"));});})}loading(a){if(!this.config.crossSdkBridgeEnabled){this.popupOptions=a;try{this.confirmationWindow=Ge({url:this.getHref("loading"),title:st,width:a?.width||ot,height:a?.height||it}),this.overlay=new X(this.config.popupOverlayOptions||{});}catch(t){let i=t instanceof Error?t.message:String(t);trackError("passport","confirmationPopupDenied",new Error(i)),this.overlay=new X(this.config.popupOverlayOptions||{},!0);}this.overlay.append(()=>{try{this.confirmationWindow?.close(),this.confirmationWindow=Ge({url:this.getHref("loading"),title:st,width:this.popupOptions?.width||ot,height:this.popupOptions?.height||it});}catch{}},()=>{this.overlayClosed=!0,this.closeWindow();});}}closeWindow(){this.confirmationWindow?.close(),this.overlay?.remove(),this.overlay=void 0;}showConfirmationScreen(a,t,i){if(this.confirmationWindow&&(this.confirmationWindow.location.href=a),!this.overlay){this.overlayClosed=!1,i({confirmed:!1});return}let r=()=>{(this.confirmationWindow?.closed||this.overlayClosed)&&(clearInterval(this.timer),window.removeEventListener("message",t),i({confirmed:!1}),this.overlayClosed=!1,this.confirmationWindow=void 0);};this.timer=setInterval(r,Ra),this.overlay.update(()=>this.recreateConfirmationWindow(a,r));}recreateConfirmationWindow(a,t){try{clearInterval(this.timer),this.confirmationWindow?.close(),this.confirmationWindow=Ge({url:a,title:st,width:this.popupOptions?.width||ot,height:this.popupOptions?.height||it}),this.timer=setInterval(t,Ra);}catch{}}};var $=class{static overlay;static onCloseListener;static closeButton;static remove(){this.onCloseListener&&this.closeButton?.removeEventListener?.("click",this.onCloseListener),this.overlay?.remove(),this.closeButton=void 0,this.onCloseListener=void 0,this.overlay=void 0;}static appendOverlay(a,t){if(!this.overlay){let i=document.createElement("div");i.innerHTML=Ct(),document.body.insertAdjacentElement("beforeend",i);let r=document.querySelector(`#${_e}`);r&&r.appendChild(a),i.addEventListener("click",t),this.overlay=i;}}};var Js=660,ei=440,ti="16px",va="passport-embedded-login-keyframes",Ea="passport-embedded-login-iframe",ze=class e{config;constructor(a){this.config=a;}getHref=a=>{let t=`${this.config.authenticationDomain}/im-embedded-login-prompt?client_id=${this.config.oidcConfiguration.clientId}&rid=${getDetail(Detail.RUNTIME_ID)}`;return a&&(t+=`&third_party_a_id=${a}`),t};static appendIFrameStylesIfNeeded=()=>{if(document.getElementById(va))return;let a=document.createElement("style");a.id=va,a.textContent=`
|
|
363
|
-
@keyframes passportEmbeddedLoginPromptPopBounceIn {
|
|
364
|
-
0% {
|
|
365
|
-
opacity: 0.5;
|
|
366
|
-
}
|
|
367
|
-
50% {
|
|
368
|
-
opacity: 1;
|
|
369
|
-
transform: scale(1.05);
|
|
370
|
-
}
|
|
371
|
-
75% {
|
|
372
|
-
transform: scale(0.98);
|
|
373
|
-
}
|
|
374
|
-
100% {
|
|
375
|
-
opacity: 1;
|
|
376
|
-
transform: scale(1);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
@media (max-height: 400px) {
|
|
381
|
-
#${Ea} {
|
|
382
|
-
width: 100% !important;
|
|
383
|
-
max-width: none !important;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
@keyframes passportEmbeddedLoginPromptOverlayFadeIn {
|
|
388
|
-
from {
|
|
389
|
-
opacity: 0;
|
|
390
|
-
}
|
|
391
|
-
to {
|
|
392
|
-
opacity: 1;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
`,document.head.appendChild(a);};getEmbeddedLoginIFrame=a=>{let t=document.createElement("iframe");return t.id=Ea,t.src=this.getHref(a),t.style.height="100vh",t.style.width="100vw",t.style.maxHeight=`${Js}px`,t.style.maxWidth=`${ei}px`,t.style.borderRadius=ti,t.style.opacity="0",t.style.transform="scale(0.6)",t.style.animation="passportEmbeddedLoginPromptPopBounceIn 1s ease forwards",e.appendIFrameStylesIfNeeded(),t};displayEmbeddedLoginPrompt(a){return new Promise((t,i)=>{let r=this.getEmbeddedLoginIFrame(a),n=({data:s,origin:o})=>{if(!(o!==this.config.authenticationDomain||s.eventType!==Ta))switch(s.messageType){case"login_method_selected":{let d=s.payload;window.removeEventListener("message",n),$.remove(),t(d);break}case"login_prompt_error":{window.removeEventListener("message",n),$.remove(),i(new Error("Error during embedded login prompt",{cause:s.payload}));break}case"login_prompt_closed":{window.removeEventListener("message",n),$.remove(),i(new Error("Popup closed by user"));break}default:window.removeEventListener("message",n),$.remove(),i(new Error(`Unsupported message type: ${s.messageType}`));break}};window.addEventListener("message",n),$.appendOverlay(r,()=>{window.removeEventListener("message",n),$.remove(),i(new Error("Popup closed by user"));});})}};
|
|
396
|
-
|
|
397
|
-
export { Ze as AuthConfiguration, Le as AuthManager, X as ConfirmationOverlay, He as ConfirmationScreen, ze as EmbeddedLoginPrompt, pt as MarketingConsentStatus, K as PassportError, xe as PassportErrorType, ut as RollupType, Ke as isUserImx, je as isUserZkEvm, Q as withPassportError };
|