Skip to content

Commit

Permalink
[ECO-2246] Add QoL EmojicoinClient class to make testing and genera…
Browse files Browse the repository at this point in the history
…ting data easier (#299)
  • Loading branch information
xbtmatt authored Oct 17, 2024
1 parent 79dc3eb commit 7ad06e9
Show file tree
Hide file tree
Showing 24 changed files with 1,126 additions and 150 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { emojisToName } from "lib/utils/emojis-to-name-or-symbol";
import { useEventStore } from "context/event-store-context";
import { getPeriodStartTimeFromTime } from "@sdk/utils";
import { getAptosConfig } from "lib/utils/aptos-client";
import { getEmojisInString, symbolToEmojis, toMarketEmojiData } from "@sdk/emoji_data";
import { getSymbolEmojisInString, symbolToEmojis, toMarketEmojiData } from "@sdk/emoji_data";
import { type MarketMetadataModel } from "@sdk/indexer-v2/types";
import { getMarketResource } from "@sdk/markets";
import { Aptos } from "@aptos-labs/ts-sdk";
Expand Down Expand Up @@ -270,7 +270,7 @@ export const Chart = async (props: ChartContainerProps) => {
throw new Error(`No ticker for symbol: ${symbolInfo}`);
}
const period = ResolutionStringToPeriod[resolution.toString()];
const marketEmojis = getEmojisInString(symbolInfo.ticker);
const marketEmojis = getSymbolEmojisInString(symbolInfo.ticker);
subscribeToPeriod({
marketEmojis,
period,
Expand All @@ -282,7 +282,7 @@ export const Chart = async (props: ChartContainerProps) => {
// For example: `🚀_#_5` for the `🚀` market for a resolution of period `5`.
const [symbol, resolution] = subscriberUID.split("_#_");
const period = ResolutionStringToPeriod[resolution];
const marketEmojis = getEmojisInString(symbol);
const marketEmojis = getSymbolEmojisInString(symbol);
unsubscribeFromPeriod({
marketEmojis,
period,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ChatBox = (props: ChatProps) => {
user: account.address,
marketAddress,
emojiBytes,
emojiIndicesSequence: new Uint8Array(emojiIndicesSequence),
emojiIndicesSequence,
typeTags: [emojicoin, emojicoinLP],
});
const res = await submit(builderLambda);
Expand Down
1 change: 1 addition & 0 deletions src/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"build": "pnpm i && pnpm load-env -- turbo run build",
"build:debug": "pnpm i && pnpm load-env -- turbo run build:debug",
"check": "turbo run check",
"clean": "turbo run clean --no-cache --force && rm -rf .turbo && rm -rf sdk/.turbo && rm -rf frontend/.turbo && rm -rf frontend/.next",
"dev": "pnpm load-env -- turbo run dev --force --parallel --continue",
"dev:debug": "pnpm dotenv -v FETCH_DEBUG=true -- pnpm run dev",
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"_format": "prettier 'src/**/*.ts' 'tests/**/*.ts' '.eslintrc.js'",
"build": "tsc",
"build:debug": "BUILD_DEBUG=true pnpm run build",
"check": "tsc --noEmit",
"check": "tsc -p tests/tsconfig.json --noEmit",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"e2e:testnet": "pnpm load-test-env -v NO_TEST_SETUP=true -- pnpm jest tests/e2e/queries/testnet",
"format": "pnpm _format --write",
Expand Down
Loading

0 comments on commit 7ad06e9

Please sign in to comment.