Skip to content

Commit

Permalink
Add type definition for ethereum-checksum-address (DefinitelyTyped#60044
Browse files Browse the repository at this point in the history
)

* Add files via upload

* Add newline at the end of the files

* Fix lint errors

* Delete ethereum-checksum-address directory

* Fix lint errors

* Add files via upload

* Fix lint errors

* Delete ethereum-checksum-address-tests.ts

* Delete index.d.ts

* Delete tsconfig.json

* Delete tslint.json
  • Loading branch information
wukongproject authored Apr 26, 2022
1 parent 230f354 commit 437feda
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions types/ethereum-checksum-address/ethereum-checksum-address-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {
toChecksumAddress,
checkAddressChecksum
} from "ethereum-checksum-address";

toChecksumAddress('0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1'); // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
toChecksumAddress('0x90F8BF6A479F320EAD074411A4B0E7944EA8C9C1'); // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'

checkAddressChecksum('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'); // true
checkAddressChecksum('0x90F8BF6A479F320EAD074411A4B0E7944EA8C9C1'); // false
7 changes: 7 additions & 0 deletions types/ethereum-checksum-address/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Type definitions for ethereum-checksum-address 0.0
// Project: https://github.com/miguelmota/ethereum-checksum-address
// Definitions by: Wukong Project <https://github.com/wukongproject>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export function toChecksumAddress(address: string, chainId?: number | string): string;
export function checkAddressChecksum(address: string, chainId?: number | string): boolean;
23 changes: 23 additions & 0 deletions types/ethereum-checksum-address/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"ethereum-checksum-address-tests.ts"
]
}
1 change: 1 addition & 0 deletions types/ethereum-checksum-address/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "@definitelytyped/dtslint/dt.json" }

0 comments on commit 437feda

Please sign in to comment.