Skip to content

Commit c79a364

Browse files
committed
Move sections
1 parent f4faa0f commit c79a364

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

website/pages/en/sps/triggers-example.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,7 @@ type MyTransfer @entity {
8787

8888
This schema defines a `MyTransfer` entity with fields such as `id`, `amount`, `source`, `designation`, and `signers`.
8989

90-
## Step 4: Generate Protobuf Files
91-
92-
To generate Protobuf objects in AssemblyScript, run the following command:
93-
94-
```bash
95-
npm run protogen
96-
```
97-
98-
This command converts the Protobuf definitions into AssemblyScript, allowing you to use them in the subgraph's handler.
99-
100-
## Step 5: Handle Substreams Data in `mappings.ts`
90+
## Step 4: Handle Substreams Data in `mappings.ts`
10191

10292
With the Protobuf objects generated, you can now handle the decoded Substreams data in your `mappings.ts` file found in the `./src` directory. The example below demonstrates how to extract to subgraph entities the non-derived transfers associated to the Orca account id:
10393

@@ -130,6 +120,16 @@ export function handleTriggers(bytes: Uint8Array): void {
130120
}
131121
```
132122

123+
## Step 5: Generate Protobuf Files
124+
125+
To generate Protobuf objects in AssemblyScript, run the following command:
126+
127+
```bash
128+
npm run protogen
129+
```
130+
131+
This command converts the Protobuf definitions into AssemblyScript, allowing you to use them in the subgraph's handler.
132+
133133
## Conclusion
134134

135135
You’ve successfully set up a trigger-based Substreams-powered subgraph for a Solana SPL token. You can now further customize your schema, mappings, and modules to suit your specific use case.

0 commit comments

Comments
 (0)