@wormhole-foundation/sdk-solana-ntt 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -97,6 +97,18 @@ Program log: Instruction: ReleaseInboundMint
97
97
  Program log: Instruction: ReleaseInboundUnlock
98
98
  ```
99
99
 
100
+ ## Message Customization
101
+
102
+ See the [NttManager](../docs/NttManager.md) doc for wire format details.
103
+
104
+ ### NativeTokenTransfer Additional Payload
105
+
106
+ Modify [transfer.rs](./programs/example-native-token-transfers/src/transfer.rs) and replace the `EmptyPayload` with your own custom struct. See [ntt.rs](./modules/ntt-messages/src/ntt.rs) for an example. It is highly encouraged to use a 4-byte prefix for your payload.
107
+
108
+ The additional payload field should then have your custom struct available everywhere `NativeTokenTransfer<Payload>` is used. Due to typing, parsing, and account allocation restrictions, this implementation expects that _all_ `NativeTokenTransfer` payloads for your contract adhere to your custom struct definition.
109
+
110
+ You can then modify [release_outbound](./programs/example-native-token-transfers/src/transceivers/wormhole/instructions/release_outbound.rs) and [redeem](./programs/example-native-token-transfers/src/instructions/redeem.rs) to generate and process the additional payload.
111
+
100
112
  ## Testing
101
113
 
102
114
  The test files are loacated in the `sdk/solana/__tests__/` directory