@daimo/pay
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
22 lines (19 loc) • 821 B
JavaScript
import { injected } from '@wagmi/connectors';
import { walletConfigs } from './walletConfigs.js';
const wallets = Object.keys(walletConfigs).reduce((acc, key) => {
const config = walletConfigs[key];
const target = key.split(",")[0].trim();
const flag = config.name?.replace("Wallet", "").replace(" ", "") ?? target[0].toUpperCase() + target.slice(1);
const connector = injected({
target: {
id: target,
name: config.name ?? config.shortName ?? key,
provider: (w) => w?.ethereum?.[`is${flag}`]
}
});
const name = (config.name ?? config.shortName ?? key).toLowerCase().replace(/(?:^|\s)\S/g, (a) => a.toUpperCase()).replace(/\s/g, "").replace(/(?:^|\s)\S/g, (a) => a.toLowerCase());
acc[name] = connector;
return acc;
}, {});
export { wallets };
//# sourceMappingURL=index.js.map