Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/eleven-pumpkins-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@minima-global/mds": patch
---

fixed state type for coins
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
.turbo
*.log
dist
build
dist-ssr
*.local
.cache
Expand Down
12 changes: 11 additions & 1 deletion packages/mds/src/commands/general/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,24 @@ export type Coin = {
tokenid: string;
token: Token | null;
storestate: boolean;
state: string[];
state: StateArray[] | StateObject;
spent: boolean;
mmrentry: string;
created: string;
age: string;
tokenamount: string;
};

export type StateArray = {
port: number;
type: number;
data: string;
};

export type StateObject = {
[key: `${number}`]: string;
};

export type SimpleCoinResponse = MDSResponse<string>;

export type TokenCreate = {
Expand Down
57 changes: 0 additions & 57 deletions tests/test-app-new/build/assets/index-DUKqEKPp.js

This file was deleted.

1 change: 0 additions & 1 deletion tests/test-app-new/build/assets/index-DuEtamvV.css

This file was deleted.

29 changes: 0 additions & 29 deletions tests/test-app-new/build/assets/index-legacy-DSmT3KKk.js

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion tests/test-app-new/build/dapp.conf

This file was deleted.

Binary file removed tests/test-app-new/build/icon.png
Binary file not shown.
19 changes: 0 additions & 19 deletions tests/test-app-new/build/index.html

This file was deleted.

15 changes: 13 additions & 2 deletions tests/test-app-new/src/AppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,19 @@ const AppProvider: React.FC<React.PropsWithChildren> = ({ children }) => {
const command = await MDS.cmd.block()
setBlock(command.response)

const get = await MDS.keypair.set("test", "test")
console.log(get)
const coins = await MDS.cmd.coins()

coins.response.forEach((coin) => {
if (coin.state) {
if (Array.isArray(coin.state)) {
coin.state.forEach((state) => {
console.log(state.data)
})
} else {
console.log(coin.state["0"])
}
}
})
}
})
}
Expand Down