@luxfi/core 5.3.7 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +36 -80
- package/tsconfig.json +10 -15
- package/tsconfig.tsbuildinfo +1 -0
- package/types/asset.ts +28 -0
- package/types/contract.ts +13 -0
- package/types/deposit-address.ts +9 -0
- package/types/exchange.ts +25 -0
- package/types/index.ts +21 -4
- package/types/network-type.ts +16 -0
- package/types/network.ts +58 -0
- package/types/swap-status.ts +58 -0
- package/types/transaction-type.ts +5 -0
- package/types/utila.ts +36 -0
- package/commerce/ui/conf.ts +0 -13
- package/commerce/ui/context.tsx +0 -123
- package/commerce/ui/store.ts +0 -290
- package/components/access-code-input.tsx +0 -71
- package/components/auth/auth-listener.tsx +0 -29
- package/components/auth/auth-token/clear-auth-token.tsx +0 -12
- package/components/auth/auth-token/set-auth-token.tsx +0 -16
- package/components/auth/common-auth-domains.ts +0 -16
- package/components/auth/login-panel.tsx +0 -107
- package/components/back-button.tsx +0 -49
- package/components/chat-widget.tsx +0 -85
- package/components/commerce/_to_deprecate_checkout-widget/const.ts +0 -13
- package/components/commerce/_to_deprecate_checkout-widget/index.tsx_ +0 -188
- package/components/commerce/_to_deprecate_checkout-widget/obs-string-set.ts +0 -48
- package/components/commerce/_to_deprecate_checkout-widget/use-anim-clx-set.ts +0 -59
- package/components/commerce/bag-button.tsx +0 -98
- package/components/commerce/buy-button.tsx +0 -34
- package/components/commerce/checkout-button.tsx +0 -129
- package/components/commerce/checkout-panel/cart-accordian.tsx +0 -66
- package/components/commerce/checkout-panel/checkout-panel-props.ts +0 -10
- package/components/commerce/checkout-panel/desktop-bag-carousel.tsx +0 -36
- package/components/commerce/checkout-panel/desktop-cp.tsx +0 -83
- package/components/commerce/checkout-panel/index.tsx +0 -126
- package/components/commerce/checkout-panel/mobile-cp.tsx +0 -67
- package/components/commerce/checkout-panel/policy-links.tsx +0 -29
- package/components/commerce/checkout-panel/steps-indicator.tsx +0 -39
- package/components/commerce/checkout-panel/thank-you.tsx +0 -18
- package/components/commerce/desktop-bag-popup.tsx +0 -78
- package/components/commerce/desktop-nav-menu.tsx +0 -194
- package/components/commerce/drawer/index.tsx +0 -88
- package/components/commerce/drawer/micro.tsx +0 -145
- package/components/commerce/drawer/shell.tsx +0 -85
- package/components/commerce/mobile-bag-drawer.tsx +0 -51
- package/components/commerce/mobile-login-button.tsx +0 -108
- package/components/commerce/mobile-menu-toggle-button.tsx +0 -35
- package/components/commerce/mobile-nav-menu-ai.tsx +0 -51
- package/components/commerce/mobile-nav-menu-item.tsx +0 -50
- package/components/commerce/mobile-nav-menu.tsx +0 -102
- package/components/contact-dialog/contact-form.tsx +0 -113
- package/components/contact-dialog/disclaimer.tsx +0 -13
- package/components/contact-dialog/index.tsx +0 -64
- package/components/copyright.tsx +0 -21
- package/components/drawer-margin.tsx +0 -28
- package/components/footer.tsx +0 -78
- package/components/header/desktop.tsx +0 -51
- package/components/header/index.tsx +0 -50
- package/components/header/mobile.tsx +0 -163
- package/components/header/theme-toggle.tsx +0 -26
- package/components/icons/24k-gold-card.tsx +0 -43
- package/components/icons/ai-chat-act.tsx +0 -47
- package/components/icons/ai-chat.tsx +0 -29
- package/components/icons/anodized-titanium.tsx +0 -45
- package/components/icons/avatar.tsx +0 -11
- package/components/icons/bag-icon.tsx +0 -10
- package/components/icons/blog-act.tsx +0 -14
- package/components/icons/blog.tsx +0 -20
- package/components/icons/bridge-act.tsx +0 -18
- package/components/icons/bridge.tsx +0 -68
- package/components/icons/changelog-act.tsx +0 -15
- package/components/icons/changelog.tsx +0 -21
- package/components/icons/chrome.tsx +0 -45
- package/components/icons/coins-act.tsx +0 -29
- package/components/icons/coins.tsx +0 -20
- package/components/icons/compare-cards-act.tsx +0 -30
- package/components/icons/compare-cards.tsx +0 -21
- package/components/icons/credit-act.tsx +0 -29
- package/components/icons/credit.tsx +0 -20
- package/components/icons/customer-support-act.tsx +0 -27
- package/components/icons/customer-support.tsx +0 -21
- package/components/icons/customers-act.tsx +0 -65
- package/components/icons/customers.tsx +0 -33
- package/components/icons/developer-docs-act.tsx +0 -26
- package/components/icons/developer-docs.tsx +0 -20
- package/components/icons/exchange-act.tsx +0 -27
- package/components/icons/exchange.tsx +0 -21
- package/components/icons/explorer-act.tsx +0 -27
- package/components/icons/explorer.tsx +0 -22
- package/components/icons/faqs-act.tsx +0 -27
- package/components/icons/faqs.tsx +0 -21
- package/components/icons/github.tsx +0 -14
- package/components/icons/guides-act.tsx +0 -26
- package/components/icons/guides.tsx +0 -21
- package/components/icons/gun-metal.tsx +0 -44
- package/components/icons/index.tsx +0 -43
- package/components/icons/integrations-act.tsx +0 -41
- package/components/icons/integrations.tsx +0 -25
- package/components/icons/irradescent.tsx +0 -41
- package/components/icons/launch-subnet.tsx +0 -21
- package/components/icons/launchsubnet-act.tsx +0 -29
- package/components/icons/left-arrow.tsx +0 -11
- package/components/icons/lux-finance-act.tsx +0 -34
- package/components/icons/lux-finance.tsx +0 -23
- package/components/icons/lux-logo.tsx +0 -10
- package/components/icons/lux-pass-act.tsx +0 -41
- package/components/icons/lux-pass.tsx +0 -25
- package/components/icons/lux-quests-act.tsx +0 -15
- package/components/icons/lux-quests.tsx +0 -21
- package/components/icons/market-act.tsx +0 -39
- package/components/icons/market.tsx +0 -24
- package/components/icons/mirrored-titanium.tsx +0 -46
- package/components/icons/more-benefits-act.tsx +0 -29
- package/components/icons/more-benefits.tsx +0 -21
- package/components/icons/open-source-act.tsx +0 -41
- package/components/icons/open-source.tsx +0 -26
- package/components/icons/right-arrow.tsx +0 -10
- package/components/icons/safe-act.tsx +0 -77
- package/components/icons/safe.tsx +0 -37
- package/components/icons/search.tsx +0 -12
- package/components/icons/secure-delivery.tsx +0 -13
- package/components/icons/shop-act.tsx +0 -29
- package/components/icons/shop.tsx +0 -20
- package/components/icons/social-icon.tsx +0 -35
- package/components/icons/social-svg.css +0 -3
- package/components/icons/sterling-silver-card.tsx +0 -44
- package/components/icons/templates-act.tsx +0 -29
- package/components/icons/templates.tsx +0 -21
- package/components/icons/validators-act.tsx +0 -42
- package/components/icons/validators.tsx +0 -41
- package/components/icons/view-all-card-act.tsx +0 -28
- package/components/icons/view-all-card.tsx +0 -20
- package/components/icons/wallet-act.tsx +0 -29
- package/components/icons/wallet.tsx +0 -20
- package/components/icons/warpcast.tsx +0 -58
- package/components/icons/youtube-logo.tsx +0 -59
- package/components/index.ts +0 -25
- package/components/logo.tsx +0 -89
- package/components/main.tsx +0 -27
- package/components/mini-chart/index.tsx +0 -8
- package/components/mini-chart/mini-chart-props.ts +0 -44
- package/components/mini-chart/mini-chart.tsx +0 -85
- package/components/mini-chart/wrapper.tsx +0 -23
- package/components/not-found/index.tsx +0 -28
- package/components/not-found/not-found-content.mdx +0 -5
- package/components/scripts.tsx +0 -24
- package/components/tooltip.tsx +0 -31
- package/environment.d.ts +0 -6
- package/next/analytics/fpixel.ts +0 -16
- package/next/analytics/google-analytics.ts +0 -14
- package/next/analytics/index.ts +0 -3
- package/next/analytics/pixel-analytics.tsx +0 -55
- package/next/font/get-app-router-font-classes.ts +0 -12
- package/next/font/load-and-return-lux-next-fonts-on-import.ts +0 -68
- package/next/font/local/Druk-Wide-Bold.ttf +0 -0
- package/next/font/local/Druk-Wide-Medium.ttf +0 -0
- package/next/font/local/InterVariable-Italic.ttf +0 -0
- package/next/font/local/InterVariable-Italic.woff2 +0 -0
- package/next/font/local/InterVariable.ttf +0 -0
- package/next/font/local/InterVariable.woff2 +0 -0
- package/next/font/next-font-desc.ts +0 -28
- package/next/font/pages-router-font-vars.tsx +0 -18
- package/next/head-metadata/from-next/metadata-types.ts +0 -158
- package/next/head-metadata/from-next/opengraph-types.ts +0 -267
- package/next/head-metadata/from-next/twitter-types.ts +0 -92
- package/next/head-metadata/index.tsx +0 -208
- package/next/index.ts +0 -1
- package/next/middleware/determine-device-mw.ts +0 -16
- package/root-layout/WHY_THIS_IS_SEPARATE.txt +0 -2
- package/root-layout/index.tsx +0 -112
- package/server-actions/TO-DO.txt +0 -1
- package/server-actions/firebase-app.ts +0 -14
- package/server-actions/index.ts +0 -5
- package/server-actions/store-contact.ts +0 -51
- package/site-def/footer/community.tsx +0 -67
- package/site-def/footer/company.ts +0 -37
- package/site-def/footer/ecosystem.ts +0 -37
- package/site-def/footer/index.tsx +0 -26
- package/site-def/footer/legal.ts +0 -28
- package/site-def/footer/network.ts +0 -45
- package/site-def/footer/svg/warpcast-logo.svg +0 -12
- package/site-def/index.ts +0 -3
- package/site-def/main-nav.tsx +0 -458
- package/style/cart-animation.css +0 -29
- package/style/checkout-animation.css +0 -23
- package/style/drawer-handle-overrides.css +0 -160
- package/style/lux-colors.css +0 -85
- package/style/lux-global.css +0 -51
- package/tailwind/fontFamily.tailwind.lux.ts +0 -18
- package/tailwind/index.ts +0 -2
- package/tailwind/lux-tw-fonts.ts +0 -40
- package/tailwind/tailwind.config.lux-preset.ts +0 -10
- package/types/chatbot-config.ts +0 -7
- package/types/chatbot-suggested-question.ts +0 -7
- package/types/contact-info.ts +0 -11
- package/types/site-def.ts +0 -43
package/package.json
CHANGED
@@ -1,80 +1,36 @@
|
|
1
|
-
{
|
2
|
-
"name": "@luxfi/core",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"publishConfig": {
|
6
|
-
"registry": "https://registry.npmjs.org/",
|
7
|
-
"access": "public",
|
8
|
-
"scope": "@luxfi"
|
9
|
-
},
|
10
|
-
"
|
11
|
-
|
12
|
-
|
13
|
-
"
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
"hanzo",
|
19
|
-
"luxdefi"
|
20
|
-
],
|
21
|
-
"scripts": {
|
22
|
-
"lat": "npm show @luxfi/core version",
|
23
|
-
"pub": "npm publish",
|
24
|
-
"
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
"
|
35
|
-
|
36
|
-
|
37
|
-
},
|
38
|
-
"dependencies": {
|
39
|
-
"@next/third-parties": "^14.1.0",
|
40
|
-
"@types/node": "^20.12.12",
|
41
|
-
"cookies-next": "^4.1.1",
|
42
|
-
"date-fns": "^3.6.0",
|
43
|
-
"embla-carousel-autoplay": "^8.1.1",
|
44
|
-
"firebase": "10.12.0",
|
45
|
-
"framer-motion": "^11.2.12",
|
46
|
-
"react-device-detect": "^2.2.3",
|
47
|
-
"react-social-icons": "^6.4.0",
|
48
|
-
"react-tooltip": "^5.26.4",
|
49
|
-
"request": "^2.88.2",
|
50
|
-
"usehooks-ts": "^3.1.0"
|
51
|
-
},
|
52
|
-
"peerDependencies": {
|
53
|
-
"@hanzo/auth": "*",
|
54
|
-
"@hanzo/commerce": "*",
|
55
|
-
"@hanzo/ui": "*",
|
56
|
-
"@hookform/resolvers": "^3.3.2",
|
57
|
-
"lucide-react": "^0.344.0",
|
58
|
-
"mobx": "^6.12.3",
|
59
|
-
"mobx-react-lite": "^4.0.7",
|
60
|
-
"next": "14.2.3",
|
61
|
-
"next-themes": "^0.2.1",
|
62
|
-
"react": "*",
|
63
|
-
"react-dom": "*",
|
64
|
-
"react-hook-form": "^7.51.4",
|
65
|
-
"validator": "^13.11.0",
|
66
|
-
"zod": "3.23.8"
|
67
|
-
},
|
68
|
-
"devDependencies": {
|
69
|
-
"@mdx-js/loader": "^3.0.0",
|
70
|
-
"@mdx-js/react": "^3.0.0",
|
71
|
-
"@types/facebook-pixel": "^0.0.30",
|
72
|
-
"@types/gtag.js": "^0.0.19",
|
73
|
-
"@types/mdx": "^2.0.9",
|
74
|
-
"@types/node": "^20.11.24",
|
75
|
-
"@types/react": "*",
|
76
|
-
"@types/react-dom": "*",
|
77
|
-
"tailwindcss": "^3.4.3",
|
78
|
-
"typescript": "5.4.5"
|
79
|
-
}
|
80
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@luxfi/core",
|
3
|
+
"version": "10.0.0",
|
4
|
+
"description": "core types and shared utilities related blockchain",
|
5
|
+
"publishConfig": {
|
6
|
+
"registry": "https://registry.npmjs.org/",
|
7
|
+
"access": "public",
|
8
|
+
"scope": "@luxfi"
|
9
|
+
},
|
10
|
+
"author": "Hanzo AI, Inc.",
|
11
|
+
"license": "BSD-3-Clause",
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "git+https://github.com/luxfi/bridge.git",
|
15
|
+
"directory": "pkg/luxfi-core"
|
16
|
+
},
|
17
|
+
"keywords": [
|
18
|
+
"hanzo",
|
19
|
+
"luxdefi"
|
20
|
+
],
|
21
|
+
"scripts": {
|
22
|
+
"lat": "npm show @luxfi/core version",
|
23
|
+
"pub": "npm publish",
|
24
|
+
"tc": "tsc"
|
25
|
+
},
|
26
|
+
"exports": {
|
27
|
+
".": "./types/index.ts"
|
28
|
+
},
|
29
|
+
"dependencies": {
|
30
|
+
},
|
31
|
+
"peerDependencies": {
|
32
|
+
},
|
33
|
+
"devDependencies": {
|
34
|
+
"typescript": "catalog:"
|
35
|
+
}
|
36
|
+
}
|
package/tsconfig.json
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
{
|
2
|
-
"extends": "
|
3
|
-
"include": [
|
4
|
-
"**/*.ts",
|
5
|
-
"**/*.tsx",
|
6
|
-
],
|
7
|
-
"exclude": [
|
8
|
-
"node_modules",
|
9
|
-
]
|
10
|
-
|
11
|
-
"paths": {
|
12
|
-
"react": [ "./node_modules/@types/react" ],
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
1
|
+
{
|
2
|
+
"extends": "../../tsconfig.base.json",
|
3
|
+
"include": [
|
4
|
+
"**/*.ts",
|
5
|
+
"**/*.tsx",
|
6
|
+
],
|
7
|
+
"exclude": [
|
8
|
+
"node_modules",
|
9
|
+
]
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"fileNames":["../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./types/asset.ts","./types/deposit-address.ts","./types/network-type.ts","./types/network.ts","./types/index.ts","../../node_modules/.pnpm/@types+estree@1.0.6/node_modules/@types/estree/index.d.ts","../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts","../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/use-at-your-own-risk.d.ts","../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index.d.ts","../../node_modules/.pnpm/@types+eslint-scope@3.7.7/node_modules/@types/eslint-scope/index.d.ts"],"fileIdsList":[[84,87],[84,85,86],[87],[79,80,81,82],[79,80,81]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"a24c4688002c1d54e2bb044658e517e7fe0ad04a7749e06d867d28d312792e38","38614f95bf4f7b1f76cac8795b2a81f32f489e35dc93e404b5c0e94907baaa13","2123fc7e470aaa34f611ca4af1e2848facf4e44e65e89475d8a0e595e429fefb","5d9f13bf6f2c8ba4909ba0b5008bbd4de0a39c945c5930258c00e2b7558b914e","c512fa7dba3f7d0c2b1bd601cb86f3e6d98e9695015961af661c1720e784f5e6",{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1}],"root":[[79,83]],"options":{"allowJs":true,"declaration":false,"esModuleInterop":true,"jsx":1,"module":99,"skipLibCheck":true,"strict":true,"target":7,"verbatimModuleSyntax":true},"referencedMap":[[88,1],[87,2],[86,3],[83,4],[82,5]],"affectedFilesPendingEmit":[79,80,83,81,82],"version":"5.7.2"}
|
package/types/asset.ts
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
interface Asset {
|
2
|
+
name: string
|
3
|
+
asset: string
|
4
|
+
logo: string
|
5
|
+
contract_address: string | null
|
6
|
+
decimals: number
|
7
|
+
status: string
|
8
|
+
is_deposit_enabled: boolean
|
9
|
+
is_withdrawal_enabled: boolean
|
10
|
+
is_refuel_enabled: boolean
|
11
|
+
max_withdrawal_amount: number
|
12
|
+
deposit_fee: number
|
13
|
+
withdrawal_fee: number
|
14
|
+
source_base_fee: number
|
15
|
+
destination_base_fee: number
|
16
|
+
//is_native: boolean
|
17
|
+
|
18
|
+
id?: number,
|
19
|
+
price_in_usd?: number | null,
|
20
|
+
precision?: number | null,
|
21
|
+
listing_date?: Date,
|
22
|
+
network_id?: number
|
23
|
+
|
24
|
+
}
|
25
|
+
|
26
|
+
export {
|
27
|
+
type Asset as default
|
28
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
type Status = 'active' | 'inactive'
|
2
|
+
|
3
|
+
interface ExchangeAsset {
|
4
|
+
asset: string
|
5
|
+
is_default: boolean
|
6
|
+
network: string
|
7
|
+
status: Status
|
8
|
+
}
|
9
|
+
|
10
|
+
interface Exchange {
|
11
|
+
display_name: string
|
12
|
+
internal_name: string
|
13
|
+
is_featured: boolean
|
14
|
+
type: "cex" | "fiat"
|
15
|
+
status: Status
|
16
|
+
created_date: string
|
17
|
+
currencies: ExchangeAsset []
|
18
|
+
metadata?: {} | null
|
19
|
+
img_url?: string
|
20
|
+
}
|
21
|
+
|
22
|
+
export {
|
23
|
+
type Exchange as default
|
24
|
+
}
|
25
|
+
|
package/types/index.ts
CHANGED
@@ -1,4 +1,21 @@
|
|
1
|
-
|
2
|
-
export type
|
3
|
-
export type {
|
4
|
-
export type
|
1
|
+
|
2
|
+
export { type default as Asset } from './asset'
|
3
|
+
export type { Contract, Contracts } from './contract'
|
4
|
+
export { type default as DepositAddress} from './deposit-address'
|
5
|
+
export { type default as Exchange } from './exchange'
|
6
|
+
export { type default as NetworkType} from './network-type'
|
7
|
+
export { type default as Network} from './network'
|
8
|
+
export { TransactionType} from './transaction-type'
|
9
|
+
export {
|
10
|
+
SwapStatus,
|
11
|
+
swapStatusByIndex,
|
12
|
+
UtilaTransactionStatus,
|
13
|
+
utilaTransactionStatusByIndex
|
14
|
+
} from './swap-status'
|
15
|
+
|
16
|
+
export type {
|
17
|
+
UTILA_NETWORK,
|
18
|
+
UTILA_TRANSACTION_CREATED,
|
19
|
+
UTILA_TRANSACTION_STATE_UPDATED
|
20
|
+
} from './utila'
|
21
|
+
|
package/types/network.ts
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
import type Asset from './asset'
|
2
|
+
import type DepositAddress from './deposit-address'
|
3
|
+
import type NetworkType from './network-type'
|
4
|
+
|
5
|
+
type NetworkNode = { url: string } | string
|
6
|
+
|
7
|
+
interface NetworkMetadata {
|
8
|
+
multicall3?: {
|
9
|
+
address: `0x${string}`
|
10
|
+
blockCreated: number
|
11
|
+
}
|
12
|
+
ensRegistry?: {
|
13
|
+
address: `0x${string}`
|
14
|
+
}
|
15
|
+
ensUniversalResolver?: {
|
16
|
+
address: `0x${string}`
|
17
|
+
}
|
18
|
+
WatchdogContractAddress?: `0x${string}`
|
19
|
+
L1Network?: string
|
20
|
+
}
|
21
|
+
|
22
|
+
interface _ManagedAccount {
|
23
|
+
address: `0x${string}`
|
24
|
+
}
|
25
|
+
|
26
|
+
type ManagedAccount = _ManagedAccount | string
|
27
|
+
|
28
|
+
interface Network {
|
29
|
+
|
30
|
+
display_name: string
|
31
|
+
internal_name: string
|
32
|
+
transaction_explorer_template: string
|
33
|
+
account_explorer_template: string
|
34
|
+
currencies: Asset[]
|
35
|
+
refuel_amount_in_usd?: number
|
36
|
+
chain_id: string | null
|
37
|
+
type: NetworkType
|
38
|
+
created_date?: string
|
39
|
+
is_featured: boolean
|
40
|
+
nodes: NetworkNode[]
|
41
|
+
managed_accounts: ManagedAccount[]
|
42
|
+
metadata: NetworkMetadata | null | undefined
|
43
|
+
img_url?: string
|
44
|
+
|
45
|
+
id?: number,
|
46
|
+
native_currency: string | null
|
47
|
+
is_testnet: boolean | null
|
48
|
+
logo: string | null
|
49
|
+
average_completion_time: string | null
|
50
|
+
listing_date?: Date | null
|
51
|
+
|
52
|
+
status: string
|
53
|
+
deposit_address?: DepositAddress
|
54
|
+
}
|
55
|
+
|
56
|
+
export {
|
57
|
+
type Network as default
|
58
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
export enum SwapStatus {
|
2
|
+
Created = "created",
|
3
|
+
UserTransferPending = "user_transfer_pending",
|
4
|
+
UserTransferDelayed = "user_transfer_delayed",
|
5
|
+
UserDepositPending = "user_deposit_pending",
|
6
|
+
BridgeTransferPending = "bridge_transfer_pending",
|
7
|
+
Completed = "completed",
|
8
|
+
Failed = "failed",
|
9
|
+
Expired = "expired",
|
10
|
+
Cancelled = "cancelled",
|
11
|
+
TeleportProcessPending = "teleport_processing_pending",
|
12
|
+
UserPayoutPending = "user_payout_pending",
|
13
|
+
PayoutSuccess = "payout_success"
|
14
|
+
}
|
15
|
+
export const swapStatusByIndex: { [key: number]: SwapStatus } = {
|
16
|
+
"0": SwapStatus.Created,
|
17
|
+
"1": SwapStatus.UserTransferPending,
|
18
|
+
"2": SwapStatus.UserTransferDelayed,
|
19
|
+
"3": SwapStatus.BridgeTransferPending,
|
20
|
+
"4": SwapStatus.Completed,
|
21
|
+
"5": SwapStatus.Failed,
|
22
|
+
"6": SwapStatus.Expired,
|
23
|
+
"7": SwapStatus.Cancelled,
|
24
|
+
};
|
25
|
+
|
26
|
+
export enum UtilaTransactionStatus {
|
27
|
+
AWAITING_APPROVAL = "AWAITING_APPROVAL",
|
28
|
+
AWAITING_POLICY_CHECK = "AWAITING_POLICY_CHECK",
|
29
|
+
AWAITING_SIGNATURE = "AWAITING_SIGNATURE",
|
30
|
+
SIGNED = "SIGNED",
|
31
|
+
AWAITING_PUBLISH = "AWAITING_PUBLISH",
|
32
|
+
PUBLISHED = "PUBLISHED",
|
33
|
+
MINED = "MINED",
|
34
|
+
FAILED = "FAILED",
|
35
|
+
DECLINED = "DECLINED",
|
36
|
+
REPLACED = "REPLACED",
|
37
|
+
CANCELED = "CANCELED",
|
38
|
+
DROPPED = "DROPPED",
|
39
|
+
CONFIRMED = "CONFIRMED",
|
40
|
+
EXPIRED = "EXPIRED"
|
41
|
+
}
|
42
|
+
|
43
|
+
export const utilaTransactionStatusByIndex: { [key: number]: UtilaTransactionStatus } = {
|
44
|
+
"1": UtilaTransactionStatus.AWAITING_APPROVAL,
|
45
|
+
"2": UtilaTransactionStatus.AWAITING_POLICY_CHECK,
|
46
|
+
"3": UtilaTransactionStatus.AWAITING_SIGNATURE,
|
47
|
+
"4": UtilaTransactionStatus.SIGNED,
|
48
|
+
"5": UtilaTransactionStatus.AWAITING_PUBLISH,
|
49
|
+
"6": UtilaTransactionStatus.PUBLISHED,
|
50
|
+
"7": UtilaTransactionStatus.MINED,
|
51
|
+
"8": UtilaTransactionStatus.FAILED,
|
52
|
+
"9": UtilaTransactionStatus.DECLINED,
|
53
|
+
"10": UtilaTransactionStatus.REPLACED,
|
54
|
+
"11": UtilaTransactionStatus.CANCELED,
|
55
|
+
"12": UtilaTransactionStatus.DROPPED,
|
56
|
+
"13": UtilaTransactionStatus.CONFIRMED,
|
57
|
+
"14": UtilaTransactionStatus.EXPIRED
|
58
|
+
}
|
package/types/utila.ts
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
export type UTILA_NETWORK = {
|
2
|
+
$typeName: string
|
3
|
+
name: string
|
4
|
+
displayName: string
|
5
|
+
testnet: boolean
|
6
|
+
nativeAsset: string
|
7
|
+
custom: boolean
|
8
|
+
caipDetails: {
|
9
|
+
$typeName: string
|
10
|
+
chainId: string
|
11
|
+
namespace: string
|
12
|
+
reference: string
|
13
|
+
},
|
14
|
+
assets: Record<string, string>
|
15
|
+
}
|
16
|
+
|
17
|
+
export type UTILA_TRANSACTION_CREATED = {
|
18
|
+
id: string,
|
19
|
+
vault: string,
|
20
|
+
type: string,
|
21
|
+
resourceType: string,
|
22
|
+
resource: string,
|
23
|
+
}
|
24
|
+
|
25
|
+
export type UTILA_TRANSACTION_STATE_UPDATED = {
|
26
|
+
id: string,
|
27
|
+
vault: string,
|
28
|
+
type: string,
|
29
|
+
details: {
|
30
|
+
transactionStateUpdated: {
|
31
|
+
newState: string
|
32
|
+
}
|
33
|
+
},
|
34
|
+
resourceType: string,
|
35
|
+
resource: string,
|
36
|
+
}
|
package/commerce/ui/conf.ts
DELETED
package/commerce/ui/context.tsx
DELETED
@@ -1,123 +0,0 @@
|
|
1
|
-
'use client'
|
2
|
-
import React, {
|
3
|
-
createContext,
|
4
|
-
useContext,
|
5
|
-
useRef,
|
6
|
-
type PropsWithChildren,
|
7
|
-
useEffect,
|
8
|
-
useLayoutEffect
|
9
|
-
} from 'react'
|
10
|
-
import { enableStaticRendering } from 'mobx-react-lite'
|
11
|
-
import { usePathname } from 'next/navigation'
|
12
|
-
import { useDebounceCallback } from 'usehooks-ts'
|
13
|
-
|
14
|
-
|
15
|
-
import { preset as twConfig } from '@hanzo/ui/tailwind'
|
16
|
-
import { useCommerce } from '@hanzo/commerce'
|
17
|
-
|
18
|
-
import type { CommerceDrawer, SelectAndBuy } from './store'
|
19
|
-
import { CommerceUIStore } from './store'
|
20
|
-
import conf from './conf'
|
21
|
-
|
22
|
-
const LOG = false ////////////////////
|
23
|
-
const log = (s: string) => {
|
24
|
-
if (LOG) {
|
25
|
-
console.log('CMMC UI CONTEXT ' + s)
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
// https://dev.to/ivandotv/mobx-server-side-rendering-with-next-js-4m18
|
30
|
-
enableStaticRendering(typeof window === "undefined")
|
31
|
-
|
32
|
-
const CommerceUIContext = createContext<CommerceUIStore | undefined>(undefined)
|
33
|
-
|
34
|
-
const useCommerceDrawer = (): CommerceDrawer => {
|
35
|
-
return useContext(CommerceUIContext) as CommerceDrawer
|
36
|
-
}
|
37
|
-
|
38
|
-
const useSelectAndBuy = (): SelectAndBuy => {
|
39
|
-
return useContext(CommerceUIContext) as SelectAndBuy
|
40
|
-
}
|
41
|
-
|
42
|
-
const CommerceUIProvider: React.FC<PropsWithChildren> = ({
|
43
|
-
children,
|
44
|
-
}) => {
|
45
|
-
|
46
|
-
const cmmc = useCommerce()
|
47
|
-
const pathname = usePathname()
|
48
|
-
const storeRef = useRef<CommerceUIStore>(new CommerceUIStore(cmmc, conf))
|
49
|
-
const prevPathRef = useRef<string>('initial')
|
50
|
-
|
51
|
-
const onResize = () => {
|
52
|
-
const width = window.innerWidth
|
53
|
-
let desktopMin = 0
|
54
|
-
if (twConfig.theme?.screens) {
|
55
|
-
// expected form: { md: '768px' }
|
56
|
-
if ('md' in twConfig.theme?.screens && typeof twConfig.theme?.screens.md === 'string') {
|
57
|
-
desktopMin = parseInt(twConfig.theme?.screens.md)
|
58
|
-
}
|
59
|
-
if (width < desktopMin) {
|
60
|
-
if (!storeRef.current.isMobile) {
|
61
|
-
storeRef.current.setMobile(true)
|
62
|
-
}
|
63
|
-
}
|
64
|
-
else if (storeRef.current.isMobile) {
|
65
|
-
storeRef.current.setMobile(false)
|
66
|
-
}
|
67
|
-
}
|
68
|
-
storeRef.current.setViewportHeight(window.innerHeight)
|
69
|
-
}
|
70
|
-
|
71
|
-
const onResize_debounced = useDebounceCallback(onResize, 500)
|
72
|
-
|
73
|
-
useLayoutEffect(() => {
|
74
|
-
storeRef.current.initialize()
|
75
|
-
onResize()
|
76
|
-
window.addEventListener('resize', onResize_debounced);
|
77
|
-
|
78
|
-
return () => {
|
79
|
-
window.removeEventListener('resize', onResize_debounced)
|
80
|
-
storeRef.current.dispose()
|
81
|
-
}
|
82
|
-
}, [])
|
83
|
-
|
84
|
-
useEffect(() => {
|
85
|
-
const checkingOut = (pathname === '/checkout')
|
86
|
-
|
87
|
-
/////////////////////////////////////
|
88
|
-
log("useEffect: pathname: " + pathname)
|
89
|
-
log("useEffect: prev pathname: " + prevPathRef.current)
|
90
|
-
|
91
|
-
if (storeRef.current.checkingOut === undefined || storeRef.current._checkingOut!== checkingOut) {
|
92
|
-
log("useEffect: setting checkingOut to: " + checkingOut) /////////////////////////////////////
|
93
|
-
storeRef.current.setCheckingOut(checkingOut)
|
94
|
-
}
|
95
|
-
if ( prevPathRef.current === 'initial') {
|
96
|
-
prevPathRef.current = pathname
|
97
|
-
storeRef.current.newRoute()
|
98
|
-
}
|
99
|
-
else if (
|
100
|
-
!checkingOut
|
101
|
-
&&
|
102
|
-
prevPathRef.current !== pathname
|
103
|
-
) {
|
104
|
-
storeRef.current.newRoute()
|
105
|
-
prevPathRef.current = pathname
|
106
|
-
log("ROUTE CHANGE: " + pathname + ": " + storeRef.current._routeChangedTime)
|
107
|
-
}
|
108
|
-
}, [pathname])
|
109
|
-
|
110
|
-
|
111
|
-
return (
|
112
|
-
<CommerceUIContext.Provider value={storeRef.current}>
|
113
|
-
{children}
|
114
|
-
</CommerceUIContext.Provider>
|
115
|
-
)
|
116
|
-
}
|
117
|
-
|
118
|
-
export {
|
119
|
-
useCommerceDrawer,
|
120
|
-
useSelectAndBuy,
|
121
|
-
CommerceUIProvider
|
122
|
-
}
|
123
|
-
|