Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLT-7208: Token Metadata client #19

Merged
merged 3 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/token-metadata-client/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# @marlow/token-metadata-client
TODO
25 changes: 25 additions & 0 deletions packages/token-metadata-client/package.json
Original file line number Diff line number Diff line change
@@ -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 <nicolas.henin@iohk.io> (https://iohk.io)",
"Hernan Rajchert <hernan.rajchert@iohk.io> (https://iohk.io)",
"Bjorn Kihlberg <bjorn.kihlberg@iohk.io> (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": {}
}
15 changes: 15 additions & 0 deletions packages/token-metadata-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -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");
};
8 changes: 8 additions & 0 deletions packages/token-metadata-client/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../../tsconfig-base.json",
"compilerOptions": {
"outDir": "../dist",
"paths": {}
},
"references": []
}
5 changes: 5 additions & 0 deletions packages/token-metadata-client/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entryPointStrategy": "expand",
"entryPoints": ["./src"],
"tsconfig": "./src/tsconfig.json"
}