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

Qi Wallet v2 #329

Merged
merged 23 commits into from
Oct 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
96fdb0f
add new types
alejoacosta74 Oct 21, 2024
a4dd595
unify data structures into single map
alejoacosta74 Oct 21, 2024
6a3d082
refactor address getter methods
alejoacosta74 Oct 21, 2024
4874610
update sendTx to use new data structure
alejoacosta74 Oct 21, 2024
910822d
update scanning & syncing logic
alejoacosta74 Oct 21, 2024
2283247
update addresses get methods
alejoacosta74 Oct 21, 2024
d859152
update serialization logic
alejoacosta74 Oct 21, 2024
9b49c33
update paymentcode logic
alejoacosta74 Oct 21, 2024
e9f5413
fix bug in getNext payment code address
alejoacosta74 Oct 21, 2024
e1119fa
remove helper methods
alejoacosta74 Oct 21, 2024
37e3259
Fixes to new qi syncing logic
rileystephens28 Oct 22, 2024
1bc903a
Temporarily add legacy qi wallet for comparison
rileystephens28 Oct 22, 2024
55b75ab
bug fix in _findLastUsedIndex
alejoacosta74 Oct 22, 2024
23fd54c
QiHDWalletLegacy: bug fix on paymentcode addr generation
alejoacosta74 Oct 22, 2024
8d34625
update serialization/deserialization properties
alejoacosta74 Oct 22, 2024
1b0630a
add script to compare new vs legacy QiHDWallet address generation
alejoacosta74 Oct 22, 2024
526ddf7
update QiAddressInfo with derivationPath property
alejoacosta74 Oct 22, 2024
f7ebfe1
remove duplicated updates to address map
alejoacosta74 Oct 22, 2024
9d9d4bd
Fix `getAddressesForZone` method name
rileystephens28 Oct 22, 2024
dbf709d
Support min denomination when selecting for conversion txs
rileystephens28 Oct 22, 2024
ae49b30
fix bug in getChangeAddresses function
alejoacosta74 Oct 23, 2024
361ce46
Fix serializing all derivation paths
rileystephens28 Oct 23, 2024
3e27a77
Remove legacy Qi HD Wallet export
rileystephens28 Oct 23, 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
Next Next commit
add new types
alejoacosta74 authored and rileystephens28 committed Oct 22, 2024
commit 96fdb0fc93ce5a3f3ea25a2cbd6095152eac0f75
35 changes: 30 additions & 5 deletions src/wallet/qi-hdwallet.ts
Original file line number Diff line number Diff line change
@@ -38,11 +38,36 @@ export interface OutpointInfo {
account?: number;
}

// enum AddressUseStatus {
// USED, // Address has been used in a transaction and is not available for reuse
// UNUSED, // Address has not been used in any transaction and is available for reuse
// ATTEMPTED, // Address was attempted to be used in a transaction but tx status is unknown
// }
/**
* Enum representing the status of an address in the wallet.
*
* @enum {string}
*/
enum AddressStatus {
USED = 'USED',
UNUSED = 'UNUSED',
ATTEMPTED_USE = 'ATTEMPTED_USE',
UNKNOWN = 'UNKNOWN',
}

/**
* Type representing the derivation path of an address in the wallet.
*
* @type {string}
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type DerivationPath = 'BIP44:external' | 'BIP44:change' | string; // string for payment codes

/**
* Interface representing an address in the Qi HD wallet.
*
* @extends NeuteredAddressInfo
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface QiAddressInfo extends NeuteredAddressInfo {
status: AddressStatus;
counterpartyPaymentCode?: string;
}

interface PaymentChannelAddressInfo {
address: string;