@imtbl/sdk 0.0.1-alpha.1 → 0.0.1-alpha.2
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/browser/checkout.js +2 -0
- package/dist/checkout_sdk.d.ts +641 -0
- package/dist/checkout_sdk.js +468 -0
- package/dist/checkout_widgets.d.ts +14442 -0
- package/dist/checkout_widgets.js +180 -0
- package/dist/index.cjs +554 -0
- package/dist/index.d.ts +14841 -5
- package/dist/index.js +555 -2
- package/package.json +15 -5
package/dist/index.cjs
CHANGED
|
@@ -10,6 +10,7 @@ var detectEthereumProvider = require('@metamask/detect-provider');
|
|
|
10
10
|
var oidcClientTs = require('oidc-client-ts');
|
|
11
11
|
var magicSdk = require('magic-sdk');
|
|
12
12
|
var oidc = require('@magic-ext/oidc');
|
|
13
|
+
var providers = require('@ethersproject/providers');
|
|
13
14
|
|
|
14
15
|
function _interopNamespaceDefault(e) {
|
|
15
16
|
var n = Object.create(null);
|
|
@@ -2001,6 +2002,559 @@ class Passport {
|
|
|
2001
2002
|
}
|
|
2002
2003
|
}
|
|
2003
2004
|
|
|
2005
|
+
const $762782b6c862d954$export$db5daa1b5156ccfe = [
|
|
2006
|
+
{
|
|
2007
|
+
constant: true,
|
|
2008
|
+
inputs: [],
|
|
2009
|
+
name: "name",
|
|
2010
|
+
outputs: [
|
|
2011
|
+
{
|
|
2012
|
+
name: "",
|
|
2013
|
+
type: "string"
|
|
2014
|
+
}
|
|
2015
|
+
],
|
|
2016
|
+
payable: false,
|
|
2017
|
+
type: "function"
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
constant: true,
|
|
2021
|
+
inputs: [],
|
|
2022
|
+
name: "decimals",
|
|
2023
|
+
outputs: [
|
|
2024
|
+
{
|
|
2025
|
+
name: "",
|
|
2026
|
+
type: "uint8"
|
|
2027
|
+
}
|
|
2028
|
+
],
|
|
2029
|
+
payable: false,
|
|
2030
|
+
type: "function"
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
constant: true,
|
|
2034
|
+
inputs: [
|
|
2035
|
+
{
|
|
2036
|
+
name: "_owner",
|
|
2037
|
+
type: "address"
|
|
2038
|
+
}
|
|
2039
|
+
],
|
|
2040
|
+
name: "balanceOf",
|
|
2041
|
+
outputs: [
|
|
2042
|
+
{
|
|
2043
|
+
name: "balance",
|
|
2044
|
+
type: "uint256"
|
|
2045
|
+
}
|
|
2046
|
+
],
|
|
2047
|
+
payable: false,
|
|
2048
|
+
type: "function"
|
|
2049
|
+
},
|
|
2050
|
+
{
|
|
2051
|
+
constant: true,
|
|
2052
|
+
inputs: [],
|
|
2053
|
+
name: "symbol",
|
|
2054
|
+
outputs: [
|
|
2055
|
+
{
|
|
2056
|
+
name: "",
|
|
2057
|
+
type: "string"
|
|
2058
|
+
}
|
|
2059
|
+
],
|
|
2060
|
+
payable: false,
|
|
2061
|
+
type: "function"
|
|
2062
|
+
}
|
|
2063
|
+
];
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
exports.ConnectionProviders = void 0;
|
|
2067
|
+
(function(ConnectionProviders) {
|
|
2068
|
+
ConnectionProviders["METAMASK"] = "metamask";
|
|
2069
|
+
})(exports.ConnectionProviders || (exports.ConnectionProviders = {}));
|
|
2070
|
+
|
|
2071
|
+
|
|
2072
|
+
exports.ChainId = void 0;
|
|
2073
|
+
(function(ChainId) {
|
|
2074
|
+
ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
|
|
2075
|
+
ChainId[ChainId["GOERLI"] = 5] = "GOERLI";
|
|
2076
|
+
ChainId[ChainId["POLYGON"] = 137] = "POLYGON";
|
|
2077
|
+
})(exports.ChainId || (exports.ChainId = {}));
|
|
2078
|
+
const $a47e48dd2c04791b$export$f61f4aaec62f6be9 = {
|
|
2079
|
+
[exports.ChainId.ETHEREUM]: {
|
|
2080
|
+
chainIdHex: "0x1",
|
|
2081
|
+
chainName: "Ethereum",
|
|
2082
|
+
rpcUrls: [
|
|
2083
|
+
"https://mainnet.infura.io/v3/"
|
|
2084
|
+
],
|
|
2085
|
+
nativeCurrency: {
|
|
2086
|
+
name: "Ethereum",
|
|
2087
|
+
symbol: "ETH",
|
|
2088
|
+
decimals: 18
|
|
2089
|
+
},
|
|
2090
|
+
blockExplorerUrls: [
|
|
2091
|
+
"https://etherscan.io/"
|
|
2092
|
+
]
|
|
2093
|
+
},
|
|
2094
|
+
[exports.ChainId.GOERLI]: {
|
|
2095
|
+
chainIdHex: "0x5",
|
|
2096
|
+
chainName: "Goerli",
|
|
2097
|
+
rpcUrls: [
|
|
2098
|
+
"https://goerli.infura.io/v3/"
|
|
2099
|
+
],
|
|
2100
|
+
nativeCurrency: {
|
|
2101
|
+
name: "Goerli Eth",
|
|
2102
|
+
symbol: "ETH",
|
|
2103
|
+
decimals: 18
|
|
2104
|
+
},
|
|
2105
|
+
blockExplorerUrls: [
|
|
2106
|
+
"https://goerli.etherscan.io/"
|
|
2107
|
+
]
|
|
2108
|
+
},
|
|
2109
|
+
[exports.ChainId.POLYGON]: {
|
|
2110
|
+
chainIdHex: "0x89",
|
|
2111
|
+
chainName: "Polygon",
|
|
2112
|
+
rpcUrls: [
|
|
2113
|
+
"https://polygon-rpc.com"
|
|
2114
|
+
],
|
|
2115
|
+
nativeCurrency: {
|
|
2116
|
+
name: "MATIC",
|
|
2117
|
+
symbol: "MATIC",
|
|
2118
|
+
decimals: 18
|
|
2119
|
+
},
|
|
2120
|
+
blockExplorerUrls: [
|
|
2121
|
+
"https://polygonscan.com/"
|
|
2122
|
+
]
|
|
2123
|
+
}
|
|
2124
|
+
};
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
|
|
2130
|
+
|
|
2131
|
+
const $4f91c5f280efe242$export$a130407f3423b97d = {
|
|
2132
|
+
CHECK_CONNECTION: "eth_accounts",
|
|
2133
|
+
CONNECT: "eth_requestAccounts",
|
|
2134
|
+
ADD_NETWORK: "wallet_addEthereumChain",
|
|
2135
|
+
SWITCH_NETWORK: "wallet_switchEthereumChain"
|
|
2136
|
+
};
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
|
|
2140
|
+
|
|
2141
|
+
let $a8bc256d81a5e2c1$export$e3dc0620abde7f5a;
|
|
2142
|
+
(function(CheckoutErrorType) {
|
|
2143
|
+
CheckoutErrorType["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
|
|
2144
|
+
CheckoutErrorType["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
|
|
2145
|
+
CheckoutErrorType["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
|
|
2146
|
+
CheckoutErrorType["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
|
|
2147
|
+
CheckoutErrorType["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
|
|
2148
|
+
CheckoutErrorType["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
|
|
2149
|
+
CheckoutErrorType["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
|
|
2150
|
+
CheckoutErrorType["TRANSACTION_ERROR"] = "TRANSACTION_ERROR";
|
|
2151
|
+
})($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
|
|
2152
|
+
class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
2153
|
+
constructor(message, type){
|
|
2154
|
+
super(message);
|
|
2155
|
+
this.type = type;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
const $a8bc256d81a5e2c1$export$bacc563de539c6c3 = async (fn, customError)=>{
|
|
2159
|
+
try {
|
|
2160
|
+
return await fn();
|
|
2161
|
+
} catch (error) {
|
|
2162
|
+
const errorMessage = customError.message || `${error.message}` || "UnknownError";
|
|
2163
|
+
throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type);
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
|
|
2167
|
+
|
|
2168
|
+
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
|
|
2172
|
+
|
|
2173
|
+
async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(provider) {
|
|
2174
|
+
const network = await provider.getNetwork();
|
|
2175
|
+
if (!Object.values((exports.ChainId)).includes(network.chainId)) // return empty details
|
|
2176
|
+
return {};
|
|
2177
|
+
const chainIdNetworkInfo = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[network.chainId];
|
|
2178
|
+
const networkInfo = {
|
|
2179
|
+
name: chainIdNetworkInfo.chainName,
|
|
2180
|
+
chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
|
|
2181
|
+
nativeCurrency: chainIdNetworkInfo.nativeCurrency
|
|
2182
|
+
};
|
|
2183
|
+
return networkInfo;
|
|
2184
|
+
}
|
|
2185
|
+
async function $de192de6ef100f9f$export$b827d9418aeb5dbd(provider, chainId) {
|
|
2186
|
+
if (!Object.values((exports.ChainId)).includes(chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`${chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
|
|
2187
|
+
if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("provider object is missing request function", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
|
|
2188
|
+
// WT-1146 - Refer to the README in this folder for explantion on the switch network flow
|
|
2189
|
+
try {
|
|
2190
|
+
await $de192de6ef100f9f$var$switchNetworkInWallet(provider, chainId);
|
|
2191
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2192
|
+
} catch (err) {
|
|
2193
|
+
if (err.message.includes("Unrecognized chain ID")) try {
|
|
2194
|
+
await $de192de6ef100f9f$var$addNetworkToWallet(provider, chainId);
|
|
2195
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2196
|
+
} catch (err) {
|
|
2197
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("user cancelled the add network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
2198
|
+
}
|
|
2199
|
+
else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("user cancelled the switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
2200
|
+
}
|
|
2201
|
+
// we can assume that if the above succeeds then user has successfully
|
|
2202
|
+
// switched to the network specified
|
|
2203
|
+
const newNetwork = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId];
|
|
2204
|
+
return {
|
|
2205
|
+
network: {
|
|
2206
|
+
name: newNetwork.chainName,
|
|
2207
|
+
chainId: parseInt(newNetwork.chainIdHex, 16),
|
|
2208
|
+
nativeCurrency: newNetwork.nativeCurrency
|
|
2209
|
+
}
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
// these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
|
|
2213
|
+
// make sure to check if(provider.provider?.request) in the exported function and throw an error
|
|
2214
|
+
async function $de192de6ef100f9f$var$switchNetworkInWallet(provider, chainId) {
|
|
2215
|
+
if (provider.provider?.request) return await provider.provider.request({
|
|
2216
|
+
method: ($4f91c5f280efe242$export$a130407f3423b97d).SWITCH_NETWORK,
|
|
2217
|
+
params: [
|
|
2218
|
+
{
|
|
2219
|
+
chainId: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].chainIdHex
|
|
2220
|
+
}
|
|
2221
|
+
]
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
async function $de192de6ef100f9f$var$addNetworkToWallet(provider, chainId) {
|
|
2225
|
+
if (provider.provider?.request) {
|
|
2226
|
+
const addNetwork = {
|
|
2227
|
+
chainId: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].chainIdHex,
|
|
2228
|
+
chainName: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].chainName,
|
|
2229
|
+
rpcUrls: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].rpcUrls,
|
|
2230
|
+
nativeCurrency: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].nativeCurrency,
|
|
2231
|
+
blockExplorerUrls: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].blockExplorerUrls
|
|
2232
|
+
};
|
|
2233
|
+
return await provider.provider.request({
|
|
2234
|
+
method: ($4f91c5f280efe242$export$a130407f3423b97d).ADD_NETWORK,
|
|
2235
|
+
params: [
|
|
2236
|
+
addNetwork
|
|
2237
|
+
]
|
|
2238
|
+
});
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
let $efe60cea83bfc4e8$export$f04a61298a47a40f;
|
|
2247
|
+
(function(Icon) {
|
|
2248
|
+
Icon["ETH"] = "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";
|
|
2249
|
+
Icon["MATIC"] = "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";
|
|
2250
|
+
Icon["IMX"] = "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";
|
|
2251
|
+
})($efe60cea83bfc4e8$export$f04a61298a47a40f || ($efe60cea83bfc4e8$export$f04a61298a47a40f = {}));
|
|
2252
|
+
const $efe60cea83bfc4e8$export$3dbcce43073f40c7 = [
|
|
2253
|
+
{
|
|
2254
|
+
name: "Ethereum",
|
|
2255
|
+
symbol: "ETH",
|
|
2256
|
+
decimals: 18,
|
|
2257
|
+
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"
|
|
2258
|
+
},
|
|
2259
|
+
{
|
|
2260
|
+
name: "Matic",
|
|
2261
|
+
symbol: "MATIC",
|
|
2262
|
+
address: "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",
|
|
2263
|
+
decimals: 18,
|
|
2264
|
+
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"
|
|
2265
|
+
},
|
|
2266
|
+
{
|
|
2267
|
+
name: "Immutable X",
|
|
2268
|
+
symbol: "IMX",
|
|
2269
|
+
address: "0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",
|
|
2270
|
+
decimals: 18,
|
|
2271
|
+
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"
|
|
2272
|
+
}
|
|
2273
|
+
];
|
|
2274
|
+
const $efe60cea83bfc4e8$var$goerliTokensList = [
|
|
2275
|
+
{
|
|
2276
|
+
name: "Ethereum",
|
|
2277
|
+
symbol: "ETH",
|
|
2278
|
+
decimals: 18,
|
|
2279
|
+
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"
|
|
2280
|
+
},
|
|
2281
|
+
{
|
|
2282
|
+
name: "Immutable X",
|
|
2283
|
+
symbol: "IMX",
|
|
2284
|
+
address: "0x1facdd0165489f373255a90304650e15481b2c85",
|
|
2285
|
+
decimals: 18,
|
|
2286
|
+
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"
|
|
2287
|
+
}
|
|
2288
|
+
];
|
|
2289
|
+
const $efe60cea83bfc4e8$var$polygonTokensList = [];
|
|
2290
|
+
const $efe60cea83bfc4e8$export$473cec51305fdae8 = (chainId)=>{
|
|
2291
|
+
let tokenList = [];
|
|
2292
|
+
switch(chainId){
|
|
2293
|
+
case (exports.ChainId).ETHEREUM:
|
|
2294
|
+
tokenList = $efe60cea83bfc4e8$export$3dbcce43073f40c7;
|
|
2295
|
+
break;
|
|
2296
|
+
case (exports.ChainId).GOERLI:
|
|
2297
|
+
tokenList = $efe60cea83bfc4e8$var$goerliTokensList;
|
|
2298
|
+
break;
|
|
2299
|
+
case (exports.ChainId).POLYGON:
|
|
2300
|
+
tokenList = $efe60cea83bfc4e8$var$polygonTokensList;
|
|
2301
|
+
break;
|
|
2302
|
+
default:
|
|
2303
|
+
tokenList = $efe60cea83bfc4e8$export$3dbcce43073f40c7;
|
|
2304
|
+
}
|
|
2305
|
+
return {
|
|
2306
|
+
tokens: tokenList
|
|
2307
|
+
};
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
|
|
2311
|
+
|
|
2312
|
+
|
|
2313
|
+
const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (provider, walletAddress)=>{
|
|
2314
|
+
return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
2315
|
+
const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(provider);
|
|
2316
|
+
const balance = await provider.getBalance(walletAddress);
|
|
2317
|
+
return {
|
|
2318
|
+
balance: balance,
|
|
2319
|
+
formattedBalance: (ethers.utils).formatUnits(balance, networkInfo.nativeCurrency.decimals),
|
|
2320
|
+
token: networkInfo.nativeCurrency
|
|
2321
|
+
};
|
|
2322
|
+
}, {
|
|
2323
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR
|
|
2324
|
+
});
|
|
2325
|
+
};
|
|
2326
|
+
async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress, contractAddress) {
|
|
2327
|
+
return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
2328
|
+
const contract = new (ethers.Contract)(contractAddress, JSON.stringify(($762782b6c862d954$export$db5daa1b5156ccfe)), provider);
|
|
2329
|
+
const name = await contract.name();
|
|
2330
|
+
const symbol = await contract.symbol();
|
|
2331
|
+
const balance = await contract.balanceOf(walletAddress);
|
|
2332
|
+
const decimals = await contract.decimals();
|
|
2333
|
+
const formattedBalance = (ethers.utils).formatUnits(balance, decimals);
|
|
2334
|
+
return {
|
|
2335
|
+
balance: balance,
|
|
2336
|
+
formattedBalance: formattedBalance,
|
|
2337
|
+
token: {
|
|
2338
|
+
name: name,
|
|
2339
|
+
symbol: symbol,
|
|
2340
|
+
decimals: decimals,
|
|
2341
|
+
address: contractAddress
|
|
2342
|
+
}
|
|
2343
|
+
};
|
|
2344
|
+
}, {
|
|
2345
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ERC20_BALANCE_ERROR
|
|
2346
|
+
});
|
|
2347
|
+
}
|
|
2348
|
+
const $1564e43dde50bb61$export$fee49741664a4d7e = async (provider, walletAddress, chainId)=>{
|
|
2349
|
+
if (!Object.values((exports.ChainId)).includes(chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`ChainId ${chainId} is not supported`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
|
|
2350
|
+
if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("provider object is missing request function", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
|
|
2351
|
+
const tokenList = ($efe60cea83bfc4e8$export$473cec51305fdae8)(chainId);
|
|
2352
|
+
const allBalancePromises = [];
|
|
2353
|
+
allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(provider, walletAddress));
|
|
2354
|
+
tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress, token.address ?? "")));
|
|
2355
|
+
const balanceResults = await Promise.allSettled(allBalancePromises);
|
|
2356
|
+
const getBalanceResults = balanceResults.filter((result)=>result.status === "fulfilled").map((fulfilledResult)=>fulfilledResult.value);
|
|
2357
|
+
return {
|
|
2358
|
+
balances: getBalanceResults
|
|
2359
|
+
};
|
|
2360
|
+
};
|
|
2361
|
+
|
|
2362
|
+
|
|
2363
|
+
|
|
2364
|
+
|
|
2365
|
+
|
|
2366
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2367
|
+
|
|
2368
|
+
|
|
2369
|
+
|
|
2370
|
+
async function $c99672cf2294e839$export$2d040992269b4717(providerPreference) {
|
|
2371
|
+
const provider = await $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference);
|
|
2372
|
+
if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
|
|
2373
|
+
const accounts = await provider.provider.request({
|
|
2374
|
+
method: ($4f91c5f280efe242$export$a130407f3423b97d).CHECK_CONNECTION,
|
|
2375
|
+
params: []
|
|
2376
|
+
});
|
|
2377
|
+
// accounts[0] will have the active account if connected.
|
|
2378
|
+
return {
|
|
2379
|
+
isConnected: accounts && accounts.length > 0,
|
|
2380
|
+
walletAddress: accounts[0] ?? ""
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2383
|
+
async function $c99672cf2294e839$export$fba2f6c3656e07c1(params) {
|
|
2384
|
+
const web3Provider = await $c99672cf2294e839$var$getWalletProviderForPreference(params.providerPreference);
|
|
2385
|
+
await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
2386
|
+
if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
|
|
2387
|
+
// this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
|
|
2388
|
+
await web3Provider.provider.request({
|
|
2389
|
+
method: ($4f91c5f280efe242$export$a130407f3423b97d).CONNECT,
|
|
2390
|
+
params: []
|
|
2391
|
+
});
|
|
2392
|
+
}, {
|
|
2393
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR
|
|
2394
|
+
});
|
|
2395
|
+
return web3Provider;
|
|
2396
|
+
}
|
|
2397
|
+
async function $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference) {
|
|
2398
|
+
let web3Provider = null;
|
|
2399
|
+
switch(providerPreference){
|
|
2400
|
+
case (exports.ConnectionProviders).METAMASK:
|
|
2401
|
+
web3Provider = await $c99672cf2294e839$var$getMetaMaskProvider();
|
|
2402
|
+
break;
|
|
2403
|
+
default:
|
|
2404
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider preference was not detected", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CONNECT_PROVIDER_ERROR);
|
|
2405
|
+
}
|
|
2406
|
+
return web3Provider;
|
|
2407
|
+
}
|
|
2408
|
+
async function $c99672cf2294e839$var$getMetaMaskProvider() {
|
|
2409
|
+
const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
2410
|
+
return await (detectEthereumProvider)();
|
|
2411
|
+
}, {
|
|
2412
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR
|
|
2413
|
+
});
|
|
2414
|
+
if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
|
|
2415
|
+
return new (providers.Web3Provider)(provider);
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
|
|
2419
|
+
|
|
2420
|
+
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (params)=>{
|
|
2424
|
+
const { provider: provider , transaction: transaction } = params;
|
|
2425
|
+
return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
2426
|
+
const transactionResponse = await provider.getSigner().sendTransaction(transaction);
|
|
2427
|
+
return {
|
|
2428
|
+
transactionResponse: transactionResponse
|
|
2429
|
+
};
|
|
2430
|
+
}, {
|
|
2431
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).TRANSACTION_ERROR
|
|
2432
|
+
});
|
|
2433
|
+
};
|
|
2434
|
+
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
|
|
2438
|
+
class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
2439
|
+
async checkIsWalletConnected(params) {
|
|
2440
|
+
return $c99672cf2294e839$export$2d040992269b4717(params.providerPreference);
|
|
2441
|
+
}
|
|
2442
|
+
async connect(params) {
|
|
2443
|
+
const provider = await $c99672cf2294e839$export$fba2f6c3656e07c1(params);
|
|
2444
|
+
const network = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(provider);
|
|
2445
|
+
return {
|
|
2446
|
+
provider: provider,
|
|
2447
|
+
network: network
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2450
|
+
async switchNetwork(params) {
|
|
2451
|
+
return await ($de192de6ef100f9f$export$b827d9418aeb5dbd)(params.provider, params.chainId);
|
|
2452
|
+
}
|
|
2453
|
+
async getBalance(params) {
|
|
2454
|
+
if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(params.provider, params.walletAddress);
|
|
2455
|
+
return await $1564e43dde50bb61$export$60e0fe116a0e6ed0(params.provider, params.walletAddress, params.contractAddress);
|
|
2456
|
+
}
|
|
2457
|
+
async getAllBalances(params) {
|
|
2458
|
+
return $1564e43dde50bb61$export$fee49741664a4d7e(params.provider, params.walletAddress, params.chainId);
|
|
2459
|
+
}
|
|
2460
|
+
getTokenAllowList(params) {
|
|
2461
|
+
return $efe60cea83bfc4e8$export$473cec51305fdae8(params.chainId);
|
|
2462
|
+
}
|
|
2463
|
+
async sendTransaction(params) {
|
|
2464
|
+
return await $dbe95599a4661140$export$8e0e7ffc78696d30(params);
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
function $parcel$export(e, n, v, s) {
|
|
2469
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
2470
|
+
}
|
|
2471
|
+
var $88e4c575901cd68c$exports = {};
|
|
2472
|
+
|
|
2473
|
+
$parcel$export($88e4c575901cd68c$exports, "IMTBLWidgetEvents", () => exports.IMTBLWidgetEvents);
|
|
2474
|
+
exports.IMTBLWidgetEvents = void 0;
|
|
2475
|
+
(function(IMTBLWidgetEvents) {
|
|
2476
|
+
IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
|
|
2477
|
+
IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
|
|
2478
|
+
IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
|
|
2479
|
+
IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
|
|
2480
|
+
IMTBLWidgetEvents["IMTBL_BUY_WIDGET_EVENT"] = "imtbl-buy-widget";
|
|
2481
|
+
})(exports.IMTBLWidgetEvents || (exports.IMTBLWidgetEvents = {}));
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
var $d71a87afc3136184$exports = {};
|
|
2485
|
+
|
|
2486
|
+
$parcel$export($d71a87afc3136184$exports, "ConnectEventType", () => exports.ConnectEventType);
|
|
2487
|
+
exports.ConnectEventType = void 0;
|
|
2488
|
+
(function(ConnectEventType) {
|
|
2489
|
+
ConnectEventType["SUCCESS"] = "success";
|
|
2490
|
+
ConnectEventType["FAILURE"] = "failure";
|
|
2491
|
+
})(exports.ConnectEventType || (exports.ConnectEventType = {}));
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
var $9d0f1783d4d36e8a$exports = {};
|
|
2495
|
+
|
|
2496
|
+
$parcel$export($9d0f1783d4d36e8a$exports, "WalletEventType", () => exports.WalletEventType);
|
|
2497
|
+
//wallet widget events
|
|
2498
|
+
exports.WalletEventType = void 0;
|
|
2499
|
+
(function(WalletEventType) {
|
|
2500
|
+
WalletEventType["CLOSE_WIDGET"] = "close-widget";
|
|
2501
|
+
WalletEventType["NETWORK_SWITCH"] = "network-switch";
|
|
2502
|
+
})(exports.WalletEventType || (exports.WalletEventType = {}));
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
var $5d497088f13bb116$exports = {};
|
|
2506
|
+
|
|
2507
|
+
$parcel$export($5d497088f13bb116$exports, "SwapEventType", () => exports.SwapEventType);
|
|
2508
|
+
exports.SwapEventType = void 0;
|
|
2509
|
+
(function(SwapEventType) {
|
|
2510
|
+
SwapEventType["SUCCESS"] = "success";
|
|
2511
|
+
SwapEventType["FAILURE"] = "failure";
|
|
2512
|
+
})(exports.SwapEventType || (exports.SwapEventType = {}));
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
var $28a5fdc2f5e6c742$exports = {};
|
|
2516
|
+
|
|
2517
|
+
$parcel$export($28a5fdc2f5e6c742$exports, "BridgeEventType", () => exports.BridgeEventType);
|
|
2518
|
+
exports.BridgeEventType = void 0;
|
|
2519
|
+
(function(BridgeEventType) {
|
|
2520
|
+
BridgeEventType["CLOSE_WIDGET"] = "close-widget";
|
|
2521
|
+
BridgeEventType["SUCCESS"] = "success";
|
|
2522
|
+
BridgeEventType["FAILURE"] = "failure";
|
|
2523
|
+
})(exports.BridgeEventType || (exports.BridgeEventType = {}));
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
var $ede253beebe0de4a$exports = {};
|
|
2527
|
+
|
|
2528
|
+
$parcel$export($ede253beebe0de4a$exports, "BuyEventType", () => exports.BuyEventType);
|
|
2529
|
+
exports.BuyEventType = void 0;
|
|
2530
|
+
(function(BuyEventType) {
|
|
2531
|
+
BuyEventType["SUCCESS"] = "success";
|
|
2532
|
+
BuyEventType["FAILURE"] = "failure";
|
|
2533
|
+
BuyEventType["NOT_CONNECTED"] = "not_connected";
|
|
2534
|
+
BuyEventType["CLOSE"] = "close";
|
|
2535
|
+
})(exports.BuyEventType || (exports.BuyEventType = {}));
|
|
2536
|
+
|
|
2537
|
+
|
|
2538
|
+
var $9234b4c577442a97$exports = {};
|
|
2539
|
+
|
|
2540
|
+
$parcel$export($9234b4c577442a97$exports, "Network", () => exports.Network);
|
|
2541
|
+
$parcel$export($9234b4c577442a97$exports, "WidgetTheme", () => exports.WidgetTheme);
|
|
2542
|
+
$parcel$export($9234b4c577442a97$exports, "ConnectionProviders", () => exports.ConnectionProviders);
|
|
2543
|
+
|
|
2544
|
+
exports.Network = void 0;
|
|
2545
|
+
(function(Network) {
|
|
2546
|
+
Network["ETHEREUM"] = "Ethereum";
|
|
2547
|
+
Network["GOERLI"] = "Goerli";
|
|
2548
|
+
Network["POLYGON"] = "Polygon";
|
|
2549
|
+
})(exports.Network || (exports.Network = {}));
|
|
2550
|
+
exports.WidgetTheme = void 0;
|
|
2551
|
+
(function(WidgetTheme) {
|
|
2552
|
+
WidgetTheme["LIGHT"] = "light";
|
|
2553
|
+
WidgetTheme["DARK"] = "dark";
|
|
2554
|
+
WidgetTheme["CUSTOM"] = "custom";
|
|
2555
|
+
})(exports.WidgetTheme || (exports.WidgetTheme = {}));
|
|
2556
|
+
|
|
2557
|
+
exports.Checkout = $a8cb37a3fc8eb863$export$1f60ba4ec72508a0;
|
|
2004
2558
|
exports.Config = Config;
|
|
2005
2559
|
exports.Configuration = Configuration;
|
|
2006
2560
|
exports.GenericIMXProvider = GenericIMXProvider;
|