Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArConnect 1.17.0 #448

Merged
merged 49 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b8c91f2
fix: updated copy for permissions
nicholaswma Jul 9, 2024
0e02410
fix: updated quick settings permissions titles
nicholaswma Jul 10, 2024
4f3433c
feat: Add edit permissions screen
pawanpaudel93 Jul 10, 2024
ceb033d
feat(wallet): add validation for key length during import
pawanpaudel93 Jul 10, 2024
c9f8c52
fix: check bits only after logged in
pawanpaudel93 Jul 10, 2024
22c5b23
refactor: Place common modal components in single component
pawanpaudel93 Jul 10, 2024
7c4b4e5
feat: add screen 1 permission
nicholaswma Jul 10, 2024
44d1643
fix: re-added title removed misc
nicholaswma Jul 10, 2024
1b3efe5
chore: converted permissions page to component
nicholaswma Jul 10, 2024
989bb8b
fix: changes made for Permissions component
nicholaswma Jul 11, 2024
7859f81
Merge branch 'chore/permission-component' of https://github.com/arcon…
nicholaswma Jul 11, 2024
9f03b90
refactor: Reuse getWalletKeyLength function
pawanpaudel93 Jul 11, 2024
9d11e93
refactor: Import from correct component
pawanpaudel93 Jul 11, 2024
663b2a9
fix: enabled permissions component
nicholaswma Jul 11, 2024
d0deebc
feat(wallet): add validation for key length during wallet generation
pawanpaudel93 Jul 11, 2024
781325d
fix: Update matches logic for password
pawanpaudel93 Jul 11, 2024
6ed2cc8
refactor: Add loading spinner to Next button in backup page
pawanpaudel93 Jul 11, 2024
ec6ed15
refactor: Retry generating wallet if imported from seedphrase on bits…
pawanpaudel93 Jul 11, 2024
ad72c2c
fix: removed placeholder misc fixes
nicholaswma Jul 11, 2024
d10b56c
chore: removed unused route
nicholaswma Jul 11, 2024
52bf07e
fix: removed excess messaging
nicholaswma Jul 11, 2024
c1f02c4
chore: added error messaging, updated mismatch analytics
nicholaswma Jul 12, 2024
c5358cc
Merge pull request #435 from arconnectio/arc-420/permissions-screen-1
nicholaswma Jul 12, 2024
85bdc73
Merge pull request #431 from arconnectio/arc-419/update-settings-copy
nicholaswma Jul 12, 2024
1c119d8
feat(keystone): support ao signing
soralit Jun 27, 2024
4c8028d
feat(keystone): wait for transaction prepared for keystone
soralit Jun 28, 2024
8bbcd6c
feat(keystone): support sign ao transfer via api for dapps
soralit Jul 8, 2024
208f144
refactor: add long wait msg and auto-retry for seedphrase
pawanpaudel93 Jul 12, 2024
0968ff5
fix: Use wallet ref
pawanpaudel93 Jul 12, 2024
37f4a03
fix: Make sure tab cannot be closed before wallet is created
pawanpaudel93 Jul 12, 2024
cf4ac3a
Merge pull request #436 from arconnectio/arc-416-new-wallet-creation-…
pawanpaudel93 Jul 12, 2024
735665a
Merge branch 'development' into arc-422-import-wallet-creation-error
pawanpaudel93 Jul 12, 2024
1be6577
Revert "feat: updated permissions screen"
nicholaswma Jul 12, 2024
1046699
Merge pull request #438 from arconnectio/revert-435-arc-420/permissio…
nicholaswma Jul 12, 2024
a9e4eb0
Merge pull request #437 from arconnectio/arc-424/error-messaging-sda-…
nicholaswma Jul 12, 2024
0b035c3
Merge branch 'development' of https://github.com/arconnectio/ArConnec…
nicholaswma Jul 12, 2024
42df190
fix: messages
nicholaswma Jul 12, 2024
3133d62
Merge pull request #433 from arconnectio/arc-422-import-wallet-creati…
nicholaswma Jul 12, 2024
beb6c21
Merge pull request #440 from arconnectio/development
nicholaswma Jul 12, 2024
93f1bf3
chore: removed console logs
nicholaswma Jul 13, 2024
1d58f95
Merge pull request #411 from KeystoneHQ/keystone-ao
nicholaswma Jul 13, 2024
84b39ae
Merge pull request #441 from arconnectio/keystone-ao
nicholaswma Jul 13, 2024
4974ce5
Merge pull request #442 from arconnectio/development
nicholaswma Jul 13, 2024
ed8039c
fix: confirm button stuck on disabeled
nicholaswma Jul 15, 2024
e96cfce
fix: arc 427 delay error messaging on send screen
nicholaswma Jul 15, 2024
2042aa7
fix: arc-426 update messaging
nicholaswma Jul 15, 2024
0b7075c
Merge pull request #444 from arconnectio/fix/disabeled-error
nicholaswma Jul 15, 2024
356cdaa
Merge pull request #445 from arconnectio/fix/ao-error-messaging
nicholaswma Jul 15, 2024
5bb86e2
Merge pull request #446 from arconnectio/development
nicholaswma Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 47 additions & 11 deletions assets/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
"message": "Hide",
"description": "Hide text"
},
"close": {
"message": "Close",
"description": "Close button text"
},
"retry": {
"message": "Retry",
"description": "Retry button text"
},
"save": {
"message": "Save",
"description": "Save button text"
},
"add_wallet": {
"message": "Add wallet",
"description": "Add a wallet text"
Expand Down Expand Up @@ -248,39 +260,39 @@
"description": "Send transaction button"
},
"permissionDescriptionAccessAddress": {
"message": "Access the current address selected in ArConnect",
"message": "Allows access to the active address",
"description": "Description for the \"ACCESS_ADDRESS\" permission"
},
"permissionDescriptionAccessPublicKey": {
"message": "Access the public key of the current address selected in ArConnect",
"message": "Allows access to the active address public key",
"description": "Description for the \"ACCESS_PUBLIC_KEY\" permission"
},
"permissionDescriptionAccessAllAddresses": {
"message": "Access all addresses added to ArConnect",
"message": "Allows access to all the active and non-active wallet addresses",
"description": "Description for the \"ACCESS_ALL_ADDRESSES\" permission"
},
"permissionDescriptionSign": {
"message": "Sign a transaction",
"message": "Allows the signing of a transaction.",
"description": "Description for the \"SIGN_TRANSACTION\" permission"
},
"permissionDescriptionEncrypt": {
"message": "Encrypt data using the user's keyfile",
"message": "Allows encrypting data using wallet's keyfile. It does not grant access to keyfile.",
"description": "Description for the \"ENCRYPT\" permission"
},
"permissionDescriptionDecrypt": {
"message": "Decrypt data using the user's keyfile",
"message": "Allows decrypting data using wallet's keyfile. It does not grant access to keyfile.",
"description": "Description for the \"DECRYPT\" permission"
},
"permissionDescriptionSignature": {
"message": "Sign data using the user's keyfile",
"message": "Allows the signing of data.",
"description": "Description for the \"SIGNATURE\" permission"
},
"permissionDescriptionArweaveConfig": {
"message": "Access the user's custom Arweave config",
"message": "Access read access to ArConnect configuration file",
"description": "Description for the \"ACCESS_ARWEAVE_CONFIG\" permission"
},
"permissionDescriptionDispatch": {
"message": "Dispatch an Arweave transaction or interaction",
"message": "Allows using dispatch transactions.",
"description": "Description for the \"DISPATCH\" permission"
},
"copyId": {
Expand Down Expand Up @@ -665,6 +677,18 @@
"message": "Error exporting wallet",
"description": "Wallet export error notification"
},
"import_wallet_key_length_short_error_title": {
"message": "Key Length Too Short",
"description": "Key Length Too Short error title"
},
"import_wallet_key_length_short_error": {
"message": "The key length of the wallet you are importing is less than the required length to transact on the AO network. It is recommended you create a new ArConnect wallet and transfer your assets to your new wallet.",
"description": "Key Length Too Short error"
},
"generate_wallet_in_progress": {
"message": "The wallet creation process can take 30-60 seconds.",
"description": "Generate wallet in progresss text"
},
"development_version": {
"message": "Development",
"description": "Development version badge text"
Expand Down Expand Up @@ -779,6 +803,10 @@
"message": "Generating wallet...",
"description": "Generating wallet in progress text"
},
"longer_than_usual": {
"message": "Please wait, this is taking longer than usual...",
"description": "Longer than usual text"
},
"keyfile": {
"message": "Keyfile",
"description": "Keyfile text"
Expand Down Expand Up @@ -1909,11 +1937,11 @@
"description": "Popup description about ao token transfer learn more"
},
"ao_degraded": {
"message": "AO Token Process Network Degraded.",
"message": "Unable to connect to AO Token Process",
"description": "ao degraded title text"
},
"ao_degraded_description": {
"message": "AO token process will be available when <br/>the network issues are resolved.",
"message": "AO balance will be available when <br/>network issues are resolved.",
"description": "ao degraded description text"
},
"network_issue": {
Expand Down Expand Up @@ -2109,5 +2137,13 @@
"incorrect_password_error_message": {
"message": "Password incorrect. Please enter the password to your ArConnect and try again. Not the password to the wallet you are importing.",
"description": "Error message if password is incorrect"
},
"mismatch_warning_title": {
"message": "Wallet Mismatch Detected.",
"description": "Title for wallet mismatch warning on sda"
},
"mismatch_warning": {
"message": "Your wallet has a mismatched bit length. You can proceed, but may encounter errors. Transactions could fail or behave unexpectedly.",
"description": "warning for mismatch wallet"
}
}
58 changes: 47 additions & 11 deletions assets/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
"message": "隐藏",
"description": "Hide text"
},
"close": {
"message": "关闭",
"description": "Close button text"
},
"retry": {
"message": "重试",
"description": "Retry button text"
},
"save": {
"message": "节省",
"description": "Save button text"
},
"add_wallet": {
"message": "添加钱包",
"description": "Add a wallet text"
Expand Down Expand Up @@ -248,39 +260,39 @@
"description": "Send transaction button"
},
"permissionDescriptionAccessAddress": {
"message": "访问 ArConnect 中选择的当前地址",
"message": "允许访问活动地址",
"description": "Description for the \"ACCESS_ADDRESS\" permission"
},
"permissionDescriptionAccessPublicKey": {
"message": "访问 ArConnect 中选择的当前地址的公钥",
"message": "允许访问活动地址的公钥",
"description": "Description for the \"ACCESS_PUBLIC_KEY\" permission"
},
"permissionDescriptionAccessAllAddresses": {
"message": "访问添加到 ArConnect 的所有地址",
"message": "允许访问所有活动和非活动钱包地址",
"description": "Description for the \"ACCESS_ALL_ADDRESSES\" permission"
},
"permissionDescriptionSign": {
"message": "签署交易",
"message": "允许签署交易。",
"description": "Description for the \"SIGN_TRANSACTION\" permission"
},
"permissionDescriptionEncrypt": {
"message": "使用用户的密钥文件加密数据",
"message": "允许使用钱包的密钥文件加密数据。这并不授予对密钥文件的访问权限",
"description": "Description for the \"ENCRYPT\" permission"
},
"permissionDescriptionDecrypt": {
"message": "使用用户的密钥文件解密数据",
"message": "允许使用钱包的密钥文件解密数据。这并不授予对密钥文件的访问权限",
"description": "Description for the \"DECRYPT\" permission"
},
"permissionDescriptionSignature": {
"message": "使用用户的密钥文件签署数据",
"message": "允许签署数据。",
"description": "Description for the \"SIGNATURE\" permission"
},
"permissionDescriptionArweaveConfig": {
"message": "访问用户的自定义 Arweave 配置",
"message": "允许读取 ArConnect 配置文件",
"description": "Description for the \"ACCESS_ARWEAVE_CONFIG\" permission"
},
"permissionDescriptionDispatch": {
"message": "发送 Arweave 交易或互动",
"message": "允许使用调度交易。",
"description": "Description for the \"DISPATCH\" permission"
},
"copyId": {
Expand Down Expand Up @@ -665,6 +677,18 @@
"message": "导出钱包出错",
"description": "Wallet export error notification"
},
"import_wallet_key_length_short_error_title": {
"message": "密钥长度太短",
"description": "Key Length Too Short error"
},
"import_wallet_key_length_short_error": {
"message": "您导入的钱包的密钥长度小于在 AO 网络上进行交易所需的长度。建议您创建一个新的ArConnect钱包,并将您的资产转移到新钱包中。",
"description": "Key Length Too Short error"
},
"generate_wallet_in_progress": {
"message": "钱包创建过程可能需要 30-60 秒。",
"description": "Generate wallet in progresss text"
},
"development_version": {
"message": "开发版本",
"description": "Development version badge text"
Expand Down Expand Up @@ -779,6 +803,10 @@
"message": "生成钱包中...",
"description": "Generating wallet in progress text"
},
"longer_than_usual": {
"message": "请稍等,这比平常需要更长的时间...",
"description": "Longer than usual text"
},
"keyfile": {
"message": "密钥文件",
"description": "Keyfile text"
Expand Down Expand Up @@ -1907,11 +1935,11 @@
"description": "Popup description about ao token transfer learn more"
},
"ao_degraded": {
"message": "AO 代币处理网络降级。",
"message": "无法连接到 AO 令牌进程",
"description": "ao degraded title text"
},
"ao_degraded_description": {
"message": "网络问题解决后,AO 代币处理将可用。",
"message": "网络问题解决后,AO 余额将可用。",
"description": "ao degraded description text"
},
"network_issue": {
Expand Down Expand Up @@ -2103,5 +2131,13 @@
"incorrect_password_error_message": {
"message": "密码错误。请输入 ArConnect 的密码后再试,而不是您正在导入的钱包密码。",
"description": "Error message if password is incorrect"
},
"mismatch_warning_title": {
"message": "检测到钱包不匹配。",
"description": "Title for wallet mismatch warning on sda"
},
"mismatch_warning": {
"message": "您的钱包存在不匹配的位长度。您可以继续操作,但可能会遇到错误。交易可能会失败或表现异常。",
"description": "warning for mismatch wallet"
}
}
2 changes: 1 addition & 1 deletion src/api/modules/connect/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type AuthType =
| "token"
| "sign"
| "subscription"
| "signMessage"
| "signKeystone"
| "signature"
| "signDataItem";

