Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lens-network/sdk

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lens-network/sdk - npm Package Compare versions

Comparing version 0.0.0-canary-20240627114739 to 0.0.0-canary-20240627133053

9

dist/ethers/index.d.ts

@@ -7,2 +7,3 @@ import { ethers, JsonRpcPayload, JsonRpcResult, JsonRpcError } from 'ethers';

erc20Factory: `0x${string}`;
erc721Factory: `0x${string}`;
};

@@ -218,3 +219,3 @@

sendRawTransactionWithDetailedOutput(serializedTransaction: string): Promise<SendRawTransactionDetails>;
"__#7921@#private": any;
"__#8012@#private": any;
_getOption<K extends keyof ethers.JsonRpcApiProviderOptions>(key: K): ethers.JsonRpcApiProviderOptions[K];

@@ -239,3 +240,3 @@ readonly _network: ethers.Network;

destroy(): void;
"__#7918@#private": any;
"__#8009@#private": any;
readonly pollingInterval: number;

@@ -507,3 +508,3 @@ readonly provider: any;

sendRawTransactionWithDetailedOutput(serializedTransaction: string): Promise<SendRawTransactionDetails>;
"__#7921@#private": any;
"__#8012@#private": any;
_getOption<K extends keyof ethers.JsonRpcApiProviderOptions>(key: K): ethers.JsonRpcApiProviderOptions[K];

@@ -528,3 +529,3 @@ readonly _network: ethers.Network;

destroy(): void;
"__#7918@#private": any;
"__#8009@#private": any;
readonly pollingInterval: number;

@@ -531,0 +532,0 @@ readonly provider: any;

@@ -5,6 +5,6 @@ import { Network, Interface, Contract, NetworkPlugin, assert, EventLog } from 'ethers';

