-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #785 from lens-protocol/release-react-2.0.0-alpha.26
Release react 2.0.0 alpha.26
- Loading branch information
Showing
129 changed files
with
4,681 additions
and
384 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@lens-protocol/domain": minor | ||
"@lens-protocol/react": minor | ||
"@lens-protocol/react-native": minor | ||
"@lens-protocol/react-web": minor | ||
--- | ||
|
||
feat: adds self-funded support for unfollow |
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,8 @@ | ||
--- | ||
"@lens-protocol/react-native": minor | ||
"@lens-protocol/react-web": minor | ||
"@lens-protocol/react": minor | ||
"@lens-protocol/api-bindings": patch | ||
--- | ||
|
||
**feat:** `useModuleMetadata`, `useLazyModuleMetadata` and surfaces new unknown modules fields |
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,5 @@ | ||
--- | ||
"@lens-protocol/wagmi": patch | ||
--- | ||
|
||
Upgraded wagmi dependency |
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,6 @@ | ||
--- | ||
"@lens-protocol/react-web": minor | ||
"@lens-protocol/react": minor | ||
--- | ||
|
||
**feat:** Added experimental hooks to integrate with XMTP: `useXmtpClient`, `useStartLensConversation`, `useEnhanceConversation`, and `useEnhanceConversations` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@lens-protocol/domain": patch | ||
"@lens-protocol/react": patch | ||
"@lens-protocol/react-native": patch | ||
"@lens-protocol/react-web": patch | ||
--- | ||
|
||
**fix:** Revoke credentials only on user initiated logout |
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,5 @@ | ||
--- | ||
"@lens-protocol/client": minor | ||
--- | ||
|
||
**feat:** support Open Action Module Metadata in `LensClient` |
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,7 @@ | ||
--- | ||
"@lens-protocol/domain": minor | ||
"@lens-protocol/react": minor | ||
"@lens-protocol/react-web": minor | ||
--- | ||
|
||
feat: implements self-funded unlink handle |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { LensClient, development } from '@lens-protocol/client'; | ||
|
||
async function main() { | ||
const client = new LensClient({ | ||
environment: development, | ||
}); | ||
|
||
const result = await client.modules.fetchMetadata({ | ||
implementation: '0xc0ffee254729296a45a3885639AC7E10F9d54979', | ||
}); | ||
|
||
console.log('Result: ', result); | ||
} | ||
|
||
main(); |
94 changes: 94 additions & 0 deletions
94
examples/node/scripts/publication/recipes/unknownOpenAction.ts
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,94 @@ | ||
import { | ||
LensClient, | ||
ModuleParam, | ||
decodeData, | ||
development, | ||
encodeData, | ||
isPostPublication, | ||
isRelaySuccess, | ||
isUnknownOpenActionModuleSettings, | ||
} from '@lens-protocol/client'; | ||
|
||
async function main() { | ||
const client = new LensClient({ | ||
environment: development, | ||
}); | ||
|
||
// fetch publication with open action module | ||
const publication = await client.publication.fetch({ | ||
forId: '0x123-0x456', | ||
}); | ||
|
||
if (!publication || !isPostPublication(publication)) { | ||
throw new Error('Publication is not a post publication'); | ||
} | ||
|
||
// the open action contract address we are interested in | ||
const openActionContractAddress = '0x1234567890123456789012345678901234567890'; | ||
|
||
// retrieve open action settings | ||
const openActionSettings = publication.openActionModules.find( | ||
(module) => | ||
module.contract.address.toLowerCase() === openActionContractAddress.toLocaleLowerCase(), | ||
); | ||
|
||
if (!openActionSettings || !isUnknownOpenActionModuleSettings(openActionSettings)) { | ||
throw new Error('No UnknownOpenActionModule settings found'); | ||
} | ||
|
||
// fetch open action metadata | ||
const result = await client.modules.fetchMetadata({ | ||
implementation: openActionSettings.contract.address, | ||
}); | ||
|
||
if (!result) { | ||
throw new Error('No metadata found'); | ||
} | ||
|
||
// decode init data if needed | ||
if (openActionSettings.initializeCalldata) { | ||
const initData = decodeData( | ||
JSON.parse(result.metadata.initializeCalldataABI) as ModuleParam[], | ||
openActionSettings.initializeCalldata, | ||
); | ||
console.log('initData', initData); | ||
} | ||
|
||
// decode init result if needed | ||
if (openActionSettings.initializeResultData && result.metadata.initializeResultDataABI) { | ||
const initResult = decodeData( | ||
JSON.parse(result.metadata.initializeResultDataABI) as ModuleParam[], | ||
openActionSettings.initializeResultData, | ||
); | ||
console.log('initResult', initResult); | ||
} | ||
|
||
// Use initData and/or initResult to inform the user about the module | ||
// configuration. This depends on the specific module used. | ||
|
||
const calldata = encodeData(JSON.parse(result.metadata.processCalldataABI) as ModuleParam[], [ | ||
/* data according to ABI spec, might leverage initData and/or initResult */ | ||
]); | ||
|
||
// act on open action | ||
const actOnResult = await client.publication.actions.actOn({ | ||
actOn: { | ||
unknownOpenAction: { | ||
address: openActionSettings.contract.address, | ||
data: calldata, | ||
}, | ||
}, | ||
for: publication.id, | ||
}); | ||
|
||
const actOnResultValue = actOnResult.unwrap(); | ||
|
||
if (!isRelaySuccess(actOnResultValue)) { | ||
console.log(`Something went wrong`, actOnResultValue); | ||
return; | ||
} | ||
|
||
console.log(`Transaction was successfully broadcasted with txId`, actOnResultValue.txId); | ||
} | ||
|
||
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
Oops, something went wrong.