diff --git a/flake.lock b/flake.lock index 3c3e071d..c88d867b 100644 --- a/flake.lock +++ b/flake.lock @@ -36,11 +36,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1688380630, - "narHash": "sha256-8ilApWVb1mAi4439zS3iFeIT0ODlbrifm/fegWwgHjA=", + "lastModified": 1692523566, + "narHash": "sha256-VDJDihK6jNebVw9y3qKCVD6+6QaC/x8kxZzL4MaIPPY=", "owner": "numtide", "repo": "devshell", - "rev": "f9238ec3d75cefbb2b42a44948c4e8fb1ae9a205", + "rev": "d208c58e2f7afef838add5f18a9936b12a71d695", "type": "github" }, "original": { diff --git a/package.json b/package.json index 10be3192..50ff5ca9 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "workspaces": [ "packages/legacy-adapter", "packages/language/core/v1", - "packages/legacy-runtime" + "packages/legacy-runtime", + "packages/token-metadata-client" ], "devDependencies": { "@blockfrost/blockfrost-js": "5.2.0", diff --git a/packages/legacy-runtime/package.json b/packages/legacy-runtime/package.json index 3f2930ec..bf7931bc 100644 --- a/packages/legacy-runtime/package.json +++ b/packages/legacy-runtime/package.json @@ -15,7 +15,7 @@ "scripts": { "build": "tsc --build src", "clean": "tsc --build --clean src", - "test": "echo 'The legact runtime doesnt have unit tests'", + "test": "echo 'The legacy runtime doesnt have unit tests'", "test:e2e": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --config test/jest.e2e.config.mjs", "build:e2e": "tsc --build test" }, diff --git a/packages/token-metadata-client/Readme.md b/packages/token-metadata-client/Readme.md new file mode 100644 index 00000000..caa589da --- /dev/null +++ b/packages/token-metadata-client/Readme.md @@ -0,0 +1,2 @@ +# @marlow/token-metadata-client +TODO \ No newline at end of file diff --git a/packages/token-metadata-client/package.json b/packages/token-metadata-client/package.json new file mode 100644 index 00000000..d7cfeced --- /dev/null +++ b/packages/token-metadata-client/package.json @@ -0,0 +1,25 @@ +{ + "name": "@marlowe/token-metadata-client", + "version": "0.1.0-beta", + "description": "TODO", + "repository": "https://github.com/input-output-hk/marlowe-ts-sdk", + "publishConfig": { + "access": "public" + }, + "contributors": [ + "Nicolas Henin (https://iohk.io)", + "Hernan Rajchert (https://iohk.io)", + "Bjorn Kihlberg (https://iohk.io)" + ], + "license": "Apache-2.0", + "scripts": { + "build": "tsc --build src", + "clean": "tsc --build --clean src", + "test": "echo '@marlowe/token-metadata-client doesnt have unit tests'" + }, + "type": "module", + "exports": { + ".": "./dist/index.js" + }, + "dependencies": {} +} diff --git a/packages/token-metadata-client/src/index.ts b/packages/token-metadata-client/src/index.ts new file mode 100644 index 00000000..4272a05b --- /dev/null +++ b/packages/token-metadata-client/src/index.ts @@ -0,0 +1,15 @@ +export interface TokenMetadata { + precision: number; + symbol: string; + name: string; + network: "mainnet" | "preview" | "preprod"; +} + +export const lookupToken = ( + policyId: string, + tokenName: string +): TokenMetadata => { + if (policyId === "" && tokenName === "") + return { precision: 1e-6, symbol: "₳", name: "Ada", network: "mainnet" }; + throw new Error("not found"); +}; diff --git a/packages/token-metadata-client/src/tsconfig.json b/packages/token-metadata-client/src/tsconfig.json new file mode 100644 index 00000000..1e20b0a7 --- /dev/null +++ b/packages/token-metadata-client/src/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig-base.json", + "compilerOptions": { + "outDir": "../dist", + "paths": {} + }, + "references": [] +} diff --git a/packages/token-metadata-client/typedoc.json b/packages/token-metadata-client/typedoc.json new file mode 100644 index 00000000..103a6fb2 --- /dev/null +++ b/packages/token-metadata-client/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPointStrategy": "expand", + "entryPoints": ["./src"], + "tsconfig": "./src/tsconfig.json" +}