pinata 1.10.1 → 2.1.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 +13 -13
- package/dist/index.d.mts +543 -279
- package/dist/index.d.ts +543 -279
- package/dist/index.js +3535 -1843
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3490 -1842
- package/dist/index.mjs.map +1 -1
- package/package.json +52 -44
package/README.md
CHANGED
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
The new all-in-one Pinata SDK
|
|
6
6
|
|
|
7
|
-
> [!IMPORTANT]
|
|
8
|
-
> The `v1.*.*` release is a breaking change and does not support IPFS. Please use the [`pinata-web3`](https://github.com/PinataCloud/pinata-web3) SDK.
|
|
9
|
-
|
|
10
7
|
## Quickstart
|
|
11
8
|
|
|
12
9
|
[View the full documentation here](https://docs.pinata.cloud/sdk-beta/getting-started)
|
|
@@ -45,7 +42,7 @@ const pinata = new PinataSDK({
|
|
|
45
42
|
async function main() {
|
|
46
43
|
try {
|
|
47
44
|
const file = new File(["hello"], "Testing.txt", { type: "text/plain" });
|
|
48
|
-
const upload = await pinata.upload.file(file);
|
|
45
|
+
const upload = await pinata.upload.public.file(file);
|
|
49
46
|
console.log(upload);
|
|
50
47
|
} catch (error) {
|
|
51
48
|
console.log(error);
|
|
@@ -59,14 +56,17 @@ This will return an object like the following:
|
|
|
59
56
|
|
|
60
57
|
```typescript
|
|
61
58
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
id: "0195a5c4-242f-7c01-bee8-f34a9e8e804b",
|
|
60
|
+
user_id: "87ef31fe-519b-4ffe-90d9-987771247827",
|
|
61
|
+
group_id: null,
|
|
62
|
+
name: "hello.txt",
|
|
63
|
+
cid: "bafkreid7qoywk77r7rj3slobqfekdvs57qwuwh5d2z3sqsw52iabe3mqne",
|
|
64
|
+
created_at: "2025-03-17T20:20:50.057Z",
|
|
65
|
+
size: 12,
|
|
66
|
+
number_of_files: 1,
|
|
67
|
+
mime_type: "text/plain",
|
|
68
|
+
vectorized: false,
|
|
69
|
+
network: "public",
|
|
70
70
|
}
|
|
71
71
|
```
|
|
72
72
|
|
|
@@ -84,7 +84,7 @@ const pinata = new PinataSDK({
|
|
|
84
84
|
|
|
85
85
|
async function main() {
|
|
86
86
|
try {
|
|
87
|
-
const data = await pinata.gateways.get("bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq");
|
|
87
|
+
const data = await pinata.gateways.public.get("bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq");
|
|
88
88
|
console.log(data)
|
|
89
89
|
} catch (error) {
|
|
90
90
|
console.log(error);
|