@kynesyslabs/demosdk 2.4.18 → 2.4.20
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/abstraction/Identities.d.ts +4 -2
- package/build/abstraction/Identities.js +36 -12
- package/build/abstraction/Identities.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/storage/StorageProgram.d.ts +192 -0
- package/build/storage/StorageProgram.js +257 -0
- package/build/storage/StorageProgram.js.map +1 -0
- package/build/storage/index.d.ts +2 -0
- package/build/storage/index.js +6 -0
- package/build/storage/index.js.map +1 -0
- package/build/types/abstraction/index.d.ts +2 -2
- package/build/types/blockchain/Transaction.d.ts +3 -2
- package/build/types/blockchain/Transaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.d.ts +70 -0
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/index.d.ts +3 -1
- package/build/types/blockchain/TransactionSubtypes/index.js +1 -0
- package/build/types/blockchain/TransactionSubtypes/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -222,8 +222,10 @@ export declare class Identities {
|
|
|
222
222
|
*
|
|
223
223
|
* Multi-chain resolution strategy (per UD docs):
|
|
224
224
|
* 1. Try Polygon L2 UNS first (most new domains, cheaper gas)
|
|
225
|
-
* 2.
|
|
226
|
-
* 3.
|
|
225
|
+
* 2. Try Base L2 UNS (new L2 option - growing adoption)
|
|
226
|
+
* 3. Try Sonic (emerging network support)
|
|
227
|
+
* 4. Fallback to Ethereum L1 UNS (legacy domains)
|
|
228
|
+
* 5. Fallback to Ethereum L1 CNS (oldest legacy domains)
|
|
227
229
|
*
|
|
228
230
|
* @param domain The UD domain (e.g., "brad.crypto")
|
|
229
231
|
* @returns Object with owner address, network, and registry type
|
|
@@ -498,8 +498,10 @@ class Identities {
|
|
|
498
498
|
*
|
|
499
499
|
* Multi-chain resolution strategy (per UD docs):
|
|
500
500
|
* 1. Try Polygon L2 UNS first (most new domains, cheaper gas)
|
|
501
|
-
* 2.
|
|
502
|
-
* 3.
|
|
501
|
+
* 2. Try Base L2 UNS (new L2 option - growing adoption)
|
|
502
|
+
* 3. Try Sonic (emerging network support)
|
|
503
|
+
* 4. Fallback to Ethereum L1 UNS (legacy domains)
|
|
504
|
+
* 5. Fallback to Ethereum L1 CNS (oldest legacy domains)
|
|
503
505
|
*
|
|
504
506
|
* @param domain The UD domain (e.g., "brad.crypto")
|
|
505
507
|
* @returns Object with owner address, network, and registry type
|
|
@@ -511,6 +513,10 @@ class Identities {
|
|
|
511
513
|
];
|
|
512
514
|
// Polygon L2 UNS Registry (primary - most new domains)
|
|
513
515
|
const polygonUnsRegistry = "0xa9a6A3626993D487d2Dbda3173cf58cA1a9D9e9f";
|
|
516
|
+
// Base L2 UNS Registry (new L2 option - growing adoption)
|
|
517
|
+
const baseUnsRegistry = "0xF6c1b83977DE3dEffC476f5048A0a84d3375d498";
|
|
518
|
+
// Sonic UNS Registry (emerging network support)
|
|
519
|
+
const sonicUnsRegistry = "0xDe1DAdcF11a7447C3D093e97FdbD513f488cE3b4";
|
|
514
520
|
// Ethereum L1 UNS Registry (fallback)
|
|
515
521
|
const ethereumUnsRegistry = "0x049aba7510f45BA5b64ea9E658E342F904DB358D";
|
|
516
522
|
// Ethereum L1 CNS Registry (legacy fallback)
|
|
@@ -523,19 +529,37 @@ class Identities {
|
|
|
523
529
|
return { owner, network: "polygon", registryType: "UNS" };
|
|
524
530
|
}
|
|
525
531
|
catch (polygonError) {
|
|
526
|
-
// Polygon failed, try
|
|
532
|
+
// Polygon failed, try Base L2 UNS
|
|
527
533
|
try {
|
|
528
|
-
const
|
|
529
|
-
const contract = new ethers_1.ethers.Contract(
|
|
534
|
+
const baseProvider = new ethers_1.ethers.JsonRpcProvider("https://mainnet.base.org");
|
|
535
|
+
const contract = new ethers_1.ethers.Contract(baseUnsRegistry, registryAbi, baseProvider);
|
|
530
536
|
const owner = await contract.ownerOf(tokenId);
|
|
531
|
-
return { owner, network: "
|
|
537
|
+
return { owner, network: "base", registryType: "UNS" };
|
|
532
538
|
}
|
|
533
|
-
catch (
|
|
534
|
-
//
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
+
catch (baseError) {
|
|
540
|
+
// Base failed, try Sonic
|
|
541
|
+
try {
|
|
542
|
+
const sonicProvider = new ethers_1.ethers.JsonRpcProvider("https://rpc.soniclabs.com");
|
|
543
|
+
const contract = new ethers_1.ethers.Contract(sonicUnsRegistry, registryAbi, sonicProvider);
|
|
544
|
+
const owner = await contract.ownerOf(tokenId);
|
|
545
|
+
return { owner, network: "sonic", registryType: "UNS" };
|
|
546
|
+
}
|
|
547
|
+
catch (sonicError) {
|
|
548
|
+
// Sonic failed, try Ethereum UNS
|
|
549
|
+
try {
|
|
550
|
+
const ethereumProvider = new ethers_1.ethers.JsonRpcProvider("https://eth.llamarpc.com");
|
|
551
|
+
const contract = new ethers_1.ethers.Contract(ethereumUnsRegistry, registryAbi, ethereumProvider);
|
|
552
|
+
const owner = await contract.ownerOf(tokenId);
|
|
553
|
+
return { owner, network: "ethereum", registryType: "UNS" };
|
|
554
|
+
}
|
|
555
|
+
catch (ethereumUnsError) {
|
|
556
|
+
// Ethereum UNS failed, try Ethereum CNS (legacy)
|
|
557
|
+
const ethereumProvider = new ethers_1.ethers.JsonRpcProvider("https://eth.llamarpc.com");
|
|
558
|
+
const contract = new ethers_1.ethers.Contract(ethereumCnsRegistry, registryAbi, ethereumProvider);
|
|
559
|
+
const owner = await contract.ownerOf(tokenId);
|
|
560
|
+
return { owner, network: "ethereum", registryType: "CNS" };
|
|
561
|
+
}
|
|
562
|
+
}
|
|
539
563
|
}
|
|
540
564
|
}
|
|
541
565
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,mBAAmB,CAAC,cAAsB;QACtC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QAErD,OAAO,CACH,4CAA4C;YAC5C,cAAc,cAAc,IAAI;YAChC,cAAc,SAAS,IAAI;YAC3B,UAAU,KAAK,EAAE,CACpB,CAAA;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,KAAK,CAAC,4BAA4B,CAC9B,KAAY,EACZ,MAAc,EACd,SAAiB,EACjB,UAAkB,EAClB,YAAqB;QAErB,0DAA0D;QAC1D,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAClC,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;QAEtC,qDAAqD;QACrD,kDAAkD;QAClD,MAAM,SAAS,GAAG,KAAK,CAAA;QAEvB,MAAM,SAAS,GAAsB;YACjC,MAAM;YACN,eAAe,EAAE,KAAK;YACtB,SAAS;YACT,SAAS;YACT,UAAU;YACV,OAAO;YACP,YAAY;SACf,CAAA;QAED,MAAM,OAAO,GAAwD;YACjE,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE,SAAS;YAClB,YAAY,EAAE,YAAY;SAC7B,CAAA;QAED,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,IAAW,EAAE,OAAO,CAAC,CAAA;IAChE,CAAC;CACJ;AAp2BD,gCAo2BC"}
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.instantMessaging = exports.bridge = exports.web2 = exports.abstraction = exports.websdk = exports.l2ps = exports.demoswork = exports.wallet = exports.xmcore = exports.xmwebsdk = exports.xmlocalsdk = exports.utils = exports.encryption = exports.types = void 0;
|
|
36
|
+
exports.storage = exports.instantMessaging = exports.bridge = exports.web2 = exports.abstraction = exports.websdk = exports.l2ps = exports.demoswork = exports.wallet = exports.xmcore = exports.xmwebsdk = exports.xmlocalsdk = exports.utils = exports.encryption = exports.types = void 0;
|
|
37
37
|
// Common types and constants
|
|
38
38
|
exports.types = __importStar(require("./types"));
|
|
39
39
|
// Basic cryptographic and data manipulation functions
|
|
@@ -52,4 +52,5 @@ exports.web2 = __importStar(require("./websdk/Web2Calls"));
|
|
|
52
52
|
// Export bridge module and its types
|
|
53
53
|
exports.bridge = __importStar(require("./bridge"));
|
|
54
54
|
exports.instantMessaging = __importStar(require("./instant_messaging"));
|
|
55
|
+
exports.storage = __importStar(require("./storage"));
|
|
55
56
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,iDAAgC;AAChC,sDAAsD;AACtD,2DAA0C;AAC1C,iDAAgC;AAEhC,gCAAgC;AAChC,oEAAmD;AACnD,gEAA+C;AAC/C,4DAA2C,CAAC,gCAAgC;AAE5E,mDAAkC;AAClC,yDAAwC;AAExC,+CAA8B;AAE9B,mDAAkC;AAClC,6DAA4C;AAC5C,2DAA0C;AAE1C,qCAAqC;AACrC,mDAAkC;AAElC,wEAAuD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,iDAAgC;AAChC,sDAAsD;AACtD,2DAA0C;AAC1C,iDAAgC;AAEhC,gCAAgC;AAChC,oEAAmD;AACnD,gEAA+C;AAC/C,4DAA2C,CAAC,gCAAgC;AAE5E,mDAAkC;AAClC,yDAAwC;AAExC,+CAA8B;AAE9B,mDAAkC;AAClC,6DAA4C;AAC5C,2DAA0C;AAE1C,qCAAqC;AACrC,mDAAkC;AAElC,wEAAuD;AAEvD,qDAAoC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { StorageProgramPayload, StorageProgramAccessControl } from "../types/blockchain/TransactionSubtypes/StorageProgramTransaction";
|
|
2
|
+
/**
|
|
3
|
+
* Storage Program class for creating and managing key-value storage on Demos Network
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Deterministic address derivation (stor-{sha256})
|
|
7
|
+
* - Key-value storage with 128KB limit
|
|
8
|
+
* - Access control (private, public, restricted, deployer-only)
|
|
9
|
+
* - Nested data structures (max 64 levels)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { StorageProgram } from '@kynesyslabs/demosdk'
|
|
14
|
+
*
|
|
15
|
+
* // Derive storage address
|
|
16
|
+
* const address = StorageProgram.deriveStorageAddress(
|
|
17
|
+
* 'myDeployerAddress',
|
|
18
|
+
* 'myAppConfig',
|
|
19
|
+
* 'randomSalt123'
|
|
20
|
+
* )
|
|
21
|
+
*
|
|
22
|
+
* // Create storage program
|
|
23
|
+
* const payload = StorageProgram.createStorageProgram(
|
|
24
|
+
* 'myDeployerAddress',
|
|
25
|
+
* 'myAppConfig',
|
|
26
|
+
* { apiKey: 'secret', endpoint: 'https://api.example.com' },
|
|
27
|
+
* 'public',
|
|
28
|
+
* 'randomSalt123'
|
|
29
|
+
* )
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class StorageProgram {
|
|
33
|
+
/**
|
|
34
|
+
* Derive a deterministic storage program address
|
|
35
|
+
*
|
|
36
|
+
* @param deployerAddress - Address of the program deployer
|
|
37
|
+
* @param programName - Name of the storage program
|
|
38
|
+
* @param salt - Optional random salt for uniqueness (default: empty string)
|
|
39
|
+
* @returns Storage address in format: stor-{first 40 chars of sha256}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const address = StorageProgram.deriveStorageAddress(
|
|
44
|
+
* 'demos1abc...',
|
|
45
|
+
* 'myConfig',
|
|
46
|
+
* 'salt123'
|
|
47
|
+
* )
|
|
48
|
+
* // Returns: 'stor-7a8b9c...' (40 chars after prefix)
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
static deriveStorageAddress(deployerAddress: string, programName: string, salt?: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Create a new Storage Program
|
|
54
|
+
*
|
|
55
|
+
* @param deployerAddress - Address creating the storage program (will be the deployer)
|
|
56
|
+
* @param programName - Name of the storage program
|
|
57
|
+
* @param initialData - Initial key-value data to store
|
|
58
|
+
* @param accessControl - Access control mode (default: 'private')
|
|
59
|
+
* @param salt - Optional random salt for address derivation
|
|
60
|
+
* @param allowedAddresses - List of allowed addresses (for 'restricted' mode)
|
|
61
|
+
* @returns StorageProgramPayload for transaction creation
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const payload = StorageProgram.createStorageProgram(
|
|
66
|
+
* 'demos1abc...',
|
|
67
|
+
* 'userPreferences',
|
|
68
|
+
* { theme: 'dark', language: 'en' },
|
|
69
|
+
* 'private'
|
|
70
|
+
* )
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
static createStorageProgram(deployerAddress: string, programName: string, initialData: Record<string, any>, accessControl?: StorageProgramAccessControl, salt?: string, allowedAddresses?: string[]): StorageProgramPayload;
|
|
74
|
+
/**
|
|
75
|
+
* Write or update key-value data in a Storage Program
|
|
76
|
+
*
|
|
77
|
+
* @param storageAddress - The storage program address (stor-{hash})
|
|
78
|
+
* @param data - Key-value data to write/update
|
|
79
|
+
* @returns StorageProgramPayload for transaction creation
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const payload = StorageProgram.writeStorage(
|
|
84
|
+
* 'stor-7a8b9c...',
|
|
85
|
+
* { newKey: 'value', existingKey: 'updatedValue' }
|
|
86
|
+
* )
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
static writeStorage(storageAddress: string, data: Record<string, any>): StorageProgramPayload;
|
|
90
|
+
/**
|
|
91
|
+
* Read data from a Storage Program (query operation, not a transaction)
|
|
92
|
+
*
|
|
93
|
+
* Note: This creates a payload for validation purposes.
|
|
94
|
+
* Actual reads should use RPC endpoints like GET /storage-program/:address
|
|
95
|
+
*
|
|
96
|
+
* @param storageAddress - The storage program address to read from
|
|
97
|
+
* @returns StorageProgramPayload for validation
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* // For transaction validation (not typical usage)
|
|
102
|
+
* const payload = StorageProgram.readStorage('stor-7a8b9c...')
|
|
103
|
+
*
|
|
104
|
+
* // Typical usage: Use RPC endpoint
|
|
105
|
+
* // fetch(`${rpcUrl}/storage-program/${storageAddress}`)
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
static readStorage(storageAddress: string): StorageProgramPayload;
|
|
109
|
+
/**
|
|
110
|
+
* Update access control settings for a Storage Program (deployer only)
|
|
111
|
+
*
|
|
112
|
+
* @param storageAddress - The storage program address
|
|
113
|
+
* @param accessControl - New access control mode
|
|
114
|
+
* @param allowedAddresses - Updated list of allowed addresses (for 'restricted' mode)
|
|
115
|
+
* @returns StorageProgramPayload for transaction creation
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* // Change from private to public
|
|
120
|
+
* const payload = StorageProgram.updateAccessControl(
|
|
121
|
+
* 'stor-7a8b9c...',
|
|
122
|
+
* 'public'
|
|
123
|
+
* )
|
|
124
|
+
*
|
|
125
|
+
* // Set restricted access with allowlist
|
|
126
|
+
* const payload = StorageProgram.updateAccessControl(
|
|
127
|
+
* 'stor-7a8b9c...',
|
|
128
|
+
* 'restricted',
|
|
129
|
+
* ['demos1user1...', 'demos1user2...']
|
|
130
|
+
* )
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
static updateAccessControl(storageAddress: string, accessControl: StorageProgramAccessControl, allowedAddresses?: string[]): StorageProgramPayload;
|
|
134
|
+
/**
|
|
135
|
+
* Delete an entire Storage Program (deployer only)
|
|
136
|
+
*
|
|
137
|
+
* WARNING: This operation is irreversible and will delete all stored data.
|
|
138
|
+
*
|
|
139
|
+
* @param storageAddress - The storage program address to delete
|
|
140
|
+
* @returns StorageProgramPayload for transaction creation
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* const payload = StorageProgram.deleteStorageProgram('stor-7a8b9c...')
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
static deleteStorageProgram(storageAddress: string): StorageProgramPayload;
|
|
148
|
+
/**
|
|
149
|
+
* Validate storage size against 128KB limit
|
|
150
|
+
*
|
|
151
|
+
* @param data - The data object to validate
|
|
152
|
+
* @returns true if size is within limit, false otherwise
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const data = { key: 'value', nested: { data: 'here' } }
|
|
157
|
+
* if (StorageProgram.validateSize(data)) {
|
|
158
|
+
* // Safe to store
|
|
159
|
+
* }
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
static validateSize(data: Record<string, any>): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Get the size of data in bytes
|
|
165
|
+
*
|
|
166
|
+
* @param data - The data object to measure
|
|
167
|
+
* @returns Size in bytes
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```typescript
|
|
171
|
+
* const size = StorageProgram.getDataSize({ key: 'value' })
|
|
172
|
+
* console.log(`Data size: ${size} bytes`)
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
static getDataSize(data: Record<string, any>): number;
|
|
176
|
+
/**
|
|
177
|
+
* Validate nesting depth (max 64 levels)
|
|
178
|
+
*
|
|
179
|
+
* @param data - The data object to validate
|
|
180
|
+
* @param maxDepth - Maximum allowed nesting depth (default: 64)
|
|
181
|
+
* @returns true if nesting depth is within limit
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const data = { level1: { level2: { level3: 'value' } } }
|
|
186
|
+
* if (StorageProgram.validateNestingDepth(data)) {
|
|
187
|
+
* // Safe nesting depth
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
static validateNestingDepth(data: any, maxDepth?: number): boolean;
|
|
192
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StorageProgram = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
// REVIEW: Storage Program class for key-value storage with access control
|
|
6
|
+
/**
|
|
7
|
+
* Storage Program class for creating and managing key-value storage on Demos Network
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - Deterministic address derivation (stor-{sha256})
|
|
11
|
+
* - Key-value storage with 128KB limit
|
|
12
|
+
* - Access control (private, public, restricted, deployer-only)
|
|
13
|
+
* - Nested data structures (max 64 levels)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { StorageProgram } from '@kynesyslabs/demosdk'
|
|
18
|
+
*
|
|
19
|
+
* // Derive storage address
|
|
20
|
+
* const address = StorageProgram.deriveStorageAddress(
|
|
21
|
+
* 'myDeployerAddress',
|
|
22
|
+
* 'myAppConfig',
|
|
23
|
+
* 'randomSalt123'
|
|
24
|
+
* )
|
|
25
|
+
*
|
|
26
|
+
* // Create storage program
|
|
27
|
+
* const payload = StorageProgram.createStorageProgram(
|
|
28
|
+
* 'myDeployerAddress',
|
|
29
|
+
* 'myAppConfig',
|
|
30
|
+
* { apiKey: 'secret', endpoint: 'https://api.example.com' },
|
|
31
|
+
* 'public',
|
|
32
|
+
* 'randomSalt123'
|
|
33
|
+
* )
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
class StorageProgram {
|
|
37
|
+
/**
|
|
38
|
+
* Derive a deterministic storage program address
|
|
39
|
+
*
|
|
40
|
+
* @param deployerAddress - Address of the program deployer
|
|
41
|
+
* @param programName - Name of the storage program
|
|
42
|
+
* @param salt - Optional random salt for uniqueness (default: empty string)
|
|
43
|
+
* @returns Storage address in format: stor-{first 40 chars of sha256}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const address = StorageProgram.deriveStorageAddress(
|
|
48
|
+
* 'demos1abc...',
|
|
49
|
+
* 'myConfig',
|
|
50
|
+
* 'salt123'
|
|
51
|
+
* )
|
|
52
|
+
* // Returns: 'stor-7a8b9c...' (40 chars after prefix)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
static deriveStorageAddress(deployerAddress, programName, salt = "") {
|
|
56
|
+
// Create hash input: deployerAddress:programName:salt
|
|
57
|
+
const hashInput = `${deployerAddress}:${programName}:${salt}`;
|
|
58
|
+
// SHA-256 hash and take first 40 characters
|
|
59
|
+
const hash = (0, crypto_1.createHash)("sha256").update(hashInput).digest("hex");
|
|
60
|
+
const addressHash = hash.substring(0, 40);
|
|
61
|
+
return `stor-${addressHash}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create a new Storage Program
|
|
65
|
+
*
|
|
66
|
+
* @param deployerAddress - Address creating the storage program (will be the deployer)
|
|
67
|
+
* @param programName - Name of the storage program
|
|
68
|
+
* @param initialData - Initial key-value data to store
|
|
69
|
+
* @param accessControl - Access control mode (default: 'private')
|
|
70
|
+
* @param salt - Optional random salt for address derivation
|
|
71
|
+
* @param allowedAddresses - List of allowed addresses (for 'restricted' mode)
|
|
72
|
+
* @returns StorageProgramPayload for transaction creation
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const payload = StorageProgram.createStorageProgram(
|
|
77
|
+
* 'demos1abc...',
|
|
78
|
+
* 'userPreferences',
|
|
79
|
+
* { theme: 'dark', language: 'en' },
|
|
80
|
+
* 'private'
|
|
81
|
+
* )
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
static createStorageProgram(deployerAddress, programName, initialData, accessControl = "private", salt, allowedAddresses) {
|
|
85
|
+
// Derive storage address
|
|
86
|
+
const storageAddress = this.deriveStorageAddress(deployerAddress, programName, salt || "");
|
|
87
|
+
return {
|
|
88
|
+
operation: "CREATE_STORAGE_PROGRAM",
|
|
89
|
+
storageAddress,
|
|
90
|
+
programName,
|
|
91
|
+
data: initialData,
|
|
92
|
+
accessControl,
|
|
93
|
+
allowedAddresses,
|
|
94
|
+
salt,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Write or update key-value data in a Storage Program
|
|
99
|
+
*
|
|
100
|
+
* @param storageAddress - The storage program address (stor-{hash})
|
|
101
|
+
* @param data - Key-value data to write/update
|
|
102
|
+
* @returns StorageProgramPayload for transaction creation
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* const payload = StorageProgram.writeStorage(
|
|
107
|
+
* 'stor-7a8b9c...',
|
|
108
|
+
* { newKey: 'value', existingKey: 'updatedValue' }
|
|
109
|
+
* )
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
static writeStorage(storageAddress, data) {
|
|
113
|
+
return {
|
|
114
|
+
operation: "WRITE_STORAGE",
|
|
115
|
+
storageAddress,
|
|
116
|
+
data,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Read data from a Storage Program (query operation, not a transaction)
|
|
121
|
+
*
|
|
122
|
+
* Note: This creates a payload for validation purposes.
|
|
123
|
+
* Actual reads should use RPC endpoints like GET /storage-program/:address
|
|
124
|
+
*
|
|
125
|
+
* @param storageAddress - The storage program address to read from
|
|
126
|
+
* @returns StorageProgramPayload for validation
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* // For transaction validation (not typical usage)
|
|
131
|
+
* const payload = StorageProgram.readStorage('stor-7a8b9c...')
|
|
132
|
+
*
|
|
133
|
+
* // Typical usage: Use RPC endpoint
|
|
134
|
+
* // fetch(`${rpcUrl}/storage-program/${storageAddress}`)
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
static readStorage(storageAddress) {
|
|
138
|
+
return {
|
|
139
|
+
operation: "READ_STORAGE",
|
|
140
|
+
storageAddress,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Update access control settings for a Storage Program (deployer only)
|
|
145
|
+
*
|
|
146
|
+
* @param storageAddress - The storage program address
|
|
147
|
+
* @param accessControl - New access control mode
|
|
148
|
+
* @param allowedAddresses - Updated list of allowed addresses (for 'restricted' mode)
|
|
149
|
+
* @returns StorageProgramPayload for transaction creation
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* // Change from private to public
|
|
154
|
+
* const payload = StorageProgram.updateAccessControl(
|
|
155
|
+
* 'stor-7a8b9c...',
|
|
156
|
+
* 'public'
|
|
157
|
+
* )
|
|
158
|
+
*
|
|
159
|
+
* // Set restricted access with allowlist
|
|
160
|
+
* const payload = StorageProgram.updateAccessControl(
|
|
161
|
+
* 'stor-7a8b9c...',
|
|
162
|
+
* 'restricted',
|
|
163
|
+
* ['demos1user1...', 'demos1user2...']
|
|
164
|
+
* )
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
static updateAccessControl(storageAddress, accessControl, allowedAddresses) {
|
|
168
|
+
return {
|
|
169
|
+
operation: "UPDATE_ACCESS_CONTROL",
|
|
170
|
+
storageAddress,
|
|
171
|
+
accessControl,
|
|
172
|
+
allowedAddresses,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Delete an entire Storage Program (deployer only)
|
|
177
|
+
*
|
|
178
|
+
* WARNING: This operation is irreversible and will delete all stored data.
|
|
179
|
+
*
|
|
180
|
+
* @param storageAddress - The storage program address to delete
|
|
181
|
+
* @returns StorageProgramPayload for transaction creation
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const payload = StorageProgram.deleteStorageProgram('stor-7a8b9c...')
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
static deleteStorageProgram(storageAddress) {
|
|
189
|
+
return {
|
|
190
|
+
operation: "DELETE_STORAGE_PROGRAM",
|
|
191
|
+
storageAddress,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Validate storage size against 128KB limit
|
|
196
|
+
*
|
|
197
|
+
* @param data - The data object to validate
|
|
198
|
+
* @returns true if size is within limit, false otherwise
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* const data = { key: 'value', nested: { data: 'here' } }
|
|
203
|
+
* if (StorageProgram.validateSize(data)) {
|
|
204
|
+
* // Safe to store
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
static validateSize(data) {
|
|
209
|
+
const jsonString = JSON.stringify(data);
|
|
210
|
+
const sizeInBytes = new TextEncoder().encode(jsonString).length;
|
|
211
|
+
const maxSizeInBytes = 128 * 1024; // 128KB
|
|
212
|
+
return sizeInBytes <= maxSizeInBytes;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Get the size of data in bytes
|
|
216
|
+
*
|
|
217
|
+
* @param data - The data object to measure
|
|
218
|
+
* @returns Size in bytes
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```typescript
|
|
222
|
+
* const size = StorageProgram.getDataSize({ key: 'value' })
|
|
223
|
+
* console.log(`Data size: ${size} bytes`)
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
static getDataSize(data) {
|
|
227
|
+
const jsonString = JSON.stringify(data);
|
|
228
|
+
return new TextEncoder().encode(jsonString).length;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Validate nesting depth (max 64 levels)
|
|
232
|
+
*
|
|
233
|
+
* @param data - The data object to validate
|
|
234
|
+
* @param maxDepth - Maximum allowed nesting depth (default: 64)
|
|
235
|
+
* @returns true if nesting depth is within limit
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* const data = { level1: { level2: { level3: 'value' } } }
|
|
240
|
+
* if (StorageProgram.validateNestingDepth(data)) {
|
|
241
|
+
* // Safe nesting depth
|
|
242
|
+
* }
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
static validateNestingDepth(data, maxDepth = 64) {
|
|
246
|
+
const getDepth = (obj, currentDepth = 1) => {
|
|
247
|
+
if (typeof obj !== "object" || obj === null) {
|
|
248
|
+
return currentDepth;
|
|
249
|
+
}
|
|
250
|
+
const depths = Object.values(obj).map(value => getDepth(value, currentDepth + 1));
|
|
251
|
+
return Math.max(...depths, currentDepth);
|
|
252
|
+
};
|
|
253
|
+
return getDepth(data) <= maxDepth;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
exports.StorageProgram = StorageProgram;
|
|
257
|
+
//# sourceMappingURL=StorageProgram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageProgram.js","sourceRoot":"","sources":["../../../src/storage/StorageProgram.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAOnC,0EAA0E;AAE1E;;;;;;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Q,CAAC,KAAK,EAAE,YAAY,GAAG,CAAC,CAAC,CACpC,CAAA;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,YAAY,CAAC,CAAA;QAC5C,CAAC,CAAA;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAA;IACrC,CAAC;CACJ;AAlQD,wCAkQC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { StorageProgram } from "./StorageProgram";
|
|
2
|
+
export type { StorageProgramPayload, StorageProgramAccessControl, StorageProgramOperation, StorageProgramTransactionContent, StorageProgramTransaction, } from "../types/blockchain/TransactionSubtypes/StorageProgramTransaction";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StorageProgram = void 0;
|
|
4
|
+
var StorageProgram_1 = require("./StorageProgram");
|
|
5
|
+
Object.defineProperty(exports, "StorageProgram", { enumerable: true, get: function () { return StorageProgram_1.StorageProgram; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/storage/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,gHAAA,cAAc,OAAA"}
|
|
@@ -167,7 +167,7 @@ export interface BaseUdIdentityPayload {
|
|
|
167
167
|
* Follows signature-based verification pattern (like XM identities)
|
|
168
168
|
* User signs challenge with domain's resolved Ethereum address
|
|
169
169
|
*
|
|
170
|
-
* Multi-chain support: Polygon L2
|
|
170
|
+
* Multi-chain support: Polygon L2, Base L2, Sonic, and Ethereum L1
|
|
171
171
|
*/
|
|
172
172
|
export interface UDIdentityPayload {
|
|
173
173
|
domain: string;
|
|
@@ -175,7 +175,7 @@ export interface UDIdentityPayload {
|
|
|
175
175
|
signature: string;
|
|
176
176
|
publicKey: string;
|
|
177
177
|
signedData: string;
|
|
178
|
-
network: "polygon" | "ethereum";
|
|
178
|
+
network: "polygon" | "ethereum" | "base" | "sonic";
|
|
179
179
|
registryType: "UNS" | "CNS";
|
|
180
180
|
}
|
|
181
181
|
export interface UDIdentityAssignPayload extends BaseUdIdentityPayload {
|
|
@@ -10,12 +10,13 @@ import { InstantMessagingPayload } from "../instantMessaging";
|
|
|
10
10
|
import { NativeBridgeTxPayload } from "../../bridge/nativeBridgeTypes";
|
|
11
11
|
import { L2PSEncryptedPayload } from "../../l2ps";
|
|
12
12
|
import { StoragePayload } from "./TransactionSubtypes/StorageTransaction";
|
|
13
|
+
import { StorageProgramPayload } from "./TransactionSubtypes/StorageProgramTransaction";
|
|
13
14
|
import { L2PSHashPayload } from "./TransactionSubtypes/L2PSHashTransaction";
|
|
14
15
|
import { ContractDeployPayload } from "./TransactionSubtypes/ContractDeployTransaction";
|
|
15
16
|
import { ContractCallPayload } from "./TransactionSubtypes/ContractCallTransaction";
|
|
16
|
-
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["l2psEncryptedTx", L2PSEncryptedPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload] | ["nativeBridge", NativeBridgeTxPayload] | ["storage", StoragePayload] | ["l2ps_hash_update", L2PSHashPayload] | ["contractDeploy", ContractDeployPayload] | ["contractCall", ContractCallPayload];
|
|
17
|
+
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["l2psEncryptedTx", L2PSEncryptedPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload] | ["nativeBridge", NativeBridgeTxPayload] | ["storage", StoragePayload] | ["storageProgram", StorageProgramPayload] | ["l2ps_hash_update", L2PSHashPayload] | ["contractDeploy", ContractDeployPayload] | ["contractCall", ContractCallPayload];
|
|
17
18
|
export interface TransactionContent {
|
|
18
|
-
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "nativeBridge" | "l2psEncryptedTx" | "storage" | "l2ps_hash_update" | "contractDeploy" | "contractCall";
|
|
19
|
+
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "nativeBridge" | "l2psEncryptedTx" | "storage" | "storageProgram" | "l2ps_hash_update" | "contractDeploy" | "contractCall";
|
|
19
20
|
from: string;
|
|
20
21
|
from_ed25519_address: string;
|
|
21
22
|
to: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/types/blockchain/Transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/types/blockchain/Transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwFA,uCAAuC;AACvC,wDAAqC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
/**
|
|
3
|
+
* Storage Program operations
|
|
4
|
+
*
|
|
5
|
+
* - CREATE_STORAGE_PROGRAM: Initialize a new storage program with access control
|
|
6
|
+
* - WRITE_STORAGE: Write/update key-value pairs in the storage
|
|
7
|
+
* - READ_STORAGE: Query operation (not a transaction, used for validation)
|
|
8
|
+
* - UPDATE_ACCESS_CONTROL: Modify access control settings (deployer only)
|
|
9
|
+
* - DELETE_STORAGE_PROGRAM: Remove the entire storage program (deployer only)
|
|
10
|
+
*/
|
|
11
|
+
export type StorageProgramOperation = "CREATE_STORAGE_PROGRAM" | "WRITE_STORAGE" | "READ_STORAGE" | "UPDATE_ACCESS_CONTROL" | "DELETE_STORAGE_PROGRAM";
|
|
12
|
+
/**
|
|
13
|
+
* Access control modes for Storage Programs
|
|
14
|
+
*
|
|
15
|
+
* - private: Only deployer can read and write
|
|
16
|
+
* - public: Anyone can read, only deployer can write
|
|
17
|
+
* - restricted: Only addresses in allowedAddresses can read/write
|
|
18
|
+
* - deployer-only: Only deployer has all permissions (same as private but explicit)
|
|
19
|
+
*/
|
|
20
|
+
export type StorageProgramAccessControl = "private" | "public" | "restricted" | "deployer-only";
|
|
21
|
+
/**
|
|
22
|
+
* Storage Program payload for transaction data
|
|
23
|
+
*
|
|
24
|
+
* @property operation - The storage operation to perform
|
|
25
|
+
* @property storageAddress - The storage program address (stor-{hash})
|
|
26
|
+
* @property programName - Name of the storage program (required for CREATE)
|
|
27
|
+
* @property data - Key-value data to write (required for CREATE and WRITE)
|
|
28
|
+
* @property accessControl - Access control mode (optional for CREATE, required for UPDATE_ACCESS_CONTROL)
|
|
29
|
+
* @property allowedAddresses - List of allowed addresses for 'restricted' mode
|
|
30
|
+
* @property salt - Random salt for address derivation (optional for CREATE)
|
|
31
|
+
*/
|
|
32
|
+
export interface StorageProgramPayload {
|
|
33
|
+
/** The storage operation to perform */
|
|
34
|
+
operation: StorageProgramOperation;
|
|
35
|
+
/** The storage program address (stor-{hash format}) */
|
|
36
|
+
storageAddress: string;
|
|
37
|
+
/** Name of the storage program (required for CREATE_STORAGE_PROGRAM) */
|
|
38
|
+
programName?: string;
|
|
39
|
+
/** Key-value data to write (for CREATE_STORAGE_PROGRAM and WRITE_STORAGE) */
|
|
40
|
+
data?: Record<string, any>;
|
|
41
|
+
/** Access control mode */
|
|
42
|
+
accessControl?: StorageProgramAccessControl;
|
|
43
|
+
/** Allowed addresses for 'restricted' access control */
|
|
44
|
+
allowedAddresses?: string[];
|
|
45
|
+
/** Random salt for deterministic address derivation (optional) */
|
|
46
|
+
salt?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Transaction content type for Storage Program operations.
|
|
50
|
+
* Extends the base TransactionContent with storageProgram-specific type and data.
|
|
51
|
+
*/
|
|
52
|
+
export type StorageProgramTransactionContent = Omit<TransactionContent, "type" | "data"> & {
|
|
53
|
+
type: "storageProgram";
|
|
54
|
+
data: ["storageProgram", StorageProgramPayload];
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Complete Storage Program transaction interface.
|
|
58
|
+
* Used for structured key-value storage on the blockchain with access control.
|
|
59
|
+
*
|
|
60
|
+
* Storage Programs support:
|
|
61
|
+
* - Key-value storage (max 128KB per program)
|
|
62
|
+
* - Access control (private, public, restricted, deployer-only)
|
|
63
|
+
* - Deterministic address derivation
|
|
64
|
+
* - Nested data structures (max 64 levels)
|
|
65
|
+
*
|
|
66
|
+
* @see STORAGE_PROGRAMS_SPEC.md for complete specification
|
|
67
|
+
*/
|
|
68
|
+
export interface StorageProgramTransaction extends Omit<Transaction, "content"> {
|
|
69
|
+
content: StorageProgramTransactionContent;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageProgramTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/StorageProgramTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -8,6 +8,7 @@ export * from './IdentityTransaction';
|
|
|
8
8
|
export * from './InstantMessagingTransaction';
|
|
9
9
|
export * from './NativeBridgeTransaction';
|
|
10
10
|
export * from './StorageTransaction';
|
|
11
|
+
export * from './StorageProgramTransaction';
|
|
11
12
|
export * from './ContractDeployTransaction';
|
|
12
13
|
export * from './ContractCallTransaction';
|
|
13
14
|
import { L2PSTransaction } from './L2PSTransaction';
|
|
@@ -20,6 +21,7 @@ import { IdentityTransaction } from './IdentityTransaction';
|
|
|
20
21
|
import { InstantMessagingTransaction } from './InstantMessagingTransaction';
|
|
21
22
|
import { NativeBridgeTransaction } from './NativeBridgeTransaction';
|
|
22
23
|
import { StorageTransaction } from './StorageTransaction';
|
|
24
|
+
import { StorageProgramTransaction } from './StorageProgramTransaction';
|
|
23
25
|
import { ContractDeployTransaction } from './ContractDeployTransaction';
|
|
24
26
|
import { ContractCallTransaction } from './ContractCallTransaction';
|
|
25
|
-
export type SpecificTransaction = L2PSTransaction | L2PSHashTransaction | Web2Transaction | CrosschainTransaction | NativeTransaction | DemosworkTransaction | IdentityTransaction | InstantMessagingTransaction | NativeBridgeTransaction | StorageTransaction | ContractDeployTransaction | ContractCallTransaction;
|
|
27
|
+
export type SpecificTransaction = L2PSTransaction | L2PSHashTransaction | Web2Transaction | CrosschainTransaction | NativeTransaction | DemosworkTransaction | IdentityTransaction | InstantMessagingTransaction | NativeBridgeTransaction | StorageTransaction | StorageProgramTransaction | ContractDeployTransaction | ContractCallTransaction;
|
|
@@ -24,6 +24,7 @@ __exportStar(require("./IdentityTransaction"), exports);
|
|
|
24
24
|
__exportStar(require("./InstantMessagingTransaction"), exports);
|
|
25
25
|
__exportStar(require("./NativeBridgeTransaction"), exports);
|
|
26
26
|
__exportStar(require("./StorageTransaction"), exports);
|
|
27
|
+
__exportStar(require("./StorageProgramTransaction"), exports);
|
|
27
28
|
__exportStar(require("./ContractDeployTransaction"), exports);
|
|
28
29
|
__exportStar(require("./ContractCallTransaction"), exports);
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,wDAAqC;AACrC,oDAAiC;AACjC,0DAAuC;AACvC,sDAAmC;AACnC,yDAAsC;AACtC,wDAAqC;AACrC,gEAA6C;AAC7C,4DAAyC;AACzC,uDAAoC;AACpC,8DAA2C;AAC3C,4DAAyC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,wDAAqC;AACrC,oDAAiC;AACjC,0DAAuC;AACvC,sDAAmC;AACnC,yDAAsC;AACtC,wDAAqC;AACrC,gEAA6C;AAC7C,4DAAyC;AACzC,uDAAoC;AACpC,8DAA2C;AAC3C,8DAA2C;AAC3C,4DAAyC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynesyslabs/demosdk",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.20",
|
|
4
4
|
"description": "Demosdk is a JavaScript/TypeScript SDK that provides a unified interface for interacting with Demos network",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|