From 15831211fb9d7fd85a6cbc34c78eedae3298fe4c Mon Sep 17 00:00:00 2001 From: Cesare Naldi Date: Wed, 15 May 2024 20:42:29 +0200 Subject: [PATCH] Adopt mintFee and updates node scripts --- examples/node/abi/PublicActProxy.json | 452 +++++++++++++++--- examples/node/contracts/PublicActProxy.ts | 140 +++++- .../factories/PublicActProxy__factory.ts | 296 +++++++++--- .../recipes/openActionWalletOnly.ts | 34 +- .../src/lens/graphql/fragments.graphql | 3 + .../src/lens/graphql/generated.ts | 276 ++++++++++- .../src/lens/utils/CollectModuleSettings.ts | 19 +- .../client/src/graphql/fragments.generated.ts | 154 ++++++ packages/client/src/graphql/fragments.graphql | 9 + .../client/src/graphql/types.generated.ts | 3 +- .../explore/graphql/explore.generated.ts | 21 + .../submodules/feed/graphql/feed.generated.ts | 105 ++++ .../graphql/notifications.generated.ts | 147 ++++++ .../graphql/publication.generated.ts | 42 ++ .../bookmarks/graphql/bookmarks.generated.ts | 21 + .../revenue/graphql/revenue.generated.ts | 63 +++ .../search/graphql/search.generated.ts | 21 + .../useApproveModule/token-allowance.ts | 22 +- .../useOpenAction/createOpenActionRequest.ts | 2 +- packages/shared-kernel/src/crypto/Asset.ts | 16 - 20 files changed, 1646 insertions(+), 200 deletions(-) diff --git a/examples/node/abi/PublicActProxy.json b/examples/node/abi/PublicActProxy.json index 4b44d7900b..c388925d37 100644 --- a/examples/node/abi/PublicActProxy.json +++ b/examples/node/abi/PublicActProxy.json @@ -1,109 +1,433 @@ [ { + "type": "constructor", "inputs": [ - { "internalType": "address", "name": "lensHub", "type": "address" }, - { "internalType": "address", "name": "collectPublicationAction", "type": "address" } + { + "name": "lensHub", + "type": "address", + "internalType": "address" + }, + { + "name": "collectPublicationAction", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "COLLECT_PUBLICATION_ACTION", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract CollectPublicationAction" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "HUB", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ILensHub" + } ], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "view" }, { - "inputs": [{ "internalType": "uint8", "name": "increment", "type": "uint8" }], + "type": "function", "name": "incrementNonce", + "inputs": [ + { + "name": "increment", + "type": "uint8", + "internalType": "uint8" + } + ], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], + "type": "function", "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "pure", - "type": "function" + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "pure" }, { - "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }], + "type": "function", "name": "nonces", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "inputs": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" }, { + "type": "function", + "name": "publicCollect", "inputs": [ { - "components": [ - { "internalType": "uint256", "name": "publicationActedProfileId", "type": "uint256" }, - { "internalType": "uint256", "name": "publicationActedId", "type": "uint256" }, - { "internalType": "uint256", "name": "actorProfileId", "type": "uint256" }, - { "internalType": "uint256[]", "name": "referrerProfileIds", "type": "uint256[]" }, - { "internalType": "uint256[]", "name": "referrerPubIds", "type": "uint256[]" }, - { "internalType": "address", "name": "actionModuleAddress", "type": "address" }, - { "internalType": "bytes", "name": "actionModuleData", "type": "bytes" } - ], - "internalType": "struct Types.PublicationActionParams", "name": "publicationActionParams", - "type": "tuple" + "type": "tuple", + "internalType": "struct Types.PublicationActionParams", + "components": [ + { + "name": "publicationActedProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "publicationActedId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "actorProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referrerProfileIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "referrerPubIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "actionModuleAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "actionModuleData", + "type": "bytes", + "internalType": "bytes" + } + ] } ], - "name": "publicCollect", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "publicCollectWithSig", "inputs": [ { - "components": [ - { "internalType": "uint256", "name": "publicationActedProfileId", "type": "uint256" }, - { "internalType": "uint256", "name": "publicationActedId", "type": "uint256" }, - { "internalType": "uint256", "name": "actorProfileId", "type": "uint256" }, - { "internalType": "uint256[]", "name": "referrerProfileIds", "type": "uint256[]" }, - { "internalType": "uint256[]", "name": "referrerPubIds", "type": "uint256[]" }, - { "internalType": "address", "name": "actionModuleAddress", "type": "address" }, - { "internalType": "bytes", "name": "actionModuleData", "type": "bytes" } - ], - "internalType": "struct Types.PublicationActionParams", "name": "publicationActionParams", - "type": "tuple" + "type": "tuple", + "internalType": "struct Types.PublicationActionParams", + "components": [ + { + "name": "publicationActedProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "publicationActedId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "actorProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referrerProfileIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "referrerPubIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "actionModuleAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "actionModuleData", + "type": "bytes", + "internalType": "bytes" + } + ] }, { - "components": [ - { "internalType": "address", "name": "signer", "type": "address" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" } - ], - "internalType": "struct Types.EIP712Signature", "name": "signature", - "type": "tuple" + "type": "tuple", + "internalType": "struct Types.EIP712Signature", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "deadline", + "type": "uint256", + "internalType": "uint256" + } + ] } ], - "name": "publicCollectWithSig", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "type": "function", + "name": "publicFreeAct", "inputs": [ { + "name": "publicationActionParams", + "type": "tuple", + "internalType": "struct Types.PublicationActionParams", "components": [ - { "internalType": "uint256", "name": "publicationActedProfileId", "type": "uint256" }, - { "internalType": "uint256", "name": "publicationActedId", "type": "uint256" }, - { "internalType": "uint256", "name": "actorProfileId", "type": "uint256" }, - { "internalType": "uint256[]", "name": "referrerProfileIds", "type": "uint256[]" }, - { "internalType": "uint256[]", "name": "referrerPubIds", "type": "uint256[]" }, - { "internalType": "address", "name": "actionModuleAddress", "type": "address" }, - { "internalType": "bytes", "name": "actionModuleData", "type": "bytes" } - ], + { + "name": "publicationActedProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "publicationActedId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "actorProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referrerProfileIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "referrerPubIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "actionModuleAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "actionModuleData", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "publicPaidAct", + "inputs": [ + { + "name": "publicationActionParams", + "type": "tuple", "internalType": "struct Types.PublicationActionParams", + "components": [ + { + "name": "publicationActedProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "publicationActedId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "actorProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referrerProfileIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "referrerPubIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "actionModuleAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "actionModuleData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "currency", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "approveTo", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "publicPaidActWithSig", + "inputs": [ + { "name": "publicationActionParams", - "type": "tuple" + "type": "tuple", + "internalType": "struct Types.PublicationActionParams", + "components": [ + { + "name": "publicationActedProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "publicationActedId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "actorProfileId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "referrerProfileIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "referrerPubIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "actionModuleAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "actionModuleData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "currency", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "approveTo", + "type": "address", + "internalType": "address" + }, + { + "name": "signature", + "type": "tuple", + "internalType": "struct Types.EIP712Signature", + "components": [ + { + "name": "signer", + "type": "address", + "internalType": "address" + }, + { + "name": "v", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "r", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "deadline", + "type": "uint256", + "internalType": "uint256" + } + ] } ], - "name": "publicFreeAct", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" } ] diff --git a/examples/node/contracts/PublicActProxy.ts b/examples/node/contracts/PublicActProxy.ts index 8c72e38dd3..9f2661ed13 100644 --- a/examples/node/contracts/PublicActProxy.ts +++ b/examples/node/contracts/PublicActProxy.ts @@ -71,24 +71,34 @@ export declare namespace Types { export interface PublicActProxyInterface extends utils.Interface { functions: { + 'COLLECT_PUBLICATION_ACTION()': FunctionFragment; + 'HUB()': FunctionFragment; 'incrementNonce(uint8)': FunctionFragment; 'name()': FunctionFragment; 'nonces(address)': FunctionFragment; 'publicCollect((uint256,uint256,uint256,uint256[],uint256[],address,bytes))': FunctionFragment; 'publicCollectWithSig((uint256,uint256,uint256,uint256[],uint256[],address,bytes),(address,uint8,bytes32,bytes32,uint256))': FunctionFragment; 'publicFreeAct((uint256,uint256,uint256,uint256[],uint256[],address,bytes))': FunctionFragment; + 'publicPaidAct((uint256,uint256,uint256,uint256[],uint256[],address,bytes),address,uint256,address)': FunctionFragment; + 'publicPaidActWithSig((uint256,uint256,uint256,uint256[],uint256[],address,bytes),address,uint256,address,(address,uint8,bytes32,bytes32,uint256))': FunctionFragment; }; getFunction( nameOrSignatureOrTopic: + | 'COLLECT_PUBLICATION_ACTION' + | 'HUB' | 'incrementNonce' | 'name' | 'nonces' | 'publicCollect' | 'publicCollectWithSig' - | 'publicFreeAct', + | 'publicFreeAct' + | 'publicPaidAct' + | 'publicPaidActWithSig', ): FunctionFragment; + encodeFunctionData(functionFragment: 'COLLECT_PUBLICATION_ACTION', values?: undefined): string; + encodeFunctionData(functionFragment: 'HUB', values?: undefined): string; encodeFunctionData( functionFragment: 'incrementNonce', values: [PromiseOrValue], @@ -107,13 +117,36 @@ export interface PublicActProxyInterface extends utils.Interface { functionFragment: 'publicFreeAct', values: [Types.PublicationActionParamsStruct], ): string; + encodeFunctionData( + functionFragment: 'publicPaidAct', + values: [ + Types.PublicationActionParamsStruct, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string; + encodeFunctionData( + functionFragment: 'publicPaidActWithSig', + values: [ + Types.PublicationActionParamsStruct, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + Types.EIP712SignatureStruct, + ], + ): string; + decodeFunctionResult(functionFragment: 'COLLECT_PUBLICATION_ACTION', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'HUB', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'incrementNonce', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'nonces', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'publicCollect', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'publicCollectWithSig', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'publicFreeAct', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'publicPaidAct', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'publicPaidActWithSig', data: BytesLike): Result; events: {}; } @@ -143,6 +176,10 @@ export interface PublicActProxy extends BaseContract { removeListener: OnEvent; functions: { + COLLECT_PUBLICATION_ACTION(overrides?: CallOverrides): Promise<[string]>; + + HUB(overrides?: CallOverrides): Promise<[string]>; + incrementNonce( increment: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue }, @@ -167,8 +204,29 @@ export interface PublicActProxy extends BaseContract { publicationActionParams: Types.PublicationActionParamsStruct, overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; + + publicPaidAct( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + publicPaidActWithSig( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + signature: Types.EIP712SignatureStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; }; + COLLECT_PUBLICATION_ACTION(overrides?: CallOverrides): Promise; + + HUB(overrides?: CallOverrides): Promise; + incrementNonce( increment: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue }, @@ -194,7 +252,28 @@ export interface PublicActProxy extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; + publicPaidAct( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + publicPaidActWithSig( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + signature: Types.EIP712SignatureStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + callStatic: { + COLLECT_PUBLICATION_ACTION(overrides?: CallOverrides): Promise; + + HUB(overrides?: CallOverrides): Promise; + incrementNonce( increment: PromiseOrValue, overrides?: CallOverrides, @@ -219,11 +298,32 @@ export interface PublicActProxy extends BaseContract { publicationActionParams: Types.PublicationActionParamsStruct, overrides?: CallOverrides, ): Promise; + + publicPaidAct( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + publicPaidActWithSig( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + signature: Types.EIP712SignatureStruct, + overrides?: CallOverrides, + ): Promise; }; filters: {}; estimateGas: { + COLLECT_PUBLICATION_ACTION(overrides?: CallOverrides): Promise; + + HUB(overrides?: CallOverrides): Promise; + incrementNonce( increment: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue }, @@ -248,9 +348,30 @@ export interface PublicActProxy extends BaseContract { publicationActionParams: Types.PublicationActionParamsStruct, overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; + + publicPaidAct( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + publicPaidActWithSig( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + signature: Types.EIP712SignatureStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; }; populateTransaction: { + COLLECT_PUBLICATION_ACTION(overrides?: CallOverrides): Promise; + + HUB(overrides?: CallOverrides): Promise; + incrementNonce( increment: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue }, @@ -278,5 +399,22 @@ export interface PublicActProxy extends BaseContract { publicationActionParams: Types.PublicationActionParamsStruct, overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; + + publicPaidAct( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + publicPaidActWithSig( + publicationActionParams: Types.PublicationActionParamsStruct, + currency: PromiseOrValue, + amount: PromiseOrValue, + approveTo: PromiseOrValue, + signature: Types.EIP712SignatureStruct, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; }; } diff --git a/examples/node/contracts/factories/PublicActProxy__factory.ts b/examples/node/contracts/factories/PublicActProxy__factory.ts index cb2e52efe4..d8e1d0d2ec 100644 --- a/examples/node/contracts/factories/PublicActProxy__factory.ts +++ b/examples/node/contracts/factories/PublicActProxy__factory.ts @@ -8,247 +8,435 @@ import type { PublicActProxy, PublicActProxyInterface } from '../PublicActProxy' const _abi = [ { + type: 'constructor', inputs: [ { - internalType: 'address', name: 'lensHub', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: 'collectPublicationAction', type: 'address', + internalType: 'address', }, ], stateMutability: 'nonpayable', - type: 'constructor', }, { + type: 'function', + name: 'COLLECT_PUBLICATION_ACTION', + inputs: [], + outputs: [ + { + name: '', + type: 'address', + internalType: 'contract CollectPublicationAction', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'HUB', + inputs: [], + outputs: [ + { + name: '', + type: 'address', + internalType: 'contract ILensHub', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'incrementNonce', inputs: [ { - internalType: 'uint8', name: 'increment', type: 'uint8', + internalType: 'uint8', }, ], - name: 'incrementNonce', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'name', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'pure', - type: 'function', }, { + type: 'function', + name: 'nonces', inputs: [ { - internalType: 'address', name: 'signer', type: 'address', + internalType: 'address', }, ], - name: 'nonces', outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'publicCollect', inputs: [ { + name: 'publicationActionParams', + type: 'tuple', + internalType: 'struct Types.PublicationActionParams', components: [ { - internalType: 'uint256', name: 'publicationActedProfileId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'publicationActedId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'actorProfileId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256[]', name: 'referrerProfileIds', type: 'uint256[]', + internalType: 'uint256[]', }, { - internalType: 'uint256[]', name: 'referrerPubIds', type: 'uint256[]', + internalType: 'uint256[]', }, { - internalType: 'address', name: 'actionModuleAddress', type: 'address', + internalType: 'address', }, { - internalType: 'bytes', name: 'actionModuleData', type: 'bytes', + internalType: 'bytes', }, ], - internalType: 'struct Types.PublicationActionParams', - name: 'publicationActionParams', - type: 'tuple', }, ], - name: 'publicCollect', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'publicCollectWithSig', inputs: [ { + name: 'publicationActionParams', + type: 'tuple', + internalType: 'struct Types.PublicationActionParams', components: [ { - internalType: 'uint256', name: 'publicationActedProfileId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'publicationActedId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'actorProfileId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256[]', name: 'referrerProfileIds', type: 'uint256[]', + internalType: 'uint256[]', }, { - internalType: 'uint256[]', name: 'referrerPubIds', type: 'uint256[]', + internalType: 'uint256[]', }, { - internalType: 'address', name: 'actionModuleAddress', type: 'address', + internalType: 'address', }, { - internalType: 'bytes', name: 'actionModuleData', type: 'bytes', + internalType: 'bytes', }, ], - internalType: 'struct Types.PublicationActionParams', - name: 'publicationActionParams', - type: 'tuple', }, { + name: 'signature', + type: 'tuple', + internalType: 'struct Types.EIP712Signature', components: [ { - internalType: 'address', name: 'signer', type: 'address', + internalType: 'address', }, { - internalType: 'uint8', name: 'v', type: 'uint8', + internalType: 'uint8', }, { - internalType: 'bytes32', name: 'r', type: 'bytes32', + internalType: 'bytes32', }, { - internalType: 'bytes32', name: 's', type: 'bytes32', + internalType: 'bytes32', }, { - internalType: 'uint256', name: 'deadline', type: 'uint256', + internalType: 'uint256', }, ], - internalType: 'struct Types.EIP712Signature', - name: 'signature', - type: 'tuple', }, ], - name: 'publicCollectWithSig', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'publicFreeAct', inputs: [ { + name: 'publicationActionParams', + type: 'tuple', + internalType: 'struct Types.PublicationActionParams', components: [ { - internalType: 'uint256', name: 'publicationActedProfileId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'publicationActedId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'actorProfileId', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256[]', name: 'referrerProfileIds', type: 'uint256[]', + internalType: 'uint256[]', }, { - internalType: 'uint256[]', name: 'referrerPubIds', type: 'uint256[]', + internalType: 'uint256[]', }, { - internalType: 'address', name: 'actionModuleAddress', type: 'address', + internalType: 'address', }, { - internalType: 'bytes', name: 'actionModuleData', type: 'bytes', + internalType: 'bytes', }, ], - internalType: 'struct Types.PublicationActionParams', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'publicPaidAct', + inputs: [ + { name: 'publicationActionParams', type: 'tuple', + internalType: 'struct Types.PublicationActionParams', + components: [ + { + name: 'publicationActedProfileId', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'publicationActedId', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'actorProfileId', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'referrerProfileIds', + type: 'uint256[]', + internalType: 'uint256[]', + }, + { + name: 'referrerPubIds', + type: 'uint256[]', + internalType: 'uint256[]', + }, + { + name: 'actionModuleAddress', + type: 'address', + internalType: 'address', + }, + { + name: 'actionModuleData', + type: 'bytes', + internalType: 'bytes', + }, + ], + }, + { + name: 'currency', + type: 'address', + internalType: 'address', + }, + { + name: 'amount', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'approveTo', + type: 'address', + internalType: 'address', }, ], - name: 'publicFreeAct', outputs: [], stateMutability: 'nonpayable', + }, + { type: 'function', + name: 'publicPaidActWithSig', + inputs: [ + { + name: 'publicationActionParams', + type: 'tuple', + internalType: 'struct Types.PublicationActionParams', + components: [ + { + name: 'publicationActedProfileId', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'publicationActedId', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'actorProfileId', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'referrerProfileIds', + type: 'uint256[]', + internalType: 'uint256[]', + }, + { + name: 'referrerPubIds', + type: 'uint256[]', + internalType: 'uint256[]', + }, + { + name: 'actionModuleAddress', + type: 'address', + internalType: 'address', + }, + { + name: 'actionModuleData', + type: 'bytes', + internalType: 'bytes', + }, + ], + }, + { + name: 'currency', + type: 'address', + internalType: 'address', + }, + { + name: 'amount', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'approveTo', + type: 'address', + internalType: 'address', + }, + { + name: 'signature', + type: 'tuple', + internalType: 'struct Types.EIP712Signature', + components: [ + { + name: 'signer', + type: 'address', + internalType: 'address', + }, + { + name: 'v', + type: 'uint8', + internalType: 'uint8', + }, + { + name: 'r', + type: 'bytes32', + internalType: 'bytes32', + }, + { + name: 's', + type: 'bytes32', + internalType: 'bytes32', + }, + { + name: 'deadline', + type: 'uint256', + internalType: 'uint256', + }, + ], + }, + ], + outputs: [], + stateMutability: 'nonpayable', }, ] as const; diff --git a/examples/node/scripts/publication/recipes/openActionWalletOnly.ts b/examples/node/scripts/publication/recipes/openActionWalletOnly.ts index 52234eb29c..235bc70861 100644 --- a/examples/node/scripts/publication/recipes/openActionWalletOnly.ts +++ b/examples/node/scripts/publication/recipes/openActionWalletOnly.ts @@ -10,7 +10,7 @@ dotenv.config(); const typedAbi = abi as ethers.ContractInterface; const publicActionProxyAddress = { - development: '0x88c8fa7C470d9d94aDfA40187157917B26A548d3', + development: '0x77706372deCeb81D49422F9115680B4873722AF1', production: '0x53582b1b7BE71622E7386D736b6baf87749B7a2B', }; @@ -52,36 +52,22 @@ async function main() { const { typedData } = resultTypedData.unwrap(); - // sign the typed data - const signedTypedData = await wallet._signTypedData( - typedData.domain, - typedData.types, - typedData.value, - ); - // init publicActProxy contract const publicActProxy = new ethers.Contract( publicActionProxyAddress.development, typedAbi, wallet, ) as PublicActProxy; - - // prepare data for the contract - const { v, r, s } = ethers.utils.splitSignature(signedTypedData); - // submit tx - const tx = await publicActProxy.publicCollectWithSig( - { - publicationActedProfileId: typedData.value.publicationActedProfileId, - publicationActedId: typedData.value.publicationActedId, - actorProfileId: typedData.value.actorProfileId, - referrerProfileIds: typedData.value.referrerProfileIds, - referrerPubIds: typedData.value.referrerPubIds, - actionModuleAddress: typedData.value.actionModuleAddress, - actionModuleData: typedData.value.actionModuleData, - }, - { signer: wallet.address, v, r, s, deadline: typedData.value.deadline }, - ); + const tx = await publicActProxy.publicFreeAct({ + publicationActedProfileId: typedData.value.publicationActedProfileId, + publicationActedId: typedData.value.publicationActedId, + actorProfileId: typedData.value.actorProfileId, + referrerProfileIds: typedData.value.referrerProfileIds, + referrerPubIds: typedData.value.referrerPubIds, + actionModuleAddress: typedData.value.actionModuleAddress, + actionModuleData: typedData.value.actionModuleData, + }); console.log(`Submitted a tx with a hash: `, tx.hash); diff --git a/packages/api-bindings/src/lens/graphql/fragments.graphql b/packages/api-bindings/src/lens/graphql/fragments.graphql index e22cfd1679..c23aa5ba76 100644 --- a/packages/api-bindings/src/lens/graphql/fragments.graphql +++ b/packages/api-bindings/src/lens/graphql/fragments.graphql @@ -479,6 +479,9 @@ fragment ProtocolSharedRevenueCollectOpenActionSettings on ProtocolSharedRevenue amount { ...Amount } + mintFee { + ...Amount + } recipient referralFee followerOnly diff --git a/packages/api-bindings/src/lens/graphql/generated.ts b/packages/api-bindings/src/lens/graphql/generated.ts index f9a0f7cf8a..6931f7871b 100644 --- a/packages/api-bindings/src/lens/graphql/generated.ts +++ b/packages/api-bindings/src/lens/graphql/generated.ts @@ -1459,7 +1459,6 @@ export type ProtocolSharedRevenueCollectModuleInput = { collectLimit?: InputMaybe; /** The wallet of a client app to share revenues alongside the recipient and the protocol. Optional. */ creatorClient?: InputMaybe; - currentCollects?: Scalars['Float']; endsAt?: InputMaybe; followerOnly: Scalars['Boolean']; recipient?: InputMaybe; @@ -1604,7 +1603,7 @@ export enum PublicationReportingIllegalSubreason { AnimalAbuse = 'ANIMAL_ABUSE', DirectThreat = 'DIRECT_THREAT', HumanAbuse = 'HUMAN_ABUSE', - Plagiarism = 'PLAGIARISM', + IntEllEctualProperty = 'INTEllECTUAL_PROPERTY', ThreatIndividual = 'THREAT_INDIVIDUAL', Violence = 'VIOLENCE', } @@ -2569,6 +2568,7 @@ export type ProtocolSharedRevenueCollectOpenActionSettings = { creatorClient: EvmAddress | null; contract: NetworkAddress; amount: Amount; + mintFee: Amount; }; export type Recipient = { recipient: EvmAddress; split: number }; @@ -31128,6 +31128,14 @@ export const FragmentProtocolSharedRevenueCollectOpenActionSettings = /*#__PURE_ selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -33889,6 +33897,14 @@ export const FragmentPost = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -39276,6 +39292,14 @@ export const FragmentQuoteFields = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -44718,6 +44742,14 @@ export const FragmentCommentFields = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -50852,6 +50884,14 @@ export const FragmentQuote = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -57629,6 +57669,14 @@ export const FragmentExplorePublication = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -64510,6 +64558,14 @@ export const FragmentComment = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -71337,6 +71393,14 @@ export const FragmentMirror = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -79288,6 +79352,14 @@ export const FragmentFeedItem = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -86271,6 +86343,14 @@ export const FragmentFeedHighlight = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -95142,6 +95222,14 @@ export const FragmentOpenActionPaidAction = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -102083,6 +102171,14 @@ export const FragmentAnyPublicationInternal = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -111453,6 +111549,14 @@ export const FragmentReactionNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -118396,6 +118500,14 @@ export const FragmentCommentNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -126252,6 +126364,14 @@ export const FragmentMirrorNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -133174,6 +133294,14 @@ export const FragmentQuoteNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -141234,6 +141362,14 @@ export const FragmentActedNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -149319,6 +149455,14 @@ export const FragmentMentionNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -156301,6 +156445,14 @@ export const FragmentNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -166999,6 +167151,14 @@ export const FragmentPublicationRevenue = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -175160,6 +175320,14 @@ export const ExplorePublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -183429,6 +183597,14 @@ export const FeedDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -190608,6 +190784,14 @@ export const FeedHighlightsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -197776,6 +197960,14 @@ export const LatestPaidActionsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -206936,6 +207128,14 @@ export const NotificationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -227360,6 +227560,14 @@ export const PublicationDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -234565,6 +234773,14 @@ export const PublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -241997,6 +242213,14 @@ export const PublicationBookmarksDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -254093,6 +254317,14 @@ export const RevenueFromPublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -261296,6 +261528,14 @@ export const RevenueFromPublicationDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -268835,6 +269075,14 @@ export const SearchPublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -282056,8 +282304,10 @@ export type ProtocolSharedRevenueCollectOpenActionSettingsKeySpecifier = ( | 'collectNft' | 'contract' | 'creatorClient' + | 'distribution' | 'endsAt' | 'followerOnly' + | 'mintFee' | 'recipient' | 'referralFee' | 'type' @@ -282069,12 +282319,27 @@ export type ProtocolSharedRevenueCollectOpenActionSettingsFieldPolicy = { collectNft?: FieldPolicy | FieldReadFunction; contract?: FieldPolicy | FieldReadFunction; creatorClient?: FieldPolicy | FieldReadFunction; + distribution?: FieldPolicy | FieldReadFunction; endsAt?: FieldPolicy | FieldReadFunction; followerOnly?: FieldPolicy | FieldReadFunction; + mintFee?: FieldPolicy | FieldReadFunction; recipient?: FieldPolicy | FieldReadFunction; referralFee?: FieldPolicy | FieldReadFunction; type?: FieldPolicy | FieldReadFunction; }; +export type ProtocolSharedRevenueDistributionKeySpecifier = ( + | 'creatorClientSplit' + | 'creatorSplit' + | 'executorClientSplit' + | 'protocolSplit' + | ProtocolSharedRevenueDistributionKeySpecifier +)[]; +export type ProtocolSharedRevenueDistributionFieldPolicy = { + creatorClientSplit?: FieldPolicy | FieldReadFunction; + creatorSplit?: FieldPolicy | FieldReadFunction; + executorClientSplit?: FieldPolicy | FieldReadFunction; + protocolSplit?: FieldPolicy | FieldReadFunction; +}; export type PublicationMarketplaceMetadataAttributeKeySpecifier = ( | 'displayType' | 'traitType' @@ -284552,6 +284817,13 @@ export type StrictTypedTypePolicies = { | (() => undefined | ProtocolSharedRevenueCollectOpenActionSettingsKeySpecifier); fields?: ProtocolSharedRevenueCollectOpenActionSettingsFieldPolicy; }; + ProtocolSharedRevenueDistribution?: Omit & { + keyFields?: + | false + | ProtocolSharedRevenueDistributionKeySpecifier + | (() => undefined | ProtocolSharedRevenueDistributionKeySpecifier); + fields?: ProtocolSharedRevenueDistributionFieldPolicy; + }; PublicationMarketplaceMetadataAttribute?: Omit & { keyFields?: | false diff --git a/packages/api-bindings/src/lens/utils/CollectModuleSettings.ts b/packages/api-bindings/src/lens/utils/CollectModuleSettings.ts index 2ff196e2a0..13aa8691f2 100644 --- a/packages/api-bindings/src/lens/utils/CollectModuleSettings.ts +++ b/packages/api-bindings/src/lens/utils/CollectModuleSettings.ts @@ -1,11 +1,4 @@ -import { - Amount, - ChainType, - Erc20Amount, - EvmAddress, - FiatAmount, - erc20, -} from '@lens-protocol/shared-kernel'; +import { Erc20Amount, EvmAddress, FiatAmount } from '@lens-protocol/shared-kernel'; import * as gql from '../graphql/generated'; import { OpenActionModuleSettings, PrimaryPublication } from '../publication'; @@ -205,15 +198,7 @@ function buildCollectFee( function buildMintFee( module: gql.ProtocolSharedRevenueCollectOpenActionSettings, ): SharedMintFee | null { - // TODO replace with data from `module` once available - const bonsai = erc20({ - address: '0x3d2bD0e15829AA5C362a4144FdF4A1112fa29B5c', - chainType: ChainType.POLYGON, - decimals: 18, - name: 'BONSAI', - symbol: 'BONSAI', - }); - const amount = Amount.erc20(bonsai, 10); + const amount = erc20Amount(module.mintFee); if (amount.isZero()) return null; diff --git a/packages/client/src/graphql/fragments.generated.ts b/packages/client/src/graphql/fragments.generated.ts index 8f12556934..c04f2687aa 100644 --- a/packages/client/src/graphql/fragments.generated.ts +++ b/packages/client/src/graphql/fragments.generated.ts @@ -297,6 +297,13 @@ export type ProtocolSharedRevenueCollectOpenActionSettingsFragment = { creatorClient: string | null; contract: NetworkAddressFragment; amount: AmountFragment; + distribution: { + creatorClientSplit: number; + creatorSplit: number; + executorClientSplit: number; + protocolSplit: number; + }; + mintFee: AmountFragment; }; export type MultirecipientFeeCollectOpenActionSettingsFragment = { @@ -27638,6 +27645,27 @@ export const ProtocolSharedRevenueCollectOpenActionSettingsFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -30351,6 +30379,27 @@ export const PostFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -35855,6 +35904,27 @@ export const CommentBaseFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -41252,6 +41322,27 @@ export const QuoteBaseFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -46167,6 +46258,27 @@ export const CommentFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -53008,6 +53120,27 @@ export const QuoteFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -59849,6 +59982,27 @@ export const MirrorFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/client/src/graphql/fragments.graphql b/packages/client/src/graphql/fragments.graphql index a9e44ef4b1..db005e8766 100644 --- a/packages/client/src/graphql/fragments.graphql +++ b/packages/client/src/graphql/fragments.graphql @@ -454,6 +454,15 @@ fragment ProtocolSharedRevenueCollectOpenActionSettings on ProtocolSharedRevenue amount { ...Amount } + distribution { + creatorClientSplit + creatorSplit + executorClientSplit + protocolSplit + } + mintFee { + ...Amount + } recipient referralFee followerOnly diff --git a/packages/client/src/graphql/types.generated.ts b/packages/client/src/graphql/types.generated.ts index 1d3e80d272..de92ded3df 100644 --- a/packages/client/src/graphql/types.generated.ts +++ b/packages/client/src/graphql/types.generated.ts @@ -1449,7 +1449,6 @@ export type ProtocolSharedRevenueCollectModuleInput = { collectLimit?: InputMaybe; /** The wallet of a client app to share revenues alongside the recipient and the protocol. Optional. */ creatorClient?: InputMaybe; - currentCollects?: Scalars['Float']['input']; endsAt?: InputMaybe; followerOnly: Scalars['Boolean']['input']; recipient?: InputMaybe; @@ -1594,7 +1593,7 @@ export enum PublicationReportingIllegalSubreason { AnimalAbuse = 'ANIMAL_ABUSE', DirectThreat = 'DIRECT_THREAT', HumanAbuse = 'HUMAN_ABUSE', - Plagiarism = 'PLAGIARISM', + IntEllEctualProperty = 'INTEllECTUAL_PROPERTY', ThreatIndividual = 'THREAT_INDIVIDUAL', Violence = 'VIOLENCE', } diff --git a/packages/client/src/submodules/explore/graphql/explore.generated.ts b/packages/client/src/submodules/explore/graphql/explore.generated.ts index 6aa6aaa724..0d3e5741ed 100644 --- a/packages/client/src/submodules/explore/graphql/explore.generated.ts +++ b/packages/client/src/submodules/explore/graphql/explore.generated.ts @@ -5553,6 +5553,27 @@ export const ExplorePublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/client/src/submodules/feed/graphql/feed.generated.ts b/packages/client/src/submodules/feed/graphql/feed.generated.ts index bc7dfea1ae..02300e7579 100644 --- a/packages/client/src/submodules/feed/graphql/feed.generated.ts +++ b/packages/client/src/submodules/feed/graphql/feed.generated.ts @@ -6453,6 +6453,27 @@ export const FeedItemFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -15438,6 +15459,27 @@ export const OpenActionPaidActionFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -22627,6 +22669,27 @@ export const FeedDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -29832,6 +29895,27 @@ export const FeedHighlightsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -37001,6 +37085,27 @@ export const LatestPaidActionsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/client/src/submodules/notifications/graphql/notifications.generated.ts b/packages/client/src/submodules/notifications/graphql/notifications.generated.ts index 2ac63bf6e2..11159f08d3 100644 --- a/packages/client/src/submodules/notifications/graphql/notifications.generated.ts +++ b/packages/client/src/submodules/notifications/graphql/notifications.generated.ts @@ -5497,6 +5497,27 @@ export const ReactionNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -12452,6 +12473,27 @@ export const CommentNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -19381,6 +19423,27 @@ export const MirrorNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -26336,6 +26399,27 @@ export const QuoteNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -34290,6 +34374,27 @@ export const ActedNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -42282,6 +42387,27 @@ export const MentionNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -49844,6 +49970,27 @@ export const NotificationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/client/src/submodules/publication/graphql/publication.generated.ts b/packages/client/src/submodules/publication/graphql/publication.generated.ts index 8433419839..d9395c4c9d 100644 --- a/packages/client/src/submodules/publication/graphql/publication.generated.ts +++ b/packages/client/src/submodules/publication/graphql/publication.generated.ts @@ -6981,6 +6981,27 @@ export const PublicationDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -14200,6 +14221,27 @@ export const PublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts b/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts index efcb81b410..a508c29178 100644 --- a/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts +++ b/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts @@ -5583,6 +5583,27 @@ export const PublicationBookmarksDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/client/src/submodules/revenue/graphql/revenue.generated.ts b/packages/client/src/submodules/revenue/graphql/revenue.generated.ts index 81215790eb..28137039d7 100644 --- a/packages/client/src/submodules/revenue/graphql/revenue.generated.ts +++ b/packages/client/src/submodules/revenue/graphql/revenue.generated.ts @@ -5618,6 +5618,27 @@ export const PublicationRevenueFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -12880,6 +12901,27 @@ export const RevenueFromPublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, @@ -20129,6 +20171,27 @@ export const RevenueFromPublicationDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/client/src/submodules/search/graphql/search.generated.ts b/packages/client/src/submodules/search/graphql/search.generated.ts index 04d2090c12..cb7a3a9697 100644 --- a/packages/client/src/submodules/search/graphql/search.generated.ts +++ b/packages/client/src/submodules/search/graphql/search.generated.ts @@ -5569,6 +5569,27 @@ export const SearchPublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'distribution' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'creatorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'creatorSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'executorClientSplit' } }, + { kind: 'Field', name: { kind: 'Name', value: 'protocolSplit' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'mintFee' }, + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Amount' } }], + }, + }, { kind: 'Field', name: { kind: 'Name', value: 'recipient' } }, { kind: 'Field', name: { kind: 'Name', value: 'referralFee' } }, { kind: 'Field', name: { kind: 'Name', value: 'followerOnly' } }, diff --git a/packages/react/src/transactions/useApproveModule/token-allowance.ts b/packages/react/src/transactions/useApproveModule/token-allowance.ts index 6f5fd5ec44..e3b13a8c54 100644 --- a/packages/react/src/transactions/useApproveModule/token-allowance.ts +++ b/packages/react/src/transactions/useApproveModule/token-allowance.ts @@ -11,15 +11,7 @@ import { TokenAllowanceLimit, TokenAllowanceRequest, } from '@lens-protocol/domain/use-cases/transactions'; -import { - Amount, - ChainType, - Erc20Amount, - EvmAddress, - erc20, - invariant, - never, -} from '@lens-protocol/shared-kernel'; +import { Erc20Amount, EvmAddress, invariant, never } from '@lens-protocol/shared-kernel'; import { SessionType } from '../../authentication'; @@ -32,16 +24,8 @@ function createTokenAllowanceRequest( }; } -function buildMintFeeAmount(_module: ProtocolSharedRevenueCollectOpenActionSettings): Erc20Amount { - // TODO replace with data from `_module` once available - const bonsai = erc20({ - address: '0x3d2bD0e15829AA5C362a4144FdF4A1112fa29B5c', - chainType: ChainType.POLYGON, - decimals: 18, - name: 'BONSAI', - symbol: 'BONSAI', - }); - return Amount.erc20(bonsai, 10); +function buildMintFeeAmount(module: ProtocolSharedRevenueCollectOpenActionSettings): Erc20Amount { + return erc20Amount(module.mintFee); } export type ResolveTokenAllowanceRequestForCollectArgs = { diff --git a/packages/react/src/transactions/useOpenAction/createOpenActionRequest.ts b/packages/react/src/transactions/useOpenAction/createOpenActionRequest.ts index cc941dd38f..5027458e0b 100644 --- a/packages/react/src/transactions/useOpenAction/createOpenActionRequest.ts +++ b/packages/react/src/transactions/useOpenAction/createOpenActionRequest.ts @@ -205,7 +205,7 @@ function resolveUnknownRequestFor( target.openActionModules?.find( (entry): entry is UnknownOpenActionModuleSettings => isUnknownOpenActionModuleSettings(entry) && entry.contract.address === params.address, - ) ?? never(`Cannot find Open Action settings ${params.address} fro publication ${target.id}`); + ) ?? never(`Cannot find Open Action settings ${params.address} in publication ${target.id}`); return { kind: TransactionKind.ACT_ON_PUBLICATION, diff --git a/packages/shared-kernel/src/crypto/Asset.ts b/packages/shared-kernel/src/crypto/Asset.ts index 0d3d4e1a35..2c679f77b8 100644 --- a/packages/shared-kernel/src/crypto/Asset.ts +++ b/packages/shared-kernel/src/crypto/Asset.ts @@ -237,22 +237,6 @@ export function erc20({ name, decimals, symbol, address, chainType }: Erc20Info) return immutable(asset.hash, asset); } -/** - * Bonsai asset factory function. - * - * @param info - {@link Erc20Info} details - * @returns An Erc20 asset instance. - */ -export function bonsai(address: EvmAddress) { - return erc20({ - address, - chainType: ChainType.POLYGON, - decimals: 18, - name: 'BONSAI', - symbol: 'BONSAI', - }); -} - /** * Matic asset provider function. *