Skip to content

Commit

Permalink
Merge branch 'main' into chore/refactor-get-current-network-api
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 authored Oct 22, 2024
2 parents 7981ee1 + c9c1aaf commit eb1df0e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 34 deletions.
1 change: 0 additions & 1 deletion packages/wallet-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"terser": "^5.14.2"
},
"dependencies": {
"@consensys/starknet-snap": "file:../starknet-snap",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
Expand Down
51 changes: 36 additions & 15 deletions packages/wallet-ui/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
import * as Types from '@consensys/starknet-snap/src/types/snapState';
import { BigNumber } from 'ethers';

export type Account = Pick<
Types.AccContract,
'address' | 'publicKey' | 'upgradeRequired' | 'deployRequired'
>;
export type Network = Pick<
Types.Network,
'name' | 'chainId' | 'baseUrl' | 'nodeUrl'
>;
export type Transaction = {
txnHash: string; // in hex
txnType: string;
chainId: string; // in hex
senderAddress: string; // in hex
contractAddress: string; // in hex
contractFuncName: string;
contractCallData: string[] | number[];
status?: TransactionStatus | string;
executionStatus?: TransactionStatus | string;
finalityStatus?: TransactionStatus | string;
failureReason: string;
eventIds: string[];
timestamp: number;
};

export interface Erc20TokenBalance extends Types.Erc20Token {
export type Account = {
address: string;
publicKey: string;
upgradeRequired: boolean;
deployRequired: boolean;
};

export type Network = {
name: string;
chainId: string;
};

export interface Erc20Token {
address: string;
name: string;
symbol: string;
decimals: number;
chainId: string;
}

export interface Erc20TokenBalance extends Erc20Token {
amount: BigNumber;
usdPrice?: number;
}
Expand Down Expand Up @@ -42,11 +68,6 @@ export enum BalanceType {
Total = 'total',
}

export type {
Erc20Token,
Transaction,
} from '@consensys/starknet-snap/src/types/snapState';

// Define the type for your token balances
export interface TokenBalance {
balance: BigNumber;
Expand Down
18 changes: 0 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2214,23 +2214,6 @@ __metadata:
languageName: unknown
linkType: soft

"@consensys/starknet-snap@file:../starknet-snap::locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui":
version: 2.9.0
resolution: "@consensys/starknet-snap@file:../starknet-snap#../starknet-snap::hash=e2922a&locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui"
dependencies:
"@metamask/key-tree": 9.0.0
"@metamask/snaps-sdk": ^4.0.0
async-mutex: ^0.3.2
ethereum-unit-converter: ^0.0.17
ethers: ^5.5.1
starknet: 6.11.0
starknet_v4.22.0: "npm:[email protected]"
superstruct: ^2.0.2
uuid: ^10.0.0
checksum: 67b923b31e050b59a219a0484548aaf5e8ff5453215ed5e32cc2d62209f49aad0c9eb087fd750e2cfd14d0f40d20181976da16940bd8982f650829ff0db8b3df
languageName: node
linkType: hard

"@consensys/starknet-snap@workspace:packages/starknet-snap":
version: 0.0.0-use.local
resolution: "@consensys/starknet-snap@workspace:packages/starknet-snap"
Expand Down Expand Up @@ -27472,7 +27455,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "wallet-ui@workspace:packages/wallet-ui"
dependencies:
"@consensys/starknet-snap": "file:../starknet-snap"
"@craco/craco": ^7.1.0
"@emotion/react": ^11.9.0
"@emotion/styled": ^11.8.1
Expand Down

0 comments on commit eb1df0e

Please sign in to comment.