Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-core",
"version": "14.0.3",
"version": "14.1.0-beta.0",
"description": "MultiversX SDK for JavaScript and TypeScript",
"author": "MultiversX",
"homepage": "https://multiversx.com",
Expand Down
20 changes: 8 additions & 12 deletions src/abi/smartContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ import {
} from "./interface";
import { NativeSerializer } from "./nativeSerializer";
import { Query } from "./query";
import { EndpointDefinition, TypedValue } from "./typesystem";

interface IAbi {
constructorDefinition: EndpointDefinition;

getEndpoints(): EndpointDefinition[];
getEndpoint(name: string | ContractFunction): EndpointDefinition;
}
import { Abi, EndpointDefinition, TypedValue } from "./typesystem";

/**
* * @deprecated component. Use "SmartContractTransactionsFactory" or "SmartContractController", instead.
Expand All @@ -35,7 +28,7 @@ interface IAbi {
*/
export class SmartContract implements ISmartContract {
private address: Address = Address.empty();
private abi?: IAbi;
private abi?: Abi;

/**
* This object contains a function for each endpoint defined by the contract.
Expand All @@ -55,7 +48,7 @@ export class SmartContract implements ISmartContract {
/**
* Create a SmartContract object by providing its address on the Network.
*/
constructor(options: { address?: Address; abi?: IAbi } = {}) {
constructor(options: { address?: Address; abi?: Abi } = {}) {
this.address = options.address || Address.empty();
this.abi = options.abi;

Expand Down Expand Up @@ -105,13 +98,16 @@ export class SmartContract implements ISmartContract {
return this.address;
}

private getAbi(): IAbi {
private getAbi(): Abi {
guardValueIsSet("abi", this.abi);
return this.abi!;
}

getEndpoint(name: string | ContractFunction): EndpointDefinition {
return this.getAbi().getEndpoint(name);
if (typeof name === "string") {
return this.getAbi().getEndpoint(name);
}
return this.getAbi().getEndpoint(name.name);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from "./accounts";
export * from "./core";
export * from "./delegation";
export * from "./entrypoints";
export * from "./multisig";
export * from "./networkProviders";
export * from "./smartContracts";
export * from "./tokenManagement";
Expand Down
3 changes: 3 additions & 0 deletions src/multisig/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./multisigTransactionsFactory";
export * from "./proposeTransferExecuteContractInput";
export * from "./resources";
Loading
Loading