File tree Expand file tree Collapse file tree 6 files changed +66
-2
lines changed
e2e/artillery/src/processors
lit-client/src/lib/LitClient
networks/src/networks/vNaga/envs Expand file tree Collapse file tree 6 files changed +66
-2
lines changed Original file line number Diff line number Diff line change 11import { createAuthManager , storagePlugins } from "@lit-protocol/auth" ;
2- import { createLitClient } from "@lit-protocol/lit-client" ;
2+ import { createLitClient , LitClientType } from "@lit-protocol/lit-client" ;
33import { z } from "zod" ;
44import * as StateManager from "../StateManager" ;
55import * as NetworkManager from "../../../src/helper/NetworkManager" ;
@@ -16,7 +16,7 @@ const PkpSignResultSchema = z.object({
1616} ) ;
1717
1818// Global variables to cache expensive operations
19- let litClient : any = null ;
19+ let litClient : LitClientType ;
2020let authManager : any = null ;
2121let masterAccountAuthContext : any = null ;
2222let networkModule : any = null ;
@@ -113,6 +113,7 @@ export async function runPkpSignTest() {
113113 authContext : authContext ,
114114 pubKey : state . masterAccount . pkp . publicKey ,
115115 toSign : `Hello from Artillery! ${ Date . now ( ) } ` , // Unique message per request
116+ // userMaxPrice: await litClient
116117 } ) ;
117118
118119 // Validate the result using Zod schema
Original file line number Diff line number Diff line change @@ -715,6 +715,9 @@ export const _createNagaLitClient = async (
715715 handshakeResult : _stateManager . getCallbackResult ( ) ,
716716 getMaxPricesForNodeProduct : networkModule . getMaxPricesForNodeProduct ,
717717 getUserMaxPrice : networkModule . getUserMaxPrice ,
718+ getFreshPriceFeedInfo : async ( ) => {
719+ return await networkModule . getFreshPriceFeedInfo ( ) ;
720+ } ,
718721 signSessionKey : _signSessionKey ,
719722 signCustomSessionKey : _signCustomSessionKey ,
720723 executeJs : _executeJs ,
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ import {
8080} from './chain-manager/createChainManager' ;
8181import { getMaxPricesForNodeProduct } from './pricing-manager/getMaxPricesForNodeProduct' ;
8282import { getUserMaxPrice } from './pricing-manager/getUserMaxPrice' ;
83+ import { getPriceFeedInfo } from '../../LitChainClient/apis/highLevelApis/priceFeed/priceFeedApi' ;
84+ import { createReadOnlyContractsManager } from '../../LitChainClient/contract-manager/createContractsManager' ;
8385
8486const MODULE_NAME = 'naga-dev' ;
8587
@@ -323,6 +325,19 @@ const networkModuleObject = {
323325 } ) ;
324326 } ,
325327
328+ // Expose a fresh price feed fetcher (chain read; independent of state refresh)
329+ getFreshPriceFeedInfo : async ( ) => {
330+ const { walletClient } = createReadOnlyContractsManager ( networkConfig ) ;
331+ const realmId = Number ( networkConfig . networkSpecificConfigs ?. realmId ?? 1 ) ;
332+ return await getPriceFeedInfo (
333+ {
334+ realmId,
335+ networkCtx : networkConfig as any ,
336+ } ,
337+ walletClient
338+ ) ;
339+ } ,
340+
326341 getMaxPricesForNodeProduct : getMaxPricesForNodeProduct ,
327342 getUserMaxPrice : getUserMaxPrice ,
328343 getVerifyReleaseId : ( ) => verifyReleaseId ,
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ import {
8080} from './chain-manager/createChainManager' ;
8181import { getMaxPricesForNodeProduct } from './pricing-manager/getMaxPricesForNodeProduct' ;
8282import { getUserMaxPrice } from './pricing-manager/getUserMaxPrice' ;
83+ import { getPriceFeedInfo } from '../../LitChainClient/apis/highLevelApis/priceFeed/priceFeedApi' ;
84+ import { createReadOnlyContractsManager } from '../../LitChainClient/contract-manager/createContractsManager' ;
8385
8486const MODULE_NAME = 'naga-local' ;
8587
@@ -323,6 +325,19 @@ const networkModuleObject = {
323325 } ) ;
324326 } ,
325327
328+ // Expose a fresh price feed fetcher (chain read; independent of state refresh)
329+ getFreshPriceFeedInfo : async ( ) => {
330+ const { walletClient } = createReadOnlyContractsManager ( networkConfig ) ;
331+ const realmId = Number ( networkConfig . networkSpecificConfigs ?. realmId ?? 1 ) ;
332+ return await getPriceFeedInfo (
333+ {
334+ realmId,
335+ networkCtx : networkConfig as any ,
336+ } ,
337+ walletClient
338+ ) ;
339+ } ,
340+
326341 getMaxPricesForNodeProduct : getMaxPricesForNodeProduct ,
327342 getUserMaxPrice : getUserMaxPrice ,
328343 getVerifyReleaseId : ( ) => verifyReleaseId ,
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ import {
8080} from './chain-manager/createChainManager' ;
8181import { getMaxPricesForNodeProduct } from './pricing-manager/getMaxPricesForNodeProduct' ;
8282import { getUserMaxPrice } from './pricing-manager/getUserMaxPrice' ;
83+ import { getPriceFeedInfo } from '../../LitChainClient/apis/highLevelApis/priceFeed/priceFeedApi' ;
84+ import { createReadOnlyContractsManager } from '../../LitChainClient/contract-manager/createContractsManager' ;
8385
8486const MODULE_NAME = 'naga-staging' ;
8587
@@ -323,6 +325,19 @@ const networkModuleObject = {
323325 } ) ;
324326 } ,
325327
328+ // Expose a fresh price feed fetcher (chain read; independent of state refresh)
329+ getFreshPriceFeedInfo : async ( ) => {
330+ const { walletClient } = createReadOnlyContractsManager ( networkConfig ) ;
331+ const realmId = Number ( networkConfig . networkSpecificConfigs ?. realmId ?? 1 ) ;
332+ return await getPriceFeedInfo (
333+ {
334+ realmId,
335+ networkCtx : networkConfig as any ,
336+ } ,
337+ walletClient
338+ ) ;
339+ } ,
340+
326341 getMaxPricesForNodeProduct : getMaxPricesForNodeProduct ,
327342 getUserMaxPrice : getUserMaxPrice ,
328343 getVerifyReleaseId : ( ) => verifyReleaseId ,
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ import {
8080} from './chain-manager/createChainManager' ;
8181import { getMaxPricesForNodeProduct } from './pricing-manager/getMaxPricesForNodeProduct' ;
8282import { getUserMaxPrice } from './pricing-manager/getUserMaxPrice' ;
83+ import { getPriceFeedInfo } from '../../LitChainClient/apis/highLevelApis/priceFeed/priceFeedApi' ;
84+ import { createReadOnlyContractsManager } from '../../LitChainClient/contract-manager/createContractsManager' ;
8385
8486const MODULE_NAME = 'naga-test' ;
8587
@@ -323,6 +325,19 @@ const networkModuleObject = {
323325 } ) ;
324326 } ,
325327
328+ // Expose a fresh price feed fetcher (chain read; independent of state refresh)
329+ getFreshPriceFeedInfo : async ( ) => {
330+ const { walletClient } = createReadOnlyContractsManager ( networkConfig ) ;
331+ const realmId = Number ( networkConfig . networkSpecificConfigs ?. realmId ?? 1 ) ;
332+ return await getPriceFeedInfo (
333+ {
334+ realmId,
335+ networkCtx : networkConfig as any ,
336+ } ,
337+ walletClient
338+ ) ;
339+ } ,
340+
326341 getMaxPricesForNodeProduct : getMaxPricesForNodeProduct ,
327342 getUserMaxPrice : getUserMaxPrice ,
328343 getVerifyReleaseId : ( ) => verifyReleaseId ,
You can’t perform that action at this time.
0 commit comments