@nevermined-io/commons 0.4.5 → 0.5.1

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.
Files changed (36) hide show
  1. package/dist/index.js +2 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/lib/constants/AssetConstants.js +2 -0
  4. package/dist/lib/constants/AssetConstants.js.map +1 -0
  5. package/dist/lib/constants/index.js +2 -0
  6. package/dist/lib/constants/index.js.map +1 -0
  7. package/dist/lib/ddo/DDO.d.ts +1 -1
  8. package/dist/lib/ddo/DDO.d.ts.map +1 -1
  9. package/dist/lib/ddo/DDO.js +78 -62
  10. package/dist/lib/ddo/DDO.js.map +1 -0
  11. package/dist/lib/ddo/index.js +2 -0
  12. package/dist/lib/ddo/index.js.map +1 -0
  13. package/dist/lib/types/ContractsTypes.d.ts +1 -1
  14. package/dist/lib/types/ContractsTypes.d.ts.map +1 -1
  15. package/dist/lib/types/ContractsTypes.js +5 -14
  16. package/dist/lib/types/ContractsTypes.js.map +1 -0
  17. package/dist/lib/types/DDOTypes.js +8 -6
  18. package/dist/lib/types/DDOTypes.js.map +1 -0
  19. package/dist/lib/types/GeneralTypes.js +3 -1
  20. package/dist/lib/types/GeneralTypes.js.map +1 -0
  21. package/dist/lib/types/MetadataTypes.js +24 -23
  22. package/dist/lib/types/MetadataTypes.js.map +1 -0
  23. package/dist/lib/types/TransactionTypes.js +7 -2
  24. package/dist/lib/types/TransactionTypes.js.map +1 -0
  25. package/dist/lib/types/TranscoderTypes.js +11 -9
  26. package/dist/lib/types/TranscoderTypes.js.map +1 -0
  27. package/dist/lib/types/index.js +2 -0
  28. package/dist/lib/types/index.js.map +1 -0
  29. package/dist/lib/types/types.d.ts +93 -1
  30. package/dist/lib/types/types.d.ts.map +1 -1
  31. package/dist/lib/types/types.js +176 -69
  32. package/dist/lib/types/types.js.map +1 -0
  33. package/package.json +21 -1
  34. package/src/lib/ddo/DDO.ts +1 -1
  35. package/src/lib/types/ContractsTypes.ts +1 -1
  36. package/src/lib/types/types.ts +114 -1
package/dist/index.js CHANGED
@@ -2,3 +2,5 @@ export * from './lib/types/index.js';
2
2
  export * from './lib/ddo/index.js';
3
3
  export * from './lib/constants/index.js';
4
4
  export { DDO } from './lib/ddo/DDO.js';
5
+
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './lib/types/index.js'\nexport * from './lib/ddo/index.js'\nexport * from './lib/constants/index.js'\nexport { DDO } from './lib/ddo/DDO.js'\n"],"names":["DDO"],"mappings":"AAAA,cAAc,uBAAsB;AACpC,cAAc,qBAAoB;AAClC,cAAc,2BAA0B;AACxC,SAASA,GAAG,QAAQ,mBAAkB"}
@@ -1,3 +1,5 @@
1
1
  export const NETWORK_FEE_DENOMINATOR = 10000n;
2
2
  // The default encryption method
3
3
  export const DEFAULT_ENCRYPTION_METHOD = 'PSK-RSA';
4
+
5
+ //# sourceMappingURL=AssetConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/constants/AssetConstants.ts"],"sourcesContent":["export const NETWORK_FEE_DENOMINATOR = 10000n\n\n// The type of the encryption methods supported for the private data included in the metadata\nexport type EncryptionMethod = 'PSK-RSA' | 'PSK-ECDSA'\n\n// The default encryption method\nexport const DEFAULT_ENCRYPTION_METHOD = 'PSK-RSA' as EncryptionMethod\n"],"names":["NETWORK_FEE_DENOMINATOR","DEFAULT_ENCRYPTION_METHOD"],"mappings":"AAAA,OAAO,MAAMA,0BAA0B,MAAM,CAAA;AAK7C,gCAAgC;AAChC,OAAO,MAAMC,4BAA4B,UAA6B"}
@@ -1 +1,3 @@
1
1
  export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/constants/index.ts"],"sourcesContent":["export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js'\nexport type { EncryptionMethod } from './AssetConstants.js'\n"],"names":["DEFAULT_ENCRYPTION_METHOD","NETWORK_FEE_DENOMINATOR"],"mappings":"AAAA,SAASA,yBAAyB,EAAEC,uBAAuB,QAAQ,sBAAqB"}
@@ -23,7 +23,7 @@ export declare class DDO {
23
23
  created: string;
24
24
  updated?: string;
25
25
  metadata: Metadata;
26
- registry: Registry;
26
+ registry?: Registry;
27
27
  constructor(ddo?: Partial<DDO>);
28
28
  }
