@vleap/warps 3.0.0-alpha.30 → 3.0.0-alpha.32

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/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { WarpInitConfig, WarpBrand, WarpAbi, Warp, WarpCacheConfig, WarpAction, WarpActionIndex, WarpChainInfo, WarpExecutionResults, WarpExecutable, ResolvedInput, WarpRegistryInfo } from '@vleap/warps-core';
1
+ import { WarpInitConfig, WarpBrand, WarpAbi, WarpExecution, Warp, WarpAdapterGenericTransaction, WarpChainInfo, WarpAdapterGenericRemoteTransaction, WarpExecutable, WarpAction, ResolvedInput } from '@vleap/warps-core';
2
2
  export * from '@vleap/warps-core';
3
3
  import { Transaction, TransactionOnNetwork } from '@multiversx/sdk-core';
4
4
  import { WarpBrandUrls, WarpBrandColors, WarpBrandCta } from '@vleap/warps-core/src/types';
@@ -23,41 +23,21 @@ declare class BrandBuilder {
23
23
  }
24
24
 
25
25
  declare class WarpAbiBuilder {
26
- private config;
27
- private cache;
28
- constructor(config: WarpInitConfig);
29
26
  createFromRaw(encoded: string): Promise<WarpAbi>;
30
- createFromTransaction(tx: TransactionOnNetwork): Promise<WarpAbi>;
31
- }
32
-
33
- declare class WarpBuilder {
34
- private config;
35
- private cache;
36
- private pendingWarp;
37
- constructor(config: WarpInitConfig);
38
- createInscriptionTransaction(warp: Warp): Transaction;
39
- createFromRaw(encoded: string, validate?: boolean): Promise<Warp>;
40
- createFromTransaction(tx: TransactionOnNetwork, validate?: boolean): Promise<Warp>;
41
- createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
42
- setName(name: string): WarpBuilder;
43
- setTitle(title: string): WarpBuilder;
44
- setDescription(description: string): WarpBuilder;
45
- setPreview(preview: string): WarpBuilder;
46
- setActions(actions: WarpAction[]): WarpBuilder;
47
- addAction(action: WarpAction): WarpBuilder;
48
- build(): Promise<Warp>;
49
- getDescriptionPreview(description: string, maxChars?: number): string;
50
- private ensure;
51
- private validate;
52
27
  }
53
28
 
54
- type WarpAdapterTransaction = any;
29
+ type ExecutionHandlers = {
30
+ onExecuted?: (result: WarpExecution) => void;
31
+ };
55
32
  declare class WarpExecutor {
56
33
  private config;
57
34
  private factory;
58
- constructor(config: WarpInitConfig);
59
- execute(warp: Warp, action: WarpActionIndex, inputs: string[]): Promise<[WarpAdapterTransaction, WarpChainInfo]>;
60
- executeCollect(warp: Warp, action: WarpActionIndex, inputs: string[], extra?: Record<string, any>): Promise<WarpExecutionResults>;
35
+ private handlers;
36
+ constructor(config: WarpInitConfig, handlers: ExecutionHandlers);
37
+ execute(warp: Warp, inputs: string[]): Promise<[WarpAdapterGenericTransaction | null, WarpChainInfo | null]>;
38
+ evaluateResults(warp: Warp, chain: WarpChainInfo, tx: WarpAdapterGenericRemoteTransaction): Promise<void>;
39
+ private determineActionIndex;
40
+ private executeCollect;
61
41
  }
62
42
 
