-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from lacchain/feature/ethers-6
fix
- Loading branch information
Showing
13 changed files
with
291 additions
and
203 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
@@ -1,36 +1,72 @@ | ||
import { AbiCoder, AccessListish, AddressLike, BigNumberish, BlockTag, TransactionRequest } | ||
from 'ethers'; | ||
|
||
|
||
import { | ||
AbiCoder, | ||
AccessListish, | ||
AddressLike, | ||
BigNumberish, | ||
BlockTag, | ||
TransactionRequest, | ||
} from 'ethers'; | ||
|
||
export class LacchainTransactionRequest implements TransactionRequest { | ||
|
||
constructor( | ||
private _aOriginalTransactionRequest: TransactionRequest, | ||
private _aNodeAddress: string, | ||
private _aExpirationTime: number | ||
private _aExpirationTime: number, | ||
) {} | ||
|
||
get data(): any | string { | ||
return this._aOriginalTransactionRequest.data + AbiCoder.defaultAbiCoder().encode( | ||
["address", "uint256"], | ||
[this._aNodeAddress, this._aExpirationTime] | ||
).substring(2);; | ||
return ( | ||
this._aOriginalTransactionRequest.data + | ||
AbiCoder.defaultAbiCoder() | ||
.encode( | ||
['address', 'uint256'], | ||
[this._aNodeAddress, this._aExpirationTime], | ||
) | ||
.substring(2) | ||
); | ||
} | ||
|
||
get chainId(): any | BigNumberish { return 0; } | ||
get chainId(): any | BigNumberish { | ||
return 0; | ||
} | ||
|
||
get type(): any | number { return this._aOriginalTransactionRequest.type; } | ||
get to(): any | AddressLike { return this._aOriginalTransactionRequest.to; } | ||
get from(): any | AddressLike { return this._aOriginalTransactionRequest.from; } | ||
get nonce(): any | number { return this._aOriginalTransactionRequest.nonce; } | ||
get gasLimit(): any | BigNumberish { return this._aOriginalTransactionRequest.gasLimit; } | ||
get gasPrice(): any | BigNumberish { return this._aOriginalTransactionRequest.gasPrice; } | ||
get maxPriorityFeePerGas(): any | BigNumberish { return this._aOriginalTransactionRequest.maxPriorityFeePerGas; } | ||
get maxFeePerGas(): any | BigNumberish { return this._aOriginalTransactionRequest.maxFeePerGas; } | ||
get value(): any | BigNumberish { return this._aOriginalTransactionRequest.value; } | ||
get accessList(): any | AccessListish { return this._aOriginalTransactionRequest.accessList; } | ||
get customData(): any { return this._aOriginalTransactionRequest.customData; } | ||
get blockTag(): undefined | BlockTag { return this._aOriginalTransactionRequest.blockTag; } | ||
get enableCcipRead(): undefined | boolean { return this._aOriginalTransactionRequest.enableCcipRead; } | ||
get type(): any | number { | ||
return this._aOriginalTransactionRequest.type; | ||
} | ||
get to(): any | AddressLike { | ||
return this._aOriginalTransactionRequest.to; | ||
} | ||
get from(): any | AddressLike { | ||
return this._aOriginalTransactionRequest.from; | ||
} | ||
get nonce(): any | number { | ||
return this._aOriginalTransactionRequest.nonce; | ||
} | ||
get gasLimit(): any | BigNumberish { | ||
return this._aOriginalTransactionRequest.gasLimit; | ||
} | ||
get gasPrice(): any | BigNumberish { | ||
return this._aOriginalTransactionRequest.gasPrice; | ||
} | ||
get maxPriorityFeePerGas(): any | BigNumberish { | ||
return this._aOriginalTransactionRequest.maxPriorityFeePerGas; | ||
} | ||
get maxFeePerGas(): any | BigNumberish { | ||
return this._aOriginalTransactionRequest.maxFeePerGas; | ||
} | ||
get value(): any | BigNumberish { | ||
return this._aOriginalTransactionRequest.value; | ||
} | ||
get accessList(): any | AccessListish { | ||
return this._aOriginalTransactionRequest.accessList; | ||
} | ||
get customData(): any { | ||
return this._aOriginalTransactionRequest.customData; | ||
} | ||
get blockTag(): undefined | BlockTag { | ||
return this._aOriginalTransactionRequest.blockTag; | ||
} | ||
get enableCcipRead(): undefined | boolean { | ||
return this._aOriginalTransactionRequest.enableCcipRead; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,31 +1,67 @@ | ||
import { AccessList, Signature, Transaction, TransactionLike } from 'ethers'; | ||
|
||
|
||
|
||
export class LacchainTransaction implements TransactionLike { | ||
|
||
constructor(private _aOriginalTx: Transaction, private _aHashTx: string) {} | ||
constructor( | ||
private _aOriginalTx: Transaction, | ||
private _aHashTx: string, | ||
) {} | ||
|
||
get hash(): null | string { | ||
return this._aHashTx; | ||
} | ||
|
||
get type(): null | number { return this._aOriginalTx.type; } | ||
get typeName(): null | string { return this._aOriginalTx.typeName; } | ||
get to(): null | string { return this._aOriginalTx.to; } | ||
get nonce(): number { return this._aOriginalTx.nonce; } | ||
get gasLimit(): bigint { return this._aOriginalTx.gasLimit; } | ||
get gasPrice(): null | bigint { return this._aOriginalTx.gasPrice; } | ||
get maxPriorityFeePerGas(): null | bigint { return this._aOriginalTx.maxPriorityFeePerGas; } | ||
get maxFeePerGas(): null | bigint { return this._aOriginalTx.maxFeePerGas; } | ||
get data(): string { return this._aOriginalTx.data; } | ||
get value(): bigint { return this._aOriginalTx.value; } | ||
get chainId(): bigint { return this._aOriginalTx.chainId; } | ||
get signature(): null | Signature { return this._aOriginalTx.signature || null; } | ||
get accessList(): null | AccessList { return this._aOriginalTx.accessList } | ||
get unsignedHash(): string { return this._aOriginalTx.unsignedHash; } | ||
get from(): null | string { return this._aOriginalTx.from; } | ||
get fromPublicKey(): null | string { return this._aOriginalTx.fromPublicKey; } | ||
get serialized(): string { return this._aOriginalTx.serialized; } | ||
get unsignedSerialized(): string { return this._aOriginalTx.unsignedSerialized; } | ||
get type(): null | number { | ||
return this._aOriginalTx.type; | ||
} | ||
get typeName(): null | string { | ||
return this._aOriginalTx.typeName; | ||
} | ||
get to(): null | string { | ||
return this._aOriginalTx.to; | ||
} | ||
get nonce(): number { | ||
return this._aOriginalTx.nonce; | ||
} | ||
get gasLimit(): bigint { | ||
return this._aOriginalTx.gasLimit; | ||
} | ||
get gasPrice(): null | bigint { | ||
return this._aOriginalTx.gasPrice; | ||
} | ||
get maxPriorityFeePerGas(): null | bigint { | ||
return this._aOriginalTx.maxPriorityFeePerGas; | ||
} | ||
get maxFeePerGas(): null | bigint { | ||
return this._aOriginalTx.maxFeePerGas; | ||
} | ||
get data(): string { | ||
return this._aOriginalTx.data; | ||
} | ||
get value(): bigint { | ||
return this._aOriginalTx.value; | ||
} | ||
get chainId(): bigint { | ||
return this._aOriginalTx.chainId; | ||
} | ||
get signature(): null | Signature { | ||
return this._aOriginalTx.signature || null; | ||
} | ||
get accessList(): null | AccessList { | ||
return this._aOriginalTx.accessList; | ||
} | ||
get unsignedHash(): string { | ||
return this._aOriginalTx.unsignedHash; | ||
} | ||
get from(): null | string { | ||
return this._aOriginalTx.from; | ||
} | ||
get fromPublicKey(): null | string { | ||
return this._aOriginalTx.fromPublicKey; | ||
} | ||
get serialized(): string { | ||
return this._aOriginalTx.serialized; | ||
} | ||
get unsignedSerialized(): string { | ||
return this._aOriginalTx.unsignedSerialized; | ||
} | ||
} |
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
Oops, something went wrong.