@secondlayer/stacks 0.3.0 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.cjs +1 -84
- package/dist/src/index.cjs.map +3 -6
- package/dist/src/index.d.cts +32 -179
- package/dist/src/index.d.ts +32 -179
- package/dist/src/index.js +1 -84
- package/dist/src/index.js.map +3 -6
- package/dist/src/tools/btc/index.cjs.map +2 -2
- package/dist/src/tools/btc/index.js.map +2 -2
- package/dist/src/tools/index.cjs.map +2 -2
- package/dist/src/tools/index.js.map +2 -2
- package/dist/src/triggers/index.cjs.map +2 -2
- package/dist/src/triggers/index.d.cts +5 -1
- package/dist/src/triggers/index.d.ts +5 -1
- package/dist/src/triggers/index.js.map +2 -2
- package/package.json +3 -37
- package/dist/src/tx/index.cjs +0 -65
- package/dist/src/tx/index.cjs.map +0 -10
- package/dist/src/tx/index.d.cts +0 -42
- package/dist/src/tx/index.d.ts +0 -42
- package/dist/src/tx/index.js +0 -22
- package/dist/src/tx/index.js.map +0 -10
- package/dist/src/ui/index.cjs +0 -431
- package/dist/src/ui/index.cjs.map +0 -27
- package/dist/src/ui/index.d.cts +0 -107
- package/dist/src/ui/index.d.ts +0 -107
- package/dist/src/ui/index.js +0 -391
- package/dist/src/ui/index.js.map +0 -27
- package/dist/src/ui/schemas.cjs +0 -134
- package/dist/src/ui/schemas.cjs.map +0 -18
- package/dist/src/ui/schemas.d.cts +0 -83
- package/dist/src/ui/schemas.d.ts +0 -83
- package/dist/src/ui/schemas.js +0 -91
- package/dist/src/ui/schemas.js.map +0 -18
package/dist/src/ui/index.js.map
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/ui/index.ts", "../../../src/ui/atoms/address.schema.ts", "../../../src/ui/atoms/address.tsx", "../../../src/ui/atoms/amount.schema.ts", "../../../src/ui/atoms/amount.tsx", "../../../src/ui/atoms/blockHeight.schema.ts", "../../../src/ui/atoms/blockHeight.tsx", "../../../src/ui/atoms/bnsName.schema.ts", "../../../src/ui/atoms/bnsName.tsx", "../../../src/ui/atoms/nftAsset.schema.ts", "../../../src/ui/atoms/nftAsset.tsx", "../../../src/ui/atoms/principal.schema.ts", "../../../src/ui/atoms/principal.tsx", "../../../src/ui/atoms/token.schema.ts", "../../../src/ui/atoms/token.tsx", "../../../src/ui/atoms/txStatus.schema.ts", "../../../src/ui/atoms/txStatus.tsx", "../../../src/ui/componentMap.tsx"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * Stacks UI atoms for json-render catalogs.\n *\n * These are reusable building blocks authors compose into their own\n * json-render catalog when calling `step.render(id, catalog, opts)`.\n *\n * Usage:\n *\n * import { defineCatalog, schema, atoms } from \"@secondlayer/stacks/ui\"\n * import { z } from \"zod\"\n *\n * const whaleUI = defineCatalog(schema, {\n * components: {\n * Address: atoms.Address,\n * Amount: atoms.Amount,\n * WhaleCard: {\n * props: z.object({ from: z.string(), amount: z.string() }),\n * render: WhaleCard,\n * },\n * },\n * actions: {},\n * })\n *\n * Re-exports `defineCatalog` + the React `schema` from `@json-render/*` so\n * users only import from one place.\n */\n\nexport { defineCatalog } from \"@json-render/core\";\nexport { schema } from \"@json-render/react\";\n\nimport type { StacksAtom } from \"./atom-types.ts\";\nimport { AddressComponent } from \"./atoms/address.tsx\";\nimport { AmountComponent } from \"./atoms/amount.tsx\";\nimport { BlockHeightComponent } from \"./atoms/blockHeight.tsx\";\nimport { BnsNameComponent } from \"./atoms/bnsName.tsx\";\nimport { NftAssetComponent } from \"./atoms/nftAsset.tsx\";\nimport { PrincipalComponent } from \"./atoms/principal.tsx\";\nimport { TokenComponent } from \"./atoms/token.tsx\";\nimport { TxStatusComponent } from \"./atoms/txStatus.tsx\";\n\nexport type { StacksAtom } from \"./atom-types.ts\";\n\nexport const atoms: Record<string, StacksAtom> = {\n\tAddress: AddressComponent,\n\tAmount: AmountComponent,\n\tBlockHeight: BlockHeightComponent,\n\tBnsName: BnsNameComponent,\n\tNftAsset: NftAssetComponent,\n\tPrincipal: PrincipalComponent,\n\tToken: TokenComponent,\n\tTxStatus: TxStatusComponent,\n};\n\n// Named exports for direct import (e.g. `import { Address } from \"@secondlayer/stacks/ui\"`)\nexport { Address, AddressProps } from \"./atoms/address.tsx\";\nexport { Amount, AmountProps } from \"./atoms/amount.tsx\";\nexport { BlockHeight, BlockHeightProps } from \"./atoms/blockHeight.tsx\";\nexport { BnsName, BnsNameProps } from \"./atoms/bnsName.tsx\";\nexport { NftAsset, NftAssetProps } from \"./atoms/nftAsset.tsx\";\nexport { Principal, PrincipalProps } from \"./atoms/principal.tsx\";\nexport { Token, TokenProps } from \"./atoms/token.tsx\";\nexport { TxStatus, TxStatusProps } from \"./atoms/txStatus.tsx\";\n\nexport { atomComponentMap } from \"./componentMap.tsx\";\n",
|
|
6
|
-
"import { z } from \"zod\";\n\nexport interface AddressPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\ttruncate?: boolean;\n}\n\nexport const AddressProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Stacks principal (SP…/SM…/ST…)\"),\n\tbns: z.string().nullable().optional().describe(\"Optional BNS override\"),\n\ttruncate: z.boolean().optional().default(true),\n});\n",
|
|
7
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { AddressProps, type AddressPropsType } from \"./address.schema.ts\";\n\nexport { AddressProps, type AddressPropsType };\n\nfunction truncatePrincipal(value: string): string {\n\tif (value.length <= 14) return value;\n\treturn `${value.slice(0, 6)}…${value.slice(-4)}`;\n}\n\nexport function Address(props: AddressPropsType): ReactElement {\n\tconst display =\n\t\tprops.bns ??\n\t\t(props.truncate ? truncatePrincipal(props.value) : props.value);\n\treturn (\n\t\t<span className=\"font-mono text-sm\" title={props.value}>\n\t\t\t{display}\n\t\t</span>\n\t);\n}\n\nexport const AddressComponent: StacksAtom = {\n\tprops: AddressProps,\n\trender: Address,\n};\n",
|
|
8
|
-
"import { z } from \"zod\";\n\nexport interface AmountPropsType {\n\tmicroUnits: string;\n\tdecimals?: number;\n\tsymbol?: string;\n\tusdValue?: number | null | undefined;\n}\n\nexport const AmountProps: z.ZodTypeAny = z.object({\n\tmicroUnits: z\n\t\t.string()\n\t\t.describe(\"Amount in micro-units (as string to preserve bigint precision)\"),\n\tdecimals: z\n\t\t.number()\n\t\t.int()\n\t\t.min(0)\n\t\t.max(18)\n\t\t.default(6)\n\t\t.describe(\n\t\t\t\"Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)\",\n\t\t),\n\tsymbol: z.string().default(\"STX\"),\n\tusdValue: z.number().nullable().optional(),\n});\n",
|
|
9
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { AmountProps, type AmountPropsType } from \"./amount.schema.ts\";\n\nexport { AmountProps, type AmountPropsType };\n\nfunction formatAmount(microUnits: string, decimals: number): string {\n\ttry {\n\t\tconst raw = BigInt(microUnits);\n\t\tconst divisor = 10n ** BigInt(decimals);\n\t\tconst whole = raw / divisor;\n\t\tconst fraction = raw % divisor;\n\t\tif (fraction === 0n) return whole.toLocaleString();\n\t\tconst fracStr = fraction\n\t\t\t.toString()\n\t\t\t.padStart(decimals, \"0\")\n\t\t\t.replace(/0+$/, \"\");\n\t\treturn `${whole.toLocaleString()}.${fracStr}`;\n\t} catch {\n\t\treturn microUnits;\n\t}\n}\n\nexport function Amount(props: AmountPropsType): ReactElement {\n\tconst decimals = props.decimals ?? 6;\n\tconst symbol = props.symbol ?? \"STX\";\n\tconst formatted = formatAmount(props.microUnits, decimals);\n\treturn (\n\t\t<span className=\"font-mono tabular-nums\">\n\t\t\t<span className=\"font-medium\">{formatted}</span>\n\t\t\t<span className=\"ml-1 text-muted-foreground\">{symbol}</span>\n\t\t\t{props.usdValue != null && (\n\t\t\t\t<span className=\"ml-2 text-sm text-muted-foreground\">\n\t\t\t\t\t($\n\t\t\t\t\t{props.usdValue.toLocaleString(undefined, {\n\t\t\t\t\t\tmaximumFractionDigits: 2,\n\t\t\t\t\t})}\n\t\t\t\t\t)\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\nexport const AmountComponent: StacksAtom = {\n\tprops: AmountProps,\n\trender: Amount,\n};\n",
|
|
10
|
-
"import { z } from \"zod\";\n\nexport interface BlockHeightPropsType {\n\theight: number;\n\ttimestamp?: string | null | undefined;\n}\n\nexport const BlockHeightProps: z.ZodTypeAny = z.object({\n\theight: z.number().int().nonnegative(),\n\ttimestamp: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"ISO-8601 block timestamp\"),\n});\n",
|
|
11
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport {\n\tBlockHeightProps,\n\ttype BlockHeightPropsType,\n} from \"./blockHeight.schema.ts\";\n\nexport { BlockHeightProps, type BlockHeightPropsType };\n\nfunction relative(timestamp: string | null | undefined): string | null {\n\tif (!timestamp) return null;\n\tconst then = new Date(timestamp).getTime();\n\tif (Number.isNaN(then)) return null;\n\tconst delta = Math.max(0, Date.now() - then);\n\tconst s = Math.floor(delta / 1000);\n\tif (s < 60) return `${s}s ago`;\n\tconst m = Math.floor(s / 60);\n\tif (m < 60) return `${m}m ago`;\n\tconst h = Math.floor(m / 60);\n\tif (h < 24) return `${h}h ago`;\n\treturn `${Math.floor(h / 24)}d ago`;\n}\n\nexport function BlockHeight(props: BlockHeightPropsType): ReactElement {\n\tconst rel = relative(props.timestamp);\n\treturn (\n\t\t<span className=\"font-mono text-sm\">\n\t\t\t<span>#{props.height.toLocaleString()}</span>\n\t\t\t{rel && <span className=\"ml-1 text-muted-foreground\">· {rel}</span>}\n\t\t</span>\n\t);\n}\n\nexport const BlockHeightComponent: StacksAtom = {\n\tprops: BlockHeightProps,\n\trender: BlockHeight,\n};\n",
|
|
12
|
-
"import { z } from \"zod\";\n\nexport interface BnsNamePropsType {\n\tname: string;\n\tnamespace: string;\n\texpiresAt?: string | null | undefined;\n}\n\nexport const BnsNameProps: z.ZodTypeAny = z.object({\n\tname: z.string(),\n\tnamespace: z.string(),\n\texpiresAt: z.string().nullable().optional().describe(\"ISO-8601 timestamp\"),\n});\n",
|
|
13
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { BnsNameProps, type BnsNamePropsType } from \"./bnsName.schema.ts\";\n\nexport { BnsNameProps, type BnsNamePropsType };\n\nexport function BnsName(props: BnsNamePropsType): ReactElement {\n\treturn (\n\t\t<span className=\"font-mono text-sm\">\n\t\t\t<span className=\"font-medium\">{props.name}</span>\n\t\t\t<span className=\"text-muted-foreground\">.{props.namespace}</span>\n\t\t</span>\n\t);\n}\n\nexport const BnsNameComponent: StacksAtom = {\n\tprops: BnsNameProps,\n\trender: BnsName,\n};\n",
|
|
14
|
-
"import { z } from \"zod\";\n\nexport interface NftAssetPropsType {\n\tassetIdentifier: string;\n\ttokenId: string;\n\tname?: string | null | undefined;\n\timageUrl?: string | null | undefined;\n}\n\nexport const NftAssetProps: z.ZodTypeAny = z.object({\n\tassetIdentifier: z\n\t\t.string()\n\t\t.describe(\"Full asset identifier (e.g. SP123.contract::asset-name)\"),\n\ttokenId: z\n\t\t.string()\n\t\t.describe(\"Token id (as string to preserve bigint precision)\"),\n\tname: z.string().nullable().optional(),\n\timageUrl: z.string().url().nullable().optional(),\n});\n",
|
|
15
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { NftAssetProps, type NftAssetPropsType } from \"./nftAsset.schema.ts\";\n\nexport { NftAssetProps, type NftAssetPropsType };\n\nexport function NftAsset(props: NftAssetPropsType): ReactElement {\n\tconst [, assetName] = props.assetIdentifier.split(\"::\", 2);\n\tconst displayName = props.name ?? `${assetName ?? \"NFT\"} #${props.tokenId}`;\n\treturn (\n\t\t<span className=\"inline-flex items-center gap-2\">\n\t\t\t{props.imageUrl && (\n\t\t\t\t<img\n\t\t\t\t\tsrc={props.imageUrl}\n\t\t\t\t\talt={displayName}\n\t\t\t\t\tclassName=\"h-5 w-5 rounded\"\n\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<span className=\"font-mono text-sm\">{displayName}</span>\n\t\t</span>\n\t);\n}\n\nexport const NftAssetComponent: StacksAtom = {\n\tprops: NftAssetProps,\n\trender: NftAsset,\n};\n",
|
|
16
|
-
"import { z } from \"zod\";\n\nexport interface PrincipalPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\tkind?: \"standard\" | \"contract\" | undefined;\n}\n\nexport const PrincipalProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Standard or contract principal\"),\n\tbns: z.string().nullable().optional(),\n\tkind: z.enum([\"standard\", \"contract\"]).optional(),\n});\n",
|
|
17
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { Address } from \"./address.tsx\";\nimport { PrincipalProps, type PrincipalPropsType } from \"./principal.schema.ts\";\n\nexport { PrincipalProps, type PrincipalPropsType };\n\nfunction inferKind(value: string): \"standard\" | \"contract\" {\n\treturn value.includes(\".\") ? \"contract\" : \"standard\";\n}\n\nexport function Principal(props: PrincipalPropsType): ReactElement {\n\tconst kind = props.kind ?? inferKind(props.value);\n\tif (kind === \"contract\") {\n\t\tconst parts = props.value.split(\".\", 2);\n\t\tconst addr = parts[0] ?? props.value;\n\t\tconst name = parts[1] ?? \"\";\n\t\treturn (\n\t\t\t<span className=\"font-mono text-sm\" title={props.value}>\n\t\t\t\t<Address value={addr} bns={props.bns} truncate />\n\t\t\t\t<span className=\"text-muted-foreground\">.</span>\n\t\t\t\t<span className=\"text-foreground\">{name}</span>\n\t\t\t</span>\n\t\t);\n\t}\n\treturn <Address value={props.value} bns={props.bns} truncate />;\n}\n\nexport const PrincipalComponent: StacksAtom = {\n\tprops: PrincipalProps,\n\trender: Principal,\n};\n",
|
|
18
|
-
"import { z } from \"zod\";\n\nexport interface TokenPropsType {\n\tsymbol: string;\n\tcontract?: string | null | undefined;\n\tdecimals?: number;\n}\n\nexport const TokenProps: z.ZodTypeAny = z.object({\n\tsymbol: z.string(),\n\tcontract: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"SIP-010 contract id (for non-STX tokens)\"),\n\tdecimals: z.number().int().min(0).max(18).default(6),\n});\n",
|
|
19
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { TokenProps, type TokenPropsType } from \"./token.schema.ts\";\n\nexport { TokenProps, type TokenPropsType };\n\nexport function Token(props: TokenPropsType): ReactElement {\n\treturn (\n\t\t<span className=\"font-mono text-sm\" title={props.contract ?? undefined}>\n\t\t\t<span className=\"font-medium\">{props.symbol}</span>\n\t\t</span>\n\t);\n}\n\nexport const TokenComponent: StacksAtom = {\n\tprops: TokenProps,\n\trender: Token,\n};\n",
|
|
20
|
-
"import { z } from \"zod\";\n\nexport interface TxStatusPropsType {\n\tstatus:\n\t\t| \"pending\"\n\t\t| \"success\"\n\t\t| \"failed\"\n\t\t| \"abort_by_post_condition\"\n\t\t| \"abort_by_response\";\n\ttxId?: string | null | undefined;\n}\n\nexport const TxStatusProps: z.ZodTypeAny = z.object({\n\tstatus: z.enum([\n\t\t\"pending\",\n\t\t\"success\",\n\t\t\"failed\",\n\t\t\"abort_by_post_condition\",\n\t\t\"abort_by_response\",\n\t]),\n\ttxId: z.string().nullable().optional(),\n});\n",
|
|
21
|
-
"import type { ReactElement } from \"react\";\nimport type { StacksAtom } from \"../atom-types.ts\";\nimport { TxStatusProps, type TxStatusPropsType } from \"./txStatus.schema.ts\";\n\nexport { TxStatusProps, type TxStatusPropsType };\n\nconst TONE: Record<TxStatusPropsType[\"status\"], string> = {\n\tpending:\n\t\t\"bg-yellow-100 text-yellow-900 dark:bg-yellow-950 dark:text-yellow-200\",\n\tsuccess: \"bg-green-100 text-green-900 dark:bg-green-950 dark:text-green-200\",\n\tfailed: \"bg-red-100 text-red-900 dark:bg-red-950 dark:text-red-200\",\n\tabort_by_post_condition:\n\t\t\"bg-orange-100 text-orange-900 dark:bg-orange-950 dark:text-orange-200\",\n\tabort_by_response:\n\t\t\"bg-red-100 text-red-900 dark:bg-red-950 dark:text-red-200\",\n};\n\nconst LABEL: Record<TxStatusPropsType[\"status\"], string> = {\n\tpending: \"pending\",\n\tsuccess: \"confirmed\",\n\tfailed: \"failed\",\n\tabort_by_post_condition: \"post-condition aborted\",\n\tabort_by_response: \"aborted\",\n};\n\nexport function TxStatus(props: TxStatusPropsType): ReactElement {\n\treturn (\n\t\t<span\n\t\t\tclassName={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${TONE[props.status]}`}\n\t\t\ttitle={props.txId ?? undefined}\n\t\t>\n\t\t\t{LABEL[props.status]}\n\t\t</span>\n\t);\n}\n\nexport const TxStatusComponent: StacksAtom = {\n\tprops: TxStatusProps,\n\trender: TxStatus,\n};\n",
|
|
22
|
-
"import type { ReactElement } from \"react\";\nimport { Address } from \"./atoms/address.tsx\";\nimport { Amount } from \"./atoms/amount.tsx\";\nimport { BlockHeight } from \"./atoms/blockHeight.tsx\";\nimport { BnsName } from \"./atoms/bnsName.tsx\";\nimport { NftAsset } from \"./atoms/nftAsset.tsx\";\nimport { Principal } from \"./atoms/principal.tsx\";\nimport { Token } from \"./atoms/token.tsx\";\nimport { TxStatus } from \"./atoms/txStatus.tsx\";\n\ntype AtomRenderer = (args: { element: { props: unknown } }) => ReactElement;\n\n/**\n * Component map for `createRenderer()` from `@json-render/react`. Bridges\n * json-render's `{ element }` wrapper back to each atom's typed props\n * signature.\n *\n * import { createRenderer } from \"@json-render/react\";\n * import { defineCatalog, schema, atoms, atomComponentMap } from \"@secondlayer/stacks/ui\";\n * const catalog = defineCatalog(schema, { components: atoms, actions: {} });\n * const Renderer = createRenderer(catalog, atomComponentMap);\n * // <Renderer spec={step.output.spec} />\n */\nexport const atomComponentMap: Record<string, AtomRenderer> = {\n\tAddress: ({ element }) => (\n\t\t<Address {...(element.props as Parameters<typeof Address>[0])} />\n\t),\n\tAmount: ({ element }) => (\n\t\t<Amount {...(element.props as Parameters<typeof Amount>[0])} />\n\t),\n\tBlockHeight: ({ element }) => (\n\t\t<BlockHeight {...(element.props as Parameters<typeof BlockHeight>[0])} />\n\t),\n\tBnsName: ({ element }) => (\n\t\t<BnsName {...(element.props as Parameters<typeof BnsName>[0])} />\n\t),\n\tNftAsset: ({ element }) => (\n\t\t<NftAsset {...(element.props as Parameters<typeof NftAsset>[0])} />\n\t),\n\tPrincipal: ({ element }) => (\n\t\t<Principal {...(element.props as Parameters<typeof Principal>[0])} />\n\t),\n\tToken: ({ element }) => (\n\t\t<Token {...(element.props as Parameters<typeof Token>[0])} />\n\t),\n\tTxStatus: ({ element }) => (\n\t\t<TxStatus {...(element.props as Parameters<typeof TxStatus>[0])} />\n\t),\n};\n"
|
|
23
|
-
],
|
|
24
|
-
"mappings": ";AA2BA;AACA;;;AC5BA;AAQO,IAAM,eAA6B,EAAE,OAAO;AAAA,EAClD,OAAO,EAAE,OAAO,EAAE,SAAS,gCAA+B;AAAA,EAC1D,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,uBAAuB;AAAA,EACtE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAC9C,CAAC;;;;ACND,SAAS,iBAAiB,CAAC,OAAuB;AAAA,EACjD,IAAI,MAAM,UAAU;AAAA,IAAI,OAAO;AAAA,EAC/B,OAAO,GAAG,MAAM,MAAM,GAAG,CAAC,KAAI,MAAM,MAAM,EAAE;AAAA;AAGtC,SAAS,OAAO,CAAC,OAAuC;AAAA,EAC9D,MAAM,UACL,MAAM,QACL,MAAM,WAAW,kBAAkB,MAAM,KAAK,IAAI,MAAM;AAAA,EAC1D,uBACC,OAEE,QAFF;AAAA,IAAM,WAAU;AAAA,IAA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AA,EAChD,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,SAAS;AAAA,EACT,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AACX;",
|
|
25
|
-
"debugId": "B28A322BCA92F0BF64756E2164756E21",
|
|
26
|
-
"names": []
|
|
27
|
-
}
|
package/dist/src/ui/schemas.cjs
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
var import_node_module = require("node:module");
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
function __accessProp(key) {
|
|
7
|
-
return this[key];
|
|
8
|
-
}
|
|
9
|
-
var __toCommonJS = (from) => {
|
|
10
|
-
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
11
|
-
if (entry)
|
|
12
|
-
return entry;
|
|
13
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (var key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(entry, key))
|
|
17
|
-
__defProp(entry, key, {
|
|
18
|
-
get: __accessProp.bind(from, key),
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
__moduleCache.set(from, entry);
|
|
23
|
-
return entry;
|
|
24
|
-
};
|
|
25
|
-
var __moduleCache;
|
|
26
|
-
var __returnValue = (v) => v;
|
|
27
|
-
function __exportSetter(name, newValue) {
|
|
28
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
29
|
-
}
|
|
30
|
-
var __export = (target, all) => {
|
|
31
|
-
for (var name in all)
|
|
32
|
-
__defProp(target, name, {
|
|
33
|
-
get: all[name],
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
set: __exportSetter.bind(all, name)
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// src/ui/schemas.ts
|
|
41
|
-
var exports_schemas = {};
|
|
42
|
-
__export(exports_schemas, {
|
|
43
|
-
defineCatalog: () => defineCatalog,
|
|
44
|
-
atomSchemas: () => atomSchemas,
|
|
45
|
-
TxStatusProps: () => TxStatusProps,
|
|
46
|
-
TokenProps: () => TokenProps,
|
|
47
|
-
PrincipalProps: () => PrincipalProps,
|
|
48
|
-
NftAssetProps: () => NftAssetProps,
|
|
49
|
-
BnsNameProps: () => BnsNameProps,
|
|
50
|
-
BlockHeightProps: () => BlockHeightProps,
|
|
51
|
-
AmountProps: () => AmountProps,
|
|
52
|
-
AddressProps: () => AddressProps
|
|
53
|
-
});
|
|
54
|
-
module.exports = __toCommonJS(exports_schemas);
|
|
55
|
-
|
|
56
|
-
// src/ui/atoms/address.schema.ts
|
|
57
|
-
var import_zod = require("zod");
|
|
58
|
-
var AddressProps = import_zod.z.object({
|
|
59
|
-
value: import_zod.z.string().describe("Stacks principal (SP…/SM…/ST…)"),
|
|
60
|
-
bns: import_zod.z.string().nullable().optional().describe("Optional BNS override"),
|
|
61
|
-
truncate: import_zod.z.boolean().optional().default(true)
|
|
62
|
-
});
|
|
63
|
-
// src/ui/atoms/amount.schema.ts
|
|
64
|
-
var import_zod2 = require("zod");
|
|
65
|
-
var AmountProps = import_zod2.z.object({
|
|
66
|
-
microUnits: import_zod2.z.string().describe("Amount in micro-units (as string to preserve bigint precision)"),
|
|
67
|
-
decimals: import_zod2.z.number().int().min(0).max(18).default(6).describe("Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)"),
|
|
68
|
-
symbol: import_zod2.z.string().default("STX"),
|
|
69
|
-
usdValue: import_zod2.z.number().nullable().optional()
|
|
70
|
-
});
|
|
71
|
-
// src/ui/atoms/blockHeight.schema.ts
|
|
72
|
-
var import_zod3 = require("zod");
|
|
73
|
-
var BlockHeightProps = import_zod3.z.object({
|
|
74
|
-
height: import_zod3.z.number().int().nonnegative(),
|
|
75
|
-
timestamp: import_zod3.z.string().nullable().optional().describe("ISO-8601 block timestamp")
|
|
76
|
-
});
|
|
77
|
-
// src/ui/atoms/bnsName.schema.ts
|
|
78
|
-
var import_zod4 = require("zod");
|
|
79
|
-
var BnsNameProps = import_zod4.z.object({
|
|
80
|
-
name: import_zod4.z.string(),
|
|
81
|
-
namespace: import_zod4.z.string(),
|
|
82
|
-
expiresAt: import_zod4.z.string().nullable().optional().describe("ISO-8601 timestamp")
|
|
83
|
-
});
|
|
84
|
-
// src/ui/atoms/nftAsset.schema.ts
|
|
85
|
-
var import_zod5 = require("zod");
|
|
86
|
-
var NftAssetProps = import_zod5.z.object({
|
|
87
|
-
assetIdentifier: import_zod5.z.string().describe("Full asset identifier (e.g. SP123.contract::asset-name)"),
|
|
88
|
-
tokenId: import_zod5.z.string().describe("Token id (as string to preserve bigint precision)"),
|
|
89
|
-
name: import_zod5.z.string().nullable().optional(),
|
|
90
|
-
imageUrl: import_zod5.z.string().url().nullable().optional()
|
|
91
|
-
});
|
|
92
|
-
// src/ui/atoms/principal.schema.ts
|
|
93
|
-
var import_zod6 = require("zod");
|
|
94
|
-
var PrincipalProps = import_zod6.z.object({
|
|
95
|
-
value: import_zod6.z.string().describe("Standard or contract principal"),
|
|
96
|
-
bns: import_zod6.z.string().nullable().optional(),
|
|
97
|
-
kind: import_zod6.z.enum(["standard", "contract"]).optional()
|
|
98
|
-
});
|
|
99
|
-
// src/ui/atoms/token.schema.ts
|
|
100
|
-
var import_zod7 = require("zod");
|
|
101
|
-
var TokenProps = import_zod7.z.object({
|
|
102
|
-
symbol: import_zod7.z.string(),
|
|
103
|
-
contract: import_zod7.z.string().nullable().optional().describe("SIP-010 contract id (for non-STX tokens)"),
|
|
104
|
-
decimals: import_zod7.z.number().int().min(0).max(18).default(6)
|
|
105
|
-
});
|
|
106
|
-
// src/ui/atoms/txStatus.schema.ts
|
|
107
|
-
var import_zod8 = require("zod");
|
|
108
|
-
var TxStatusProps = import_zod8.z.object({
|
|
109
|
-
status: import_zod8.z.enum([
|
|
110
|
-
"pending",
|
|
111
|
-
"success",
|
|
112
|
-
"failed",
|
|
113
|
-
"abort_by_post_condition",
|
|
114
|
-
"abort_by_response"
|
|
115
|
-
]),
|
|
116
|
-
txId: import_zod8.z.string().nullable().optional()
|
|
117
|
-
});
|
|
118
|
-
// src/ui/schemas.ts
|
|
119
|
-
var atomSchemas = {
|
|
120
|
-
Address: { props: AddressProps },
|
|
121
|
-
Amount: { props: AmountProps },
|
|
122
|
-
BlockHeight: { props: BlockHeightProps },
|
|
123
|
-
BnsName: { props: BnsNameProps },
|
|
124
|
-
NftAsset: { props: NftAssetProps },
|
|
125
|
-
Principal: { props: PrincipalProps },
|
|
126
|
-
Token: { props: TokenProps },
|
|
127
|
-
TxStatus: { props: TxStatusProps }
|
|
128
|
-
};
|
|
129
|
-
function defineCatalog(def) {
|
|
130
|
-
return def;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
//# debugId=A453CD9C19FDB34F64756E2164756E21
|
|
134
|
-
//# sourceMappingURL=schemas.cjs.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/ui/atoms/address.schema.ts", "../../../src/ui/atoms/amount.schema.ts", "../../../src/ui/atoms/blockHeight.schema.ts", "../../../src/ui/atoms/bnsName.schema.ts", "../../../src/ui/atoms/nftAsset.schema.ts", "../../../src/ui/atoms/principal.schema.ts", "../../../src/ui/atoms/token.schema.ts", "../../../src/ui/atoms/txStatus.schema.ts", "../../../src/ui/schemas.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { z } from \"zod\";\n\nexport interface AddressPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\ttruncate?: boolean;\n}\n\nexport const AddressProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Stacks principal (SP…/SM…/ST…)\"),\n\tbns: z.string().nullable().optional().describe(\"Optional BNS override\"),\n\ttruncate: z.boolean().optional().default(true),\n});\n",
|
|
6
|
-
"import { z } from \"zod\";\n\nexport interface AmountPropsType {\n\tmicroUnits: string;\n\tdecimals?: number;\n\tsymbol?: string;\n\tusdValue?: number | null | undefined;\n}\n\nexport const AmountProps: z.ZodTypeAny = z.object({\n\tmicroUnits: z\n\t\t.string()\n\t\t.describe(\"Amount in micro-units (as string to preserve bigint precision)\"),\n\tdecimals: z\n\t\t.number()\n\t\t.int()\n\t\t.min(0)\n\t\t.max(18)\n\t\t.default(6)\n\t\t.describe(\n\t\t\t\"Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)\",\n\t\t),\n\tsymbol: z.string().default(\"STX\"),\n\tusdValue: z.number().nullable().optional(),\n});\n",
|
|
7
|
-
"import { z } from \"zod\";\n\nexport interface BlockHeightPropsType {\n\theight: number;\n\ttimestamp?: string | null | undefined;\n}\n\nexport const BlockHeightProps: z.ZodTypeAny = z.object({\n\theight: z.number().int().nonnegative(),\n\ttimestamp: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"ISO-8601 block timestamp\"),\n});\n",
|
|
8
|
-
"import { z } from \"zod\";\n\nexport interface BnsNamePropsType {\n\tname: string;\n\tnamespace: string;\n\texpiresAt?: string | null | undefined;\n}\n\nexport const BnsNameProps: z.ZodTypeAny = z.object({\n\tname: z.string(),\n\tnamespace: z.string(),\n\texpiresAt: z.string().nullable().optional().describe(\"ISO-8601 timestamp\"),\n});\n",
|
|
9
|
-
"import { z } from \"zod\";\n\nexport interface NftAssetPropsType {\n\tassetIdentifier: string;\n\ttokenId: string;\n\tname?: string | null | undefined;\n\timageUrl?: string | null | undefined;\n}\n\nexport const NftAssetProps: z.ZodTypeAny = z.object({\n\tassetIdentifier: z\n\t\t.string()\n\t\t.describe(\"Full asset identifier (e.g. SP123.contract::asset-name)\"),\n\ttokenId: z\n\t\t.string()\n\t\t.describe(\"Token id (as string to preserve bigint precision)\"),\n\tname: z.string().nullable().optional(),\n\timageUrl: z.string().url().nullable().optional(),\n});\n",
|
|
10
|
-
"import { z } from \"zod\";\n\nexport interface PrincipalPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\tkind?: \"standard\" | \"contract\" | undefined;\n}\n\nexport const PrincipalProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Standard or contract principal\"),\n\tbns: z.string().nullable().optional(),\n\tkind: z.enum([\"standard\", \"contract\"]).optional(),\n});\n",
|
|
11
|
-
"import { z } from \"zod\";\n\nexport interface TokenPropsType {\n\tsymbol: string;\n\tcontract?: string | null | undefined;\n\tdecimals?: number;\n}\n\nexport const TokenProps: z.ZodTypeAny = z.object({\n\tsymbol: z.string(),\n\tcontract: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"SIP-010 contract id (for non-STX tokens)\"),\n\tdecimals: z.number().int().min(0).max(18).default(6),\n});\n",
|
|
12
|
-
"import { z } from \"zod\";\n\nexport interface TxStatusPropsType {\n\tstatus:\n\t\t| \"pending\"\n\t\t| \"success\"\n\t\t| \"failed\"\n\t\t| \"abort_by_post_condition\"\n\t\t| \"abort_by_response\";\n\ttxId?: string | null | undefined;\n}\n\nexport const TxStatusProps: z.ZodTypeAny = z.object({\n\tstatus: z.enum([\n\t\t\"pending\",\n\t\t\"success\",\n\t\t\"failed\",\n\t\t\"abort_by_post_condition\",\n\t\t\"abort_by_response\",\n\t]),\n\ttxId: z.string().nullable().optional(),\n});\n",
|
|
13
|
-
"/**\n * React-free Zod schemas for Stacks UI atoms, plus a pass-through\n * `defineCatalog` helper.\n *\n * Import from this module when writing a workflow handler that uses\n * `step.render` — you avoid pulling React and `@json-render/*` into the\n * bundled handler (which would duplicate Zod and break esbuild's util\n * scoping). The runner wraps the raw definition into a real json-render\n * `Catalog` at render time using its own `@json-render/*` install.\n *\n * @example\n *\n * import { defineCatalog, AddressProps, AmountProps } from \"@secondlayer/stacks/ui/schemas\"\n * import { z } from \"zod\"\n *\n * const whaleUI = defineCatalog({\n * components: {\n * Address: { props: AddressProps },\n * Amount: { props: AmountProps },\n * WhaleCard: {\n * props: z.object({ from: z.string(), amount: z.string() }),\n * },\n * },\n * actions: {},\n * })\n *\n * // ...inside a workflow handler:\n * await step.render(\"card\", whaleUI, { model, prompt, context })\n */\n\nexport {\n\tAddressProps,\n\ttype AddressPropsType,\n} from \"./atoms/address.schema.ts\";\nexport { AmountProps, type AmountPropsType } from \"./atoms/amount.schema.ts\";\nexport {\n\tBlockHeightProps,\n\ttype BlockHeightPropsType,\n} from \"./atoms/blockHeight.schema.ts\";\nexport { BnsNameProps, type BnsNamePropsType } from \"./atoms/bnsName.schema.ts\";\nexport {\n\tNftAssetProps,\n\ttype NftAssetPropsType,\n} from \"./atoms/nftAsset.schema.ts\";\nexport {\n\tPrincipalProps,\n\ttype PrincipalPropsType,\n} from \"./atoms/principal.schema.ts\";\nexport { TokenProps, type TokenPropsType } from \"./atoms/token.schema.ts\";\nexport {\n\tTxStatusProps,\n\ttype TxStatusPropsType,\n} from \"./atoms/txStatus.schema.ts\";\n\nimport type { z } from \"zod\";\nimport { AddressProps } from \"./atoms/address.schema.ts\";\nimport { AmountProps } from \"./atoms/amount.schema.ts\";\nimport { BlockHeightProps } from \"./atoms/blockHeight.schema.ts\";\nimport { BnsNameProps } from \"./atoms/bnsName.schema.ts\";\nimport { NftAssetProps } from \"./atoms/nftAsset.schema.ts\";\nimport { PrincipalProps } from \"./atoms/principal.schema.ts\";\nimport { TokenProps } from \"./atoms/token.schema.ts\";\nimport { TxStatusProps } from \"./atoms/txStatus.schema.ts\";\n\n/**\n * Atom-schema registry — ready to drop into a catalog's `components` field.\n */\nexport const atomSchemas: Record<string, { props: z.ZodTypeAny }> = {\n\tAddress: { props: AddressProps },\n\tAmount: { props: AmountProps },\n\tBlockHeight: { props: BlockHeightProps },\n\tBnsName: { props: BnsNameProps },\n\tNftAsset: { props: NftAssetProps },\n\tPrincipal: { props: PrincipalProps },\n\tToken: { props: TokenProps },\n\tTxStatus: { props: TxStatusProps },\n};\n\n// --- Raw catalog definition shape (wrapped into a Catalog at render time) ---\n\n/**\n * Raw catalog definition — a plain object mapping component names to their\n * prop schemas. The workflow runner wraps this into a `@json-render/core`\n * `Catalog` via its own install, keeping json-render out of the user bundle.\n */\nexport interface RawCatalogDefinition {\n\tcomponents: Record<string, { props: unknown }>;\n\tactions?: Record<string, { params?: unknown }>;\n}\n\n/**\n * Identity helper — exists so authors get IDE autocomplete and so the\n * migration story to a real catalog constructor stays open. Does not import\n * `@json-render/*`, so nothing React-flavored bundles into the handler.\n */\nexport function defineCatalog<T extends RawCatalogDefinition>(def: T): T {\n\treturn def;\n}\n"
|
|
14
|
-
],
|
|
15
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAkB,IAAlB;AAQO,IAAM,eAA6B,aAAE,OAAO;AAAA,EAClD,OAAO,aAAE,OAAO,EAAE,SAAS,gCAA+B;AAAA,EAC1D,KAAK,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,uBAAuB;AAAA,EACtE,UAAU,aAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAC9C,CAAC;;ACZiB,IAAlB;AASO,IAAM,cAA4B,cAAE,OAAO;AAAA,EACjD,YAAY,cACV,OAAO,EACP,SAAS,gEAAgE;AAAA,EAC3E,UAAU,cACR,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,IAAI,EAAE,EACN,QAAQ,CAAC,EACT,SACA,mEACD;AAAA,EACD,QAAQ,cAAE,OAAO,EAAE,QAAQ,KAAK;AAAA,EAChC,UAAU,cAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC1C,CAAC;;ACxBiB,IAAlB;AAOO,IAAM,mBAAiC,cAAE,OAAO;AAAA,EAC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ACD,CAAC;AAAA,EACD,MAAM,cAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AACtC,CAAC;;AC8CM,IAAM,cAAuD;AAAA,EACnE,SAAS,EAAE,OAAO,aAAa;AAAA,EAC/B,QAAQ,EAAE,OAAO,YAAY;AAAA,EAC7B,aAAa,EAAE,OAAO,iBAAiB;AAAA,EACvC,SAAS,EAAE,OAAO,aAAa;AAAA,EAC/B,UAAU,EAAE,OAAO,cAAc;AAAA,EACjC,WAAW,EAAE,OAAO,eAAe;AAAA,EACnC,OAAO,EAAE,OAAO,WAAW;AAAA,EAC3B,UAAU,EAAE,OAAO,cAAc;AAClC;AAmBO,SAAS,aAA6C,CAAC,KAAW;AAAA,EACxE,OAAO;AAAA;",
|
|
16
|
-
"debugId": "A453CD9C19FDB34F64756E2164756E21",
|
|
17
|
-
"names": []
|
|
18
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
interface AddressPropsType {
|
|
3
|
-
value: string;
|
|
4
|
-
bns?: string | null | undefined;
|
|
5
|
-
truncate?: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const AddressProps: z.ZodTypeAny;
|
|
8
|
-
import { z as z2 } from "zod";
|
|
9
|
-
interface AmountPropsType {
|
|
10
|
-
microUnits: string;
|
|
11
|
-
decimals?: number;
|
|
12
|
-
symbol?: string;
|
|
13
|
-
usdValue?: number | null | undefined;
|
|
14
|
-
}
|
|
15
|
-
declare const AmountProps: z2.ZodTypeAny;
|
|
16
|
-
import { z as z3 } from "zod";
|
|
17
|
-
interface BlockHeightPropsType {
|
|
18
|
-
height: number;
|
|
19
|
-
timestamp?: string | null | undefined;
|
|
20
|
-
}
|
|
21
|
-
declare const BlockHeightProps: z3.ZodTypeAny;
|
|
22
|
-
import { z as z4 } from "zod";
|
|
23
|
-
interface BnsNamePropsType {
|
|
24
|
-
name: string;
|
|
25
|
-
namespace: string;
|
|
26
|
-
expiresAt?: string | null | undefined;
|
|
27
|
-
}
|
|
28
|
-
declare const BnsNameProps: z4.ZodTypeAny;
|
|
29
|
-
import { z as z5 } from "zod";
|
|
30
|
-
interface NftAssetPropsType {
|
|
31
|
-
assetIdentifier: string;
|
|
32
|
-
tokenId: string;
|
|
33
|
-
name?: string | null | undefined;
|
|
34
|
-
imageUrl?: string | null | undefined;
|
|
35
|
-
}
|
|
36
|
-
declare const NftAssetProps: z5.ZodTypeAny;
|
|
37
|
-
import { z as z6 } from "zod";
|
|
38
|
-
interface PrincipalPropsType {
|
|
39
|
-
value: string;
|
|
40
|
-
bns?: string | null | undefined;
|
|
41
|
-
kind?: "standard" | "contract" | undefined;
|
|
42
|
-
}
|
|
43
|
-
declare const PrincipalProps: z6.ZodTypeAny;
|
|
44
|
-
import { z as z7 } from "zod";
|
|
45
|
-
interface TokenPropsType {
|
|
46
|
-
symbol: string;
|
|
47
|
-
contract?: string | null | undefined;
|
|
48
|
-
decimals?: number;
|
|
49
|
-
}
|
|
50
|
-
declare const TokenProps: z7.ZodTypeAny;
|
|
51
|
-
import { z as z8 } from "zod";
|
|
52
|
-
interface TxStatusPropsType {
|
|
53
|
-
status: "pending" | "success" | "failed" | "abort_by_post_condition" | "abort_by_response";
|
|
54
|
-
txId?: string | null | undefined;
|
|
55
|
-
}
|
|
56
|
-
declare const TxStatusProps: z8.ZodTypeAny;
|
|
57
|
-
import { z as z9 } from "zod";
|
|
58
|
-
/**
|
|
59
|
-
* Atom-schema registry — ready to drop into a catalog's `components` field.
|
|
60
|
-
*/
|
|
61
|
-
declare const atomSchemas: Record<string, {
|
|
62
|
-
props: z9.ZodTypeAny
|
|
63
|
-
}>;
|
|
64
|
-
/**
|
|
65
|
-
* Raw catalog definition — a plain object mapping component names to their
|
|
66
|
-
* prop schemas. The workflow runner wraps this into a `@json-render/core`
|
|
67
|
-
* `Catalog` via its own install, keeping json-render out of the user bundle.
|
|
68
|
-
*/
|
|
69
|
-
interface RawCatalogDefinition {
|
|
70
|
-
components: Record<string, {
|
|
71
|
-
props: unknown
|
|
72
|
-
}>;
|
|
73
|
-
actions?: Record<string, {
|
|
74
|
-
params?: unknown
|
|
75
|
-
}>;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Identity helper — exists so authors get IDE autocomplete and so the
|
|
79
|
-
* migration story to a real catalog constructor stays open. Does not import
|
|
80
|
-
* `@json-render/*`, so nothing React-flavored bundles into the handler.
|
|
81
|
-
*/
|
|
82
|
-
declare function defineCatalog<T extends RawCatalogDefinition>(def: T): T;
|
|
83
|
-
export { defineCatalog, atomSchemas, TxStatusPropsType, TxStatusProps, TokenPropsType, TokenProps, RawCatalogDefinition, PrincipalPropsType, PrincipalProps, NftAssetPropsType, NftAssetProps, BnsNamePropsType, BnsNameProps, BlockHeightPropsType, BlockHeightProps, AmountPropsType, AmountProps, AddressPropsType, AddressProps };
|
package/dist/src/ui/schemas.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
interface AddressPropsType {
|
|
3
|
-
value: string;
|
|
4
|
-
bns?: string | null | undefined;
|
|
5
|
-
truncate?: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const AddressProps: z.ZodTypeAny;
|
|
8
|
-
import { z as z2 } from "zod";
|
|
9
|
-
interface AmountPropsType {
|
|
10
|
-
microUnits: string;
|
|
11
|
-
decimals?: number;
|
|
12
|
-
symbol?: string;
|
|
13
|
-
usdValue?: number | null | undefined;
|
|
14
|
-
}
|
|
15
|
-
declare const AmountProps: z2.ZodTypeAny;
|
|
16
|
-
import { z as z3 } from "zod";
|
|
17
|
-
interface BlockHeightPropsType {
|
|
18
|
-
height: number;
|
|
19
|
-
timestamp?: string | null | undefined;
|
|
20
|
-
}
|
|
21
|
-
declare const BlockHeightProps: z3.ZodTypeAny;
|
|
22
|
-
import { z as z4 } from "zod";
|
|
23
|
-
interface BnsNamePropsType {
|
|
24
|
-
name: string;
|
|
25
|
-
namespace: string;
|
|
26
|
-
expiresAt?: string | null | undefined;
|
|
27
|
-
}
|
|
28
|
-
declare const BnsNameProps: z4.ZodTypeAny;
|
|
29
|
-
import { z as z5 } from "zod";
|
|
30
|
-
interface NftAssetPropsType {
|
|
31
|
-
assetIdentifier: string;
|
|
32
|
-
tokenId: string;
|
|
33
|
-
name?: string | null | undefined;
|
|
34
|
-
imageUrl?: string | null | undefined;
|
|
35
|
-
}
|
|
36
|
-
declare const NftAssetProps: z5.ZodTypeAny;
|
|
37
|
-
import { z as z6 } from "zod";
|
|
38
|
-
interface PrincipalPropsType {
|
|
39
|
-
value: string;
|
|
40
|
-
bns?: string | null | undefined;
|
|
41
|
-
kind?: "standard" | "contract" | undefined;
|
|
42
|
-
}
|
|
43
|
-
declare const PrincipalProps: z6.ZodTypeAny;
|
|
44
|
-
import { z as z7 } from "zod";
|
|
45
|
-
interface TokenPropsType {
|
|
46
|
-
symbol: string;
|
|
47
|
-
contract?: string | null | undefined;
|
|
48
|
-
decimals?: number;
|
|
49
|
-
}
|
|
50
|
-
declare const TokenProps: z7.ZodTypeAny;
|
|
51
|
-
import { z as z8 } from "zod";
|
|
52
|
-
interface TxStatusPropsType {
|
|
53
|
-
status: "pending" | "success" | "failed" | "abort_by_post_condition" | "abort_by_response";
|
|
54
|
-
txId?: string | null | undefined;
|
|
55
|
-
}
|
|
56
|
-
declare const TxStatusProps: z8.ZodTypeAny;
|
|
57
|
-
import { z as z9 } from "zod";
|
|
58
|
-
/**
|
|
59
|
-
* Atom-schema registry — ready to drop into a catalog's `components` field.
|
|
60
|
-
*/
|
|
61
|
-
declare const atomSchemas: Record<string, {
|
|
62
|
-
props: z9.ZodTypeAny
|
|
63
|
-
}>;
|
|
64
|
-
/**
|
|
65
|
-
* Raw catalog definition — a plain object mapping component names to their
|
|
66
|
-
* prop schemas. The workflow runner wraps this into a `@json-render/core`
|
|
67
|
-
* `Catalog` via its own install, keeping json-render out of the user bundle.
|
|
68
|
-
*/
|
|
69
|
-
interface RawCatalogDefinition {
|
|
70
|
-
components: Record<string, {
|
|
71
|
-
props: unknown
|
|
72
|
-
}>;
|
|
73
|
-
actions?: Record<string, {
|
|
74
|
-
params?: unknown
|
|
75
|
-
}>;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Identity helper — exists so authors get IDE autocomplete and so the
|
|
79
|
-
* migration story to a real catalog constructor stays open. Does not import
|
|
80
|
-
* `@json-render/*`, so nothing React-flavored bundles into the handler.
|
|
81
|
-
*/
|
|
82
|
-
declare function defineCatalog<T extends RawCatalogDefinition>(def: T): T;
|
|
83
|
-
export { defineCatalog, atomSchemas, TxStatusPropsType, TxStatusProps, TokenPropsType, TokenProps, RawCatalogDefinition, PrincipalPropsType, PrincipalProps, NftAssetPropsType, NftAssetProps, BnsNamePropsType, BnsNameProps, BlockHeightPropsType, BlockHeightProps, AmountPropsType, AmountProps, AddressPropsType, AddressProps };
|
package/dist/src/ui/schemas.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// src/ui/atoms/address.schema.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var AddressProps = z.object({
|
|
4
|
-
value: z.string().describe("Stacks principal (SP…/SM…/ST…)"),
|
|
5
|
-
bns: z.string().nullable().optional().describe("Optional BNS override"),
|
|
6
|
-
truncate: z.boolean().optional().default(true)
|
|
7
|
-
});
|
|
8
|
-
// src/ui/atoms/amount.schema.ts
|
|
9
|
-
import { z as z2 } from "zod";
|
|
10
|
-
var AmountProps = z2.object({
|
|
11
|
-
microUnits: z2.string().describe("Amount in micro-units (as string to preserve bigint precision)"),
|
|
12
|
-
decimals: z2.number().int().min(0).max(18).default(6).describe("Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)"),
|
|
13
|
-
symbol: z2.string().default("STX"),
|
|
14
|
-
usdValue: z2.number().nullable().optional()
|
|
15
|
-
});
|
|
16
|
-
// src/ui/atoms/blockHeight.schema.ts
|
|
17
|
-
import { z as z3 } from "zod";
|
|
18
|
-
var BlockHeightProps = z3.object({
|
|
19
|
-
height: z3.number().int().nonnegative(),
|
|
20
|
-
timestamp: z3.string().nullable().optional().describe("ISO-8601 block timestamp")
|
|
21
|
-
});
|
|
22
|
-
// src/ui/atoms/bnsName.schema.ts
|
|
23
|
-
import { z as z4 } from "zod";
|
|
24
|
-
var BnsNameProps = z4.object({
|
|
25
|
-
name: z4.string(),
|
|
26
|
-
namespace: z4.string(),
|
|
27
|
-
expiresAt: z4.string().nullable().optional().describe("ISO-8601 timestamp")
|
|
28
|
-
});
|
|
29
|
-
// src/ui/atoms/nftAsset.schema.ts
|
|
30
|
-
import { z as z5 } from "zod";
|
|
31
|
-
var NftAssetProps = z5.object({
|
|
32
|
-
assetIdentifier: z5.string().describe("Full asset identifier (e.g. SP123.contract::asset-name)"),
|
|
33
|
-
tokenId: z5.string().describe("Token id (as string to preserve bigint precision)"),
|
|
34
|
-
name: z5.string().nullable().optional(),
|
|
35
|
-
imageUrl: z5.string().url().nullable().optional()
|
|
36
|
-
});
|
|
37
|
-
// src/ui/atoms/principal.schema.ts
|
|
38
|
-
import { z as z6 } from "zod";
|
|
39
|
-
var PrincipalProps = z6.object({
|
|
40
|
-
value: z6.string().describe("Standard or contract principal"),
|
|
41
|
-
bns: z6.string().nullable().optional(),
|
|
42
|
-
kind: z6.enum(["standard", "contract"]).optional()
|
|
43
|
-
});
|
|
44
|
-
// src/ui/atoms/token.schema.ts
|
|
45
|
-
import { z as z7 } from "zod";
|
|
46
|
-
var TokenProps = z7.object({
|
|
47
|
-
symbol: z7.string(),
|
|
48
|
-
contract: z7.string().nullable().optional().describe("SIP-010 contract id (for non-STX tokens)"),
|
|
49
|
-
decimals: z7.number().int().min(0).max(18).default(6)
|
|
50
|
-
});
|
|
51
|
-
// src/ui/atoms/txStatus.schema.ts
|
|
52
|
-
import { z as z8 } from "zod";
|
|
53
|
-
var TxStatusProps = z8.object({
|
|
54
|
-
status: z8.enum([
|
|
55
|
-
"pending",
|
|
56
|
-
"success",
|
|
57
|
-
"failed",
|
|
58
|
-
"abort_by_post_condition",
|
|
59
|
-
"abort_by_response"
|
|
60
|
-
]),
|
|
61
|
-
txId: z8.string().nullable().optional()
|
|
62
|
-
});
|
|
63
|
-
// src/ui/schemas.ts
|
|
64
|
-
var atomSchemas = {
|
|
65
|
-
Address: { props: AddressProps },
|
|
66
|
-
Amount: { props: AmountProps },
|
|
67
|
-
BlockHeight: { props: BlockHeightProps },
|
|
68
|
-
BnsName: { props: BnsNameProps },
|
|
69
|
-
NftAsset: { props: NftAssetProps },
|
|
70
|
-
Principal: { props: PrincipalProps },
|
|
71
|
-
Token: { props: TokenProps },
|
|
72
|
-
TxStatus: { props: TxStatusProps }
|
|
73
|
-
};
|
|
74
|
-
function defineCatalog(def) {
|
|
75
|
-
return def;
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
defineCatalog,
|
|
79
|
-
atomSchemas,
|
|
80
|
-
TxStatusProps,
|
|
81
|
-
TokenProps,
|
|
82
|
-
PrincipalProps,
|
|
83
|
-
NftAssetProps,
|
|
84
|
-
BnsNameProps,
|
|
85
|
-
BlockHeightProps,
|
|
86
|
-
AmountProps,
|
|
87
|
-
AddressProps
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
//# debugId=C344789B3957A10364756E2164756E21
|
|
91
|
-
//# sourceMappingURL=schemas.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/ui/atoms/address.schema.ts", "../../../src/ui/atoms/amount.schema.ts", "../../../src/ui/atoms/blockHeight.schema.ts", "../../../src/ui/atoms/bnsName.schema.ts", "../../../src/ui/atoms/nftAsset.schema.ts", "../../../src/ui/atoms/principal.schema.ts", "../../../src/ui/atoms/token.schema.ts", "../../../src/ui/atoms/txStatus.schema.ts", "../../../src/ui/schemas.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { z } from \"zod\";\n\nexport interface AddressPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\ttruncate?: boolean;\n}\n\nexport const AddressProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Stacks principal (SP…/SM…/ST…)\"),\n\tbns: z.string().nullable().optional().describe(\"Optional BNS override\"),\n\ttruncate: z.boolean().optional().default(true),\n});\n",
|
|
6
|
-
"import { z } from \"zod\";\n\nexport interface AmountPropsType {\n\tmicroUnits: string;\n\tdecimals?: number;\n\tsymbol?: string;\n\tusdValue?: number | null | undefined;\n}\n\nexport const AmountProps: z.ZodTypeAny = z.object({\n\tmicroUnits: z\n\t\t.string()\n\t\t.describe(\"Amount in micro-units (as string to preserve bigint precision)\"),\n\tdecimals: z\n\t\t.number()\n\t\t.int()\n\t\t.min(0)\n\t\t.max(18)\n\t\t.default(6)\n\t\t.describe(\n\t\t\t\"Decimal places (6 for STX, 8 for sBTC, varies for SIP-010 tokens)\",\n\t\t),\n\tsymbol: z.string().default(\"STX\"),\n\tusdValue: z.number().nullable().optional(),\n});\n",
|
|
7
|
-
"import { z } from \"zod\";\n\nexport interface BlockHeightPropsType {\n\theight: number;\n\ttimestamp?: string | null | undefined;\n}\n\nexport const BlockHeightProps: z.ZodTypeAny = z.object({\n\theight: z.number().int().nonnegative(),\n\ttimestamp: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"ISO-8601 block timestamp\"),\n});\n",
|
|
8
|
-
"import { z } from \"zod\";\n\nexport interface BnsNamePropsType {\n\tname: string;\n\tnamespace: string;\n\texpiresAt?: string | null | undefined;\n}\n\nexport const BnsNameProps: z.ZodTypeAny = z.object({\n\tname: z.string(),\n\tnamespace: z.string(),\n\texpiresAt: z.string().nullable().optional().describe(\"ISO-8601 timestamp\"),\n});\n",
|
|
9
|
-
"import { z } from \"zod\";\n\nexport interface NftAssetPropsType {\n\tassetIdentifier: string;\n\ttokenId: string;\n\tname?: string | null | undefined;\n\timageUrl?: string | null | undefined;\n}\n\nexport const NftAssetProps: z.ZodTypeAny = z.object({\n\tassetIdentifier: z\n\t\t.string()\n\t\t.describe(\"Full asset identifier (e.g. SP123.contract::asset-name)\"),\n\ttokenId: z\n\t\t.string()\n\t\t.describe(\"Token id (as string to preserve bigint precision)\"),\n\tname: z.string().nullable().optional(),\n\timageUrl: z.string().url().nullable().optional(),\n});\n",
|
|
10
|
-
"import { z } from \"zod\";\n\nexport interface PrincipalPropsType {\n\tvalue: string;\n\tbns?: string | null | undefined;\n\tkind?: \"standard\" | \"contract\" | undefined;\n}\n\nexport const PrincipalProps: z.ZodTypeAny = z.object({\n\tvalue: z.string().describe(\"Standard or contract principal\"),\n\tbns: z.string().nullable().optional(),\n\tkind: z.enum([\"standard\", \"contract\"]).optional(),\n});\n",
|
|
11
|
-
"import { z } from \"zod\";\n\nexport interface TokenPropsType {\n\tsymbol: string;\n\tcontract?: string | null | undefined;\n\tdecimals?: number;\n}\n\nexport const TokenProps: z.ZodTypeAny = z.object({\n\tsymbol: z.string(),\n\tcontract: z\n\t\t.string()\n\t\t.nullable()\n\t\t.optional()\n\t\t.describe(\"SIP-010 contract id (for non-STX tokens)\"),\n\tdecimals: z.number().int().min(0).max(18).default(6),\n});\n",
|
|
12
|
-
"import { z } from \"zod\";\n\nexport interface TxStatusPropsType {\n\tstatus:\n\t\t| \"pending\"\n\t\t| \"success\"\n\t\t| \"failed\"\n\t\t| \"abort_by_post_condition\"\n\t\t| \"abort_by_response\";\n\ttxId?: string | null | undefined;\n}\n\nexport const TxStatusProps: z.ZodTypeAny = z.object({\n\tstatus: z.enum([\n\t\t\"pending\",\n\t\t\"success\",\n\t\t\"failed\",\n\t\t\"abort_by_post_condition\",\n\t\t\"abort_by_response\",\n\t]),\n\ttxId: z.string().nullable().optional(),\n});\n",
|
|
13
|
-
"/**\n * React-free Zod schemas for Stacks UI atoms, plus a pass-through\n * `defineCatalog` helper.\n *\n * Import from this module when writing a workflow handler that uses\n * `step.render` — you avoid pulling React and `@json-render/*` into the\n * bundled handler (which would duplicate Zod and break esbuild's util\n * scoping). The runner wraps the raw definition into a real json-render\n * `Catalog` at render time using its own `@json-render/*` install.\n *\n * @example\n *\n * import { defineCatalog, AddressProps, AmountProps } from \"@secondlayer/stacks/ui/schemas\"\n * import { z } from \"zod\"\n *\n * const whaleUI = defineCatalog({\n * components: {\n * Address: { props: AddressProps },\n * Amount: { props: AmountProps },\n * WhaleCard: {\n * props: z.object({ from: z.string(), amount: z.string() }),\n * },\n * },\n * actions: {},\n * })\n *\n * // ...inside a workflow handler:\n * await step.render(\"card\", whaleUI, { model, prompt, context })\n */\n\nexport {\n\tAddressProps,\n\ttype AddressPropsType,\n} from \"./atoms/address.schema.ts\";\nexport { AmountProps, type AmountPropsType } from \"./atoms/amount.schema.ts\";\nexport {\n\tBlockHeightProps,\n\ttype BlockHeightPropsType,\n} from \"./atoms/blockHeight.schema.ts\";\nexport { BnsNameProps, type BnsNamePropsType } from \"./atoms/bnsName.schema.ts\";\nexport {\n\tNftAssetProps,\n\ttype NftAssetPropsType,\n} from \"./atoms/nftAsset.schema.ts\";\nexport {\n\tPrincipalProps,\n\ttype PrincipalPropsType,\n} from \"./atoms/principal.schema.ts\";\nexport { TokenProps, type TokenPropsType } from \"./atoms/token.schema.ts\";\nexport {\n\tTxStatusProps,\n\ttype TxStatusPropsType,\n} from \"./atoms/txStatus.schema.ts\";\n\nimport type { z } from \"zod\";\nimport { AddressProps } from \"./atoms/address.schema.ts\";\nimport { AmountProps } from \"./atoms/amount.schema.ts\";\nimport { BlockHeightProps } from \"./atoms/blockHeight.schema.ts\";\nimport { BnsNameProps } from \"./atoms/bnsName.schema.ts\";\nimport { NftAssetProps } from \"./atoms/nftAsset.schema.ts\";\nimport { PrincipalProps } from \"./atoms/principal.schema.ts\";\nimport { TokenProps } from \"./atoms/token.schema.ts\";\nimport { TxStatusProps } from \"./atoms/txStatus.schema.ts\";\n\n/**\n * Atom-schema registry — ready to drop into a catalog's `components` field.\n */\nexport const atomSchemas: Record<string, { props: z.ZodTypeAny }> = {\n\tAddress: { props: AddressProps },\n\tAmount: { props: AmountProps },\n\tBlockHeight: { props: BlockHeightProps },\n\tBnsName: { props: BnsNameProps },\n\tNftAsset: { props: NftAssetProps },\n\tPrincipal: { props: PrincipalProps },\n\tToken: { props: TokenProps },\n\tTxStatus: { props: TxStatusProps },\n};\n\n// --- Raw catalog definition shape (wrapped into a Catalog at render time) ---\n\n/**\n * Raw catalog definition — a plain object mapping component names to their\n * prop schemas. The workflow runner wraps this into a `@json-render/core`\n * `Catalog` via its own install, keeping json-render out of the user bundle.\n */\nexport interface RawCatalogDefinition {\n\tcomponents: Record<string, { props: unknown }>;\n\tactions?: Record<string, { params?: unknown }>;\n}\n\n/**\n * Identity helper — exists so authors get IDE autocomplete and so the\n * migration story to a real catalog constructor stays open. Does not import\n * `@json-render/*`, so nothing React-flavored bundles into the handler.\n */\nexport function defineCatalog<T extends RawCatalogDefinition>(def: T): T {\n\treturn def;\n}\n"
|
|
14
|
-
],
|
|
15
|
-
"mappings": ";AAAA;AAQO,IAAM,eAA6B,EAAE,OAAO;AAAA,EAClD,OAAO,EAAE,OAAO,EAAE,SAAS,gCAA+B;AAAA,EAC1D,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,uBAAuB;AAAA,EACtE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAC9C,CAAC;;ACZD,cAAS;AASF,IAAM,cAA4B,GAAE,OAAO;AAAA,EACjD,YAAY,GACV,OAAO,EACP,SAAS,gEAAgE;AAAA,EAC3E,UAAU,GACR,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,IAAI,EAAE,EACN,QAAQ,CAAC,EACT,SACA,mEACD;AAAA,EACD,QAAQ,GAAE,OAAO,EAAE,QAAQ,KAAK;AAAA,EAChC,UAAU,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC1C,CAAC;;ACxBD,cAAS;AAOF,IAAM,mBAAiC,GAAE,OAAO;AAAA,EACtD,QAAQ,GAAE,OAAO,EAAE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