@hyperauth/vue 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/dist/chains.d.ts +5 -0
- package/dist/chains.d.ts.map +1 -0
- package/dist/csp.d.ts +20 -0
- package/dist/csp.d.ts.map +1 -0
- package/dist/env.d.ts +7 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/iframe-bridge.d.ts +20 -0
- package/dist/iframe-bridge.d.ts.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4248 -0
- package/dist/index.js.map +59 -0
- package/dist/injection-key.d.ts +4 -0
- package/dist/injection-key.d.ts.map +1 -0
- package/dist/policy.d.ts +36 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/provider.d.ts +29 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/store.d.ts +8 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/types.d.ts +156 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/button.d.ts +48 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/modal.d.ts +46 -0
- package/dist/ui/modal.d.ts.map +1 -0
- package/dist/ui/settlement-progress.d.ts +17 -0
- package/dist/ui/settlement-progress.d.ts.map +1 -0
- package/dist/use-account.d.ts +16 -0
- package/dist/use-account.d.ts.map +1 -0
- package/dist/use-hyperauth.d.ts +8 -0
- package/dist/use-hyperauth.d.ts.map +1 -0
- package/dist/use-login.d.ts +20 -0
- package/dist/use-login.d.ts.map +1 -0
- package/dist/use-policy-mint.d.ts +50 -0
- package/dist/use-policy-mint.d.ts.map +1 -0
- package/dist/use-policy-verify.d.ts +27 -0
- package/dist/use-policy-verify.d.ts.map +1 -0
- package/dist/use-registration.d.ts +14 -0
- package/dist/use-registration.d.ts.map +1 -0
- package/dist/use-session.d.ts +17 -0
- package/dist/use-session.d.ts.map +1 -0
- package/dist/use-settlement.d.ts +17 -0
- package/dist/use-settlement.d.ts.map +1 -0
- package/dist/use-signer.d.ts +19 -0
- package/dist/use-signer.d.ts.map +1 -0
- package/dist/use-store.d.ts +13 -0
- package/dist/use-store.d.ts.map +1 -0
- package/dist/use-transaction.d.ts +18 -0
- package/dist/use-transaction.d.ts.map +1 -0
- package/package.json +48 -0
package/dist/chains.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SupportedChain } from './types';
|
|
2
|
+
export declare const chainIds: Record<SupportedChain, number>;
|
|
3
|
+
export declare const explorerUrls: Record<SupportedChain, string>;
|
|
4
|
+
export declare function txExplorerUrl(chain: SupportedChain, hash: string): string;
|
|
5
|
+
//# sourceMappingURL=chains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKvD,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzE"}
|
package/dist/csp.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest of Content Security Policy directives the SDK depends on.
|
|
3
|
+
*
|
|
4
|
+
* Apps that ship a CSP need to merge these directives — otherwise the worker
|
|
5
|
+
* fails to boot, OPFS writes get blocked, or the bundler ALPN handshake
|
|
6
|
+
* silently drops.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { cspManifest } from '@hyperauth/vue'
|
|
10
|
+
* // merge into your CSP middleware
|
|
11
|
+
*/
|
|
12
|
+
export declare const cspManifest: {
|
|
13
|
+
readonly 'worker-src': readonly ["'self'", "blob:"];
|
|
14
|
+
readonly 'script-src': readonly ["'self'", "'wasm-unsafe-eval'"];
|
|
15
|
+
readonly 'connect-src': readonly ["'self'", "https://*.hyperauth.io", "https://*.hyperauth.dev", "https://*.pimlico.io", "wss://*.hyperauth.io", "https://api.transak.com", "https://api.sardine.ai"];
|
|
16
|
+
readonly 'frame-src': readonly ["'self'", "https://*.hyperauth.io"];
|
|
17
|
+
readonly 'img-src': readonly ["'self'", "data:", "blob:"];
|
|
18
|
+
};
|
|
19
|
+
export declare function cspManifestString(): string;
|
|
20
|
+
//# sourceMappingURL=csp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csp.d.ts","sourceRoot":"","sources":["../src/csp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW;;;;;;CAcd,CAAC;AAEX,wBAAgB,iBAAiB,IAAI,MAAM,CAI1C"}
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** True only in the browser, after hydration is safe. */
|
|
2
|
+
export declare const isBrowser: () => boolean;
|
|
3
|
+
export declare const hasWebAuthn: () => boolean;
|
|
4
|
+
export declare const hasWorkers: () => boolean;
|
|
5
|
+
export declare const hasOPFS: () => boolean;
|
|
6
|
+
export declare function getOrigin(): string | null;
|
|
7
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,eAAO,MAAM,SAAS,QAAO,OACsC,CAAC;AAEpE,eAAO,MAAM,WAAW,QAAO,OACmC,CAAC;AAEnE,eAAO,MAAM,UAAU,QAAO,OACgB,CAAC;AAE/C,eAAO,MAAM,OAAO,QAAO,OAG2B,CAAC;AAEvD,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAGzC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden iframe that hosts the enclave when the dApp's origin doesn't match
|
|
3
|
+
* the HyperAuth deployment. Communication is postMessage-based — this lets
|
|
4
|
+
* the host page skip the COOP/COEP requirements that SharedArrayBuffer
|
|
5
|
+
* normally imposes, since the enclave runs inside its own origin.
|
|
6
|
+
*/
|
|
7
|
+
export interface IframeBridge {
|
|
8
|
+
iframe: HTMLIFrameElement | null;
|
|
9
|
+
call: <T = unknown>(method: string, payload?: unknown, timeoutMs?: number) => Promise<T>;
|
|
10
|
+
destroy: () => void;
|
|
11
|
+
isReady: () => boolean;
|
|
12
|
+
}
|
|
13
|
+
interface MountOptions {
|
|
14
|
+
origin: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
readyTimeoutMs?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function mountIframeBridge(opts: MountOptions): Promise<IframeBridge>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=iframe-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iframe-bridge.d.ts","sourceRoot":"","sources":["../src/iframe-bridge.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACzF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC;CACxB;AAED,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CA4FjF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { createHyperAuth } from './provider';
|
|
2
|
+
export { useHyperAuth } from './use-hyperauth';
|
|
3
|
+
export { HyperAuthKey } from './injection-key';
|
|
4
|
+
export { useLogin } from './use-login';
|
|
5
|
+
export type { UseLoginReturn, LoginOptions } from './use-login';
|
|
6
|
+
export { useSession } from './use-session';
|
|
7
|
+
export type { UseSessionReturn } from './use-session';
|
|
8
|
+
export { useAccount } from './use-account';
|
|
9
|
+
export type { UseAccountReturn } from './use-account';
|
|
10
|
+
export { useTransaction } from './use-transaction';
|
|
11
|
+
export type { UseTransactionReturn } from './use-transaction';
|
|
12
|
+
export { useSettlement } from './use-settlement';
|
|
13
|
+
export type { UseSettlementReturn } from './use-settlement';
|
|
14
|
+
export { useRegistration } from './use-registration';
|
|
15
|
+
export type { UseRegistrationReturn } from './use-registration';
|
|
16
|
+
export { useSigner } from './use-signer';
|
|
17
|
+
export type { UseSignerReturn } from './use-signer';
|
|
18
|
+
export { usePolicyMint, buildPolicyPreview } from './use-policy-mint';
|
|
19
|
+
export type { UsePolicyMintReturn, UsePolicyMintOptions, PolicyParams, UCANPolicyPayload, PolicyMintStatus, } from './use-policy-mint';
|
|
20
|
+
export { usePolicyVerify } from './use-policy-verify';
|
|
21
|
+
export type { UsePolicyVerifyReturn, UsePolicyVerifyOptions, PolicyVerifyStatus, } from './use-policy-verify';
|
|
22
|
+
export { parsePolicyToken, getPolicyFacts, isPolicyExpired, isOriginAllowedByFacts, PolicyTokenParseError, } from './policy';
|
|
23
|
+
export type { ParsedPolicyToken, PolicyFacts } from './policy';
|
|
24
|
+
export { Button, Modal, ModalBackdrop, ModalContent, ModalClose, SettlementProgress } from './ui';
|
|
25
|
+
export type { ButtonProps, ModalProps, ModalBackdropProps, ModalContentProps, ModalCloseProps, SettlementProgressProps, } from './ui';
|
|
26
|
+
export { cspManifest, cspManifestString } from './csp';
|
|
27
|
+
export { mountIframeBridge } from './iframe-bridge';
|
|
28
|
+
export type { IframeBridge } from './iframe-bridge';
|
|
29
|
+
export { chainIds, explorerUrls, txExplorerUrl } from './chains';
|
|
30
|
+
export type { HyperAuthStatus, AuthStatus, ProviderKind, SupportedChain, HyperAuthContextValue, HyperAuthPluginOptions, User, IdentityState, SessionKey, CreateSessionOptions, TransactionIntent, TransactionPhase, TransactionResult, SettlementPhase, SettlementStep, SettlementParams, SettlementState, UcanPolicy, Store, StoreState, RegistrationPhase, RegistrationOutcome, RegistrationStep, } from './types';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAE,eAAe,E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