Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bitcoin Telegram Bot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s2191814
Bitcoin Telegram Bot
Merge requests
!2
Draft: initial user flow for creating a wallet
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Draft: initial user flow for creating a wallet
2-implement_all_user_flows
into
main
Overview
0
Commits
15
Pipelines
0
Changes
2
Merged
Janssen, D.D. (Dylan, Student M-CS)
requested to merge
2-implement_all_user_flows
into
main
2 years ago
Overview
0
Commits
15
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Viewing commit
2d42c121
Prev
Next
Show latest version
2 files
+
69
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
2d42c121
Add peewee ORM
· 2d42c121
s2191814
authored
2 years ago
wallet.py
0 → 100755
+
37
−
0
Options
#!/bin/env python3
from
typing
import
Union
from
bitcoinlib.wallets
import
Wallet
,
HDKey
,
WalletKey
import
os
from
util
import
DBManager
db
=
DBManager
()
def
new_multig_wallet
(
userId
:
Union
[
int
,
str
],
sigs
:
int
,
klist
:
list
[
HDKey
])
->
WalletKey
:
"""
Creates a new multisig wallet.
userId: name of the wallet
sigs: number of signatures needed for the wallet
klist: list of (public master) keys inside the wallet
"""
return
Wallet
.
create
(
name
=
userId
,
sigs_required
=
sigs
,
keys
=
klist
,
network
=
os
.
getenv
(
"
BTC_NETWORK
"
),
db_uri
=
db
.
db_uri
)
def
new_HD_key
()
->
HDKey
:
"""
Generates a new Hierarchical Deterministic key
"""
return
HDKey
(
network
=
os
.
getenv
(
"
BTC_NETWORK
"
))
def
main
():
pass
if
__name__
==
"
__main__
"
:
main
()
Loading