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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Visit [UTXOS](https://utxos.dev/) for more information.

- **Multi-Chain Support**: Bitcoin, Cardano, and Spark blockchains
- **Developer-Controlled Wallets**: Manage wallets on behalf of users with secure backend integration
- **User-Controlled Wallets**: Non-custodial wallet solutions with OAuth integration (Google, Twitter, Discord, Apple)
- **User-Controlled Wallets**: Non-custodial wallet solutions with OAuth integration (Google, Twitter, Discord)
- **Transaction Sponsorship**: Sponsor transactions for gasless user experiences
- **Shard-Based Security**: Client-side key management with multi-shard encryption
- **TypeScript Native**: Full type safety and IntelliSense support
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Metadata } from "next";

export const metadata: Metadata = {
title: "UTXOS Wallet | Web3 Wallet as a Service",
description: "Connect your wallet with social login - Google, Discord, Twitter, Apple, Email",
description: "Connect your wallet with social login Google, Discord, Twitter, Email",
};

export default function RootLayout({
Expand Down
1 change: 0 additions & 1 deletion examples/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const PROVIDERS: { id: Web3AuthProvider; label: string; icon: string }[] = [
{ id: "google", label: "Google", icon: "G" },
{ id: "discord", label: "Discord", icon: "D" },
{ id: "twitter", label: "Twitter", icon: "X" },
{ id: "apple", label: "Apple", icon: "" },
{ id: "email", label: "Email", icon: "@" },
];

Expand Down
1 change: 0 additions & 1 deletion examples/react-native/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const PROVIDERS: { id: Web3AuthProvider; label: string; icon: string }[] = [
{ id: "google", label: "Google", icon: "G" },
{ id: "discord", label: "Discord", icon: "D" },
{ id: "twitter", label: "Twitter", icon: "X" },
{ id: "apple", label: "Apple", icon: "" },
{ id: "email", label: "Email", icon: "@" },
];

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@utxos/sdk",
"version": "0.2.3",
"version": "0.2.4",
"description": "UTXOS SDK - Web3 infrastructure platform for UTXO blockchains",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down
37 changes: 15 additions & 22 deletions src/non-custodial/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ export type Web3NonCustodialProviderParams = {
googleOauth2ClientId: string;
twitterOauth2ClientId: string;
discordOauth2ClientId: string;
appleOauth2ClientId: string;
/**
* @deprecated Apple Sign In was removed. Omit this field. If a non-empty value is passed,
* the constructor throws so misconfiguration is visible immediately instead of failing later.
*/
appleOauth2ClientId?: string;
};

export type Web3NonCustodialProviderUser = {
Expand Down Expand Up @@ -183,9 +187,13 @@ export class Web3NonCustodialProvider {
googleOauth2ClientId: string;
twitterOauth2ClientId: string;
discordOauth2ClientId: string;
appleOauth2ClientId: string;

constructor(params: Web3NonCustodialProviderParams) {
if (params.appleOauth2ClientId) {
throw new Error(
"Apple Sign no longer supported in SDK.",
);
}
this.projectId = params.projectId;
this.appOrigin = params.appOrigin ? params.appOrigin : "https://utxos.dev";
this.storageLocation = params.storageLocation
Expand All @@ -194,7 +202,6 @@ export class Web3NonCustodialProvider {
this.googleOauth2ClientId = params.googleOauth2ClientId;
this.twitterOauth2ClientId = params.twitterOauth2ClientId;
this.discordOauth2ClientId = params.discordOauth2ClientId;
this.appleOauth2ClientId = params.appleOauth2ClientId;
}

private base64Encode(str: string): string {
Expand Down Expand Up @@ -492,6 +499,11 @@ export class Web3NonCustodialProvider {
redirectUrl: string,
callback: (authorizationUrl: string) => void,
) {
if ((provider as string) === "apple") {
throw new Error(
"Apple Sign In was removed. Use google, discord, twitter, or email.",
);
}
if (provider === "google") {
const googleState = JSON.stringify({
redirect: redirectUrl,
Expand Down Expand Up @@ -549,25 +561,6 @@ export class Web3NonCustodialProvider {
"https://x.com/i/oauth2/authorize?" + twitterSearchParams.toString();
callback(twitterAuthorizeUrl);
return;
} else if (provider === "apple") {
const appleState = JSON.stringify({
redirect: redirectUrl,
provider: "apple",
projectId: this.projectId,
});
const appleSearchParams = new URLSearchParams({
client_id: this.appleOauth2ClientId,
response_type: "code",
redirect_uri: this.appOrigin + "/api/auth",
response_mode: "form_post",
scope: "name email",
state: this.base64Encode(appleState),
});
const appleAuthorizeUrl =
"https://appleid.apple.com/auth/authorize?" +
appleSearchParams.toString();
callback(appleAuthorizeUrl);
return;
} else if (provider === "email") {
// Email uses OTP flow, not OAuth - this method should not be called for email
throw new Error("Email provider uses OTP flow. Use the email OTP API endpoints instead.");
Expand Down
6 changes: 5 additions & 1 deletion src/types/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export type Web3ProjectBranding = {
twitterEnabled?: boolean;
discordEnabled?: boolean;
googleEnabled?: boolean;
/**
* Present on legacy API payloads. Apple Sign In is no longer offered; safe to ignore in UI.
* @deprecated
*/
appleEnabled?: boolean;
emailEnabled?: boolean;
};
Expand Down Expand Up @@ -58,7 +62,7 @@ export type Web3JWTBody = {
username: string | null;
};

export type Web3AuthProvider = "google" | "discord" | "twitter" | "apple" | "email";
export type Web3AuthProvider = "google" | "discord" | "twitter" | "email";

/** Role a user can have within a project */
export type Web3ProjectRole = "owner" | "admin" | "developer" | "billing";
Expand Down
3 changes: 1 addition & 2 deletions src/wallet-user-controlled/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ export * from "./web3-wallet";
export type UserControlledWalletDirectTo =
| "google"
| "twitter"
| "discord"
| "apple";
| "discord";
Loading