@aurum-sdk/types 0.1.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/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # @aurum-sdk/types
2
+
3
+ Shared TypeScript type definitions for the Aurum SDK ecosystem.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @aurum-sdk/types
9
+ ```
10
+
11
+ ## Exports
12
+
13
+ ```typescript
14
+ import {
15
+ // Enums
16
+ WalletId,
17
+ WalletName,
18
+
19
+ // SDK Configuration
20
+ type AurumConfig,
21
+ type BrandConfig,
22
+ type NonNullableBrandConfig,
23
+ type WalletsConfig,
24
+ type EmailConfig,
25
+ type WalletConnectConfig,
26
+
27
+ // Theme & Styling
28
+ type Theme,
29
+ type BorderRadiusToken,
30
+ type BorderRadiusSizeSlot,
31
+ type BorderRadiusScale,
32
+ type WalletLayout,
33
+ BORDER_RADIUS_SCALES,
34
+
35
+ // Provider & User
36
+ type AurumRpcProvider,
37
+ type UserInfo,
38
+
39
+ // Headless Mode
40
+ type EmailAuthStartResult,
41
+ type EmailAuthVerifyResult,
42
+ type WalletConnectSessionResult,
43
+ } from '@aurum-sdk/types';
44
+ ```
45
+
46
+ ## License
47
+
48
+ MIT
@@ -0,0 +1,150 @@
1
+ /**
2
+ * EIP-1193 Connect Info
3
+ */
4
+ interface ProviderConnectInfo {
5
+ chainId: string;
6
+ }
7
+ /**
8
+ * EIP-1193 Provider RPC Error
9
+ */
10
+ interface ProviderRpcError extends Error {
11
+ code: number;
12
+ data?: unknown;
13
+ }
14
+ interface AurumRpcProvider {
15
+ /**
16
+ * Sends a JSON-RPC request to the provider.
17
+ * @param args - The request arguments (method and params)
18
+ */
19
+ request<T = unknown>(args: {
20
+ method: string;
21
+ params?: unknown[] | object;
22
+ }): Promise<T>;
23
+ /**
24
+ * EIP-1193 event interface
25
+ */
26
+ on?(eventName: 'connect', listener: (connectInfo: ProviderConnectInfo) => void): void;
27
+ on?(eventName: 'disconnect', listener: (error: ProviderRpcError) => void): void;
28
+ on?(eventName: 'chainChanged', listener: (chainId: string) => void): void;
29
+ on?(eventName: 'accountsChanged', listener: (accounts: string[]) => void): void;
30
+ on?(eventName: string, listener: (...args: unknown[]) => void): void;
31
+ removeListener?(eventName: 'connect', listener: (connectInfo: ProviderConnectInfo) => void): void;
32
+ removeListener?(eventName: 'disconnect', listener: (error: ProviderRpcError) => void): void;
33
+ removeListener?(eventName: 'chainChanged', listener: (chainId: string) => void): void;
34
+ removeListener?(eventName: 'accountsChanged', listener: (accounts: string[]) => void): void;
35
+ removeListener?(eventName: string, listener: (...args: unknown[]) => void): void;
36
+ emit?(eventName: string, ...args: unknown[]): boolean;
37
+ /**
38
+ * EIP-1193 required properties for full compatibility
39
+ */
40
+ readonly isConnected?: boolean;
41
+ readonly chainId?: string;
42
+ readonly networkVersion?: string;
43
+ readonly selectedAddress?: string | null;
44
+ }
45
+
46
+ interface EmailAuthStartResult {
47
+ flowId: string;
48
+ }
49
+ interface EmailAuthVerifyResult {
50
+ address: `0x${string}`;
51
+ email: string;
52
+ isNewUser: boolean;
53
+ }
54
+ interface WalletConnectSessionResult {
55
+ uri: string;
56
+ waitForConnection: () => Promise<`0x${string}`>;
57
+ }
58
+
59
+ declare enum WalletName {
60
+ Email = "Email",
61
+ MetaMask = "MetaMask",
62
+ CoinbaseWallet = "Coinbase Wallet",
63
+ Phantom = "Phantom",
64
+ WalletConnect = "WalletConnect",
65
+ Rabby = "Rabby",
66
+ Brave = "Brave Wallet",
67
+ Ledger = "Ledger",
68
+ AppKit = "AppKit"
69
+ }
70
+ declare enum WalletId {
71
+ Email = "email",
72
+ MetaMask = "metamask",
73
+ CoinbaseWallet = "coinbase-wallet",
74
+ Phantom = "phantom",
75
+ WalletConnect = "walletconnect",
76
+ Rabby = "rabby",
77
+ Brave = "brave",
78
+ Ledger = "ledger",
79
+ AppKit = "appkit"
80
+ }
81
+
82
+ type Theme = 'light' | 'dark';
83
+ type BorderRadiusToken = 'none' | 'sm' | 'md' | 'lg' | 'xl';
84
+ type WalletLayout = 'stacked' | 'grid';
85
+ /**
86
+ * Border radius scale for each size slot (xs through xl).
87
+ * Values are in pixels.
88
+ */
89
+ interface BorderRadiusScale {
90
+ xs: number;
91
+ sm: number;
92
+ md: number;
93
+ lg: number;
94
+ xl: number;
95
+ }
96
+ /**
97
+ * Complete border radius scales for each token.
98
+ * Each token provides a consistent scale of pixel values.
99
+ */
100
+ declare const BORDER_RADIUS_SCALES: Record<BorderRadiusToken, BorderRadiusScale>;
101
+ type BorderRadiusSizeSlot = keyof BorderRadiusScale;
102
+ interface BrandConfig {
103
+ theme?: Theme;
104
+ logo?: string;
105
+ primaryColor?: string;
106
+ borderRadius?: BorderRadiusToken;
107
+ modalZIndex?: number;
108
+ appName?: string;
109
+ hideFooter?: boolean;
110
+ font?: string;
111
+ walletLayout?: WalletLayout;
112
+ }
113
+ interface NonNullableBrandConfig extends Omit<BrandConfig, 'theme' | 'primaryColor' | 'borderRadius' | 'modalZIndex' | 'appName' | 'hideFooter' | 'font' | 'walletLayout'> {
114
+ theme: Theme;
115
+ primaryColor: string;
116
+ borderRadius: BorderRadiusToken;
117
+ modalZIndex: number;
118
+ appName: string;
119
+ hideFooter: boolean;
120
+ font: string;
121
+ walletLayout: WalletLayout;
122
+ }
123
+ interface EmailConfig {
124
+ projectId: string;
125
+ }
126
+ interface WalletConnectConfig {
127
+ projectId: string;
128
+ }
129
+ /**
130
+ * walletConnect projectId is used for WalletConnect, AppKit, and Ledger wallets
131
+ */
132
+ interface WalletsConfig {
133
+ email?: EmailConfig;
134
+ walletConnect?: WalletConnectConfig;
135
+ exclude?: WalletId[] | `${WalletId}`[];
136
+ }
137
+ interface AurumConfig {
138
+ brand?: BrandConfig;
139
+ wallets?: WalletsConfig;
140
+ telemetry?: boolean;
141
+ }
142
+
143
+ interface UserInfo {
144
+ publicAddress: string;
145
+ walletName: WalletName;
146
+ walletId: WalletId;
147
+ email?: string;
148
+ }
149
+
150
+ export { type AurumConfig, type AurumRpcProvider, BORDER_RADIUS_SCALES, type BorderRadiusScale, type BorderRadiusSizeSlot, type BorderRadiusToken, type BrandConfig, type EmailAuthStartResult, type EmailAuthVerifyResult, type EmailConfig, type NonNullableBrandConfig, type ProviderConnectInfo, type ProviderRpcError, type Theme, type UserInfo, type WalletConnectConfig, type WalletConnectSessionResult, WalletId, type WalletLayout, WalletName, type WalletsConfig };
@@ -0,0 +1,150 @@
1
+ /**
2
+ * EIP-1193 Connect Info
3
+ */
4
+ interface ProviderConnectInfo {
5
+ chainId: string;
6
+ }
7
+ /**
8
+ * EIP-1193 Provider RPC Error
9
+ */
10
+ interface ProviderRpcError extends Error {
11
+ code: number;
12
+ data?: unknown;
13
+ }
14
+ interface AurumRpcProvider {
15
+ /**
16
+ * Sends a JSON-RPC request to the provider.
17
+ * @param args - The request arguments (method and params)
18
+ */
19
+ request<T = unknown>(args: {
20
+ method: string;
21
+ params?: unknown[] | object;
22
+ }): Promise<T>;
23
+ /**
24
+ * EIP-1193 event interface
25
+ */
26
+ on?(eventName: 'connect', listener: (connectInfo: ProviderConnectInfo) => void): void;
27
+ on?(eventName: 'disconnect', listener: (error: ProviderRpcError) => void): void;
28
+ on?(eventName: 'chainChanged', listener: (chainId: string) => void): void;
29
+ on?(eventName: 'accountsChanged', listener: (accounts: string[]) => void): void;
30
+ on?(eventName: string, listener: (...args: unknown[]) => void): void;
31
+ removeListener?(eventName: 'connect', listener: (connectInfo: ProviderConnectInfo) => void): void;
32
+ removeListener?(eventName: 'disconnect', listener: (error: ProviderRpcError) => void): void;
33
+ removeListener?(eventName: 'chainChanged', listener: (chainId: string) => void): void;
34
+ removeListener?(eventName: 'accountsChanged', listener: (accounts: string[]) => void): void;
35
+ removeListener?(eventName: string, listener: (...args: unknown[]) => void): void;
36
+ emit?(eventName: string, ...args: unknown[]): boolean;
37
+ /**
38
+ * EIP-1193 required properties for full compatibility
39
+ */
40
+ readonly isConnected?: boolean;
41
+ readonly chainId?: string;
42
+ readonly networkVersion?: string;
43
+ readonly selectedAddress?: string | null;
44
+ }
45
+
46
+ interface EmailAuthStartResult {
47
+ flowId: string;
48
+ }
49
+ interface EmailAuthVerifyResult {
50
+ address: `0x${string}`;
51
+ email: string;
52
+ isNewUser: boolean;
53
+ }
54
+ interface WalletConnectSessionResult {
55
+ uri: string;
56
+ waitForConnection: () => Promise<`0x${string}`>;
57
+ }
58
+
59
+ declare enum WalletName {
60
+ Email = "Email",
61
+ MetaMask = "MetaMask",
62
+ CoinbaseWallet = "Coinbase Wallet",
63
+ Phantom = "Phantom",
64
+ WalletConnect = "WalletConnect",
65
+ Rabby = "Rabby",
66
+ Brave = "Brave Wallet",
67
+ Ledger = "Ledger",
68
+ AppKit = "AppKit"
69
+ }
70
+ declare enum WalletId {
71
+ Email = "email",
72
+ MetaMask = "metamask",
73
+ CoinbaseWallet = "coinbase-wallet",
74
+ Phantom = "phantom",
75
+ WalletConnect = "walletconnect",
76
+ Rabby = "rabby",
77
+ Brave = "brave",
78
+ Ledger = "ledger",
79
+ AppKit = "appkit"
80
+ }
81
+
82
+ type Theme = 'light' | 'dark';
83
+ type BorderRadiusToken = 'none' | 'sm' | 'md' | 'lg' | 'xl';
84
+ type WalletLayout = 'stacked' | 'grid';
85
+ /**
86
+ * Border radius scale for each size slot (xs through xl).
87
+ * Values are in pixels.
88
+ */
89
+ interface BorderRadiusScale {
90
+ xs: number;
91
+ sm: number;
92
+ md: number;
93
+ lg: number;
94
+ xl: number;
95
+ }
96
+ /**
97
+ * Complete border radius scales for each token.
98
+ * Each token provides a consistent scale of pixel values.
99
+ */
100
+ declare const BORDER_RADIUS_SCALES: Record<BorderRadiusToken, BorderRadiusScale>;
101
+ type BorderRadiusSizeSlot = keyof BorderRadiusScale;
102
+ interface BrandConfig {
103
+ theme?: Theme;
104
+ logo?: string;
105
+ primaryColor?: string;
106
+ borderRadius?: BorderRadiusToken;
107
+ modalZIndex?: number;
108
+ appName?: string;
109
+ hideFooter?: boolean;
110
+ font?: string;
111
+ walletLayout?: WalletLayout;
112
+ }
113
+ interface NonNullableBrandConfig extends Omit<BrandConfig, 'theme' | 'primaryColor' | 'borderRadius' | 'modalZIndex' | 'appName' | 'hideFooter' | 'font' | 'walletLayout'> {
114
+ theme: Theme;
115
+ primaryColor: string;
116
+ borderRadius: BorderRadiusToken;
117
+ modalZIndex: number;
118
+ appName: string;
119
+ hideFooter: boolean;
120
+ font: string;
121
+ walletLayout: WalletLayout;
122
+ }
123
+ interface EmailConfig {
124
+ projectId: string;
125
+ }
126
+ interface WalletConnectConfig {
127
+ projectId: string;
128
+ }
129
+ /**
130
+ * walletConnect projectId is used for WalletConnect, AppKit, and Ledger wallets
131
+ */
132
+ interface WalletsConfig {
133
+ email?: EmailConfig;
134
+ walletConnect?: WalletConnectConfig;
135
+ exclude?: WalletId[] | `${WalletId}`[];
136
+ }
137
+ interface AurumConfig {
138
+ brand?: BrandConfig;
139
+ wallets?: WalletsConfig;
140
+ telemetry?: boolean;
141
+ }
142
+
143
+ interface UserInfo {
144
+ publicAddress: string;
145
+ walletName: WalletName;
146
+ walletId: WalletId;
147
+ email?: string;
148
+ }
149
+
150
+ export { type AurumConfig, type AurumRpcProvider, BORDER_RADIUS_SCALES, type BorderRadiusScale, type BorderRadiusSizeSlot, type BorderRadiusToken, type BrandConfig, type EmailAuthStartResult, type EmailAuthVerifyResult, type EmailConfig, type NonNullableBrandConfig, type ProviderConnectInfo, type ProviderRpcError, type Theme, type UserInfo, type WalletConnectConfig, type WalletConnectSessionResult, WalletId, type WalletLayout, WalletName, type WalletsConfig };
package/dist/index.js ADDED
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ // src/sdk-config.ts
4
+ var BORDER_RADIUS_SCALES = {
5
+ none: { xs: 0, sm: 0, md: 0, lg: 0, xl: 0 },
6
+ sm: { xs: 4, sm: 6, md: 8, lg: 10, xl: 12 },
7
+ md: { xs: 6, sm: 10, md: 14, lg: 18, xl: 22 },
8
+ lg: { xs: 8, sm: 14, md: 20, lg: 26, xl: 32 },
9
+ xl: { xs: 10, sm: 18, md: 26, lg: 34, xl: 42 }
10
+ };
11
+
12
+ // src/wallet.ts
13
+ var WalletName = /* @__PURE__ */ ((WalletName2) => {
14
+ WalletName2["Email"] = "Email";
15
+ WalletName2["MetaMask"] = "MetaMask";
16
+ WalletName2["CoinbaseWallet"] = "Coinbase Wallet";
17
+ WalletName2["Phantom"] = "Phantom";
18
+ WalletName2["WalletConnect"] = "WalletConnect";
19
+ WalletName2["Rabby"] = "Rabby";
20
+ WalletName2["Brave"] = "Brave Wallet";
21
+ WalletName2["Ledger"] = "Ledger";
22
+ WalletName2["AppKit"] = "AppKit";
23
+ return WalletName2;
24
+ })(WalletName || {});
25
+ var WalletId = /* @__PURE__ */ ((WalletId2) => {
26
+ WalletId2["Email"] = "email";
27
+ WalletId2["MetaMask"] = "metamask";
28
+ WalletId2["CoinbaseWallet"] = "coinbase-wallet";
29
+ WalletId2["Phantom"] = "phantom";
30
+ WalletId2["WalletConnect"] = "walletconnect";
31
+ WalletId2["Rabby"] = "rabby";
32
+ WalletId2["Brave"] = "brave";
33
+ WalletId2["Ledger"] = "ledger";
34
+ WalletId2["AppKit"] = "appkit";
35
+ return WalletId2;
36
+ })(WalletId || {});
37
+
38
+ exports.BORDER_RADIUS_SCALES = BORDER_RADIUS_SCALES;
39
+ exports.WalletId = WalletId;
40
+ exports.WalletName = WalletName;
41
+ //# sourceMappingURL=index.js.map
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/sdk-config.ts","../src/wallet.ts"],"names":["WalletName","WalletId"],"mappings":";;;AAsBO,IAAM,oBAAA,GAAqE;AAAA,EAChF,IAAA,EAAM,EAAE,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAE;AAAA,EAC1C,EAAA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A,CAAA,GAAiB,iBAAA;AACjB,EAAAA,UAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,UAAA,eAAA,CAAA,GAAgB,eAAA;AAChB,EAAAA,UAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,UAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,UAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,UAAA,QAAA,CAAA,GAAS,QAAA;AATC,EAAA,OAAAA,SAAAA;AAAA,CAAA,EAAA,QAAA,IAAA,EAAA","file":"index.js","sourcesContent":["import { WalletId } from './wallet';\n\nexport type Theme = 'light' | 'dark';\nexport type BorderRadiusToken = 'none' | 'sm' | 'md' | 'lg' | 'xl';\nexport type WalletLayout = 'stacked' | 'grid';\n\n/**\n * Border radius scale for each size slot (xs through xl).\n * Values are in pixels.\n */\nexport interface BorderRadiusScale {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\n/**\n * Complete border radius scales for each token.\n * Each token provides a consistent scale of pixel values.\n */\nexport const BORDER_RADIUS_SCALES: Record<BorderRadiusToken, BorderRadiusScale> = {\n none: { xs: 0, sm: 0, md: 0, lg: 0, xl: 0 },\n sm: { xs: 4, sm: 6, md: 8, lg: 10, xl: 12 },\n md: { xs: 6, sm: 10, md: 14, lg: 18, xl: 22 },\n lg: { xs: 8, sm: 14, md: 20, lg: 26, xl: 32 },\n xl: { xs: 10, sm: 18, md: 26, lg: 34, xl: 42 },\n};\n\nexport type BorderRadiusSizeSlot = keyof BorderRadiusScale;\n\nexport interface BrandConfig {\n theme?: Theme;\n logo?: string;\n primaryColor?: string;\n borderRadius?: BorderRadiusToken;\n modalZIndex?: number;\n appName?: string;\n hideFooter?: boolean;\n font?: string;\n walletLayout?: WalletLayout;\n}\n\nexport interface NonNullableBrandConfig\n extends Omit<\n BrandConfig,\n 'theme' | 'primaryColor' | 'borderRadius' | 'modalZIndex' | 'appName' | 'hideFooter' | 'font' | 'walletLayout'\n > {\n theme: Theme;\n primaryColor: string;\n borderRadius: BorderRadiusToken;\n modalZIndex: number;\n appName: string;\n hideFooter: boolean;\n font: string;\n walletLayout: WalletLayout;\n}\n\nexport interface EmailConfig {\n projectId: string;\n}\n\nexport interface WalletConnectConfig {\n projectId: string;\n}\n\n/**\n * walletConnect projectId is used for WalletConnect, AppKit, and Ledger wallets\n */\nexport interface WalletsConfig {\n email?: EmailConfig;\n walletConnect?: WalletConnectConfig;\n exclude?: WalletId[] | `${WalletId}`[];\n}\n\nexport interface AurumConfig {\n brand?: BrandConfig;\n wallets?: WalletsConfig;\n telemetry?: boolean;\n}\n","export enum WalletName {\n Email = 'Email',\n MetaMask = 'MetaMask',\n CoinbaseWallet = 'Coinbase Wallet',\n Phantom = 'Phantom',\n WalletConnect = 'WalletConnect',\n Rabby = 'Rabby',\n Brave = 'Brave Wallet',\n Ledger = 'Ledger',\n AppKit = 'AppKit',\n}\n\nexport enum WalletId {\n Email = 'email',\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase-wallet',\n Phantom = 'phantom',\n WalletConnect = 'walletconnect',\n Rabby = 'rabby',\n Brave = 'brave',\n Ledger = 'ledger',\n AppKit = 'appkit',\n}\n"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,38 @@
1
+ // src/sdk-config.ts
2
+ var BORDER_RADIUS_SCALES = {
3
+ none: { xs: 0, sm: 0, md: 0, lg: 0, xl: 0 },
4
+ sm: { xs: 4, sm: 6, md: 8, lg: 10, xl: 12 },
5
+ md: { xs: 6, sm: 10, md: 14, lg: 18, xl: 22 },
6
+ lg: { xs: 8, sm: 14, md: 20, lg: 26, xl: 32 },
7
+ xl: { xs: 10, sm: 18, md: 26, lg: 34, xl: 42 }
8
+ };
9
+
10
+ // src/wallet.ts
11
+ var WalletName = /* @__PURE__ */ ((WalletName2) => {
12
+ WalletName2["Email"] = "Email";
13
+ WalletName2["MetaMask"] = "MetaMask";
14
+ WalletName2["CoinbaseWallet"] = "Coinbase Wallet";
15
+ WalletName2["Phantom"] = "Phantom";
16
+ WalletName2["WalletConnect"] = "WalletConnect";
17
+ WalletName2["Rabby"] = "Rabby";
18
+ WalletName2["Brave"] = "Brave Wallet";
19
+ WalletName2["Ledger"] = "Ledger";
20
+ WalletName2["AppKit"] = "AppKit";
21
+ return WalletName2;
22
+ })(WalletName || {});
23
+ var WalletId = /* @__PURE__ */ ((WalletId2) => {
24
+ WalletId2["Email"] = "email";
25
+ WalletId2["MetaMask"] = "metamask";
26
+ WalletId2["CoinbaseWallet"] = "coinbase-wallet";
27
+ WalletId2["Phantom"] = "phantom";
28
+ WalletId2["WalletConnect"] = "walletconnect";
29
+ WalletId2["Rabby"] = "rabby";
30
+ WalletId2["Brave"] = "brave";
31
+ WalletId2["Ledger"] = "ledger";
32
+ WalletId2["AppKit"] = "appkit";
33
+ return WalletId2;
34
+ })(WalletId || {});
35
+
36
+ export { BORDER_RADIUS_SCALES, WalletId, WalletName };
37
+ //# sourceMappingURL=index.mjs.map
38
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/sdk-config.ts","../src/wallet.ts"],"names":["WalletName","WalletId"],"mappings":";AAsBO,IAAM,oBAAA,GAAqE;AAAA,EAChF,IAAA,EAAM,EAAE,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAE;AAAA,EAC1C,EAAA,EAAI,EAAE,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAG;AAAA,EAC1C,EAAA,EAAI,EAAE,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAG;AAAA,EAC5C,EAAA,EAAI,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A,CAAA,EAAA,QAAA,IAAA,EAAA","file":"index.mjs","sourcesContent":["import { WalletId } from './wallet';\n\nexport type Theme = 'light' | 'dark';\nexport type BorderRadiusToken = 'none' | 'sm' | 'md' | 'lg' | 'xl';\nexport type WalletLayout = 'stacked' | 'grid';\n\n/**\n * Border radius scale for each size slot (xs through xl).\n * Values are in pixels.\n */\nexport interface BorderRadiusScale {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\n/**\n * Complete border radius scales for each token.\n * Each token provides a consistent scale of pixel values.\n */\nexport const BORDER_RADIUS_SCALES: Record<BorderRadiusToken, BorderRadiusScale> = {\n none: { xs: 0, sm: 0, md: 0, lg: 0, xl: 0 },\n sm: { xs: 4, sm: 6, md: 8, lg: 10, xl: 12 },\n md: { xs: 6, sm: 10, md: 14, lg: 18, xl: 22 },\n lg: { xs: 8, sm: 14, md: 20, lg: 26, xl: 32 },\n xl: { xs: 10, sm: 18, md: 26, lg: 34, xl: 42 },\n};\n\nexport type BorderRadiusSizeSlot = keyof BorderRadiusScale;\n\nexport interface BrandConfig {\n theme?: Theme;\n logo?: string;\n primaryColor?: string;\n borderRadius?: BorderRadiusToken;\n modalZIndex?: number;\n appName?: string;\n hideFooter?: boolean;\n font?: string;\n walletLayout?: WalletLayout;\n}\n\nexport interface NonNullableBrandConfig\n extends Omit<\n BrandConfig,\n 'theme' | 'primaryColor' | 'borderRadius' | 'modalZIndex' | 'appName' | 'hideFooter' | 'font' | 'walletLayout'\n > {\n theme: Theme;\n primaryColor: string;\n borderRadius: BorderRadiusToken;\n modalZIndex: number;\n appName: string;\n hideFooter: boolean;\n font: string;\n walletLayout: WalletLayout;\n}\n\nexport interface EmailConfig {\n projectId: string;\n}\n\nexport interface WalletConnectConfig {\n projectId: string;\n}\n\n/**\n * walletConnect projectId is used for WalletConnect, AppKit, and Ledger wallets\n */\nexport interface WalletsConfig {\n email?: EmailConfig;\n walletConnect?: WalletConnectConfig;\n exclude?: WalletId[] | `${WalletId}`[];\n}\n\nexport interface AurumConfig {\n brand?: BrandConfig;\n wallets?: WalletsConfig;\n telemetry?: boolean;\n}\n","export enum WalletName {\n Email = 'Email',\n MetaMask = 'MetaMask',\n CoinbaseWallet = 'Coinbase Wallet',\n Phantom = 'Phantom',\n WalletConnect = 'WalletConnect',\n Rabby = 'Rabby',\n Brave = 'Brave Wallet',\n Ledger = 'Ledger',\n AppKit = 'AppKit',\n}\n\nexport enum WalletId {\n Email = 'email',\n MetaMask = 'metamask',\n CoinbaseWallet = 'coinbase-wallet',\n Phantom = 'phantom',\n WalletConnect = 'walletconnect',\n Rabby = 'rabby',\n Brave = 'brave',\n Ledger = 'ledger',\n AppKit = 'appkit',\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@aurum-sdk/types",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript types for Aurum SDK",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "engines": {
9
+ "node": ">=18.0.0",
10
+ "pnpm": ">=8.0.0"
11
+ },
12
+ "packageManager": "pnpm@8.15.0",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "README.md"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsup",
26
+ "clean": "rm -rf dist",
27
+ "prepublishOnly": "pnpm build"
28
+ },
29
+ "devDependencies": {
30
+ "tsup": "^8.0.0",
31
+ "typescript": "^5.0.0"
32
+ },
33
+ "keywords": [
34
+ "typescript",
35
+ "types",
36
+ "aurum",
37
+ "wallet"
38
+ ],
39
+ "author": "Hunter Cote",
40
+ "license": "MIT",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/aurum-sdk/aurum.git",
44
+ "directory": "packages/types"
45
+ },
46
+ "homepage": "https://github.com/aurum-sdk/aurum#readme"
47
+ }