From 026f3b34b629d06a097fe4acb72f1cf16cb63d26 Mon Sep 17 00:00:00 2001 From: "Jason M. Hasperhoven" Date: Mon, 6 Jan 2025 19:21:53 +0400 Subject: [PATCH] Add tmp-cosmos-pkg --- packages/tmp-cosmos-kit/LICENSE | 33 +++++ packages/tmp-cosmos-kit/README.md | 181 +++++++++++++++++++++++ packages/tmp-cosmos-kit/cjs/index.d.ts | 4 + packages/tmp-cosmos-kit/cjs/index.js | 8 + packages/tmp-cosmos-kit/cjs/wallets.d.ts | 57 +++++++ packages/tmp-cosmos-kit/cjs/wallets.js | 158 ++++++++++++++++++++ packages/tmp-cosmos-kit/esm/index.d.ts | 4 + packages/tmp-cosmos-kit/esm/index.js | 3 + packages/tmp-cosmos-kit/esm/wallets.d.ts | 57 +++++++ packages/tmp-cosmos-kit/esm/wallets.js | 120 +++++++++++++++ packages/tmp-cosmos-kit/package.json | 95 ++++++++++++ 11 files changed, 720 insertions(+) create mode 100644 packages/tmp-cosmos-kit/LICENSE create mode 100644 packages/tmp-cosmos-kit/README.md create mode 100644 packages/tmp-cosmos-kit/cjs/index.d.ts create mode 100644 packages/tmp-cosmos-kit/cjs/index.js create mode 100644 packages/tmp-cosmos-kit/cjs/wallets.d.ts create mode 100644 packages/tmp-cosmos-kit/cjs/wallets.js create mode 100644 packages/tmp-cosmos-kit/esm/index.d.ts create mode 100644 packages/tmp-cosmos-kit/esm/index.js create mode 100644 packages/tmp-cosmos-kit/esm/wallets.d.ts create mode 100644 packages/tmp-cosmos-kit/esm/wallets.js create mode 100644 packages/tmp-cosmos-kit/package.json diff --git a/packages/tmp-cosmos-kit/LICENSE b/packages/tmp-cosmos-kit/LICENSE new file mode 100644 index 000000000..b3ac161b5 --- /dev/null +++ b/packages/tmp-cosmos-kit/LICENSE @@ -0,0 +1,33 @@ +The Clear BSD License + +Copyright (c) 2024 Cosmos Kit Contributors +Copyright (c) 2024 Interweb, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted (subject to the limitations in the disclaimer +below) provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY +THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/tmp-cosmos-kit/README.md b/packages/tmp-cosmos-kit/README.md new file mode 100644 index 000000000..36db13d5a --- /dev/null +++ b/packages/tmp-cosmos-kit/README.md @@ -0,0 +1,181 @@ +# cosmos-kit + +

+ +

+ +

+ + + + + + + + + +
+ + +

+ +Cosmos Kit is a univeral wallet adapter for developers to build apps that quickly and easily interact with Cosmos blockchains and wallets. + +## 🏁 Quickstart + +Get started quickly by using [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) to help you build high-quality Cosmos apps fast! + +## βš™οΈ Configuration + +Check out [our docs here](https://docs.cosmology.zone/cosmos-kit/get-started) to configure CosmosKit. + +## βš›οΈ CosmJS Signers + +If you want to get a cosmjs stargate or cosmwasm signer, [here are docs for our hooks](https://docs.cosmology.zone/cosmos-kit/hooks) + +## πŸ“¦ Packages + +| Name | Description | +| --- | --- | +| [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/cosmos-kit) | Single package for React developers to install Cosmos Kit | +| [@cosmos-kit/core](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/core) | Core Cosmos Kit functionality | +| [@cosmos-kit/walletconnect](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/walletconnect) | Mobile WalletConnect support for the Cosmos ecosystem | +| [@cosmos-kit/react](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/react) | React integration with Interchain UI Modal for simple usage | +| [@cosmos-kit/react-lite](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/react-lite) | A lightweight version of React integration without UI for customization | + +## πŸ“¦ Wallets + +Explore the range of wallet adapters available in our [wallets directory](https://github.com/cosmology-tech/cosmos-kit/tree/main/wallets). + +

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +

