@dipansrimany/mlink-sdk 0.3.1 → 0.4.2
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/adapters/express.d.mts +2 -2
- package/dist/adapters/express.d.ts +2 -2
- package/dist/adapters/express.js +117 -10
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +117 -10
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/next.d.mts +2 -2
- package/dist/adapters/next.d.ts +2 -2
- package/dist/adapters/next.js +117 -10
- package/dist/adapters/next.js.map +1 -1
- package/dist/adapters/next.mjs +117 -10
- package/dist/adapters/next.mjs.map +1 -1
- package/dist/builders-CLqoe2Kx.d.ts +245 -0
- package/dist/builders-pKj4NiIj.d.mts +245 -0
- package/dist/index.d.mts +1131 -24
- package/dist/index.d.ts +1131 -24
- package/dist/index.js +346 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +317 -21
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +43 -5
- package/dist/react/index.d.ts +43 -5
- package/dist/react/index.js +522 -37
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +522 -37
- package/dist/react/index.mjs.map +1 -1
- package/dist/styles.css +248 -0
- package/dist/types-DD9rJ58Y.d.mts +214 -0
- package/dist/types-DD9rJ58Y.d.ts +214 -0
- package/package.json +2 -2
- package/dist/builders-CJNt88dM.d.ts +0 -19
- package/dist/builders-CN5ijFpW.d.mts +0 -19
- package/dist/types-CAnUIaVe.d.mts +0 -68
- package/dist/types-CAnUIaVe.d.ts +0 -68
package/dist/react/index.d.ts
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { E as EVMTransaction, C as ChainConfig, A as ActionMetadata } from '../types-
|
|
2
|
+
import { E as EVMTransaction, C as ChainConfig, A as ActionMetadata } from '../types-DD9rJ58Y.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
type MlinkStatus = 'idle' | 'loading' | 'ready' | 'executing' | 'success' | 'error';
|
|
5
|
+
type MlinkStatus = 'idle' | 'loading' | 'validating' | 'ready' | 'executing' | 'success' | 'error' | 'unregistered' | 'blocked';
|
|
6
|
+
type RegistrationStatus = 'pending' | 'approved' | 'blocked' | null;
|
|
7
|
+
interface RegistrationResult {
|
|
8
|
+
isRegistered: boolean;
|
|
9
|
+
status: RegistrationStatus;
|
|
10
|
+
error?: string;
|
|
11
|
+
warning?: string;
|
|
12
|
+
mlink?: {
|
|
13
|
+
mlinkId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
status: RegistrationStatus;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
6
20
|
interface MlinkInstance {
|
|
7
21
|
status: MlinkStatus;
|
|
8
22
|
metadata: ActionMetadata | null;
|
|
9
23
|
error: string | null;
|
|
10
24
|
url: string;
|
|
11
25
|
refresh: () => Promise<void>;
|
|
26
|
+
registration: RegistrationResult | null;
|
|
27
|
+
isRegistered: boolean;
|
|
12
28
|
}
|
|
13
29
|
interface MlinkAdapter {
|
|
14
30
|
connect: () => Promise<string>;
|
|
@@ -78,6 +94,14 @@ interface MlinkProps {
|
|
|
78
94
|
onError?: (error: string) => void;
|
|
79
95
|
className?: string;
|
|
80
96
|
stylePreset?: 'default' | 'compact' | 'minimal';
|
|
97
|
+
/** Registry URL for validation (defaults to https://mlinks-fe.vercel.app) */
|
|
98
|
+
registryUrl?: string;
|
|
99
|
+
/** Whether to require registration for the mlink to work (defaults to true) */
|
|
100
|
+
requireRegistration?: boolean;
|
|
101
|
+
/** Whether to allow pending mlinks (defaults to true) */
|
|
102
|
+
allowPending?: boolean;
|
|
103
|
+
/** Whether to allow blocked mlinks (defaults to false) */
|
|
104
|
+
allowBlocked?: boolean;
|
|
81
105
|
}
|
|
82
106
|
interface ActionButtonProps {
|
|
83
107
|
label: string;
|
|
@@ -97,6 +121,14 @@ interface ExecutionResult {
|
|
|
97
121
|
interface UseMlinkOptions {
|
|
98
122
|
refreshInterval?: number;
|
|
99
123
|
enabled?: boolean;
|
|
124
|
+
/** Registry URL for validation (defaults to https://mlinks-fe.vercel.app) */
|
|
125
|
+
registryUrl?: string;
|
|
126
|
+
/** Whether to require registration for the mlink to work (defaults to true) */
|
|
127
|
+
requireRegistration?: boolean;
|
|
128
|
+
/** Whether to allow pending mlinks (defaults to true) */
|
|
129
|
+
allowPending?: boolean;
|
|
130
|
+
/** Whether to allow blocked mlinks (defaults to false) */
|
|
131
|
+
allowBlocked?: boolean;
|
|
100
132
|
}
|
|
101
133
|
interface UseExecuteMlinkReturn {
|
|
102
134
|
execute: (action: string, input?: string) => Promise<ExecutionResult>;
|
|
@@ -106,7 +138,7 @@ interface UseExecuteMlinkReturn {
|
|
|
106
138
|
reset: () => void;
|
|
107
139
|
}
|
|
108
140
|
|
|
109
|
-
declare function Mlink({ url, adapter, theme: themeProp, onSuccess, onError, className, stylePreset, }: MlinkProps): react_jsx_runtime.JSX.Element;
|
|
141
|
+
declare function Mlink({ url, adapter, theme: themeProp, onSuccess, onError, className, stylePreset, registryUrl, requireRegistration, allowPending, allowBlocked, }: MlinkProps): react_jsx_runtime.JSX.Element;
|
|
110
142
|
|
|
111
143
|
interface MlinkContextValue {
|
|
112
144
|
theme: MlinkTheme;
|
|
@@ -126,7 +158,13 @@ interface UseExecuteMlinkOptions {
|
|
|
126
158
|
onSuccess?: (txHash: string, action: string) => void;
|
|
127
159
|
onError?: (error: string) => void;
|
|
128
160
|
}
|
|
129
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Enhanced UseExecuteMlinkReturn with data parameter support
|
|
163
|
+
*/
|
|
164
|
+
interface UseExecuteMlinkReturnEnhanced extends Omit<UseExecuteMlinkReturn, 'execute'> {
|
|
165
|
+
execute: (action: string, input?: string, data?: Record<string, string | string[]>) => Promise<ExecutionResult>;
|
|
166
|
+
}
|
|
167
|
+
declare function useExecuteMlink(options: UseExecuteMlinkOptions): UseExecuteMlinkReturnEnhanced;
|
|
130
168
|
|
|
131
169
|
/**
|
|
132
170
|
* Create a Mlink adapter from wagmi hooks
|
|
@@ -205,4 +243,4 @@ declare const mantleTheme: MlinkTheme;
|
|
|
205
243
|
declare const themePresets: Record<MlinkThemePreset, MlinkTheme>;
|
|
206
244
|
declare function resolveTheme(theme?: Partial<MlinkTheme> | MlinkThemePreset): MlinkTheme;
|
|
207
245
|
|
|
208
|
-
export { type ActionButtonProps, type EthersAdapterConfig, type ExecutionResult, Mlink, type MlinkAdapter, Mlink as MlinkComponent, type MlinkInstance, type MlinkProps, MlinkProvider, type MlinkProviderConfig, type MlinkStatus, type MlinkTheme, type MlinkThemePreset, type UseExecuteMlinkReturn, type UseMlinkOptions, type WagmiAdapterConfig, createMlinkAdapter, darkTheme, lightTheme, mantleTheme, resolveTheme, themePresets, useExecuteMlink, useMlink, useMlinkContext, useMlinkEthersAdapter, useMlinkWagmiAdapter };
|
|
246
|
+
export { type ActionButtonProps, type EthersAdapterConfig, type ExecutionResult, Mlink, type MlinkAdapter, Mlink as MlinkComponent, type MlinkInstance, type MlinkProps, MlinkProvider, type MlinkProviderConfig, type MlinkStatus, type MlinkTheme, type MlinkThemePreset, type RegistrationResult, type RegistrationStatus, type UseExecuteMlinkReturn, type UseExecuteMlinkReturnEnhanced, type UseMlinkOptions, type WagmiAdapterConfig, createMlinkAdapter, darkTheme, lightTheme, mantleTheme, resolveTheme, themePresets, useExecuteMlink, useMlink, useMlinkContext, useMlinkEthersAdapter, useMlinkWagmiAdapter };
|