@reef-knot/wallet-adapter-coinbase-smart-wallet 3.2.0 → 4.0.0-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.
@@ -0,0 +1,53 @@
1
+ import * as React from "react";
2
+ import { memo } from "react";
3
+
4
+ //#region src/icons/coinbase.svg
5
+ var _circle, _path, _rect, _defs;
6
+ function _extends() {
7
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
8
+ for (var e = 1; e < arguments.length; e++) {
9
+ var t = arguments[e];
10
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
11
+ }
12
+ return n;
13
+ }, _extends.apply(null, arguments);
14
+ }
15
+ var Memo = /* @__PURE__ */ memo(function SvgCoinbase(props) {
16
+ return /* @__PURE__ */ React.createElement("svg", _extends({
17
+ width: 40,
18
+ height: 40,
19
+ viewBox: "0 0 40 40",
20
+ fill: "none",
21
+ xmlns: "http://www.w3.org/2000/svg"
22
+ }, props), _circle || (_circle = /* @__PURE__ */ React.createElement("circle", {
23
+ cx: 20,
24
+ cy: 20,
25
+ r: 15,
26
+ fill: "#fff"
27
+ })), _path || (_path = /* @__PURE__ */ React.createElement("path", {
28
+ fillRule: "evenodd",
29
+ clipRule: "evenodd",
30
+ d: "M20 40c11.046 0 20-8.954 20-20S31.046 0 20 0 0 8.954 0 20s8.954 20 20 20zm0-8c6.627 0 12-5.373 12-12S26.627 8 20 8 8 13.373 8 20s5.373 12 12 12z",
31
+ fill: "url(#a)"
32
+ })), _rect || (_rect = /* @__PURE__ */ React.createElement("rect", {
33
+ x: 16,
34
+ y: 16,
35
+ width: 8,
36
+ height: 8,
37
+ rx: 1,
38
+ fill: "#2952EA"
39
+ })), _defs || (_defs = /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", {
40
+ id: "a",
41
+ x1: 20,
42
+ y1: 0,
43
+ x2: 20,
44
+ y2: 40,
45
+ gradientUnits: "userSpaceOnUse"
46
+ }, /* @__PURE__ */ React.createElement("stop", { stopColor: "#345FF8" }), /* @__PURE__ */ React.createElement("stop", {
47
+ offset: 1,
48
+ stopColor: "#1D44DC"
49
+ })))));
50
+ });
51
+
52
+ //#endregion
53
+ export { Memo as default };
@@ -0,0 +1 @@
1
+ import Memo from "./coinbase.js";
package/dist/index.d.ts CHANGED
@@ -9,55 +9,27 @@ export declare const getCoinbaseSmartWalletConnector: (config: ConfigType) => {
9
9
  icon?: string | undefined;
10
10
  id: string;
11
11
  rdns?: string | readonly string[] | undefined;
12
- supportsSimulation?: boolean | undefined;
13
12
  type: string;
14
13
  setup?: (() => Promise<void>) | undefined;
15
- connect: (parameters?: {
14
+ connect: (<withCapabilities extends boolean = false>(parameters?: {
16
15
  chainId?: number | undefined;
17
16
  isReconnecting?: boolean | undefined;
17
+ withCapabilities?: withCapabilities | boolean | undefined;
18
18
  } | undefined) => Promise<{
19
- accounts: readonly import("abitype").Address[];
19
+ accounts: withCapabilities extends true ? readonly {
20
+ address: import("abitype").Address;
21
+ capabilities: Record<string, unknown>;
22
+ }[] : readonly import("abitype").Address[];
20
23
  chainId: number;
21
- }>;
22
- disconnect: () => Promise<void>;
23
- getAccounts: () => Promise<readonly import("abitype").Address[]>;
24
- getChainId: () => Promise<number>;
25
- getProvider: (parameters?: {
26
- chainId?: number | undefined;
27
- } | undefined) => Promise<import("cbw-sdk").CoinbaseWalletProvider>;
28
- getClient?: ((parameters?: {
29
- chainId?: number | undefined;
30
- } | undefined) => Promise<import("viem").Client>) | undefined;
31
- isAuthorized: () => Promise<boolean>;
32
- switchChain?: ((parameters: import("@wagmi/core/internal").Compute<{
33
- addEthereumChainParameter?: import("@wagmi/core/internal").ExactPartial<import("@wagmi/core/internal").Omit<import("viem").AddEthereumChainParameter, "chainId">> | undefined;
34
- chainId: number;
35
- }>) => Promise<import("viem").Chain>) | undefined;
36
- onAccountsChanged: (accounts: string[]) => void;
37
- onChainChanged: (chainId: string) => void;
38
- onConnect?: ((connectInfo: import("viem").ProviderConnectInfo) => void) | undefined;
39
- onDisconnect: (error?: Error | undefined) => void;
40
- onMessage?: ((message: import("viem").ProviderMessage) => void) | undefined;
41
- } | {
42
- name: string;
43
- icon?: string | undefined;
44
- id: string;
45
- rdns?: string | readonly string[] | undefined;
46
- supportsSimulation?: boolean | undefined;
47
- type: string;
48
- setup?: (() => Promise<void>) | undefined;
49
- connect: ((parameters?: {
50
- chainId?: number | undefined;
51
- isReconnecting?: boolean | undefined;
52
- } | undefined) => Promise<{
53
- accounts: readonly import("abitype").Address[];
54
- chainId: number;
55
- }>) & ((parameters?: {
24
+ }>) & (<withCapabilities extends boolean = false>(parameters?: {
56
25
  chainId?: number | undefined;
57
26
  instantOnboarding?: boolean | undefined;
58
27
  isReconnecting?: boolean | undefined;
28
+ withCapabilities?: withCapabilities | boolean | undefined;
59
29
  }) => Promise<{
60
- accounts: readonly import("abitype").Address[];
30
+ accounts: withCapabilities extends true ? readonly {
31
+ address: import("abitype").Address;
32
+ }[] : readonly import("abitype").Address[];
61
33
  chainId: number;
62
34
  }>);
63
35
  disconnect: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,eAAO,MAAM,EAAE,wBAAwB,CAAC;AACxC,eAAO,MAAM,IAAI,0BAA0B,CAAC;AAC5C,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C,KAAK,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnE,eAAO,MAAM,+BAA+B,WAAY,UAAU;;;;;;;;;eAsByW,CAAC;sBAA4C,CAAC;;;;;;;;;eAA8R,CAAC;;;eAA0G,CAAC;;;;iCAAyK,CAAC;;;;;;;;;;;;;;;;;eAAlmB,CAAC;sBAA4C,CAAC;;;;;eAA4M,CAAC;yBAA+C,CAAC;sBAA6C,CAAC;;;;;;;;;eAAb,CAAC;;;;;eAA0G,CAAC;;;;iCAAyK,CAAC;;;;;;;;CAV5gC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAOhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,eAAO,MAAM,EAAE,wBAAwB,CAAC;AACxC,eAAO,MAAM,IAAI,0BAA0B,CAAC;AAC5C,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C,KAAK,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnE,eAAO,MAAM,+BAA+B,WAAY,UAAU;;;;;;;;eAsBwT,CAAC;sBAA4C,CAAC;wBAA+C,CAAC;;;;;;;;eApB9a,CAAC;yBACD,CAAC;sBAGd,CAAC;wBAG1B,CAAD;;;;;;;;;;;eAag5B,CAAC;;;;;eAA0G,CAAC;;;;iCAAyK,CAAC;;;;;;;;CAVxqC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAOhC,CAAC"}
package/dist/index.js CHANGED
@@ -1,30 +1,29 @@
1
- import { coinbaseWallet } from 'wagmi/connectors';
2
- import { isProviderExistsEIP6963 } from '@reef-knot/wallets-helpers';
3
- import Memo from './icons/coinbase.svg.js';
1
+ import Memo from "./icons/coinbase.js";
2
+ import "./icons/index.js";
3
+ import { coinbaseWallet } from "wagmi/connectors";
4
+ import { isProviderExistsEIP6963 } from "@reef-knot/wallets-helpers";
4
5
 
5
- const id = 'coinbaseSmartWallet';
6
- const name = 'Coinbase Smart Wallet';
7
- const rdns = 'com.coinbase.wallet';
8
- const getCoinbaseSmartWalletConnector = config => {
9
- var _a, _b;
10
- const coinbaseCreateConnectorFn = coinbaseWallet({
11
- preference: 'smartWalletOnly',
12
- appName: (_b = (_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.location) === null || _b === void 0 ? void 0 : _b.hostname
13
- });
14
- const coinbaseConnector = coinbaseCreateConnectorFn(config);
15
- return Object.assign(Object.assign({}, coinbaseConnector), {
16
- name
17
- });
6
+ //#region src/index.ts
7
+ const id = "coinbaseSmartWallet";
8
+ const name = "Coinbase Smart Wallet";
9
+ const rdns = "com.coinbase.wallet";
10
+ const getCoinbaseSmartWalletConnector = (config) => {
11
+ return {
12
+ ...coinbaseWallet({
13
+ preference: { options: "smartWalletOnly" },
14
+ appName: globalThis.window?.location?.hostname
15
+ })(config),
16
+ name
17
+ };
18
18
  };
19
- const CoinbaseSmartWallet = ({
20
- providersStore
21
- }) => ({
22
- walletName: name,
23
- walletId: id,
24
- type: coinbaseWallet.type,
25
- icon: Memo,
26
- detector: () => isProviderExistsEIP6963(providersStore, rdns),
27
- createConnectorFn: getCoinbaseSmartWalletConnector
19
+ const CoinbaseSmartWallet = ({ providersStore }) => ({
20
+ walletName: name,
21
+ walletId: id,
22
+ type: coinbaseWallet.type,
23
+ icon: Memo,
24
+ detector: () => isProviderExistsEIP6963(providersStore, rdns),
25
+ createConnectorFn: getCoinbaseSmartWalletConnector
28
26
  });
29
27
 
30
- export { CoinbaseSmartWallet, getCoinbaseSmartWalletConnector, id, name, rdns };
28
+ //#endregion
29
+ export { CoinbaseSmartWallet, getCoinbaseSmartWalletConnector, id, name, rdns };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/wallet-adapter-coinbase-smart-wallet",
3
- "version": "3.2.0",
3
+ "version": "4.0.0-alpha.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "https://github.com/lidofinance/reef-knot.git",
27
+ "url": "git+https://github.com/lidofinance/reef-knot.git",
28
28
  "directory": "packages/wallets/coinbase-smart-wallet"
29
29
  },
30
30
  "publishConfig": {
@@ -32,18 +32,21 @@
32
32
  "access": "public"
33
33
  },
34
34
  "scripts": {
35
- "build": "rollup -c",
36
- "dev": "dev=on rollup -c -w",
37
- "lint": "eslint --ext ts,tsx,js,mjs ."
35
+ "build": "yarn run -T tsdown",
36
+ "dev": "yarn run -T tsdown --watch",
37
+ "lint": "eslint --ext ts,tsx,js,mjs .",
38
+ "typecheck": "tsc --noEmit"
38
39
  },
39
40
  "devDependencies": {
40
- "@reef-knot/types": "4.2.0",
41
- "@svgr/rollup": "^6.5.1",
41
+ "@reef-knot/types": "5.0.0-alpha.2",
42
+ "@reef-knot/wallets-helpers": "3.0.0-alpha.2",
43
+ "build-config": "*",
42
44
  "eslint-config-custom": "*"
43
45
  },
44
46
  "peerDependencies": {
45
- "@reef-knot/types": "4.2.0",
47
+ "@reef-knot/types": "5.0.0-alpha.2",
48
+ "@reef-knot/wallets-helpers": "3.0.0-alpha.2",
46
49
  "@tanstack/react-query": "^5.29.0",
47
- "wagmi": ">=2.14"
50
+ "wagmi": ">=3.3"
48
51
  }
49
52
  }
@@ -1,54 +0,0 @@
1
- import * as React from 'react';
2
- import { memo } from 'react';
3
-
4
- var _circle, _path, _rect, _defs;
5
- function _extends() {
6
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
7
- for (var e = 1; e < arguments.length; e++) {
8
- var t = arguments[e];
9
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
10
- }
11
- return n;
12
- }, _extends.apply(null, arguments);
13
- }
14
- var SvgCoinbase = function SvgCoinbase(props) {
15
- return /*#__PURE__*/React.createElement("svg", _extends({
16
- width: 40,
17
- height: 40,
18
- viewBox: "0 0 40 40",
19
- fill: "none",
20
- xmlns: "http://www.w3.org/2000/svg"
21
- }, props), _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
22
- cx: 20,
23
- cy: 20,
24
- r: 15,
25
- fill: "#fff"
26
- })), _path || (_path = /*#__PURE__*/React.createElement("path", {
27
- fillRule: "evenodd",
28
- clipRule: "evenodd",
29
- d: "M20 40c11.046 0 20-8.954 20-20S31.046 0 20 0 0 8.954 0 20s8.954 20 20 20zm0-8c6.627 0 12-5.373 12-12S26.627 8 20 8 8 13.373 8 20s5.373 12 12 12z",
30
- fill: "url(#a)"
31
- })), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
32
- x: 16,
33
- y: 16,
34
- width: 8,
35
- height: 8,
36
- rx: 1,
37
- fill: "#2952EA"
38
- })), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
39
- id: "a",
40
- x1: 20,
41
- y1: 0,
42
- x2: 20,
43
- y2: 40,
44
- gradientUnits: "userSpaceOnUse"
45
- }, /*#__PURE__*/React.createElement("stop", {
46
- stopColor: "#345FF8"
47
- }), /*#__PURE__*/React.createElement("stop", {
48
- offset: 1,
49
- stopColor: "#1D44DC"
50
- })))));
51
- };
52
- var Memo = /*#__PURE__*/memo(SvgCoinbase);
53
-
54
- export { Memo as default };