From 3b543a671a8e7e2284273c2fa90f7e180a214b87 Mon Sep 17 00:00:00 2001 From: jouzo Date: Mon, 2 Aug 2021 09:58:23 +0200 Subject: [PATCH] Fix and add documentation --- .../__tests__/category/spv/createHtlc.test.ts | 2 +- packages/jellyfish-api-core/src/category/spv.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jellyfish-api-core/__tests__/category/spv/createHtlc.test.ts b/packages/jellyfish-api-core/__tests__/category/spv/createHtlc.test.ts index 237dcb4196..030466d2a5 100644 --- a/packages/jellyfish-api-core/__tests__/category/spv/createHtlc.test.ts +++ b/packages/jellyfish-api-core/__tests__/category/spv/createHtlc.test.ts @@ -66,7 +66,7 @@ describe('Spv', () => { const pubKeyA = await container.call('spv_getaddresspubkey', [await container.call('spv_getnewaddress')]) const pubKeyB = await container.call('spv_getaddresspubkey', [await container.call('spv_getnewaddress')]) - const promise = client.spv.createHtlc(pubKeyA, pubKeyB, { timeout: '4194304' }) + const promise = client.spv.createHtlc(pubKeyA, pubKeyB, { timeout: '4194304' }) // SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22) await expect(promise).rejects.toThrow(RpcApiError) await expect(promise).rejects.toThrow("RpcApiError: 'Invalid block denominated relative timeout', code: -3, method: spv_createhtlc") }) diff --git a/packages/jellyfish-api-core/src/category/spv.ts b/packages/jellyfish-api-core/src/category/spv.ts index e1e3cfbefc..a2b79837cb 100644 --- a/packages/jellyfish-api-core/src/category/spv.ts +++ b/packages/jellyfish-api-core/src/category/spv.ts @@ -4,7 +4,7 @@ import BigNumber from 'bignumber.js' export const HTLC_MINIMUM_BLOCK_COUNT = 9 /** - * SPV RPCs for DeFi Blockchain + * SPV RPCs for Bitcoin Blockchain */ export class Spv { private readonly client: ApiClient @@ -62,7 +62,7 @@ export class Spv { * Creates a Bitcoin address whose funds can be unlocked with a seed or as a refund. * * @param {string} receiverPubKey The public key of the possessor of the seed - * @param {number} ownerPubKey The public key of the recipient of the refund + * @param {string} ownerPubKey The public key of the recipient of the refund * @param {CreateHtlcOptions} options * @param {string} options.timeout Timeout of the contract (denominated in blocks) relative to its placement in the blockchain. Minimum 9. See HTLC_MINIMUM_BLOCK_COUNT * @param {string} [options.seed] SHA256 hash of the seed. If none provided one will be generated