@flow-industries/id 0.3.1 → 0.6.0
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/sdk/client/access-key.d.ts +5 -3
- package/dist/sdk/client/access-key.js +6 -4
- package/dist/sdk/client/create-flow.js +145 -3
- package/dist/sdk/client/dialog-host.js +24 -18
- package/dist/sdk/client/iframe-host.d.ts +23 -0
- package/dist/sdk/client/iframe-host.js +34 -0
- package/dist/sdk/client/index.d.ts +2 -1
- package/dist/sdk/client/index.js +1 -0
- package/dist/sdk/client/methods.d.ts +1 -0
- package/dist/sdk/client/methods.js +1 -0
- package/dist/sdk/client/profile-button.d.ts +15 -0
- package/dist/sdk/client/profile-button.js +189 -0
- package/dist/sdk/client/signing.d.ts +1 -1
- package/dist/sdk/client/signing.js +3 -1
- package/dist/sdk/client/store.js +4 -1
- package/dist/sdk/dialog/remote/Messenger.d.ts +1 -2
- package/dist/sdk/dialog/remote/Messenger.js +3 -1
- package/dist/sdk/react/hooks.d.ts +6 -2
- package/dist/sdk/react/hooks.js +6 -2
- package/dist/sdk/react/index.d.ts +3 -2
- package/dist/sdk/react/index.js +2 -1
- package/dist/sdk/react/profile-button.d.ts +9 -0
- package/dist/sdk/react/profile-button.js +28 -0
- package/dist/sdk/react/provider.js +1 -1
- package/dist/sdk/types/auth.d.ts +13 -0
- package/dist/sdk/types/dialog.d.ts +22 -0
- package/dist/sdk/types/events.d.ts +40 -0
- package/dist/sdk/types/events.js +6 -0
- package/dist/sdk/types/index.d.ts +5 -4
- package/dist/sdk/types/messenger.d.ts +30 -0
- package/dist/sdk/types/protocol.d.ts +15 -1
- package/dist/sdk/types/sdk.d.ts +72 -1
- package/dist/sdk/verify.d.ts +7 -0
- package/dist/sdk/verify.js +7 -0
- package/dist/sdk/wagmi/index.js +8 -3
- package/package.json +30 -4
- package/dist/sdk/client/protocol.d.ts +0 -97
- package/dist/sdk/client/protocol.js +0 -9
- package/dist/sdk/client/types.d.ts +0 -35
- package/dist/sdk/client/types.js +0 -0
- package/dist/sdk/types.d.ts +0 -32
- package/dist/sdk/types.js +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { FlowUser, FlowCredential, WebAuthnSignature } from "../types";
|
|
2
|
-
export declare const METHODS: {
|
|
3
|
-
readonly connect: "wallet_connect";
|
|
4
|
-
readonly signMessage: "personal_sign";
|
|
5
|
-
readonly signTypedData: "eth_signTypedData";
|
|
6
|
-
readonly sendTransaction: "eth_sendTransaction";
|
|
7
|
-
readonly sendCalls: "wallet_sendCalls";
|
|
8
|
-
readonly restore: "wallet_restore";
|
|
9
|
-
readonly signOut: "wallet_signout";
|
|
10
|
-
};
|
|
11
|
-
export type Method = (typeof METHODS)[keyof typeof METHODS];
|
|
12
|
-
export type ConnectCapabilities = {
|
|
13
|
-
createAccount?: boolean;
|
|
14
|
-
signIn?: boolean;
|
|
15
|
-
accessKeyHash?: string;
|
|
16
|
-
headless?: boolean;
|
|
17
|
-
credentialId?: string;
|
|
18
|
-
};
|
|
19
|
-
export type ConnectRequest = [{
|
|
20
|
-
capabilities?: ConnectCapabilities;
|
|
21
|
-
}];
|
|
22
|
-
export type ConnectResponse = {
|
|
23
|
-
jwt: string;
|
|
24
|
-
user: FlowUser;
|
|
25
|
-
credential: FlowCredential;
|
|
26
|
-
webauthn?: WebAuthnSignature;
|
|
27
|
-
};
|
|
28
|
-
export type SignMessageRequest = [message: string, address: string];
|
|
29
|
-
export type SignMessageResponse = `0x${string}`;
|
|
30
|
-
export type TypedDataDomain = {
|
|
31
|
-
name?: string;
|
|
32
|
-
version?: string;
|
|
33
|
-
chainId?: number;
|
|
34
|
-
verifyingContract?: string;
|
|
35
|
-
salt?: string;
|
|
36
|
-
};
|
|
37
|
-
export type TypedDataField = {
|
|
38
|
-
name: string;
|
|
39
|
-
type: string;
|
|
40
|
-
};
|
|
41
|
-
export type TypedData = {
|
|
42
|
-
domain: TypedDataDomain;
|
|
43
|
-
types: Record<string, readonly TypedDataField[]>;
|
|
44
|
-
primaryType: string;
|
|
45
|
-
message: Record<string, unknown>;
|
|
46
|
-
};
|
|
47
|
-
export type SignTypedDataRequest = [address: string, typedData: TypedData];
|
|
48
|
-
export type SignTypedDataResponse = `0x${string}`;
|
|
49
|
-
export type Call = {
|
|
50
|
-
to?: string;
|
|
51
|
-
value?: string;
|
|
52
|
-
data?: string;
|
|
53
|
-
};
|
|
54
|
-
export type TransactionArgs = Call & {
|
|
55
|
-
chainId?: string;
|
|
56
|
-
};
|
|
57
|
-
export type SendTransactionRequest = [TransactionArgs];
|
|
58
|
-
export type SendTransactionResponse = `0x${string}`;
|
|
59
|
-
export type SendCallsRequest = [
|
|
60
|
-
{
|
|
61
|
-
calls: readonly Call[];
|
|
62
|
-
chainId?: string;
|
|
63
|
-
capabilities?: Record<string, unknown>;
|
|
64
|
-
}
|
|
65
|
-
];
|
|
66
|
-
export type SendCallsResponse = {
|
|
67
|
-
id: string;
|
|
68
|
-
};
|
|
69
|
-
export type RestoreRequest = [];
|
|
70
|
-
export type RestoreResponse = {
|
|
71
|
-
jwt: string;
|
|
72
|
-
user: FlowUser;
|
|
73
|
-
credential: FlowCredential;
|
|
74
|
-
address: `0x${string}`;
|
|
75
|
-
};
|
|
76
|
-
export type SignOutRequest = [];
|
|
77
|
-
export type SignOutResponse = {
|
|
78
|
-
ok: true;
|
|
79
|
-
};
|
|
80
|
-
export type MethodParams = {
|
|
81
|
-
[METHODS.connect]: ConnectRequest;
|
|
82
|
-
[METHODS.signMessage]: SignMessageRequest;
|
|
83
|
-
[METHODS.signTypedData]: SignTypedDataRequest;
|
|
84
|
-
[METHODS.sendTransaction]: SendTransactionRequest;
|
|
85
|
-
[METHODS.sendCalls]: SendCallsRequest;
|
|
86
|
-
[METHODS.restore]: RestoreRequest;
|
|
87
|
-
[METHODS.signOut]: SignOutRequest;
|
|
88
|
-
};
|
|
89
|
-
export type MethodResult = {
|
|
90
|
-
[METHODS.connect]: ConnectResponse;
|
|
91
|
-
[METHODS.signMessage]: SignMessageResponse;
|
|
92
|
-
[METHODS.signTypedData]: SignTypedDataResponse;
|
|
93
|
-
[METHODS.sendTransaction]: SendTransactionResponse;
|
|
94
|
-
[METHODS.sendCalls]: SendCallsResponse;
|
|
95
|
-
[METHODS.restore]: RestoreResponse;
|
|
96
|
-
[METHODS.signOut]: SignOutResponse;
|
|
97
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Chain } from "viem";
|
|
2
|
-
import type { FlowCredential, FlowUser } from "../types";
|
|
3
|
-
export type { FlowUser, FlowCredential };
|
|
4
|
-
export type Address = `0x${string}`;
|
|
5
|
-
export type AccessKeyOptions = {
|
|
6
|
-
expiry?: number;
|
|
7
|
-
strict?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type CreateFlowOptions = {
|
|
10
|
-
host?: string;
|
|
11
|
-
rpId?: string;
|
|
12
|
-
chains?: readonly Chain[];
|
|
13
|
-
accessKey?: boolean | AccessKeyOptions;
|
|
14
|
-
/**
|
|
15
|
-
* If true (default), createFlow attempts a silent restore on startup —
|
|
16
|
-
* if the user has a valid Flow cookie session, state populates without UI.
|
|
17
|
-
*/
|
|
18
|
-
autoRestore?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export type FlowState = {
|
|
21
|
-
user: FlowUser | null;
|
|
22
|
-
jwt: string | null;
|
|
23
|
-
credential: FlowCredential | null;
|
|
24
|
-
address: Address | null;
|
|
25
|
-
};
|
|
26
|
-
export type LoginOptions = {
|
|
27
|
-
mode?: "iframe" | "popup";
|
|
28
|
-
signUp?: boolean;
|
|
29
|
-
};
|
|
30
|
-
export type Session = {
|
|
31
|
-
user: FlowUser;
|
|
32
|
-
jwt: string;
|
|
33
|
-
credential: FlowCredential;
|
|
34
|
-
address: Address;
|
|
35
|
-
};
|
package/dist/sdk/client/types.js
DELETED
|
File without changes
|
package/dist/sdk/types.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export type FlowUser = {
|
|
2
|
-
id: string;
|
|
3
|
-
username: string;
|
|
4
|
-
};
|
|
5
|
-
export type FlowCredential = {
|
|
6
|
-
id: string;
|
|
7
|
-
publicKey: string;
|
|
8
|
-
};
|
|
9
|
-
export type AuthResponse = {
|
|
10
|
-
jwt: string;
|
|
11
|
-
user: FlowUser;
|
|
12
|
-
credential: FlowCredential;
|
|
13
|
-
};
|
|
14
|
-
export type AuthConfig = {
|
|
15
|
-
rpId: string;
|
|
16
|
-
rpName: string;
|
|
17
|
-
};
|
|
18
|
-
export type WebAuthnSignature = {
|
|
19
|
-
signature: {
|
|
20
|
-
r: string;
|
|
21
|
-
s: string;
|
|
22
|
-
};
|
|
23
|
-
metadata: {
|
|
24
|
-
authenticatorData: string;
|
|
25
|
-
clientDataJSON: string;
|
|
26
|
-
challengeIndex: number;
|
|
27
|
-
typeIndex: number;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export type AuthResponseWithWebAuthn = AuthResponse & {
|
|
31
|
-
webauthn?: WebAuthnSignature;
|
|
32
|
-
};
|
package/dist/sdk/types.js
DELETED
|
File without changes
|