@aurum-sdk/core 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 +420 -0
- package/dist/chunk-DHEVW7CR.js +2432 -0
- package/dist/chunk-DHEVW7CR.js.map +1 -0
- package/dist/chunk-U5BSED2R.mjs +2432 -0
- package/dist/chunk-U5BSED2R.mjs.map +1 -0
- package/dist/index.css +743 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +273 -0
- package/dist/index.d.ts +273 -0
- package/dist/index.js +2433 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2433 -0
- package/dist/index.mjs.map +1 -0
- package/dist/widgets.css +743 -0
- package/dist/widgets.css.map +1 -0
- package/dist/widgets.d.mts +88 -0
- package/dist/widgets.d.ts +88 -0
- package/dist/widgets.js +78 -0
- package/dist/widgets.js.map +1 -0
- package/dist/widgets.mjs +78 -0
- package/dist/widgets.mjs.map +1 -0
- package/package.json +113 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/globals.css","../src/ui/Badge/Badge.css","../src/ui/Button/Button.css","../src/ui/Divider/Divider.css","../src/components/PoweredBy/PoweredBy.css","../src/ui/Modal/Modal.css","../src/ui/Spinner/Spinner.css","../src/ui/Text/Text.css","../src/components/ModalHeader/ModalHeader.css","../src/components/ConnectModal/EmailAuth.css","../src/components/ConnectModal/WalletGrid.css","../src/components/ConnectModal/AdditionalWalletsIcon.css","../src/components/ConnectModal/ConnectionStatus/ConnectionStatus.css","../src/components/QRCodeDisplay/QRCodeSkeleton.css","../src/components/QRCodeDisplay/QRCodeDisplay.css"],"sourcesContent":["/* ============================================\n AURUM SDK - DESIGN TOKEN SYSTEM\n ============================================\n\n Google Fonts:\n - Noto Sans: 400, 500, 600, 700\n ============================================ */\n\n@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');\n\n/* ============================================\n External variables (injected by createShadowRoot.ts):\n - --aurum-primary-color: Brand color from dapp\n - --aurum-border-radius-*: Radius scale tokens\n - --aurum-modal-z-index: Modal z-index\n - --aurum-font-family: Font family from dapp\n ============================================ */\n\n/* Base reset styles for Shadow DOM */\n:host {\n all: initial;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Ensure form elements inherit font from parent */\ninput,\nbutton,\ntextarea,\nselect {\n font-family: inherit;\n}\n\n.aurum-sdk {\n /* ==========================================\n TYPOGRAPHY\n ========================================== */\n font-family: var(--aurum-font-family);\n font-size: 1rem;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n\n /* Font weights */\n --font-normal: 400;\n --font-medium: 500;\n --font-semibold: 600;\n --font-bold: 700;\n\n /* ==========================================\n TRANSITIONS\n ========================================== */\n --duration-fast: 100ms;\n --duration-normal: 200ms;\n --duration-slow: 300ms;\n --ease-default: cubic-bezier(0.4, 0, 0.2, 1);\n --ease-in: cubic-bezier(0.4, 0, 1, 1);\n --ease-out: cubic-bezier(0, 0, 0.2, 1);\n\n /* ==========================================\n LIGHT THEME COLORS (Default)\n ========================================== */\n\n /* Foreground / Text */\n --color-foreground: #0c0c0c;\n --color-foreground-muted: #787878;\n --color-foreground-subtle: #979797;\n\n /* Card surfaces */\n --color-card: #ffffff;\n\n /* Borders */\n --color-border: #d9d9d9;\n --color-border-muted: #c0c0c0;\n --color-border-focus: var(--aurum-primary-color);\n\n /* Brand / Primary (from integrator) */\n --color-primary: var(--aurum-primary-color);\n --color-primary-foreground: #ffffff;\n --color-primary-hover: color-mix(in srgb, var(--aurum-primary-color) 85%, #000);\n --color-primary-muted: color-mix(in srgb, var(--aurum-primary-color) 15%, transparent);\n\n /* Interactive elements */\n --color-accent: #f1f1f1;\n --color-accent-foreground: #0d0d0d;\n --color-accent-hover: #e6e6e6;\n\n /* Semantic colors */\n --color-success: #22c55e;\n --color-error: #ef4444;\n\n /* Overlay / Modal */\n --color-overlay: rgb(0 0 0 / 0.5);\n\n /* Ring (focus indicator) */\n --color-ring: var(--aurum-primary-color);\n --ring-offset: 0.125rem;\n\n /* Shadows */\n --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n}\n\n/* ==========================================\n DARK THEME COLORS\n ========================================== */\n\n.aurum-sdk[data-theme='dark'] {\n /* Foreground / Text */\n --color-foreground: #fafafa;\n --color-foreground-muted: #a9a9a9;\n --color-foreground-subtle: #777777;\n\n /* Card surfaces */\n --color-card: #151515;\n\n /* Borders */\n --color-border: #282828;\n --color-border-muted: #424242;\n --color-border-focus: var(--aurum-primary-color);\n\n /* Brand / Primary (from integrator) */\n --color-primary: var(--aurum-primary-color);\n --color-primary-foreground: #0a0a0a;\n --color-primary-hover: color-mix(in srgb, var(--aurum-primary-color) 85%, #fff);\n --color-primary-muted: color-mix(in srgb, var(--aurum-primary-color) 20%, transparent);\n\n /* Interactive elements */\n --color-accent: #272727;\n --color-accent-foreground: #fafafa;\n --color-accent-hover: #404040;\n\n /* Semantic colors */\n --color-success: #22c55e;\n --color-error: #ef4444;\n\n /* Overlay / Modal */\n --color-overlay: rgb(0 0 0 / 0.7);\n\n /* Ring (focus indicator) */\n --color-ring: var(--aurum-primary-color);\n --ring-offset: 0.125rem;\n\n /* Shadows */\n --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);\n}\n",".aurum-badge-recent {\n padding: 0.25rem 0.5rem;\n border-radius: var(--aurum-border-radius-xs);\n\n font-size: 0.65rem;\n line-height: 1;\n letter-spacing: 0.07em;\n text-transform: uppercase;\n\n color: var(--color-foreground-muted);\n}\n",".aurum-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n font-weight: var(--font-semibold);\n cursor: pointer;\n transition:\n background-color var(--duration-normal) var(--ease-default),\n color var(--duration-normal) var(--ease-default),\n transform var(--duration-fast) var(--ease-default),\n box-shadow var(--duration-normal) var(--ease-default);\n text-decoration: none;\n box-sizing: border-box;\n position: relative;\n outline: none;\n font-family: inherit;\n}\n\n.aurum-button:focus-visible {\n outline: 2px solid var(--color-ring);\n outline-offset: var(--ring-offset);\n}\n\n.aurum-button--xs {\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n gap: 0.25rem;\n border-radius: var(--aurum-border-radius-xs);\n}\n\n.aurum-button--sm {\n padding: 0.5rem 0.75rem;\n font-size: 0.875rem;\n gap: 0.25rem;\n border-radius: calc(var(--aurum-border-radius-sm) - 2px);\n}\n\n.aurum-button--md {\n padding: 0.75rem 1rem;\n font-size: 0.9rem;\n gap: 0.5rem;\n border-radius: calc(var(--aurum-border-radius-md) - 2px);\n}\n\n.aurum-button--lg {\n padding: 1rem 1.5rem;\n font-size: 1rem;\n gap: 0.75rem;\n border-radius: var(--aurum-border-radius-md);\n}\n\n.aurum-button--full-width {\n width: 100%;\n}\n\n.aurum-button--primary {\n background-color: var(--color-primary);\n color: var(--color-primary-foreground);\n}\n\n.aurum-button--primary:active:not(:disabled) {\n transform: scale(0.98);\n}\n\n.aurum-button--secondary {\n background-color: var(--color-accent);\n color: var(--color-accent-foreground);\n}\n\n.aurum-button--secondary:active:not(:disabled) {\n transform: scale(0.98);\n}\n\n.aurum-button--tertiary {\n background: transparent;\n color: var(--color-foreground);\n border: 1px solid var(--color-border);\n}\n\n.aurum-button--tertiary:active:not(:disabled) {\n transform: scale(0.98);\n}\n\n.aurum-button--text {\n background: transparent;\n color: var(--color-primary);\n padding: 0.25rem;\n}\n\n.aurum-button--text:not(.aurum-button--full-width) {\n width: fit-content;\n}\n\n.aurum-button--text:active:not(:disabled) {\n transform: scale(0.98);\n}\n\n.aurum-button--close {\n background: transparent;\n color: var(--color-foreground-muted);\n border: none;\n padding: 0.5rem;\n border-radius: var(--aurum-border-radius-md);\n font-size: 1.25rem;\n line-height: 1;\n}\n\n.aurum-button--close:active:not(:disabled) {\n transform: scale(0.95);\n}\n\n/* Hover styles only for devices with hover capability (not touch) */\n@media (hover: hover) {\n .aurum-button--primary:hover:not(:disabled) {\n background-color: var(--color-primary-hover);\n }\n\n .aurum-button--secondary:hover:not(:disabled) {\n background-color: var(--color-accent-hover);\n }\n\n .aurum-button--tertiary:hover:not(:disabled) {\n background-color: var(--color-accent);\n border-color: var(--color-border-muted);\n }\n\n .aurum-button--text:hover:not(:disabled) {\n opacity: 0.7;\n }\n\n .aurum-button--close:hover:not(:disabled) {\n background-color: var(--color-accent);\n color: var(--color-foreground);\n }\n}\n\n.aurum-button--disabled,\n.aurum-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.aurum-button--loading {\n pointer-events: none;\n}\n",".divider {\n display: flex;\n align-items: center;\n width: 100%;\n}\n\n.divider-line {\n flex: 1;\n height: 1px;\n background-color: var(--color-border);\n}\n\n.divider-text {\n padding: 0 1rem;\n color: var(--color-foreground-subtle);\n font-size: 0.875rem;\n font-weight: var(--font-medium);\n}\n",".powered-by-container {\n position: absolute;\n bottom: 1rem;\n left: 0;\n right: 0;\n width: 100%;\n}\n",".modal-overlay {\n position: fixed;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: var(--aurum-modal-z-index);\n background-color: var(--color-overlay);\n opacity: 0;\n}\n\n.modal-overlay.modal-open {\n opacity: 1;\n transition: opacity 150ms ease-out;\n}\n\n.modal-overlay.modal-exiting {\n opacity: 0;\n transition: opacity 150ms ease-in;\n}\n\n.modal-content {\n position: relative;\n width: 23.75rem;\n min-width: 17rem;\n padding: 1.25rem 1.5rem;\n color: var(--color-card-foreground);\n background-color: var(--color-card);\n border-radius: var(--aurum-border-radius-lg);\n box-shadow: var(--shadow);\n border: 1px solid var(--color-border-muted);\n outline: none;\n opacity: 0;\n transform: scale(0.95);\n}\n\n.modal-overlay.modal-open .modal-content {\n opacity: 1;\n transform: scale(1);\n transition:\n opacity 150ms ease-out,\n transform 150ms ease-out;\n}\n\n.modal-overlay.modal-exiting .modal-content {\n opacity: 0;\n transform: scale(0.95);\n transition:\n opacity 150ms ease-in,\n transform 150ms ease-in;\n}\n\n.modal-page-container {\n position: relative;\n width: 100%;\n overflow-x: visible;\n overflow-y: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.modal-page-container::-webkit-scrollbar {\n display: none;\n}\n\n.modal-page {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n opacity: 0;\n transition: opacity 0s;\n}\n\n.modal-page.active {\n opacity: 1;\n transition: opacity var(--duration-slow) var(--ease-out);\n}\n\n/* Mobile drawer layout */\n@media (max-width: 30.25rem) {\n .modal-overlay {\n align-items: flex-end;\n justify-content: center;\n opacity: 1;\n transition: none;\n }\n\n .modal-overlay.modal-open {\n transition: none;\n }\n\n .modal-overlay.modal-exiting {\n opacity: 1;\n background-color: transparent;\n transition: none;\n }\n\n .modal-content {\n width: 100%;\n max-height: 82vh;\n max-height: 82dvh;\n min-height: 35vh;\n min-height: 35dvh;\n padding: 1rem;\n border-radius: var(--aurum-border-radius-lg) var(--aurum-border-radius-lg) 0 0;\n border-bottom: none;\n display: flex;\n flex-direction: column;\n height: auto;\n opacity: 1;\n transform: translateY(100%);\n }\n\n .modal-overlay.modal-open .modal-content {\n opacity: 1;\n transform: translateY(0);\n transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .modal-overlay.modal-exiting .modal-content {\n opacity: 1;\n transform: translateY(100%);\n transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .modal-page-container {\n flex: 0 1 auto;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n }\n\n .modal-page {\n flex: 0 1 auto;\n display: flex;\n flex-direction: column;\n }\n}\n",".spinner {\n flex-shrink: 0;\n animation: spinner-rotate 1s linear infinite;\n}\n\n@keyframes spinner-rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",".aurum-text {\n margin: 0;\n padding: 0;\n font-family: inherit;\n line-height: 1.5;\n}\n\n.aurum-text--primary {\n color: var(--color-foreground);\n}\n\n.aurum-text--secondary {\n color: var(--color-foreground-muted);\n}\n\n.aurum-text--tertiary {\n color: var(--color-foreground-subtle);\n}\n\n.aurum-text--error {\n color: var(--color-error);\n}\n\n.aurum-text--brand {\n color: var(--color-primary);\n}\n\n.aurum-text--success {\n color: var(--color-success);\n}\n\n.aurum-text--xs {\n font-size: 0.75rem;\n line-height: 1.4;\n}\n\n.aurum-text--sm {\n font-size: 0.875rem;\n line-height: 1.45;\n}\n\n.aurum-text--md {\n font-size: 1rem;\n line-height: 1.5;\n}\n\n.aurum-text--lg {\n font-size: 1.125rem;\n line-height: 1.5;\n}\n\n.aurum-text--normal {\n font-weight: var(--font-normal);\n}\n\n.aurum-text--semibold {\n font-weight: var(--font-semibold);\n}\n\n.aurum-text--bold {\n font-weight: var(--font-bold);\n}\n\n.aurum-text--align-left {\n text-align: left;\n}\n\n.aurum-text--align-center {\n text-align: center;\n}\n\n.aurum-text--align-right {\n text-align: right;\n}\n",".modal-header {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding: 1rem;\n background-color: var(--color-card);\n border-radius: var(--aurum-border-radius-lg) var(--aurum-border-radius-lg) 0 0;\n z-index: 1;\n display: grid;\n grid-template-columns: 1fr auto 1fr;\n align-items: center;\n}\n\n.modal-header > div {\n display: flex;\n align-items: center;\n width: 100%;\n}\n\n.modal-header-left {\n justify-content: flex-start;\n min-width: 2.25rem;\n height: 2.25rem;\n}\n\n.modal-header-center {\n justify-content: center;\n max-width: 12.5rem;\n text-align: center;\n line-height: 1.2;\n overflow-wrap: break-word;\n}\n\n.modal-header-right {\n justify-content: flex-end;\n min-width: 2.25rem;\n height: 2.25rem;\n}\n",".email-auth-input {\n width: 100%;\n outline: none;\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.75rem;\n box-sizing: border-box;\n padding: 0.75rem 3rem 0.75rem 3rem;\n color: var(--color-foreground);\n transition:\n outline 0.2s ease,\n border-color 0.2s ease;\n background-color: var(--color-card);\n border-width: 1px;\n border-style: solid;\n border-color: var(--color-border);\n border-radius: var(--aurum-border-radius-md);\n}\n\n.email-auth-input:hover:not(:focus):not(.email-auth-input--error) {\n border-color: var(--color-border-muted);\n}\n\n.email-auth-input:focus {\n outline: 2px solid var(--color-ring);\n outline-offset: var(--ring-offset);\n}\n\n.email-auth-input--error {\n outline: 2px solid var(--color-error);\n outline-offset: var(--ring-offset);\n}\n\n.email-auth-submit-button.aurum-button {\n top: 50%;\n right: 0.75rem;\n height: auto;\n padding: 0.5rem;\n min-width: auto;\n position: absolute;\n transform: translateY(-50%);\n border-radius: var(--aurum-border-radius-sm);\n}\n\n.email-auth-icon {\n top: 50%;\n left: 1rem;\n position: absolute;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n pointer-events: none;\n}\n",".aurum-wallet-grid {\n display: grid;\n grid-template-columns: repeat(var(--grid-columns, 3), 1fr);\n gap: 10px;\n width: 100%;\n}\n",".additional-wallets-container {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.additional-wallets-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-template-rows: 1fr 1fr;\n gap: 0.125rem;\n align-items: center;\n justify-items: center;\n}\n\n.additional-wallets-grid-item {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.additional-wallets-placeholder {\n background-color: var(--aurum-color-bg-tertiary);\n border-radius: var(--aurum-border-radius-xs);\n opacity: 0.4;\n}\n\n.circular-icon-wrapper {\n border-radius: 50%;\n overflow: hidden;\n border: 2px solid var(--aurum-color-bg-secondary);\n}\n\n.circular-icon-wrapper--front {\n z-index: 2;\n}\n\n.circular-icon-wrapper--back {\n margin-left: -0.5rem;\n z-index: 1;\n}\n","@keyframes shake {\n 0%,\n 100% {\n transform: translateX(0);\n }\n 20%,\n 60% {\n transform: translateX(-0.125rem);\n }\n 40%,\n 80% {\n transform: translateX(0.125rem);\n }\n}\n\n@keyframes opacity-pulse {\n 0%,\n 100% {\n opacity: 0.4;\n }\n 50% {\n opacity: 1;\n }\n}\n\n@keyframes scale-in {\n from {\n transform: scale(0.75);\n }\n to {\n transform: scale(1);\n }\n}\n\n.wallet-icon-shake {\n /* Duration synced with ANIMATION_DURATION.SHAKE in constants/theme.ts */\n animation: shake var(--duration-slow) var(--ease-default);\n}\n\n.ellipses-loading,\n.ellipses-success,\n.status-icon-with-dots {\n display: flex;\n gap: 0.25rem;\n align-items: center;\n justify-content: center;\n width: 100%;\n}\n\n.ellipses-loading span,\n.ellipses-success span,\n.status-icon-with-dots .dot,\n.status-icon-with-dots .icon-center {\n font-size: 3rem;\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 0.9375rem;\n height: 3rem;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n}\n\n.ellipses-loading span,\n.ellipses-success span,\n.status-icon-with-dots .dot {\n transform: translateY(-0.28125rem);\n}\n\n.status-icon-with-dots .icon-center {\n transform: translateY(-0.2rem);\n}\n\n.ellipses-loading span {\n color: var(--color-foreground-subtle);\n opacity: 0.4;\n animation: opacity-pulse 1.5s var(--ease-default) infinite;\n will-change: opacity;\n}\n\n.ellipses-loading span:nth-child(2) {\n animation-delay: 0.2s;\n}\n.ellipses-loading span:nth-child(3) {\n animation-delay: 0.4s;\n}\n.ellipses-loading span:nth-child(4) {\n animation-delay: 0.6s;\n}\n.ellipses-loading span:nth-child(5) {\n animation-delay: 0.8s;\n}\n\n.ellipses-success span,\n.status-icon-with-dots.success .dot {\n color: var(--aurum-primary-color);\n}\n\n.status-icon-with-dots.error .dot {\n color: var(--color-error);\n}\n\n.status-button {\n display: flex;\n align-items: flex-start;\n justify-content: center;\n width: 100%;\n}\n\n.success-icon-large {\n animation: scale-in var(--duration-fast) var(--ease-out);\n}\n\n/* Logo containers for visual balance */\n.brand-logo-container,\n.wallet-logo-with-retry {\n position: relative;\n display: inline-block;\n}\n\n/* Always reserve space on both sides to prevent layout shift when retry button appears/disappears */\n.brand-logo-container {\n margin-left: 0.375rem; /* Matches retry button's right: -0.375rem */\n}\n\n.wallet-logo-with-retry {\n margin-right: 0.375rem; /* Reserve space for retry button */\n}\n\n.retry-icon-overlay.retry-icon-overlay {\n position: absolute;\n bottom: -0.125rem;\n right: -0.375rem;\n width: 1.625rem;\n height: 1.625rem;\n min-width: 1.625rem;\n min-height: 1.625rem;\n border-radius: 50%;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n",".qr-skeleton-container {\n width: 100%;\n position: relative;\n}\n\n.qr-skeleton-svg {\n display: block;\n position: relative;\n z-index: 2;\n border-radius: var(--aurum-border-radius-sm);\n}\n\n.qr-skeleton-dot {\n opacity: 0.7;\n}\n\n.qr-skeleton-eye {\n opacity: 0.7;\n}\n","@keyframes qr-shimmer {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.qr-container-shimmer {\n position: relative;\n overflow: hidden; /* Keep for shimmer animation */\n}\n\n.qr-container-shimmer::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n color-mix(in srgb, var(--color-foreground) 10%, transparent) 50%,\n transparent 100%\n );\n animation: qr-shimmer 2s infinite;\n pointer-events: none;\n z-index: 1;\n}\n\n.qr-container {\n border-radius: var(--aurum-border-radius-md);\n border: 1px solid var(--color-border);\n padding: 0.5rem;\n box-sizing: content-box;\n transition: border-color var(--duration-slow) var(--ease-default);\n}\n\n.qr-subtitle {\n max-width: 15rem;\n}\n"],"mappings":";;;AAmBA;AACE,OAAK;AACP;AAEA;AACA,CAAC;AACD,CAAC;AACC,cAAY;AACd;AAGA;AACA;AACA;AACA;AACE,eAAa;AACf;AAEA,CAAC;AAIC,eAAa,IAAI;AACjB,aAAW;AACX,eAAa;AACb,0BAAwB;AACxB,2BAAyB;AAGzB,iBAAe;AACf,iBAAe;AACf,mBAAiB;AACjB,eAAa;AAKb,mBAAiB;AACjB,qBAAmB;AACnB,mBAAiB;AACjB,kBAAgB,aAAa,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C,YAAU;AACV,YAAU;AACZ;AAEA,CALC,oBAKoB;AACnB,WAAS;AACT,YAAU;AACV,OAAK;AACL,QAAM;AACN,SAAO;AACP,UAAQ;AACR;AAAA,IAAY;AAAA,MACV,KAAK;AAAA,MACL,YAAY,EAAE;AAAA,MACd,UAAU,GAAG,IAAI,EAAE,IAAI,oBAAoB,GAAG,EAAE,aAAa,GAAG;AAAA,MAChE,YAAY;AAEd,aAAW,WAAW,GAAG;AACzB,kBAAgB;AAChB,WAAS;AACX;AAEA,CAAC;AACC,iBAAe,IAAI;AACnB,UAAQ,IAAI,MAAM,IAAI;AACtB,WAAS;AACT,cAAY;AACZ,cAAY,aAAa,IAAI,iBAAiB,IAAI;AACpD;AAEA,CAAC;AACC,aAAW;AACb;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { Chain } from 'viem';
|
|
2
|
+
import { WalletId, WalletName, AurumRpcProvider, AurumConfig, NonNullableBrandConfig, UserInfo, WalletsConfig, EmailAuthStartResult, EmailAuthVerifyResult, WalletConnectSessionResult } from '@aurum-sdk/types';
|
|
3
|
+
import { SignInWithEmailResult, VerifyEmailOTPResult } from '@coinbase/cdp-core';
|
|
4
|
+
|
|
5
|
+
interface WalletConnectionResult {
|
|
6
|
+
address: string;
|
|
7
|
+
provider: AurumRpcProvider;
|
|
8
|
+
walletId: WalletId;
|
|
9
|
+
email?: string;
|
|
10
|
+
}
|
|
11
|
+
interface WalletAdapter {
|
|
12
|
+
readonly id: WalletId;
|
|
13
|
+
readonly name: WalletName;
|
|
14
|
+
readonly icon: string;
|
|
15
|
+
readonly hide: boolean;
|
|
16
|
+
readonly downloadUrl: string | null;
|
|
17
|
+
readonly wcDeepLinkUrl: string | null;
|
|
18
|
+
isInstalled(): boolean;
|
|
19
|
+
getProvider(): AurumRpcProvider | null;
|
|
20
|
+
connect(): Promise<WalletConnectionResult>;
|
|
21
|
+
tryRestoreConnection(): Promise<WalletConnectionResult | null>;
|
|
22
|
+
disconnect(): Promise<void>;
|
|
23
|
+
emailAuthStart?(email: string): Promise<SignInWithEmailResult>;
|
|
24
|
+
emailAuthVerify?(email: string, otp: string): Promise<VerifyEmailOTPResult>;
|
|
25
|
+
onAccountsChanged(callback: (accounts: string[]) => void): void;
|
|
26
|
+
removeListeners(): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Aurum SDK - Web3 Wallet Integration Library
|
|
31
|
+
*/
|
|
32
|
+
declare class Aurum {
|
|
33
|
+
private core;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new Aurum instance.
|
|
36
|
+
*
|
|
37
|
+
* @param config - Configuration for branding and wallets
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const aurum = new Aurum({
|
|
42
|
+
* brand: { appName: 'Your App Name' },
|
|
43
|
+
* wallets: {
|
|
44
|
+
* email: { projectId: 'cdp-project-id' },
|
|
45
|
+
* walletConnect: { projectId: 'reown-project-id' },
|
|
46
|
+
* },
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
constructor(config: AurumConfig);
|
|
51
|
+
/**
|
|
52
|
+
* EIP1193 compatible RPC provider that can be used to interact with the connected wallet.
|
|
53
|
+
* Compatible with viem, ethers.js, and other web3 libraries.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const balance = await aurum.rpcProvider.request({
|
|
58
|
+
* method: 'eth_getBalance',
|
|
59
|
+
* params: [address, 'latest']
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
get rpcProvider(): AurumRpcProvider;
|
|
64
|
+
/**
|
|
65
|
+
* Indicates whether the SDK is finished initializing.
|
|
66
|
+
*/
|
|
67
|
+
get ready(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the resolved brand configuration.
|
|
70
|
+
* @internal Used by widget components (i.e. ConnectWidget)
|
|
71
|
+
*/
|
|
72
|
+
get brandConfig(): NonNullableBrandConfig;
|
|
73
|
+
/**
|
|
74
|
+
* Returns the wallet adapters configured for this instance.
|
|
75
|
+
* @internal Used by widget components (i.e. ConnectWidget)
|
|
76
|
+
*/
|
|
77
|
+
get walletAdapters(): WalletAdapter[];
|
|
78
|
+
/**
|
|
79
|
+
* Returns the set of excluded wallet IDs.
|
|
80
|
+
* @internal Used by widget components (i.e. ConnectWidget)
|
|
81
|
+
*/
|
|
82
|
+
get excludedWalletIds(): Set<WalletId>;
|
|
83
|
+
/**
|
|
84
|
+
* Waits for the SDK to finish initializing.
|
|
85
|
+
* This should be called before calling methods with the provider to ensure provider is set (such as after a page refresh).
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* await aurum.whenReady();
|
|
90
|
+
* const balance = await aurum.rpcProvider.request({
|
|
91
|
+
* method: 'eth_getBalance',
|
|
92
|
+
* params: [address, 'latest']
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
whenReady(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Opens the wallet connection modal or connects directly to a specific wallet.
|
|
99
|
+
*
|
|
100
|
+
* @param walletId - Optional wallet ID for direct connection (bypasses modal).
|
|
101
|
+
* Cannot be 'email' or 'walletconnect' (use their dedicated methods).
|
|
102
|
+
* @returns The connected wallet address
|
|
103
|
+
* @throws Error if user closes the modal without connecting a wallet
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* // Open modal for user to choose
|
|
108
|
+
* const address = await aurum.connect();
|
|
109
|
+
*
|
|
110
|
+
* // Or connect directly to a specific wallet
|
|
111
|
+
* import { WalletId } from '@aurum-sdk/types';
|
|
112
|
+
* const address = await aurum.connect(WalletId.MetaMask);
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
connect(walletId?: WalletId): Promise<`0x${string}`>;
|
|
116
|
+
/**
|
|
117
|
+
* Disconnects the currently connected wallet and clears the connection state.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* await aurum.disconnect();
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
disconnect(): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Gets information about the currently connected user.
|
|
127
|
+
*
|
|
128
|
+
* @returns User information including wallet address and wallet name, or undefined if no wallet is connected
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const userInfo = await aurum.getUserInfo();
|
|
133
|
+
* if (userInfo) {
|
|
134
|
+
* console.log(`Connected to ${userInfo.walletName}: ${userInfo.publicAddress}`);
|
|
135
|
+
* } else {
|
|
136
|
+
* console.log('No wallet connected');
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
getUserInfo(): Promise<UserInfo | undefined>;
|
|
141
|
+
/**
|
|
142
|
+
* Checks if a wallet is currently connected.
|
|
143
|
+
*
|
|
144
|
+
* @returns `true` if a wallet is connected, `false` otherwise
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const isConnected = await aurum.isConnected();
|
|
149
|
+
* console.log('Is user connected:', isConnected);
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
isConnected(): Promise<boolean>;
|
|
153
|
+
/**
|
|
154
|
+
* Gets the current chain ID of the connected wallet.
|
|
155
|
+
*
|
|
156
|
+
* @returns The current chain ID as a number
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const chainId = await aurum.getChainId();
|
|
161
|
+
* console.log('Connected to chain:', chainId);
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
getChainId(): Promise<number>;
|
|
165
|
+
/**
|
|
166
|
+
* Switches the connected wallet to a different blockchain network.
|
|
167
|
+
* If the chain is not added to the wallet, it will attempt to add it using the provided chain config.
|
|
168
|
+
*
|
|
169
|
+
* @param chainId - The chain ID to switch to (can be hex string, decimal string, or number)
|
|
170
|
+
* @param chain - Optional viem Chain object with chain configuration (required if chain needs to be added)
|
|
171
|
+
* @throws Error if the switch fails or the user rejects the request
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* import { sepolia } from 'viem/chains';
|
|
176
|
+
*
|
|
177
|
+
* await aurum.switchChain(sepolia.id, sepolia);
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
switchChain(chainId: `0x${string}` | string | number, chain?: Chain): Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Updates the brand configuration at runtime.
|
|
183
|
+
* Changes will be reflected the next time the connect modal is opened.
|
|
184
|
+
*
|
|
185
|
+
* @param newConfig - Partial brand config to merge with existing config
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* aurum.updateBrandConfig({
|
|
190
|
+
* theme: 'light',
|
|
191
|
+
* });
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
updateBrandConfig(newConfig: Partial<NonNullableBrandConfig>): void;
|
|
195
|
+
/**
|
|
196
|
+
* Updates the wallets configuration at runtime.
|
|
197
|
+
* Changes will be reflected the next time the connect modal is opened.
|
|
198
|
+
*
|
|
199
|
+
* @param newConfig - Partial wallets config to update (currently supports `exclude`)
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* import { WalletId } from '@aurum-sdk/types';
|
|
204
|
+
*
|
|
205
|
+
* aurum.updateWalletsConfig({
|
|
206
|
+
* exclude: [WalletId.Email, WalletId.AppKit],
|
|
207
|
+
* });
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
updateWalletsConfig(newConfig: Partial<Pick<WalletsConfig, 'exclude'>>): void;
|
|
211
|
+
/**
|
|
212
|
+
* Notifies the SDK of a widget-initiated connection.
|
|
213
|
+
* Updates internal state so getUserInfo(), isConnected(), etc. work correctly.
|
|
214
|
+
* @internal Used by ConnectWidget - not intended for direct use
|
|
215
|
+
*/
|
|
216
|
+
handleWidgetConnection(result: WalletConnectionResult): Promise<void>;
|
|
217
|
+
/**
|
|
218
|
+
* Starts the email authentication flow by sending an OTP to the provided email.
|
|
219
|
+
* Use with `emailAuthVerify()` to complete the connection.
|
|
220
|
+
*
|
|
221
|
+
* @param email - The email address to send the OTP to
|
|
222
|
+
* @returns Object containing flowId to use with emailAuthVerify
|
|
223
|
+
* @throws Error if email wallet is not configured
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* const { flowId } = await aurum.emailAuthStart('user@example.com');
|
|
228
|
+
* // User receives OTP email, then verify:
|
|
229
|
+
* const { address, email, isNewUser } = await aurum.emailAuthVerify(flowId, '123456');
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
emailAuthStart(email: string): Promise<EmailAuthStartResult>;
|
|
233
|
+
/**
|
|
234
|
+
* Verifies the email OTP and completes the wallet connection.
|
|
235
|
+
*
|
|
236
|
+
* @param flowId - The flowId returned from emailAuthStart
|
|
237
|
+
* @param otp - The OTP code the user received via email
|
|
238
|
+
* @returns Object containing the connected address and email
|
|
239
|
+
* @throws Error if verification fails
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* const { flowId } = await aurum.emailAuthStart('user@example.com');
|
|
244
|
+
* // User receives OTP...
|
|
245
|
+
* const { address, email, isNewUser } = await aurum.emailAuthVerify(flowId, '123456');
|
|
246
|
+
* console.log(`Connected: ${address} (${email})`);
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
emailAuthVerify(flowId: string, otp: string): Promise<EmailAuthVerifyResult>;
|
|
250
|
+
/**
|
|
251
|
+
* Initiates a WalletConnect session and returns the URI for displaying a custom QR code.
|
|
252
|
+
* Use this for building custom QR code UIs instead of using the built-in modal.
|
|
253
|
+
*
|
|
254
|
+
* @returns Object containing the URI and a function to wait for the connection
|
|
255
|
+
* @throws Error if WalletConnect is not configured
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```typescript
|
|
259
|
+
* // Get the WalletConnect URI
|
|
260
|
+
* const { uri, waitForConnection } = await aurum.getWalletConnectSession();
|
|
261
|
+
*
|
|
262
|
+
* // Display your custom QR code with the URI
|
|
263
|
+
* myQRCodeComponent.render(uri);
|
|
264
|
+
*
|
|
265
|
+
* // Wait for user to scan and approve
|
|
266
|
+
* const address = await waitForConnection();
|
|
267
|
+
* console.log('Connected:', address);
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
getWalletConnectSession(): Promise<WalletConnectSessionResult>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export { Aurum };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { Chain } from 'viem';
|
|
2
|
+
import { WalletId, WalletName, AurumRpcProvider, AurumConfig, NonNullableBrandConfig, UserInfo, WalletsConfig, EmailAuthStartResult, EmailAuthVerifyResult, WalletConnectSessionResult } from '@aurum-sdk/types';
|
|
3
|
+
import { SignInWithEmailResult, VerifyEmailOTPResult } from '@coinbase/cdp-core';
|
|
4
|
+
|
|
5
|
+
interface WalletConnectionResult {
|
|
6
|
+
address: string;
|
|
7
|
+
provider: AurumRpcProvider;
|
|
8
|
+
walletId: WalletId;
|
|
9
|
+
email?: string;
|
|
10
|
+
}
|
|
11
|
+
interface WalletAdapter {
|
|
12
|
+
readonly id: WalletId;
|
|
13
|
+
readonly name: WalletName;
|
|
14
|
+
readonly icon: string;
|
|
15
|
+
readonly hide: boolean;
|
|
16
|
+
readonly downloadUrl: string | null;
|
|
17
|
+
readonly wcDeepLinkUrl: string | null;
|
|
18
|
+
isInstalled(): boolean;
|
|
19
|
+
getProvider(): AurumRpcProvider | null;
|
|
20
|
+
connect(): Promise<WalletConnectionResult>;
|
|
21
|
+
tryRestoreConnection(): Promise<WalletConnectionResult | null>;
|
|
22
|
+
disconnect(): Promise<void>;
|
|
23
|
+
emailAuthStart?(email: string): Promise<SignInWithEmailResult>;
|
|
24
|
+
emailAuthVerify?(email: string, otp: string): Promise<VerifyEmailOTPResult>;
|
|
25
|
+
onAccountsChanged(callback: (accounts: string[]) => void): void;
|
|
26
|
+
removeListeners(): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Aurum SDK - Web3 Wallet Integration Library
|
|
31
|
+
*/
|
|
32
|
+
declare class Aurum {
|
|
33
|
+
private core;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new Aurum instance.
|
|
36
|
+
*
|
|
37
|
+
* @param config - Configuration for branding and wallets
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const aurum = new Aurum({
|
|
42
|
+
* brand: { appName: 'Your App Name' },
|
|
43
|
+
* wallets: {
|
|
44
|
+
* email: { projectId: 'cdp-project-id' },
|
|
45
|
+
* walletConnect: { projectId: 'reown-project-id' },
|
|
46
|
+
* },
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
constructor(config: AurumConfig);
|
|
51
|
+
/**
|
|
52
|
+
* EIP1193 compatible RPC provider that can be used to interact with the connected wallet.
|
|
53
|
+
* Compatible with viem, ethers.js, and other web3 libraries.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const balance = await aurum.rpcProvider.request({
|
|
58
|
+
* method: 'eth_getBalance',
|
|
59
|
+
* params: [address, 'latest']
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
get rpcProvider(): AurumRpcProvider;
|
|
64
|
+
/**
|
|
65
|
+
* Indicates whether the SDK is finished initializing.
|
|
66
|
+
*/
|
|
67
|
+
get ready(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the resolved brand configuration.
|
|
70
|
+
* @internal Used by widget components (i.e. ConnectWidget)
|
|
71
|
+
*/
|
|
72
|
+
get brandConfig(): NonNullableBrandConfig;
|
|
73
|
+
/**
|
|
74
|
+
* Returns the wallet adapters configured for this instance.
|
|
75
|
+
* @internal Used by widget components (i.e. ConnectWidget)
|
|
76
|
+
*/
|
|
77
|
+
get walletAdapters(): WalletAdapter[];
|
|
78
|
+
/**
|
|
79
|
+
* Returns the set of excluded wallet IDs.
|
|
80
|
+
* @internal Used by widget components (i.e. ConnectWidget)
|
|
81
|
+
*/
|
|
82
|
+
get excludedWalletIds(): Set<WalletId>;
|
|
83
|
+
/**
|
|
84
|
+
* Waits for the SDK to finish initializing.
|
|
85
|
+
* This should be called before calling methods with the provider to ensure provider is set (such as after a page refresh).
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* await aurum.whenReady();
|
|
90
|
+
* const balance = await aurum.rpcProvider.request({
|
|
91
|
+
* method: 'eth_getBalance',
|
|
92
|
+
* params: [address, 'latest']
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
whenReady(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Opens the wallet connection modal or connects directly to a specific wallet.
|
|
99
|
+
*
|
|
100
|
+
* @param walletId - Optional wallet ID for direct connection (bypasses modal).
|
|
101
|
+
* Cannot be 'email' or 'walletconnect' (use their dedicated methods).
|
|
102
|
+
* @returns The connected wallet address
|
|
103
|
+
* @throws Error if user closes the modal without connecting a wallet
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* // Open modal for user to choose
|
|
108
|
+
* const address = await aurum.connect();
|
|
109
|
+
*
|
|
110
|
+
* // Or connect directly to a specific wallet
|
|
111
|
+
* import { WalletId } from '@aurum-sdk/types';
|
|
112
|
+
* const address = await aurum.connect(WalletId.MetaMask);
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
connect(walletId?: WalletId): Promise<`0x${string}`>;
|
|
116
|
+
/**
|
|
117
|
+
* Disconnects the currently connected wallet and clears the connection state.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* await aurum.disconnect();
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
disconnect(): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Gets information about the currently connected user.
|
|
127
|
+
*
|
|
128
|
+
* @returns User information including wallet address and wallet name, or undefined if no wallet is connected
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const userInfo = await aurum.getUserInfo();
|
|
133
|
+
* if (userInfo) {
|
|
134
|
+
* console.log(`Connected to ${userInfo.walletName}: ${userInfo.publicAddress}`);
|
|
135
|
+
* } else {
|
|
136
|
+
* console.log('No wallet connected');
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
getUserInfo(): Promise<UserInfo | undefined>;
|
|
141
|
+
/**
|
|
142
|
+
* Checks if a wallet is currently connected.
|
|
143
|
+
*
|
|
144
|
+
* @returns `true` if a wallet is connected, `false` otherwise
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const isConnected = await aurum.isConnected();
|
|
149
|
+
* console.log('Is user connected:', isConnected);
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
isConnected(): Promise<boolean>;
|
|
153
|
+
/**
|
|
154
|
+
* Gets the current chain ID of the connected wallet.
|
|
155
|
+
*
|
|
156
|
+
* @returns The current chain ID as a number
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const chainId = await aurum.getChainId();
|
|
161
|
+
* console.log('Connected to chain:', chainId);
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
getChainId(): Promise<number>;
|
|
165
|
+
/**
|
|
166
|
+
* Switches the connected wallet to a different blockchain network.
|
|
167
|
+
* If the chain is not added to the wallet, it will attempt to add it using the provided chain config.
|
|
168
|
+
*
|
|
169
|
+
* @param chainId - The chain ID to switch to (can be hex string, decimal string, or number)
|
|
170
|
+
* @param chain - Optional viem Chain object with chain configuration (required if chain needs to be added)
|
|
171
|
+
* @throws Error if the switch fails or the user rejects the request
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* import { sepolia } from 'viem/chains';
|
|
176
|
+
*
|
|
177
|
+
* await aurum.switchChain(sepolia.id, sepolia);
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
switchChain(chainId: `0x${string}` | string | number, chain?: Chain): Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Updates the brand configuration at runtime.
|
|
183
|
+
* Changes will be reflected the next time the connect modal is opened.
|
|
184
|
+
*
|
|
185
|
+
* @param newConfig - Partial brand config to merge with existing config
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* aurum.updateBrandConfig({
|
|
190
|
+
* theme: 'light',
|
|
191
|
+
* });
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
updateBrandConfig(newConfig: Partial<NonNullableBrandConfig>): void;
|
|
195
|
+
/**
|
|
196
|
+
* Updates the wallets configuration at runtime.
|
|
197
|
+
* Changes will be reflected the next time the connect modal is opened.
|
|
198
|
+
*
|
|
199
|
+
* @param newConfig - Partial wallets config to update (currently supports `exclude`)
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* import { WalletId } from '@aurum-sdk/types';
|
|
204
|
+
*
|
|
205
|
+
* aurum.updateWalletsConfig({
|
|
206
|
+
* exclude: [WalletId.Email, WalletId.AppKit],
|
|
207
|
+
* });
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
updateWalletsConfig(newConfig: Partial<Pick<WalletsConfig, 'exclude'>>): void;
|
|
211
|
+
/**
|
|
212
|
+
* Notifies the SDK of a widget-initiated connection.
|
|
213
|
+
* Updates internal state so getUserInfo(), isConnected(), etc. work correctly.
|
|
214
|
+
* @internal Used by ConnectWidget - not intended for direct use
|
|
215
|
+
*/
|
|
216
|
+
handleWidgetConnection(result: WalletConnectionResult): Promise<void>;
|
|
217
|
+
/**
|
|
218
|
+
* Starts the email authentication flow by sending an OTP to the provided email.
|
|
219
|
+
* Use with `emailAuthVerify()` to complete the connection.
|
|
220
|
+
*
|
|
221
|
+
* @param email - The email address to send the OTP to
|
|
222
|
+
* @returns Object containing flowId to use with emailAuthVerify
|
|
223
|
+
* @throws Error if email wallet is not configured
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* const { flowId } = await aurum.emailAuthStart('user@example.com');
|
|
228
|
+
* // User receives OTP email, then verify:
|
|
229
|
+
* const { address, email, isNewUser } = await aurum.emailAuthVerify(flowId, '123456');
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
emailAuthStart(email: string): Promise<EmailAuthStartResult>;
|
|
233
|
+
/**
|
|
234
|
+
* Verifies the email OTP and completes the wallet connection.
|
|
235
|
+
*
|
|
236
|
+
* @param flowId - The flowId returned from emailAuthStart
|
|
237
|
+
* @param otp - The OTP code the user received via email
|
|
238
|
+
* @returns Object containing the connected address and email
|
|
239
|
+
* @throws Error if verification fails
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* const { flowId } = await aurum.emailAuthStart('user@example.com');
|
|
244
|
+
* // User receives OTP...
|
|
245
|
+
* const { address, email, isNewUser } = await aurum.emailAuthVerify(flowId, '123456');
|
|
246
|
+
* console.log(`Connected: ${address} (${email})`);
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
emailAuthVerify(flowId: string, otp: string): Promise<EmailAuthVerifyResult>;
|
|
250
|
+
/**
|
|
251
|
+
* Initiates a WalletConnect session and returns the URI for displaying a custom QR code.
|
|
252
|
+
* Use this for building custom QR code UIs instead of using the built-in modal.
|
|
253
|
+
*
|
|
254
|
+
* @returns Object containing the URI and a function to wait for the connection
|
|
255
|
+
* @throws Error if WalletConnect is not configured
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```typescript
|
|
259
|
+
* // Get the WalletConnect URI
|
|
260
|
+
* const { uri, waitForConnection } = await aurum.getWalletConnectSession();
|
|
261
|
+
*
|
|
262
|
+
* // Display your custom QR code with the URI
|
|
263
|
+
* myQRCodeComponent.render(uri);
|
|
264
|
+
*
|
|
265
|
+
* // Wait for user to scan and approve
|
|
266
|
+
* const address = await waitForConnection();
|
|
267
|
+
* console.log('Connected:', address);
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
getWalletConnectSession(): Promise<WalletConnectSessionResult>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export { Aurum };
|