Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/20240129 #813

Merged
merged 14 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-seals-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lens-protocol/client": patch
---

**chore**: Relax node version requirements to >18 <21
8 changes: 8 additions & 0 deletions .changeset/four-squids-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/api-bindings": minor
"@lens-protocol/react": minor
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
---

**feat:** introduces `params.statsFor` and `params.profile.metadataSource` in `LensConfig`
12 changes: 12 additions & 0 deletions .changeset/grumpy-bugs-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@lens-protocol/blockchain-bindings": patch
"@lens-protocol/gated-content": patch
"@lens-protocol/shared-kernel": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
"@lens-protocol/client": patch
"@lens-protocol/react": patch
"@lens-protocol/wagmi": patch
---

**chore:** Removed peer dependency on ethers@5
7 changes: 7 additions & 0 deletions .changeset/heavy-lizards-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**fix:** supports User Rejection error from Wallet that despite returning correct error code are NOT recognized by `ethers` (v5)
8 changes: 8 additions & 0 deletions .changeset/hip-baboons-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/api-bindings": patch
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**Fixed**: missing export of `findCollectModuleSettings` and `isCollectModuleSettings` helpers
8 changes: 8 additions & 0 deletions .changeset/hip-brooms-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/shared-kernel": minor
"@lens-protocol/react": minor
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
---

**feat:** Introduced `debug` mode. Exported `ConsoleLogger`.
5 changes: 5 additions & 0 deletions .changeset/honest-buses-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lens-protocol/client": minor
---

**feat**: Added `authentication.authenticateWith` method to allow to authenticate LensClient with an existing refresh token
8 changes: 8 additions & 0 deletions .changeset/modern-taxis-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/api-bindings": patch
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

