Skip to content

Commit be499c7

Browse files
committed
docs: deprecate transferAllocation + docs corrections
1 parent b13c54c commit be499c7

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

.changeset/many-islands-fly.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@zerochain/sdk': patch
3+
---
4+
5+
- Add missing code documentation / corrections
6+
- transferAllocation is marked as deprecated

docs/docs/api/allocation.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,17 @@ const transactionHash = await updateForbidAllocation({
438438
```
439439

440440
### `getUpdateAllocTicket`
441-
Signs an "Update Allocation ticket," which is needed to allow someone else to run an update transaction for your allocation on your terms.
442-
{/* Get details of params and update code docs too // DOTODO: https://0chain.slack.com/archives/D06680GNC49/p1739215304759299 */}
441+
Generates and signs an "Update Allocation ticket", which authorizes the "add blobber" or "replace blobber" operation from other wallets.
442+
443443
#### Parameters
444444
| Name | Type | Description | Default value |
445445
|---|---|---|---|
446446
| `domain` | `NetworkDomain` | Network domain for the allocation | |
447447
| `wallet` | `ActiveWallet` | Active Wallet details | |
448448
| `allocationId` | `string` | Allocation ID to update | |
449-
| `userId` | `string` | Wallet ID of the user updating the allocation. | |
450-
| `operationType` | `string` | Type of operation | |
451-
| `roundExpiry` | `number` | Expiry round for the ticket | |
449+
| `userId` | `string` | UserID is the wallet ID which will be allowed to update your allocation | |
450+
| `operationType` | `replace_blobber` \| `add_blobber` | Type of operation | |
451+
| `roundExpiry` | `number` | Round expiry is the round after which the auth ticket will no longer be valid. | |
452452

453453
#### Return Type
454454
```typescript
@@ -469,9 +469,9 @@ const authTicket = await getUpdateAllocTicket({
469469
})
470470
```
471471

472-
### `transferAllocation`
472+
{/* ### `transferAllocation`
473473
Transfers the ownership of an allocation to a new owner.
474-
{/* verify and update code docs too // DOTODO: https://0chain.slack.com/archives/D06680GNC49/p1739216420958469 */}
474+
475475
#### Parameters
476476
| Name | Type | Description | Default value |
477477
|---|---|---|---|
@@ -492,7 +492,7 @@ await transferAllocation({
492492
newOwnerId: walledIdOfNewOwner,
493493
newOwnerPublicKey: walletPublicKeyOfNewOwner
494494
})
495-
```
495+
``` */}
496496

497497
### `checkAllocStatus`
498498
Checks the health status of the allocation.

docs/docs/api/introduction.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ The allocation storage methods allow you to create, update, and manage allocatio
6161
| [`updateAllocationWithRepair`](/docs/api/allocation#updateallocationwithrepair) | Updates your allocation settings and repairs the allocation if any blobber was replaced or added |
6262
| [`getUpdateAllocationMinLock`](/docs/api/allocation#getupdateallocationminlock) | Retrieves the minimum lock value for the allocation after update. |
6363
| [`updateForbidAllocation`](/docs/api/allocation#updateforbidallocation) | UpdateForbidAllocation updates the permissions of an allocation, given the permission parameters in a forbid-first manner. |
64-
| [`getUpdateAllocTicket`](/docs/api/allocation#getupdateallocticket) | This method is used to sign an "Update Allocation ticket". This ticket is needed to allow someone else to run update transaction for your allocation on your terms. |
65-
| [`transferAllocation`](/docs/api/allocation#transferallocation) | Transfer the ownership of an allocation to a new owner |
64+
| [`getUpdateAllocTicket`](/docs/api/allocation#getupdateallocticket) | Generates and signs an "Update Allocation ticket", which authorizes the "add blobber" or "replace blobber" operation from other wallets. |
6665
| [`checkAllocStatus`](/docs/api/allocation#checkallocstatus) | Check the health status of the allocation.|
6766
| [`skipStatusCheck`](/docs/api/allocation#skipstatuscheck) | Skips the `checkAlloctionStatus` health status check of the allocation. |
6867
| [`repairAllocation`](/docs/api/allocation#repairallocation) | Start a repair process for an allocation. |
6968
| [`repairSize`](/docs/api/allocation#repairsize) | Retrieves the repair size for a specific path in an allocation. |
7069
| [`createWorkers`](/docs/api/allocation#createworkers) | Manually create local workers that sync with the allocation. |
7170
| [`terminateWorkers`](/docs/api/allocation#terminateworkers) | Remove local workers that sync with the allocation. This is useful when switching between allocations. |
71+
{/* | [`transferAllocation`](/docs/api/allocation#transferallocation) | Transfer the ownership of an allocation to a new owner | */}
7272
{/* createFreeAllocation // DOTODO */}
7373

7474
### Blobber Methods

package/src/sdk/allocation.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ export const reloadAllocation = async ({
206206
return await goWasm.sdk.reloadAllocation(allocationId)
207207
}
208208

209-
/** transferAllocation transfers the ownership of an allocation to a new owner */
209+
/**
210+
* transferAllocation transfers the ownership of an allocation to a new owner
211+
* @deprecated
212+
*/
210213
export const transferAllocation = async ({
211214
wallet,
212215
domain,
@@ -562,7 +565,7 @@ export const createFreeAllocation = async ({
562565
}
563566

564567
/**
565-
* This method is used to sign an "Update Allocation ticket". This ticket is needed to allow someone else to run update transaction for your allocation on your terms.
568+
* Generates and signs an "Update Allocation ticket", which authorizes the "add blobber" or "replace blobber" operation from other wallets. This ticket must be signed by the allocation owner.
566569
*/
567570
export const getUpdateAllocTicket = async ({
568571
domain,
@@ -575,9 +578,11 @@ export const getUpdateAllocTicket = async ({
575578
domain: NetworkDomain
576579
wallet: ActiveWallet
577580
allocationId: string
578-
// get from zcnContracts
581+
// TODO: get from zcnContracts? Check for other zcnContracts teamWallet mentions too. Are they valid?
582+
/** UserID is the wallet ID which will be allowed to update your allocation */
579583
userId: string // TODO: Should we directly add teamWallet here
580-
operationType: string // TODO
584+
operationType: 'replace_blobber' | 'add_blobber'
585+
/** Round expiry is the round after which the auth ticket will no longer be valid. */
581586
roundExpiry: number
582587
}): Promise<string> => {
583588
const goWasm = await getWasm({ domain, wallet })

0 commit comments

Comments
 (0)