var A=Object.defineProperty;var R=(n,e)=>{for(var t in e)A(n,t,{get:e[t],enumerable:!0});};var s={id:37111,name:"Lens Development Network",network:"lens-development-network",rpcUrl:"https://rpc.staging.lens-network.crtlkey.com/",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0x40bef8fc597752305170829a81097612e00Dc3A8"}},P={id:37111,name:"Lens Local Network",network:"lens-local-network",rpcUrl:"http://localhost:4096",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0x40bef8fc597752305170829a81097612e00Dc3A8"}};var a=class n extends NetworkPlugin{contracts;constructor(e){super(n.name),this.contracts=e;}clone(){return new n(this.contracts)}static name="xyz.lens.network.contracts"};function C(n){assert(n?.name===a.name,`Network plugin ${a.name} not found`,"UNKNOWN_ERROR");}function F(n){return ()=>{let e=new Network(n.name,n.id);return e.attachPlugin(new a(n.contracts)),e}}[s].forEach(n=>Network.register(n.id,F(n)));function v(n){return class extends n{getTokenBalance(t,r){return this.send("lens_getTokenBalance",[{address:t,contractAddress:r}])}getContractABI(t){return this.send("lens_getContractABI",[t])}getTokenTxHistory(t){return this.send("lens_getTokenTxHistory",[t])}getNftTxHistory(t){return this.send("lens_getNftTxHistory",[t])}getTokenInfo(t){return this.send("lens_getTokenInfo",[t])}async getContractCreation(t){return await this.send("lens_getContractCreation",t)??[]}async getTxHistory(t){return this.send("lens_getTxHistory",[t])}async getBlockNumberByTime(t,r){return this.send("lens_getBlockNumberByTime",[t,r])}async sendRawTransactionWithDetailedOutput(t){return this.send("zks_sendRawTransactionWithDetailedOutput",[t])}static getDefaultProvider(t){throw new Error("Use 'getDefaultProvider' from '@lens-network/sdk/ethers' instead")}}}var o=class extends v(c.Provider){getTokenBalance(e,t){return super.getTokenBalance(e,t)}getContractABI(e){return super.getContractABI(e)}getTokenTxHistory(e){return super.getTokenTxHistory(e)}getNftTxHistory(e){return super.getNftTxHistory(e)}getTokenInfo(e){return super.getTokenInfo(e)}getContractCreation(e){return super.getContractCreation(e)}getTxHistory(e){return super.getTxHistory(e)}getBlockNumberByTime(e,t){return super.getBlockNumberByTime(e,t)}sendRawTransactionWithDetailedOutput(e){return super.sendRawTransactionWithDetailedOutput(e)}},d=class extends v(c.BrowserProvider){getTokenBalance(e,t){return super.getTokenBalance(e,t)}getContractABI(e){return super.getContractABI(e)}getTokenTxHistory(e){return super.getTokenTxHistory(e)}getNftTxHistory(e){return super.getNftTxHistory(e)}getTokenInfo(e){return super.getTokenInfo(e)}getContractCreation(e){return super.getContractCreation(e)}getTxHistory(e){return super.getTxHistory(e)}getBlockNumberByTime(e,t){return super.getBlockNumberByTime(e,t)}sendRawTransactionWithDetailedOutput(e){return super.sendRawTransactionWithDetailedOutput(e)}};var m=(r=>(r[r.Mainnet=NaN]="Mainnet",r[r.Testnet=NaN]="Testnet",r[r.Staging=s.id]="Staging",r))(m||{});var g=class extends Error{name="InvariantError"};function E(n,e){throw new g(e)}function U(n){switch(n){case m.Staging:return new o(s.rpcUrl);case NaN:case NaN:E(!1,"Network supported yet");}}var N={};R(N,{localhost:()=>W,staging:()=>z});var B={name:"Ether",symbol:"ETH",decimals:18};function H(n){return {chainId:toBeHex(n.id),chainName:n.name,nativeCurrency:B,rpcUrls:[n.rpcUrl],blockExplorerUrls:[n.blockExplorerUrl]}}var z=H(s),W=H(P);var p={};R(p,{BasicErc20Factory__factory:()=>l,BasicErc20__factory:()=>u});var T=[{inputs:[{components:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],internalType:"struct BasicErc20.TokenParams",name:"details",type:"tuple"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"revision",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],u=class{static abi=T;static createInterface(){return new Interface(T)}static connect(e,t){return new Contract(e,T,t)}};var f=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"tokenAddress",type:"address"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!1,internalType:"string",name:"symbol",type:"string"},{indexed:!1,internalType:"uint256",name:"initialSupply",type:"uint256"}],name:"TokenCreated",type:"event"},{inputs:[{components:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],internalType:"struct BasicErc20.TokenParams",name:"params",type:"tuple"}],name:"createToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getTokens",outputs:[{internalType:"contract BasicErc20[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"initialOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"revision",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokens",outputs:[{internalType:"contract BasicErc20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],l=class{static abi=f;static createInterface(){return new Interface(f)}static connect(e,t){return new Contract(e,f,t)}};function O(n){return class extends n{async createErc20(t){let{chainId:r}=await this._providerL2().getNetwork(),i=Network.from(r)?.getPlugin(a.name);C(i);let k=await(await p.BasicErc20Factory__factory.connect(i.contracts.erc20Factory,this._signerL2()).createToken(t)).wait();assert(k!==null,"Transaction failed","NETWORK_ERROR");let w=k.logs.find(S=>S.address===i.contracts.erc20Factory);assert(w instanceof EventLog,"Event log not found","NETWORK_ERROR");let b=p.BasicErc20Factory__factory.createInterface().parseLog(w);return assert(b?.name==="TokenCreated","Token not created","NETWORK_ERROR"),b.args.tokenAddress}}}var I=class extends O(c.Wallet){createErc20(e){return super.createErc20(e)}connect(e){return super.connect(e)}},D=class n extends O(c.Signer){createErc20(e){return super.createErc20(e)}static from(e,t,r){let i=super.from(e,t,r);return Object.setPrototypeOf(i,n.prototype)}};
var S=Object.defineProperty;var R=(n,e)=>{for(var t in e)S(n,t,{get:e[t],enumerable:!0});};var s={id:37111,name:"Lens Development Network",network:"lens-development-network",rpcUrl:"https://rpc.staging.lens-network.crtlkey.com/",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0xCAb3353b6055d6FDE858f8b862B90c9f81f63Ec3",erc721Factory:"0xCfBDe041302aA0Fdee0dbAd4E22cc937fdC184ED"}},P={id:37111,name:"Lens Local Network",network:"lens-local-network",rpcUrl:"http://localhost:4096",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0xCAb3353b6055d6FDE858f8b862B90c9f81f63Ec3",erc721Factory:"0xCfBDe041302aA0Fdee0dbAd4E22cc937fdC184ED"}};var a=class n extends NetworkPlugin{contracts;constructor(e){super(n.name),this.contracts=e;}clone(){return new n(this.contracts)}static name="xyz.lens.network.contracts"};function C(n){assert(n?.name===a.name,`Network plugin ${a.name} not found`,"UNKNOWN_ERROR");}function L(n){return ()=>{let e=new Network(n.name,n.id);return e.attachPlugin(new a(n.contracts)),e}}[s].forEach(n=>Network.register(n.id,L(n)));function E(n){return class extends n{getTokenBalance(t,r){return this.send("lens_getTokenBalance",[{address:t,contractAddress:r}])}getContractABI(t){return this.send("lens_getContractABI",[t])}getTokenTxHistory(t){return this.send("lens_getTokenTxHistory",[t])}getNftTxHistory(t){return this.send("lens_getNftTxHistory",[t])}getTokenInfo(t){return this.send("lens_getTokenInfo",[t])}async getContractCreation(t){return await this.send("lens_getContractCreation",t)??[]}async getTxHistory(t){return this.send("lens_getTxHistory",[t])}async getBlockNumberByTime(t,r){return this.send("lens_getBlockNumberByTime",[t,r])}async sendRawTransactionWithDetailedOutput(t){return this.send("zks_sendRawTransactionWithDetailedOutput",[t])}static getDefaultProvider(t){throw new Error("Use 'getDefaultProvider' from '@lens-network/sdk/ethers' instead")}}}var o=class extends E(c.Provider){getTokenBalance(e,t){return super.getTokenBalance(e,t)}getContractABI(e){return super.getContractABI(e)}getTokenTxHistory(e){return super.getTokenTxHistory(e)}getNftTxHistory(e){return super.getNftTxHistory(e)}getTokenInfo(e){return super.getTokenInfo(e)}getContractCreation(e){return super.getContractCreation(e)}getTxHistory(e){return super.getTxHistory(e)}getBlockNumberByTime(e,t){return super.getBlockNumberByTime(e,t)}sendRawTransactionWithDetailedOutput(e){return super.sendRawTransactionWithDetailedOutput(e)}},d=class extends E(c.BrowserProvider){getTokenBalance(e,t){return super.getTokenBalance(e,t)}getContractABI(e){return super.getContractABI(e)}getTokenTxHistory(e){return super.getTokenTxHistory(e)}getNftTxHistory(e){return super.getNftTxHistory(e)}getTokenInfo(e){return super.getTokenInfo(e)}getContractCreation(e){return super.getContractCreation(e)}getTxHistory(e){return super.getTxHistory(e)}getBlockNumberByTime(e,t){return super.getBlockNumberByTime(e,t)}sendRawTransactionWithDetailedOutput(e){return super.sendRawTransactionWithDetailedOutput(e)}};var m=(r=>(r[r.Mainnet=NaN]="Mainnet",r[r.Testnet=NaN]="Testnet",r[r.Staging=s.id]="Staging",r))(m||{});var g=class extends Error{name="InvariantError"};function v(n,e){throw new g(e)}function U(n){switch(n){case m.Staging:return new o(s.rpcUrl);case NaN:case NaN:v(!1,"Network supported yet");}}var N={};R(N,{localhost:()=>W,staging:()=>z});var H={name:"Ether",symbol:"ETH",decimals:18};function B(n){return {chainId:toBeHex(n.id),chainName:n.name,nativeCurrency:H,rpcUrls:[n.rpcUrl],blockExplorerUrls:[n.blockExplorerUrl]}}var z=B(s),W=B(P);var p={};R(p,{BasicErc20__factory:()=>u,Erc20Factory__factory:()=>l});var T=[{inputs:[{components:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],internalType:"struct BasicErc20.TokenParams",name:"params",type:"tuple"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"revision",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],u=class{static abi=T;static createInterface(){return new Interface(T)}static connect(e,t){return new Contract(e,T,t)}};var f=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"tokenAddress",type:"address"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!1,internalType:"string",name:"symbol",type:"string"},{indexed:!1,internalType:"uint256",name:"initialSupply",type:"uint256"}],name:"TokenCreated",type:"event"},{inputs:[{components:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],internalType:"struct BasicErc20.TokenParams",name:"params",type:"tuple"}],name:"createToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getTokens",outputs:[{internalType:"contract BasicErc20[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"initialOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"revision",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokens",outputs:[{internalType:"contract BasicErc20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],l=class{static abi=f;static createInterface(){return new Interface(f)}static connect(e,t){return new Contract(e,f,t)}};function A(n){return class extends n{async createErc20(t){let{chainId:r}=await this._providerL2().getNetwork(),i=Network.from(r)?.getPlugin(a.name);C(i);let k=await(await p.Erc20Factory__factory.connect(i.contracts.erc20Factory,this._signerL2()).createToken(t)).wait();assert(k!==null,"Transaction failed","NETWORK_ERROR");let b=k.logs.find(O=>O.address===i.contracts.erc20Factory);assert(b instanceof EventLog,"Event log not found","NETWORK_ERROR");let w=p.Erc20Factory__factory.createInterface().parseLog(b);return assert(w?.name==="TokenCreated","Token not created","NETWORK_ERROR"),w.args.tokenAddress}}}var D=class extends A(c.Wallet){createErc20(e){return super.createErc20(e)}connect(e){return super.connect(e)}},I=class n extends A(c.Signer){createErc20(e){return super.createErc20(e)}static from(e,t,r){let i=super.from(e,t,r);return Object.setPrototypeOf(i,n.prototype)}};
export { d as BrowserProvider, m as Network, o as Provider, D as Signer, I as Wallet, N as chains, U as getDefaultProvider };
export { d as BrowserProvider, m as Network, o as Provider, I as Signer, D as Wallet, N as chains, U as getDefaultProvider };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.js.map
import * as viem from 'viem';
import { Address, Hex, Hash, Chain, Account, Client, Transport, ChainContract, ContractFunctionArgs } from 'viem';
import { Chain, ChainContract, ContractFunctionArgs, Address, Account, Client, Transport, Hex, Hash } from 'viem';
import { RequestErrorType } from 'viem/utils';
import { Prettify, Assign } from 'viem/chains';
import { ZkSyncRpcLog } from 'viem/zksync';

@@ -9,4 +10,485 @@ import { T as TimeDirection, S as SecondsSinceEpoch, a as TxHistoryRequest, C as ContractCreationAddresses, b as TokenTxHistoryRequest, P as PagingResult } from '../types-Cs2ICLUM.js';

export { SendRawTransactionErrorType, SendRawTransactionParameters } from 'viem/actions';
import { Prettify, Assign } from 'viem/chains';
declare const abi$1: readonly [{
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: false;
readonly internalType: "uint8";
readonly name: "version";
readonly type: "uint8";
}];
readonly name: "Initialized";
readonly type: "event";
}, {
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly internalType: "address";
readonly name: "previousOwner";
readonly type: "address";
}, {
readonly indexed: true;
readonly internalType: "address";
readonly name: "newOwner";
readonly type: "address";
}];
readonly name: "OwnershipTransferred";
readonly type: "event";
}, {
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly internalType: "address";
readonly name: "tokenAddress";
readonly type: "address";
}, {
readonly indexed: true;
readonly internalType: "address";
readonly name: "owner";
readonly type: "address";
}, {
readonly indexed: false;
readonly internalType: "string";
readonly name: "name";
readonly type: "string";
}, {
readonly indexed: false;
readonly internalType: "string";
readonly name: "symbol";
readonly type: "string";
}, {
readonly indexed: false;
readonly internalType: "uint256";
readonly name: "initialSupply";
readonly type: "uint256";
}];
readonly name: "TokenCreated";
readonly type: "event";
}, {
readonly inputs: readonly [{
readonly components: readonly [{
readonly internalType: "address";
readonly name: "initialOwner";
readonly type: "address";
}, {
readonly internalType: "uint256";
readonly name: "initialSupply";
readonly type: "uint256";
}, {
readonly internalType: "string";
readonly name: "name";
readonly type: "string";
}, {
readonly internalType: "string";
readonly name: "symbol";
readonly type: "string";
}];
readonly internalType: "struct BasicErc20.TokenParams";
readonly name: "params";
readonly type: "tuple";
}];
readonly name: "createToken";
readonly outputs: readonly [{
readonly internalType: "address";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "getTokens";
readonly outputs: readonly [{
readonly internalType: "contract BasicErc20[]";
readonly name: "";
readonly type: "address[]";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "address";
readonly name: "initialOwner";
readonly type: "address";
}];
readonly name: "initialize";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "owner";
readonly outputs: readonly [{
readonly internalType: "address";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "renounceOwnership";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "revision";
readonly outputs: readonly [{
readonly internalType: "uint16";
readonly name: "";
readonly type: "uint16";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "uint256";
readonly name: "";
readonly type: "uint256";
}];
readonly name: "tokens";
readonly outputs: readonly [{
readonly internalType: "contract BasicErc20";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "address";
readonly name: "newOwner";
readonly type: "address";
}];
readonly name: "transferOwnership";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}];
type LensNetworkChain = Prettify<Assign<Chain, {
contracts: {
erc20Factory: ChainContract;
erc721Factory: ChainContract;
};
}>>;
declare const staging: {
blockExplorers?: {
[key: string]: {
name: string;
url: string;
apiUrl?: string | undefined;
};
default: {
name: string;
url: string;
apiUrl?: string | undefined;
};
} | undefined;
contracts: {
erc20Factory: ChainContract;
erc721Factory: ChainContract;
};
id: number;
name: string;
nativeCurrency: {
name: string;
symbol: string;
decimals: number;
};
rpcUrls: {
[key: string]: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
default: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<viem.ChainFormatters | undefined> | undefined;
formatters?: viem.ChainFormatters | undefined;
serializers?: viem.ChainSerializers<viem.ChainFormatters | undefined, viem.TransactionSerializable> | undefined;
};
declare const localhost: {
blockExplorers?: {
[key: string]: {
name: string;
url: string;
apiUrl?: string | undefined;
};
default: {
name: string;
url: string;
apiUrl?: string | undefined;
};
} | undefined;
contracts: {
erc20Factory: ChainContract;
erc721Factory: ChainContract;
};
id: number;
name: string;
nativeCurrency: {
name: string;
symbol: string;
decimals: number;
};
rpcUrls: {
[key: string]: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
default: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<viem.ChainFormatters | undefined> | undefined;
formatters?: viem.ChainFormatters | undefined;
serializers?: viem.ChainSerializers<viem.ChainFormatters | undefined, viem.TransactionSerializable> | undefined;
};
type chains_LensNetworkChain = LensNetworkChain;
declare const chains_localhost: typeof localhost;
declare const chains_staging: typeof staging;
declare namespace chains {
export { type chains_LensNetworkChain as LensNetworkChain, chains_localhost as localhost, chains_staging as staging };
}
type CreateErc20Parameters = ContractFunctionArgs<typeof abi$1, 'nonpayable', 'createToken'>[0];
type CreateErc20ReturnType = Address;
type CreateErc20ErrorType = RequestErrorType;
/**
* Create an ERC-20 contract with the given parameters.
*
* @param client - Client to use
* @param parameters - {@link CreateErc20Parameters}
* @returns The newly created ERC-20 contract address. {@link CreateErc20ReturnType}
*
* @example
* ```ts
* import { createWalletClient, Hex, http, privateKeyToAccount } from 'viem';
* import { chains, createErc20 } from '@lens-network/sdk/viem';
*
* const account = privateKeyToAccount(process.env.PRIVATE_KEY as Hex);
*
* const walletClient = createWalletClient({
* account,
* chain: chains.staging,
* transport: http(),
* });
*
* const tokenAddress = await createErc20(client, {
* initialOwner: account.address,
* initialSupply: 100_000_000_000_000_000_000n,
* name: 'SDK Test Token',
* symbol: 'SDK',
* });
*
* // tokenAddress: 0x…
* ```
*/
declare function createErc20<TChain extends LensNetworkChain, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>, params: CreateErc20Parameters): Promise<CreateErc20ReturnType>;
declare const abi: readonly [{
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: false;
readonly internalType: "uint8";
readonly name: "version";
readonly type: "uint8";
}];
readonly name: "Initialized";
readonly type: "event";
}, {
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly internalType: "address";
readonly name: "previousOwner";
readonly type: "address";
}, {
readonly indexed: true;
readonly internalType: "address";
readonly name: "newOwner";
readonly type: "address";
}];
readonly name: "OwnershipTransferred";
readonly type: "event";
}, {
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly internalType: "address";
readonly name: "tokenAddress";
readonly type: "address";
}, {
readonly indexed: true;
readonly internalType: "address";
readonly name: "owner";
readonly type: "address";
}, {
readonly indexed: false;
readonly internalType: "string";
readonly name: "name";
readonly type: "string";
}, {
readonly indexed: false;
readonly internalType: "string";
readonly name: "symbol";
readonly type: "string";
}, {
readonly indexed: false;
readonly internalType: "uint256";
readonly name: "maxSupply";
readonly type: "uint256";
}];
readonly name: "TokenCreated";
readonly type: "event";
}, {
readonly inputs: readonly [{
readonly components: readonly [{
readonly internalType: "address";
readonly name: "initialOwner";
readonly type: "address";
}, {
readonly internalType: "uint256";
readonly name: "maxSupply";
readonly type: "uint256";
}, {
readonly internalType: "string";
readonly name: "name";
readonly type: "string";
}, {
readonly internalType: "string";
readonly name: "symbol";
readonly type: "string";
}];
readonly internalType: "struct BasicErc721.TokenParams";
readonly name: "params";
readonly type: "tuple";
}];
readonly name: "createToken";
readonly outputs: readonly [{
readonly internalType: "address";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "getTokens";
readonly outputs: readonly [{
readonly internalType: "contract BasicErc721[]";
readonly name: "";
readonly type: "address[]";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "address";
readonly name: "initialOwner";
readonly type: "address";
}];
readonly name: "initialize";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "owner";
readonly outputs: readonly [{
readonly internalType: "address";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "renounceOwnership";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "revision";
readonly outputs: readonly [{
readonly internalType: "uint16";
readonly name: "";
readonly type: "uint16";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "uint256";
readonly name: "";
readonly type: "uint256";
}];
readonly name: "tokens";
readonly outputs: readonly [{
readonly internalType: "contract BasicErc721";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "address";
readonly name: "newOwner";
readonly type: "address";
}];
readonly name: "transferOwnership";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}];
type CreateErc721Parameters = ContractFunctionArgs<typeof abi, 'nonpayable', 'createToken'>[0];
type CreateErc721ReturnType = Address;
type CreateErc721ErrorType = RequestErrorType;
/**
* Create an ERC-721 contract with the given parameters.
*
* @param client - Client to use
* @param parameters - {@link CreateErc721Parameters}
* @returns The newly created ERC-721 contract address. {@link CreateErc721ReturnType}
*
* @example
* ```ts
* import { createWalletClient, Hex, http, privateKeyToAccount } from 'viem';
* import { chains, createErc721 } from '@lens-network/sdk/viem';
*
* const account = privateKeyToAccount(process.env.PRIVATE_KEY as Hex);
*
* const walletClient = createWalletClient({
* account,
* chain: chains.staging,
* transport: http(),
* });
*
* const tokenAddress = await createErc721(client, {
* initialOwner: account.address,
* maxSupply: 100n,
* name: 'My collection',
* symbol: 'SDK',
* });
*
* // tokenAddress: 0x…
* ```
*/
declare function createErc721<TChain extends LensNetworkChain, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>, params: CreateErc721Parameters): Promise<CreateErc721ReturnType>;
type StorageEntry = {

@@ -433,256 +915,2 @@ address: Address;

type LensNetworkChain = Prettify<Assign<Chain, {
contracts: {
erc20Factory: ChainContract;
};
}>>;
declare const staging: {
blockExplorers?: {
[key: string]: {
name: string;
url: string;
apiUrl?: string | undefined;
};
default: {
name: string;
url: string;
apiUrl?: string | undefined;
};
} | undefined;
contracts: {
erc20Factory: ChainContract;
};
id: number;
name: string;
nativeCurrency: {
name: string;
symbol: string;
decimals: number;
};
rpcUrls: {
[key: string]: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
default: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<viem.ChainFormatters | undefined> | undefined;
formatters?: viem.ChainFormatters | undefined;
serializers?: viem.ChainSerializers<viem.ChainFormatters | undefined, viem.TransactionSerializable> | undefined;
};
declare const localhost: {
blockExplorers?: {
[key: string]: {
name: string;
url: string;
apiUrl?: string | undefined;
};
default: {
name: string;
url: string;
apiUrl?: string | undefined;
};
} | undefined;
contracts: {
erc20Factory: ChainContract;
};
id: number;
name: string;
nativeCurrency: {
name: string;
symbol: string;
decimals: number;
};
rpcUrls: {
[key: string]: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
default: {
http: readonly string[];
webSocket?: readonly string[] | undefined;
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<viem.ChainFormatters | undefined> | undefined;
formatters?: viem.ChainFormatters | undefined;
serializers?: viem.ChainSerializers<viem.ChainFormatters | undefined, viem.TransactionSerializable> | undefined;
};
type chains_LensNetworkChain = LensNetworkChain;
declare const chains_localhost: typeof localhost;
declare const chains_staging: typeof staging;
declare namespace chains {
export { type chains_LensNetworkChain as LensNetworkChain, chains_localhost as localhost, chains_staging as staging };
}
declare const abi: readonly [{
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: false;
readonly internalType: "uint8";
readonly name: "version";
readonly type: "uint8";
}];
readonly name: "Initialized";
readonly type: "event";
}, {
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly internalType: "address";
readonly name: "previousOwner";
readonly type: "address";
}, {
readonly indexed: true;
readonly internalType: "address";
readonly name: "newOwner";
readonly type: "address";
}];
readonly name: "OwnershipTransferred";
readonly type: "event";
}, {
readonly anonymous: false;
readonly inputs: readonly [{
readonly indexed: true;
readonly internalType: "address";
readonly name: "tokenAddress";
readonly type: "address";
}, {
readonly indexed: true;
readonly internalType: "address";
readonly name: "owner";
readonly type: "address";
}, {
readonly indexed: false;
readonly internalType: "string";
readonly name: "name";
readonly type: "string";
}, {
readonly indexed: false;
readonly internalType: "string";
readonly name: "symbol";
readonly type: "string";
}, {
readonly indexed: false;
readonly internalType: "uint256";
readonly name: "initialSupply";
readonly type: "uint256";
}];
readonly name: "TokenCreated";
readonly type: "event";
}, {
readonly inputs: readonly [{
readonly components: readonly [{
readonly internalType: "address";
readonly name: "initialOwner";
readonly type: "address";
}, {
readonly internalType: "uint256";
readonly name: "initialSupply";
readonly type: "uint256";
}, {
readonly internalType: "string";
readonly name: "name";
readonly type: "string";
}, {
readonly internalType: "string";
readonly name: "symbol";
readonly type: "string";
}];
readonly internalType: "struct BasicErc20.TokenParams";
readonly name: "params";
readonly type: "tuple";
}];
readonly name: "createToken";
readonly outputs: readonly [{
readonly internalType: "address";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "getTokens";
readonly outputs: readonly [{
readonly internalType: "contract BasicErc20[]";
readonly name: "";
readonly type: "address[]";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "address";
readonly name: "initialOwner";
readonly type: "address";
}];
readonly name: "initialize";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "owner";
readonly outputs: readonly [{
readonly internalType: "address";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "renounceOwnership";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}, {
readonly inputs: readonly [];
readonly name: "revision";
readonly outputs: readonly [{
readonly internalType: "uint16";
readonly name: "";
readonly type: "uint16";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "uint256";
readonly name: "";
readonly type: "uint256";
}];
readonly name: "tokens";
readonly outputs: readonly [{
readonly internalType: "contract BasicErc20";
readonly name: "";
readonly type: "address";
}];
readonly stateMutability: "view";
readonly type: "function";
}, {
readonly inputs: readonly [{
readonly internalType: "address";
readonly name: "newOwner";
readonly type: "address";
}];
readonly name: "transferOwnership";
readonly outputs: readonly [];
readonly stateMutability: "nonpayable";
readonly type: "function";
}];
type CreateErc20Parameters = ContractFunctionArgs<typeof abi, 'nonpayable', 'createToken'>[0];
type CreateErc20ReturnType = Address;
type PublicActions = {

@@ -892,7 +1120,7 @@ /**

/**
* Create an ERC-20 token with the given parameters.
* Create an ERC-20 contract with the given parameters.
*
* @param client - Client to use
* @param parameters - {@link CreateErc20Parameters}
* @returns The newly created ERC-20 token address. {@link CreateErc20ReturnType}
* @returns The newly created ERC-20 contract address. {@link CreateErc20ReturnType}
*

@@ -924,2 +1152,33 @@ * @example

/**
* Create an ERC-721 contract with the given parameters.
*
* @param client - Client to use
* @param parameters - {@link CreateErc20Parameters}
* @returns The newly created ERC-721 contract address. {@link CreateErc20ReturnType}
*
* @example
* ```ts
* import { createWalletClient, Hex, http, privateKeyToAccount } from 'viem';
* import { chains, walletActions } from '@lens-network/sdk/viem';
*
* const account = privateKeyToAccount(process.env.PRIVATE_KEY as Hex);
*
* export const walletClient = createWalletClient({
* account,
* chain: chains.staging,
* transport: http(),
* }).extend(walletActions());
*
* const tokenAddress = await client.createErc721({
* initialOwner: account.address,
* maxSupply: 100n,
* name: 'My collection',
* symbol: 'SDK',
* });
*
* // tokenAddress: 0x…
* ```
*/
createErc721: (params: CreateErc721Parameters) => Promise<CreateErc721ReturnType>;
/**
* Executes a transaction and returns its hash, storage logs, and events that would have

@@ -966,2 +1225,3 @@ * been generated if the transaction had already been included in the block.

erc20Factory: viem.ChainContract;
erc721Factory: viem.ChainContract;
};

@@ -993,2 +1253,2 @@ id: number;

export { type ContractsCreationResult, type GetBlockNumberByTimeErrorType, type GetBlockNumberByTimeParameters, type GetBlockNumberByTimeReturnType, type GetContractAbiErrorType, type GetContractAbiParameters, type GetContractAbiReturnType, type GetContractCreationErrorType, type GetContractCreationParameters, type GetContractCreationReturnType, type GetNftTxHistoryErrorType, type GetNftTxHistoryParameters, type GetNftTxHistoryReturnType, type GetTokenBalanceErrorType, type GetTokenBalanceParameters, type GetTokenBalanceReturnType, type GetTokenInfoErrorType, type GetTokenInfoParameters, type GetTokenInfoReturnType, type GetTokenTxHistoryErrorType, type GetTokenTxHistoryParameters, type GetTokenTxHistoryReturnType, type GetTxHistoryErrorType, type GetTxHistoryParameters, type GetTxHistoryReturnType, PagingResult, type PublicActions, type PublicLensNetworkRpcSchema, SecondsSinceEpoch, type SendRawTransactionDetails, type SendRawTransactionWithDetailedOutputErrorType, type SendRawTransactionWithDetailedOutputParameters, type SendRawTransactionWithDetailedOutputReturnType, type StorageEntry, TimeDirection, type TokenBalanceRequest, type TokenInfoResult, type TokenTxHistoryItem, type TxHistoryItem, type WalletActions, chains, getBlockNumberByTime, getContractABI, getContractCreation, getNftTxHistory, getTokenBalance, getTokenInfo, getTokenTxHistory, getTxHistory, publicActions, sendRawTransactionWithDetailedOutput, walletActions };
export { type ContractsCreationResult, type CreateErc20ErrorType, type CreateErc20Parameters, type CreateErc20ReturnType, type CreateErc721ErrorType, type CreateErc721Parameters, type CreateErc721ReturnType, type GetBlockNumberByTimeErrorType, type GetBlockNumberByTimeParameters, type GetBlockNumberByTimeReturnType, type GetContractAbiErrorType, type GetContractAbiParameters, type GetContractAbiReturnType, type GetContractCreationErrorType, type GetContractCreationParameters, type GetContractCreationReturnType, type GetNftTxHistoryErrorType, type GetNftTxHistoryParameters, type GetNftTxHistoryReturnType, type GetTokenBalanceErrorType, type GetTokenBalanceParameters, type GetTokenBalanceReturnType, type GetTokenInfoErrorType, type GetTokenInfoParameters, type GetTokenInfoReturnType, type GetTokenTxHistoryErrorType, type GetTokenTxHistoryParameters, type GetTokenTxHistoryReturnType, type GetTxHistoryErrorType, type GetTxHistoryParameters, type GetTxHistoryReturnType, PagingResult, type PublicActions, type PublicLensNetworkRpcSchema, SecondsSinceEpoch, type SendRawTransactionDetails, type SendRawTransactionWithDetailedOutputErrorType, type SendRawTransactionWithDetailedOutputParameters, type SendRawTransactionWithDetailedOutputReturnType, type StorageEntry, TimeDirection, type TokenBalanceRequest, type TokenInfoResult, type TokenTxHistoryItem, type TxHistoryItem, type WalletActions, chains, createErc20, createErc721, getBlockNumberByTime, getContractABI, getContractCreation, getNftTxHistory, getTokenBalance, getTokenInfo, getTokenTxHistory, getTxHistory, publicActions, sendRawTransactionWithDetailedOutput, walletActions };

@@ -0,10 +1,10 @@

import { getChainContractAddress, parseEventLogs } from 'viem';
import { writeContract, waitForTransactionReceipt } from 'viem/actions';
import { defineChain } from 'viem/utils';
import { chainConfig } from 'viem/zksync';
import { getChainContractAddress, parseEventLogs } from 'viem';
import { writeContract, waitForTransactionReceipt } from 'viem/actions';
var k=Object.defineProperty;var R=(e,t)=>{for(var r in t)k(e,r,{get:t[r],enumerable:!0});};async function o(e,{closest:t,timestamp:r}){return e.request({method:"lens_getBlockNumberByTime",params:[t,r]},{retryCount:0})}async function a(e,{address:t}){return e.request({method:"lens_getContractABI",params:[t]},{retryCount:0})}async function i(e,{addresses:t}){return await e.request({method:"lens_getContractCreation",params:t},{retryCount:0})??[]}async function s(e,t){return e.request({method:"lens_getTokenBalance",params:[t]},{retryCount:0})}async function p(e,{address:t}){return e.request({method:"lens_getTokenInfo",params:[t]},{retryCount:0})}async function c(e,t){return e.request({method:"lens_getTokenTxHistory",params:[t]},{retryCount:0})}async function u(e,t){return e.request({method:"lens_getNftTxHistory",params:[t]},{retryCount:0})}async function m(e,t){return e.request({method:"lens_getTxHistory",params:[t]},{retryCount:0})}async function T(e,{serializedTransaction:t}){return e.request({method:"zks_sendRawTransactionWithDetailedOutput",params:[t]},{retryCount:0})}var x={};R(x,{localhost:()=>b,staging:()=>w});var y={id:37111,name:"Lens Development Network",network:"lens-development-network",rpcUrl:"https://rpc.staging.lens-network.crtlkey.com/",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0x40bef8fc597752305170829a81097612e00Dc3A8"}},d={id:37111,name:"Lens Local Network",network:"lens-local-network",rpcUrl:"http://localhost:4096",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0x40bef8fc597752305170829a81097612e00Dc3A8"}};var l={name:"Ether",symbol:"ETH",decimals:18};function f(e){return defineChain({...chainConfig,id:e.id,name:e.name,network:e.network,nativeCurrency:l,rpcUrls:{default:{http:[e.rpcUrl]}},blockExplorers:{default:{name:`${e.name} Explorer`,url:e.blockExplorerUrl}},contracts:{erc20Factory:{address:e.contracts.erc20Factory}},testnet:e.testnet,fees:{estimateFeesPerGas:0n}})}var w=f(y),b=f(d);var n=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"tokenAddress",type:"address"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!1,internalType:"string",name:"symbol",type:"string"},{indexed:!1,internalType:"uint256",name:"initialSupply",type:"uint256"}],name:"TokenCreated",type:"event"},{inputs:[{components:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],internalType:"struct BasicErc20.TokenParams",name:"params",type:"tuple"}],name:"createToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getTokens",outputs:[{internalType:"contract BasicErc20[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"initialOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"revision",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokens",outputs:[{internalType:"contract BasicErc20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];async function C(e,t){let r=await writeContract(e,{address:getChainContractAddress({chain:e.chain,contract:"erc20Factory"}),abi:n,functionName:"createToken",args:[t]}),h=await waitForTransactionReceipt(e,{hash:r});return parseEventLogs({abi:n,logs:h.logs})[0]?.address}function B(){return e=>({getTokenBalance:t=>s(e,t),getContractABI:t=>a(e,t),getTokenTxHistory:t=>c(e,t),getNftTxHistory:t=>u(e,t),getTokenInfo:t=>p(e,t),getContractCreation:t=>i(e,t),getTxHistory:t=>m(e,t),getBlockNumberByTime:t=>o(e,t)})}function S(){return e=>({createErc20:t=>C(e,t),sendRawTransactionWithDetailedOutput:t=>T(e,t)})}
var w=Object.defineProperty;var A=(e,t)=>{for(var r in t)w(e,r,{get:t[r],enumerable:!0});};var a=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"tokenAddress",type:"address"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!1,internalType:"string",name:"symbol",type:"string"},{indexed:!1,internalType:"uint256",name:"initialSupply",type:"uint256"}],name:"TokenCreated",type:"event"},{inputs:[{components:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"uint256",name:"initialSupply",type:"uint256"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],internalType:"struct BasicErc20.TokenParams",name:"params",type:"tuple"}],name:"createToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getTokens",outputs:[{internalType:"contract BasicErc20[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"initialOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"revision",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokens",outputs:[{internalType:"contract BasicErc20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];async function s(e,t){let r=await writeContract(e,{address:getChainContractAddress({chain:e.chain,contract:"erc20Factory"}),abi:a,functionName:"createToken",args:[t]}),n=await waitForTransactionReceipt(e,{hash:r});return parseEventLogs({abi:a,logs:n.logs})[0]?.address}var o=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"tokenAddress",type:"address"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!1,internalType:"string",name:"symbol",type:"string"},{indexed:!1,internalType:"uint256",name:"maxSupply",type:"uint256"}],name:"TokenCreated",type:"event"},{inputs:[{components:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"uint256",name:"maxSupply",type:"uint256"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],internalType:"struct BasicErc721.TokenParams",name:"params",type:"tuple"}],name:"createToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getTokens",outputs:[{internalType:"contract BasicErc721[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"initialOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"revision",outputs:[{internalType:"uint16",name:"",type:"uint16"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokens",outputs:[{internalType:"contract BasicErc721",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];async function i(e,t){let r=await writeContract(e,{address:getChainContractAddress({chain:e.chain,contract:"erc721Factory"}),abi:o,functionName:"createToken",args:[t]}),n=await waitForTransactionReceipt(e,{hash:r});return parseEventLogs({abi:o,logs:n.logs})[0]?.address}async function p(e,{closest:t,timestamp:r}){return e.request({method:"lens_getBlockNumberByTime",params:[t,r]},{retryCount:0})}async function c(e,{address:t}){return e.request({method:"lens_getContractABI",params:[t]},{retryCount:0})}async function u(e,{addresses:t}){return await e.request({method:"lens_getContractCreation",params:t},{retryCount:0})??[]}async function m(e,t){return e.request({method:"lens_getTokenBalance",params:[t]},{retryCount:0})}async function y(e,{address:t}){return e.request({method:"lens_getTokenInfo",params:[t]},{retryCount:0})}async function T(e,t){return e.request({method:"lens_getTokenTxHistory",params:[t]},{retryCount:0})}async function d(e,t){return e.request({method:"lens_getNftTxHistory",params:[t]},{retryCount:0})}async function l(e,t){return e.request({method:"lens_getTxHistory",params:[t]},{retryCount:0})}async function f(e,{serializedTransaction:t}){return e.request({method:"zks_sendRawTransactionWithDetailedOutput",params:[t]},{retryCount:0})}var R={};A(R,{localhost:()=>v,staging:()=>O});var C={id:37111,name:"Lens Development Network",network:"lens-development-network",rpcUrl:"https://rpc.staging.lens-network.crtlkey.com/",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0xCAb3353b6055d6FDE858f8b862B90c9f81f63Ec3",erc721Factory:"0xCfBDe041302aA0Fdee0dbAd4E22cc937fdC184ED"}},x={id:37111,name:"Lens Local Network",network:"lens-local-network",rpcUrl:"http://localhost:4096",blockExplorerUrl:"https://explorer.staging.lens.zksync.dev/",testnet:!0,contracts:{erc20Factory:"0xCAb3353b6055d6FDE858f8b862B90c9f81f63Ec3",erc721Factory:"0xCfBDe041302aA0Fdee0dbAd4E22cc937fdC184ED"}};var h={name:"Ether",symbol:"ETH",decimals:18};function k(e){return defineChain({...chainConfig,id:e.id,name:e.name,network:e.network,nativeCurrency:h,rpcUrls:{default:{http:[e.rpcUrl]}},blockExplorers:{default:{name:`${e.name} Explorer`,url:e.blockExplorerUrl}},contracts:{erc20Factory:{address:e.contracts.erc20Factory},erc721Factory:{address:e.contracts.erc721Factory}},testnet:e.testnet,fees:{estimateFeesPerGas:0n}})}var O=k(C),v=k(x);function I(){return e=>({getTokenBalance:t=>m(e,t),getContractABI:t=>c(e,t),getTokenTxHistory:t=>T(e,t),getNftTxHistory:t=>d(e,t),getTokenInfo:t=>y(e,t),getContractCreation:t=>u(e,t),getTxHistory:t=>l(e,t),getBlockNumberByTime:t=>p(e,t)})}function F(){return e=>({createErc20:t=>s(e,t),createErc721:t=>i(e,t),sendRawTransactionWithDetailedOutput:t=>f(e,t)})}
export { x as chains, o as getBlockNumberByTime, a as getContractABI, i as getContractCreation, u as getNftTxHistory, s as getTokenBalance, p as getTokenInfo, c as getTokenTxHistory, m as getTxHistory, B as publicActions, T as sendRawTransactionWithDetailedOutput, S as walletActions };
export { R as chains, s as createErc20, i as createErc721, p as getBlockNumberByTime, c as getContractABI, u as getContractCreation, d as getNftTxHistory, m as getTokenBalance, y as getTokenInfo, T as getTokenTxHistory, l as getTxHistory, I as publicActions, f as sendRawTransactionWithDetailedOutput, F as walletActions };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.js.map
{
"name": "@lens-network/sdk",
"version": "0.0.0-canary-20240627114739",
"version": "0.0.0-canary-20240627133053",
"description": "The quickest way to connect your dApp to the Lens Network.",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc