casper-ecosystem / casper-js-sdk

TypeScript Casper Client SDK
Apache License 2.0
71 stars 60 forks source link

Export Result in sdk #219

Closed gRoussac closed 1 year ago

gRoussac commented 1 year ago

Hi, those lines in DeployUtil

export declare const deployFromJson: (json: any) => Result<Deploy, Error>;

export declare const validateDeploy: (deploy: Deploy) => Result<Deploy, string>;

return Result as type

and this type is not exported so in my app if I need to do

const signedDeploy: Result<DeployUtil.Deploy, Error> = DeployUtil.deployFromJson(signedDeployToJson);

then I need to import in my app

"ts-results": "npm:@casperlabs/ts-results@^3.3.4",

which is not ideal.

It's a bit sensitive, please check that it does not break anything.