Skip to content

Commit

Permalink
fix: Less restrictive types for isAddressValid
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-rib committed Dec 25, 2020
1 parent f0c2153 commit a78618b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/modules/validate-address/isAddressValid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const isAddressValid = ({
address,
chain,
}: {
context: SkybridgeContext;
context: Pick<SkybridgeContext, 'mode'>;
address: string;
/**
* If passed, this function will verify whether the address is valid for this partifular chain.
Expand Down
2 changes: 1 addition & 1 deletion src/modules/validate-address/isBinanceAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const isBinanceAddress = ({
context,
address,
}: {
context: SkybridgeContext;
context: Pick<SkybridgeContext, 'mode'>;
address: string;
}): boolean => {
const prefix = context.mode === 'production' ? 'bnb' : 'tbnb';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/validate-address/isBitcoinAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const isBitcoinAddress = ({
context,
address,
}: {
context: SkybridgeContext;
context: Pick<SkybridgeContext, 'mode'>;
address: string;
}): boolean => {
const result = validate(address);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/validate-address/isEthereumAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { SkybridgeContext } from '../context';
export const isEthereumAddress = ({
address,
}: {
context: SkybridgeContext;
context: Pick<SkybridgeContext, 'mode'>;
address: string;
}): boolean => {
return /^0x[a-fA-F0-9]{40}$/.test(address);
Expand Down

0 comments on commit a78618b

Please sign in to comment.