Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions packages/lit-client/src/lib/LitClient/createLitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ import {
} from '@lit-protocol/access-control-conditions';
import { encrypt as blsEncrypt } from '@lit-protocol/crypto';
import { getChildLogger } from '@lit-protocol/logger';
import type {
LitNetworkModule,
PKPStorageProvider,
import {
type LitNetworkModule,
type PKPStorageProvider,
type ExpectedAccountOrWalletClient,
type GenericTxRes,
type LitTxRes,
type PKPData,
type AuthMethod,
PKPPermissionsManager,
PaymentManager,
} from '@lit-protocol/networks';
import {
AuthContextSchema2,
Expand Down Expand Up @@ -735,8 +742,14 @@ export const _createNagaLitClient = async (
loginUrl: networkModule.getDefaultLoginBaseUrl(),
},
disconnect: _stateManager.stop,
mintWithEoa: networkModule.chainApi.mintWithEoa,
mintWithAuth: networkModule.chainApi.mintWithAuth,
mintWithEoa: networkModule.chainApi.mintWithEoa as (params: {
account: ExpectedAccountOrWalletClient;
}) => Promise<GenericTxRes<LitTxRes<PKPData>, PKPData>>,
mintWithAuth: networkModule.chainApi.mintWithAuth as (params: {
account: ExpectedAccountOrWalletClient;
authData: any;
scopes: string[];
}) => Promise<GenericTxRes<LitTxRes<PKPData>, PKPData>>,
mintWithCustomAuth: async (params: MintWithCustomAuthRequest) => {
const validatedParams = MintWithCustomAuthSchema.parse(params);

Expand Down Expand Up @@ -801,11 +814,15 @@ export const _createNagaLitClient = async (
pkpData: pkp,
};
},
getPKPPermissionsManager: networkModule.chainApi.getPKPPermissionsManager,
getPKPPermissionsManager: networkModule.chainApi
.getPKPPermissionsManager as (params: {
pkpIdentifier: PkpIdentifierRaw;
account: ExpectedAccountOrWalletClient;
}) => Promise<PKPPermissionsManager>,
getPaymentManager: async (params: { account: any }) => {
return await networkModule.chainApi.getPaymentManager({
return (await networkModule.chainApi.getPaymentManager({
account: params.account,
});
})) as PaymentManager;
},
viewPKPPermissions: async (pkpIdentifier: PkpIdentifierRaw) => {
// It's an Anvil private key, chill. 🤣
Expand Down
15 changes: 15 additions & 0 deletions packages/networks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ export type { PKPStorageProvider } from './storage/types';

// Schema types
export type { MintRequestRaw } from './networks/vNaga/shared/managers/LitChainClient/schemas/MintRequestSchema';

// ----- re-exports for SDK consumers
export type { ExpectedAccountOrWalletClient } from './networks/vNaga/shared/managers/contract-manager/createContractsManager';
export { PKPPermissionsManager } from './networks/vNaga/shared/managers/LitChainClient/apis/highLevelApis/PKPPermissionsManager';
export { PaymentManager } from './networks/vNaga/shared/managers/LitChainClient/apis/highLevelApis/PaymentManager/PaymentManager';
export type {
GenericTxRes,
LitTxRes,
} from './networks/vNaga/shared/managers/LitChainClient/apis/types';
export type { PKPData } from './networks/vNaga/shared/managers/LitChainClient/schemas/shared/PKPDataSchema';
export type { AuthMethod } from './networks/vNaga/shared/managers/LitChainClient/apis/highLevelApis/PKPPermissionsManager/handlers/getPermissionsContext';
export type { PkpIdentifierRaw } from './networks/vNaga/shared/managers/LitChainClient/apis/rawContractApis/permissions/utils/resolvePkpTokenId';
export { getMaxPricesForNodeProduct } from './networks/vNaga/shared/managers/pricing-manager/getMaxPricesForNodeProduct';
export { getUserMaxPrice } from './networks/vNaga/shared/managers/pricing-manager/getUserMaxPrice';
export { PRODUCT_IDS } from './networks/vNaga/shared/managers/pricing-manager/constants';
Loading