Skip to content

Commit 820d558

Browse files
authored
Merge branch 'develop' into 1223-fix-todos
2 parents 724df17 + a4ad487 commit 820d558

File tree

6 files changed

+1284
-1120
lines changed

6 files changed

+1284
-1120
lines changed

packages/core/src/generation.ts

+16-5
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,22 @@ export async function generateText({
146146

147147
elizaLogger.info("Selected model:", model);
148148

149-
const temperature = models[provider].settings.temperature;
150-
const frequency_penalty = models[provider].settings.frequency_penalty;
151-
const presence_penalty = models[provider].settings.presence_penalty;
152-
const max_context_length = models[provider].settings.maxInputTokens;
153-
const max_response_length = models[provider].settings.maxOutputTokens;
149+
const modelConfiguration = runtime.character?.settings?.modelConfig;
150+
const temperature =
151+
modelConfiguration?.temperature ||
152+
models[provider].settings.temperature;
153+
const frequency_penalty =
154+
modelConfiguration?.frequency_penalty ||
155+
models[provider].settings.frequency_penalty;
156+
const presence_penalty =
157+
modelConfiguration?.presence_penalty ||
158+
models[provider].settings.presence_penalty;
159+
const max_context_length =
160+
modelConfiguration?.maxInputTokens ||
161+
models[provider].settings.maxInputTokens;
162+
const max_response_length =
163+
modelConfiguration.max_response_length ||
164+
models[provider].settings.maxOutputTokens;
154165

155166
const apiKey = runtime.token;
156167

packages/core/src/types.ts

+9
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,14 @@ export interface IAgentConfig {
626626
[key: string]: string;
627627
}
628628

629+
export interface ModelConfiguration {
630+
temperature?: number;
631+
max_response_length?: number;
632+
frequency_penalty?: number;
633+
presence_penalty?: number;
634+
maxInputTokens?: number;
635+
}
636+
629637
/**
630638
* Configuration for an agent character
631639
*/
@@ -738,6 +746,7 @@ export type Character = {
738746
};
739747
};
740748
model?: string;
749+
modelConfig?: ModelConfiguration;
741750
embeddingModel?: string;
742751
chains?: {
743752
evm?: any[];

packages/plugin-3d-generation/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"types": "dist/index.d.ts",
77
"dependencies": {
88
"@elizaos/core": "workspace:*",
9-
"tsup": "8.3.5"
9+
"tsup": "8.3.5",
10+
"whatwg-url": "7.1.0"
1011
},
1112
"scripts": {
1213
"build": "tsup --format esm --dts",

packages/plugin-starknet/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"@elizaos/plugin-trustdb": "workspace:*",
1010
"@avnu/avnu-sdk": "2.1.1",
1111
"@uniswap/sdk-core": "6.0.0",
12+
"unruggable-sdk": "1.4.0",
1213
"@unruggable_starknet/core": "0.1.0",
1314
"starknet": "6.18.0",
1415
"tsup": "8.3.5",

packages/plugin-starknet/src/actions/unruggable.ts

+55-55
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ import {
99
Memory,
1010
ModelClass,
1111
State,
12+
type Action,
1213
} from "@elizaos/core";
1314
import { Percent } from "@uniswap/sdk-core";
15+
import { createMemecoin, launchOnEkubo } from "unruggable-sdk";
16+
import { constants } from "starknet";
17+
1418
import {
1519
getStarknetAccount,
1620
getStarknetProvider,
@@ -22,9 +26,20 @@ import { AMM, QUOTE_TOKEN_SYMBOL } from "@unruggable_starknet/core/constants";
2226
import { ACCOUNTS, TOKENS } from "../utils/constants.ts";
2327
import { validateStarknetConfig } from "../environment.ts";
2428

25-
export function isDeployTokenContent(
26-
content: DeployData
27-
): content is DeployData {
29+
interface SwapContent {
30+
sellTokenAddress: string;
31+
buyTokenAddress: string;
32+
sellAmount: string;
33+
}
34+
35+
interface DeployTokenContent {
36+
name: string;
37+
symbol: string;
38+
owner: string;
39+
initialSupply: string;
40+
}
41+
42+
export function isDeployTokenContent(content: DeployTokenContent) {
2843
// Validate types
2944
const validTypes =
3045
typeof content.name === "string" &&
@@ -122,77 +137,62 @@ export const deployToken: Action = {
122137
const provider = getStarknetProvider(runtime);
123138
const account = getStarknetAccount(runtime);
124139

125-
const factory = new Factory({
126-
provider,
127-
chainId: await provider.getChainId(),
128-
});
140+
const chainId = await provider.getChainId();
141+
const config = {
142+
starknetChainId: chainId,
143+
starknetProvider: provider,
144+
};
129145

130-
const { tokenAddress, calls: deployCalls } =
131-
factory.getDeployCalldata({
132-
name: response.name,
133-
symbol: response.symbol,
134-
owner: response.owner,
135-
initialSupply: response.initialSupply,
136-
});
137-
138-
const data = await factory.getMemecoinLaunchData(tokenAddress);
139-
140-
const { calls: launchCalls } = await factory.getEkuboLaunchCalldata(
146+
const { tokenAddress, transactionHash } = await createMemecoin(
147+
config,
141148
{
142-
address: tokenAddress,
143149
name: response.name,
144150
symbol: response.symbol,
145151
owner: response.owner,
146-
totalSupply: response.initialSupply,
147-
decimals: 18,
148-
...data,
149-
},
150-
{
151-
fees: parseFormatedPercentage("3"),
152-
amm: AMM.EKUBO,
153-
teamAllocations: [
154-
{
155-
address: ACCOUNTS.ELIZA,
156-
amount: new Percent(
157-
2.5,
158-
response.initialSupply
159-
).toFixed(0),
160-
},
161-
{
162-
address: ACCOUNTS.BLOBERT,
163-
amount: new Percent(
164-
2.5,
165-
response.initialSupply
166-
).toFixed(0),
167-
},
168-
],
169-
holdLimit: parseFormatedPercentage("2"),
170-
antiBotPeriod: 3600,
171-
quoteToken: {
172-
address: TOKENS.LORDS,
173-
symbol: "LORDS" as QUOTE_TOKEN_SYMBOL,
174-
name: "Lords",
175-
decimals: 18,
176-
camelCased: false,
177-
},
178-
startingMarketCap: parseFormatedAmount("5000"),
152+
initialSupply: response.initialSupply,
153+
starknetAccount: account,
179154
}
180155
);
181156

182157
elizaLogger.log(
183-
"Deployment has been initiated for coin: " +
158+
"Token deployment initiated for: " +
184159
response.name +
185160
" at address: " +
186161
tokenAddress
187162
);
188-
const tx = await account.execute([...deployCalls, ...launchCalls]);
163+
164+
await launchOnEkubo(config, {
165+
antiBotPeriodInSecs: 3600,
166+
currencyAddress: TOKENS.LORDS,
167+
fees: "3",
168+
holdLimit: "2",
169+
memecoinAddress: tokenAddress,
170+
starknetAccount: account,
171+
startingMarketCap: "5000",
172+
teamAllocations: [
173+
{
174+
address: ACCOUNTS.ELIZA,
175+
amount: new Percent(
176+
2.5,
177+
response.initialSupply
178+
).toFixed(0),
179+
},
180+
{
181+
address: ACCOUNTS.BLOBERT,
182+
amount: new Percent(
183+
2.5,
184+
response.initialSupply
185+
).toFixed(0),
186+
},
187+
],
188+
});
189189

190190
callback?.({
191191
text:
192192
"Token Deployment completed successfully!" +
193193
response.symbol +
194194
" deployed in tx: " +
195-
tx.transaction_hash,
195+
transactionHash,
196196
});
197197

198198
return true;

0 commit comments

Comments
 (0)