63
43
  declare class WarpFactory {
@@ -73,40 +53,10 @@ declare class WarpFactory {
73
53
  private getPreparedArgs;
74
54
  }
75
55
 
76
- declare class WarpInterpolator {
77
- static apply(config: WarpInitConfig, warp: Warp): Promise<Warp>;
78
- static applyGlobals(config: WarpInitConfig, warp: Warp): Promise<Warp>;
79
- static applyVars(config: WarpInitConfig, warp: Warp): Warp;
80
- private static applyRootGlobals;
81
- private static applyActionGlobals;
82
- }
83
-
84
- type DetectionResult = {
85
- match: boolean;
86
- url: string;
87
- warp: Warp | null;
88
- registryInfo: WarpRegistryInfo | null;
89
- brand: WarpBrand | null;
90
- };
91
- type DetectionResultFromHtml = {
92
- match: boolean;
93
- results: {
94
- url: string;
95
- warp: Warp;
96
- }[];
97
- };
98
- declare class WarpLinkDetecter {
99
- private config;
100
- constructor(config: WarpInitConfig);
101
- isValid(url: string): boolean;
102
- detectFromHtml(content: string): Promise<DetectionResultFromHtml>;
103
- detect(url: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
104
- }
105
-
106
56
  declare class WarpUtils {
107
57
  static getChainInfoForAction(config: WarpInitConfig, action: WarpAction, inputs?: string[]): Promise<WarpChainInfo>;
108
58
  private static tryGetChainFromInputs;
109
59
  private static getDefaultChainInfo;
110
60
  }
111
61
 
112
- export { BrandBuilder, WarpAbiBuilder, type WarpAdapterTransaction, WarpBuilder, WarpExecutor, WarpFactory, WarpInterpolator, WarpLinkDetecter, WarpUtils };
62
+ export { BrandBuilder, WarpAbiBuilder, WarpExecutor, WarpFactory, WarpUtils };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WarpInitConfig, WarpBrand, WarpAbi, Warp, WarpCacheConfig, WarpAction, WarpActionIndex, WarpChainInfo, WarpExecutionResults, WarpExecutable, ResolvedInput, WarpRegistryInfo } from '@vleap/warps-core';
1
+ import { WarpInitConfig, WarpBrand, WarpAbi, WarpExecution, Warp, WarpAdapterGenericTransaction, WarpChainInfo, WarpAdapterGenericRemoteTransaction, WarpExecutable, WarpAction, ResolvedInput } from '@vleap/warps-core';
2
2
  export * from '@vleap/warps-core';
3
3
  import { Transaction, TransactionOnNetwork } from '@multiversx/sdk-core';
4
4
  import { WarpBrandUrls, WarpBrandColors, WarpBrandCta } from '@vleap/warps-core/src/types';
@@ -23,41 +23,21 @@ declare class BrandBuilder {
23
23
  }
24
24
 
25
25
  declare class WarpAbiBuilder {
26
- private config;
27
- private cache;
28
- constructor(config: WarpInitConfig);
29
26
  createFromRaw(encoded: string): Promise<WarpAbi>;
30
- createFromTransaction(tx: TransactionOnNetwork): Promise<WarpAbi>;
31
- }
32
-
33
- declare class WarpBuilder {
34
- private config;
35
- private cache;
36
- private pendingWarp;
37
- constructor(config: WarpInitConfig);
38
- createInscriptionTransaction(warp: Warp): Transaction;
39
- createFromRaw(encoded: string, validate?: boolean): Promise<Warp>;
40
- createFromTransaction(tx: TransactionOnNetwork, validate?: boolean): Promise<Warp>;
41
- createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
42
- setName(name: string): WarpBuilder;
43
- setTitle(title: string): WarpBuilder;
44
- setDescription(description: string): WarpBuilder;
45
- setPreview(preview: string): WarpBuilder;
46
- setActions(actions: WarpAction[]): WarpBuilder;
47
- addAction(action: WarpAction): WarpBuilder;
48
- build(): Promise<Warp>;
49
- getDescriptionPreview(description: string, maxChars?: number): string;
50
- private ensure;
51
- private validate;
52
27
  }
53
28
 
54
- type WarpAdapterTransaction = any;
29
+ type ExecutionHandlers = {
30
+ onExecuted?: (result: WarpExecution) => void;
31
+ };
55
32
  declare class WarpExecutor {
56
33
  private config;
57
34
  private factory;
58
- constructor(config: WarpInitConfig);
59
- execute(warp: Warp, action: WarpActionIndex, inputs: string[]): Promise<[WarpAdapterTransaction, WarpChainInfo]>;
60
- executeCollect(warp: Warp, action: WarpActionIndex, inputs: string[], extra?: Record<string, any>): Promise<WarpExecutionResults>;
35
+ private handlers;
36
+ constructor(config: WarpInitConfig, handlers: ExecutionHandlers);
37
+ execute(warp: Warp, inputs: string[]): Promise<[WarpAdapterGenericTransaction | null, WarpChainInfo | null]>;
38
+ evaluateResults(warp: Warp, chain: WarpChainInfo, tx: WarpAdapterGenericRemoteTransaction): Promise<void>;
39
+ private determineActionIndex;
40
+ private executeCollect;
61
41
  }
62
42
 
63
43
  declare class WarpFactory {
@@ -73,40 +53,10 @@ declare class WarpFactory {
73
53
  private getPreparedArgs;
74
54
  }
75
55
 
76
- declare class WarpInterpolator {
77
- static apply(config: WarpInitConfig, warp: Warp): Promise<Warp>;
78
- static applyGlobals(config: WarpInitConfig, warp: Warp): Promise<Warp>;
79
- static applyVars(config: WarpInitConfig, warp: Warp): Warp;
80
- private static applyRootGlobals;
81
- private static applyActionGlobals;
82
- }
83
-
84
- type DetectionResult = {
85
- match: boolean;
86
- url: string;
87
- warp: Warp | null;
88
- registryInfo: WarpRegistryInfo | null;
89
- brand: WarpBrand | null;
90
- };
91
- type DetectionResultFromHtml = {
92
- match: boolean;
93
- results: {
94
- url: string;
95
- warp: Warp;
96
- }[];
97
- };
98
- declare class WarpLinkDetecter {
99
- private config;
100
- constructor(config: WarpInitConfig);
101
- isValid(url: string): boolean;
102
- detectFromHtml(content: string): Promise<DetectionResultFromHtml>;
103
- detect(url: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
104
- }
105
-
106
56
  declare class WarpUtils {
107
57
  static getChainInfoForAction(config: WarpInitConfig, action: WarpAction, inputs?: string[]): Promise<WarpChainInfo>;
108
58
  private static tryGetChainFromInputs;
109
59
  private static getDefaultChainInfo;
110
60
  }
111
61
 
112
- export { BrandBuilder, WarpAbiBuilder, type WarpAdapterTransaction, WarpBuilder, WarpExecutor, WarpFactory, WarpInterpolator, WarpLinkDetecter, WarpUtils };
62
+ export { BrandBuilder, WarpAbiBuilder, WarpExecutor, WarpFactory, WarpUtils };