Expand Down
2 changes: 1 addition & 1 deletion src/api/modules/sign/chunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { nanoid } from "nanoid";
*/
export interface Chunk {
collectionID: string; // unique ID for the collection, that is the parent of this chunk
type: "tag" | "data" | "start" | "end";
type: "tag" | "data" | "bytes" | "start" | "end";
index: number; // index of the chunk, to make sure it is not in the wrong order
value?: number[] | Tag; // Uint8Array converted to number array or a tag
}
Expand Down
51 changes: 47 additions & 4 deletions src/api/modules/sign/sign_auth.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { onMessage, sendMessage } from "@arconnect/webext-bridge";
import { deconstructTransaction } from "./transaction_builder";
import { bytesToChunks, deconstructTransaction } from "./transaction_builder";
import type Transaction from "arweave/web/lib/transaction";
import type { AuthResult } from "shim";
import authenticate from "../connect/auth";
import { nanoid } from "nanoid";

/**
* Request a manual signature for the transaction.
Expand Down Expand Up @@ -73,15 +74,57 @@ export const signAuth = (
}
);

export const signAuthMessage = (dataToSign: Uint8Array) =>
export type AuthKeystoneType = "Message" | "DataItem";

export interface AuthKeystoneData {
type: AuthKeystoneType;
data: Uint8Array;
}

export const signAuthKeystone = (dataToSign: AuthKeystoneData) =>
new Promise<AuthResult<{ id: string; signature: string } | undefined>>(
(resolve, reject) => {
// start auth
const collectionID = nanoid();
authenticate({
type: "signMessage",
data: Buffer.from(dataToSign).toString("base64")
type: "signKeystone",
keystoneSignType: dataToSign.type,
collectionID
})
.then((res) => resolve(res))
.catch((err) => reject(err));
const dataChunks = bytesToChunks(dataToSign.data, collectionID, 0);

// send tx in chunks to sign if requested
onMessage("auth_listening", async ({ sender }) => {
if (sender.context !== "web_accessible") return;

// send data chunks
for (const chunk of dataChunks) {
try {
await sendMessage(
"auth_chunk",
chunk,
`web_accessible@${sender.tabId}`
);
} catch (e) {
// chunk fail
return reject(
`Error while sending a data chunk of collection "${collectionID}": \n${e}`
);
}
}

// end chunk
await sendMessage(
"auth_chunk",
{
collectionID,
type: "end",
index: dataChunks.length
},
`web_accessible@${sender.tabId}`
);
});
}
);
Loading
Loading