@0xward/cultos-utils 1.0.2 → 1.0.6
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/.github/workflows/generator-generic-ossf-slsa3-publish.yml +66 -0
- package/LICENSE +5 -0
- package/README.md +64 -5
- package/assets/header-sync.svg +14 -0
- package/examples/basic-demo.js +5 -0
- package/index.js +151 -2
- package/package.json +3 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
2
|
+
# They are provided by a third-party and are governed by
|
|
3
|
+
# separate terms of service, privacy policy, and support
|
|
4
|
+
# documentation.
|
|
5
|
+
|
|
6
|
+
# This workflow lets you generate SLSA provenance file for your project.
|
|
7
|
+
# The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements
|
|
8
|
+
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
|
|
9
|
+
# https://github.com/slsa-framework/slsa-github-generator.
|
|
10
|
+
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
|
|
11
|
+
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.
|
|
12
|
+
|
|
13
|
+
name: SLSA generic generator
|
|
14
|
+
on:
|
|
15
|
+
workflow_dispatch:
|
|
16
|
+
release:
|
|
17
|
+
types: [created]
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
outputs:
|
|
23
|
+
digests: ${{ steps.hash.outputs.digests }}
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
# ========================================================
|
|
29
|
+
#
|
|
30
|
+
# Step 1: Build your artifacts.
|
|
31
|
+
#
|
|
32
|
+
# ========================================================
|
|
33
|
+
- name: Build artifacts
|
|
34
|
+
run: |
|
|
35
|
+
# These are some amazing artifacts.
|
|
36
|
+
echo "artifact1" > artifact1
|
|
37
|
+
echo "artifact2" > artifact2
|
|
38
|
+
|
|
39
|
+
# ========================================================
|
|
40
|
+
#
|
|
41
|
+
# Step 2: Add a step to generate the provenance subjects
|
|
42
|
+
# as shown below. Update the sha256 sum arguments
|
|
43
|
+
# to include all binaries that you generate
|
|
44
|
+
# provenance for.
|
|
45
|
+
#
|
|
46
|
+
# ========================================================
|
|
47
|
+
- name: Generate subject for provenance
|
|
48
|
+
id: hash
|
|
49
|
+
run: |
|
|
50
|
+
set -euo pipefail
|
|
51
|
+
|
|
52
|
+
# List the artifacts the provenance will refer to.
|
|
53
|
+
files=$(ls artifact*)
|
|
54
|
+
# Generate the subjects (base64 encoded).
|
|
55
|
+
echo "hashes=$(sha256sum $files | base64 -w0)" >> "${GITHUB_OUTPUT}"
|
|
56
|
+
|
|
57
|
+
provenance:
|
|
58
|
+
needs: [build]
|
|
59
|
+
permissions:
|
|
60
|
+
actions: read # To read the workflow path.
|
|
61
|
+
id-token: write # To sign the provenance.
|
|
62
|
+
contents: write # To add assets to a release.
|
|
63
|
+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0
|
|
64
|
+
with:
|
|
65
|
+
base64-subjects: "${{ needs.build.outputs.digests }}"
|
|
66
|
+
upload-assets: true # Optional: Upload to a new release
|
package/LICENSE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 0xward
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software... Full MIT Granted.
|
package/README.md
CHANGED
|
@@ -1,15 +1,74 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./assets/header-sync.svg" alt="0xward Core Intelligence Sync Animation" width="120" height="120" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# @0xward/cultos-utils
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@0xward/cultos-utils"><img src="https://img.shields.io/npm/v/@0xward/cultos-utils?style=flat-square" alt="NPM Version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@0xward/cultos-utils"><img src="https://img.shields.io/npm/dm/@0xward/cultos-utils?style=flat-square" alt="NPM Downloads" /></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/@0xward/cultos-utils"><img src="https://img.shields.io/npm/l/@0xward/cultos-utils?style=flat-square" alt="License" /></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
A specialized developer utility framework containing metadata modeling tools and statistical validation functions for algorithmic token distributions inside the CultOS digital token ecosystem.
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
- **Meme Framework Parameters:** Configurable boundaries for setting up automated viral mechanics.
|
|
7
|
-
- **Stacks Interoperability:** Clean utilities designed to streamline interaction with Clarity smart contracts.
|
|
15
|
+
---
|
|
8
16
|
|
|
9
17
|
## Installation
|
|
18
|
+
|
|
19
|
+
### Prerequisites
|
|
20
|
+
- Node.js >= 18.0.0
|
|
21
|
+
- npm >= 9.0.0 (or yarn >= 1.22.0 / pnpm >= 8.0.0)
|
|
22
|
+
|
|
23
|
+
### Package Deployment
|
|
24
|
+
Execute the targeted acquisition command matching your production environment package manager setup:
|
|
25
|
+
|
|
10
26
|
```bash
|
|
27
|
+
# Using Node Package Manager (Default)
|
|
11
28
|
npm install @0xward/cultos-utils
|
|
29
|
+
|
|
30
|
+
# Using Yarn Package Manager
|
|
31
|
+
yarn add @0xward/cultos-utils
|
|
32
|
+
|
|
33
|
+
# Using PNPM Package Manager
|
|
34
|
+
pnpm add @0xward/cultos-utils
|
|
12
35
|
```
|
|
13
36
|
|
|
37
|
+
### Peer Dependencies
|
|
38
|
+
For secure runtime cryptographic executions and ledger state mutations, ensure your runtime container establishes communication boundaries with the primary network bindings if processing on-chain blocks:
|
|
39
|
+
- For Stacks L2 layers: @stacks/transactions (>= 6.x) for standard SIP-10 token serialization compliance.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Core Capabilities
|
|
44
|
+
|
|
45
|
+
* **SIP-10 Standardization Tooling:** Implements structural verification blueprints to check data alignment with Stacks standard fungible token parameters.
|
|
46
|
+
* **Velocity Simulation Models:** Houses computational logic to forecast engagement growth multipliers based on custom initial parameters.
|
|
47
|
+
* **Distributed Metadata Mapping:** Formats metadata schemas ensuring clean binding setups with protocol targets like Gaia and IPFS storage interfaces.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
const { CultOSUtils } = require("@0xward/cultos-utils");
|
|
55
|
+
const metadata = CultOSUtils.generateMemeMetadata("Core Cult Network", "CCN");
|
|
56
|
+
console.log("Standardized Token Object:", metadata);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## API Reference
|
|
62
|
+
|
|
63
|
+
### Methods
|
|
64
|
+
|
|
65
|
+
| Method | Parameters | Return Type | Description |
|
|
66
|
+
| :--- | :--- | :--- | :--- |
|
|
67
|
+
| `generateMemeMetadata` | `name: string`, `ticker: string` | `Object` | Generates structured JSON files fully compliant with token metadata definitions. |
|
|
68
|
+
| `calculateViralFactor` | `metrics: Object` | `number` | Runs analytical models to map probability outputs from networking inputs. |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
14
72
|
## License
|
|
15
|
-
|
|
73
|
+
|
|
74
|
+
This project is licensed under the terms of the MIT License.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="120" height="120">
|
|
2
|
+
<style>
|
|
3
|
+
.layer { fill: none; stroke: #888888; stroke-width: 2; transform-origin: center; }
|
|
4
|
+
.l1 { animation: slide 3s ease-in-out infinite; }
|
|
5
|
+
.l2 { animation: slide 3s ease-in-out infinite; animation-delay: 1s; }
|
|
6
|
+
.l3 { animation: slide 3s ease-in-out infinite; animation-delay: 2s; }
|
|
7
|
+
@keyframes slide { 0%, 100% { transform: translateY(0px) scale(0.9); opacity: 0.4; } 50% { transform: translateY(-5px) scale(1); opacity: 0.9; } }
|
|
8
|
+
</style>
|
|
9
|
+
<g>
|
|
10
|
+
<polygon points="50,20 80,35 50,50 20,35" class="layer l1" />
|
|
11
|
+
<polygon points="50,40 80,55 50,70 20,55" class="layer l2" />
|
|
12
|
+
<polygon points="50,60 80,75 50,90 20,75" class="layer l3" />
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const { CultOSUtils } = require("../index.js");
|
|
2
|
+
console.log("🚀 Generating Cult Meme Coin Metadata on Stacks...");
|
|
3
|
+
const meta = CultOSUtils.generateMemeMetadata("WAGMI Cult", "WAGMIC");
|
|
4
|
+
console.log("Metadata Created:", meta);
|
|
5
|
+
console.log("✅ [cultos-utils] Demo running successfully!");
|
package/index.js
CHANGED
|
@@ -1,2 +1,151 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @0xward/cultos-utils
|
|
2
|
+
// AI-powered meme coin generator framework for the Stacks ecosystem (Bitcoin L2)
|
|
3
|
+
// SIP-10 compliant token metadata, viral factor scoring, and cult mechanics
|
|
4
|
+
|
|
5
|
+
const SIP10_STANDARD = "SIP-010";
|
|
6
|
+
const STACKS_ECOSYSTEM = "Stacks Bitcoin L2";
|
|
7
|
+
const DEFAULT_SUPPLY = "1000000000";
|
|
8
|
+
const MAX_TICKER_LENGTH = 8;
|
|
9
|
+
const MIN_TICKER_LENGTH = 2;
|
|
10
|
+
const MAX_NAME_LENGTH = 64;
|
|
11
|
+
|
|
12
|
+
const CULT_ARCHETYPES = {
|
|
13
|
+
degen: { viralMultiplier: 1.8, description: "High risk, high reward degenerate energy" },
|
|
14
|
+
meme: { viralMultiplier: 2.0, description: "Pure internet culture and meme propagation" },
|
|
15
|
+
oracle: { viralMultiplier: 1.5, description: "Mystical on-chain prophecy narrative" },
|
|
16
|
+
rebel: { viralMultiplier: 1.6, description: "Anti-establishment movement energy" },
|
|
17
|
+
cosmic: { viralMultiplier: 1.7, description: "Universal and transcendental branding" },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const TOKENOMICS_PRESETS = {
|
|
21
|
+
fair: { community: 80, team: 10, treasury: 10 },
|
|
22
|
+
stealth: { community: 95, team: 0, treasury: 5 },
|
|
23
|
+
vested: { community: 60, team: 20, treasury: 20 },
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
class CultOSUtils {
|
|
27
|
+
constructor(options = {}) {
|
|
28
|
+
this.ecosystem = options.ecosystem || STACKS_ECOSYSTEM;
|
|
29
|
+
this.standard = options.standard || SIP10_STANDARD;
|
|
30
|
+
this.version = "1.0.6";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_validateTicker(ticker) {
|
|
34
|
+
if (typeof ticker !== "string" || ticker.trim().length === 0) {
|
|
35
|
+
throw new Error("ticker must be a non-empty string.");
|
|
36
|
+
}
|
|
37
|
+
const clean = ticker.trim().toUpperCase();
|
|
38
|
+
if (clean.length < MIN_TICKER_LENGTH || clean.length > MAX_TICKER_LENGTH) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
`ticker must be ${MIN_TICKER_LENGTH}–${MAX_TICKER_LENGTH} characters. Got: "${clean}" (${clean.length})`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
if (!/^[A-Z0-9]+$/.test(clean)) {
|
|
44
|
+
throw new Error(`ticker must only contain uppercase letters and digits. Got: "${clean}"`);
|
|
45
|
+
}
|
|
46
|
+
return clean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_validateName(name) {
|
|
50
|
+
if (typeof name !== "string" || name.trim().length === 0) {
|
|
51
|
+
throw new Error("name must be a non-empty string.");
|
|
52
|
+
}
|
|
53
|
+
if (name.trim().length > MAX_NAME_LENGTH) {
|
|
54
|
+
throw new Error(`name must not exceed ${MAX_NAME_LENGTH} characters.`);
|
|
55
|
+
}
|
|
56
|
+
return name.trim();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
_validateSupply(supply) {
|
|
60
|
+
const s = String(supply || DEFAULT_SUPPLY).replace(/_/g, "");
|
|
61
|
+
if (!/^\d+$/.test(s) || BigInt(s) <= 0n) {
|
|
62
|
+
throw new Error(`supply must be a positive integer string. Got: "${supply}"`);
|
|
63
|
+
}
|
|
64
|
+
return s;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
_computeViralScore(archetype, supply, nameLength) {
|
|
68
|
+
const base = CULT_ARCHETYPES[archetype]?.viralMultiplier || 1.0;
|
|
69
|
+
const supplyNum = Math.log10(parseFloat(supply) || 1);
|
|
70
|
+
const namePenalty = nameLength > 20 ? 0.9 : 1.0;
|
|
71
|
+
const raw = base * (supplyNum / 10) * namePenalty * 100;
|
|
72
|
+
return Math.min(Math.round(raw), 100);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static generateMemeMetadata(name, ticker, options = {}) {
|
|
76
|
+
const instance = new CultOSUtils(options);
|
|
77
|
+
return instance.generateMemeMetadata(name, ticker, options);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
generateMemeMetadata(name, ticker, options = {}) {
|
|
81
|
+
const validName = this._validateName(name);
|
|
82
|
+
const validTicker = this._validateTicker(ticker);
|
|
83
|
+
const supply = this._validateSupply(options.supply);
|
|
84
|
+
const archetype = options.archetype || "meme";
|
|
85
|
+
const decimals = options.decimals ?? 6;
|
|
86
|
+
const preset = options.tokenomics || "fair";
|
|
87
|
+
|
|
88
|
+
if (!CULT_ARCHETYPES[archetype]) {
|
|
89
|
+
throw new Error(
|
|
90
|
+
`Unknown archetype: "${archetype}". Use: ${Object.keys(CULT_ARCHETYPES).join(", ")}.`
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
if (!TOKENOMICS_PRESETS[preset]) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`Unknown tokenomics preset: "${preset}". Use: ${Object.keys(TOKENOMICS_PRESETS).join(", ")}.`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const viralScore = this._computeViralScore(archetype, supply, validName.length);
|
|
100
|
+
const tokenomics = TOKENOMICS_PRESETS[preset];
|
|
101
|
+
const cultMeta = CULT_ARCHETYPES[archetype];
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
name: validName,
|
|
105
|
+
ticker: validTicker,
|
|
106
|
+
supply,
|
|
107
|
+
decimals,
|
|
108
|
+
sip10Standard: this.standard,
|
|
109
|
+
ecosystem: this.ecosystem,
|
|
110
|
+
securedBy: "Bitcoin",
|
|
111
|
+
archetype,
|
|
112
|
+
archetypeDescription: cultMeta.description,
|
|
113
|
+
viralScore,
|
|
114
|
+
viralRating: viralScore >= 80 ? "Viral" : viralScore >= 50 ? "Growing" : "Niche",
|
|
115
|
+
tokenomics: {
|
|
116
|
+
preset,
|
|
117
|
+
communityPercent: tokenomics.community,
|
|
118
|
+
teamPercent: tokenomics.team,
|
|
119
|
+
treasuryPercent: tokenomics.treasury,
|
|
120
|
+
},
|
|
121
|
+
generatedAt: new Date().toISOString(),
|
|
122
|
+
sdkVersion: this.version,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
computeViralFactor(metadata) {
|
|
127
|
+
if (!metadata || typeof metadata !== "object") {
|
|
128
|
+
throw new Error("metadata must be a valid object.");
|
|
129
|
+
}
|
|
130
|
+
if (!metadata.ticker || !metadata.name) {
|
|
131
|
+
throw new Error("metadata must include 'ticker' and 'name'.");
|
|
132
|
+
}
|
|
133
|
+
const archetype = metadata.archetype || "meme";
|
|
134
|
+
const supply = metadata.supply || DEFAULT_SUPPLY;
|
|
135
|
+
return this._computeViralScore(archetype, supply, metadata.name.length);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
getCultArchetypes() {
|
|
139
|
+
return Object.entries(CULT_ARCHETYPES).map(([key, val]) => ({ id: key, ...val }));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
getTokenomicsPresets() {
|
|
143
|
+
return Object.entries(TOKENOMICS_PRESETS).map(([key, val]) => ({ id: key, ...val }));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
getVersion() {
|
|
147
|
+
return this.version;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
module.exports = { CultOSUtils, CULT_ARCHETYPES, TOKENOMICS_PRESETS, SIP10_STANDARD };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xward/cultos-utils",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "Futuristic AI-powered generator framework for viral internet-style cult meme coins in the Stacks ecosystem.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"0xward",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"bugs": {
|
|
21
21
|
"url": "https://github.com/0xward/cultos-utils/issues"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://
|
|
23
|
+
"homepage": "https://www.npmjs.com/package/@0xward/cultos-utils#readme"
|
|
24
24
|
}
|