From 17a4c19f25a3d9d71f67acdcfefe1ce157a55557 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 16 Jun 2022 13:32:44 +0000 Subject: [PATCH 1/9] chore(deps): update dependency prettier to v2.7.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4c24854..155e6f0 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "eslint-plugin-import": "2.26.0", "eslint-plugin-prettier": "4.0.0", "husky": "8.0.1", - "prettier": "2.7.0", + "prettier": "2.7.1", "ts-node": "10.8.1", "tslib": "2.4.0", "typescript": "4.7.3" diff --git a/yarn.lock b/yarn.lock index 03d8b23..9cca5e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1490,10 +1490,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.0.tgz#a4fdae07e5596c51c9857ea676cd41a0163879d6" - integrity sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ== +prettier@2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== punycode@^2.1.0: version "2.1.1" From a062982668d421a79cc785092dbb608a746581bf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 16 Jun 2022 13:33:01 +0000 Subject: [PATCH 2/9] fix(deps): update dependency @nervina-labs/cota-sdk to v0.6.0 --- example/aggregator/package.json | 2 +- example/aggregator/yarn.lock | 8 ++++---- example/mainnet/package.json | 2 +- example/mainnet/yarn.lock | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/aggregator/package.json b/example/aggregator/package.json index e06ec67..0eaf07a 100644 --- a/example/aggregator/package.json +++ b/example/aggregator/package.json @@ -8,7 +8,7 @@ "build": "tsc" }, "dependencies": { - "@nervina-labs/cota-sdk": "0.5.6", + "@nervina-labs/cota-sdk": "0.6.0", "@types/node": "17.0.21", "ts-node": "10.8.1", "tslib": "2.4.0", diff --git a/example/aggregator/yarn.lock b/example/aggregator/yarn.lock index 7b77e3a..46480e9 100644 --- a/example/aggregator/yarn.lock +++ b/example/aggregator/yarn.lock @@ -27,10 +27,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@nervina-labs/cota-sdk@0.5.6": - version "0.5.6" - resolved "https://registry.yarnpkg.com/@nervina-labs/cota-sdk/-/cota-sdk-0.5.6.tgz#942d9e69b5f39dcdd23bf28e7d7ed7e0b345100a" - integrity sha512-xCTswdASpZWQ2lxZBl4IsQmA1m1RcA+kruCdZoi2zlEJwnG1Y4mV4BbDECbMKecwlBY02z2PEsF6HWDyjVhpnA== +"@nervina-labs/cota-sdk@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@nervina-labs/cota-sdk/-/cota-sdk-0.6.0.tgz#5fa479ef96946f818e19c07f54726c1890db9de0" + integrity sha512-dEztdIMqR3si2rH26QlzXbSf3kr8fKHsgxyRq/1IsSAR7ykyG5Xae9wE+wook9BYbDBEfti+bXe/nHIggUvrYQ== dependencies: "@nervosnetwork/ckb-sdk-core" "^0.103.0" "@nervosnetwork/ckb-sdk-utils" "^0.103.0" diff --git a/example/mainnet/package.json b/example/mainnet/package.json index 2338f53..96ffc38 100644 --- a/example/mainnet/package.json +++ b/example/mainnet/package.json @@ -4,6 +4,6 @@ "description": "The examples for mainnet", "license": "MIT", "dependencies": { - "@nervina-labs/cota-sdk": "0.5.6" + "@nervina-labs/cota-sdk": "0.6.0" } } \ No newline at end of file diff --git a/example/mainnet/yarn.lock b/example/mainnet/yarn.lock index f3fe6da..c067a9e 100644 --- a/example/mainnet/yarn.lock +++ b/example/mainnet/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@nervina-labs/cota-sdk@0.5.6": - version "0.5.6" - resolved "https://registry.yarnpkg.com/@nervina-labs/cota-sdk/-/cota-sdk-0.5.6.tgz#942d9e69b5f39dcdd23bf28e7d7ed7e0b345100a" - integrity sha512-xCTswdASpZWQ2lxZBl4IsQmA1m1RcA+kruCdZoi2zlEJwnG1Y4mV4BbDECbMKecwlBY02z2PEsF6HWDyjVhpnA== +"@nervina-labs/cota-sdk@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@nervina-labs/cota-sdk/-/cota-sdk-0.6.0.tgz#5fa479ef96946f818e19c07f54726c1890db9de0" + integrity sha512-dEztdIMqR3si2rH26QlzXbSf3kr8fKHsgxyRq/1IsSAR7ykyG5Xae9wE+wook9BYbDBEfti+bXe/nHIggUvrYQ== dependencies: "@nervosnetwork/ckb-sdk-core" "^0.103.0" "@nervosnetwork/ckb-sdk-utils" "^0.103.0" From 29e195738a977f26c1b633fa68716f5df1440b18 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Jun 2022 20:42:26 +0000 Subject: [PATCH 3/9] chore(deps): update dependency typescript to v4.7.4 --- example/aggregator/package.json | 2 +- example/aggregator/yarn.lock | 8 ++++---- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/aggregator/package.json b/example/aggregator/package.json index 0eaf07a..494b9a1 100644 --- a/example/aggregator/package.json +++ b/example/aggregator/package.json @@ -12,6 +12,6 @@ "@types/node": "17.0.21", "ts-node": "10.8.1", "tslib": "2.4.0", - "typescript": "4.7.3" + "typescript": "4.7.4" } } \ No newline at end of file diff --git a/example/aggregator/yarn.lock b/example/aggregator/yarn.lock index 46480e9..f790565 100644 --- a/example/aggregator/yarn.lock +++ b/example/aggregator/yarn.lock @@ -346,10 +346,10 @@ type-fest@^1.2.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== -typescript@4.7.3: - version "4.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" - integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== +typescript@4.7.4: + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== v8-compile-cache-lib@^3.0.1: version "3.0.1" diff --git a/package.json b/package.json index 155e6f0..0d2c78b 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "prettier": "2.7.1", "ts-node": "10.8.1", "tslib": "2.4.0", - "typescript": "4.7.3" + "typescript": "4.7.4" }, "homepage": "https://github.com/nervina-labs/cota-sdk-js#readme" } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 9cca5e5..3a1ff7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1723,10 +1723,10 @@ type-fest@^1.2.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== -typescript@4.7.3: - version "4.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" - integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== +typescript@4.7.4: + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== unbox-primitive@^1.0.1: version "1.0.1" From 7ff75c4f0868267ef8ccf1a55f4311fdfb8b32a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 19:30:26 +0000 Subject: [PATCH 4/9] chore(deps): update dependency @typescript-eslint/parser to v5.29.0 --- package.json | 2 +- yarn.lock | 58 ++++++++++++++++++++++++++-------------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 0d2c78b..fe07cba 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "devDependencies": { "@types/crypto-js": "4.1.1", "@types/node": "17.0.31", - "@typescript-eslint/parser": "5.28.0", + "@typescript-eslint/parser": "5.29.0", "babel-eslint": "10.1.0", "eslint": "8.14.0", "eslint-config-prettier": "8.5.0", diff --git a/yarn.lock b/yarn.lock index 3a1ff7d..a0556d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -252,48 +252,48 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.31.tgz#a5bb84ecfa27eec5e1c802c6bbf8139bdb163a5d" integrity sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q== -"@typescript-eslint/parser@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.28.0.tgz#639b101cad2bfb7ae16e69710ac95c42bd4eae33" - integrity sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA== - dependencies: - "@typescript-eslint/scope-manager" "5.28.0" - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/typescript-estree" "5.28.0" +"@typescript-eslint/parser@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.29.0.tgz#41314b195b34d44ff38220caa55f3f93cfca43cf" + integrity sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw== + dependencies: + "@typescript-eslint/scope-manager" "5.29.0" + "@typescript-eslint/types" "5.29.0" + "@typescript-eslint/typescript-estree" "5.29.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.28.0.tgz#ef9a5c68fecde72fd2ff8a84b9c120324826c1b9" - integrity sha512-LeBLTqF/he1Z+boRhSqnso6YrzcKMTQ8bO/YKEe+6+O/JGof9M0g3IJlIsqfrK/6K03MlFIlycbf1uQR1IjE+w== +"@typescript-eslint/scope-manager@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.29.0.tgz#2a6a32e3416cb133e9af8dcf54bf077a916aeed3" + integrity sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA== dependencies: - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/visitor-keys" "5.28.0" + "@typescript-eslint/types" "5.29.0" + "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/types@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.28.0.tgz#cffd9bcdce28db6daaa146e48a0be4387a6f4e9d" - integrity sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA== +"@typescript-eslint/types@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" + integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/typescript-estree@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz#3487d158d091ca2772b285e67412ff6d9797d863" - integrity sha512-9GX+GfpV+F4hdTtYc6OV9ZkyYilGXPmQpm6AThInpBmKJEyRSIjORJd1G9+bknb7OTFYL+Vd4FBJAO6T78OVqA== +"@typescript-eslint/typescript-estree@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz#e83d19aa7fd2e74616aab2f25dfbe4de4f0b5577" + integrity sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ== dependencies: - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/visitor-keys" "5.28.0" + "@typescript-eslint/types" "5.29.0" + "@typescript-eslint/visitor-keys" "5.29.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz#982bb226b763c48fc1859a60de33fbf939d40a0f" - integrity sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA== +"@typescript-eslint/visitor-keys@5.29.0": + version "5.29.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.29.0.tgz#7a4749fa7ef5160c44a451bf060ac1dc6dfb77ee" + integrity sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ== dependencies: - "@typescript-eslint/types" "5.28.0" + "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" acorn-jsx@^5.3.1: From 5dcb774af78cb53b840e476a70322c9a19d21225 Mon Sep 17 00:00:00 2001 From: duanyytop Date: Wed, 22 Jun 2022 11:58:52 +0800 Subject: [PATCH 5/9] chore: Update tx fee --- package.json | 2 +- src/constants/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 04c2fb8..08f1352 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nervina-labs/cota-sdk", - "version": "0.5.6", + "version": "0.5.7", "description": "The SDK of CoTA", "repository": "git@github.com:nervina-labs/cota-sdk-js.git", "author": "duanyytop ", diff --git a/src/constants/index.ts b/src/constants/index.ts index 42c1234..c7bcefc 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,4 +1,4 @@ -export const FEE = BigInt(160000) +export const FEE = BigInt(30000) export const MIN_CAPACITY = BigInt(61) * BigInt(100000000) const TestnetInfo = { From bbd8a816fc6406b499957cc35811aa9d0188fd17 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 22 Jun 2022 20:54:51 +0800 Subject: [PATCH 6/9] fix: Set empty witness 0x --- src/service/cota/claim-update.ts | 2 +- src/service/cota/claim.ts | 2 +- src/service/cota/define.ts | 2 +- src/service/cota/isssuer.ts | 2 +- src/service/cota/mint.ts | 8 ++++---- src/service/cota/transfer-update.ts | 2 +- src/service/cota/transfer.ts | 2 +- src/service/cota/update.ts | 2 +- src/service/cota/withdraw.ts | 2 +- src/service/registry/index.ts | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/service/cota/claim-update.ts b/src/service/cota/claim-update.ts index caaa4f4..aa87c10 100644 --- a/src/service/cota/claim-update.ts +++ b/src/service/cota/claim-update.ts @@ -56,7 +56,7 @@ export const generateClaimUpdateCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x07${claimUpdateSmtEntry}`, outputType: '' }, + i > 0 ? '0x' : { lock: '', inputType: `0x07${claimUpdateSmtEntry}`, outputType: '' }, ) return rawTx } diff --git a/src/service/cota/claim.ts b/src/service/cota/claim.ts index eb11cda..bfebd7c 100644 --- a/src/service/cota/claim.ts +++ b/src/service/cota/claim.ts @@ -56,7 +56,7 @@ export const generateClaimCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x04${claimSmtEntry}`, outputType: '' }, + i > 0 ? '0x' : { lock: '', inputType: `0x04${claimSmtEntry}`, outputType: '' }, ) return rawTx } diff --git a/src/service/cota/define.ts b/src/service/cota/define.ts index 938a6a2..18a59ab 100644 --- a/src/service/cota/define.ts +++ b/src/service/cota/define.ts @@ -84,7 +84,7 @@ export const generateDefineCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x01${defineSmtEntry}`, outputType: generateCotaMetadata(cotaInfo, cotaId) }, + i > 0 ? '0x' : { lock: '', inputType: `0x01${defineSmtEntry}`, outputType: generateCotaMetadata(cotaInfo, cotaId) }, ) return { rawTx, cotaId } } diff --git a/src/service/cota/isssuer.ts b/src/service/cota/isssuer.ts index a81b51b..dfbcfd7 100644 --- a/src/service/cota/isssuer.ts +++ b/src/service/cota/isssuer.ts @@ -54,7 +54,7 @@ export const generateIssuerInfoTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: '', outputType: generateIssuerMetadata(issuerInfo) }, + i > 0 ? '0x' : { lock: '', inputType: '', outputType: generateIssuerMetadata(issuerInfo) }, ) return rawTx } diff --git a/src/service/cota/mint.ts b/src/service/cota/mint.ts index 720a75e..9461d70 100644 --- a/src/service/cota/mint.ts +++ b/src/service/cota/mint.ts @@ -28,14 +28,14 @@ export const generateMintCotaTx = async ( outputs[0].capacity = `0x${(BigInt(outputs[0].capacity) - fee).toString(16)}` const cotaId = append0x(mintCotaInfo.cotaId) - + let withdrawals = mintCotaInfo.withdrawals const isTokenIndexNull = withdrawals.some(withdrawal => withdrawal.tokenIndex == null || withdrawal.tokenIndex === '') if (isTokenIndexNull) { - const { issued } = await service.aggregator.getDefineInfo({cotaId}) + const { issued } = await service.aggregator.getDefineInfo({ cotaId }) withdrawals = withdrawals.map((withdrawal, index) => ({ ...withdrawal, - tokenIndex: append0x(u32ToBe(issued + index)) + tokenIndex: append0x(u32ToBe(issued + index)), })) } @@ -62,7 +62,7 @@ export const generateMintCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x02${mintSmtEntry}`, outputType: '' }, + i > 0 ? '0x' : { lock: '', inputType: `0x02${mintSmtEntry}`, outputType: '' }, ) return rawTx } diff --git a/src/service/cota/transfer-update.ts b/src/service/cota/transfer-update.ts index a4b7a2a..f06c714 100644 --- a/src/service/cota/transfer-update.ts +++ b/src/service/cota/transfer-update.ts @@ -57,7 +57,7 @@ export const generateTransferUpdateCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x08${transferUpdateSmtEntry}`, outputType: '' }, + i > 0 ? '0x' : { lock: '', inputType: `0x08${transferUpdateSmtEntry}`, outputType: '' }, ) return rawTx } diff --git a/src/service/cota/transfer.ts b/src/service/cota/transfer.ts index 1c86ed7..eeb8296 100644 --- a/src/service/cota/transfer.ts +++ b/src/service/cota/transfer.ts @@ -55,7 +55,7 @@ export const generateTransferCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x06${transferSmtEntry}`, outputType: '' }, + i > 0 ? '0x' : { lock: '', inputType: `0x06${transferSmtEntry}`, outputType: '' }, ) return rawTx } diff --git a/src/service/cota/update.ts b/src/service/cota/update.ts index 6fd4875..3016762 100644 --- a/src/service/cota/update.ts +++ b/src/service/cota/update.ts @@ -40,7 +40,7 @@ export const generateUpdateCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x05${updateSmtEntry}`, outputType: '' }, + i > 0 ? '0x' : { lock: '', inputType: `0x05${updateSmtEntry}`, outputType: '' }, ) return rawTx } diff --git a/src/service/cota/withdraw.ts b/src/service/cota/withdraw.ts index b91a6f3..57741f3 100644 --- a/src/service/cota/withdraw.ts +++ b/src/service/cota/withdraw.ts @@ -43,7 +43,7 @@ export const generateWithdrawCotaTx = async ( witnesses: [], } rawTx.witnesses = rawTx.inputs.map((_, i) => - i > 0 ? '' : { lock: '', inputType: `0x03${withdrawalSmtEntry}`, outputType: '' }, + i > 0 ? '0x' : { lock: '', inputType: `0x03${withdrawalSmtEntry}`, outputType: '' }, ) return rawTx } diff --git a/src/service/registry/index.ts b/src/service/registry/index.ts index 69de0bd..7c61d42 100644 --- a/src/service/registry/index.ts +++ b/src/service/registry/index.ts @@ -92,6 +92,6 @@ export const generateRegisterCotaTx = async ( } const registryWitness = serializeWitnessArgs({ lock: '', inputType: append0x(registrySmtEntry), outputType: '' }) const emptyWitness = { lock: '', inputType: '', outputType: '' } - rawTx.witnesses = rawTx.inputs.map((_, i) => (i === 0 ? registryWitness : i === 1 ? emptyWitness : '')) + rawTx.witnesses = rawTx.inputs.map((_, i) => (i === 0 ? registryWitness : i === 1 ? emptyWitness : '0x')) return rawTx } From 90ba99a878bee6511a5cc5bed0d08ef98db6cbbc Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 22 Jun 2022 20:55:39 +0800 Subject: [PATCH 7/9] chore: Bump to v0.5.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 08f1352..074acc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nervina-labs/cota-sdk", - "version": "0.5.7", + "version": "0.5.8", "description": "The SDK of CoTA", "repository": "git@github.com:nervina-labs/cota-sdk-js.git", "author": "duanyytop ", From 7c7ae0db83d54941ee74abdc5f28d875ed015221 Mon Sep 17 00:00:00 2001 From: duanyytop Date: Wed, 29 Jun 2022 16:26:15 +0800 Subject: [PATCH 8/9] chore: Update mainnet deployment --- src/constants/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/index.ts b/src/constants/index.ts index df5dea6..7881614 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -45,7 +45,7 @@ const MainnetInfo = { } as CKBComponents.Script, CotaTypeDep: { - outPoint: { txHash: '0x207c0ab1a25f63198c0cb73a9f201585ac39619e0a32cb2339e7cd95858dbe72', index: '0x0' }, + outPoint: { txHash: '0x875db3381ebe7a730676c110e1c0d78ae1bdd0c11beacb7db4db08e368c2cd95', index: '0x0' }, depType: 'depGroup', } as CKBComponents.CellDep, From 98897a6976097f8b83a996d50c2d613de8a47d4b Mon Sep 17 00:00:00 2001 From: duanyytop Date: Wed, 29 Jun 2022 16:27:13 +0800 Subject: [PATCH 9/9] chore: Bump to v0.6.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fe07cba..74c0bda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nervina-labs/cota-sdk", - "version": "0.6.0", + "version": "0.6.1", "description": "The SDK of CoTA", "repository": "git@github.com:nervina-labs/cota-sdk-js.git", "author": "duanyytop ",