29
29
  export declare class AgentDDO extends DDO {
@@ -1 +1 @@
1
- {"version":3,"file":"DDO.d.ts","sourceRoot":"","sources":["../../../src/lib/ddo/DDO.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,IAAI,EAAe,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAQ1D,KAAK,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAA;AAE/B,qBAAa,GAAG;IACd;;;;OAIG;WACW,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;IAIzC;;;;OAIG;WACW,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG;IAMjD;;OAEG;IACI,EAAE,SAAK;IAIP,CAAC,UAAU,CAAC,SAA4B;IAExC,IAAI,EAAE,SAAS,CAA2D;IAE1E,OAAO,EAAE,MAAM,CAAqD;IAEpE,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,QAAQ,EAAE,QAAQ,CAgBxB;IAEM,QAAQ,EAAE,QAAQ,CAAA;gBAEN,GAAG,GAAE,OAAO,CAAC,GAAG,CAAM;CAK1C;AAED,qBAAa,QAAS,SAAQ,GAAG;IACf,QAAQ,EAAE,QAAQ,CAMjC;gBAEkB,GAAG,GAAE,OAAO,CAAC,QAAQ,CAAM;WAIhC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,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,QAAQ,EAAE,IAAI,CAK7B;gBAEkB,GAAG,GAAE,OAAO,CAAC,OAAO,CAAM;WAI/B,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;CAYxF"}
@@ -1,97 +1,113 @@
1
- const jsonReplacer = (_key, value) => {
1
+ const jsonReplacer = (_key, value)=>{
2
2
  // Modify the value or return undefined to exclude the property
3
3
  return typeof value === 'bigint' ? value.toString() : value;
4
4
  };
5
5
  export class DDO {
6
6
  /**
7
- * Serializes the DDO object.
8
- * @param ddo - The {@link DDO} to be serialized.
9
- * @returns DDO serialized.
10
- */
11
- static serialize(ddo) {
7
+ * Serializes the DDO object.
8
+ * @param ddo - The {@link DDO} to be serialized.
9
+ * @returns DDO serialized.
10
+ */ static serialize(ddo) {
12
11
  return JSON.stringify(ddo, jsonReplacer, 2);
13
12
  }
14
13
  /**
15
- * Deserializes the DDO object.
16
- * @param ddoString - The serialized {@link DDO} to be deserialized.
17
- * @returns The deserialized {@link DDO}.
18
- */
19
- static deserialize(ddoString) {
14
+ * Deserializes the DDO object.
15
+ * @param ddoString - The serialized {@link DDO} to be deserialized.
16
+ * @returns The deserialized {@link DDO}.
17
+ */ static deserialize(ddoString) {
20
18
  const ddo = JSON.parse(ddoString);
21
19
  return new DDO(ddo);
22
20
  }
23
- /**
24
- * DID, decentralizes ID.
25
- */
26
- id = '';
27
- // public didSeed = ''
28
- ['@context'] = 'https://w3id.org/did/v1';
29
- _nvm = { userId: '', userAddress: '', appId: '', versions: [] };
30
- created = new Date().toISOString().replace(/\.[0-9]{3}/, '');
31
- updated;
32
- metadata = {
33
- serviceEndpoint: '',
34
- main: {
35
- name: '',
36
- description: '',
37
- dateCreated: '',
38
- datePublished: '',
39
- license: '',
40
- tags: [],
41
- },
42
- curation: {
43
- numVotes: 0,
44
- rating: 0,
45
- schema: '',
46
- isListed: true,
47
- },
48
- };
49
- registry;
50
- constructor(ddo = {}) {
21
+ constructor(ddo = {}){
22
+ /**
23
+ * DID, decentralizes ID.
24
+ */ this.id = '';
25
+ // public didSeed = ''
26
+ this['@context'] = 'https://w3id.org/did/v1';
27
+ this._nvm = {
28
+ userId: '',
29
+ userAddress: '',
30
+ appId: '',
31
+ versions: []
32
+ };
33
+ this.created = new Date().toISOString().replace(/\.[0-9]{3}/, '');
34
+ this.metadata = {
35
+ serviceEndpoint: '',
36
+ main: {
37
+ name: '',
38
+ description: '',
39
+ dateCreated: '',
40
+ datePublished: '',
41
+ license: '',
42
+ tags: []
43
+ },
44
+ curation: {
45
+ numVotes: 0,
46
+ rating: 0,
47
+ schema: '',
48
+ isListed: true
49
+ }
50
+ };
51
51
  Object.assign(this, ddo, {
52
- created: (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, ''),
52
+ created: ddo && ddo.created || new Date().toISOString().replace(/\.[0-9]{3}/, '')
53
53
  });
54
54
  }
55
55
  }
56
56
  export class AgentDDO extends DDO {
57
- registry = {
58
- owner: '0x',
59
- creator: '0x',
60
- url: '',
61
- lastUpdated: 0n,
62
- plans: [],
63
- };
64
- constructor(ddo = {}) {
65
- super(ddo);
57
+ constructor(ddo = {}){
58
+ super(ddo), this.registry = {
59
+ owner: '0x',
60
+ creator: '0x',
61
+ url: '',
62
+ lastUpdated: 0n,
63
+ plans: []
64
+ };
66
65
  }
67
66
  static getInstance(userId, userAddress, appId) {
68
67
  return new AgentDDO({
69
68
  id: '',
70
- _nvm: { userId, userAddress, appId: appId || '', versions: [] },
71
- registry: { owner: '0x', creator: '0x', url: '', lastUpdated: 0n, plans: [] },
69
+ _nvm: {
70
+ userId,
71
+ userAddress,
72
+ appId: appId || '',
73
+ versions: []
74
+ },
75
+ registry: {
76
+ owner: '0x',
77
+ creator: '0x',
78
+ url: '',
79
+ lastUpdated: 0n,
80
+ plans: []
81
+ }
72
82
  });
73
83
  }
74
84
  }
75
85
  export class PlanDDO extends DDO {
76
- registry = {
77
- owner: '0x',
78
- price: {},
79
- credits: {},
80
- lastUpdated: 0n,
81
- };
82
- constructor(ddo = {}) {
83
- super(ddo);
86
+ constructor(ddo = {}){
87
+ super(ddo), this.registry = {
88
+ owner: '0x',
89
+ price: {},
90
+ credits: {},
91
+ lastUpdated: 0n
92
+ };
84
93
  }
85
94
  static getInstance(userId, userAddress, appId) {
86
95
  return new PlanDDO({
87
96
  id: '',
88
- _nvm: { userId, userAddress, appId: appId || '', versions: [] },
97
+ _nvm: {
98
+ userId,
99
+ userAddress,
100
+ appId: appId || '',
101
+ versions: []
102
+ },
89
103
  registry: {
90
104
  owner: '0x',
91
105
  price: {},
92
106
  credits: {},
93
- lastUpdated: 0n,
94
- },
107
+ lastUpdated: 0n
108
+ }
95
109
  });
96
110
  }
97
111
  }
112
+
113
+ //# sourceMappingURL=DDO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/ddo/DDO.ts"],"sourcesContent":["import { CreditsConfig, DIDAgent, Plan, PriceConfig } from '../types/ContractsTypes.js'\nimport { Metadata, NvmConfig } from '../types/DDOTypes.js'\n\nconst jsonReplacer = (_key: string, value: unknown) => {\n // Modify the value or return undefined to exclude the property\n return typeof value === 'bigint' ? value.toString() : value\n}\n\n// Union type for registry\ntype Registry = DIDAgent | Plan\n\nexport class DDO {\n /**\n * Serializes the DDO object.\n * @param ddo - The {@link DDO} to be serialized.\n * @returns DDO serialized.\n */\n public static serialize(ddo: DDO): string {\n return JSON.stringify(ddo, jsonReplacer, 2)\n }\n\n /**\n * Deserializes the DDO object.\n * @param ddoString - The serialized {@link DDO} to be deserialized.\n * @returns The deserialized {@link DDO}.\n */\n public static deserialize(ddoString: string): DDO {\n const ddo = JSON.parse(ddoString)\n\n return new DDO(ddo)\n }\n\n /**\n * DID, decentralizes ID.\n */\n public id = ''\n\n // public didSeed = ''\n\n public ['@context'] = 'https://w3id.org/did/v1'\n\n public _nvm: NvmConfig = { userId: '', userAddress: '', appId: '', versions: [] }\n\n public created: string = new Date().toISOString().replace(/\\.[0-9]{3}/, '')\n\n public updated?: string\n\n public metadata: Metadata = {\n serviceEndpoint: '',\n main: {\n name: '',\n description: '',\n dateCreated: '',\n datePublished: '',\n license: '',\n tags: [],\n },\n curation: {\n numVotes: 0,\n rating: 0,\n schema: '',\n isListed: true,\n },\n }\n\n public registry?: Registry\n\n public constructor(ddo: Partial<DDO> = {}) {\n Object.assign(this, ddo, {\n created: (ddo && ddo.created) || new Date().toISOString().replace(/\\.[0-9]{3}/, ''),\n })\n }\n}\n\nexport class AgentDDO extends DDO {\n public override registry: DIDAgent = {\n owner: '0x',\n creator: '0x',\n url: '',\n lastUpdated: 0n,\n plans: [],\n }\n\n public constructor(ddo: Partial<AgentDDO> = {}) {\n super(ddo)\n }\n\n public static getInstance(userId: string, userAddress: string, appId?: string): AgentDDO {\n return new AgentDDO({\n id: '',\n _nvm: { userId, userAddress, appId: appId || '', versions: [] },\n registry: { owner: '0x', creator: '0x', url: '', lastUpdated: 0n, plans: [] },\n })\n }\n}\n\nexport class PlanDDO extends DDO {\n public override registry: Plan = {\n owner: '0x',\n price: {} as PriceConfig,\n credits: {} as CreditsConfig,\n lastUpdated: 0n,\n }\n\n public constructor(ddo: Partial<PlanDDO> = {}) {\n super(ddo)\n }\n\n public static getInstance(userId: string, userAddress: string, appId?: string): PlanDDO {\n return new PlanDDO({\n id: '',\n _nvm: { userId, userAddress, appId: appId || '', versions: [] },\n registry: {\n owner: '0x',\n price: {} as PriceConfig,\n credits: {} as CreditsConfig,\n lastUpdated: 0n,\n },\n })\n }\n}\n"],"names":["jsonReplacer","_key","value","toString","DDO","serialize","ddo","JSON","stringify","deserialize","ddoString","parse","id","_nvm","userId","userAddress","appId","versions","created","Date","toISOString","replace","metadata","serviceEndpoint","main","name","description","dateCreated","datePublished","license","tags","curation","numVotes","rating","schema","isListed","Object","assign","AgentDDO","registry","owner","creator","url","lastUpdated","plans","getInstance","PlanDDO","price","credits"],"mappings":"AAGA,MAAMA,eAAe,CAACC,MA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;YACJC,MAAM;gBAAEC;gBAAQC;gBAAaC,OAAOA,SAAS;gBAAIC,UAAU,EAAE;YAAC;YAC9DsB,UAAU;gBAAEC,OAAO;gBAAMC,SAAS;gBAAMC,KAAK;gBAAIC,aAAa,EAAE;gBAAEC,OAAO,EAAE;YAAC;QAC9E;IACF;AACF;AAEA,OAAO,MAAME,gBAAgB1C;IAQ3B,YAAmBE,MAAwB,CAAC,CAAC,CAAE;QAC7C,KAAK,CAACA,WARQiC,WAAiB;YAC/BC,OAAO;YACPO,OAAO,CAAC;YACRC,SAAS,CAAC;YACVL,aAAa,EAAE;QACjB;IAIA;IAEA,OAAcE,YAAY/B,MAAc,EAAEC,WAAmB,EAAEC,KAAc,EAAW;QACtF,OAAO,IAAI8B,QAAQ;YACjBlC,IAAI;YACJC,MAAM;gBAAEC;gBAAQC;gBAAaC,OAAOA,SAAS;gBAAIC,UAAU,EAAE;YAAC;YAC9DsB,UAAU;gBACRC,OAAO;gBACPO,OAAO,CAAC;gBACRC,SAAS,CAAC;gBACVL,aAAa,EAAE;YACjB;QACF;IACF;AACF"}
@@ -1 +1,3 @@
1
1
  export * from './DDO.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/ddo/index.ts"],"sourcesContent":["export * from './DDO.js'\n"],"names":[],"mappings":"AAAA,cAAc,WAAU"}
@@ -81,7 +81,7 @@ export interface CreditsConfig {
81
81
  */
82
82
  nftAddress?: Address;
83
83
  }
84
- export declare class Plan {
84
+ export interface Plan {
85
85
  owner: Address;
86
86
  price: PriceConfig;
87
87
  credits: CreditsConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"ContractsTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/types/ContractsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAS9B,oBAAY,cAAc;IACxB,gBAAgB,IAAA;IAChB,UAAU,IAAA;IACV,cAAc,I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E,MAAM,CAAA;CACpB"}
@@ -5,22 +5,13 @@
5
5
  /// If ONLY_PLAN_ROLE it means the credits can be redeemed by an account with specifics grants for the plan
6
6
  /// If OWNER_OR_GLOBAL_ROLE means Only the owner OR accounts with CREDITS_BURNER_ROLE can redeem
7
7
  /// If ONLY_SUBSCRIBER means only the subscriber (the one who holds the credits NFT) can redeem
8
- export var RedemptionType;
9
- (function (RedemptionType) {
8
+ export var RedemptionType = /*#__PURE__*/ function(RedemptionType) {
10
9
  RedemptionType[RedemptionType["ONLY_GLOBAL_ROLE"] = 0] = "ONLY_GLOBAL_ROLE";
11
10
  RedemptionType[RedemptionType["ONLY_OWNER"] = 1] = "ONLY_OWNER";
12
11
  RedemptionType[RedemptionType["ONLY_PLAN_ROLE"] = 2] = "ONLY_PLAN_ROLE";
13
12
  RedemptionType[RedemptionType["OWNER_OR_GLOBAL_ROLE"] = 3] = "OWNER_OR_GLOBAL_ROLE";
14
13
  RedemptionType[RedemptionType["ONLY_SUBSCRIBER"] = 4] = "ONLY_SUBSCRIBER";
15
- })(RedemptionType || (RedemptionType = {}));
16
- /// Definition of a plan
17
- export class Plan {
18
- // The owner of the Plan
19
- owner;
20
- // The price configuration of the plan
21
- price;
22
- // The credits configuration of the plan
23
- credits;
24
- // The timestamp of the last time the plan definition was updated
25
- lastUpdated;
26
- }
14
+ return RedemptionType;
15
+ }({});
16
+
17
+ //# sourceMappingURL=ContractsTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/ContractsTypes.ts"],"sourcesContent":["import { Address } from 'viem'\n\n/// Different types of redemptions criterias that can be used when redeeming credits\n/// @notice 0 - ONLY_GLOBAL_ROLE, 1 - ONLY_OWNER, 2 - ROLE_AND_OWNER\n/// If ONLY_GLOBAL_ROLE it means the credits can be redeemed only by an account with the `CREDITS_BURNER_ROLE`\n/// If ONLY_OWNER it means the credits can be redeemed only by the owner of the Plan\n/// If ONLY_PLAN_ROLE it means the credits can be redeemed by an account with specifics grants for the plan\n/// If OWNER_OR_GLOBAL_ROLE means Only the owner OR accounts with CREDITS_BURNER_ROLE can redeem\n/// If ONLY_SUBSCRIBER means only the subscriber (the one who holds the credits NFT) can redeem\nexport enum RedemptionType {\n ONLY_GLOBAL_ROLE,\n ONLY_OWNER,\n ONLY_PLAN_ROLE,\n OWNER_OR_GLOBAL_ROLE,\n ONLY_SUBSCRIBER,\n}\n\nexport interface DIDAgent {\n // The owner of the asset\n owner: Address\n // Asset original creator, this can't be modified after the asset is registered\n creator: Address\n // URL to the metadata associated to the DID\n url: string\n // When was the DID last updated\n lastUpdated: bigint\n // Array of plans that can be used to purchase access to the asset\n plans: bigint[]\n}\n\n/// Definition of the price configuration for a plan\nexport interface PriceConfig {\n /**\n * @notice Indicates if the price is in cryptocurrency (true) or fiat currency (false)\n */\n isCrypto: boolean\n /**\n * @notice Indicates if the price is in cryptocurrency (true) or fiat currency (false)\n */\n tokenAddress?: Address\n /**\n * The amounts to be paid for the plan\n * @notice only if the price is not calculated by a smart contract\n */\n amounts: bigint[]\n /**\n * The receivers of the payments of the plan\n * @notice only if the price is not calculated by a smart contract\n */\n receivers: string[]\n /**\n * The address of the smart contract that calculates the price\n */\n externalPriceAddress?: Address\n /**\n * The address of the fee controller contract, if any\n * @notice if not given, the fee controller is the default one\n */\n feeController?: Address\n /**\n * @notice The template contract address associated with the plan\n */\n templateAddress?: Address\n}\n\n/// Definition of the credits configuration for a plan\nexport interface CreditsConfig {\n /**\n * @notice Indicates if the redemption amount is fixed (true) or dynamic (false)\n */\n isRedemptionAmountFixed: boolean\n /**\n * How the credits can be redeemed\n */\n redemptionType: RedemptionType\n /**\n * Whether the credits burn proof signed by the user is required\n */\n onchainMirror: boolean\n /**\n * The duration of the credits in seconds\n */\n durationSecs: bigint\n /**\n * The amount of credits that are granted when purchasing the plan\n */\n amount: bigint\n /**\n * The minimum number of credits redeemed when using the plan\n */\n minAmount: bigint\n /**\n * The maximum number of credits redeemed when using the plan\n * @notice only if isRedemptionAmountFixed is false\n */\n maxAmount: bigint\n /**\n * The address of the NFT contract that represents the plan's credits\n */\n nftAddress?: Address\n}\n\n/// Definition of a plan\nexport interface Plan {\n // The owner of the Plan\n owner: Address\n // The price configuration of the plan\n price: PriceConfig\n // The credits configuration of the plan\n credits: CreditsConfig\n // The timestamp of the last time the plan definition was updated\n lastUpdated: bigint\n}\n"],"names":["RedemptionType"],"mappings":"AAEA,oFAAoF;AACpF,oEAAoE;AACpE,8GAA8G;AAC9G,oFAAoF;AACpF,2GAA2G;AAC3G,gGAAgG;AAChG,+FAA+F;AAC/F,OAAO,IAAA,AAAKA,wCAAAA;;;;;;WAAAA;MAMX"}
@@ -1,14 +1,16 @@
1
- export var ApiAuthenticationType;
2
- (function (ApiAuthenticationType) {
1
+ export var ApiAuthenticationType = /*#__PURE__*/ function(ApiAuthenticationType) {
3
2
  ApiAuthenticationType["none"] = "none";
4
3
  ApiAuthenticationType["basic"] = "basic";
5
4
  ApiAuthenticationType["bearer"] = "bearer";
6
5
  ApiAuthenticationType["oauth"] = "oauth";
7
- })(ApiAuthenticationType || (ApiAuthenticationType = {}));
8
- export var AgentTaskStatus;
9
- (function (AgentTaskStatus) {
6
+ return ApiAuthenticationType;
7
+ }({});
8
+ export var AgentTaskStatus = /*#__PURE__*/ function(AgentTaskStatus) {
10
9
  AgentTaskStatus["SUCCESS"] = "Success";
11
10
  AgentTaskStatus["FAILURE"] = "Failure";
12
11
  AgentTaskStatus["PENDING"] = "Pending";
13
12
  AgentTaskStatus["IN_PROGRESS"] = "In_Progress";
14
- })(AgentTaskStatus || (AgentTaskStatus = {}));
13
+ return AgentTaskStatus;
14
+ }({});
15
+
16
+ //# sourceMappingURL=DDOTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/DDOTypes.ts"],"sourcesContent":["import { CreditsConfig, PriceConfig } from './ContractsTypes.js'\n\nexport interface Metadata {\n serviceEndpoint: string\n main: MetadataMainAttributes\n agent?: AgentMetadata\n additionalInformation?: unknown\n curation: Curation\n plan?: PlanMetadata\n}\n\nexport interface NvmConfigVersions {\n id: number\n updated: string\n checksum: string\n}\nexport interface NvmConfig {\n userId: string\n userAddress: string\n appId: string\n versions: NvmConfigVersions[]\n}\n\nexport interface Proof {\n created: string\n creator: string\n signatureValue: string\n type: string\n}\n\nexport interface MetadataMainAttributes {\n name: string\n description?: string\n author?: string\n dateCreated?: string\n datePublished?: string\n license?: string\n tags?: string[]\n}\n\n/**\n * Interface describing an asset of type `service`\n */\nexport interface AgentMetadata {\n /**\n * Type of Web service\n */\n apiType?: 'restful' | 'graphql' | 'rpc' | 'other'\n\n /**\n * Authentication required by the API\n */\n authentication?: ResourceAuthentication\n\n /**\n * List of endpoints of the API exposed by the Agent\n */\n endpoints?: ApiEndpoint[]\n\n /**\n * List of open endpoints available for the agent. These endpoints are not protected.\n * This attribute is useful to indicate which endpoints are available for public access (documentation, definitions, etc).\n */\n openEndpoints?: string[]\n\n requiredHeaders?: { [verb: string]: string }[]\n\n encryptedAttributes?: string\n}\n\nexport interface PlanMetadata {\n isTrialPlan?: boolean\n productId?: string\n priceId?: string\n recurringSubscription?: boolean\n accessLimit: 'credits' | 'time'\n fiatPaymentProvider?: 'stripe' | 'braintree'\n currency?: string\n /**\n * x402 payment scheme identifier (e.g., 'nvm:erc4337')\n */\n x402Scheme?: string\n /**\n * URL of the x402 facilitator endpoint\n */\n x402FacilitatorUrl?: string\n /**\n * URL to the x402 scheme specification\n */\n x402SpecUrl?: string\n}\n\nexport interface AgentRegistry {\n owner: string\n creator: string\n url: string\n lastUpdated: string\n plans: string[]\n}\n\nexport interface PlanRegistry {\n owner: string\n lastUpdated: string\n price: PriceConfig\n credits: CreditsConfig\n}\n\nexport interface ResourceAuthentication {\n type: ApiAuthenticationType\n\n user?: string\n password?: string\n token?: string\n encrypted?: boolean\n privateParameters?: { [name: string]: string }[]\n}\n\n/**\n * Curation attributes of Assets Metadata.\n * @see https://github.com/nevermined-io/docs/blob/master/docs/architecture/specs/metadata/README.md#curation-attributes\n */\nexport interface Curation {\n /**\n * Decimal value between 0 and 1. 0 is the default value.\n * @example 0.93\n */\n rating: number\n\n /**\n * Number of votes. 0 is the default value.\n * @example 123\n */\n numVotes: number\n\n /**\n * Schema applied to calculate the rating.\n * @example \"Binary Voting\"\n */\n schema?: string\n\n /**\n * Flag unsuitable content.\n * @example true\n */\n isListed?: boolean\n}\n\nexport enum ApiAuthenticationType {\n none = 'none',\n basic = 'basic',\n bearer = 'bearer',\n oauth = 'oauth',\n}\n\nexport type ApiEndpoint = { [verb: string]: string }\n\nexport enum AgentTaskStatus {\n SUCCESS = 'Success',\n FAILURE = 'Failure',\n PENDING = 'Pending',\n IN_PROGRESS = 'In_Progress',\n}\n"],"names":["ApiAuthenticationType","AgentTaskStatus"],"mappings":"AAmJA,OAAO,IAAA,AAAKA,+CAAAA;;;;;WAAAA;MAKX;AAID,OAAO,IAAA,AAAKC,yCAAAA;;;;;WAAAA;MAKX"}
@@ -1 +1,3 @@
1
- export {};
1
+ export { };
2
+
3
+ //# sourceMappingURL=GeneralTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/GeneralTypes.ts"],"sourcesContent":["export interface Balance {\n eth: bigint\n nevermined: bigint\n}\n\nexport interface Eip712Data {\n message: string\n chainId: number\n}\n\nexport interface TypedDataDomain {\n name: string\n version: string\n chainId: number\n}\n\nexport interface TypedDataTypes {\n Nevermined: {\n name: string\n type: string\n }[]\n}\n\nexport interface PriceBreakdown {\n grossCharge: bigint\n ownerMargin: bigint\n nvmMargin: bigint\n stripeFee?: bigint\n nvmCharge: bigint\n orgMargin?: bigint\n}\n\nexport interface BraintreeTwoTxBreakdown extends PriceBreakdown {\n /** Amount to charge on the platform gateway (grossed-up NVM fee) in micro-units */\n platformChargeMicroUnits: bigint\n /** Amount to charge on the merchant gateway in micro-units */\n merchantChargeMicroUnits: bigint\n /** NVM's net profit after Braintree takes its cut from the platform transaction */\n nvmNetMicroUnits: bigint\n}\n"],"names":[],"mappings":"AAgCA,WAOC"}
@@ -5,58 +5,59 @@
5
5
  * * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL
6
6
  * * OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry
7
7
  * * NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain
8
- */
9
- export var DIDResolvePolicy;
10
- (function (DIDResolvePolicy) {
8
+ */ export var DIDResolvePolicy = /*#__PURE__*/ function(DIDResolvePolicy) {
11
9
  DIDResolvePolicy[DIDResolvePolicy["ImmutableFirst"] = 0] = "ImmutableFirst";
12
10
  DIDResolvePolicy[DIDResolvePolicy["MetadataAPIFirst"] = 1] = "MetadataAPIFirst";
13
11
  DIDResolvePolicy[DIDResolvePolicy["OnlyImmutable"] = 2] = "OnlyImmutable";
14
12
  DIDResolvePolicy[DIDResolvePolicy["OnlyMetadataAPI"] = 3] = "OnlyMetadataAPI";
15
13
  DIDResolvePolicy[DIDResolvePolicy["NoRegistry"] = 4] = "NoRegistry";
16
- })(DIDResolvePolicy || (DIDResolvePolicy = {}));
14
+ return DIDResolvePolicy;
15
+ }({});
17
16
  /**
18
17
  * Where the metadata will be published. Options:
19
18
  * - OnlyMetadataAPI, The metadata will be stored only in the Metadata/Marketplace API
20
19
  * - IPFS, The metadata will be stored in the Metadata/Marketplace API and IPFS
21
20
  * - Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin
22
21
  * - Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave
23
- */
24
- export var PublishMetadataOptions;
25
- (function (PublishMetadataOptions) {
22
+ */ export var PublishMetadataOptions = /*#__PURE__*/ function(PublishMetadataOptions) {
26
23
  PublishMetadataOptions[PublishMetadataOptions["OnlyMetadataAPI"] = 0] = "OnlyMetadataAPI";
27
24
  PublishMetadataOptions[PublishMetadataOptions["IPFS"] = 1] = "IPFS";
28
25
  PublishMetadataOptions[PublishMetadataOptions["Filecoin"] = 2] = "Filecoin";
29
26
  PublishMetadataOptions[PublishMetadataOptions["Arweave"] = 3] = "Arweave";
30
- })(PublishMetadataOptions || (PublishMetadataOptions = {}));
27
+ return PublishMetadataOptions;
28
+ }({});
31
29
  /**
32
30
  * It specifies if the DID will be published on-chain initially or not.
33
- */
34
- export var PublishOnChainOptions;
35
- (function (PublishOnChainOptions) {
31
+ */ export var PublishOnChainOptions = /*#__PURE__*/ function(PublishOnChainOptions) {
36
32
  PublishOnChainOptions[PublishOnChainOptions["DIDRegistry"] = 0] = "DIDRegistry";
37
33
  PublishOnChainOptions[PublishOnChainOptions["OnlyOffchain"] = 1] = "OnlyOffchain";
38
- })(PublishOnChainOptions || (PublishOnChainOptions = {}));
34
+ return PublishOnChainOptions;
35
+ }({});
39
36
  export class AssetPublicationOptions {
40
- metadata = PublishMetadataOptions.OnlyMetadataAPI;
41
- did = PublishOnChainOptions.DIDRegistry;
37
+ constructor(){
38
+ this.metadata = 0;
39
+ this.did = 0;
40
+ }
42
41
  }
43
- export var PermissionType;
44
- (function (PermissionType) {
42
+ export var PermissionType = /*#__PURE__*/ function(PermissionType) {
45
43
  PermissionType["Read"] = "read";
46
44
  PermissionType["Update"] = "update";
47
45
  PermissionType["Delete"] = "delete";
48
46
  PermissionType["Admin"] = "admin";
49
- })(PermissionType || (PermissionType = {}));
50
- export var PaymentMethodsAccepted;
51
- (function (PaymentMethodsAccepted) {
47
+ return PermissionType;
48
+ }({});
49
+ export var PaymentMethodsAccepted = /*#__PURE__*/ function(PaymentMethodsAccepted) {
52
50
  PaymentMethodsAccepted["Crypto"] = "crypto";
53
51
  PaymentMethodsAccepted["Fiat"] = "fiat";
54
52
  PaymentMethodsAccepted["All"] = "all";
55
53
  PaymentMethodsAccepted["NotSelected"] = "notSelected";
56
- })(PaymentMethodsAccepted || (PaymentMethodsAccepted = {}));
57
- export var State;
58
- (function (State) {
54
+ return PaymentMethodsAccepted;
55
+ }({});
56
+ export var State = /*#__PURE__*/ function(State) {
59
57
  State["Disabled"] = "disabled";
60
58
  State["Unconfirmed"] = "unconfirmed";
61
59
  State["Confirmed"] = "confirmed";
62
- })(State || (State = {}));
60
+ return State;
61
+ }({});
62
+
63
+ //# sourceMappingURL=MetadataTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/MetadataTypes.ts"],"sourcesContent":["import { DDO } from '../ddo/DDO.js'\n\n/**\n * It described the policy to be used when resolving an asset. It has the following options:\n * * ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API\n * * MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url\n * * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL\n * * OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry\n * * NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain\n */\nexport enum DIDResolvePolicy {\n ImmutableFirst = 0,\n MetadataAPIFirst = 1,\n OnlyImmutable = 2,\n OnlyMetadataAPI = 3,\n NoRegistry = 4,\n}\n\n/**\n * Where the metadata will be published. Options:\n * - OnlyMetadataAPI, The metadata will be stored only in the Metadata/Marketplace API\n * - IPFS, The metadata will be stored in the Metadata/Marketplace API and IPFS\n * - Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin\n * - Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave\n */\nexport enum PublishMetadataOptions {\n OnlyMetadataAPI = 0,\n IPFS = 1,\n Filecoin = 2,\n Arweave = 3,\n}\n\n/**\n * It specifies if the DID will be published on-chain initially or not.\n */\nexport enum PublishOnChainOptions {\n DIDRegistry = 0, // The DID and the reference to the DDO will be stored in the DIDRegistry contract\n OnlyOffchain = 1, // THE DID won't be stored on-chain and will be lazy-registered when needed\n}\n\nexport class AssetPublicationOptions {\n metadata?: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI\n did?: PublishOnChainOptions = PublishOnChainOptions.DIDRegistry\n}\n\nexport interface SearchResults {\n value: number\n relation: 'eq' | 'gte'\n}\n\nexport interface QueryResult {\n results: DDO[]\n page: number\n totalPages: number\n totalResults: { [jsonPath: string]: any }\n}\n\nexport interface MarketplaceResults<Entity> {\n page: number\n results: Entity[]\n total_pages: number\n total_results: SearchResults\n}\n\nexport interface SearchQuery {\n offset?: number\n page?: number\n text?: string\n query?: unknown\n sort?: unknown\n show_unlisted?: boolean\n appId?: string\n}\n\nexport enum PermissionType {\n Read = 'read',\n Update = 'update',\n Delete = 'delete',\n Admin = 'admin',\n}\n\nexport interface NewPermission {\n userId: string\n type: PermissionType[]\n issuer: string\n holder: string\n}\n\nexport interface Permission extends NewPermission {\n id: string\n issuanceDate: Date\n}\n\nexport enum PaymentMethodsAccepted {\n Crypto = 'crypto',\n Fiat = 'fiat',\n All = 'all',\n NotSelected = 'notSelected',\n}\n\nexport enum State {\n Disabled = 'disabled',\n Unconfirmed = 'unconfirmed',\n Confirmed = 'confirmed',\n}\n\nexport interface Stripe {\n accountId?: string | null\n accountType?: 'express' | 'standard' | null\n isAccountValidated?: boolean\n accountCreatedAt?: string\n accountUpdatedAt?: string\n additionalInformation?: unknown\n}\n\nexport interface BraintreeMerchant {\n merchantId?: string | null\n isAccountValidated?: boolean\n accountCreatedAt?: string\n accountUpdatedAt?: string\n accessToken?: string | null\n refreshToken?: string | null\n tokenExpiresAt?: string | null\n // Map of ISO 4217 currency code → Braintree merchantAccountId. Each entry\n // represents a currency-bound child account under the seller's Braintree\n // account; we route transaction.sale to the right one based on the plan\n // currency. Discovered via gateway.merchantAccount.all() at OAuth time.\n merchantAccountIdsByCurrency?: Record<string, string>\n // Derived for API output (the keys of merchantAccountIdsByCurrency). Set by\n // GetUserProfileDto.stripBraintreeTokens; not persisted.\n supportedCurrencies?: string[]\n additionalInformation?: unknown\n}\n\nexport interface AdditionalInformation {\n privyUserId?: string\n privyWalletId?: string\n}\n\nexport interface NewProfile {\n isListed: boolean\n state: State\n addresses: string[]\n nickname: string\n name?: string\n email?: string\n live?: Stripe\n sandbox?: Stripe\n braintreeLive?: BraintreeMerchant\n braintreeSandbox?: BraintreeMerchant\n paymentCountry?: string\n additionalInformation?: unknown\n}\n\nexport interface Profile extends NewProfile {\n userId: string\n creationDate: Date\n updateDate: Date\n}\n\nexport interface ReducedProfile {\n userId: string\n nickname?: string\n live?: Stripe\n sandbox?: Stripe\n braintreeLive?: BraintreeMerchant\n braintreeSandbox?: BraintreeMerchant\n additionalInformation?: unknown\n}\n"],"names":["DIDResolvePolicy","PublishMetadataOptions","PublishOnChainOptions","AssetPublicationOptions","metadata","did","PermissionType","PaymentMethodsAccepted","State"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,IAAA,AAAKA,0CAAAA;;;;;;WAAAA;MAMX;AAED;;;;;;CAMC,GACD,OAAO,IAAA,AAAKC,gDAAAA;;;;;WAAAA;MAKX;AAED;;CAEC,GACD,OAAO,IAAA,AAAKC,+CAAAA;;;WAAAA;MAGX;AAED,OAAO,MAAMC;;aACXC;aACAC;;AACF;AA+BA,OAAO,IAAA,AAAKC,wCAAAA;;;;;WAAAA;MAKX;AAcD,OAAO,IAAA,AAAKC,gDAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,+BAAAA;;;;WAAAA;MAIX"}
@@ -1,4 +1,9 @@
1
1
  /**
2
2
  * Shared transaction types used by both API and webapp
3
- */
4
- export {};
3
+ */ /**
4
+ * Credits information for a purchased plan
5
+ */ /**
6
+ * Response from GET /api/v1/transactions/plans-purchased-detailed
7
+ */ export { };
8
+
9
+ //# sourceMappingURL=TransactionTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/TransactionTypes.ts"],"sourcesContent":["/**\n * Shared transaction types used by both API and webapp\n */\n\n/**\n * Credits information for a purchased plan\n */\nexport interface PlanCreditsInfo {\n /** Indicates if the redemption amount is fixed (true) or dynamic (false) */\n isRedemptionAmountFixed: boolean\n /** For EXPIRABLE plans: percentage consumed (0-100). For FIXED/DYNAMIC: remaining credits */\n consumptionInfo: number\n /** For EXPIRABLE plans: true if expired. For FIXED/DYNAMIC: true if no credits left */\n isExpired: boolean\n /** Current credits balance */\n currentBalance: string\n /** Total credits originally granted */\n totalCredits: string\n /** Purchase date for expirable plans */\n purchaseDate?: string\n /** Duration in seconds for expirable plans */\n durationSecs?: number\n}\n\n/**\n * Single item from the plans-purchased-detailed API response\n */\nexport interface PurchasedPlanItem {\n /** Plan detailed information */\n plan?: {\n id: string\n [key: string]: unknown\n }\n /** Agents associated to this plan */\n agents?: unknown[]\n /** Credits consumption information */\n creditsInfo?: PlanCreditsInfo | null\n /** List of transactions for this plan */\n transactions?: unknown[]\n}\n\n/**\n * Response from GET /api/v1/transactions/plans-purchased-detailed\n */\nexport interface PlanPurchasedDetailedResponse {\n /** Current page number */\n page: number\n /** Total number of pages */\n totalPages: number\n /** Total number of results found */\n totalResults: number\n /** List of purchased plans with detailed information */\n results: PurchasedPlanItem[]\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GAED;;CAEC,GAmCD;;CAEC,GACD,WASC"}
@@ -1,5 +1,4 @@
1
- export var Flavor;
2
- (function (Flavor) {
1
+ export var Flavor = /*#__PURE__*/ function(Flavor) {
3
2
  Flavor[Flavor["Avatar"] = 0] = "Avatar";
4
3
  Flavor[Flavor["Cover"] = 1] = "Cover";
5
4
  Flavor[Flavor["Animation"] = 2] = "Animation";
@@ -9,9 +8,9 @@ export var Flavor;
9
8
  Flavor[Flavor["Terms"] = 6] = "Terms";
10
9
  Flavor[Flavor["Private"] = 7] = "Private";
11
10
  Flavor[Flavor["SampleData"] = 8] = "SampleData";
12
- })(Flavor || (Flavor = {}));
13
- export var FlavorFolder;
14
- (function (FlavorFolder) {
11
+ return Flavor;
12
+ }({});
13
+ export var FlavorFolder = /*#__PURE__*/ function(FlavorFolder) {
15
14
  FlavorFolder["Avatars"] = "avatars";
16
15
  FlavorFolder["Covers"] = "covers";
17
16
  FlavorFolder["Animations"] = "animations";
@@ -21,10 +20,13 @@ export var FlavorFolder;
21
20
  FlavorFolder["Terms"] = "terms";
22
21
  FlavorFolder["Privates"] = "private";
23
22
  FlavorFolder["SampleData"] = "sample-data";
24
- })(FlavorFolder || (FlavorFolder = {}));
25
- export var TranscodingStatus;
26
- (function (TranscodingStatus) {
23
+ return FlavorFolder;
24
+ }({});
25
+ export var TranscodingStatus = /*#__PURE__*/ function(TranscodingStatus) {
27
26
  TranscodingStatus["Pending"] = "Pending";
28
27
  TranscodingStatus["Done"] = "Done";
29
28
  TranscodingStatus["Error"] = "Error";
30
- })(TranscodingStatus || (TranscodingStatus = {}));
29
+ return TranscodingStatus;
30
+ }({});
31
+
32
+ //# sourceMappingURL=TranscoderTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/TranscoderTypes.ts"],"sourcesContent":["export enum Flavor {\n Avatar = 0,\n Cover = 1,\n Animation = 2,\n Image = 3,\n Video = 4,\n Audio = 5,\n Terms = 6,\n Private = 7,\n SampleData = 8,\n}\n\nexport enum FlavorFolder {\n Avatars = 'avatars',\n Covers = 'covers',\n Animations = 'animations',\n Images = 'images',\n Videos = 'videos',\n Audios = 'audios',\n Terms = 'terms',\n Privates = 'private',\n SampleData = 'sample-data',\n}\n\nexport enum TranscodingStatus {\n Pending = 'Pending',\n Done = 'Done',\n Error = 'Error',\n}\n"],"names":["Flavor","FlavorFolder","TranscodingStatus"],"mappings":"AAAA,OAAO,IAAA,AAAKA,gCAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,sCAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,2CAAAA;;;;WAAAA;MAIX"}
@@ -5,3 +5,5 @@ export * from './MetadataTypes.js';
5
5
  export * from './TransactionTypes.js';
6
6
  export * from './TranscoderTypes.js';
7
7
  export * from './types.js';
8
+
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/index.ts"],"sourcesContent":["export * from './ContractsTypes.js'\nexport * from './DDOTypes.js'\nexport * from './GeneralTypes.js'\nexport * from './MetadataTypes.js'\nexport * from './TransactionTypes.js'\nexport * from './TranscoderTypes.js'\nexport * from './types.js'\n"],"names":[],"mappings":"AAAA,cAAc,sBAAqB;AACnC,cAAc,gBAAe;AAC7B,cAAc,oBAAmB;AACjC,cAAc,qBAAoB;AAClC,cAAc,wBAAuB;AACrC,cAAc,uBAAsB;AACpC,cAAc,aAAY"}