@taquito/tzip16 25.2.0-beta1 → 25.2.0-beta3

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.
@@ -12,6 +12,7 @@ import { Handler, Tzip16Uri } from '../metadata-provider';
12
12
  export declare class IpfsHttpHandler implements Handler {
13
13
  private readonly timeout;
14
14
  private readonly gateways;
15
+ readonly integrityVerified = true;
15
16
  httpBackend: HttpBackend;
16
17
  /**
17
18
  * @param ipfsGateway - Optional HTTPS gateway hostname (without `https://` or `/ipfs/`). For production, use a paid gateway service with an SLA or a self-hosted HTTPS IPFS gateway. When omitted, falls back across the default public gateways.
@@ -7,10 +7,11 @@ export interface MetadataProviderInterface {
7
7
  export interface MetadataEnvelope {
8
8
  uri: string;
9
9
  integrityCheckResult?: boolean;
10
- sha256Hash?: string;
10
+ sha256Hash: string;
11
11
  metadata: MetadataInterface;
12
12
  }
13
13
  export interface Handler {
14
+ readonly integrityVerified?: boolean;
14
15
  getMetadata(contractAbstraction: ContractAbstraction<ContractProvider | Wallet>, uri: Tzip16Uri, context: Context): Promise<string>;
15
16
  }
16
17
  export interface Tzip16Uri {
@@ -9,13 +9,20 @@ export declare class Tzip16ContractAbstraction {
9
9
  private context;
10
10
  private _metadataProvider;
11
11
  private _metadataEnvelope?;
12
+ private _metadataEnvelopePromise?;
12
13
  private _viewFactory;
13
14
  private _metadataViewsObject;
14
15
  constructor(constractAbstraction: ContractAbstraction<ContractProvider | Wallet>, context: MetadataContext);
15
16
  private findMetadataBigMap;
16
17
  private getUriOrFail;
17
18
  /**
18
- * Return an object containing the metadata, the uri, an optional integrity check result and an optional sha256 hash
19
+ * Fetch and cache the contract metadata envelope on this `Tzip16ContractAbstraction` instance.
20
+ * Subsequent calls to `getMetadata()`, `metadataViews()`, and the `metadata*()` accessors
21
+ * reuse the cached envelope without re-fetching.
22
+ *
23
+ * @returns an object containing the parsed `metadata`, the `uri`, the `sha256Hash` of the raw
24
+ * metadata string, and an optional `integrityCheckResult` (`true` when verified via a
25
+ * `sha256://` commitment or a content-verifying handler such as `IpfsHttpHandler`).
19
26
  */
20
27
  getMetadata(): Promise<MetadataEnvelope>;
21
28
  metadataName(): Promise<string | undefined>;
@@ -33,6 +40,11 @@ export declare class Tzip16ContractAbstraction {
33
40
  } | undefined>;
34
41
  metadataInterfaces(): Promise<string[] | undefined>;
35
42
  metadataErrors(): Promise<import("./metadata-interface").ErrorsTzip16 | undefined>;
43
+ /**
44
+ * Build and cache off-chain view implementations from the cached metadata envelope returned by
45
+ * `getMetadata()`. If `getMetadata()` has already resolved on this instance, `metadataViews()`
46
+ * uses that same cached envelope without re-fetching.
47
+ */
36
48
  metadataViews(): Promise<{
37
49
  [key: string]: () => View;
38
50
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taquito/tzip16",
3
- "version": "25.2.0-beta1",
3
+ "version": "25.2.0-beta3",
4
4
  "description": "TZIP-16 contract metadata support for Taquito.",
5
5
  "keywords": [
6
6
  "taquito",
@@ -55,12 +55,12 @@
55
55
  ]
56
56
  },
57
57
  "dependencies": {
58
- "@taquito/core": "^25.2.0-beta1",
59
- "@taquito/http-utils": "^25.2.0-beta1",
60
- "@taquito/michelson-encoder": "^25.2.0-beta1",
61
- "@taquito/rpc": "^25.2.0-beta1",
62
- "@taquito/taquito": "^25.2.0-beta1",
63
- "@taquito/utils": "^25.2.0-beta1",
58
+ "@taquito/core": "^25.2.0-beta3",
59
+ "@taquito/http-utils": "^25.2.0-beta3",
60
+ "@taquito/michelson-encoder": "^25.2.0-beta3",
61
+ "@taquito/rpc": "^25.2.0-beta3",
62
+ "@taquito/taquito": "^25.2.0-beta3",
63
+ "@taquito/utils": "^25.2.0-beta3",
64
64
  "bignumber.js": "^10.0.2",
65
65
  "crypto-js": "^4.2.0"
66
66
  },
@@ -70,9 +70,7 @@
70
70
  "@rollup/plugin-node-resolve": "16.0.3",
71
71
  "@types/crypto-js": "^4.2.2",
72
72
  "@types/node": "^22.20.5",
73
- "@typescript-eslint/eslint-plugin": "^6.21.0",
74
- "@typescript-eslint/parser": "^6.21.0",
75
- "eslint": "^8.57.0",
73
+ "eslint": "^10.15.0",
76
74
  "ipfs-unixfs-exporter": "16.2.3",
77
75
  "lint-staged": "^15.2.7",
78
76
  "lodash.camelcase": "^4.3.0",