|
1 | | -;; title: aibtc-smart-wallet-traits |
2 | | -;; version: 2.0.0 |
3 | | -;; summary: A collection of traits for user agent smart wallets. |
| 1 | +;; title: aibtc-user-agent-account-traits |
| 2 | +;; version: 1.0.0 |
| 3 | +;; summary: A collection of traits for user agent accounts. |
4 | 4 |
|
5 | 5 | ;; IMPORTS |
6 | 6 | (use-trait sip010-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait) |
|
11 | 11 | (use-trait dao-faktory-dex .aibtc-dao-traits-v3.faktory-dex) |
12 | 12 | (use-trait faktory-token .faktory-trait-v1.sip-010-trait) |
13 | 13 |
|
14 | | -;; SMART WALLET TRAITS |
| 14 | +;; ACCOUNT TRAITS |
15 | 15 |
|
16 | | -(define-trait aibtc-smart-wallet ( |
17 | | - ;; deposit STX to the smart wallet |
| 16 | +(define-trait aibtc-account ( |
| 17 | + ;; deposit STX to the agent account |
18 | 18 | ;; @param amount amount of microSTX to deposit |
19 | 19 | ;; @returns (response bool uint) |
20 | 20 | (deposit-stx (uint) (response bool uint)) |
21 | | - ;; deposit FT to the smart wallet |
| 21 | + ;; deposit FT to the agent account |
22 | 22 | ;; @param ft the fungible token contract |
23 | 23 | ;; @param amount amount of tokens to deposit |
24 | 24 | ;; @returns (response bool uint) |
25 | 25 | (deposit-ft (<sip010-trait> uint) (response bool uint)) |
26 | | - ;; withdraw STX from the smart wallet (user only) |
| 26 | + ;; withdraw STX from the agent account (owner only) |
27 | 27 | ;; @param amount amount of microSTX to withdraw |
28 | 28 | ;; @returns (response bool uint) |
29 | 29 | (withdraw-stx (uint) (response bool uint)) |
30 | | - ;; withdraw FT from the smart wallet (user only) |
| 30 | + ;; withdraw FT from the agent account (owner only) |
31 | 31 | ;; @param ft the fungible token contract |
32 | 32 | ;; @param amount amount of tokens to withdraw |
33 | 33 | ;; @returns (response bool uint) |
34 | 34 | (withdraw-ft (<sip010-trait> uint) (response bool uint)) |
35 | | - ;; approve an asset for deposit/withdrawal (user only) |
| 35 | + ;; approve an asset for deposit/withdrawal (owner only) |
36 | 36 | ;; @param asset the asset contract principal |
37 | 37 | ;; @returns (response bool uint) |
38 | 38 | (approve-asset (principal) (response bool uint)) |
39 | | - ;; revoke approval for an asset (user only) |
| 39 | + ;; revoke approval for an asset (owner only) |
40 | 40 | ;; @param asset the asset contract principal |
41 | 41 | ;; @returns (response bool uint) |
42 | 42 | (revoke-asset (principal) (response bool uint)) |
|
48 | 48 | ;; @param action the action contract |
49 | 49 | ;; @param parameters encoded action parameters |
50 | 50 | ;; @returns (response bool uint) |
51 | | - (proxy-propose-action (<dao-action-proposals-trait> <dao-action-trait> (buff 2048) (optional (string-ascii 1024))) (response bool uint)) |
| 51 | + (acct-propose-action (<dao-action-proposals-trait> <dao-action-trait> (buff 2048) (optional (string-ascii 1024))) (response bool uint)) |
52 | 52 | ;; create a core proposal to the DAO (user or agent) |
53 | 53 | ;; @param core-proposals the core proposals contract |
54 | 54 | ;; @param proposal the proposal contract |
55 | 55 | ;; @returns (response bool uint) |
56 | | - (proxy-create-proposal (<dao-core-proposals-trait> <dao-proposal-trait> (optional (string-ascii 1024))) (response bool uint)) |
| 56 | + (acct-create-proposal (<dao-core-proposals-trait> <dao-proposal-trait> (optional (string-ascii 1024))) (response bool uint)) |
57 | 57 | ;; vote on an action proposal (user or agent) |
58 | 58 | ;; @param action-proposals the action proposals contract |
59 | 59 | ;; @param proposalId the proposal ID |
|
79 | 79 | (conclude-core-proposal (<dao-core-proposals-trait> <dao-proposal-trait>) (response bool uint)) |
80 | 80 | )) |
81 | 81 |
|
| 82 | +(define-trait faktory-dex-approval ( |
| 83 | + ;; approve a dex for trading an asset |
| 84 | + ;; @param faktory-dex the faktory dex contract |
| 85 | + ;; @returns (response bool uint) |
| 86 | + (acct-approve-dex (<dao-faktory-dex>) (response bool uint)) |
| 87 | + ;; revoke approval for a dex |
| 88 | + ;; @param faktory-dex the faktory dex contract |
| 89 | + ;; @returns (response bool uint) |
| 90 | + (acct-revoke-dex (<dao-faktory-dex>) (response bool uint)) |
| 91 | +)) |
| 92 | + |
82 | 93 | (define-trait faktory-buy-sell ( |
83 | 94 | ;; buy an asset from a faktory dex |
84 | 95 | ;; @param faktory-dex the faktory dex contract |
85 | 96 | ;; @param asset the asset contract principal |
86 | 97 | ;; @param amount amount of tokens to buy |
87 | 98 | ;; @returns (response bool uint) |
88 | | - (buy-asset (<dao-faktory-dex> <faktory-token> uint) (response bool uint)) |
| 99 | + (acct-buy-asset (<dao-faktory-dex> <faktory-token> uint) (response bool uint)) |
89 | 100 | ;; sell an asset to a faktory dex |
90 | 101 | ;; @param faktory-dex the faktory dex contract |
91 | 102 | ;; @param asset the asset contract principal |
92 | 103 | ;; @param amount amount of tokens to sell |
93 | 104 | ;; @returns (response bool uint) |
94 | | - (sell-asset (<dao-faktory-dex> <faktory-token> uint) (response bool uint)) |
95 | | - ;; approve a dex for trading an asset |
96 | | - ;; @param faktory-dex the faktory dex contract |
97 | | - ;; @returns (response bool uint) |
98 | | - (approve-dex (<dao-faktory-dex>) (response bool uint)) |
99 | | - ;; revoke approval for a dex |
100 | | - ;; @param faktory-dex the faktory dex contract |
101 | | - ;; @returns (response bool uint) |
102 | | - (revoke-dex (<dao-faktory-dex>) (response bool uint)) |
| 105 | + (acct-sell-asset (<dao-faktory-dex> <faktory-token> uint) (response bool uint)) |
103 | 106 | )) |
0 commit comments