feat: Expose `erc20Amount` helper to make working with API Amounts easier
13 changes: 13 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"changesets": [
"afraid-lemons-bathe",
"angry-seals-rush",
"blue-pets-poke",
"breezy-lizards-sell",
"brown-bears-repair",
Expand Down Expand Up @@ -57,6 +58,7 @@
"flat-boxes-work",
"fluffy-apricots-provide",
"forty-brooms-wonder",
"four-squids-clean",
"fresh-lamps-explain",
"friendly-monkeys-relax",
"friendly-planes-run",
Expand All @@ -70,13 +72,18 @@
"gold-radios-hunt",
"gorgeous-pigs-kneel",
"gorgeous-rice-trade",
"grumpy-bugs-sip",
"grumpy-coats-scream",
"happy-donuts-boil",
"happy-pumpkins-clean",
"heavy-dodos-raise",
"heavy-lizards-eat",
"heavy-terms-prove",
"hip-baboons-camp",
"hip-brooms-act",
"hip-buckets-tickle",
"honest-berries-fetch",
"honest-buses-flow",
"honest-drinks-try",
"hot-eels-divide",
"hot-hornets-drum",
Expand All @@ -98,6 +105,7 @@
"metal-cougars-train",
"mighty-planets-retire",
"modern-spies-confess",
"modern-taxis-share",
"nervous-papayas-design",
"new-doors-sip",
"new-moons-jog",
Expand All @@ -117,14 +125,17 @@
"poor-parrots-unite",
"popular-pants-look",
"pretty-parents-exist",
"quick-ads-press",
"quick-knives-tap",
"quiet-rules-pay",
"rare-birds-breathe",
"rude-suns-visit",
"serious-bats-shake",
"shaggy-carrots-cry",
"shaggy-colts-turn",
"sharp-snakes-push",
"shy-pugs-taste",
"silent-mangos-yawn",
"six-cherries-notice",
"six-feet-sparkle",
"six-flowers-smell",
Expand Down Expand Up @@ -162,7 +173,9 @@
"two-geese-protect",
"violet-ads-warn",
"violet-impalas-grab",
"wet-dogs-refuse",
"wicked-bobcats-joke",
"witty-roses-burn",
"yellow-cows-push",
"young-carrots-jump",
"young-jeans-reflect"
Expand Down
15 changes: 15 additions & 0 deletions .changeset/quick-ads-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@lens-protocol/client": minor
---

**feat**: added new methods:

- `feed.latestPaidActions`
- `profile.report`
- `profile.followStatusBulk`
- `nfts.collections`
- `nfts.collectionOwners`
- `nfts.mutualCollections`
- `nfts.popularCollections`

**breaking**: `nfts.fetch` doesn't require authentication, returns `Promise<PaginatedResult<NftFragment>>`
7 changes: 7 additions & 0 deletions .changeset/shaggy-colts-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**fixed:** return type of `useLazyModuleMetadata`
7 changes: 7 additions & 0 deletions .changeset/silent-mangos-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**fix:** exports missing `AsyncTransactionResult`
10 changes: 10 additions & 0 deletions .changeset/wet-dogs-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@lens-protocol/react": minor
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
"@lens-protocol/blockchain-bindings": patch
"@lens-protocol/api-bindings": patch
"@lens-protocol/client": patch
---

**feat:** support Unknown Follow Modules
7 changes: 7 additions & 0 deletions .changeset/witty-roses-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**fix:** exports missing `ProfileFields` type
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
Expand All @@ -31,7 +31,7 @@ jobs:
needs: install

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
Expand All @@ -57,7 +57,7 @@ jobs:
with:
swap-size-gb: 8

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
needs: [install, lint, test]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
Expand All @@ -107,7 +107,7 @@ jobs:
needs: [install, lint, test]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup pnpm for docs
uses: pnpm/[email protected]
Expand Down
5 changes: 0 additions & 5 deletions examples/node/scripts/authentication/authenticate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import { setupWallet } from '../shared/setupWallet';
async function main() {
const client = new LensClient({
environment: development,
headers: {
origin: 'https://lens-scripts.example',
'user-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
},
});

const wallet = setupWallet();
Expand Down
21 changes: 21 additions & 0 deletions examples/node/scripts/authentication/authenticateWith.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { LensClient, development } from '@lens-protocol/client';

async function main() {
const client = new LensClient({
environment: development,
});

const token = 'YOUR_VALID_REFRESH_TOKEN_HERE';
await client.authentication.authenticateWith({ refreshToken: token });

console.log(`Is LensClient authenticated? `, await client.authentication.isAuthenticated());

const accessTokenResult = await client.authentication.getAccessToken();
const accessToken = accessTokenResult.unwrap();
const profileId = await client.authentication.getProfileId();

console.log(`Authenticated profileId: `, profileId);
console.log(`Access token: `, accessToken);
}

main();
36 changes: 36 additions & 0 deletions examples/node/scripts/authentication/overwriteOrigin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { LensClient, development } from '@lens-protocol/client';

import { setupWallet } from '../shared/setupWallet';

async function main() {
const client = new LensClient({
environment: development,
headers: {
origin: 'https://lens-scripts.example',
},
});

const wallet = setupWallet();
const address = await wallet.getAddress();

const managedProfiles = await client.wallet.profilesManaged({ for: wallet.address });

if (managedProfiles.items.length === 0) {
throw new Error(`You don't manage any profiles, create one first`);
}

const { id, text } = await client.authentication.generateChallenge({
signedBy: address,
for: managedProfiles.items[0].id,
});

console.log(`Challenge: `, text); // Notice the origin URL in the challenge message

const signature = await wallet.signMessage(text);

await client.authentication.authenticate({ id, signature });

console.log(`Is LensClient authenticated? `, await client.authentication.isAuthenticated());
}

main();
27 changes: 27 additions & 0 deletions examples/node/scripts/feed/latestPaidActions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { isFollowPaidAction, isOpenActionPaidAction } from '@lens-protocol/client';

import { getAuthenticatedClient } from '../shared/getAuthenticatedClient';
import { setupWallet } from '../shared/setupWallet';

async function main() {
const wallet = setupWallet();
const client = await getAuthenticatedClient(wallet);

const result = await client.feed.latestPaidActions();

result.unwrap().items.map((item) => {
const actingProfileIds = item.latestActed.map((acted) => acted.profile.id).join(', ');

if (isFollowPaidAction(item)) {
console.log(`Profiles ${actingProfileIds} followed: ${item.followed.id}`);
}

if (isOpenActionPaidAction(item)) {
console.log(
`Profiles ${actingProfileIds} acted on: ${item.actedOn.__typename} ${item.actedOn.id}`,
);
}
});
}

main();
24 changes: 24 additions & 0 deletions examples/node/scripts/follow/followStatusBulk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { LensClient, development } from '@lens-protocol/client';

async function main() {
const client = new LensClient({
environment: development,
});

const result = await client.profile.followStatusBulk({
followInfos: [
{
follower: '0x06', // is 0x06 following 0x38?
profileId: '0x38',
},
{
follower: '0x38', // is 0x38 following 0x06?
profileId: '0x06',
},
],
});

console.log(`Result: `, result);
}

main();
Loading
Loading