Skip to content

Commit

Permalink
chore: removes mention of APP_NOT_ALLOWED broadcasst error reason
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi committed May 9, 2024
1 parent 0f65f90 commit 59aba76
Show file tree
Hide file tree
Showing 29 changed files with 3 additions and 184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export type RequestFallback = AnyTransactionRequestModel;
export enum BroadcastingErrorReason {
/**
* The app is not whitelisted to use gasless transactions.
*
* @deprecated This error reason is not longer used and will be removed in the future.
*/
APP_NOT_ALLOWED = 'APP_NOT_ALLOWED',
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ describe(`Given an instance of the ${MomokaRelayer.name}`, () => {
});

describe.only.each([
{
broadcastResult: mockRelayErrorFragment(RelayErrorReasonType.AppNotAllowed),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
broadcastResult: mockRelayErrorFragment(RelayErrorReasonType.NotSponsored),
reason: BroadcastingErrorReason.NOT_SPONSORED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ describe(`Given an instance of the ${OnChainRelayer.name}`, () => {
});

describe.only.each([
{
broadcastResult: mockRelayErrorFragment(RelayErrorReasonType.AppNotAllowed),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
broadcastResult: mockRelayErrorFragment(RelayErrorReasonType.NotSponsored),
reason: BroadcastingErrorReason.NOT_SPONSORED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,6 @@ describe(`Given an instance of ${OpenActionGateway.name}`, () => {

describe(`when creating any ${NativeTransaction.name}`, () => {
describe.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ describe(`Given an instance of ${CreateMomokaCommentGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ describe(`Given an instance of ${CreateMomokaMirrorGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ describe(`Given an instance of ${CreateMomokaPostGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ describe(`Given an instance of ${CreateMomokaQuoteGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ describe(`Given an instance of ${CreateOnChainCommentGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ describe(`Given an instance of ${CreateOnChainMirrorGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ describe(`Given an instance of ${CreateOnChainPostGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ describe(`Given an instance of ${CreateOnChainQuoteGateway.name}`, () => {
});

it.each([
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.AppNotAllowed,
),
reason: BroadcastingErrorReason.APP_NOT_ALLOWED,
},
{
relayError: mockLensProfileManagerRelayError(
LensProfileManagerRelayErrorReasonType.NoLensManagerEnabled,
Expand Down
4 changes: 0 additions & 4 deletions packages/react/src/transactions/adapters/relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ export function handleRelayError(
_?: unknown,
): Failure<BroadcastingError> {
switch (error.reason) {
case RelayErrorReasonType.AppNotAllowed:
case LensProfileManagerRelayErrorReasonType.AppNotAllowed:
return failure(new BroadcastingError(BroadcastingErrorReason.APP_NOT_ALLOWED));

case RelayErrorReasonType.RateLimited:
case LensProfileManagerRelayErrorReasonType.RateLimited:
return failure(new BroadcastingError(BroadcastingErrorReason.RATE_LIMITED));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export type CreateCommentArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down Expand Up @@ -407,7 +406,6 @@ export type CreateCommentArgs = {
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand Down Expand Up @@ -440,11 +438,6 @@ export type CreateCommentArgs = {
* }
* ```
*
* We omitted the handling of the {@link BroadcastingErrorReason.APP_NOT_ALLOWED} error because it's usually
* something that builder will face when deploying their app to production using the Production Lens API.
*
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
* ## Momoka comments
*
* For a comment to be hosted on Momoka it must meet the following criteria:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export type CreateMirrorArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down Expand Up @@ -194,7 +193,6 @@ export type CreateMirrorArgs = {
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand Down Expand Up @@ -224,12 +222,6 @@ export type CreateMirrorArgs = {
* }
* ```
*
* We omitted the handling of the {@link BroadcastingErrorReason.APP_NOT_ALLOWED} error because it's usually
* something that builder will face when deploying their app to production using the Production Lens API.
*
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
*
* @category Publications
* @group Hooks
*/
Expand Down
7 changes: 0 additions & 7 deletions packages/react/src/transactions/publications/useCreatePost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export type CreatePostArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down Expand Up @@ -375,7 +374,6 @@ export type CreatePostArgs = {
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand Down Expand Up @@ -406,11 +404,6 @@ export type CreatePostArgs = {
* }
* ```
*
* We omitted the handling of the {@link BroadcastingErrorReason.APP_NOT_ALLOWED} error because it's usually
* something that builder will face when deploying their app to production using the Production Lens API.
*
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
* ## Momoka posts
*
* For a post to be hosted on Momoka it must meet the following criteria:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export type CreateQuoteArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down Expand Up @@ -385,7 +384,6 @@ export type CreateQuoteArgs = {
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand Down Expand Up @@ -418,11 +416,6 @@ export type CreateQuoteArgs = {
* }
* ```
*
* We omitted the handling of the {@link BroadcastingErrorReason.APP_NOT_ALLOWED} error because it's usually
* something that builder will face when deploying their app to production using the Production Lens API.
*
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
* ## Create an app-specific quote
*
* You can create a comment that is specific to an app by defining the `appId` when creating the comment metadata.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export type OptimisticCreatePostArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down
10 changes: 1 addition & 9 deletions packages/react/src/transactions/useBlockProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type BlockProfileArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down Expand Up @@ -193,7 +193,6 @@ export type BlockProfileArgs = {
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand Down Expand Up @@ -224,13 +223,6 @@ export type BlockProfileArgs = {
* }
* }
* ```
*
* In this example we omitted {@link BroadcastingErrorReason.APP_NOT_ALLOWED} as it's not normally a problem per-se.
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
* You can still include it in your fallback logic if you want to. For example to unblock testing your app from a domain that is not the
* whitelisted one (e.g. localhost).
*
*/
export function useBlockProfiles(): UseDeferredTask<
AsyncTransactionResult<void>,
Expand Down
8 changes: 0 additions & 8 deletions packages/react/src/transactions/useFollow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export type FollowArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down Expand Up @@ -260,7 +259,6 @@ export type FollowArgs = {
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand All @@ -284,12 +282,6 @@ export type FollowArgs = {
* }
* ```
*
* In this example we omitted {@link BroadcastingErrorReason.APP_NOT_ALLOWED} as it's not normally a problem per-se.
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
* You can still include it in your fallback logic if you want to. For example to unblock testing your app from a domain that is not the
* whitelisted one (e.g. localhost).
*
* @category Profiles
* @group Hooks
*/
Expand Down
9 changes: 0 additions & 9 deletions packages/react/src/transactions/useLinkHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export type LinkHandleArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down Expand Up @@ -172,7 +171,6 @@ export type LinkHandleArgs = {
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand Down Expand Up @@ -203,13 +201,6 @@ export type LinkHandleArgs = {
* }
* }
* ```
*
* In this example we omitted {@link BroadcastingErrorReason.APP_NOT_ALLOWED} as it's not normally a problem per-se.
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
* You can still include it in your fallback logic if you want to. For example to unblock testing your app from a domain that is not the
* whitelisted one (e.g. localhost).
*
*/
export function useLinkHandle(): UseDeferredTask<
AsyncTransactionResult<void>,
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/transactions/useOpenAction/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export type OpenActionArgs = {
* See {@link BroadcastingError} with:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* If not specified, or `true`, the hook will attempt a Sponsored Transaction.
* Set it to `false` to force it to use a Self-Funded Transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ export type OpenActionAsyncResult = AsyncTransactionResult<void>;
* If for some reason the Lens API cannot sponsor the transaction, the hook will fail with a {@link BroadcastingError} with one of the following reasons:
* - {@link BroadcastingErrorReason.NOT_SPONSORED} - the profile is not sponsored
* - {@link BroadcastingErrorReason.RATE_LIMITED} - the profile reached the rate limit
* - {@link BroadcastingErrorReason.APP_NOT_ALLOWED} - the app is not whitelisted for gasless transactions
*
* In those cases you can retry the transaction as self-funded like in the following example:
*
Expand All @@ -239,12 +238,6 @@ export type OpenActionAsyncResult = AsyncTransactionResult<void>;
* }
* ```
*
* In this example we omitted {@link BroadcastingErrorReason.APP_NOT_ALLOWED} as it's not normally a problem per-se.
* It just requires the app to apply for whitelisting. See https://docs.lens.xyz/docs/gasless-and-signless#whitelisting-your-app.
*
* You can still include it in your fallback logic if you want to. For example to unblock testing your app from a domain that is not the
* whitelisted one (e.g. localhost).
*
* @category Publications
* @group Hooks
*/
Expand Down
Loading

0 comments on commit 59aba76

Please sign in to comment.