-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import { LensClient, development } from '@lens-protocol/client'; | ||
|
||
async function main() { | ||
const lensClient = new LensClient({ | ||
const client = new LensClient({ | ||
environment: development, | ||
}); | ||
|
||
const profileId = 'PROFILE_ID'; | ||
const profileId = '0x01'; | ||
|
||
const followRevenue = await lensClient.revenue.fromFollow({ | ||
for: 'PROFILE_ID', | ||
const result = await client.revenue.fromFollow({ | ||
for: profileId, | ||
}); | ||
|
||
console.log( | ||
`Follow revenue for profile with id: ${profileId} - ${JSON.stringify(followRevenue)}`, | ||
); | ||
console.log(`Follow revenue for profile with id: ${profileId}`, result); | ||
} | ||
|
||
main(); |
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 |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import { LensClient, development } from '@lens-protocol/client'; | ||
|
||
async function main() { | ||
const lensClient = new LensClient({ | ||
const client = new LensClient({ | ||
environment: development, | ||
}); | ||
|
||
const publicationRevenue = await lensClient.revenue.fromPublication({ | ||
for: 'PUBLICATION_ID', | ||
}); | ||
try { | ||
const publications = await client.publication.fetchAll(); | ||
|
||
const firstPublication = publications.items[0]; | ||
|
||
const publicationRevenue = await client.revenue.fromPublication({ | ||
for: firstPublication.id, | ||
}); | ||
|
||
console.log( | ||
`Publication revenue for publication with id: ${ | ||
publicationRevenue.publication.id | ||
} - ${JSON.stringify(publicationRevenue.revenue)}`, | ||
); | ||
console.log(`Revenue for publication with id: ${firstPublication.id}`, publicationRevenue); | ||
} catch (e) { | ||
if (e instanceof Error) { | ||
console.log(e.message); | ||
} | ||
} | ||
} | ||
|
||
main(); |
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 |
---|---|---|
@@ -1,61 +1,17 @@ | ||
import { LensClient, development } from '@lens-protocol/client'; | ||
|
||
async function main() { | ||
const lensClient = new LensClient({ | ||
const client = new LensClient({ | ||
environment: development, | ||
}); | ||
|
||
const collectRevenue = await lensClient.revenue.fromPublications({ | ||
for: 'PROFILE_ID', | ||
// where: { | ||
// fromCollects: true, | ||
// }, | ||
}); | ||
|
||
collectRevenue.items.map((item) => { | ||
console.log( | ||
`Collect revenue for publication with id: ${item.publication.id} - ${JSON.stringify( | ||
item.revenue, | ||
)}`, | ||
); | ||
}); | ||
|
||
const revenueFromQuoteCollects = await lensClient.revenue.fromPublications({ | ||
for: 'PROFILE_ID', | ||
// where: { | ||
// fromCollects: true, | ||
// publicationTypes: [PublicationType.Quote], | ||
// }, | ||
}); | ||
|
||
revenueFromQuoteCollects.items.map((item) => { | ||
console.log( | ||
`Collect revenue for quote publication with id: ${item.publication.id} - ${JSON.stringify( | ||
item.revenue, | ||
)}`, | ||
); | ||
}); | ||
const profileId = '0x01'; | ||
|
||
const revenueFromOpenAction = await lensClient.revenue.fromPublications({ | ||
for: 'PROFILE_ID', | ||
// where: { | ||
// fromCollects: false, | ||
// anyOf: [ | ||
// { | ||
// address: '0x000', | ||
// category: OpenActionCategoryType.Collect, | ||
// }, | ||
// ], | ||
// }, | ||
const result = await client.revenue.fromPublications({ | ||
for: profileId, | ||
}); | ||
|
||
revenueFromOpenAction.items.map((item) => { | ||
console.log( | ||
`Open action revenue for publication with id: ${item.publication.id} - ${JSON.stringify( | ||
item.revenue, | ||
)}`, | ||
); | ||
}); | ||
console.log(`Follow revenue for profile with id: ${profileId}`, result); | ||
} | ||
|
||
main(); |
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