@imtbl/sdk 0.1.4-alpha → 0.1.5-alpha
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/checkout_sdk.d.ts +57 -3
- package/dist/checkout_sdk.js +22 -5
- package/dist/checkout_widgets.d.ts +600 -1
- package/dist/checkout_widgets.js +193 -142
- package/dist/immutablex_client.d.ts +9 -9
- package/dist/immutablex_client.js +34 -31
- package/dist/index.cjs +377 -161
- package/dist/index.d.ts +118 -13
- package/dist/index.js +385 -178
- package/dist/passport.d.ts +9 -9
- package/dist/passport.js +233 -202
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -10,6 +10,8 @@ import { parseUnits } from '@ethersproject/units';
|
|
|
10
10
|
import { BigNumber } from '@ethersproject/bignumber';
|
|
11
11
|
import detectEthereumProvider from '@metamask/detect-provider';
|
|
12
12
|
import { Web3Provider } from '@ethersproject/providers';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
import 'react';
|
|
13
15
|
|
|
14
16
|
var Environment;
|
|
15
17
|
(function (Environment) {
|
|
@@ -25,26 +27,26 @@ class ImmutableConfiguration {
|
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
30
|
+
/**
|
|
31
|
+
* Set `sdkVersion` on config
|
|
32
|
+
*/
|
|
33
|
+
const production = () => Config.createConfig({
|
|
34
|
+
basePath: 'https://api.x.immutable.com',
|
|
35
|
+
chainID: 1,
|
|
36
|
+
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
37
|
+
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
38
|
+
sdkVersion: 'ts-immutable-sdk-0.1.5-alpha',
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Set `sdkVersion` on config
|
|
42
|
+
*/
|
|
43
|
+
const sandbox = () => Config.createConfig({
|
|
44
|
+
basePath: 'https://api.sandbox.x.immutable.com',
|
|
45
|
+
chainID: 5,
|
|
46
|
+
coreContractAddress: '0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623',
|
|
47
|
+
registrationContractAddress: '0x1C97Ada273C9A52253f463042f29117090Cd7D83',
|
|
48
|
+
sdkVersion: 'ts-immutable-sdk-0.1.5-alpha',
|
|
49
|
+
});
|
|
48
50
|
class ImxConfiguration {
|
|
49
51
|
immutableXConfig;
|
|
50
52
|
baseConfig;
|
|
@@ -56,13 +58,16 @@ class ImxConfiguration {
|
|
|
56
58
|
else {
|
|
57
59
|
switch (baseConfig.environment) {
|
|
58
60
|
case Environment.SANDBOX: {
|
|
59
|
-
this.immutableXConfig =
|
|
61
|
+
this.immutableXConfig = sandbox();
|
|
60
62
|
break;
|
|
61
63
|
}
|
|
62
64
|
case Environment.PRODUCTION: {
|
|
63
|
-
this.immutableXConfig =
|
|
65
|
+
this.immutableXConfig = production();
|
|
64
66
|
break;
|
|
65
67
|
}
|
|
68
|
+
default: {
|
|
69
|
+
this.immutableXConfig = sandbox();
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
73
|
}
|
|
@@ -117,7 +122,7 @@ class ImmutableXClient {
|
|
|
117
122
|
}
|
|
118
123
|
/**
|
|
119
124
|
* Get a list of Deposits
|
|
120
|
-
* @param request - optional
|
|
125
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
121
126
|
* @returns a promise that resolves with the requested list of Deposits
|
|
122
127
|
* @throws {@link index.IMXError}
|
|
123
128
|
*/
|
|
@@ -144,7 +149,7 @@ class ImmutableXClient {
|
|
|
144
149
|
}
|
|
145
150
|
/**
|
|
146
151
|
* Get a list of Assets
|
|
147
|
-
* @param request - optional
|
|
152
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
148
153
|
* @returns a promise that resolves with the requested list of Assets
|
|
149
154
|
* @throws {@link index.IMXError}
|
|
150
155
|
*/
|
|
@@ -181,7 +186,7 @@ class ImmutableXClient {
|
|
|
181
186
|
}
|
|
182
187
|
/**
|
|
183
188
|
* Get a list of Collections
|
|
184
|
-
* @param request - optional
|
|
189
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
185
190
|
* @returns a promise that resolves with the requested list of Collections
|
|
186
191
|
* @throws {@link index.IMXError}
|
|
187
192
|
*/
|
|
@@ -337,7 +342,7 @@ class ImmutableXClient {
|
|
|
337
342
|
}
|
|
338
343
|
/**
|
|
339
344
|
* Get a list of Mints
|
|
340
|
-
* @param request optional
|
|
345
|
+
* @param request optional object containing the parameters to be provided in the API request
|
|
341
346
|
* @returns a promise that resolves with the requested list of Mints
|
|
342
347
|
* @throws {@link index.IMXError}
|
|
343
348
|
*/
|
|
@@ -356,7 +361,7 @@ class ImmutableXClient {
|
|
|
356
361
|
}
|
|
357
362
|
/**
|
|
358
363
|
* Get a list of Withdrawals
|
|
359
|
-
* @param request - optional
|
|
364
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
360
365
|
* @returns a promise that resolves with the requested list of Withdrawals
|
|
361
366
|
* @throws {@link index.IMXError}
|
|
362
367
|
*/
|
|
@@ -383,7 +388,7 @@ class ImmutableXClient {
|
|
|
383
388
|
}
|
|
384
389
|
/**
|
|
385
390
|
* Get a list of Orders
|
|
386
|
-
* @param request - optional
|
|
391
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
387
392
|
* @returns a promise that resolves with the requested list of Orders
|
|
388
393
|
* @throws {@link index.IMXError}
|
|
389
394
|
*/
|
|
@@ -401,7 +406,7 @@ class ImmutableXClient {
|
|
|
401
406
|
}
|
|
402
407
|
/**
|
|
403
408
|
* Get a list of Trades
|
|
404
|
-
* @param request - optional
|
|
409
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
405
410
|
* @returns a promise that resolves with the requested list of Trades
|
|
406
411
|
* @throws {@link index.IMXError}
|
|
407
412
|
*/
|
|
@@ -419,7 +424,7 @@ class ImmutableXClient {
|
|
|
419
424
|
}
|
|
420
425
|
/**
|
|
421
426
|
* Get a list of Tokens
|
|
422
|
-
* @param request - optional
|
|
427
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
423
428
|
* @returns a promise that resolves with the requested list of Tokens
|
|
424
429
|
* @throws {@link index.IMXError}
|
|
425
430
|
*/
|
|
@@ -437,7 +442,7 @@ class ImmutableXClient {
|
|
|
437
442
|
}
|
|
438
443
|
/**
|
|
439
444
|
* Get a list of Transfers
|
|
440
|
-
* @param request - optional
|
|
445
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
441
446
|
* @returns a promise that resolves with the requested list of Transfers
|
|
442
447
|
* @throws {@link index.IMXError}
|
|
443
448
|
*/
|
|
@@ -658,9 +663,9 @@ const getAuthConfiguration = ({ oidcConfiguration, authenticationDomain, }) => {
|
|
|
658
663
|
authorization_endpoint: `${authenticationDomain}/authorize`,
|
|
659
664
|
token_endpoint: `${authenticationDomain}/oauth/token`,
|
|
660
665
|
userinfo_endpoint: `${authenticationDomain}/userinfo`,
|
|
661
|
-
end_session_endpoint: `${authenticationDomain}/v2/logout`
|
|
662
|
-
`?returnTo=${encodeURIComponent(oidcConfiguration.logoutRedirectUri)}`
|
|
663
|
-
`&client_id=${oidcConfiguration.clientId}`,
|
|
666
|
+
end_session_endpoint: `${authenticationDomain}/v2/logout`
|
|
667
|
+
+ `?returnTo=${encodeURIComponent(oidcConfiguration.logoutRedirectUri)}`
|
|
668
|
+
+ `&client_id=${oidcConfiguration.clientId}`,
|
|
664
669
|
},
|
|
665
670
|
mergeClaims: true,
|
|
666
671
|
loadUserInfo: true,
|
|
@@ -680,7 +685,7 @@ class AuthManager {
|
|
|
680
685
|
this.config = config;
|
|
681
686
|
this.userManager = new UserManager(getAuthConfiguration(config));
|
|
682
687
|
}
|
|
683
|
-
mapOidcUserToDomainModel = (oidcUser) => {
|
|
688
|
+
static mapOidcUserToDomainModel = (oidcUser) => {
|
|
684
689
|
const passport = oidcUser.profile?.passport;
|
|
685
690
|
return {
|
|
686
691
|
expired: oidcUser.expired,
|
|
@@ -701,7 +706,7 @@ class AuthManager {
|
|
|
701
706
|
const oidcUser = await this.userManager.signinPopup({
|
|
702
707
|
popupWindowFeatures,
|
|
703
708
|
});
|
|
704
|
-
return
|
|
709
|
+
return AuthManager.mapOidcUserToDomainModel(oidcUser);
|
|
705
710
|
}, PassportErrorType.AUTHENTICATION_ERROR);
|
|
706
711
|
}
|
|
707
712
|
async loginCallback() {
|
|
@@ -720,7 +725,7 @@ class AuthManager {
|
|
|
720
725
|
if (!oidcUser) {
|
|
721
726
|
return null;
|
|
722
727
|
}
|
|
723
|
-
return
|
|
728
|
+
return AuthManager.mapOidcUserToDomainModel(oidcUser);
|
|
724
729
|
}, PassportErrorType.SILENT_LOGIN_ERROR);
|
|
725
730
|
}
|
|
726
731
|
async getUser() {
|
|
@@ -729,7 +734,7 @@ class AuthManager {
|
|
|
729
734
|
if (!oidcUser) {
|
|
730
735
|
return null;
|
|
731
736
|
}
|
|
732
|
-
return
|
|
737
|
+
return AuthManager.mapOidcUserToDomainModel(oidcUser);
|
|
733
738
|
}, PassportErrorType.NOT_LOGGED_IN_ERROR);
|
|
734
739
|
}
|
|
735
740
|
async requestRefreshTokenAfterRegistration() {
|
|
@@ -737,18 +742,18 @@ class AuthManager {
|
|
|
737
742
|
const updatedUser = await retryWithDelay(async () => {
|
|
738
743
|
const user = await this.userManager.signinSilent();
|
|
739
744
|
const passportMetadata = user?.profile?.passport;
|
|
740
|
-
const metadataExists = !!passportMetadata?.ether_key
|
|
741
|
-
!!passportMetadata?.stark_key
|
|
742
|
-
!!passportMetadata?.user_admin_key;
|
|
745
|
+
const metadataExists = !!passportMetadata?.ether_key
|
|
746
|
+
&& !!passportMetadata?.stark_key
|
|
747
|
+
&& !!passportMetadata?.user_admin_key;
|
|
743
748
|
if (metadataExists) {
|
|
744
749
|
return user;
|
|
745
750
|
}
|
|
746
|
-
return Promise.reject('user wallet addresses not exist');
|
|
751
|
+
return Promise.reject(new Error('user wallet addresses not exist'));
|
|
747
752
|
});
|
|
748
753
|
if (!updatedUser) {
|
|
749
754
|
return null;
|
|
750
755
|
}
|
|
751
|
-
return
|
|
756
|
+
return AuthManager.mapOidcUserToDomainModel(updatedUser);
|
|
752
757
|
}, PassportErrorType.REFRESH_TOKEN_ERROR);
|
|
753
758
|
}
|
|
754
759
|
}
|
|
@@ -787,12 +792,24 @@ var SendMessage;
|
|
|
787
792
|
})(SendMessage || (SendMessage = {}));
|
|
788
793
|
var TransactionTypes;
|
|
789
794
|
(function (TransactionTypes) {
|
|
795
|
+
// TODO: remove this once the naming has been fixed
|
|
796
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
790
797
|
TransactionTypes["CancelOrder"] = "delete:v1/orders";
|
|
798
|
+
// TODO: remove this once the naming has been fixed
|
|
799
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
791
800
|
TransactionTypes["CreateOrder"] = "post:v1/orders";
|
|
801
|
+
// TODO: remove this once the naming has been fixed
|
|
802
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
792
803
|
TransactionTypes["CreateTrade"] = "post:v1/trades";
|
|
804
|
+
// TODO: remove this once the naming has been fixed
|
|
805
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
793
806
|
TransactionTypes["CreateTransfer"] = "post:v1/transfers";
|
|
807
|
+
// TODO: remove this once the naming has been fixed
|
|
808
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
794
809
|
TransactionTypes["CreateBatchTransfer"] = "post:v2/transfers";
|
|
795
810
|
})(TransactionTypes || (TransactionTypes = {}));
|
|
811
|
+
// TODO: remove this once the naming has been fixed
|
|
812
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
796
813
|
const PassportEventType = 'imx_passport_confirmation';
|
|
797
814
|
|
|
798
815
|
const openPopupCenter = ({ url, title, width, height, }) => {
|
|
@@ -812,10 +829,10 @@ const openPopupCenter = ({ url, title, width, height, }) => {
|
|
|
812
829
|
return newWindow;
|
|
813
830
|
};
|
|
814
831
|
|
|
815
|
-
const
|
|
816
|
-
const
|
|
817
|
-
const
|
|
818
|
-
const
|
|
832
|
+
const CONFIRMATION_WINDOW_TITLE = 'Confirm this transaction';
|
|
833
|
+
const CONFIRMATION_WINDOW_HEIGHT = 380;
|
|
834
|
+
const CONFIRMATION_WINDOW_WIDTH = 480;
|
|
835
|
+
const CONFIRMATION_WINDOW_CLOSED_POLLING_DURATION = 1000;
|
|
819
836
|
class ConfirmationScreen {
|
|
820
837
|
config;
|
|
821
838
|
constructor(config) {
|
|
@@ -831,12 +848,14 @@ class ConfirmationScreen {
|
|
|
831
848
|
startTransaction(accessToken, transaction, popupOptions) {
|
|
832
849
|
return new Promise((resolve, reject) => {
|
|
833
850
|
const messageHandler = ({ data, origin }) => {
|
|
834
|
-
if (origin
|
|
835
|
-
data.eventType
|
|
851
|
+
if (origin !== this.config.passportDomain
|
|
852
|
+
|| data.eventType !== PassportEventType) {
|
|
836
853
|
return;
|
|
837
854
|
}
|
|
838
855
|
switch (data.messageType) {
|
|
839
856
|
case ReceiveMessage.CONFIRMATION_WINDOW_READY: {
|
|
857
|
+
// TODO: remove once fixed
|
|
858
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
840
859
|
this.postMessage(confirmationWindow, accessToken, {
|
|
841
860
|
messageType: SendMessage.TRANSACTION_START,
|
|
842
861
|
messageData: transaction,
|
|
@@ -858,87 +877,87 @@ class ConfirmationScreen {
|
|
|
858
877
|
window.addEventListener('message', messageHandler);
|
|
859
878
|
const confirmationWindow = openPopupCenter({
|
|
860
879
|
url: `${this.config.passportDomain}/transaction-confirmation`,
|
|
861
|
-
title:
|
|
862
|
-
width: popupOptions?.width ||
|
|
863
|
-
height: popupOptions?.height ||
|
|
880
|
+
title: CONFIRMATION_WINDOW_TITLE,
|
|
881
|
+
width: popupOptions?.width || CONFIRMATION_WINDOW_WIDTH,
|
|
882
|
+
height: popupOptions?.height || CONFIRMATION_WINDOW_HEIGHT,
|
|
864
883
|
});
|
|
865
884
|
// https://stackoverflow.com/questions/9388380/capture-the-close-event-of-popup-window-in-javascript/48240128#48240128
|
|
866
|
-
const timer = setInterval(
|
|
885
|
+
const timer = setInterval(() => {
|
|
867
886
|
if (confirmationWindow.closed) {
|
|
868
887
|
clearInterval(timer);
|
|
869
888
|
window.removeEventListener('message', messageHandler);
|
|
870
889
|
resolve({ confirmed: false });
|
|
871
890
|
}
|
|
872
|
-
},
|
|
891
|
+
}, CONFIRMATION_WINDOW_CLOSED_POLLING_DURATION);
|
|
873
892
|
});
|
|
874
893
|
}
|
|
875
894
|
}
|
|
876
895
|
|
|
877
896
|
const ERC721$1 = 'ERC721';
|
|
878
|
-
const transfer$1 = ({ request, transfersApi, starkSigner, user, passportConfig,
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
897
|
+
const transfer$1 = ({ request, transfersApi, starkSigner, user, passportConfig,
|
|
898
|
+
// TODO: remove this eslint disable once we have a better solution
|
|
899
|
+
// eslint-disable-next-line max-len
|
|
900
|
+
}) => withPassportError(async () => {
|
|
901
|
+
const transferAmount = request.type === ERC721$1 ? '1' : request.amount;
|
|
902
|
+
const getSignableTransferRequest = {
|
|
903
|
+
sender: user.etherKey,
|
|
904
|
+
token: convertToSignableToken(request),
|
|
905
|
+
amount: transferAmount,
|
|
906
|
+
receiver: request.receiver,
|
|
907
|
+
};
|
|
908
|
+
const signableResult = await transfersApi.getSignableTransferV1({
|
|
909
|
+
getSignableTransferRequest,
|
|
910
|
+
});
|
|
911
|
+
const confirmationScreen = new ConfirmationScreen(passportConfig);
|
|
912
|
+
const confirmationResult = await confirmationScreen.startTransaction(user.accessToken, {
|
|
913
|
+
transactionType: TransactionTypes.CreateTransfer,
|
|
914
|
+
transactionData: getSignableTransferRequest,
|
|
915
|
+
});
|
|
916
|
+
if (!confirmationResult.confirmed) {
|
|
917
|
+
throw new Error('Transaction rejected by user');
|
|
918
|
+
}
|
|
919
|
+
const signableResultData = signableResult.data;
|
|
920
|
+
const { payload_hash: payloadHash } = signableResultData;
|
|
921
|
+
const starkSignature = await starkSigner.signMessage(payloadHash);
|
|
922
|
+
const senderStarkKey = await starkSigner.getAddress();
|
|
923
|
+
const transferSigningParams = {
|
|
924
|
+
sender_stark_key: signableResultData.sender_stark_key || senderStarkKey,
|
|
925
|
+
sender_vault_id: signableResultData.sender_vault_id,
|
|
926
|
+
receiver_stark_key: signableResultData.receiver_stark_key,
|
|
927
|
+
receiver_vault_id: signableResultData.receiver_vault_id,
|
|
928
|
+
asset_id: signableResultData.asset_id,
|
|
929
|
+
amount: signableResultData.amount,
|
|
930
|
+
nonce: signableResultData.nonce,
|
|
931
|
+
expiration_timestamp: signableResultData.expiration_timestamp,
|
|
932
|
+
stark_signature: starkSignature,
|
|
933
|
+
};
|
|
934
|
+
const createTransferRequest = {
|
|
935
|
+
createTransferRequest: transferSigningParams,
|
|
936
|
+
};
|
|
937
|
+
const headers = {
|
|
938
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
939
|
+
Authorization: `Bearer ${user.accessToken}`,
|
|
940
|
+
};
|
|
941
|
+
const { data: responseData } = await transfersApi.createTransferV1(createTransferRequest, { headers });
|
|
942
|
+
return {
|
|
943
|
+
sent_signature: responseData.sent_signature,
|
|
944
|
+
status: responseData.status?.toString(),
|
|
945
|
+
time: responseData.time,
|
|
946
|
+
transfer_id: responseData.transfer_id,
|
|
947
|
+
};
|
|
948
|
+
}, PassportErrorType.TRANSFER_ERROR);
|
|
928
949
|
async function batchNftTransfer({ user, starkSigner, request, transfersApi, passportConfig, }) {
|
|
929
950
|
return withPassportError(async () => {
|
|
930
951
|
const ethAddress = user.etherKey;
|
|
931
|
-
const signableRequests = request.map((nftTransfer) => {
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
};
|
|
941
|
-
});
|
|
952
|
+
const signableRequests = request.map((nftTransfer) => ({
|
|
953
|
+
amount: '1',
|
|
954
|
+
token: convertToSignableToken({
|
|
955
|
+
type: ERC721$1,
|
|
956
|
+
tokenId: nftTransfer.tokenId,
|
|
957
|
+
tokenAddress: nftTransfer.tokenAddress,
|
|
958
|
+
}),
|
|
959
|
+
receiver: nftTransfer.receiver,
|
|
960
|
+
}));
|
|
942
961
|
const getSignableTransferRequestV2 = {
|
|
943
962
|
sender_ether_key: ethAddress,
|
|
944
963
|
signable_requests: signableRequests,
|
|
@@ -973,7 +992,8 @@ async function batchNftTransfer({ user, starkSigner, request, transfersApi, pass
|
|
|
973
992
|
requests,
|
|
974
993
|
};
|
|
975
994
|
const headers = {
|
|
976
|
-
|
|
995
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
996
|
+
Authorization: `Bearer ${user.accessToken}`,
|
|
977
997
|
};
|
|
978
998
|
const response = await transfersApi.createTransfer({
|
|
979
999
|
createTransferRequestV2: transferSigningParams,
|
|
@@ -1030,7 +1050,8 @@ async function createOrder$1({ starkSigner, user, request, ordersApi, passportCo
|
|
|
1030
1050
|
},
|
|
1031
1051
|
};
|
|
1032
1052
|
const headers = {
|
|
1033
|
-
|
|
1053
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1054
|
+
Authorization: `Bearer ${user.accessToken}`,
|
|
1034
1055
|
};
|
|
1035
1056
|
const createOrderResponse = await ordersApi.createOrder(orderParams, {
|
|
1036
1057
|
headers,
|
|
@@ -1059,7 +1080,8 @@ async function cancelOrder$1({ user, starkSigner, request, ordersApi, passportCo
|
|
|
1059
1080
|
const { payload_hash: payloadHash } = getSignableCancelOrderResponse.data;
|
|
1060
1081
|
const starkSignature = await starkSigner.signMessage(payloadHash);
|
|
1061
1082
|
const headers = {
|
|
1062
|
-
|
|
1083
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1084
|
+
Authorization: `Bearer ${user.accessToken}`,
|
|
1063
1085
|
};
|
|
1064
1086
|
const cancelOrderResponse = await ordersApi.cancelOrder({
|
|
1065
1087
|
id: request.order_id.toString(),
|
|
@@ -1103,7 +1125,8 @@ async function exchangeTransfer$1({ user, starkSigner, request, exchangesApi, })
|
|
|
1103
1125
|
stark_signature: starkSignature,
|
|
1104
1126
|
};
|
|
1105
1127
|
const headers = {
|
|
1106
|
-
|
|
1128
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1129
|
+
Authorization: `Bearer ${user.accessToken}`,
|
|
1107
1130
|
};
|
|
1108
1131
|
const response = await exchangesApi.createExchangeTransfer({
|
|
1109
1132
|
id: request.transactionID,
|
|
@@ -1159,7 +1182,8 @@ async function createTrade$1({ request, tradesApi, user, starkSigner, passportCo
|
|
|
1159
1182
|
vault_id_sell: signableResultData.vault_id_sell,
|
|
1160
1183
|
},
|
|
1161
1184
|
};
|
|
1162
|
-
|
|
1185
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1186
|
+
const headers = { Authorization: `Bearer ${user.accessToken}` };
|
|
1163
1187
|
const { data: createTradeResponse } = await tradesApi.createTradeV3(tradeParams, {
|
|
1164
1188
|
headers,
|
|
1165
1189
|
});
|
|
@@ -1187,9 +1211,13 @@ class PassportImxProvider {
|
|
|
1187
1211
|
passportConfig: this.passportConfig,
|
|
1188
1212
|
});
|
|
1189
1213
|
}
|
|
1214
|
+
// TODO: Remove once implemented
|
|
1215
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1190
1216
|
registerOffchain() {
|
|
1191
1217
|
throw new PassportError('Operation not supported', PassportErrorType.OPERATION_NOT_SUPPORTED_ERROR);
|
|
1192
1218
|
}
|
|
1219
|
+
// TODO: Remove once implemented
|
|
1220
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1193
1221
|
isRegisteredOnchain() {
|
|
1194
1222
|
throw new PassportError('Operation not supported', PassportErrorType.OPERATION_NOT_SUPPORTED_ERROR);
|
|
1195
1223
|
}
|
|
@@ -1237,14 +1265,18 @@ class PassportImxProvider {
|
|
|
1237
1265
|
exchangesApi: this.immutableXClient.exchangeApi,
|
|
1238
1266
|
});
|
|
1239
1267
|
}
|
|
1240
|
-
//
|
|
1268
|
+
// TODO: Remove once implemented
|
|
1269
|
+
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
1241
1270
|
deposit(deposit) {
|
|
1242
1271
|
throw new PassportError('Operation not supported', PassportErrorType.OPERATION_NOT_SUPPORTED_ERROR);
|
|
1243
1272
|
}
|
|
1244
|
-
//
|
|
1273
|
+
// TODO: Remove once implemented
|
|
1274
|
+
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
1245
1275
|
prepareWithdrawal(request) {
|
|
1246
1276
|
throw new PassportError('Operation not supported', PassportErrorType.OPERATION_NOT_SUPPORTED_ERROR);
|
|
1247
1277
|
}
|
|
1278
|
+
// TODO: Remove once implemented
|
|
1279
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1248
1280
|
completeWithdrawal(
|
|
1249
1281
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1250
1282
|
starkPublicKey,
|
|
@@ -1307,20 +1339,21 @@ class PassportConfiguration {
|
|
|
1307
1339
|
}
|
|
1308
1340
|
else {
|
|
1309
1341
|
switch (baseConfig.environment) {
|
|
1310
|
-
case Environment.
|
|
1311
|
-
this.network = Networks.
|
|
1342
|
+
case Environment.PRODUCTION: {
|
|
1343
|
+
this.network = Networks.PRODUCTION;
|
|
1312
1344
|
this.authenticationDomain = 'https://auth.immutable.com';
|
|
1313
1345
|
this.magicPublishableApiKey = 'pk_live_10F423798A540ED7';
|
|
1314
1346
|
this.magicProviderId = 'fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=';
|
|
1315
|
-
this.passportDomain = 'https://passport.
|
|
1347
|
+
this.passportDomain = 'https://passport.immutable.com';
|
|
1316
1348
|
break;
|
|
1317
1349
|
}
|
|
1318
|
-
case Environment.
|
|
1319
|
-
|
|
1350
|
+
case Environment.SANDBOX:
|
|
1351
|
+
default: {
|
|
1352
|
+
this.network = Networks.SANDBOX;
|
|
1320
1353
|
this.authenticationDomain = 'https://auth.immutable.com';
|
|
1321
1354
|
this.magicPublishableApiKey = 'pk_live_10F423798A540ED7';
|
|
1322
1355
|
this.magicProviderId = 'fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=';
|
|
1323
|
-
this.passportDomain = 'https://passport.immutable.com';
|
|
1356
|
+
this.passportDomain = 'https://passport.sandbox.immutable.com';
|
|
1324
1357
|
break;
|
|
1325
1358
|
}
|
|
1326
1359
|
}
|
|
@@ -1328,12 +1361,12 @@ class PassportConfiguration {
|
|
|
1328
1361
|
}
|
|
1329
1362
|
}
|
|
1330
1363
|
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
};
|
|
1364
|
+
// TODO: remove this eslint disable once we have a better solution
|
|
1365
|
+
// eslint-disable-next-line max-len
|
|
1366
|
+
const getStarkSigner = async (signer) => withPassportError(async () => {
|
|
1367
|
+
const privateKey = await generateLegacyStarkPrivateKey(signer);
|
|
1368
|
+
return createStarkSigner(privateKey);
|
|
1369
|
+
}, PassportErrorType.WALLET_CONNECTION_ERROR);
|
|
1337
1370
|
|
|
1338
1371
|
async function registerPassport({ ethSigner, starkSigner, usersApi }, authorization) {
|
|
1339
1372
|
return withPassportError(async () => {
|
|
@@ -1349,7 +1382,7 @@ async function registerPassport({ ethSigner, starkSigner, usersApi }, authorizat
|
|
|
1349
1382
|
const ethSignature = await signRaw(signableMessage, ethSigner);
|
|
1350
1383
|
const starkSignature = await starkSigner.signMessage(payloadHash);
|
|
1351
1384
|
const response = await usersApi.registerPassportUser({
|
|
1352
|
-
authorization: `Bearer
|
|
1385
|
+
authorization: `Bearer ${authorization}`,
|
|
1353
1386
|
registerPassportUserRequest: {
|
|
1354
1387
|
eth_signature: ethSignature,
|
|
1355
1388
|
ether_key: userAddress,
|
|
@@ -1361,6 +1394,7 @@ async function registerPassport({ ethSigner, starkSigner, usersApi }, authorizat
|
|
|
1361
1394
|
}, PassportErrorType.USER_REGISTRATION_ERROR);
|
|
1362
1395
|
}
|
|
1363
1396
|
|
|
1397
|
+
// TODO: Remove this once the dependency has been added
|
|
1364
1398
|
class Passport {
|
|
1365
1399
|
authManager;
|
|
1366
1400
|
magicAdapter;
|
|
@@ -1370,11 +1404,10 @@ class Passport {
|
|
|
1370
1404
|
this.config = new PassportConfiguration(passportModuleConfiguration);
|
|
1371
1405
|
this.authManager = new AuthManager(this.config);
|
|
1372
1406
|
this.magicAdapter = new MagicAdapter(this.config);
|
|
1373
|
-
this.immutableXClient =
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
});
|
|
1407
|
+
this.immutableXClient = passportModuleConfiguration.overrides?.immutableXClient
|
|
1408
|
+
|| new ImmutableXClient({
|
|
1409
|
+
baseConfig: passportModuleConfiguration.baseConfig,
|
|
1410
|
+
});
|
|
1378
1411
|
}
|
|
1379
1412
|
async getImxProvider(user) {
|
|
1380
1413
|
if (!user || !user.idToken) {
|
|
@@ -2651,6 +2684,12 @@ let $4f91c5f280efe242$export$a75605c67ea83a5a;
|
|
|
2651
2684
|
})($4f91c5f280efe242$export$a75605c67ea83a5a || ($4f91c5f280efe242$export$a75605c67ea83a5a = {}));
|
|
2652
2685
|
|
|
2653
2686
|
|
|
2687
|
+
let $090d3502d165f17d$export$c5ab8fbcabac8c11;
|
|
2688
|
+
(function(SupportedFiatCurrencies) {
|
|
2689
|
+
SupportedFiatCurrencies["USD"] = "USD";
|
|
2690
|
+
})($090d3502d165f17d$export$c5ab8fbcabac8c11 || ($090d3502d165f17d$export$c5ab8fbcabac8c11 = {}));
|
|
2691
|
+
|
|
2692
|
+
|
|
2654
2693
|
|
|
2655
2694
|
|
|
2656
2695
|
/**
|
|
@@ -2668,6 +2707,9 @@ let $4f91c5f280efe242$export$a75605c67ea83a5a;
|
|
|
2668
2707
|
CheckoutErrorType["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
|
|
2669
2708
|
CheckoutErrorType["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
|
|
2670
2709
|
CheckoutErrorType["TRANSACTION_ERROR"] = "TRANSACTION_ERROR";
|
|
2710
|
+
CheckoutErrorType["FIAT_CONVERSION_ERROR"] = "FIAT_CONVERSION_ERROR";
|
|
2711
|
+
CheckoutErrorType["TOKEN_NOT_SUPPORTED_ERROR"] = "TOKEN_NOT_SUPPORTED_ERROR";
|
|
2712
|
+
CheckoutErrorType["FIAT_CURRENCY_NOT_SUPPORTED_ERROR"] = "FIAT_CURRENCY_NOT_SUPPORTED_ERROR";
|
|
2671
2713
|
})($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
|
|
2672
2714
|
class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
2673
2715
|
constructor(message, type, data){
|
|
@@ -2884,14 +2926,22 @@ var $cda6003506e4182e$exports = {};
|
|
|
2884
2926
|
$cda6003506e4182e$exports = JSON.parse("[{\"address\":\"0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0\",\"chainId\":137,\"name\":\"Matic\",\"symbol\":\"MATIC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 38.4 33.5' style='enable-background:new 0 0 38.4 33.5;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%238247E5;%7D%0A%3C/style%3E%3Cg%3E%3Cpath class='st0' d='M29,10.2c-0.7-0.4-1.6-0.4-2.4,0L21,13.5l-3.8,2.1l-5.5,3.3c-0.7,0.4-1.6,0.4-2.4,0L5,16.3 c-0.7-0.4-1.2-1.2-1.2-2.1v-5c0-0.8,0.4-1.6,1.2-2.1l4.3-2.5c0.7-0.4,1.6-0.4,2.4,0L16,7.2c0.7,0.4,1.2,1.2,1.2,2.1v3.3l3.8-2.2V7 c0-0.8-0.4-1.6-1.2-2.1l-8-4.7c-0.7-0.4-1.6-0.4-2.4,0L1.2,5C0.4,5.4,0,6.2,0,7v9.4c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l5.5-3.2l3.8-2.2l5.5-3.2c0.7-0.4,1.6-0.4,2.4,0l4.3,2.5c0.7,0.4,1.2,1.2,1.2,2.1v5c0,0.8-0.4,1.6-1.2,2.1 L29,28.8c-0.7,0.4-1.6,0.4-2.4,0l-4.3-2.5c-0.7-0.4-1.2-1.2-1.2-2.1V21l-3.8,2.2v3.3c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l8.1-4.7c0.7-0.4,1.2-1.2,1.2-2.1V17c0-0.8-0.4-1.6-1.2-2.1L29,10.2z'/%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"name\":\"Ethereum\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"chainId\":1,\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF\",\"chainId\":1,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0\",\"chainId\":1,\"name\":\"Matic\",\"symbol\":\"MATIC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 38.4 33.5' style='enable-background:new 0 0 38.4 33.5;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%238247E5;%7D%0A%3C/style%3E%3Cg%3E%3Cpath class='st0' d='M29,10.2c-0.7-0.4-1.6-0.4-2.4,0L21,13.5l-3.8,2.1l-5.5,3.3c-0.7,0.4-1.6,0.4-2.4,0L5,16.3 c-0.7-0.4-1.2-1.2-1.2-2.1v-5c0-0.8,0.4-1.6,1.2-2.1l4.3-2.5c0.7-0.4,1.6-0.4,2.4,0L16,7.2c0.7,0.4,1.2,1.2,1.2,2.1v3.3l3.8-2.2V7 c0-0.8-0.4-1.6-1.2-2.1l-8-4.7c-0.7-0.4-1.6-0.4-2.4,0L1.2,5C0.4,5.4,0,6.2,0,7v9.4c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l5.5-3.2l3.8-2.2l5.5-3.2c0.7-0.4,1.6-0.4,2.4,0l4.3,2.5c0.7,0.4,1.2,1.2,1.2,2.1v5c0,0.8-0.4,1.6-1.2,2.1 L29,28.8c-0.7,0.4-1.6,0.4-2.4,0l-4.3-2.5c-0.7-0.4-1.2-1.2-1.2-2.1V21l-3.8,2.2v3.3c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l8.1-4.7c0.7-0.4,1.2-1.2,1.2-2.1V17c0-0.8-0.4-1.6-1.2-2.1L29,10.2z'/%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"name\":\"Ethereum\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"chainId\":5,\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x1facdd0165489f373255a90304650e15481b2c85\",\"chainId\":5,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x123456789\",\"chainId\":5,\"name\":\"Swap Coin\",\"symbol\":\"SWC\",\"decimals\":18,\"tokenFeatures\":[\"swap\",\"fakeFeature\"]},{\"address\":\"0x123456789\",\"chainId\":5,\"name\":\"Bridge Coin\",\"symbol\":\"BDC\",\"decimals\":18,\"tokenFeatures\":[\"bridge\",\"fakeFeature\"]}]");
|
|
2885
2927
|
|
|
2886
2928
|
|
|
2887
|
-
const $efe60cea83bfc4e8$
|
|
2888
|
-
|
|
2889
|
-
|
|
2929
|
+
const $efe60cea83bfc4e8$var$filterTokenList = function({ type: type , chainId: chainId , exclude: exclude }) {
|
|
2930
|
+
return ((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
|
|
2931
|
+
const skipChainIdCheck = !chainId;
|
|
2890
2932
|
const chainIdMatches = token.chainId == chainId;
|
|
2891
2933
|
const tokenNotExcluded = !exclude?.map((excludeToken)=>excludeToken.address).includes(token.address || "");
|
|
2892
2934
|
const allowAllTokens = type === ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL;
|
|
2893
2935
|
const tokenAllowedForType = token.tokenFeatures.includes(type);
|
|
2894
|
-
return chainIdMatches && tokenNotExcluded && (allowAllTokens || tokenAllowedForType);
|
|
2936
|
+
return (skipChainIdCheck || chainIdMatches) && tokenNotExcluded && (allowAllTokens || tokenAllowedForType);
|
|
2937
|
+
});
|
|
2938
|
+
};
|
|
2939
|
+
const $efe60cea83bfc4e8$export$473cec51305fdae8 = async function({ type: type = ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL , chainId: chainId , exclude: exclude }) {
|
|
2940
|
+
// todo:For API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
|
|
2941
|
+
const filteredTokenList = $efe60cea83bfc4e8$var$filterTokenList({
|
|
2942
|
+
type: type,
|
|
2943
|
+
chainId: chainId,
|
|
2944
|
+
exclude: exclude
|
|
2895
2945
|
}).map((token)=>{
|
|
2896
2946
|
const { chainId: chainId , tokenFeatures: tokenFeatures , ...tokenInfo } = token;
|
|
2897
2947
|
return tokenInfo;
|
|
@@ -3104,91 +3154,248 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
3104
3154
|
function $parcel$export(e, n, v, s) {
|
|
3105
3155
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
3106
3156
|
}
|
|
3107
|
-
var $
|
|
3157
|
+
var $207ed853f11d19d5$exports = {};
|
|
3108
3158
|
|
|
3109
|
-
$parcel$export($
|
|
3110
|
-
let $
|
|
3159
|
+
$parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => $207ed853f11d19d5$export$5a0ace85cae72d45);
|
|
3160
|
+
let $207ed853f11d19d5$export$5a0ace85cae72d45;
|
|
3111
3161
|
(function(IMTBLWidgetEvents) {
|
|
3112
3162
|
IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
|
|
3113
3163
|
IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
|
|
3114
3164
|
IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
|
|
3115
3165
|
IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
|
|
3116
3166
|
IMTBLWidgetEvents["IMTBL_BUY_WIDGET_EVENT"] = "imtbl-buy-widget";
|
|
3117
|
-
})($
|
|
3167
|
+
})($207ed853f11d19d5$export$5a0ace85cae72d45 || ($207ed853f11d19d5$export$5a0ace85cae72d45 = {}));
|
|
3118
3168
|
|
|
3119
3169
|
|
|
3120
|
-
var $
|
|
3170
|
+
var $a85ecdbd885c58ad$exports = {};
|
|
3121
3171
|
|
|
3122
|
-
$parcel$export($
|
|
3123
|
-
let $
|
|
3172
|
+
$parcel$export($a85ecdbd885c58ad$exports, "ConnectEventType", () => $a85ecdbd885c58ad$export$e72e7f9969a47dd3);
|
|
3173
|
+
let $a85ecdbd885c58ad$export$e72e7f9969a47dd3;
|
|
3124
3174
|
(function(ConnectEventType) {
|
|
3125
3175
|
ConnectEventType["SUCCESS"] = "success";
|
|
3126
3176
|
ConnectEventType["FAILURE"] = "failure";
|
|
3127
3177
|
ConnectEventType["CLOSE_WIDGET"] = "close-widget";
|
|
3128
|
-
})($
|
|
3178
|
+
})($a85ecdbd885c58ad$export$e72e7f9969a47dd3 || ($a85ecdbd885c58ad$export$e72e7f9969a47dd3 = {}));
|
|
3129
3179
|
|
|
3130
3180
|
|
|
3131
|
-
var $
|
|
3181
|
+
var $77b6aac5c353d4a9$exports = {};
|
|
3132
3182
|
|
|
3133
|
-
$parcel$export($
|
|
3183
|
+
$parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => $77b6aac5c353d4a9$export$d9be06b70b28c742);
|
|
3134
3184
|
//wallet widget events
|
|
3135
|
-
let $
|
|
3185
|
+
let $77b6aac5c353d4a9$export$d9be06b70b28c742;
|
|
3136
3186
|
(function(WalletEventType) {
|
|
3137
3187
|
WalletEventType["CLOSE_WIDGET"] = "close-widget";
|
|
3138
3188
|
WalletEventType["NETWORK_SWITCH"] = "network-switch";
|
|
3139
|
-
})($
|
|
3189
|
+
})($77b6aac5c353d4a9$export$d9be06b70b28c742 || ($77b6aac5c353d4a9$export$d9be06b70b28c742 = {}));
|
|
3140
3190
|
|
|
3141
3191
|
|
|
3142
|
-
var $
|
|
3192
|
+
var $53d219e7f6bf0cd6$exports = {};
|
|
3143
3193
|
|
|
3144
|
-
$parcel$export($
|
|
3145
|
-
let $
|
|
3194
|
+
$parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => $53d219e7f6bf0cd6$export$140a49745ab55563);
|
|
3195
|
+
let $53d219e7f6bf0cd6$export$140a49745ab55563;
|
|
3146
3196
|
(function(SwapEventType) {
|
|
3147
3197
|
SwapEventType["SUCCESS"] = "success";
|
|
3148
3198
|
SwapEventType["FAILURE"] = "failure";
|
|
3149
|
-
})($
|
|
3199
|
+
})($53d219e7f6bf0cd6$export$140a49745ab55563 || ($53d219e7f6bf0cd6$export$140a49745ab55563 = {}));
|
|
3150
3200
|
|
|
3151
3201
|
|
|
3152
|
-
var $
|
|
3202
|
+
var $15cc9e120aa6f3bf$exports = {};
|
|
3153
3203
|
|
|
3154
|
-
$parcel$export($
|
|
3155
|
-
let $
|
|
3204
|
+
$parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => $15cc9e120aa6f3bf$export$d1bfa21f7c76447a);
|
|
3205
|
+
let $15cc9e120aa6f3bf$export$d1bfa21f7c76447a;
|
|
3156
3206
|
(function(BridgeEventType) {
|
|
3157
3207
|
BridgeEventType["CLOSE_WIDGET"] = "close-widget";
|
|
3158
3208
|
BridgeEventType["SUCCESS"] = "success";
|
|
3159
3209
|
BridgeEventType["FAILURE"] = "failure";
|
|
3160
|
-
})($
|
|
3210
|
+
})($15cc9e120aa6f3bf$export$d1bfa21f7c76447a || ($15cc9e120aa6f3bf$export$d1bfa21f7c76447a = {}));
|
|
3161
3211
|
|
|
3162
3212
|
|
|
3163
|
-
var $
|
|
3213
|
+
var $98cbcca465beec95$exports = {};
|
|
3164
3214
|
|
|
3165
|
-
$parcel$export($
|
|
3166
|
-
let $
|
|
3215
|
+
$parcel$export($98cbcca465beec95$exports, "BuyEventType", () => $98cbcca465beec95$export$90db5fe1be5993c1);
|
|
3216
|
+
let $98cbcca465beec95$export$90db5fe1be5993c1;
|
|
3167
3217
|
(function(BuyEventType) {
|
|
3168
3218
|
BuyEventType["SUCCESS"] = "success";
|
|
3169
3219
|
BuyEventType["FAILURE"] = "failure";
|
|
3170
3220
|
BuyEventType["NOT_CONNECTED"] = "not_connected";
|
|
3171
3221
|
BuyEventType["CLOSE"] = "close";
|
|
3172
|
-
})($
|
|
3222
|
+
})($98cbcca465beec95$export$90db5fe1be5993c1 || ($98cbcca465beec95$export$90db5fe1be5993c1 = {}));
|
|
3173
3223
|
|
|
3174
3224
|
|
|
3175
|
-
var $
|
|
3225
|
+
var $14d7a2bbb79e0dae$exports = {};
|
|
3176
3226
|
|
|
3177
|
-
$parcel$export($
|
|
3178
|
-
$parcel$export($
|
|
3179
|
-
$parcel$export($
|
|
3180
|
-
|
|
3181
|
-
let $
|
|
3227
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "Network", () => $14d7a2bbb79e0dae$export$95be4ae94445245a);
|
|
3228
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetTheme", () => $14d7a2bbb79e0dae$export$c88931fdc51854eb);
|
|
3229
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetConnectionProviders", () => $14d7a2bbb79e0dae$export$2f61dde3bdc320cb);
|
|
3230
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "CheckoutWidgetTagNames", () => $14d7a2bbb79e0dae$export$75be0f6af9650f2c);
|
|
3231
|
+
let $14d7a2bbb79e0dae$export$95be4ae94445245a;
|
|
3182
3232
|
(function(Network) {
|
|
3183
3233
|
Network["ETHEREUM"] = "Ethereum";
|
|
3184
3234
|
Network["GOERLI"] = "Goerli";
|
|
3185
3235
|
Network["POLYGON"] = "Polygon";
|
|
3186
|
-
})($
|
|
3187
|
-
let $
|
|
3236
|
+
})($14d7a2bbb79e0dae$export$95be4ae94445245a || ($14d7a2bbb79e0dae$export$95be4ae94445245a = {}));
|
|
3237
|
+
let $14d7a2bbb79e0dae$export$c88931fdc51854eb;
|
|
3188
3238
|
(function(WidgetTheme) {
|
|
3189
3239
|
WidgetTheme["LIGHT"] = "light";
|
|
3190
3240
|
WidgetTheme["DARK"] = "dark";
|
|
3191
3241
|
WidgetTheme["CUSTOM"] = "custom";
|
|
3192
|
-
})($
|
|
3242
|
+
})($14d7a2bbb79e0dae$export$c88931fdc51854eb || ($14d7a2bbb79e0dae$export$c88931fdc51854eb = {}));
|
|
3243
|
+
let $14d7a2bbb79e0dae$export$2f61dde3bdc320cb;
|
|
3244
|
+
(function(WidgetConnectionProviders) {
|
|
3245
|
+
WidgetConnectionProviders["METAMASK"] = "metamask";
|
|
3246
|
+
})($14d7a2bbb79e0dae$export$2f61dde3bdc320cb || ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb = {}));
|
|
3247
|
+
let $14d7a2bbb79e0dae$export$75be0f6af9650f2c;
|
|
3248
|
+
(function(CheckoutWidgetTagNames) {
|
|
3249
|
+
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
3250
|
+
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
3251
|
+
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
3252
|
+
CheckoutWidgetTagNames["BUY"] = "imtbl-buy";
|
|
3253
|
+
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
3254
|
+
CheckoutWidgetTagNames["EXAMPLe"] = "imtbl-example";
|
|
3255
|
+
})($14d7a2bbb79e0dae$export$75be0f6af9650f2c || ($14d7a2bbb79e0dae$export$75be0f6af9650f2c = {}));
|
|
3256
|
+
|
|
3257
|
+
|
|
3258
|
+
var $1f969328e5988c99$exports = {};
|
|
3259
|
+
|
|
3260
|
+
$parcel$export($1f969328e5988c99$exports, "BridgeReact", () => $1f969328e5988c99$export$30f61ebf204c69f6);
|
|
3261
|
+
|
|
3262
|
+
|
|
3263
|
+
|
|
3264
|
+
function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
|
|
3265
|
+
const { providerPreference: providerPreference , fromContractAddress: fromContractAddress , amount: amount , fromNetwork: fromNetwork } = props;
|
|
3266
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
3267
|
+
return /*#__PURE__*/ (jsx)("imtbl-bridge", {
|
|
3268
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
3269
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
3270
|
+
fromContractAddress: fromContractAddress ?? "",
|
|
3271
|
+
fromNetwork: fromNetwork ?? "",
|
|
3272
|
+
amount: amount ?? ""
|
|
3273
|
+
});
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3276
|
+
|
|
3277
|
+
var $f22931ca9e2f35b6$exports = {};
|
|
3278
|
+
|
|
3279
|
+
$parcel$export($f22931ca9e2f35b6$exports, "BuyReact", () => $f22931ca9e2f35b6$export$d13582032b79b401);
|
|
3280
|
+
|
|
3281
|
+
|
|
3282
|
+
|
|
3283
|
+
function $f22931ca9e2f35b6$export$d13582032b79b401(props) {
|
|
3284
|
+
const { providerPreference: providerPreference , orderId: orderId } = props;
|
|
3285
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
3286
|
+
return /*#__PURE__*/ (jsx)("imtbl-buy", {
|
|
3287
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
3288
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
3289
|
+
orderId: orderId
|
|
3290
|
+
});
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
|
|
3294
|
+
var $fa90757d8d7a0962$exports = {};
|
|
3295
|
+
|
|
3296
|
+
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
3297
|
+
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
3298
|
+
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
3299
|
+
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
3300
|
+
var checkoutWidgetJS = document.createElement("script");
|
|
3301
|
+
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
3302
|
+
document.head.appendChild(checkoutWidgetJS);
|
|
3303
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
3304
|
+
}
|
|
3305
|
+
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
3306
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
3307
|
+
}
|
|
3308
|
+
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
3309
|
+
if (!provider) {
|
|
3310
|
+
console.error("no provider parsed");
|
|
3311
|
+
return;
|
|
3312
|
+
}
|
|
3313
|
+
const elements = document.getElementsByTagName(tagName);
|
|
3314
|
+
const widget = elements[0];
|
|
3315
|
+
let attempts = 0;
|
|
3316
|
+
const maxAttempts = 10;
|
|
3317
|
+
let timer;
|
|
3318
|
+
const attemptToSetProvider = ()=>{
|
|
3319
|
+
try {
|
|
3320
|
+
widget.setProvider(provider);
|
|
3321
|
+
window.clearInterval(timer);
|
|
3322
|
+
} catch (err) {
|
|
3323
|
+
attempts++;
|
|
3324
|
+
if (attempts >= maxAttempts) {
|
|
3325
|
+
window.clearInterval(timer);
|
|
3326
|
+
console.error("failed to set the provider");
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
};
|
|
3330
|
+
timer = window.setInterval(attemptToSetProvider, 10);
|
|
3331
|
+
attemptToSetProvider();
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3334
|
+
|
|
3335
|
+
var $f2083cd30e2f5c56$exports = {};
|
|
3336
|
+
|
|
3337
|
+
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
3338
|
+
|
|
3339
|
+
|
|
3340
|
+
|
|
3341
|
+
function $f2083cd30e2f5c56$export$49d62957f420a1e2(props) {
|
|
3342
|
+
const { providerPreference: providerPreference } = props;
|
|
3343
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
3344
|
+
return /*#__PURE__*/ (jsx)("imtbl-connect", {
|
|
3345
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
3346
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
3347
|
+
});
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
|
|
3351
|
+
var $a4fbb8e3a6aeff58$exports = {};
|
|
3352
|
+
|
|
3353
|
+
$parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$export$971e031379577f4);
|
|
3354
|
+
|
|
3355
|
+
|
|
3356
|
+
|
|
3357
|
+
function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
|
|
3358
|
+
const { providerPreference: providerPreference , fromContractAddress: fromContractAddress , amount: amount , toContractAddress: toContractAddress } = props;
|
|
3359
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
3360
|
+
return /*#__PURE__*/ (jsx)("imtbl-swap", {
|
|
3361
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
3362
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
3363
|
+
fromContractAddress: fromContractAddress ?? "",
|
|
3364
|
+
toContractAddress: toContractAddress ?? "",
|
|
3365
|
+
amount: amount ?? ""
|
|
3366
|
+
});
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
|
|
3370
|
+
var $89d55ace0f8f1c07$exports = {};
|
|
3371
|
+
|
|
3372
|
+
$parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07$export$ceaac94f34dba154);
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
|
|
3376
|
+
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
3377
|
+
const { providerPreference: providerPreference } = props;
|
|
3378
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
3379
|
+
return /*#__PURE__*/ (jsx)("imtbl-wallet", {
|
|
3380
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
3381
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
3382
|
+
});
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
|
|
3386
|
+
var $d087956fd1002f80$exports = {};
|
|
3387
|
+
|
|
3388
|
+
$parcel$export($d087956fd1002f80$exports, "ExampleReact", () => $d087956fd1002f80$export$fa517eee6594d26c);
|
|
3389
|
+
|
|
3390
|
+
|
|
3391
|
+
|
|
3392
|
+
function $d087956fd1002f80$export$fa517eee6594d26c(props) {
|
|
3393
|
+
const { providerPreference: providerPreference , fromContractAddress: fromContractAddress , amount: amount , fromNetwork: fromNetwork } = props;
|
|
3394
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
3395
|
+
return /*#__PURE__*/ (jsx)("imtbl-example", {
|
|
3396
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
3397
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
3398
|
+
});
|
|
3399
|
+
}
|
|
3193
3400
|
|
|
3194
|
-
export { $
|
|
3401
|
+
export { $15cc9e120aa6f3bf$export$d1bfa21f7c76447a as BridgeEventType, $1f969328e5988c99$export$30f61ebf204c69f6 as BridgeReact, $98cbcca465beec95$export$90db5fe1be5993c1 as BuyEventType, $f22931ca9e2f35b6$export$d13582032b79b401 as BuyReact, $a47e48dd2c04791b$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $a8bc256d81a5e2c1$export$e3dc0620abde7f5a as CheckoutErrorType, $14d7a2bbb79e0dae$export$75be0f6af9650f2c as CheckoutWidgetTagNames, $fa90757d8d7a0962$export$af210a0808087845 as CheckoutWidgets, $a85ecdbd885c58ad$export$e72e7f9969a47dd3 as ConnectEventType, $f2083cd30e2f5c56$export$49d62957f420a1e2 as ConnectReact, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders, Environment, $d087956fd1002f80$export$fa517eee6594d26c as ExampleReact, GenericIMXProvider, $207ed853f11d19d5$export$5a0ace85cae72d45 as IMTBLWidgetEvents, ImmutableConfiguration, ImmutableXClient, MetaMaskIMXProvider, $14d7a2bbb79e0dae$export$95be4ae94445245a as Network, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, Passport, PassportError, ProviderConfiguration, $fa90757d8d7a0962$export$931068bc678f0d73 as SetProvider, $090d3502d165f17d$export$c5ab8fbcabac8c11 as SupportedFiatCurrencies, $53d219e7f6bf0cd6$export$140a49745ab55563 as SwapEventType, $a4fbb8e3a6aeff58$export$971e031379577f4 as SwapReact, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $fa90757d8d7a0962$export$bf1548ba7e61c17f as UpdateConfig, $77b6aac5c353d4a9$export$d9be06b70b28c742 as WalletEventType, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes, $89d55ace0f8f1c07$export$ceaac94f34dba154 as WalletReact, $14d7a2bbb79e0dae$export$2f61dde3bdc320cb as WidgetConnectionProviders, $14d7a2bbb79e0dae$export$c88931fdc51854eb as WidgetTheme };
|