@latchprotocol/widgets 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/LICENSE +21 -0
- package/README.md +649 -0
- package/dist/adapters/binDistribution.d.ts +19 -0
- package/dist/adapters/binDistribution.d.ts.map +1 -0
- package/dist/adapters/protocol.d.ts +409 -0
- package/dist/adapters/protocol.d.ts.map +1 -0
- package/dist/adapters/sale.d.ts +142 -0
- package/dist/adapters/sale.d.ts.map +1 -0
- package/dist/adapters/viem.d.ts +89 -0
- package/dist/adapters/viem.d.ts.map +1 -0
- package/dist/callpath/constants.d.ts +218 -0
- package/dist/callpath/constants.d.ts.map +1 -0
- package/dist/callpath/launch.d.ts +1979 -0
- package/dist/callpath/launch.d.ts.map +1 -0
- package/dist/callpath/liquidity.d.ts +103 -0
- package/dist/callpath/liquidity.d.ts.map +1 -0
- package/dist/callpath/plan.d.ts +34 -0
- package/dist/callpath/plan.d.ts.map +1 -0
- package/dist/callpath/swap.d.ts +129 -0
- package/dist/callpath/swap.d.ts.map +1 -0
- package/dist/chunks/SwapWidget-DgyHAVc8.js +2404 -0
- package/dist/chunks/SwapWidget-DgyHAVc8.js.map +1 -0
- package/dist/chunks/scan-Dhu7f4Nl.js +2497 -0
- package/dist/chunks/scan-Dhu7f4Nl.js.map +1 -0
- package/dist/chunks/useLocker-D1c_NTk-.js +1613 -0
- package/dist/chunks/useLocker-D1c_NTk-.js.map +1 -0
- package/dist/components/LaunchWidget.d.ts +117 -0
- package/dist/components/LaunchWidget.d.ts.map +1 -0
- package/dist/components/LiquidityWidget.d.ts +33 -0
- package/dist/components/LiquidityWidget.d.ts.map +1 -0
- package/dist/components/LockerWidget.d.ts +51 -0
- package/dist/components/LockerWidget.d.ts.map +1 -0
- package/dist/components/LocksWidgets.d.ts +61 -0
- package/dist/components/LocksWidgets.d.ts.map +1 -0
- package/dist/components/SwapWidget.d.ts +165 -0
- package/dist/components/SwapWidget.d.ts.map +1 -0
- package/dist/components/TokenTrustPanel.d.ts +32 -0
- package/dist/components/TokenTrustPanel.d.ts.map +1 -0
- package/dist/components/lockCharts.d.ts +29 -0
- package/dist/components/lockCharts.d.ts.map +1 -0
- package/dist/components/portal.d.ts +10 -0
- package/dist/components/portal.d.ts.map +1 -0
- package/dist/components/primitives.d.ts +139 -0
- package/dist/components/primitives.d.ts.map +1 -0
- package/dist/components/swap/SwapSettings.d.ts +12 -0
- package/dist/components/swap/SwapSettings.d.ts.map +1 -0
- package/dist/components/swap/TokenSelect.d.ts +61 -0
- package/dist/components/swap/TokenSelect.d.ts.map +1 -0
- package/dist/components/swap/state.d.ts +208 -0
- package/dist/components/swap/state.d.ts.map +1 -0
- package/dist/config/chain.d.ts +163 -0
- package/dist/config/chain.d.ts.map +1 -0
- package/dist/config/integrator.d.ts +121 -0
- package/dist/config/integrator.d.ts.map +1 -0
- package/dist/context/WidgetProvider.d.ts +78 -0
- package/dist/context/WidgetProvider.d.ts.map +1 -0
- package/dist/core/clMath.d.ts +98 -0
- package/dist/core/clMath.d.ts.map +1 -0
- package/dist/core/errors.d.ts +18 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/format.d.ts +47 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/liquidityGuards.d.ts +53 -0
- package/dist/core/liquidityGuards.d.ts.map +1 -0
- package/dist/core/liquidityRefresh.d.ts +35 -0
- package/dist/core/liquidityRefresh.d.ts.map +1 -0
- package/dist/core/math.d.ts +129 -0
- package/dist/core/math.d.ts.map +1 -0
- package/dist/core/pool.d.ts +33 -0
- package/dist/core/pool.d.ts.map +1 -0
- package/dist/core/tokenLists.d.ts +46 -0
- package/dist/core/tokenLists.d.ts.map +1 -0
- package/dist/embed/iframe.d.ts +185 -0
- package/dist/embed/iframe.d.ts.map +1 -0
- package/dist/embed/lockBadge.d.ts +55 -0
- package/dist/embed/lockBadge.d.ts.map +1 -0
- package/dist/embed/webComponent.d.ts +83 -0
- package/dist/embed/webComponent.d.ts.map +1 -0
- package/dist/embed.d.ts +25 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.js +543 -0
- package/dist/embed.js.map +1 -0
- package/dist/headless.d.ts +60 -0
- package/dist/headless.d.ts.map +1 -0
- package/dist/headless.js +223 -0
- package/dist/headless.js.map +1 -0
- package/dist/hooks/useAsyncResource.d.ts +38 -0
- package/dist/hooks/useAsyncResource.d.ts.map +1 -0
- package/dist/hooks/useLaunch.d.ts +140 -0
- package/dist/hooks/useLaunch.d.ts.map +1 -0
- package/dist/hooks/useLiquidity.d.ts +91 -0
- package/dist/hooks/useLiquidity.d.ts.map +1 -0
- package/dist/hooks/useLocker.d.ts +77 -0
- package/dist/hooks/useLocker.d.ts.map +1 -0
- package/dist/hooks/useLocks.d.ts +33 -0
- package/dist/hooks/useLocks.d.ts.map +1 -0
- package/dist/hooks/useSwapExecute.d.ts +46 -0
- package/dist/hooks/useSwapExecute.d.ts.map +1 -0
- package/dist/hooks/useSwapQuote.d.ts +51 -0
- package/dist/hooks/useSwapQuote.d.ts.map +1 -0
- package/dist/hooks/useTokenLists.d.ts +26 -0
- package/dist/hooks/useTokenLists.d.ts.map +1 -0
- package/dist/hooks/useTokenTrust.d.ts +40 -0
- package/dist/hooks/useTokenTrust.d.ts.map +1 -0
- package/dist/hooks/useTokens.d.ts +15 -0
- package/dist/hooks/useTokens.d.ts.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1052 -0
- package/dist/index.js.map +1 -0
- package/dist/latch-embed.d.ts +19 -0
- package/dist/latch-embed.d.ts.map +1 -0
- package/dist/latch-embed.js +950 -0
- package/dist/latch-embed.js.map +1 -0
- package/dist/latch-embed.mjs +13162 -0
- package/dist/latch-embed.mjs.map +1 -0
- package/dist/locker/model.d.ts +73 -0
- package/dist/locker/model.d.ts.map +1 -0
- package/dist/locks/embedModel.d.ts +22 -0
- package/dist/locks/embedModel.d.ts.map +1 -0
- package/dist/locks/fetch.d.ts +60 -0
- package/dist/locks/fetch.d.ts.map +1 -0
- package/dist/locks/model.d.ts +143 -0
- package/dist/locks/model.d.ts.map +1 -0
- package/dist/locks/scan.d.ts +25 -0
- package/dist/locks/scan.d.ts.map +1 -0
- package/dist/styles/css.d.ts +32 -0
- package/dist/styles/css.d.ts.map +1 -0
- package/dist/styles.css +895 -0
- package/dist/trust/model.d.ts +48 -0
- package/dist/trust/model.d.ts.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token trust: the pure half of `TokenTrustPanel`.
|
|
3
|
+
*
|
|
4
|
+
* Turns the SDK's `readTokenTrust` result into labelled rows, each carrying
|
|
5
|
+
* the words (from `@latchprotocol/sdk/trust`'s formatters, so every surface
|
|
6
|
+
* says the same thing) and its provenance: the contract, the view called and
|
|
7
|
+
* the blocks read. Nothing is added that was not read; nothing says "safe".
|
|
8
|
+
*/
|
|
9
|
+
import type { Hex } from "viem";
|
|
10
|
+
import { type TokenTrust, type TokenTrustSummary, type TrustSource, type TrustTone } from "@latchprotocol/sdk/trust";
|
|
11
|
+
import { type ShareBarView } from "../locks/model.js";
|
|
12
|
+
export interface TrustRowView {
|
|
13
|
+
readonly key: string;
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly headline: string;
|
|
16
|
+
readonly detail: string | null;
|
|
17
|
+
readonly tone: TrustTone;
|
|
18
|
+
/** One line per source: "LatchTokenLock 0x12ab…cdef · totalHeld · blocks 1–3". */
|
|
19
|
+
readonly provenance: readonly string[];
|
|
20
|
+
/** The same sources, for linking each contract to an explorer. */
|
|
21
|
+
readonly sources: readonly TrustSource[];
|
|
22
|
+
/** A locked-share bar for the rows that measure one (liquidity, token locks); `null` otherwise. */
|
|
23
|
+
readonly share?: ShareBarView | null;
|
|
24
|
+
}
|
|
25
|
+
export interface TrustPoolView {
|
|
26
|
+
readonly poolId: Hex;
|
|
27
|
+
readonly title: string;
|
|
28
|
+
/** How the pool was found, in words. */
|
|
29
|
+
readonly foundBy: string;
|
|
30
|
+
readonly rows: readonly TrustRowView[];
|
|
31
|
+
}
|
|
32
|
+
export interface TokenTrustView {
|
|
33
|
+
readonly summary: TokenTrustSummary;
|
|
34
|
+
readonly launch: TrustRowView;
|
|
35
|
+
readonly tokenLocks: TrustRowView;
|
|
36
|
+
readonly creatorTax: TrustRowView;
|
|
37
|
+
readonly pools: readonly TrustPoolView[];
|
|
38
|
+
/** Pools found but not described, one sentence each. */
|
|
39
|
+
readonly failedPools: readonly string[];
|
|
40
|
+
/** Which pools are listed, and that the list is not every pool of the token. */
|
|
41
|
+
readonly discoveryNote: string;
|
|
42
|
+
readonly readAtNote: string;
|
|
43
|
+
}
|
|
44
|
+
/** Symbols the host resolved, by lowercase address; the short address otherwise. */
|
|
45
|
+
export type SymbolBook = Readonly<Record<string, string>>;
|
|
46
|
+
/** Pure: every row of the trust panel from one read. */
|
|
47
|
+
export declare function tokenTrustView(t: TokenTrust, book?: SymbolBook): TokenTrustView;
|
|
48
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/trust/model.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAW,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAWL,KAAK,UAAU,EACf,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,C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": "0.1.0",
|
|
4
|
+
"description": "Embeddable swap, liquidity and launch widgets for LatchProtocol. Headless controllers plus drop-in styled UI, with first-class integrator fee attribution.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./headless": {
|
|
17
|
+
"types": "./dist/headless.d.ts",
|
|
18
|
+
"import": "./dist/headless.js",
|
|
19
|
+
"default": "./dist/headless.js"
|
|
20
|
+
},
|
|
21
|
+
"./embed": {
|
|
22
|
+
"types": "./dist/embed.d.ts",
|
|
23
|
+
"import": "./dist/embed.js",
|
|
24
|
+
"default": "./dist/embed.js"
|
|
25
|
+
},
|
|
26
|
+
"./styles.css": "./dist/styles.css",
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
"./latch-embed.js": "./dist/latch-embed.js",
|
|
29
|
+
"./latch-embed.mjs": "./dist/latch-embed.mjs"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"sideEffects": [
|
|
37
|
+
"**/*.css"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "vite build && vite build --config vite.embed.config.ts && tsc -p tsconfig.build.json && node scripts/emit-css.mjs",
|
|
44
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:watch": "vitest",
|
|
47
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
48
|
+
"test:fork": "vitest run --config vitest.fork.config.ts",
|
|
49
|
+
"test:all": "npm run test && npm run test:fork",
|
|
50
|
+
"build:embed": "vite build --config vite.embed.config.ts"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"latchprotocol",
|
|
54
|
+
"widget",
|
|
55
|
+
"swap",
|
|
56
|
+
"liquidity",
|
|
57
|
+
"launchpad",
|
|
58
|
+
"defi",
|
|
59
|
+
"embeddable",
|
|
60
|
+
"react"
|
|
61
|
+
],
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@latchprotocol/sdk": "^0.1.0",
|
|
64
|
+
"@radix-ui/react-dialog": "^1.1.23",
|
|
65
|
+
"@radix-ui/react-popover": "^1.1.23",
|
|
66
|
+
"@radix-ui/react-tooltip": "^1.2.16"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
70
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
71
|
+
"viem": "^2.21.0",
|
|
72
|
+
"wagmi": "^2.0.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"wagmi": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@types/node": "^22.7.0",
|
|
81
|
+
"@types/react": "^18.3.12",
|
|
82
|
+
"@types/react-dom": "^18.3.1",
|
|
83
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
84
|
+
"react": "^18.3.1",
|
|
85
|
+
"react-dom": "^18.3.1",
|
|
86
|
+
"typescript": "^5.6.0",
|
|
87
|
+
"viem": "^2.21.0",
|
|
88
|
+
"vite": "^5.4.11",
|
|
89
|
+
"vitest": "^2.1.0"
|
|
90
|
+
},
|
|
91
|
+
"homepage": "https://latches.fun",
|
|
92
|
+
"repository": {
|
|
93
|
+
"type": "git",
|
|
94
|
+
"url": "git+https://github.com/Latch-Protocol-Team/latch-sdk.git"
|
|
95
|
+
},
|
|
96
|
+
"bugs": {
|
|
97
|
+
"url": "https://github.com/Latch-Protocol-Team/latch-sdk/issues"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public"
|
|
101
|
+
}
|
|
102
|
+
}
|