forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add type definition for ethereum-checksum-address (DefinitelyTyped#60044
) * 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
1 parent
230f354
commit 437feda
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
types/ethereum-checksum-address/ethereum-checksum-address-tests.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "@definitelytyped/dtslint/dt.json" } |