Skip to content

Commit

Permalink
moved immutable to separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed Nov 18, 2024
1 parent b86b600 commit b4ae2e3
Show file tree
Hide file tree
Showing 16 changed files with 3,717 additions and 4,467 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": ["@changesets/changelog-github", { "repo": "0xsequence/kit" }],
"commit": false,
"linked": [],
"fixed": [["@0xsequence/kit", "@0xsequence/kit-checkout", "@0xsequence/kit-wallet"]],
"fixed": [["@0xsequence/kit", "@0xsequence/kit-checkout", "@0xsequence/kit-wallet", "@0xsequence/kit-immutable-connector"]],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
Expand Down
1 change: 1 addition & 0 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@0xsequence/kit-checkout": "workspace:*",
"@0xsequence/kit-wallet": "workspace:*",
"@0xsequence/kit-example-shared-components": "workspace:*",
"@0xsequence/kit-immutable-connector": "workspace:*",
"@tanstack/react-query": "^5.37.1",
"@0xsequence/network": "2.0.12",
"framer-motion": "^8.5.2",
Expand Down
10 changes: 8 additions & 2 deletions examples/react/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { KitConfig, createConfig, WalletType } from '@0xsequence/kit'
import { immutable } from '@0xsequence/kit-immutable-connector'
import { ChainId } from '@0xsequence/network'
import { zeroAddress } from 'viem'

Expand Down Expand Up @@ -76,7 +77,10 @@ export const config =
},
walletConnect: {
projectId: walletConnectProjectId
}
},
additionalWallets: [
immutable({})
]
})
: createConfig('universal', {
...kitConfig,
Expand All @@ -87,5 +91,7 @@ export const config =
walletConnect: {
projectId: walletConnectProjectId
},
immutable: {}
additionalWallets: [
immutable({})
]
})
13 changes: 13 additions & 0 deletions packages/immutable-connector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div align="center">
<img src="https://raw.githubusercontent.com/0xsequence/kit/master/public/docs/kit-logo-in-one.png">
</div>

# Immutable Connector for Sequence Kit 🧰

Connect an Immutable Passport wallet to Sequence Kit.

## LICENSE

Apache-2.0

Copyright (c) 2017-present Horizon Blockchain Games Inc. / https://horizon.io
55 changes: 55 additions & 0 deletions packages/immutable-connector/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@0xsequence/kit-immutable-connector",
"version": "4.4.4",
"description": "Immutable connector for Sequence Kit",
"keywords": [
"sequence",
"kit",
"wallet",
"immutable"
],
"repository": "https://github.com/0xsequence/kit/tree/master/packages/immutable-connector",
"author": "Horizon Blockchain Games",
"license": "Apache-2.0",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
"default": "./dist/esm/index.js"
},
"./styles.css": "./dist/styles.css"
},
"files": [
"src",
"dist"
],
"scripts": {
"build": "pnpm build:clean && pnpm build:esm && pnpm build:cjs && pnpm build:types",
"build:cjs": "tsc --module commonjs --outDir dist/cjs/",
"build:esm": "tsc --module es2022 --outDir dist/esm/",
"build:types": "tsc --declaration --declarationMap --emitDeclarationOnly --declarationDir dist/types/",
"build:clean": "rimraf -g ./dist",
"dev": "tsc --watch --module es2022 --declaration --declarationMap --outDir dist/esm/ --declarationDir dist/types/",
"test": "echo",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@imtbl/sdk": "^1.68.0"
},
"peerDependencies": {
"@0xsequence/kit": "workspace:*",
"viem": ">= 2.0.0",
"wagmi": ">= 2.0.0"
},
"devDependencies": {
"0xsequence": ">= 2.0.20",
"@0xsequence/kit": "workspace:*",
"ethers": "6.13.0",
"viem": "^2.12.0",
"wagmi": "^2.9.5"
}
}
1 change: 1 addition & 0 deletions packages/immutable-connector/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { immutable, type ImmutableOptions } from './kitConnector/immutable'
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'

import { LogoProps } from '../../types'
import { LogoProps } from '@0xsequence/kit'

