Skip to content

Commit 6ab3703

Browse files
committed
Add iconUrl support to deploy DTOs and entities; refine CEP-18 entry point validation logic
1 parent 043df32 commit 6ab3703

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/data/dto/deploys/CsprTransferDeployDto.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export class CsprTransferDeployDto implements INativeCsprDeploy {
108108
this.cep18ActionsResult = [];
109109
this.deployHash = data?.deploy_hash ?? '';
110110
this.id = getUniqueId();
111+
this.iconUrl = null;
111112
}
112113

113114
readonly recipientAccountInfo: Maybe<IAccountInfo>;
@@ -144,4 +145,5 @@ export class CsprTransferDeployDto implements INativeCsprDeploy {
144145
readonly cep18ActionsResult: ICep18ActionsResult[];
145146
readonly id: string;
146147
readonly deployHash: string;
148+
readonly iconUrl: Maybe<string>;
147149
}

src/data/dto/deploys/DeployDto.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export class DeployDto implements IDeploy {
5050
);
5151
this.contractHash = data?.contract_hash ?? '';
5252
this.contractPackageHash = data?.contract_package_hash ?? '';
53+
this.iconUrl = data?.contract_package?.icon_url ?? null;
5354
this.entryPoint = getEntryPoint(data) ?? null;
5455
this.contractName = data?.contract_package?.name ?? null;
5556

@@ -75,6 +76,7 @@ export class DeployDto implements IDeploy {
7576
readonly executionTypeId: number;
7677
readonly contractHash: string;
7778
readonly contractPackageHash: string;
79+
readonly iconUrl: Maybe<string>;
7880
readonly entryPoint: Maybe<string>;
7981
readonly status: DeployStatus;
8082
readonly cost: string;

src/data/dto/deploys/common.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
AccountKeyType,
1313
AssociatedKeysContractHash,
1414
AuctionManagerContractHash,
15+
CEP_18_ACTION_ENTRY_POINTS,
1516
CSPRMarketContractHash,
1617
CSPRStudioCep47ContractHash,
1718
DeployType,
@@ -41,8 +42,8 @@ export function getDeployType(network: Network, deploy?: Partial<ExtendedCloudDe
4142
) {
4243
return 'CSPR_MARKET';
4344
} else if (
44-
contractTypeId === ContractTypeId.CustomCep18 ||
45-
contractTypeId === ContractTypeId.Cep18
45+
(contractTypeId === ContractTypeId.CustomCep18 || contractTypeId === ContractTypeId.Cep18) &&
46+
CEP_18_ACTION_ENTRY_POINTS.includes(getEntryPoint(deploy) ?? '')
4647
) {
4748
return 'CEP18';
4849
} else if (

src/domain/deploys/entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface IDeploy extends IEntity {
3030
readonly executionTypeId: number;
3131
readonly contractHash: string;
3232
readonly contractPackageHash: string;
33+
readonly iconUrl: Maybe<string>;
3334

3435
readonly status: DeployStatus;
3536
readonly callerPublicKey: string;

0 commit comments

Comments
 (0)