Skip to content

Commit

Permalink
types and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
wepsree committed Apr 2, 2022
1 parent 8465c39 commit 7a9f062
Show file tree
Hide file tree
Showing 22 changed files with 94 additions and 94 deletions.
10 changes: 5 additions & 5 deletions src/HTTP/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
10 changes: 5 additions & 5 deletions src/IPC/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
10 changes: 5 additions & 5 deletions src/WS/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
10 changes: 5 additions & 5 deletions src/abi/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
6 changes: 3 additions & 3 deletions src/accountBlock/accountBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ class AccountBlockClass {
return getNonceHex(this.nonce);
}

get isRequestBlock(): Boolean {
get isRequestBlock(): boolean {
return isRequestBlock(this.blockType);
}

get isResponseBlock(): Boolean {
get isResponseBlock(): boolean {
return isResponseBlock(this.blockType);
}

Expand Down Expand Up @@ -251,7 +251,7 @@ class AccountBlockClass {
requiredQuota: Uint64;
difficulty: BigInt;
qc: BigInt;
isCongestion: Boolean;
isCongestion: boolean;
} = await this.provider.request('ledger_getPoWDifficulty', {
address: this.address,
previousHash: this.previousHash,
Expand Down
12 changes: 6 additions & 6 deletions src/accountBlock/receiveAccountBlockTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ReceiveAccountBlockTask {
func: isValidAddress
}, {
name: 'privateKey',
func: function (str: string | undefined | null): Boolean {
func: function (str: string | undefined | null): boolean {
if (!sign && !privateKey) return false;
if (str === undefined || str === null) {
return true;
Expand Down Expand Up @@ -57,19 +57,19 @@ export class ReceiveAccountBlockTask {

start({
checkTime = 3000,
transctionNumber = 5
transactionNumber = 5
}: {
checkTime: number;
transctionNumber: number;
transactionNumber: number;
} = {
checkTime: 3000,
transctionNumber: 5
transactionNumber: 5
}) {
this.stop();

const toReceive = () => {
this._timer = setTimeout(async () => {
await this.reveive(transctionNumber);
await this.receive(transactionNumber);
if (!this._timer) {
return;
}
Expand All @@ -92,7 +92,7 @@ export class ReceiveAccountBlockTask {
this.successCB = successCB;
}

private async reveive(pageSize: number) {
private async receive(pageSize: number) {
let unreceivedBlocks = null;
try {
unreceivedBlocks = await this.getUnreceivedBlocks(pageSize);
Expand Down
10 changes: 5 additions & 5 deletions src/accountBlock/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
4 changes: 2 additions & 2 deletions src/accountBlock/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ export function isValidAccountBlock(accountBlock) {
return !err;
}

export function isRequestBlock(blockType: BlockType): Boolean {
export function isRequestBlock(blockType: BlockType): boolean {
return blockType === BlockType.CreateContractRequest
|| blockType === BlockType.TransferRequest
|| blockType === BlockType.RefundByContractRequest
|| blockType === BlockType.ReIssueRequest;
}

export function isResponseBlock(blockType: BlockType): Boolean {
export function isResponseBlock(blockType: BlockType): boolean {
return blockType === BlockType.Response
|| blockType === BlockType.ResponseFail
|| blockType === BlockType.GenesisResponse;
Expand Down
10 changes: 5 additions & 5 deletions src/communication/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
10 changes: 5 additions & 5 deletions src/constant/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
10 changes: 5 additions & 5 deletions src/error/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
10 changes: 5 additions & 5 deletions src/keystore/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export declare type TokenInfo = {
decimals: Uint8;
owner: Address;
tokenId: TokenId;
isReIssuable: Boolean;
isReIssuable: boolean;
maxSupply: BigInt;
isOwnerBurnOnly: Boolean;
isOwnerBurnOnly: boolean;
index: Uint16;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ export declare interface RPCError {
}

export declare class ProviderType {
isConnected: Boolean;
isConnected: boolean;

constructor(provider: any, onInitCallback: Function)

Expand Down Expand Up @@ -334,8 +334,8 @@ export declare class AccountBlockClassType {
nonceHex: Hex;
hash: Hex;

isRequestBlock: Boolean;
isResponseBlock: Boolean;
isRequestBlock: boolean;
isResponseBlock: boolean;

accountBlock: AccountBlockBlock;

Expand Down
Loading

0 comments on commit 7a9f062

Please sign in to comment.