您现在的位置:kastop>> Kas信息 Kaspa网络>>正文内容

Kaspa address验证

the way that I create address object


const addressRegex = new RegExp(/(kaspa|kaspatest):\S+/i);

const addressArg = ‘kaspa:xxxxx’ ?? positionals.find((positional) => addressRegex.test(positional)) ?? null;

const address = addressArg === null ? null : new Address(addressArg);


There is Address::validate() static fn for address validation.


let isValid = Address::validate("kaspa:invalid-address");


Static  validate

validate(address): boolean

Parameters

Returns boolean

Defined in web/kaspa/kaspa.d.ts:4564

address: string


感动 同情 无聊 愤怒 搞笑 难过 高兴 路过
【字体: 】【收藏】【打印文章】 【 打赏 】 【查看评论

相关文章

    没有相关内容