Skip to content

Commit e80ae72

Browse files
committed
chore(sdk): generate latest sdk docs
1 parent 98d32f9 commit e80ae72

36 files changed

+853
-410
lines changed

content/sdks/ardrive-core-js/(advanced-features)/bundle-support.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Large uploads are automatically bundled for efficiency:
88
```typescript
99
// Bundling happens automatically for multiple files
1010
const bulkResult = await arDrive.uploadAllEntities({
11-
entitiesToUpload: manyFiles,
12-
// Bundling is handled internally
11+
entitiesToUpload: manyFiles
12+
// Bundling is handled internally
1313
});
1414
```

content/sdks/ardrive-core-js/(advanced-features)/caching.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Non-Windows: <os.homedir()>/.ardrive/caches/metadata
1111
```
1212

1313
Enable cache logging:
14+
1415
```bash
1516
export ARDRIVE_CACHE_LOG=1
1617
```

content/sdks/ardrive-core-js/(advanced-features)/community-features.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Send tips to the ArDrive community:
88
```typescript
99
// Send community tip
1010
await arDrive.sendCommunityTip({
11-
tokenAmount: new Winston(1000000000000), // 1 AR
12-
walletAddress,
13-
communityWalletAddress
11+
tokenAmount: new Winston(1000000000000), // 1 AR
12+
walletAddress,
13+
communityWalletAddress
1414
});
1515
```

content/sdks/ardrive-core-js/(advanced-features)/manifest-creation.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Create Arweave manifests for web hosting:
88
```typescript
99
// Create a manifest for a folder
1010
const manifest = await arDrive.uploadPublicManifest({
11-
folderId,
12-
destManifestName: 'index.html',
13-
conflictResolution: 'upsert'
11+
folderId,
12+
destManifestName: 'index.html',
13+
conflictResolution: 'upsert'
1414
});
1515

1616
// Access: https://arweave.net/{manifestId}

content/sdks/ardrive-core-js/(advanced-features)/progress-tracking.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export ARDRIVE_PROGRESS_LOG=1
1010
```
1111

1212
Progress will be logged to stderr:
13+
1314
```
1415
Uploading file transaction 1 of total 2 transactions...
1516
Transaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: 0%

content/sdks/ardrive-core-js/(advanced-features)/turbo-integration.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@ description: "JavaScript/TypeScript SDK for interacting with ArDrive"
66
Enable Turbo for optimized uploads:
77

88
```typescript
9-
// Enable Turbo
10-
const arDriveWithTurbo = arDriveFactory({
11-
wallet: myWallet,
12-
turboSettings: {}
9+
// Node.js
10+
const arDriveWithTurbo = arDriveFactory({
11+
wallet: myWallet,
12+
turboSettings: {
13+
turboUploadUrl: new URL('https://upload.ardrive.io')
14+
}
15+
});
16+
17+
// Browser
18+
import { arDriveFactory } from 'ardrive-core-js/web';
19+
20+
const arDrive = arDriveFactory({
21+
signer: myBrowserSigner,
22+
turboSettings: {
23+
turboUploadUrl: new URL('https://upload.ardrive.io')
24+
}
1325
});
1426

1527
// Uploads will automatically use Turbo
1628
const result = await arDriveWithTurbo.uploadAllEntities({
17-
entitiesToUpload: [{ wrappedEntity, destFolderId }]
29+
entitiesToUpload: [{ wrappedEntity, destFolderId }]
1830
});
1931
```

content/sdks/ardrive-core-js/(api-reference)/bulk-operations.mdx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ const file1 = wrapFileOrFolder('/path/to/file1.txt');
1515

1616
// Upload everything in one operation
1717
const bulkUpload = await arDrive.uploadAllEntities({
18-
entitiesToUpload: [
19-
// Public folder
20-
{
21-
wrappedEntity: folder1,
22-
destFolderId: rootFolderId
23-
},
24-
// Private folder
25-
{
26-
wrappedEntity: folder2,
27-
destFolderId: rootFolderId,
28-
driveKey: privateDriveKey
29-
},
30-
// Public file
31-
{
32-
wrappedEntity: file1,
33-
destFolderId: someFolderId
34-
}
35-
],
36-
conflictResolution: 'upsert'
18+
entitiesToUpload: [
19+
// Public folder
20+
{
21+
wrappedEntity: folder1,
22+
destFolderId: rootFolderId
23+
},
24+
// Private folder
25+
{
26+
wrappedEntity: folder2,
27+
destFolderId: rootFolderId,
28+
driveKey: privateDriveKey
29+
},
30+
// Public file
31+
{
32+
wrappedEntity: file1,
33+
destFolderId: someFolderId
34+
}
35+
],
36+
conflictResolution: 'upsert'
3737
});
3838

3939
// Results include all created entities
@@ -46,8 +46,8 @@ console.log('Total cost:', bulkUpload.totalCost.toString());
4646
```typescript
4747
// Create folder and upload all children
4848
const folderWithContents = await arDrive.createPublicFolderAndUploadChildren({
49-
parentFolderId,
50-
wrappedFolder: wrapFileOrFolder('/path/to/folder'),
51-
conflictResolution: 'skip'
49+
parentFolderId,
50+
wrappedFolder: wrapFileOrFolder('/path/to/folder'),
51+
conflictResolution: 'skip'
5252
});
5353
```

