File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 11ENVIRONMENT = local
2+ PRIVATE_KEY = <private_key>
Original file line number Diff line number Diff line change @@ -6,16 +6,31 @@ import { schema } from '@aave/graphql/test-utils';
66import type { TypedDocumentNode } from '@urql/core' ;
77import { validate } from 'graphql' ;
88import type { ValidationRule } from 'graphql/validation/ValidationContext' ;
9+ import { createWalletClient , http , type WalletClient } from 'viem' ;
10+ import { privateKeyToAccount } from 'viem/accounts' ;
11+ import { sepolia } from 'viem/chains' ;
912import { expect } from 'vitest' ;
13+ import { AaveClient } from './client' ;
1014import { GraphQLErrorCode } from './errors' ;
1115
16+ export const signer = privateKeyToAccount ( import . meta. env . PRIVATE_KEY ) ;
1217export const environment =
1318 import . meta. env . ENVIRONMENT === 'local'
1419 ? local
1520 : import . meta. env . ENVIRONMENT === 'staging'
1621 ? staging
1722 : testnet ;
1823
24+ export const client = AaveClient . create ( {
25+ environment,
26+ } ) ;
27+
28+ export const wallet : WalletClient = createWalletClient ( {
29+ account : signer ,
30+ chain : sepolia ,
31+ transport : http ( ) ,
32+ } ) ;
33+
1934const messages : Record < GraphQLErrorCode , string > = {
2035 [ GraphQLErrorCode . UNAUTHENTICATED ] :
2136 "Unauthenticated - Authentication is required to access '<operation>'" ,
Original file line number Diff line number Diff line change 22
33interface ImportMetaEnv {
44 readonly ENVIRONMENT : 'testnet' | 'staging' | 'local' | undefined ;
5+ readonly PRIVATE_KEY : `0x${string } `;
56}
67
78interface ImportMeta {
You can’t perform that action at this time.
0 commit comments