pinata 2.5.2 → 2.5.3

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/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
package/dist/index.d.mts CHANGED
@@ -175,6 +175,73 @@ type SignatureResponse = {
175
175
  signature: string;
176
176
  };
177
177
 
178
+ type NetworkIdentifier = "base" | "base-sepolia" | "eip155:8453" | "eip155:84532";
179
+ interface PaymentRequirement {
180
+ asset: string;
181
+ pay_to: string;
182
+ network: NetworkIdentifier;
183
+ amount: string;
184
+ description?: string;
185
+ }
186
+ interface PaymentInstruction {
187
+ id: string;
188
+ version: number;
189
+ payment_requirements: PaymentRequirement[];
190
+ name: string;
191
+ description?: string;
192
+ created_at: string;
193
+ }
194
+ interface CreatePaymentInstructionRequest {
195
+ name: string;
196
+ payment_requirements: PaymentRequirement[];
197
+ description?: string;
198
+ }
199
+ interface UpdatePaymentInstructionRequest {
200
+ name?: string;
201
+ payment_requirements?: PaymentRequirement[];
202
+ description?: string;
203
+ }
204
+ interface PaymentInstructionListQuery {
205
+ limit?: number;
206
+ pageToken?: string;
207
+ cid?: string;
208
+ name?: string;
209
+ id?: string;
210
+ }
211
+ interface PaymentInstructionListResponse {
212
+ data: {
213
+ payment_instructions: PaymentInstruction[];
214
+ next_page_token?: string;
215
+ };
216
+ }
217
+ interface PaymentInstructionResponse {
218
+ data: PaymentInstruction;
219
+ }
220
+ interface PaymentInstructionDeleteResponse {
221
+ data: {};
222
+ }
223
+ interface CidListQuery {
224
+ limit?: number;
225
+ pageToken?: string;
226
+ }
227
+ interface CidListResponse {
228
+ data: {
229
+ cids: string[];
230
+ next_page_token?: string;
231
+ };
232
+ }
233
+ interface CidAssociation {
234
+ payment_instruction_id: string;
235
+ cid: string;
236
+ created_at: string;
237
+ }
238
+ interface CidAssociationResponse {
239
+ data: CidAssociation;
240
+ }
241
+ interface CidRemoveResponse {
242
+ data: {};
243
+ }
244
+
178
245
  declare const analyticsDateInterval: (config: PinataConfig | undefined, options?: TimeIntervalAnalyticsQuery) => Promise<TimeIntervalAnalyticsResponse>;
179
246
 
180
247
  declare const analyticsTopUsage: (config: PinataConfig | undefined, options?: TopAnalyticsQuery) => Promise<TopAnalyticsResponse>;
