-
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
19 changed files
with
202 additions
and
231 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { | ||
CustomFiltersType, | ||
LensClient, | ||
OpenActionCategoryType, | ||
OpenActionModuleType, | ||
development, | ||
} from '@lens-protocol/client'; | ||
|
||
async function main() { | ||
const client = new LensClient({ | ||
environment: development, | ||
}); | ||
|
||
// stats across the whole protocol | ||
const protocolWideStats = await client.profile.stats({ request: { forProfileId: '0x01' } }); | ||
|
||
console.log('Result: ', protocolWideStats); | ||
|
||
// stats for a specified apps | ||
const statsForSpecifiedApps = await client.profile.stats({ | ||
request: { forProfileId: '0x01' }, | ||
profileStatsArg: { forApps: ['APP_ID', 'ANOTHER_APP_ID'] }, | ||
}); | ||
|
||
console.log('Result: ', statsForSpecifiedApps); | ||
|
||
// filter open actions | ||
const filteredOpenActions = await client.profile.stats({ | ||
request: { forProfileId: '0x01' }, | ||
profileStatsCountOpenActionArgs: { | ||
anyOf: [ | ||
{ | ||
address: '0x00', | ||
type: OpenActionModuleType.SimpleCollectOpenActionModule, | ||
category: OpenActionCategoryType.Collect, | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
console.log('Result: ', filteredOpenActions); | ||
|
||
// stats for a specified app and with custom filters | ||
const customFilteredStats = await client.profile.stats({ | ||
request: { forProfileId: '0x01' }, | ||
profileStatsArg: { forApps: ['APP_ID'], customFilters: [CustomFiltersType.Gardeners] }, | ||
}); | ||
|
||
console.log('Result: ', customFilteredStats); | ||
} | ||
|
||
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.