From 1e6a6895f7ef990f567a379d9b09410e5571c8b4 Mon Sep 17 00:00:00 2001 From: circle-github-action-bot Date: Thu, 16 Jan 2025 20:55:29 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20synced=20file(s)=20with=20circle?= =?UTF-8?q?fin/modularwallets-web-sdk-internal=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit synced local file(s) with [circlefin/modularwallets-web-sdk-internal](https://github.com/circlefin/modularwallets-web-sdk-internal).
Changed files
--- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#12821088094](https://github.com/circlefin/modularwallets-web-sdk-internal/actions/runs/12821088094) --- examples/circle-smart-account/index.tsx | 2 +- examples/circle-smart-account/package.json | 2 +- examples/modular-wallets-provider/index.ts | 2 +- .../modular-wallets-provider/package.json | 2 +- packages/w3s-web-core-sdk/README.md | 25 +++++++++++++- packages/w3s-web-core-sdk/package.json | 4 ++- .../src/accounts/toWebAuthnCredential.ts | 8 ++--- packages/w3s-web-core-sdk/src/index.ts | 34 +++++++++++++++---- yarn.lock | 18 +++++----- 9 files changed, 72 insertions(+), 25 deletions(-) diff --git a/examples/circle-smart-account/index.tsx b/examples/circle-smart-account/index.tsx index 44a6d73..69b26a1 100644 --- a/examples/circle-smart-account/index.tsx +++ b/examples/circle-smart-account/index.tsx @@ -16,7 +16,7 @@ import { toModularTransport, toPasskeyTransport, toWebAuthnCredential, -} from 'w3s-web-core-sdk' +} from '@circle-fin/modular-wallets-core' const clientKey = import.meta.env.VITE_CLIENT_KEY as string const clientUrl = import.meta.env.VITE_CLIENT_URL as string diff --git a/examples/circle-smart-account/package.json b/examples/circle-smart-account/package.json index 70d31bf..7aa877b 100644 --- a/examples/circle-smart-account/package.json +++ b/examples/circle-smart-account/package.json @@ -10,7 +10,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "viem": "^2.21.27", - "w3s-web-core-sdk": "file:../../packages/w3s-web-core-sdk" + "@circle-fin/modular-wallets-core": "^1.0.0" }, "devDependencies": { "@types/react": "^18.0.27", diff --git a/examples/modular-wallets-provider/index.ts b/examples/modular-wallets-provider/index.ts index 26f406c..07b73dd 100644 --- a/examples/modular-wallets-provider/index.ts +++ b/examples/modular-wallets-provider/index.ts @@ -1,6 +1,6 @@ import { publicActions } from "viem" import { createBundlerClient } from "viem/account-abstraction" -import { toModularTransport } from "w3s-web-core-sdk" +import { toModularTransport } from "@circle-fin/modular-wallets-core" const transport = toModularTransport("", "") diff --git a/examples/modular-wallets-provider/package.json b/examples/modular-wallets-provider/package.json index ce990c6..8107163 100644 --- a/examples/modular-wallets-provider/package.json +++ b/examples/modular-wallets-provider/package.json @@ -3,6 +3,6 @@ "version": "0.0.0", "private": true, "dependencies": { - "w3s-web-core-sdk": "file:../../packages/w3s-web-core-sdk" + "@circle-fin/modular-wallets-core": "^1.0.0" } } diff --git a/packages/w3s-web-core-sdk/README.md b/packages/w3s-web-core-sdk/README.md index 24ec8b7..0e5561f 100644 --- a/packages/w3s-web-core-sdk/README.md +++ b/packages/w3s-web-core-sdk/README.md @@ -1 +1,24 @@ -# W3S Web SDK Core Package +# Modular Wallets Web SDK + +## Overview + +Modular Wallets is a smart wallet solution built on top of Account Abstraction and adheres to the ERC-6900 and ERC-4337 standards. +The Web SDK implements [Viem](https://viem.sh/docs/clients/intro)’s interfaces, and allows you to build secure and scalable web applications using our robust [blockchain infrastructures](https://developers.circle.com/w3s/programmable-wallets-blockchain-infra), including Indexing Service and Gas Station. You can also leverage the advanced [Passkey](https://developers.circle.com/w3s/modular-wallets-passkey) technology for private key management. +Check out our [quickstart guide](https://developers.circle.com/w3s/modular-wallets-quickstart) to create your first Modular Wallet and send a gasless transaction. + +## Installation + +```bash +npm install @circle-fin/modular-wallets-core +``` + +## Documentation + +- [Modular Wallets SDKs](https://developers.circle.com/w3s/modular-wallets-sdks) +- [Web SDK API doc](https://developers.circle.com/w3s/modular-wallets-web-sdk) + +## Examples + +We've created some example apps in the [examples](https://github.com/circlefin/modularwallets-web-sdk/tree/master/examples) folder: + +- [circle-smart-account](https://github.com/circlefin/modularwallets-web-sdk/tree/master/examples/circle-smart-account) diff --git a/packages/w3s-web-core-sdk/package.json b/packages/w3s-web-core-sdk/package.json index 555cb19..753b0c4 100644 --- a/packages/w3s-web-core-sdk/package.json +++ b/packages/w3s-web-core-sdk/package.json @@ -1,11 +1,13 @@ { "name": "@circle-fin/modular-wallets-core", "description": "Serverless Typescript SDK", - "version": "1.0.0", + "version": "1.0.1", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "license": "Apache-2.0", + "homepage": "https://developers.circle.com/w3s/modular-wallets-web-sdk", + "repository": "circlefin/modularwallets-web-sdk", "files": [ "dist", "package.json", diff --git a/packages/w3s-web-core-sdk/src/accounts/toWebAuthnCredential.ts b/packages/w3s-web-core-sdk/src/accounts/toWebAuthnCredential.ts index f9c3fe1..e890878 100644 --- a/packages/w3s-web-core-sdk/src/accounts/toWebAuthnCredential.ts +++ b/packages/w3s-web-core-sdk/src/accounts/toWebAuthnCredential.ts @@ -65,7 +65,7 @@ export async function toWebAuthnCredential( * @param username - The username to use. * @returns A WebAuthn Credential. */ -export async function startRegistration( +async function startRegistration( client: RpClient, username: string | null = null, ): Promise { @@ -115,7 +115,7 @@ export async function startRegistration( * @param credentialId - The credential ID to use. * @returns A WebAuthn Credential. */ -export async function startAuthentication( +async function startAuthentication( client: RpClient, credentialId: string | null = null, ): Promise { @@ -161,7 +161,7 @@ export async function startAuthentication( * @param options - CustomPublicKeyCredentialCreationOptions instance. * @returns PublicKeyCredentialCreationOptions instance. */ -export function getCredentialCreationOptions( +function getCredentialCreationOptions( options: CustomPublicKeyCredentialCreationOptions, ): PublicKeyCredentialCreationOptions { return { @@ -179,7 +179,7 @@ export function getCredentialCreationOptions( * @param options - CustomPublicKeyCredentialRequestOptions instance. * @returns PublicKeyCredentialRequestOptions instance. */ -export function getCredentialRequestOptions( +function getCredentialRequestOptions( options: CustomPublicKeyCredentialRequestOptions, ): PublicKeyCredentialRequestOptions { return { diff --git a/packages/w3s-web-core-sdk/src/index.ts b/packages/w3s-web-core-sdk/src/index.ts index 5688085..28c509f 100644 --- a/packages/w3s-web-core-sdk/src/index.ts +++ b/packages/w3s-web-core-sdk/src/index.ts @@ -25,14 +25,34 @@ export * from './actions' // Clients export * from './clients' -// Constants -export * from './constants' - // Providers export * from './providers' // Types -export * from './types' - -// Utils -export * from './utils' +export { + WebAuthnMode, + type AuthenticatorAssertionResponse, + type AuthenticatorAttestationResponse, + type CircleSmartAccountImplementation, + type CreateCredentialParameters, + type CustomPublicKeyCredentialCreationOptions, + type CustomPublicKeyCredentialDescriptor, + type CustomPublicKeyCredentialRequestOptions, + type CustomPublicKeyCredentialUserEntity, + type GetAddressReturnType, + type GetAddressRpcSchema, + type GetLoginOptionsReturnType, + type GetLoginOptionsRpcSchema, + type GetLoginVerificationReturnType, + type GetLoginVerificationRpcSchema, + type GetRegistrationOptionsReturnType, + type GetRegistrationOptionsRpcSchema, + type GetRegistrationVerificationReturnType, + type GetRegistrationVerificationRpcSchema, + type ModularWalletRpcSchema, + type RpRpcSchema, + type ToCircleSmartAccountParameters, + type ToCircleSmartAccountReturnType, + type ToWebAuthnAccountParameters, + type WebAuthnCredential, +} from './types' diff --git a/yarn.lock b/yarn.lock index 1f14cf2..fc0ed32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -449,6 +449,16 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@circle-fin/modular-wallets-core@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@circle-fin/modular-wallets-core/-/modular-wallets-core-1.0.0.tgz#253aeb0a3a2c82bede85fb4cb1445ef4347e9d1a" + integrity sha512-fNbJpxVC2dsTbvxfSjHPYbnEY3ZxDI/gOUDhuXHaWG/17rePPnFN/ULuECAdo3L60DuL58CD7peYZh+QP7dGrQ== + dependencies: + uuid "^11.0.3" + viem "^2.21.27" + web3 "^4.13.0" + webauthn-p256 "0.0.5" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -5406,14 +5416,6 @@ w3c-xmlserializer@^4.0.0: dependencies: xml-name-validator "^4.0.0" -"w3s-web-core-sdk@file:packages/w3s-web-core-sdk": - version "1.0.0" - dependencies: - uuid "^11.0.3" - viem "^2.21.27" - web3 "^4.13.0" - webauthn-p256 "0.0.5" - walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f"