export const ImmutableLogo: React.FunctionComponent = (props: LogoProps) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Wallet } from '../../types'
import { immutableConnector } from '../wagmiConnectors'
import type { Wallet } from '@0xsequence/kit'

import { ImmutableLogo } from './ImmutableLogo'
import { BaseImmutableConnectorOptions } from '../wagmiConnectors'

import { immutableConnector, type BaseImmutableConnectorOptions } from '../wagmiConnector'

export interface ImmutableOptions extends BaseImmutableConnectorOptions {}

Expand Down
20 changes: 20 additions & 0 deletions packages/immutable-connector/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"strict": true,
// "noUncheckedIndexedAccess": true,
"module": "ESNext",
"moduleResolution": "Node",
"sourceMap": true,
"declaration": false,
"lib": ["es2022", "dom", "dom.iterable"],
"jsx": "react-jsx"
},
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
}
1 change: 0 additions & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@0xsequence/provider": ">= 2.0.20",
"@0xsequence/utils": ">= 2.0.20",
"@0xsequence/waas": ">= 2.0.20",
"@imtbl/sdk": "^1.68.0",
"framer-motion": "^8.5.2",
"uuid": "^10.0.0"
},
Expand Down
15 changes: 10 additions & 5 deletions packages/kit/src/config/defaultConnectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { email } from '../connectors/email'
import { emailWaas } from '../connectors/email/emailWaas'
import { facebook } from '../connectors/facebook'
import { google } from '../connectors/google'
import { immutable, ImmutableOptions } from '../connectors/immutable'
import { googleWaas } from '../connectors/google/googleWaas'
import { sequence } from '../connectors/sequence'
import { twitch } from '../connectors/twitch'
Expand Down Expand Up @@ -45,6 +44,8 @@ export interface DefaultWaasConnectorOptions extends CommonConnectorOptions {
| {
projectId: string
}
additionalWallets?: Wallet[]


/**
* @deprecated use connectors.walletConnect.projectId instead
Expand Down Expand Up @@ -79,12 +80,11 @@ export interface DefaultUniversalConnectorOptions extends CommonConnectorOptions
| {
projectId: string
}
immutable?: ImmutableOptions

/**
* @deprecated, use connectors.walletConnect.projectId instead
*/
walletConnectProjectId?: string
additionalWallets?: Wallet[]
}

export type DefaultConnectorOptions<T extends WalletType> = T extends 'waas'
Expand Down Expand Up @@ -166,6 +166,11 @@ export const getDefaultWaasConnectors = (options: DefaultWaasConnectorOptions):
)
}


if (options?.additionalWallets && options?.additionalWallets.length > 0) {
wallets.push(...options.additionalWallets)
}

return getKitConnectWallets(projectAccessKey, wallets)
}

Expand Down Expand Up @@ -250,8 +255,8 @@ export const getDefaultUniversalConnectors = (options: DefaultUniversalConnector
)
}

if (options.immutable) {
wallets.push(immutable(options.immutable))
if (options?.additionalWallets && options?.additionalWallets.length > 0) {
wallets.push(...options.additionalWallets)
}

return getKitConnectWallets(projectAccessKey, wallets)
Expand Down
1 change: 0 additions & 1 deletion packages/kit/src/connectors/wagmiConnectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './sequenceConnector'
export * from './sequenceWaasConnector'
export * from './immutableConnector'
4 changes: 2 additions & 2 deletions packages/kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export type {
Theme,
ModalPosition,
KitConfig,
StorageItem
StorageItem,
LogoProps
} from './types'
export type { SwapPricesWithCurrencyInfo } from './hooks/data'

Expand Down Expand Up @@ -78,7 +79,6 @@ export {
type BaseSequenceConnectorOptions,
type BaseSequenceWaasConnectorOptions
} from './connectors/wagmiConnectors'
export { immutable, type ImmutableOptions } from './connectors/immutable'

// Hooks
export { useOpenConnectModal } from './hooks/useOpenConnectModal'
Expand Down
Loading

0 comments on commit b4ae2e3

Please sign in to comment.