-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add getTransactions endpoint and remove projectKey, graphqlEndpoint p…
…arameters (#109)
- Loading branch information
1 parent
658f675
commit b51581c
Showing
37 changed files
with
189 additions
and
90 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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { DataUtils } from '../src'; | ||
import * as dotenv from 'dotenv'; | ||
dotenv.config(); | ||
|
||
const dataApiKey = 'eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjI4ZWJiMGQ5YTMxYjQ3MmY4NmU4MWY2YTVhYzBhMzE1IiwiaCI6Im11cm11cjEyOCJ9'; | ||
|
||
async function main(): Promise<void> { | ||
// initializating Data service... | ||
const dataService = new DataUtils(dataApiKey); | ||
const account = '0xe05fb316eb8c4ba7288d43c1bd87be8a8d16761c'; | ||
const transactions = await dataService.getTransactions({ | ||
account, | ||
chainId: 122, | ||
}); | ||
|
||
console.log('\x1b[33m%s\x1b[0m', `EtherspotWallet transactions:`, transactions); | ||
} | ||
|
||
main() | ||
.catch(console.error) | ||
.finally(() => process.exit()); |
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { BigNumber } from 'ethers'; | ||
import { TransactionStatuses } from '../constants'; | ||
|
||
export class Transactions { | ||
transactions: UserOpsTransaction[]; | ||
pageInfo?: { | ||
currentPage: number; | ||
limit: number; | ||
}; | ||
} | ||
|
||
class UserOpsTransaction { | ||
chainId: number; | ||
sender: string; | ||
target?: string | null; | ||
transactionHash: string; | ||
userOpHash: string; | ||
actualGasCost: number; | ||
actualGasUsed: number; | ||
success: TransactionStatuses; | ||
timestamp: number; | ||
paymaster: string; | ||
value: number; | ||
blockExplorerUrl: string; | ||
input: string; | ||
nonce: number; | ||
initCode?: string; | ||
callData?: string; | ||
accountGasLimits?: string; | ||
gasFees?: string; | ||
callGasLimit: BigNumber; | ||
verificationGasLimit: BigNumber; | ||
preVerificationGas: BigNumber; | ||
maxFeePerGas: BigNumber; | ||
maxPriorityFeePerGas: BigNumber; | ||
paymasterAndData?: string; | ||
signature?: string; | ||
beneficiary?: string; | ||
nativeTransfers?: NativeTransfersEntity[]; | ||
erc20Transfers?: Erc20TransfersEntity[]; | ||
nftTransfers?: NFTTransfersEntity[]; | ||
} | ||
|
||
class Erc20TransfersEntity { | ||
from: string; | ||
to: string; | ||
value: number; | ||
asset?: string; | ||
address: string; | ||
decimal: number; | ||
} | ||
|
||
class NativeTransfersEntity { | ||
from: string; | ||
to: string; | ||
value: string; | ||
asset?: string; | ||
address: string; | ||
decimal: number; | ||
data: string; | ||
} | ||
|
||
class NFTTransfersEntity { | ||
from: string; | ||
to: string; | ||
value: number; | ||
tokenId: number; | ||
asset?: string; | ||
category: string; | ||
address: string; | ||
} |
Oops, something went wrong.