+ + +## πŸ”Œ Integrating Wallets + +See our docs on [integrating your wallet](https://docs.cosmology.zone/cosmos-kit/integrating-wallets) + +### πŸš€ Running Example + +For high-level examples suitable for most developers, explore our [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app). For a deeper, more technical understanding, this repository contains an example, which is also useful when integrating new wallets. + +```sh +yarn build +cd packages/example +yarn dev +``` + +#### [Basic Next.js Example](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/example) + +This example demonstrates a Next.js project that integrates the `@cosmos-kit/react` wallet adapter. Note that this example has historically been used by multiple teams to test PRs. + +#### ["vanilla" example showing how `WalletManager` works](https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/example/pages/wallet-manager) + +This example is ideal for developers looking to create integrations for Vue.js, Svelte, or other frameworks. It uses a basic Next.js setup without relying on React-specific hooks, providing a clear model for building custom integrations. + +- `/wallet-manager` - Index page for wallet functionality +- `/wallet-manager/wallet-operate` - Operate Wallet Directly +- `/wallet-manager/main-wallets` - Show All Main Wallets +- `/wallet-manager/wallet-manager` - Wallet Manager Without Hook +- `/wallet-manager/wallet-repos` - Show All Wallet Repos +- `/wallet-manager/wallet-repo` - Show One Wallet Repo + +## πŸ›  Developing + +Checkout the repository and bootstrap the yarn workspace: + +```sh +# Clone the repo. +git clone https://github.com/cosmology-tech/cosmos-kit +cd cosmos-kit +yarn +``` + +### Building + +```sh +yarn build +``` + +### Publishing + +``` +lerna publish +# lerna publish minor +# lerna publish major +``` + +## Related + +Checkout these related projects: + +- [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. +- [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. +- [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. +- [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. +- [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command. +- [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. +- [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain. + +## Credits + +πŸ›  Built by Cosmology β€”Β if you like our tools, please consider delegating to [our validator βš›οΈ](https://cosmology.zone/validator) + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED β€œAS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/packages/tmp-cosmos-kit/cjs/index.d.ts b/packages/tmp-cosmos-kit/cjs/index.d.ts new file mode 100644 index 000000000..14c234989 --- /dev/null +++ b/packages/tmp-cosmos-kit/cjs/index.d.ts @@ -0,0 +1,4 @@ +export { wallets } from './wallets'; +import { ChainName, ChainWalletBase, SignerOptions, WalletModalProps, WalletStatus } from '@cosmos-kit/core'; +export { WalletStatus, ChainWalletBase }; +export type { ChainName, SignerOptions, WalletModalProps, }; diff --git a/packages/tmp-cosmos-kit/cjs/index.js b/packages/tmp-cosmos-kit/cjs/index.js new file mode 100644 index 000000000..ccb60e959 --- /dev/null +++ b/packages/tmp-cosmos-kit/cjs/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChainWalletBase = exports.WalletStatus = exports.wallets = void 0; +var wallets_1 = require("./wallets"); +Object.defineProperty(exports, "wallets", { enumerable: true, get: function () { return wallets_1.wallets; } }); +const core_1 = require("@cosmos-kit/core"); +Object.defineProperty(exports, "ChainWalletBase", { enumerable: true, get: function () { return core_1.ChainWalletBase; } }); +Object.defineProperty(exports, "WalletStatus", { enumerable: true, get: function () { return core_1.WalletStatus; } }); diff --git a/packages/tmp-cosmos-kit/cjs/wallets.d.ts b/packages/tmp-cosmos-kit/cjs/wallets.d.ts new file mode 100644 index 000000000..0d74affbd --- /dev/null +++ b/packages/tmp-cosmos-kit/cjs/wallets.d.ts @@ -0,0 +1,57 @@ +import { MainWalletBase } from '@cosmos-kit/core'; +export declare type WalletName = 'keplr' | 'cosmostation' | 'ledger' | 'okxwallet' | 'station' | 'leap' | 'trust' | 'xdefi' | 'vectis' | 'frontier' | 'fin' | 'omni' | 'coin98' | 'shell' | 'compass' | 'tailwind' | 'owallet' | 'exodus' | 'galaxystation' | 'cdcwallet'; +export declare type WalletList = (E extends MainWalletBase ? M extends MainWalletBase ? [E, M] : [E] : M extends MainWalletBase ? [M] : []) & { + mobile: M | null; + extension: E | null; +}; +export declare function createWalletList(extension: ExtensionWallet | null, mobile: MobileWallet | null, snap?: MetaMaskSnap): WalletList; +export declare const keplr: WalletList; +export declare const cosmostation: WalletList; +export declare const ledger: import("@cosmos-kit/ledger/cjs/web-usb-hid").LedgerMainWallet[]; +export declare const leap: WalletList; +export declare const station: WalletList; +export declare const okxwallet: WalletList; +export declare const trust: WalletList; +export declare const xdefi: WalletList; +export declare const vectis: WalletList; +export declare const frontier: WalletList; +export declare const fin: WalletList; +export declare const omni: WalletList; +export declare const shell: WalletList; +export declare const coin98: WalletList; +export declare const compass: WalletList; +export declare const exodus: WalletList; +export declare const tailwind: WalletList; +export declare const owallet: WalletList; +export declare const galaxystation: WalletList; +export declare const cdcwallet: WalletList; +export declare type SubWalletList = MainWalletBase[] & { + get mobile(): MainWalletBase[]; + get extension(): MainWalletBase[]; +}; +export declare type AllWalletList = SubWalletList & { + keplr: typeof keplr; + cosmostation: typeof cosmostation; + ledger: typeof ledger; + okxwallet: typeof okxwallet; + station: typeof station; + leap: typeof leap; + trust: typeof trust; + xdefi: typeof xdefi; + vectis: typeof vectis; + frontier: typeof frontier; + fin: typeof fin; + omni: typeof omni; + coin98: typeof coin98; + compass: typeof compass; + exodus: typeof exodus; + tailwind: typeof tailwind; + owallet: typeof owallet; + galaxystation: typeof owallet; + cdcwallet: typeof cdcwallet; + for: (...names: WalletName[]) => SubWalletList; + not: (...names: WalletName[]) => SubWalletList; +}; +export declare function defineGetters(wallets: MainWalletBase[]): SubWalletList; +export declare function createAllWalletList(ws: MainWalletBase[]): AllWalletList; +export declare const wallets: AllWalletList; diff --git a/packages/tmp-cosmos-kit/cjs/wallets.js b/packages/tmp-cosmos-kit/cjs/wallets.js new file mode 100644 index 000000000..1ce78a2f7 --- /dev/null +++ b/packages/tmp-cosmos-kit/cjs/wallets.js @@ -0,0 +1,158 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.wallets = + exports.createAllWalletList = + exports.defineGetters = + exports.cdcwallet /* = exports.galaxystation */ = + exports.owallet = + exports.tailwind = + exports.exodus = + exports.compass = + exports.coin98 = + exports.shell = + exports.omni = + exports.fin = + exports.frontier = + exports.vectis = + exports.xdefi = + exports.trust = + exports.okxwallet = + exports.station = + exports.leap = + exports.ledger = + exports.cosmostation = + exports.keplr = + exports.createWalletList = + void 0; +const coin98_extension_1 = require('@cosmos-kit/coin98-extension'); +const compass_extension_1 = require('@cosmos-kit/compass-extension'); +const okxwallet_extension_1 = require('@cosmos-kit/okxwallet-extension'); +const cosmostation_extension_1 = require('@cosmos-kit/cosmostation-extension'); +const cosmostation_mobile_1 = require('@cosmos-kit/cosmostation-mobile'); +const frontier_extension_1 = require('@cosmos-kit/frontier-extension'); +const keplr_extension_1 = require('@cosmos-kit/keplr-extension'); +const keplr_mobile_1 = require('@cosmos-kit/keplr-mobile'); +const owallet_extension_1 = require('@cosmos-kit/owallet-extension'); +const leap_extension_1 = require('@cosmos-kit/leap-extension'); +const leap_mobile_1 = require('@cosmos-kit/leap-mobile'); +const leap_metamask_cosmos_snap_1 = require('@cosmos-kit/leap-metamask-cosmos-snap'); +const ledger_1 = require('@cosmos-kit/ledger'); +const omni_mobile_1 = require('@cosmos-kit/omni-mobile'); +const fin_extension_1 = require('@cosmos-kit/fin-extension'); +const station_extension_1 = require('@cosmos-kit/station-extension'); +const trust_extension_1 = require('@cosmos-kit/trust-extension'); +const trust_mobile_1 = require('@cosmos-kit/trust-mobile'); +const shell_extension_1 = require('@cosmos-kit/shell-extension'); +const vectis_extension_1 = require('@cosmos-kit/vectis-extension'); +const xdefi_extension_1 = require('@cosmos-kit/xdefi-extension'); +const exodus_extension_1 = require('@cosmos-kit/exodus-extension'); +const tailwind_1 = require('@cosmos-kit/tailwind'); +// const galaxy_station_extension_1 = require("@cosmos-kit/galaxy-station-extension"); +const cdcwallet_extension_1 = require('@cosmos-kit/cdcwallet-extension'); +function createWalletList(extension, mobile, snap) { + const list = [extension, mobile, snap].filter(wallet => Boolean(wallet)); + list.mobile = mobile; + list.extension = extension; + return list; +} +exports.createWalletList = createWalletList; +exports.keplr = createWalletList(keplr_extension_1.wallets[0], keplr_mobile_1.wallets[0]); +exports.cosmostation = createWalletList( + cosmostation_extension_1.wallets[0], + cosmostation_mobile_1.wallets[0], +); +exports.ledger = ledger_1.wallets; +exports.leap = createWalletList( + leap_extension_1.wallets[0], + leap_mobile_1.wallets[0], + leap_metamask_cosmos_snap_1.wallets[0], +); +exports.station = createWalletList(station_extension_1.wallets[0], null); +exports.okxwallet = createWalletList(okxwallet_extension_1.wallets[0], null); +exports.trust = createWalletList(trust_extension_1.wallets[0], trust_mobile_1.wallets[0]); +exports.xdefi = createWalletList(xdefi_extension_1.wallets[0], null); +exports.vectis = createWalletList(vectis_extension_1.wallets[0], null); +exports.frontier = createWalletList(frontier_extension_1.wallets[0], null); +exports.fin = createWalletList(fin_extension_1.wallets[0], null); +exports.omni = createWalletList(null, omni_mobile_1.wallets[0]); +exports.shell = createWalletList(shell_extension_1.wallets[0], null); +exports.coin98 = createWalletList(coin98_extension_1.wallets[0], null); +exports.compass = createWalletList(compass_extension_1.wallets[0], null); +exports.exodus = createWalletList(exodus_extension_1.wallets[0], null); +exports.tailwind = createWalletList(tailwind_1.wallets[0], null); +exports.owallet = createWalletList(owallet_extension_1.wallets[0], null); +// exports.galaxystation = createWalletList(galaxy_station_extension_1.wallets[0], null); +exports.cdcwallet = createWalletList(cdcwallet_extension_1.wallets[0], null); +function defineGetters(wallets) { + return Object.defineProperties(wallets, { + mobile: { + get() { + return this.filter(wallet => wallet.isModeWalletConnect); + }, + }, + extension: { + get() { + return this.filter(wallet => wallet.isModeExtension); + }, + }, + }); +} +exports.defineGetters = defineGetters; +function createAllWalletList(ws) { + const wallets = ws.slice(); + wallets.keplr = exports.keplr; + wallets.cosmostation = exports.cosmostation; + wallets.ledger = exports.ledger; + wallets.okxwallet = exports.okxwallet; + wallets.station = exports.station; + wallets.leap = exports.leap; + wallets.trust = exports.trust; + wallets.xdefi = exports.xdefi; + wallets.vectis = exports.vectis; + wallets.frontier = exports.frontier; + wallets.fin = exports.fin; + wallets.omni = exports.omni; + wallets.coin98 = exports.coin98; + wallets.compass = exports.compass; + wallets.exodus = exports.exodus; + wallets.tailwind = exports.tailwind; + wallets.owallet = exports.owallet; + // wallets.galaxystation = exports.galaxystation; + wallets.cdcwallet = exports.cdcwallet; + defineGetters(wallets); + wallets.for = function (...ns) { + const names = Array.from(new Set(ns)); + return defineGetters( + names.map(name => wallets.filter(wallet => wallet.walletInfo.name.startsWith(name))).flat(), + ); + }; + wallets.not = function (...ns) { + const names = Array.from(new Set(ns)); + return defineGetters( + wallets.filter(wallet => !names.some(name => wallet.walletInfo.name.startsWith(name))), + ); + }; + return wallets; +} +exports.createAllWalletList = createAllWalletList; +exports.wallets = createAllWalletList([ + ...exports.keplr, + ...exports.leap, + ...exports.ledger, + ...exports.okxwallet, + ...exports.station, + ...exports.trust, + ...exports.cosmostation, + ...exports.xdefi, + ...exports.vectis, + ...exports.frontier, + ...exports.fin, + ...exports.omni, + ...exports.coin98, + ...exports.compass, + ...exports.exodus, + ...exports.tailwind, + ...exports.owallet, + // ...exports.galaxystation, + ...exports.cdcwallet, +]); diff --git a/packages/tmp-cosmos-kit/esm/index.d.ts b/packages/tmp-cosmos-kit/esm/index.d.ts new file mode 100644 index 000000000..14c234989 --- /dev/null +++ b/packages/tmp-cosmos-kit/esm/index.d.ts @@ -0,0 +1,4 @@ +export { wallets } from './wallets'; +import { ChainName, ChainWalletBase, SignerOptions, WalletModalProps, WalletStatus } from '@cosmos-kit/core'; +export { WalletStatus, ChainWalletBase }; +export type { ChainName, SignerOptions, WalletModalProps, }; diff --git a/packages/tmp-cosmos-kit/esm/index.js b/packages/tmp-cosmos-kit/esm/index.js new file mode 100644 index 000000000..075041756 --- /dev/null +++ b/packages/tmp-cosmos-kit/esm/index.js @@ -0,0 +1,3 @@ +export { wallets } from './wallets'; +import { ChainWalletBase, WalletStatus, } from '@cosmos-kit/core'; +export { WalletStatus, ChainWalletBase }; diff --git a/packages/tmp-cosmos-kit/esm/wallets.d.ts b/packages/tmp-cosmos-kit/esm/wallets.d.ts new file mode 100644 index 000000000..0d74affbd --- /dev/null +++ b/packages/tmp-cosmos-kit/esm/wallets.d.ts @@ -0,0 +1,57 @@ +import { MainWalletBase } from '@cosmos-kit/core'; +export declare type WalletName = 'keplr' | 'cosmostation' | 'ledger' | 'okxwallet' | 'station' | 'leap' | 'trust' | 'xdefi' | 'vectis' | 'frontier' | 'fin' | 'omni' | 'coin98' | 'shell' | 'compass' | 'tailwind' | 'owallet' | 'exodus' | 'galaxystation' | 'cdcwallet'; +export declare type WalletList = (E extends MainWalletBase ? M extends MainWalletBase ? [E, M] : [E] : M extends MainWalletBase ? [M] : []) & { + mobile: M | null; + extension: E | null; +}; +export declare function createWalletList(extension: ExtensionWallet | null, mobile: MobileWallet | null, snap?: MetaMaskSnap): WalletList; +export declare const keplr: WalletList; +export declare const cosmostation: WalletList; +export declare const ledger: import("@cosmos-kit/ledger/cjs/web-usb-hid").LedgerMainWallet[]; +export declare const leap: WalletList; +export declare const station: WalletList; +export declare const okxwallet: WalletList; +export declare const trust: WalletList; +export declare const xdefi: WalletList; +export declare const vectis: WalletList; +export declare const frontier: WalletList; +export declare const fin: WalletList; +export declare const omni: WalletList; +export declare const shell: WalletList; +export declare const coin98: WalletList; +export declare const compass: WalletList; +export declare const exodus: WalletList; +export declare const tailwind: WalletList; +export declare const owallet: WalletList; +export declare const galaxystation: WalletList; +export declare const cdcwallet: WalletList; +export declare type SubWalletList = MainWalletBase[] & { + get mobile(): MainWalletBase[]; + get extension(): MainWalletBase[]; +}; +export declare type AllWalletList = SubWalletList & { + keplr: typeof keplr; + cosmostation: typeof cosmostation; + ledger: typeof ledger; + okxwallet: typeof okxwallet; + station: typeof station; + leap: typeof leap; + trust: typeof trust; + xdefi: typeof xdefi; + vectis: typeof vectis; + frontier: typeof frontier; + fin: typeof fin; + omni: typeof omni; + coin98: typeof coin98; + compass: typeof compass; + exodus: typeof exodus; + tailwind: typeof tailwind; + owallet: typeof owallet; + galaxystation: typeof owallet; + cdcwallet: typeof cdcwallet; + for: (...names: WalletName[]) => SubWalletList; + not: (...names: WalletName[]) => SubWalletList; +}; +export declare function defineGetters(wallets: MainWalletBase[]): SubWalletList; +export declare function createAllWalletList(ws: MainWalletBase[]): AllWalletList; +export declare const wallets: AllWalletList; diff --git a/packages/tmp-cosmos-kit/esm/wallets.js b/packages/tmp-cosmos-kit/esm/wallets.js new file mode 100644 index 000000000..333adf93f --- /dev/null +++ b/packages/tmp-cosmos-kit/esm/wallets.js @@ -0,0 +1,120 @@ +import { wallets as coin98Extension } from '@cosmos-kit/coin98-extension'; +import { wallets as compassExtension } from '@cosmos-kit/compass-extension'; +import { wallets as okxwalletExtension } from '@cosmos-kit/okxwallet-extension'; +import { wallets as cosmostationExtension } from '@cosmos-kit/cosmostation-extension'; +import { wallets as cosmostationMobile } from '@cosmos-kit/cosmostation-mobile'; +import { wallets as frontierExtension } from '@cosmos-kit/frontier-extension'; +import { wallets as keplrExtension } from '@cosmos-kit/keplr-extension'; +import { wallets as keplrMobile } from '@cosmos-kit/keplr-mobile'; +import { wallets as owalletExtension } from '@cosmos-kit/owallet-extension'; +import { wallets as leapExtension } from '@cosmos-kit/leap-extension'; +import { wallets as leapMobile } from '@cosmos-kit/leap-mobile'; +import { wallets as leapMetamaskCosmosSnap } from '@cosmos-kit/leap-metamask-cosmos-snap'; +import { wallets as ledgerUSB } from '@cosmos-kit/ledger'; +import { wallets as omniMobile } from '@cosmos-kit/omni-mobile'; +import { wallets as finExtension } from '@cosmos-kit/fin-extension'; +import { wallets as stationExtension } from '@cosmos-kit/station-extension'; +import { wallets as trustExtension } from '@cosmos-kit/trust-extension'; +import { wallets as trustMobile } from '@cosmos-kit/trust-mobile'; +import { wallets as shellExtension } from '@cosmos-kit/shell-extension'; +import { wallets as vectisExtension } from '@cosmos-kit/vectis-extension'; +import { wallets as xdefiExtension } from '@cosmos-kit/xdefi-extension'; +import { wallets as exodusExtension } from '@cosmos-kit/exodus-extension'; +import { wallets as tailwindWallet } from '@cosmos-kit/tailwind'; +import { wallets as galaxyStationExtension } from '@cosmos-kit/galaxy-station-extension'; +import { wallets as cdcwalletExtension } from '@cosmos-kit/cdcwallet-extension'; +export function createWalletList(extension, mobile, snap) { + const list = [extension, mobile, snap].filter((wallet) => Boolean(wallet)); + list.mobile = mobile; + list.extension = extension; + return list; +} +export const keplr = createWalletList(keplrExtension[0], keplrMobile[0]); +export const cosmostation = createWalletList(cosmostationExtension[0], cosmostationMobile[0]); +export const ledger = ledgerUSB; +export const leap = createWalletList(leapExtension[0], leapMobile[0], leapMetamaskCosmosSnap[0]); +export const station = createWalletList(stationExtension[0], null); +export const okxwallet = createWalletList(okxwalletExtension[0], null); +export const trust = createWalletList(trustExtension[0], trustMobile[0]); +export const xdefi = createWalletList(xdefiExtension[0], null); +export const vectis = createWalletList(vectisExtension[0], null); +export const frontier = createWalletList(frontierExtension[0], null); +export const fin = createWalletList(finExtension[0], null); +export const omni = createWalletList(null, omniMobile[0]); +export const shell = createWalletList(shellExtension[0], null); +export const coin98 = createWalletList(coin98Extension[0], null); +export const compass = createWalletList(compassExtension[0], null); +export const exodus = createWalletList(exodusExtension[0], null); +export const tailwind = createWalletList(tailwindWallet[0], null); +export const owallet = createWalletList(owalletExtension[0], null); +export const galaxystation = createWalletList(galaxyStationExtension[0], null); +export const cdcwallet = createWalletList(cdcwalletExtension[0], null); +export function defineGetters(wallets) { + return Object.defineProperties(wallets, { + mobile: { + get() { + return this.filter((wallet) => wallet.isModeWalletConnect); + }, + }, + extension: { + get() { + return this.filter((wallet) => wallet.isModeExtension); + }, + }, + }); +} +export function createAllWalletList(ws) { + const wallets = ws.slice(); + wallets.keplr = keplr; + wallets.cosmostation = cosmostation; + wallets.ledger = ledger; + wallets.okxwallet = okxwallet; + wallets.station = station; + wallets.leap = leap; + wallets.trust = trust; + wallets.xdefi = xdefi; + wallets.vectis = vectis; + wallets.frontier = frontier; + wallets.fin = fin; + wallets.omni = omni; + wallets.coin98 = coin98; + wallets.compass = compass; + wallets.exodus = exodus; + wallets.tailwind = tailwind; + wallets.owallet = owallet; + wallets.galaxystation = galaxystation; + wallets.cdcwallet = cdcwallet; + defineGetters(wallets); + wallets.for = function (...ns) { + const names = Array.from(new Set(ns)); + return defineGetters(names + .map((name) => wallets.filter((wallet) => wallet.walletInfo.name.startsWith(name))) + .flat()); + }; + wallets.not = function (...ns) { + const names = Array.from(new Set(ns)); + return defineGetters(wallets.filter((wallet) => !names.some((name) => wallet.walletInfo.name.startsWith(name)))); + }; + return wallets; +} +export const wallets = createAllWalletList([ + ...keplr, + ...leap, + ...ledger, + ...okxwallet, + ...station, + ...trust, + ...cosmostation, + ...xdefi, + ...vectis, + ...frontier, + ...fin, + ...omni, + ...coin98, + ...compass, + ...exodus, + ...tailwind, + ...owallet, + ...galaxystation, + ...cdcwallet, +]); diff --git a/packages/tmp-cosmos-kit/package.json b/packages/tmp-cosmos-kit/package.json new file mode 100644 index 000000000..a02c706e3 --- /dev/null +++ b/packages/tmp-cosmos-kit/package.json @@ -0,0 +1,95 @@ +{ + "name": "@penumbra-zone/tmp-cosmos-kit", + "version": "2.21.1-penumbra-patch", + "description": "cosmos-kit wallet connector", + "author": "developers@cosmology.zone", + "contributors": [ + { + "name": "Jun Liu" + }, + { + "name": "Tom Wang" + }, + { + "name": "Dan Lynch" + }, + { + "name": "Noah Saso" + }, + { + "name": "Eliot Baker" + }, + { + "name": "Delivan Jeonghyeok Yoo" + } + ], + "homepage": "https://github.com/cosmology-tech/cosmos-kit#readme", + "license": "SEE LICENSE IN LICENSE", + "main": "cjs/index.js", + "module": "esm/index.js", + "types": "cjs/index.d.ts", + "directories": { + "lib": "src", + "test": "test" + }, + "files": [ + "cjs", + "esm", + "!CHANGELOG.md", + "!LICENSE" + ], + "scripts": { + "build:cjs": "yarn tsc -p tsconfig.json --outDir cjs --module commonjs || true", + "build:esm": "yarn tsc -p tsconfig.json --outDir esm --module es2022 || true", + "clean:cjs": "rimraf cjs", + "clean:esm": "rimraf esm", + "clean": "npm run clean:cjs && npm run clean:esm", + "build": "npm run clean && npm run build:cjs && npm run build:esm", + "prepare": "npm run build", + "lint": "eslint --ext .tsx,.ts .", + "format": "eslint --ext .tsx,.ts --fix .", + "test": "jest", + "test:watch": "jest --watch", + "test:debug": "node --inspect node_modules/.bin/jest --runInBand" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/cosmology-tech/cosmos-kit" + }, + "keywords": [ + "cosmos-kit", + "cosmos", + "keplr", + "leap", + "cosmostation", + "wallet" + ], + "bugs": { + "url": "https://github.com/cosmology-tech/cosmos-kit/issues" + }, + "dependencies": { + "@cosmos-kit/cdcwallet": "^2.15.1", + "@cosmos-kit/coin98": "^2.13.1", + "@cosmos-kit/compass": "^2.13.1", + "@cosmos-kit/cosmostation": "^2.14.0", + "@cosmos-kit/exodus": "^2.12.0", + "@cosmos-kit/fin": "^2.13.1", + "@cosmos-kit/frontier": "^2.12.0", + "@cosmos-kit/keplr": "^2.14.1", + "@cosmos-kit/leap": "^2.14.1", + "@cosmos-kit/ledger": "^2.13.0", + "@cosmos-kit/okxwallet-extension": "^2.13.0", + "@cosmos-kit/omni": "^2.12.0", + "@cosmos-kit/owallet": "^2.13.1", + "@cosmos-kit/shell": "^2.13.1", + "@cosmos-kit/station": "^2.12.0", + "@cosmos-kit/tailwind": "^1.7.0", + "@cosmos-kit/trust": "^2.13.0", + "@cosmos-kit/vectis": "^2.13.1", + "@cosmos-kit/xdefi": "^2.12.0" + }, + "gitHead": "9eae4d77b4e4492009bf8cde92beb07eb97e2d03" +}