@1sat/connect 0.0.25 → 0.0.27
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.
- package/dist/connectWallet.d.ts +20 -33
- package/dist/connectWallet.d.ts.map +1 -1
- package/dist/index.d.ts +3 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +337 -20049
- package/dist/sigma-oauth.d.ts +23 -21
- package/dist/sigma-oauth.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/sigma-oauth.d.ts
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sigma
|
|
3
|
-
*
|
|
2
|
+
* Sigma Identity — OAuth flow + CWI wallet connection.
|
|
3
|
+
*
|
|
4
|
+
* The full flow: initiateSigmaOAuth() redirects to Sigma Identity →
|
|
5
|
+
* user authenticates → redirect back → completeSigmaOAuth() exchanges
|
|
6
|
+
* code → connectSigmaWallet() opens CWI iframe with the authenticated
|
|
7
|
+
* identity. After that, the wallet is a standard WalletInterface.
|
|
4
8
|
*/
|
|
5
9
|
import { type SigmaSignInOptions, sigmaClient } from '@sigma-auth/better-auth-plugin/client';
|
|
6
|
-
|
|
10
|
+
import type { ConnectWalletResult, WalletProviderConfig } from './connectWallet';
|
|
7
11
|
export declare const SIGMA_URL = "https://auth.sigmaidentity.com";
|
|
8
12
|
export interface SigmaOAuthConfig {
|
|
9
|
-
/** OAuth client ID registered with Sigma */
|
|
10
13
|
clientId: string;
|
|
11
|
-
/** Local callback URL path (default: /auth/sigma/callback) */
|
|
12
14
|
callbackURL?: string;
|
|
13
15
|
}
|
|
14
16
|
export interface SigmaOAuthResult {
|
|
15
|
-
/** BAP ID returned from the callback */
|
|
16
17
|
bapId: string;
|
|
17
|
-
/** Public key hex */
|
|
18
18
|
pubkey: string;
|
|
19
|
-
/** Full user object from the server callback */
|
|
20
19
|
user: Record<string, unknown>;
|
|
21
|
-
/** Access token */
|
|
22
20
|
accessToken: string;
|
|
23
21
|
}
|
|
22
|
+
export interface SigmaProviderConfig extends WalletProviderConfig {
|
|
23
|
+
type: 'sigma';
|
|
24
|
+
clientId: string;
|
|
25
|
+
callbackURL?: string;
|
|
26
|
+
}
|
|
24
27
|
type SigmaPluginActions = ReturnType<ReturnType<typeof sigmaClient>['getActions']>;
|
|
25
28
|
type SigmaAugmentedClient = {
|
|
26
29
|
sigma: SigmaPluginActions['sigma'];
|
|
@@ -31,7 +34,7 @@ type SigmaAugmentedClient = {
|
|
|
31
34
|
declare const baseAuthClient: {
|
|
32
35
|
signIn: {
|
|
33
36
|
social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
34
|
-
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel";
|
|
37
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
35
38
|
callbackURL?: string | undefined;
|
|
36
39
|
newUserCallbackURL?: string | undefined;
|
|
37
40
|
errorCallbackURL?: string | undefined;
|
|
@@ -55,7 +58,7 @@ declare const baseAuthClient: {
|
|
|
55
58
|
loginHint?: string | undefined;
|
|
56
59
|
additionalData?: Record<string, any> | undefined;
|
|
57
60
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
58
|
-
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel";
|
|
61
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
59
62
|
callbackURL?: string | undefined;
|
|
60
63
|
newUserCallbackURL?: string | undefined;
|
|
61
64
|
errorCallbackURL?: string | undefined;
|
|
@@ -968,23 +971,22 @@ declare const baseAuthClient: {
|
|
|
968
971
|
};
|
|
969
972
|
export declare const sigmaAuthClient: typeof baseAuthClient & SigmaAugmentedClient;
|
|
970
973
|
/**
|
|
971
|
-
*
|
|
972
|
-
*
|
|
973
|
-
* sessionStorage, wallet-check gate, and redirect.
|
|
974
|
-
*
|
|
974
|
+
* Redirect to Sigma Identity authorize endpoint.
|
|
975
|
+
* Handles PKCE, sessionStorage, wallet-check gate.
|
|
975
976
|
* Returns a never-resolving Promise since the page navigates away.
|
|
976
977
|
*/
|
|
977
978
|
export declare function initiateSigmaOAuth(config: SigmaOAuthConfig, options?: Omit<SigmaSignInOptions, 'clientId' | 'callbackURL'>): Promise<never>;
|
|
978
979
|
/**
|
|
979
|
-
* Complete
|
|
980
|
-
*
|
|
981
|
-
* server-side callback route, and returns user data.
|
|
980
|
+
* Complete the OAuth callback. Verifies state, exchanges code,
|
|
981
|
+
* returns user data with bapId and pubkey.
|
|
982
982
|
*/
|
|
983
983
|
export declare function completeSigmaOAuth(searchParams: URLSearchParams): Promise<SigmaOAuthResult>;
|
|
984
|
+
export declare function setSigmaIdentity(bapId: string): void;
|
|
984
985
|
/**
|
|
985
|
-
*
|
|
986
|
-
*
|
|
986
|
+
* Connect to a Sigma wallet via CWI iframe.
|
|
987
|
+
* Call after completing OAuth — sets the identity and waits for
|
|
988
|
+
* the iframe to authenticate. Returns a standard ConnectWalletResult.
|
|
987
989
|
*/
|
|
988
|
-
export declare function
|
|
990
|
+
export declare function connectSigmaWallet(bapId: string): Promise<ConnectWalletResult>;
|
|
989
991
|
export {};
|
|
990
992
|
//# sourceMappingURL=sigma-oauth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sigma-oauth.d.ts","sourceRoot":"","sources":["../src/sigma-oauth.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sigma-oauth.d.ts","sourceRoot":"","sources":["../src/sigma-oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EACN,KAAK,kBAAkB,EACvB,WAAW,EACX,MAAM,uCAAuC,CAAA;AAE9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEhF,eAAO,MAAM,SAAS,mCAAmC,CAAA;AAEzD,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAChE,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB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1
|
{
|
|
2
2
|
"name": "@1sat/connect",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "Connection layer for 1Sat wallet - popup flow, events, session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"keywords": ["1sat", "bsv", "ordinals", "wallet", "sdk", "connect"],
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@1sat/wallet": "0.0.
|
|
22
|
+
"@1sat/wallet": "0.0.35",
|
|
23
23
|
"@sigma-auth/better-auth-plugin": "^0.0.84",
|
|
24
24
|
"better-auth": "^1.5.4",
|
|
25
25
|
"eventemitter3": "^5.0.1"
|