@campnetwork/origin 1.2.0-3 → 1.2.0-4
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 +29 -0
- package/dist/core.cjs +85 -81
- package/dist/core.d.ts +10 -3
- package/dist/core.esm.d.ts +10 -3
- package/dist/core.esm.js +38 -34
- package/dist/react/index.esm.d.ts +14 -6
- package/dist/react/index.esm.js +26 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -281,6 +281,8 @@ The Auth class is the entry point for authenticating users with the Origin SDK.
|
|
|
281
281
|
The `redirectUri` can also be an object with the following optional properties:
|
|
282
282
|
- `twitter` - The URI to redirect to after the user completes oauth for Twitter.
|
|
283
283
|
- `spotify` - The URI to redirect to after the user completes oauth for Spotify.
|
|
284
|
+
- `environment` - The environment to use. Can be either `DEVELOPMENT` or `PRODUCTION`. Defaults to `DEVELOPMENT`.
|
|
285
|
+
- `baseParentId` - A valid tokenID to be used as the parent of all IPNFTs minted on your platform, making them all derivatives of your base asset.
|
|
284
286
|
|
|
285
287
|
You may use the `redirectUri` object to redirect the user to different pages based on the social they are linking.
|
|
286
288
|
You may only define the URIs for the socials you are using, the rest will default to `window.location.href`.
|
|
@@ -722,6 +724,7 @@ It can also take the following optional props:
|
|
|
722
724
|
- `redirectUri` - `string | object` - Either a string that will be used as the redirect URI for all socials, or an object with the following optional properties: `twitter`, `spotify`. This is used to redirect the user to different pages after they have completed the OAuth flow for a social.
|
|
723
725
|
- `environment` - `string` - The environment to use. Can be either `DEVELOPMENT` or `PRODUCTION`. Defaults to `DEVELOPMENT`.
|
|
724
726
|
- - the `DEVELOPMENT` environment uses the Camp Testnet while the `PRODUCTION` environment uses the Camp Mainnet.
|
|
727
|
+
- `baseParentId` - `string | bigint` - A valid tokenID to be used as the parent of all IPNFTs minted on your platform, making them all derivatives of your base asset.
|
|
725
728
|
|
|
726
729
|
```jsx
|
|
727
730
|
import { CampProvider } from "@campnetwork/origin/react";
|
|
@@ -1263,6 +1266,32 @@ Call these methods as `await auth.origin.methodName(...)` after authenticating.
|
|
|
1263
1266
|
|
|
1264
1267
|
---
|
|
1265
1268
|
|
|
1269
|
+
# Advanced flows
|
|
1270
|
+
|
|
1271
|
+
## App Revenue Share in Origin using derivatives
|
|
1272
|
+
|
|
1273
|
+
You can enable app-level revenue sharing in **Origin** using the following setup:
|
|
1274
|
+
|
|
1275
|
+
1. **Mint a base (genesis) IPNFT** for your platform and set its royalty percentage to whatever share you want the platform to receive. This can be done using the Origin UI, or the SDK.
|
|
1276
|
+
2. **Make all user-created IPNFTs derivatives** of this base IPNFT. There are two ways to do this:
|
|
1277
|
+
- **Automatic (recommended):**
|
|
1278
|
+
Set the `baseParentId` parameter on the `CampProvider` or `Auth` class (depending on your integration) to the tokenId of the base IPNFT.
|
|
1279
|
+
→ This automatically applies to _all mints_, including those made through the **Camp SDK Modal**.
|
|
1280
|
+
- **Manual:**
|
|
1281
|
+
If you’re using a custom mint flow, add the base IPNFT’s tokenId to the `parents` array before calling `origin.mintFile` or `origin.mintSocial`.
|
|
1282
|
+
→ Note: this does **not** affect mints made through the Camp SDK Modal.
|
|
1283
|
+
3. **Royalties flow automatically:**
|
|
1284
|
+
|
|
1285
|
+
The royalty percentage defined on the base IPNFT will be collected from every subscription to its derivative IPNFTs.
|
|
1286
|
+
|
|
1287
|
+
4. **Claim your platform royalties:**
|
|
1288
|
+
|
|
1289
|
+
You can view and claim the accumulated platform royalties directly from your **Creator Dashboard** in the **Origin UI**.
|
|
1290
|
+
|
|
1291
|
+
**Note:** Each IPNFT can have a maximum of 8 parents. Using one parent slot for app-level revenue sharing reduces the available slots for user-defined parent–derivative relationships to 7.
|
|
1292
|
+
|
|
1293
|
+
---
|
|
1294
|
+
|
|
1266
1295
|
# Contributing
|
|
1267
1296
|
|
|
1268
1297
|
Install the dependencies.
|