@kynesyslabs/demosdk 2.8.4 → 2.8.6
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/build/types/blockchain/TransactionSubtypes/IPFSTransaction.d.ts +41 -4
- package/build/types/blockchain/TransactionSubtypes/IPFSTransaction.js +10 -1
- package/build/types/blockchain/TransactionSubtypes/IPFSTransaction.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.js +3 -1
- package/build/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import { CustomCharges } from "../CustomCharges";
|
|
|
13
13
|
/**
|
|
14
14
|
* IPFS operation type constants
|
|
15
15
|
*/
|
|
16
|
-
export type IPFSOperationType = "IPFS_ADD" | "IPFS_PIN" | "IPFS_UNPIN";
|
|
16
|
+
export type IPFSOperationType = "IPFS_ADD" | "IPFS_PIN" | "IPFS_UNPIN" | "IPFS_EXTEND_PIN";
|
|
17
17
|
/**
|
|
18
18
|
* Payload for IPFS_ADD operation
|
|
19
19
|
*
|
|
@@ -29,6 +29,13 @@ export interface IPFSAddPayload {
|
|
|
29
29
|
filename?: string;
|
|
30
30
|
/** Optional metadata to associate with the pin */
|
|
31
31
|
metadata?: Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Optional pin duration
|
|
34
|
+
* - Preset string: 'permanent' | 'week' | 'month' | 'quarter' | 'year'
|
|
35
|
+
* - Custom number: duration in seconds (min 1 day, max 10 years)
|
|
36
|
+
* - undefined or 'permanent': pin never expires
|
|
37
|
+
*/
|
|
38
|
+
duration?: "permanent" | "week" | "month" | "quarter" | "year" | number;
|
|
32
39
|
/** Optional custom charges configuration (from ipfsQuote) */
|
|
33
40
|
custom_charges?: CustomCharges;
|
|
34
41
|
}
|
|
@@ -43,8 +50,13 @@ export interface IPFSPinPayload {
|
|
|
43
50
|
operation: "IPFS_PIN";
|
|
44
51
|
/** Content Identifier to pin */
|
|
45
52
|
cid: string;
|
|
46
|
-
/**
|
|
47
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Optional pin duration
|
|
55
|
+
* - Preset string: 'permanent' | 'week' | 'month' | 'quarter' | 'year'
|
|
56
|
+
* - Custom number: duration in seconds (min 1 day, max 10 years)
|
|
57
|
+
* - undefined or 'permanent': pin never expires
|
|
58
|
+
*/
|
|
59
|
+
duration?: "permanent" | "week" | "month" | "quarter" | "year" | number;
|
|
48
60
|
/** Optional metadata to associate with the pin */
|
|
49
61
|
metadata?: Record<string, unknown>;
|
|
50
62
|
/** Optional custom charges configuration (from ipfsQuote) */
|
|
@@ -62,10 +74,31 @@ export interface IPFSUnpinPayload {
|
|
|
62
74
|
/** Content Identifier to unpin */
|
|
63
75
|
cid: string;
|
|
64
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Payload for IPFS_EXTEND_PIN operation
|
|
79
|
+
*
|
|
80
|
+
* Extends the expiration time of an existing pin.
|
|
81
|
+
* User pays additional cost based on the extension duration.
|
|
82
|
+
*/
|
|
83
|
+
export interface IPFSExtendPinPayload {
|
|
84
|
+
/** The IPFS operation type */
|
|
85
|
+
operation: "IPFS_EXTEND_PIN";
|
|
86
|
+
/** Content Identifier of the pin to extend */
|
|
87
|
+
cid: string;
|
|
88
|
+
/**
|
|
89
|
+
* Additional duration to add
|
|
90
|
+
* - Preset string: 'week' | 'month' | 'quarter' | 'year'
|
|
91
|
+
* - Custom number: additional duration in seconds (min 1 day, max 10 years)
|
|
92
|
+
* Note: 'permanent' converts the pin to never expire
|
|
93
|
+
*/
|
|
94
|
+
additionalDuration: "permanent" | "week" | "month" | "quarter" | "year" | number;
|
|
95
|
+
/** Optional custom charges configuration (from ipfsQuote) */
|
|
96
|
+
custom_charges?: CustomCharges;
|
|
97
|
+
}
|
|
65
98
|
/**
|
|
66
99
|
* Union type for all IPFS payloads
|
|
67
100
|
*/
|
|
68
|
-
export type IPFSPayload = IPFSAddPayload | IPFSPinPayload | IPFSUnpinPayload;
|
|
101
|
+
export type IPFSPayload = IPFSAddPayload | IPFSPinPayload | IPFSUnpinPayload | IPFSExtendPinPayload;
|
|
69
102
|
/**
|
|
70
103
|
* Transaction content type for IPFS operations
|
|
71
104
|
*/
|
|
@@ -91,6 +124,10 @@ export declare function isIPFSPinPayload(payload: IPFSPayload): payload is IPFSP
|
|
|
91
124
|
* Check if a payload is an IPFS_UNPIN operation
|
|
92
125
|
*/
|
|
93
126
|
export declare function isIPFSUnpinPayload(payload: IPFSPayload): payload is IPFSUnpinPayload;
|
|
127
|
+
/**
|
|
128
|
+
* Check if a payload is an IPFS_EXTEND_PIN operation
|
|
129
|
+
*/
|
|
130
|
+
export declare function isIPFSExtendPinPayload(payload: IPFSPayload): payload is IPFSExtendPinPayload;
|
|
94
131
|
/**
|
|
95
132
|
* Check if any payload is an IPFS payload
|
|
96
133
|
*/
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.isIPFSAddPayload = isIPFSAddPayload;
|
|
14
14
|
exports.isIPFSPinPayload = isIPFSPinPayload;
|
|
15
15
|
exports.isIPFSUnpinPayload = isIPFSUnpinPayload;
|
|
16
|
+
exports.isIPFSExtendPinPayload = isIPFSExtendPinPayload;
|
|
16
17
|
exports.isIPFSPayload = isIPFSPayload;
|
|
17
18
|
// ============================================================================
|
|
18
19
|
// Type Guards
|
|
@@ -35,6 +36,13 @@ function isIPFSPinPayload(payload) {
|
|
|
35
36
|
function isIPFSUnpinPayload(payload) {
|
|
36
37
|
return payload.operation === "IPFS_UNPIN";
|
|
37
38
|
}
|
|
39
|
+
// REVIEW: DEM-481 - Pin extension type guard
|
|
40
|
+
/**
|
|
41
|
+
* Check if a payload is an IPFS_EXTEND_PIN operation
|
|
42
|
+
*/
|
|
43
|
+
function isIPFSExtendPinPayload(payload) {
|
|
44
|
+
return payload.operation === "IPFS_EXTEND_PIN";
|
|
45
|
+
}
|
|
38
46
|
/**
|
|
39
47
|
* Check if any payload is an IPFS payload
|
|
40
48
|
*/
|
|
@@ -44,6 +52,7 @@ function isIPFSPayload(payload) {
|
|
|
44
52
|
const p = payload;
|
|
45
53
|
return (p.operation === "IPFS_ADD" ||
|
|
46
54
|
p.operation === "IPFS_PIN" ||
|
|
47
|
-
p.operation === "IPFS_UNPIN"
|
|
55
|
+
p.operation === "IPFS_UNPIN" ||
|
|
56
|
+
p.operation === "IPFS_EXTEND_PIN");
|
|
48
57
|
}
|
|
49
58
|
//# sourceMappingURL=IPFSTransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPFSTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/IPFSTransaction.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;
|
|
1
|
+
{"version":3,"file":"IPFSTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/IPFSTransaction.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAyJH,4CAEC;AAKD,4CAEC;AAKD,gDAEC;AAMD,wDAEC;AAKD,sCASC;AA7CD,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;GAEG;AACH,SAAgB,gBAAgB,CAAC,OAAoB;IACjD,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU,CAAA;AAC3C,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,OAAoB;IACjD,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU,CAAA;AAC3C,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,OAAoB;IACnD,OAAO,OAAO,CAAC,SAAS,KAAK,YAAY,CAAA;AAC7C,CAAC;AAED,6CAA6C;AAC7C;;GAEG;AACH,SAAgB,sBAAsB,CAAC,OAAoB;IACvD,OAAO,OAAO,CAAC,SAAS,KAAK,iBAAiB,CAAA;AAClD,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,OAAgB;IAC1C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IACzD,MAAM,CAAC,GAAG,OAAkC,CAAA;IAC5C,OAAO,CACH,CAAC,CAAC,SAAS,KAAK,UAAU;QAC1B,CAAC,CAAC,SAAS,KAAK,UAAU;QAC1B,CAAC,CAAC,SAAS,KAAK,YAAY;QAC5B,CAAC,CAAC,SAAS,KAAK,iBAAiB,CACpC,CAAA;AACL,CAAC"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { ISignature } from "./blockchain/ISignature";
|
|
|
4
4
|
export { RawTransaction } from "./blockchain/rawTransaction";
|
|
5
5
|
export { Transaction, TransactionContent, TransactionContentData, } from "./blockchain/Transaction";
|
|
6
6
|
export { type CustomCharges, type IPFSCustomCharges, type IPFSCostBreakdown, type ValidityDataCustomCharges, hasIPFSCustomCharges, isValidCharge, } from "./blockchain/CustomCharges";
|
|
7
|
-
export { L2PSTransaction, Web2Transaction, CrosschainTransaction, NativeTransaction, DemosworkTransaction, IdentityTransaction, InstantMessagingTransaction, NativeBridgeTransaction, SpecificTransaction, IPFSTransaction, type IPFSTransactionContent, type IPFSPayload, type IPFSAddPayload, type IPFSPinPayload, type IPFSUnpinPayload, type IPFSOperationType, isIPFSAddPayload, isIPFSPinPayload, isIPFSUnpinPayload, isIPFSPayload, } from "./blockchain/TransactionSubtypes";
|
|
7
|
+
export { L2PSTransaction, Web2Transaction, CrosschainTransaction, NativeTransaction, DemosworkTransaction, IdentityTransaction, InstantMessagingTransaction, NativeBridgeTransaction, SpecificTransaction, IPFSTransaction, type IPFSTransactionContent, type IPFSPayload, type IPFSAddPayload, type IPFSPinPayload, type IPFSUnpinPayload, type IPFSExtendPinPayload, type IPFSOperationType, isIPFSAddPayload, isIPFSPinPayload, isIPFSUnpinPayload, isIPFSExtendPinPayload, isIPFSPayload, } from "./blockchain/TransactionSubtypes";
|
|
8
8
|
export { INativePayload } from "./native/INativePayload";
|
|
9
9
|
export { InstantMessagingPayload } from "./instantMessaging";
|
|
10
10
|
export { TxFee } from "./blockchain/TxFee";
|
package/build/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTransactionDataType = exports.isTransactionType = exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = exports.RPCResponseSkeleton = exports.stepKeysEnum = exports.XmStepResult = exports.DataTypes = exports.EnumWeb2Actions = exports.CValidityData = exports.isIPFSPayload = exports.isIPFSUnpinPayload = exports.isIPFSPinPayload = exports.isIPFSAddPayload = exports.isValidCharge = exports.hasIPFSCustomCharges = void 0;
|
|
3
|
+
exports.isTransactionDataType = exports.isTransactionType = exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = exports.RPCResponseSkeleton = exports.stepKeysEnum = exports.XmStepResult = exports.DataTypes = exports.EnumWeb2Actions = exports.CValidityData = exports.isIPFSPayload = exports.isIPFSExtendPinPayload = exports.isIPFSUnpinPayload = exports.isIPFSPinPayload = exports.isIPFSAddPayload = exports.isValidCharge = exports.hasIPFSCustomCharges = void 0;
|
|
4
4
|
// REVIEW: Phase 9 - Custom charges for variable-cost operations
|
|
5
5
|
var CustomCharges_1 = require("./blockchain/CustomCharges");
|
|
6
6
|
Object.defineProperty(exports, "hasIPFSCustomCharges", { enumerable: true, get: function () { return CustomCharges_1.hasIPFSCustomCharges; } });
|
|
@@ -10,6 +10,8 @@ var TransactionSubtypes_1 = require("./blockchain/TransactionSubtypes");
|
|
|
10
10
|
Object.defineProperty(exports, "isIPFSAddPayload", { enumerable: true, get: function () { return TransactionSubtypes_1.isIPFSAddPayload; } });
|
|
11
11
|
Object.defineProperty(exports, "isIPFSPinPayload", { enumerable: true, get: function () { return TransactionSubtypes_1.isIPFSPinPayload; } });
|
|
12
12
|
Object.defineProperty(exports, "isIPFSUnpinPayload", { enumerable: true, get: function () { return TransactionSubtypes_1.isIPFSUnpinPayload; } });
|
|
13
|
+
// REVIEW: DEM-481 - Pin expiration extension
|
|
14
|
+
Object.defineProperty(exports, "isIPFSExtendPinPayload", { enumerable: true, get: function () { return TransactionSubtypes_1.isIPFSExtendPinPayload; } });
|
|
13
15
|
Object.defineProperty(exports, "isIPFSPayload", { enumerable: true, get: function () { return TransactionSubtypes_1.isIPFSPayload; } });
|
|
14
16
|
var ValidityData_1 = require("./blockchain/ValidityData");
|
|
15
17
|
Object.defineProperty(exports, "CValidityData", { enumerable: true, get: function () { return ValidityData_1.CValidityData; } });
|
package/build/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAmBA,gEAAgE;AAChE,4DAOmC;AAF/B,qHAAA,oBAAoB,OAAA;AACpB,8GAAA,aAAa,OAAA;AAGjB,wCAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAmBA,gEAAgE;AAChE,4DAOmC;AAF/B,qHAAA,oBAAoB,OAAA;AACpB,8GAAA,aAAa,OAAA;AAGjB,wCAAwC;AACxC,wEA0ByC;AANrC,uHAAA,gBAAgB,OAAA;AAChB,uHAAA,gBAAgB,OAAA;AAChB,yHAAA,kBAAkB,OAAA;AAClB,6CAA6C;AAC7C,6HAAA,sBAAsB,OAAA;AACtB,oHAAA,aAAa,OAAA;AAUjB,0DAAuE;AAA9D,6GAAA,aAAa,OAAA;AA6CtB,OAAO;AACP,+BAce;AADX,uGAAA,eAAe,OAAA;AAgBnB,mDAA4D;AAAnD,sGAAA,SAAS,OAAA;AAOlB,2CAQ0B;AAHtB,qGAAA,YAAY,OAAA;AAEZ,qGAAA,YAAY,OAAA;AAGhB,2CAU4B;AADxB,0GAAA,aAAa,OAAuB;AAgBxC,gDAI2B;AAHvB,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,4GAAA,eAAe,OAAA;AAanB,+BAA+B;AAC/B,gEAG+C;AAF3C,0GAAA,iBAAiB,OAAA;AACjB,8GAAA,qBAAqB,OAAA"}
|
package/package.json
CHANGED