Commit 7e991db
authored
feat: Sign transactions with MPC from a different account or even through a DAO proposal (#520)
This pr enables user to control other account using derived key and
signing transaction through MPC contract like this:
```
cargo run tokens <controllable-account-id> send-near <recipient-account-id> '0.1 NEAR' network-config testnet sign-with-mpc <admin-account-id> ed25519 derivation-path <derivation-path> prepaid-gas '15.0 Tgas' attached-deposit '1 yoctoNEAR' sign-mpc-with-keychain send
```
Additionally, PR adds new field to the config `mpc_contract_account_id`
and bumps it to version 4.
Here are examples of transactions on nearblocks:
- using ed25519 derived key:
- "sign" call to MPC:
[link](https://testnet.nearblocks.io/txns/22qLC8AjEqhCzNTmRsogDhFyeLBZ999bj7XPMdn8aUqP?tab=execution#3a4X5GGesrPP4EfcvHcQR5tJkTgtqB3pS92JcPcERWsF)
- transfer to admin:
[link](https://testnet.nearblocks.io/txns/HbF7gKqo4xke3zuGwCeU6STCSug4wEMGsBbyiQgWdKvp)
- using secp256k1 derived key:
- "sign" call to MPC:
[link](https://testnet.nearblocks.io/txns/B4TMvTQP5SUqWhSFWwohd5yNhNjTyCBm8DWs6vFGkbfn?tab=execution#382GwQimfinLJLeH7YVzTSDQTTwF4cMtvLafLn1mnpVZ)
- transfer to admin:
[link](https://testnet.nearblocks.io/txns/D6bf7oAsMMZTNwAp75ADgsGy9ebxgUErRWTztkFXWGDS)1 parent 9ab0e64 commit 7e991db
File tree
48 files changed
+1343
-56
lines changed- .github/workflows
- src
- commands
- account
- add_key
- autogenerate_new_keypair
- print_keypair_to_terminal
- save_keypair_to_keychain
- save_keypair_to_legacy_keychain
- use_ledger
- use_manually_provided_seed_phrase
- use_public_key
- create_account/fund_myself_create_account/sign_as
- delete_account
- delete_key
- storage_management
- config/add_connection
- contract
- call_function/as_transaction
- deploy_global
- deploy/initialize_mode
- call_function_type
- staking/delegate
- tokens
- send_ft
- send_near
- send_nft
- transaction
- construct_transaction/skip_action
- sign_transaction
- config
- network_for_transaction
- transaction_signature_options
- sign_with_access_key_file
- sign_with_keychain
- sign_with_ledger
- sign_with_legacy_keychain
- sign_with_mpc
- sign_with_private_key
- sign_with_seed_phrase
- submit_dao_proposal
- tests/common
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+1343
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
| 149 | + | |
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
0 commit comments