@funkit/core 2.3.1 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -26,18 +26,6 @@ import {
26
26
 
27
27
  // src/common/constants.ts
28
28
  import { padHex } from "viem";
29
- import {
30
- arbitrum,
31
- arbitrumSepolia,
32
- base,
33
- goerli,
34
- mainnet,
35
- mantle,
36
- optimism,
37
- polygon,
38
- scroll,
39
- zkSync
40
- } from "viem/chains";
41
29
 
42
30
  // src/abis/ApproveAndExec.json
43
31
  var ApproveAndExec_default = {
@@ -11508,6 +11496,7 @@ import {
11508
11496
  getChainFromName,
11509
11497
  getUserOpGasPrice
11510
11498
  } from "@funkit/api-base";
11499
+ import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from "@funkit/chains";
11511
11500
  import {
11512
11501
  ErrorCode as ErrorCode4,
11513
11502
  InternalFailureError as InternalFailureError2,
@@ -13115,323 +13104,7 @@ var BYTES32_LENGTH = 66;
13115
13104
  var BASE_PIMLICO_PAYMASTER_AND_DATA_ESTIMATION = "0xa880eae8900eb59bf7dad9bdb741a086238adca900000000000000000000000000000000000000000000000000000101010101010000000000000000000000000000000000000000000000000000000000000000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c";
13116
13105
  var OPTIMISM_PIMLICO_PAYMASTER_AND_DATA_ESTIMATION = "0x4Df91e173A6CdC74EfeF6fC72bb5Df1E8A8d758200000000000000000000000000000000000000000000000000000101010101010000000000000000000000000000000000000000000000000000000000000000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c";
13117
13106
  var ETHEREUM_PIMLICO_PAYMASTER_AND_DATA_ESTIMATION = "0x67F21bE69A16c314a0b7Da537309b2f3ADdDE03100000000000000000000000000000000000000000000000000000101010101010000000000000000000000000000000000000000000000000000000000000000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c";
13118
- var DYDX_MAINNET_CHAIN_ID = 1511490300;
13119
- var dydxChain = {
13120
- id: DYDX_MAINNET_CHAIN_ID,
13121
- name: "dYdX",
13122
- nativeCurrency: {
13123
- symbol: "DYDX",
13124
- decimals: 18,
13125
- name: "dYdX Staking Coin"
13126
- },
13127
- rpcUrls: {
13128
- default: {
13129
- http: ["https://dydx-dao-rpc.polkachu.com:443 "]
13130
- }
13131
- },
13132
- blockExplorers: {
13133
- default: {
13134
- name: "Mintscan",
13135
- url: "https://www.mintscan.io/dydx",
13136
- apiUrl: ""
13137
- }
13138
- },
13139
- contracts: {
13140
- ensRegistry: {
13141
- address: "0x"
13142
- },
13143
- ensUniversalResolver: {
13144
- address: "0x",
13145
- blockCreated: -1
13146
- },
13147
- multicall3: {
13148
- address: "0x",
13149
- blockCreated: -1
13150
- }
13151
- }
13152
- };
13153
13107
  var STABLECOIN_SYMBOLS = ["USDC", "USDC.e", "USDT", "DAI"];
13154
- var FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO = {
13155
- /** MAINNETS **/
13156
- [mainnet.id.toString()]: {
13157
- name: mainnet.name,
13158
- nativeCurrency: {
13159
- symbol: mainnet.nativeCurrency.symbol,
13160
- decimals: mainnet.nativeCurrency.decimals,
13161
- name: mainnet.nativeCurrency.name
13162
- },
13163
- chainInfo: mainnet,
13164
- explorerInfo: mainnet.blockExplorers.default,
13165
- isCheckoutSupported: true,
13166
- checkoutAssetWhitelist: ["*"],
13167
- isFunWalletSupported: true,
13168
- isMainnet: true,
13169
- moonpayChainName: "",
13170
- pickPriority: 4,
13171
- isStandardEvmAddress: true,
13172
- fallbackRpcUrls: ["https://eth.llamarpc.com", "https://rpc.ankr.com/eth"]
13173
- },
13174
- [base.id.toString()]: {
13175
- name: base.name,
13176
- nativeCurrency: {
13177
- symbol: base.nativeCurrency.symbol,
13178
- decimals: base.nativeCurrency.decimals,
13179
- name: base.nativeCurrency.name
13180
- },
13181
- chainInfo: base,
13182
- explorerInfo: base.blockExplorers.default,
13183
- isCheckoutSupported: true,
13184
- checkoutAssetWhitelist: ["*"],
13185
- isFunWalletSupported: true,
13186
- isMainnet: true,
13187
- moonpayChainName: "base",
13188
- pickPriority: 2,
13189
- isStandardEvmAddress: true,
13190
- fallbackRpcUrls: [
13191
- "https://base.llamarpc.com",
13192
- "https://base-rpc.publicnode.com"
13193
- ]
13194
- },
13195
- [polygon.id.toString()]: {
13196
- name: polygon.name,
13197
- nativeCurrency: {
13198
- symbol: polygon.nativeCurrency.symbol,
13199
- decimals: polygon.nativeCurrency.decimals,
13200
- name: polygon.nativeCurrency.name
13201
- },
13202
- coreToken: {
13203
- symbol: "MATIC",
13204
- decimals: 18,
13205
- name: "MATIC"
13206
- },
13207
- chainInfo: polygon,
13208
- explorerInfo: polygon.blockExplorers.default,
13209
- isCheckoutSupported: true,
13210
- checkoutAssetWhitelist: ["*"],
13211
- isFunWalletSupported: true,
13212
- isMainnet: true,
13213
- moonpayChainName: "polygon",
13214
- pickPriority: 1,
13215
- isStandardEvmAddress: true,
13216
- fallbackRpcUrls: [
13217
- "https://polygon.llamarpc.com",
13218
- "https://api.zan.top/polygon-mainnet"
13219
- ]
13220
- },
13221
- [arbitrum.id.toString()]: {
13222
- name: "Arbitrum",
13223
- // arbitrum.name returns 'Arbitrum One' which is too wordy for us.
13224
- nativeCurrency: {
13225
- symbol: arbitrum.nativeCurrency.symbol,
13226
- decimals: arbitrum.nativeCurrency.decimals,
13227
- name: arbitrum.nativeCurrency.name
13228
- },
13229
- coreToken: {
13230
- symbol: "ARB",
13231
- decimals: 18,
13232
- name: "Arbitrium"
13233
- },
13234
- chainInfo: arbitrum,
13235
- explorerInfo: arbitrum.blockExplorers.default,
13236
- isCheckoutSupported: true,
13237
- checkoutAssetWhitelist: ["*"],
13238
- isFunWalletSupported: true,
13239
- isMainnet: true,
13240
- moonpayChainName: "arbitrum",
13241
- pickPriority: 3,
13242
- isStandardEvmAddress: true,
13243
- fallbackRpcUrls: ["https://arbitrum.llamarpc.com"]
13244
- },
13245
- [optimism.id.toString()]: {
13246
- name: optimism.name,
13247
- nativeCurrency: {
13248
- symbol: optimism.nativeCurrency.symbol,
13249
- decimals: optimism.nativeCurrency.decimals,
13250
- name: optimism.nativeCurrency.name
13251
- },
13252
- coreToken: {
13253
- symbol: "OP",
13254
- decimals: 18,
13255
- name: "Optimism"
13256
- },
13257
- chainInfo: optimism,
13258
- explorerInfo: optimism.blockExplorers.default,
13259
- // Not supported for checkouts on backend yet
13260
- isCheckoutSupported: false,
13261
- checkoutAssetWhitelist: [],
13262
- isFunWalletSupported: true,
13263
- isMainnet: true,
13264
- moonpayChainName: "optimism",
13265
- // Not supported for checkouts yet
13266
- pickPriority: Number.MAX_SAFE_INTEGER,
13267
- isStandardEvmAddress: true,
13268
- fallbackRpcUrls: [
13269
- "https://optimism.llamarpc.com",
13270
- "https://optimism.gateway.tenderly.co"
13271
- ]
13272
- },
13273
- [zkSync.id.toString()]: {
13274
- name: "zkSync",
13275
- nativeCurrency: {
13276
- symbol: zkSync.nativeCurrency.symbol,
13277
- decimals: zkSync.nativeCurrency.decimals,
13278
- name: zkSync.nativeCurrency.name
13279
- },
13280
- coreToken: {
13281
- symbol: "ZK",
13282
- decimals: 18,
13283
- name: "zkSync"
13284
- },
13285
- chainInfo: zkSync,
13286
- explorerInfo: zkSync.blockExplorers.default,
13287
- isCheckoutSupported: false,
13288
- checkoutAssetWhitelist: ["*"],
13289
- isFunWalletSupported: false,
13290
- isMainnet: true,
13291
- moonpayChainName: "base",
13292
- // default to base for zksync era on moonpay
13293
- pickPriority: 5,
13294
- isStandardEvmAddress: true,
13295
- fallbackRpcUrls: [
13296
- "https://1rpc.io/zksync2-era",
13297
- "https://zksync.meowrpc.com"
13298
- ]
13299
- },
13300
- [mantle.id.toString()]: {
13301
- name: mantle.name,
13302
- nativeCurrency: {
13303
- symbol: mantle.nativeCurrency.symbol,
13304
- decimals: mantle.nativeCurrency.decimals,
13305
- name: mantle.nativeCurrency.name
13306
- },
13307
- coreToken: {
13308
- symbol: "MNT",
13309
- decimals: 18,
13310
- name: "Mantle"
13311
- },
13312
- chainInfo: mantle,
13313
- explorerInfo: mantle.blockExplorers.default,
13314
- isCheckoutSupported: true,
13315
- checkoutAssetWhitelist: [
13316
- // USDC.e
13317
- "0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9".toLowerCase(),
13318
- // USDe
13319
- "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34".toLowerCase()
13320
- ],
13321
- isFunWalletSupported: true,
13322
- isMainnet: true,
13323
- moonpayChainName: "base",
13324
- // default to base for mantle on moonpay
13325
- pickPriority: 6,
13326
- isStandardEvmAddress: false,
13327
- fallbackRpcUrls: [
13328
- "https://mantle.drpc.org",
13329
- "https://mantle-rpc.publicnode.com"
13330
- ]
13331
- },
13332
- [dydxChain.id.toString()]: {
13333
- name: dydxChain.name,
13334
- nativeCurrency: {
13335
- symbol: dydxChain.nativeCurrency.symbol,
13336
- decimals: dydxChain.nativeCurrency.decimals,
13337
- name: dydxChain.nativeCurrency.name
13338
- },
13339
- chainInfo: dydxChain,
13340
- explorerInfo: dydxChain.blockExplorers.default,
13341
- // We cannot pay with dYdX / cosmos tokens yet
13342
- isCheckoutSupported: false,
13343
- checkoutAssetWhitelist: [
13344
- // USDC
13345
- "0x8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5".toLowerCase()
13346
- ],
13347
- isFunWalletSupported: false,
13348
- isMainnet: true,
13349
- moonpayChainName: "base",
13350
- // default to base for dydx on moonpay
13351
- pickPriority: Number.MAX_SAFE_INTEGER,
13352
- isStandardEvmAddress: false,
13353
- fallbackRpcUrls: []
13354
- },
13355
- [scroll.id.toString()]: {
13356
- name: scroll.name,
13357
- nativeCurrency: {
13358
- symbol: scroll.nativeCurrency.symbol,
13359
- decimals: scroll.nativeCurrency.decimals,
13360
- name: scroll.nativeCurrency.name
13361
- },
13362
- chainInfo: scroll,
13363
- explorerInfo: scroll.blockExplorers.default,
13364
- isCheckoutSupported: false,
13365
- checkoutAssetWhitelist: [
13366
- // USDC
13367
- "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4".toLowerCase(),
13368
- // USDT
13369
- "0xf55bec9cafdbe8730f096aa55dad6d22d44099df".toLowerCase()
13370
- ],
13371
- isFunWalletSupported: true,
13372
- isMainnet: true,
13373
- moonpayChainName: "base",
13374
- // default to base for scroll on moonpay
13375
- pickPriority: 7,
13376
- isStandardEvmAddress: false,
13377
- fallbackRpcUrls: [
13378
- "https://rpc.ankr.com/scroll",
13379
- "https://scroll-mainnet.public.blastapi.io"
13380
- ]
13381
- },
13382
- /** TESTNETS **/
13383
- [goerli.id.toString()]: {
13384
- name: goerli.name,
13385
- nativeCurrency: {
13386
- symbol: goerli.nativeCurrency.symbol,
13387
- decimals: goerli.nativeCurrency.decimals,
13388
- name: goerli.nativeCurrency.name
13389
- },
13390
- chainInfo: goerli,
13391
- explorerInfo: goerli.blockExplorers.default,
13392
- isCheckoutSupported: true,
13393
- checkoutAssetWhitelist: ["*"],
13394
- isFunWalletSupported: true,
13395
- // testnet has no fiat checkouts supported
13396
- isMainnet: false,
13397
- moonpayChainName: null,
13398
- pickPriority: Number.MAX_SAFE_INTEGER,
13399
- isStandardEvmAddress: true,
13400
- fallbackRpcUrls: []
13401
- },
13402
- [arbitrumSepolia.id.toString()]: {
13403
- name: arbitrumSepolia.name,
13404
- nativeCurrency: {
13405
- symbol: arbitrumSepolia.nativeCurrency.symbol,
13406
- decimals: arbitrumSepolia.nativeCurrency.decimals,
13407
- name: arbitrumSepolia.nativeCurrency.name
13408
- },
13409
- chainInfo: arbitrumSepolia,
13410
- explorerInfo: {
13411
- name: "Arbiscan",
13412
- url: "https://sepolia.arbiscan.io"
13413
- },
13414
- isCheckoutSupported: true,
13415
- checkoutAssetWhitelist: ["*"],
13416
- isFunWalletSupported: true,
13417
- // testnet has no fiat checkouts supported
13418
- isMainnet: false,
13419
- moonpayChainName: null,
13420
- pickPriority: Number.MAX_SAFE_INTEGER,
13421
- isStandardEvmAddress: false,
13422
- fallbackRpcUrls: []
13423
- }
13424
- };
13425
- var FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST = Object.keys(
13426
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO
13427
- );
13428
- var FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO_LIST = Object.values(
13429
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO
13430
- ).map((item) => item.chainInfo);
13431
- var FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO_LIST.filter(
13432
- (chainInfo) => FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[chainInfo.id]?.isCheckoutSupported && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[chainInfo.id]?.isMainnet
13433
- );
13434
- var FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
13435
13108
 
13436
13109
  // src/utils/TypeUtils.ts
13437
13110
  import { isHex } from "viem";
@@ -13444,12 +13117,12 @@ var isBytes32 = (input) => {
13444
13117
 
13445
13118
  // src/viem/Converter.ts
13446
13119
  import { createWalletClient, custom, toBytes as toBytes4 } from "viem";
13447
- import { mainnet as mainnet2 } from "viem/chains";
13120
+ import { mainnet } from "viem/chains";
13448
13121
  var convertProviderToClient = ({
13449
13122
  provider,
13450
13123
  viemChain
13451
13124
  }) => {
13452
- const chain = viemChain ? viemChain : mainnet2;
13125
+ const chain = viemChain ? viemChain : mainnet;
13453
13126
  if (provider.request) {
13454
13127
  return createWalletClient({
13455
13128
  chain,
@@ -13471,7 +13144,7 @@ var convertSignerToClient = ({
13471
13144
  signer,
13472
13145
  viemChain
13473
13146
  }) => {
13474
- const chain = viemChain ? viemChain : mainnet2;
13147
+ const chain = viemChain ? viemChain : mainnet;
13475
13148
  if (signer.type === "local") {
13476
13149
  return createWalletClient({
13477
13150
  chain,
@@ -16803,7 +16476,6 @@ export {
16803
16476
  CheckoutSponsor,
16804
16477
  ContractInterface,
16805
16478
  DEFAULT_RETRY_OPTIONS,
16806
- DYDX_MAINNET_CHAIN_ID,
16807
16479
  ENTRYPOINT_ABI,
16808
16480
  ENTRYPOINT_CONTRACT_INTERFACE,
16809
16481
  ERC20_ABI,
@@ -16815,11 +16487,6 @@ export {
16815
16487
  ETH_TRANSFER_SELECTOR,
16816
16488
  FACTORY_ABI,
16817
16489
  FACTORY_CONTRACT_INTERFACE,
16818
- FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS,
16819
- FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST,
16820
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO,
16821
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO_LIST,
16822
- FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST,
16823
16490
  FUN_FAUCET_URL,
16824
16491
  FUN_GASLESS_SPONSOR_ADDRESS,
16825
16492
  FUN_TOKEN_SPONSOR_ADDRESS,
@@ -16866,7 +16533,6 @@ export {
16866
16533
  createSessionUser,
16867
16534
  createTargetSelectorMerkleTree,
16868
16535
  decodeCalldata,
16869
- dydxChain,
16870
16536
  encodeLoginData,
16871
16537
  encodeUserAuthInitData,
16872
16538
  encodeWalletSignature,