CodeChain-io/codechain-sdk-js

Some type declarations are wrong.

Closed this issue · 1 comments

  • The parameter of AssetMintOutput.fromJSON is not declared as JSON object.
    public static fromJSON(data: {
    lockScriptHash: string;
    parameters: Buffer[];
    amount: number | null;
  • The parameter of AssetTransferOutput.fromJSON is not declared as JSON object.
    public static fromJSON(data: AssetTransferOutputData) {
  • output field of the parameter of AssetMintTransaction should not be a AssetMintOutput
    constructor(data: {
    networkId: NetworkId;
    shardId: number;
    metadata: string;
    output: AssetMintOutput;
    registrar: PlatformAddress | null;
    nonce: number;
    }) {
    const { networkId, shardId, metadata, output, registrar, nonce } = data;
    this.networkId = networkId;
    this.shardId = shardId;
    this.metadata = metadata;
    this.output = new AssetMintOutput(output);
    this.registrar = registrar;
    this.nonce = nonce;
    }

Fixed at: #253

Regarding the third item, I changed the constructor implementation instead of changing the type.
(e9e7bd5#diff-f2ab1e482bebb9418aec037539b0b051L82)