@@ -247,6 +314,22 @@ declare const uploadUrl: (config: PinataConfig | undefined, url: string, network
247
314
 
248
315
  declare const uploadCid: (config: PinataConfig | undefined, cid: string, options?: UploadCIDOptions) => Promise<PinByCIDResponse>;
249
316
 
317
+ declare const listPaymentInstructions: (config: PinataConfig | undefined, options?: PaymentInstructionListQuery) => Promise<PaymentInstructionListResponse>;
318
+
319
+ declare const createPaymentInstruction: (config: PinataConfig | undefined, request: CreatePaymentInstructionRequest) => Promise<PaymentInstructionResponse>;
320
+
321
+ declare const getPaymentInstruction: (config: PinataConfig | undefined, id: string) => Promise<PaymentInstructionResponse>;
322
+
323
+ declare const updatePaymentInstruction: (config: PinataConfig | undefined, id: string, request: UpdatePaymentInstructionRequest) => Promise<PaymentInstructionResponse>;
324
+
325
+ declare const deletePaymentInstruction: (config: PinataConfig | undefined, id: string) => Promise<PaymentInstructionDeleteResponse>;
326
+
327
+ declare const listCids: (config: PinataConfig | undefined, paymentInstructionId: string, options?: CidListQuery) => Promise<CidListResponse>;
328
+
329
+ declare const addCid: (config: PinataConfig | undefined, paymentInstructionId: string, cid: string) => Promise<CidAssociationResponse>;
330
+
331
+ declare const removeCid: (config: PinataConfig | undefined, paymentInstructionId: string, cid: string) => Promise<CidRemoveResponse>;
332
+
250
333
  declare class Analytics {
251
334
  config: PinataConfig | undefined;
252
335
  requests: AnalyticsRequests;
@@ -587,6 +670,20 @@ declare class Signatures {
587
670
  updateConfig(newConfig: PinataConfig): void;
588
671
  }
589
672
 
673
+ declare class X402 {
674
+ config: PinataConfig | undefined;
675
+ constructor(config?: PinataConfig);
676
+ updateConfig(newConfig: PinataConfig): void;
677
+ listPaymentInstructions(options?: PaymentInstructionListQuery): Promise<PaymentInstructionListResponse>;
678
+ createPaymentInstruction(request: CreatePaymentInstructionRequest): Promise<PaymentInstructionResponse>;
679
+ getPaymentInstruction(id: string): Promise<PaymentInstructionResponse>;
680
+ updatePaymentInstruction(id: string, request: UpdatePaymentInstructionRequest): Promise<PaymentInstructionResponse>;
681
+ deletePaymentInstruction(id: string): Promise<PaymentInstructionDeleteResponse>;
682
+ listCids(paymentInstructionId: string, options?: CidListQuery): Promise<CidListResponse>;
683
+ addCid(paymentInstructionId: string, cid: string): Promise<CidAssociationResponse>;
684
+ removeCid(paymentInstructionId: string, cid: string): Promise<CidRemoveResponse>;
685
+ }
686
+
590
687
  declare class PinataSDK {
591
688
  config: PinataConfig | undefined;
592
689
  files: Files;
@@ -596,6 +693,7 @@ declare class PinataSDK {
596
693
  groups: Groups;
597
694
  analytics: Analytics;
598
695
  signatures: Signatures;
696
+ x402: X402;
599
697
  constructor(config?: PinataConfig);
600
698
  setNewHeaders(headers: Record<string, string>): void;
601
699
  setNewJwt(jwt: string): void;
@@ -606,4 +704,4 @@ declare function getFileIdFromUrl(url: string): string;
606
704
 
607
705
  declare const formatConfig: (config: PinataConfig | undefined) => PinataConfig | undefined;
608
706
 
609
- export { AccessLinkOptions, type AnalyticsQuery, CidVersion, type DataEndponts, DeleteResponse, type Endpoints, FileListItem, FileListQuery, FileListResponse, GetCIDResponse, type GetGroupOptions, type GroupCIDOptions, type GroupListResponse, type GroupOptions, type GroupQueryOptions, type GroupResponseItem, JsonBody, type KeyListItem, type KeyListQuery, type KeyListResponse, type KeyOptions, type KeyPermissions, type KeyResponse, OptimizeImageOptions, PinByCIDResponse, PinQueueItem, PinQueueQuery, PinQueueResponse, type PinataConfig, PinataSDK, type PinningEndpoints, type ResourcePermission, type RevokeKeyResponse, type SignatureOptions, type SignatureResponse, SignedUploadUrlOptions, SwapCidOptions, SwapCidResponse, SwapHistoryOptions, type TimeIntervalAnalyticsQuery, type TimeIntervalAnalyticsResponse, type TimePeriodItem, type TopAnalyticsItem, type TopAnalyticsQuery, type TopAnalyticsResponse, UpdateFileOptions, type UpdateGroupFilesResponse, type UpdateGroupOptions, UploadCIDOptions, UploadOptions, UploadResponse, type UserPinnedDataResponse, VectorizeFileResponse, VectorizeQuery, VectorizeQueryResponse, addToGroup, analyticsDateInterval, analyticsTopUsage, convertIPFSUrl, createAccessLink, createGroup, createKey, createSignedUploadURL, deleteFile, deleteFileVectors, deleteGroup, deletePinRequest, deleteSwap, formatConfig, getCid, getFileIdFromUrl, getGroup, listFiles, listGroups, listKeys, pinnedFileCount, queue, removeFromGroup, revokeKeys, swapCid, swapHistory, testAuthentication, totalStorageUsage, updateFile, updateGroup, uploadBase64, uploadCid, uploadFile, uploadFileArray, uploadJson, uploadUrl, vectorizeFile, vectorizeQuery };
707
+ export { AccessLinkOptions, type AnalyticsQuery, type CidAssociation, type CidAssociationResponse, type CidListQuery, type CidListResponse, type CidRemoveResponse, CidVersion, type CreatePaymentInstructionRequest, type DataEndponts, DeleteResponse, type Endpoints, FileListItem, FileListQuery, FileListResponse, GetCIDResponse, type GetGroupOptions, type GroupCIDOptions, type GroupListResponse, type GroupOptions, type GroupQueryOptions, type GroupResponseItem, JsonBody, type KeyListItem, type KeyListQuery, type KeyListResponse, type KeyOptions, type KeyPermissions, type KeyResponse, type NetworkIdentifier, OptimizeImageOptions, type PaymentInstruction, type PaymentInstructionDeleteResponse, type PaymentInstructionListQuery, type PaymentInstructionListResponse, type PaymentInstructionResponse, type PaymentRequirement, PinByCIDResponse, PinQueueItem, PinQueueQuery, PinQueueResponse, type PinataConfig, PinataSDK, type PinningEndpoints, type ResourcePermission, type RevokeKeyResponse, type SignatureOptions, type SignatureResponse, SignedUploadUrlOptions, SwapCidOptions, SwapCidResponse, SwapHistoryOptions, type TimeIntervalAnalyticsQuery, type TimeIntervalAnalyticsResponse, type TimePeriodItem, type TopAnalyticsItem, type TopAnalyticsQuery, type TopAnalyticsResponse, UpdateFileOptions, type UpdateGroupFilesResponse, type UpdateGroupOptions, type UpdatePaymentInstructionRequest, UploadCIDOptions, UploadOptions, UploadResponse, type UserPinnedDataResponse, VectorizeFileResponse, VectorizeQuery, VectorizeQueryResponse, addCid, addToGroup, analyticsDateInterval, analyticsTopUsage, convertIPFSUrl, createAccessLink, createGroup, createKey, createPaymentInstruction, createSignedUploadURL, deleteFile, deleteFileVectors, deleteGroup, deletePaymentInstruction, deletePinRequest, deleteSwap, formatConfig, getCid, getFileIdFromUrl, getGroup, getPaymentInstruction, listCids, listFiles, listGroups, listKeys, listPaymentInstructions, pinnedFileCount, queue, removeCid, removeFromGroup, revokeKeys, swapCid, swapHistory, testAuthentication, totalStorageUsage, updateFile, updateGroup, updatePaymentInstruction, uploadBase64, uploadCid, uploadFile, uploadFileArray, uploadJson, uploadUrl, vectorizeFile, vectorizeQuery };
package/dist/index.d.ts CHANGED
@@ -175,6 +175,73 @@ type SignatureResponse = {
175
175
  signature: string;
176
176
  };
177
177
 
178
+ type NetworkIdentifier = "base" | "base-sepolia" | "eip155:8453" | "eip155:84532";
179
+ interface PaymentRequirement {
180
+ asset: string;
181
+ pay_to: string;
182
+ network: NetworkIdentifier;
183
+ amount: string;
184
+ description?: string;
185
+ }
186
+ interface PaymentInstruction {
187
+ id: string;
188
+ version: number;
189
+ payment_requirements: PaymentRequirement[];
190
+ name: string;
191
+ description?: string;
192
+ created_at: string;
193
+ }
194
+ interface CreatePaymentInstructionRequest {
195
+ name: string;
196
+ payment_requirements: PaymentRequirement[];
197
+ description?: string;
198
+ }
199
+ interface UpdatePaymentInstructionRequest {
200
+ name?: string;
201
+ payment_requirements?: PaymentRequirement[];
202
+ description?: string;
203
+ }
204
+ interface PaymentInstructionListQuery {
205
+ limit?: number;
206
+ pageToken?: string;
207
+ cid?: string;
208
+ name?: string;
209
+ id?: string;
210
+ }
211
+ interface PaymentInstructionListResponse {
212
+ data: {
213
+ payment_instructions: PaymentInstruction[];
214
+ next_page_token?: string;
215
+ };
216
+ }
217
+ interface PaymentInstructionResponse {
218
+ data: PaymentInstruction;
219
+ }
220
+ interface PaymentInstructionDeleteResponse {
221
+ data: {};
222
+ }
223
+ interface CidListQuery {
224
+ limit?: number;
225
+ pageToken?: string;
226
+ }
227
+ interface CidListResponse {
228
+ data: {
229
+ cids: string[];
230
+ next_page_token?: string;
231
+ };
232
+ }
233
+ interface CidAssociation {
234
+ payment_instruction_id: string;
235
+ cid: string;
236
+ created_at: string;
237
+ }
238
+ interface CidAssociationResponse {
239
+ data: CidAssociation;
240
+ }
241
+ interface CidRemoveResponse {
242
+ data: {};
243
+ }
244
+
178
245
  declare const analyticsDateInterval: (config: PinataConfig | undefined, options?: TimeIntervalAnalyticsQuery) => Promise<TimeIntervalAnalyticsResponse>;
179
246
 
180
247
  declare const analyticsTopUsage: (config: PinataConfig | undefined, options?: TopAnalyticsQuery) => Promise<TopAnalyticsResponse>;
@@ -247,6 +314,22 @@ declare const uploadUrl: (config: PinataConfig | undefined, url: string, network
247
314
 
248
315
  declare const uploadCid: (config: PinataConfig | undefined, cid: string, options?: UploadCIDOptions) => Promise<PinByCIDResponse>;
249
316
 
317
+ declare const listPaymentInstructions: (config: PinataConfig | undefined, options?: PaymentInstructionListQuery) => Promise<PaymentInstructionListResponse>;
318
+
319
+ declare const createPaymentInstruction: (config: PinataConfig | undefined, request: CreatePaymentInstructionRequest) => Promise<PaymentInstructionResponse>;
320
+
321
+ declare const getPaymentInstruction: (config: PinataConfig | undefined, id: string) => Promise<PaymentInstructionResponse>;
322
+
323
+ declare const updatePaymentInstruction: (config: PinataConfig | undefined, id: string, request: UpdatePaymentInstructionRequest) => Promise<PaymentInstructionResponse>;
324
+
325
+ declare const deletePaymentInstruction: (config: PinataConfig | undefined, id: string) => Promise<PaymentInstructionDeleteResponse>;
326
+
327
+ declare const listCids: (config: PinataConfig | undefined, paymentInstructionId: string, options?: CidListQuery) => Promise<CidListResponse>;
328
+
329
+ declare const addCid: (config: PinataConfig | undefined, paymentInstructionId: string, cid: string) => Promise<CidAssociationResponse>;
330
+
331
+ declare const removeCid: (config: PinataConfig | undefined, paymentInstructionId: string, cid: string) => Promise<CidRemoveResponse>;
332
+
250
333
  declare class Analytics {
251
334
  config: PinataConfig | undefined;
252
335
  requests: AnalyticsRequests;
@@ -587,6 +670,20 @@ declare class Signatures {
587
670
  updateConfig(newConfig: PinataConfig): void;
588
671
  }
589
672
 
673
+ declare class X402 {
674
+ config: PinataConfig | undefined;
675
+ constructor(config?: PinataConfig);
676
+ updateConfig(newConfig: PinataConfig): void;
677
+ listPaymentInstructions(options?: PaymentInstructionListQuery): Promise<PaymentInstructionListResponse>;
678
+ createPaymentInstruction(request: CreatePaymentInstructionRequest): Promise<PaymentInstructionResponse>;
679
+ getPaymentInstruction(id: string): Promise<PaymentInstructionResponse>;
680
+ updatePaymentInstruction(id: string, request: UpdatePaymentInstructionRequest): Promise<PaymentInstructionResponse>;
681
+ deletePaymentInstruction(id: string): Promise<PaymentInstructionDeleteResponse>;
682
+ listCids(paymentInstructionId: string, options?: CidListQuery): Promise<CidListResponse>;
683
+ addCid(paymentInstructionId: string, cid: string): Promise<CidAssociationResponse>;
684
+ removeCid(paymentInstructionId: string, cid: string): Promise<CidRemoveResponse>;
685
+ }
686
+
590
687
  declare class PinataSDK {
591
688
  config: PinataConfig | undefined;
592
689
  files: Files;
@@ -596,6 +693,7 @@ declare class PinataSDK {
596
693
  groups: Groups;
597
694
  analytics: Analytics;
598
695
  signatures: Signatures;
696
+ x402: X402;
599
697
  constructor(config?: PinataConfig);
600
698
  setNewHeaders(headers: Record<string, string>): void;
601
699
  setNewJwt(jwt: string): void;
@@ -606,4 +704,4 @@ declare function getFileIdFromUrl(url: string): string;
606
704
 
607
705
  declare const formatConfig: (config: PinataConfig | undefined) => PinataConfig | undefined;
608
706
 
609
- export { AccessLinkOptions, type AnalyticsQuery, CidVersion, type DataEndponts, DeleteResponse, type Endpoints, FileListItem, FileListQuery, FileListResponse, GetCIDResponse, type GetGroupOptions, type GroupCIDOptions, type GroupListResponse, type GroupOptions, type GroupQueryOptions, type GroupResponseItem, JsonBody, type KeyListItem, type KeyListQuery, type KeyListResponse, type KeyOptions, type KeyPermissions, type KeyResponse, OptimizeImageOptions, PinByCIDResponse, PinQueueItem, PinQueueQuery, PinQueueResponse, type PinataConfig, PinataSDK, type PinningEndpoints, type ResourcePermission, type RevokeKeyResponse, type SignatureOptions, type SignatureResponse, SignedUploadUrlOptions, SwapCidOptions, SwapCidResponse, SwapHistoryOptions, type TimeIntervalAnalyticsQuery, type TimeIntervalAnalyticsResponse, type TimePeriodItem, type TopAnalyticsItem, type TopAnalyticsQuery, type TopAnalyticsResponse, UpdateFileOptions, type UpdateGroupFilesResponse, type UpdateGroupOptions, UploadCIDOptions, UploadOptions, UploadResponse, type UserPinnedDataResponse, VectorizeFileResponse, VectorizeQuery, VectorizeQueryResponse, addToGroup, analyticsDateInterval, analyticsTopUsage, convertIPFSUrl, createAccessLink, createGroup, createKey, createSignedUploadURL, deleteFile, deleteFileVectors, deleteGroup, deletePinRequest, deleteSwap, formatConfig, getCid, getFileIdFromUrl, getGroup, listFiles, listGroups, listKeys, pinnedFileCount, queue, removeFromGroup, revokeKeys, swapCid, swapHistory, testAuthentication, totalStorageUsage, updateFile, updateGroup, uploadBase64, uploadCid, uploadFile, uploadFileArray, uploadJson, uploadUrl, vectorizeFile, vectorizeQuery };
707
+ export { AccessLinkOptions, type AnalyticsQuery, type CidAssociation, type CidAssociationResponse, type CidListQuery, type CidListResponse, type CidRemoveResponse, CidVersion, type CreatePaymentInstructionRequest, type DataEndponts, DeleteResponse, type Endpoints, FileListItem, FileListQuery, FileListResponse, GetCIDResponse, type GetGroupOptions, type GroupCIDOptions, type GroupListResponse, type GroupOptions, type GroupQueryOptions, type GroupResponseItem, JsonBody, type KeyListItem, type KeyListQuery, type KeyListResponse, type KeyOptions, type KeyPermissions, type KeyResponse, type NetworkIdentifier, OptimizeImageOptions, type PaymentInstruction, type PaymentInstructionDeleteResponse, type PaymentInstructionListQuery, type PaymentInstructionListResponse, type PaymentInstructionResponse, type PaymentRequirement, PinByCIDResponse, PinQueueItem, PinQueueQuery, PinQueueResponse, type PinataConfig, PinataSDK, type PinningEndpoints, type ResourcePermission, type RevokeKeyResponse, type SignatureOptions, type SignatureResponse, SignedUploadUrlOptions, SwapCidOptions, SwapCidResponse, SwapHistoryOptions, type TimeIntervalAnalyticsQuery, type TimeIntervalAnalyticsResponse, type TimePeriodItem, type TopAnalyticsItem, type TopAnalyticsQuery, type TopAnalyticsResponse, UpdateFileOptions, type UpdateGroupFilesResponse, type UpdateGroupOptions, type UpdatePaymentInstructionRequest, UploadCIDOptions, UploadOptions, UploadResponse, type UserPinnedDataResponse, VectorizeFileResponse, VectorizeQuery, VectorizeQueryResponse, addCid, addToGroup, analyticsDateInterval, analyticsTopUsage, convertIPFSUrl, createAccessLink, createGroup, createKey, createPaymentInstruction, createSignedUploadURL, deleteFile, deleteFileVectors, deleteGroup, deletePaymentInstruction, deletePinRequest, deleteSwap, formatConfig, getCid, getFileIdFromUrl, getGroup, getPaymentInstruction, listCids, listFiles, listGroups, listKeys, listPaymentInstructions, pinnedFileCount, queue, removeCid, removeFromGroup, revokeKeys, swapCid, swapHistory, testAuthentication, totalStorageUsage, updateFile, updateGroup, updatePaymentInstruction, uploadBase64, uploadCid, uploadFile, uploadFileArray, uploadJson, uploadUrl, vectorizeFile, vectorizeQuery };