Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"strictNullChecks": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"include": ["src/**/*"]
}
3 changes: 2 additions & 1 deletion packages/ccc/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"strictNullChecks": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"include": ["src/**/*"]
}
3 changes: 2 additions & 1 deletion packages/ckb-ccc/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"strictNullChecks": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"include": ["src/**/*"]
}
3 changes: 3 additions & 0 deletions packages/connector-react/src/hooks/useCcc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function Provider({
name,
icon,
signerFilter,
client: clientArg,
}: {
children: React.ReactNode;
connectorProps?: React.HTMLAttributes<{}>;
Expand All @@ -29,6 +30,7 @@ export function Provider({
signerInfo: ccc.SignerInfo,
wallet: ccc.Wallet,
) => Promise<boolean>;
client?: ccc.Client;
}) {
const [ref, setRef] = useState<WebComponentConnector | null>(null);
const [_, setFlag] = useState(0);
Expand Down Expand Up @@ -71,6 +73,7 @@ export function Provider({
...connectorProps?.style,
zIndex: connectorProps?.style?.zIndex ?? 999,
},
...(clientArg ? { client: clientArg } : {}),
}}
/>
{children}
Expand Down
3 changes: 2 additions & 1 deletion packages/connector-react/src/hooks/useSigner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ccc } from "..";
import { useCcc } from "./useCcc";

export function useSigner() {
export function useSigner(): ccc.Signer | undefined {
return useCcc().signerInfo?.signer;
}
3 changes: 2 additions & 1 deletion packages/connector-react/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"strictNullChecks": true,
"alwaysStrict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"include": ["src/**/*"]
}
5 changes: 5 additions & 0 deletions packages/connector/src/assets/chains/ckb.sm.svg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { encodeSvgToImgSrc } from "../utils";

export const CKB_SM_SVG = encodeSvgToImgSrc(
'<svg width="19" height="18" viewBox="0 0 19 18" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_221_415)"><path d="M0.666992 9C0.666992 11.3869 1.6152 13.6761 3.30303 15.364C4.99086 17.0518 7.28004 18 9.66699 18C12.0539 18 14.3431 17.0518 16.031 15.364C17.7188 13.6761 18.667 11.3869 18.667 9C18.667 6.61305 17.7188 4.32387 16.031 2.63604C14.3431 0.948212 12.0539 0 9.66699 0C7.28004 0 4.99086 0.948212 3.30303 2.63604C1.6152 4.32387 0.666992 6.61305 0.666992 9Z" fill="#333333"/><path d="M5.51318 4.84619V12.9231H7.60395V8.52235H9.20549L5.51318 4.84619Z" fill="white"/><path d="M11.73 4.84619V9.24696H10.1284L13.8207 12.9231V4.84619H11.73Z" fill="white"/></g><defs><clipPath id="clip0_221_415"><rect width="18" height="18" fill="white" transform="translate(0.666992)"/></clipPath></defs></svg>',
);
5 changes: 5 additions & 0 deletions packages/connector/src/assets/copy.svg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { encodeSvgToImgSrc } from "./utils";

export const COPY_SVG = encodeSvgToImgSrc(
'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19 13.5657V6.10526C19 5.49737 18.5091 5 17.9091 5H10.5454C9.94543 5 9.45452 5.49737 9.45452 6.10526V13.5657C9.45452 14.1736 9.94543 14.671 10.5454 14.671H17.9091C18.5091 14.671 19 14.1736 19 13.5657Z" fill="#999999"/><path d="M14.5455 15.8684H9.18183C8.58183 15.8684 8.09092 15.3711 8.09092 14.7632V9.329H6.09091C5.49091 9.329 5 9.82637 5 10.4343V17.8947C5 18.5026 5.49091 19 6.09091 19H13.4546C14.0546 19 14.5455 18.5026 14.5455 17.8947V15.8684Z" fill="#999999"/></svg>',
);
5 changes: 5 additions & 0 deletions packages/connector/src/assets/diconnect.svg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { encodeSvgToImgSrc } from "./utils";

export const DISCONNECT_SVG = encodeSvgToImgSrc(
'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect width="32" height="32" rx="8" fill="#DDDDDD"/><path d="M20.375 16.875H14.25V15.125H20.375L19.5 13.375H21.25L23 16L21.25 18.625H19.5L20.375 16.875ZM20.9509 11.051L19.7128 12.2886C19.226 11.8 18.6473 11.4125 18.0101 11.1484C17.3729 10.8844 16.6897 10.749 16 10.75C13.1006 10.75 10.75 13.1006 10.75 16C10.75 18.8994 13.1006 21.25 16 21.25C17.4107 21.25 18.7309 20.6923 19.71 19.7147L20.9462 20.9532C20.297 21.6031 19.5259 22.1184 18.6771 22.4696C17.8283 22.8209 16.9186 23.0011 16 23C12.1341 23 9 19.8659 9 16C9 12.1341 12.1341 9 16 9C17.8816 9 19.647 9.74667 20.9509 11.051Z" fill="#666666"/></svg>',
);
5 changes: 5 additions & 0 deletions packages/connector/src/assets/swap.svg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { encodeSvgToImgSrc } from "./utils";

export const SWAP_SVG = encodeSvgToImgSrc(
'<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.30688 5.22537L11.1669 3.36536L9.30688 1.50537" stroke="#666666" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/><path d="M2.16699 3.36523H11.167" stroke="#666666" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.02698 6.77539L2.16699 8.63541L4.02698 10.4954" stroke="#666666" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.167 8.63525H2.16699" stroke="#666666" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/></svg>',
);
Loading