Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Commit

Permalink
Improve annotation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chmanie committed Nov 14, 2022
1 parent b984433 commit 9c8fd9a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions docs/api/classes/Colony.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,23 @@ This will annotate a transaction with an arbitrary text message. This only reall

**`Remarks`**

Requires an [IpfsAdapter](../interfaces/IpfsAdapter.md) that can upload and pin to IPFS. See its documentation for more information
Requires an [IpfsAdapter](../interfaces/IpfsAdapter.md) that can upload and pin to IPFS. See its documentation for more information. Keep in mind that **the annotation itself is a transaction**.

**`Example`**

```typescript
// Immediately executing async function
(async function() {
// Annotate a motion transaction to pay ourselves a little bonus :)

// Create a motion to pay 10 of the native token to some (maybe your own?) address
const [, { transactionHash }] = await colony.ext.motions.create.pay(
'0xb77D57F4959eAfA0339424b83FcFaf9c15407461',
w`10`,
);
// Annotate the motion transaction with a little explanation :)
await colony.annotateTransaction(
'0xf1940d38e0a74262643a75b0f826353d62a505aedd9c95ae5fb5da6856e4adb2',
'I am creating this motion because I think I deserve a little bonus'
transactionHash,
'I am creating this motion because I think I deserve a little bonus'
);
})();
```
Expand Down
14 changes: 10 additions & 4 deletions src/ColonyNetwork/Colony.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,22 @@ export class Colony {
*
* This will annotate a transaction with an arbitrary text message. This only really works for transactions that happened within this Colony. This will upload the text string to IPFS and connect the transaction to the IPFS hash accordingly.
*
* @remarks Requires an [[IpfsAdapter]] that can upload and pin to IPFS. See its documentation for more information
* @remarks Requires an [[IpfsAdapter]] that can upload and pin to IPFS. See its documentation for more information. Keep in mind that **the annotation itself is a transaction**.
*
* @example
* ```typescript
* // Immediately executing async function
* (async function() {
* // Annotate a motion transaction to pay ourselves a little bonus :)
*
* // Create a motion to pay 10 of the native token to some (maybe your own?) address
* const [, { transactionHash }] = await colony.ext.motions.create.pay(
* '0xb77D57F4959eAfA0339424b83FcFaf9c15407461',
* w`10`,
* );
* // Annotate the motion transaction with a little explanation :)
* await colony.annotateTransaction(
* '0xf1940d38e0a74262643a75b0f826353d62a505aedd9c95ae5fb5da6856e4adb2',
* 'I am creating this motion because I think I deserve a little bonus'
* transactionHash,
* 'I am creating this motion because I think I deserve a little bonus'
* );
* })();
* ```
Expand Down

0 comments on commit 9c8fd9a

Please sign in to comment.