content/sdks/ardrive-core-js/(api-reference)/custom-metadata.mdx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,23 @@ description: "JavaScript/TypeScript SDK for interacting with ArDrive"
66
Attach custom metadata to files:
77

88
```typescript
9-
const fileWithMetadata = wrapFileOrFolder(
10-
'/path/to/file.txt',
11-
'text/plain',
12-
{
13-
metaDataJson: {
14-
'Custom-Field': 'Custom Value',
15-
'Version': '1.0'
9+
const fileWithMetadata = wrapFileOrFolder('/path/to/file.txt', 'text/plain', {
10+
metaDataJson: {
11+
'Custom-Field': 'Custom Value',
12+
Version: '1.0'
1613
},
1714
metaDataGqlTags: {
18-
'App-Name': ['MyApp'],
19-
'App-Version': ['1.0.0']
15+
'App-Name': ['MyApp'],
16+
'App-Version': ['1.0.0']
2017
},
2118
dataGqlTags: {
22-
'Content-Type': ['text/plain']
19+
'Content-Type': ['text/plain']
2320
}
24-
}
25-
);
21+
});
2622

2723
// Upload with custom metadata
2824
await arDrive.uploadPublicFile({
29-
parentFolderId,
30-
wrappedFile: fileWithMetadata
25+
parentFolderId,
26+
wrappedFile: fileWithMetadata
3127
});
3228
```

content/sdks/ardrive-core-js/(api-reference)/download-operations.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ description: "JavaScript/TypeScript SDK for interacting with ArDrive"
77

88
```typescript
99
// Download public file
10-
const publicData = await arDrive.downloadPublicFile({
11-
fileId
10+
const publicData = await arDrive.downloadPublicFile({
11+
fileId
1212
});
1313
// publicData is a Buffer/Uint8Array
1414

1515
// Download private file (automatically decrypted)
16-
const privateData = await arDrive.downloadPrivateFile({
17-
fileId,
18-
driveKey
16+
const privateData = await arDrive.downloadPrivateFile({
17+
fileId,
18+
driveKey
1919
});
2020
```
2121

@@ -24,14 +24,14 @@ const privateData = await arDrive.downloadPrivateFile({
2424
```typescript
2525
// Download entire folder
2626
const folderData = await arDrive.downloadPublicFolder({
27-
folderId,
28-
destFolderPath: '/local/download/path'
27+
folderId,
28+
destFolderPath: '/local/download/path'
2929
});
3030

3131
// Download private folder
3232
const privateFolderData = await arDrive.downloadPrivateFolder({
33-
folderId,
34-
driveKey,
35-
destFolderPath: '/local/download/path'
33+
folderId,
34+
driveKey,
35+
destFolderPath: '/local/download/path'
3636
});
3737
```

content/sdks/ardrive-core-js/(api-reference)/drive-operations.mdx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@ description: "JavaScript/TypeScript SDK for interacting with ArDrive"
88
```typescript
99
// Public drive
1010
const publicDrive = await arDrive.createPublicDrive({
11-
driveName: 'My Public Drive'
11+
driveName: 'My Public Drive'
1212
});
1313

1414
// Private drive with password
1515
const privateDrive = await arDrive.createPrivateDrive({
16-
driveName: 'My Private Drive',
17-
drivePassword: 'mySecretPassword'
16+
driveName: 'My Private Drive',
17+
drivePassword: 'mySecretPassword'
1818
});
1919
```
2020

2121
#### Reading Drive Information
2222

2323
```typescript
2424
// Get public drive
25-
const publicDriveInfo = await arDrive.getPublicDrive({
26-
driveId
25+
const publicDriveInfo = await arDrive.getPublicDrive({
26+
driveId
2727
});
2828

2929
// Get private drive (requires drive key)
30-
const privateDriveInfo = await arDrive.getPrivateDrive({
31-
driveId,
32-
driveKey
30+
const privateDriveInfo = await arDrive.getPrivateDrive({
31+
driveId,
32+
driveKey
3333
});
3434

3535
// Get all drives for an address
36-
const allDrives = await arDrive.getAllDrivesForAddress({
37-
address: walletAddress,
38-
privateKeyData: wallet.getPrivateKey()
36+
const allDrives = await arDrive.getAllDrivesForAddress({
37+
address: walletAddress,
38+
privateKeyData: wallet.getPrivateKey()
3939
});
4040
```
4141

@@ -44,14 +44,14 @@ const allDrives = await arDrive.getAllDrivesForAddress({
4444
```typescript
4545
// Rename public drive
4646
await arDrive.renamePublicDrive({
47-
driveId,
48-
newName: 'Updated Drive Name'
47+
driveId,
48+
newName: 'Updated Drive Name'
4949
});
5050

5151
// Rename private drive
5252
await arDrive.renamePrivateDrive({
53-
driveId,
54-
driveKey,
55-
newName: 'Updated Private Name'
53+
driveId,
54+
driveKey,
55+
newName: 'Updated Private Name'
5656
});
5757
```

0 commit comments

Comments
 (0)