Skip to content

Commit

Permalink
Merge pull request #785 from lens-protocol/release-react-2.0.0-alpha.26
Browse files Browse the repository at this point in the history
Release react 2.0.0 alpha.26
  • Loading branch information
krzysu authored Dec 14, 2023
2 parents 481786b + c558bc9 commit fa27197
Show file tree
Hide file tree
Showing 129 changed files with 4,681 additions and 384 deletions.
8 changes: 8 additions & 0 deletions .changeset/cuddly-emus-judge.md
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
8 changes: 8 additions & 0 deletions .changeset/mighty-planets-retire.md
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
5 changes: 5 additions & 0 deletions .changeset/new-moons-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lens-protocol/wagmi": patch
---

Upgraded wagmi dependency
6 changes: 6 additions & 0 deletions .changeset/orange-masks-punch.md
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`
7 changes: 7 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"chilly-mirrors-fry",
"cold-pants-do",
"cool-bikes-report",
"cuddly-emus-judge",
"cuddly-schools-nail",
"curvy-onions-destroy",
"cyan-cars-join",
Expand Down Expand Up @@ -93,9 +94,11 @@
"many-jeans-cough",
"mean-ducks-tan",
"metal-cougars-train",
"mighty-planets-retire",
"modern-spies-confess",
"nervous-papayas-design",
"new-doors-sip",
"new-moons-jog",
"new-pianos-type",
"nine-chicken-deliver",
"ninety-meals-bake",
Expand All @@ -106,6 +109,7 @@
"old-owls-roll",
"olive-beans-double",
"olive-trainers-march",
"orange-masks-punch",
"plenty-emus-doubt",
"polite-pans-allow",
"poor-parrots-unite",
Expand All @@ -126,13 +130,15 @@
"slow-melons-fail",
"small-forks-rest",
"small-hats-mix",
"small-seas-switch",
"smooth-ties-roll",
"sour-avocados-look",
"spicy-hornets-protect",
"spotty-bikes-eat",
"strange-yaks-sit",
"strong-cherries-compare",
"stupid-birds-wait",
"swift-dragons-watch",
"swift-hornets-camp",
"tall-gorillas-build",
"tame-icons-leave",
Expand All @@ -145,6 +151,7 @@
"thin-news-pull",
"three-cougars-pay",
"tidy-kangaroos-bake",
"tidy-pants-punch",
"tough-snakes-complain",
"tricky-planets-share",
"two-geese-protect",
Expand Down
8 changes: 8 additions & 0 deletions .changeset/small-seas-switch.md
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
5 changes: 5 additions & 0 deletions .changeset/swift-dragons-watch.md
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`
7 changes: 7 additions & 0 deletions .changeset/tidy-pants-punch.md
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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
needs: install

steps:
- name: Set swap space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 8

- uses: actions/checkout@v3

- name: Setup pnpm
Expand Down
2 changes: 1 addition & 1 deletion examples/next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "^1.19.7",
"wagmi": "^1.4.7"
"wagmi": "^1.4.12"
},
"devDependencies": {
"@types/node": "^18.18.12",
Expand Down
15 changes: 15 additions & 0 deletions examples/node/scripts/modules/fetchMetadata.ts
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 examples/node/scripts/publication/recipes/unknownOpenAction.ts
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();
2 changes: 1 addition & 1 deletion examples/node/scripts/publication/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function main() {
});

const result = await client.publication.fetch({
forId: '0x04-0x0b',
forId: '0x56-0x02',
});

if (result && isMirrorPublication(result)) {
Expand Down
6 changes: 3 additions & 3 deletions examples/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"dependencies": {
"@ethersproject/providers": "^5.7.2",
"@irys/sdk": "^0.0.4",
"@lens-protocol/metadata": "^1.0.5",
"@lens-protocol/client": "workspace:*",
"@lens-protocol/metadata": "^1.0.5",
"@lens-protocol/react-web": "workspace:*",
"@lens-protocol/wagmi": "workspace:*",
"@xmtp/react-sdk": "1.0.0-preview.40",
"@xmtp/react-sdk": "^3.0.0",
"example-shared": "workspace:*",
"react": "^18.2.0",
"react-cool-inview": "^3.0.1",
Expand All @@ -31,7 +31,7 @@
"react-router-dom": "^6.20.0",
"readable-web-to-node-stream": "^3.0.2",
"viem": "^1.19.7",
"wagmi": "^1.4.7"
"wagmi": "^1.4.12"
},
"devDependencies": {
"@babel/core": "^7.23.3",
Expand Down
Loading

0 comments on commit fa27197

Please sign in to comment.