Skip to content

Commit a43de1f

Browse files
committed
🔀 Merge branch 'release/0.0.3'
2 parents 3acc092 + 560c264 commit a43de1f

File tree

9 files changed

+33
-14
lines changed

9 files changed

+33
-14
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "🐛 Bug"
22
description: File a bug/issue
33
title: ":bug: <title>"
4-
labels: ["bug", "triage"]
5-
# projects: []
4+
labels: ["bug"]
5+
projects: ["cryptape/46"]
66
# assignees: []
77
body:
88
- type: markdown

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "✨ Feature"
22
description: Request a feature
33
title: ":sparkles: <title>"
4-
labels: ["feature", "triage"]
5-
# projects: []
4+
labels: ["enhancement"]
5+
projects: ["cryptape/46"]
66
# assignees: []
77
body:
88
- type: markdown

bin/deploy-to-dev-chain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -u
66

77
if ! [ -f build/release/joyid ]; then
88
echo "Expect the contract files in build/release" >&2
9-
echo "Run bin/download-joyid-cells.sh to download them from the testnet" >&2
9+
echo "Run bin/download-contracts.sh to download them from the testnet" >&2
1010
exit 1
1111
fi
1212

bin/download-contracts.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function download() {
1616
else
1717
ckb-cli --url "$CKB_URL" rpc get_live_cell --tx-hash "$tx_hash" --index "$index" --with-data |
1818
sed -n 's/^ *content: 0x//p' |
19-
xxd -r -ps >"$file_path"
19+
xxd -r -ps >"$file_path.tmp"
20+
# avoid partial downloaded files
21+
mv "$file_path.tmp" "$file_path"
2022
echo "$file_name downloaded"
2123
fi
2224
}
@@ -30,4 +32,4 @@ download joyid_dep3 0x95ecf9b41701b45d431657a67bbfa3f07ef7ceb53bf87097f3674e1a4a
3032
# download joyid_dep4 0x8f8c79eb6671709633fe6a46de93c0fedc9c1b8a6527a18d3983879542635c9f 3
3133
download joyid_dep5 0x8b3255491f3c4dcc1cfca33d5c6bcaec5409efe4bbda243900f9580c47e0242e 1
3234

33-
download omnilock 0xff234bf2fb0ad2ab5b356ceda317d3dee3efb2c55b9427ef55d9dcbf6eecbf9f 0
35+
download omnilock 0xb50ef6f2e9138f4dbca7d5280e10d29c1a65e60e8a574c009a2fa4e4107e0750 0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ckb-dao-cobuild-poc",
33
"type": "module",
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"private": true,
66
"scripts": {
77
"dev": "next dev",

src/lib/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const CKB_CHAINS_CONFIGS = {
2323
"0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb",
2424
HASH_TYPE: "type",
2525
TX_HASH:
26-
"0xff234bf2fb0ad2ab5b356ceda317d3dee3efb2c55b9427ef55d9dcbf6eecbf9f",
26+
"0xb50ef6f2e9138f4dbca7d5280e10d29c1a65e60e8a574c009a2fa4e4107e0750",
2727
INDEX: "0x0",
2828
DEP_TYPE: "code",
2929
},

src/lib/wallet/btc-wallet.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ export function btcAddressToCkbAddress(btcAddress, scriptInfo, ckbChainConfig) {
5959
});
6060
}
6161

62+
export const BTC_MESSAGE_PREFIX = "CKB (Bitcoin Layer-2) transaction: ";
63+
64+
export function prepareMessage(message) {
65+
return BTC_MESSAGE_PREFIX + message;
66+
}
67+
6268
export function didSign(btcAddress, signature) {
6369
if (isNativeSegwit(btcAddress)) {
6470
signature[0] = 39 + ((signature[0] - 27) % 4);

src/lib/wallet/okx.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { urlSafeBase64Decode } from "@/lib/base64";
2-
3-
import { didConnected, didSign, btcAddressToCkbAddress } from "./btc-wallet";
2+
import {
3+
btcAddressToCkbAddress,
4+
didConnected,
5+
didSign,
6+
prepareMessage,
7+
} from "./btc-wallet";
48

59
export const title = "OKX (BTC)";
610
export const lockScriptName = "Omnilock";
@@ -26,7 +30,9 @@ export function address(btcAddress, ckbChainConfig) {
2630

2731
export async function sign(btcAddress, message) {
2832
const signature = urlSafeBase64Decode(
29-
await okxwallet.bitcoin.signMessage(message.slice(2), { from: btcAddress }),
33+
await okxwallet.bitcoin.signMessage(prepareMessage(message), {
34+
from: btcAddress,
35+
}),
3036
);
3137
return didSign(btcAddress, signature);
3238
}

src/lib/wallet/unisat.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { urlSafeBase64Decode } from "@/lib/base64";
22

3-
import { didConnected, didSign, btcAddressToCkbAddress } from "./btc-wallet";
3+
import {
4+
prepareMessage,
5+
didConnected,
6+
didSign,
7+
btcAddressToCkbAddress,
8+
} from "./btc-wallet";
49

510
export const title = "UniSat (BTC)";
611
export const lockScriptName = "Omnilock";
@@ -25,7 +30,7 @@ export function address(btcAddress, ckbChainConfig) {
2530

2631
export async function sign(btcAddress, message) {
2732
const signature = urlSafeBase64Decode(
28-
await unisat.signMessage(message.slice(2)),
33+
await unisat.signMessage(prepareMessage(message)),
2934
);
3035
return didSign(btcAddress, signature);
3136
}

0 commit comments

Comments
 (0)