| 开发者 | catenisadmin |
|---|---|
| 更新时间 | 2022年10月7日 05:22 |
| PHP版本: | 5.6 及以上 |
| WordPress版本: | 6.0 |
| 版权: | MIT |
Load Catenis API Client checkbox.
You can then choose to override the global settings used for instantiating the Catenis API client on that given page, like using a different device ID and its associated API access secret. Otherwise, whatever is configured in the plugin's global settings -- configured under "Settings" | "Catenis API Client" -- is going to be used.
Using the Catenis API client
Once enabled, a global JavaScript variable named ctnApiClient is made available on the page. That variable holds the instantiated Catenis API client object.
Use the ctnApiClient variable to call the Catenis API methods by invoking the corresponding method on that object.
For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally identical to the Catenis API Client for WordPress, except for notifications support and error handling.
Notifications support
The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. The two noticeable differences are:
comm-error event.open event emitted by the WebSocket notification channel object may return an error.When doing it on the plugin's global settings ("Settings" | "Catenis API Client"), just leave all fields of the "Client Options" section blank. However, when doing it on the "Catenis API Client" meta box on a WordPress page's edit page, use the following settings to make sure that all client options fields of the plugin's global settings are properly overridden:
catenis.iosandboxOnamount key is replaced by a new nfTokenIds key, which lists the IDs of the
non-fungible tokens that have been issued; and the holdingDevice key is replaced by a new holdingDevices key, which
lists the Catenis virtual devices to which the issued non-fungible tokens have been assigned.holder property is missing and a new boolean type
property named migrated, the value of which is always true, is present.Compression Threshold settings used for instantiating the Catenis API client.