@vleap/warps-adapter-fastset 0.1.0-alpha.2
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 +132 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +648 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +623 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +35 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { AdapterFactory, CombinedWarpBuilder, WarpClientConfig, Warp, BaseWarpBuilder, WarpAction, AdapterWarpExecutor, WarpExecutable, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, WarpExecution, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
|
|
2
|
+
|
|
3
|
+
declare const WarpFastsetConstants: {
|
|
4
|
+
ChainName: string;
|
|
5
|
+
ChainPrefix: string;
|
|
6
|
+
Pi: {
|
|
7
|
+
Identifier: string;
|
|
8
|
+
DisplayName: string;
|
|
9
|
+
Decimals: number;
|
|
10
|
+
};
|
|
11
|
+
GasLimit: {
|
|
12
|
+
Default: number;
|
|
13
|
+
ContractCall: number;
|
|
14
|
+
ContractDeploy: number;
|
|
15
|
+
Transfer: number;
|
|
16
|
+
Approve: number;
|
|
17
|
+
Swap: number;
|
|
18
|
+
};
|
|
19
|
+
GasPrice: {
|
|
20
|
+
Default: string;
|
|
21
|
+
Low: string;
|
|
22
|
+
Medium: string;
|
|
23
|
+
High: string;
|
|
24
|
+
};
|
|
25
|
+
Network: {
|
|
26
|
+
Mainnet: {
|
|
27
|
+
ChainId: string;
|
|
28
|
+
Name: string;
|
|
29
|
+
BlockTime: number;
|
|
30
|
+
};
|
|
31
|
+
Testnet: {
|
|
32
|
+
ChainId: string;
|
|
33
|
+
Name: string;
|
|
34
|
+
BlockTime: number;
|
|
35
|
+
};
|
|
36
|
+
Devnet: {
|
|
37
|
+
ChainId: string;
|
|
38
|
+
Name: string;
|
|
39
|
+
BlockTime: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
Validation: {
|
|
43
|
+
AddressLength: number;
|
|
44
|
+
HexPrefix: string;
|
|
45
|
+
MinGasLimit: number;
|
|
46
|
+
MaxGasLimit: number;
|
|
47
|
+
};
|
|
48
|
+
Timeouts: {
|
|
49
|
+
DefaultRpcTimeout: number;
|
|
50
|
+
GasEstimationTimeout: number;
|
|
51
|
+
QueryTimeout: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare const getFastsetAdapter: AdapterFactory;
|
|
56
|
+
|
|
57
|
+
declare class WarpFastsetBuilder implements CombinedWarpBuilder {
|
|
58
|
+
private readonly config;
|
|
59
|
+
private warp;
|
|
60
|
+
private actions;
|
|
61
|
+
constructor(config: WarpClientConfig);
|
|
62
|
+
createFromRaw(encoded: string): Promise<Warp>;
|
|
63
|
+
setTitle(title: string): BaseWarpBuilder;
|
|
64
|
+
setDescription(description: string): BaseWarpBuilder;
|
|
65
|
+
setPreview(preview: string): BaseWarpBuilder;
|
|
66
|
+
setActions(actions: WarpAction[]): BaseWarpBuilder;
|
|
67
|
+
addAction(action: WarpAction): BaseWarpBuilder;
|
|
68
|
+
build(): Promise<Warp>;
|
|
69
|
+
createInscriptionTransaction(warp: Warp): any;
|
|
70
|
+
createFromTransaction(tx: any, validate?: boolean): Promise<Warp>;
|
|
71
|
+
createFromTransactionHash(hash: string, cache?: any): Promise<Warp | null>;
|
|
72
|
+
private generateHash;
|
|
73
|
+
private validateWarp;
|
|
74
|
+
private fetchTransaction;
|
|
75
|
+
private getApiUrl;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare class WarpFastsetExecutor implements AdapterWarpExecutor {
|
|
79
|
+
private readonly config;
|
|
80
|
+
private readonly serializer;
|
|
81
|
+
constructor(config: WarpClientConfig);
|
|
82
|
+
createTransaction(executable: WarpExecutable): Promise<any>;
|
|
83
|
+
createTransferTransaction(executable: WarpExecutable): Promise<any>;
|
|
84
|
+
createContractCallTransaction(executable: WarpExecutable): Promise<any>;
|
|
85
|
+
executeQuery(executable: WarpExecutable): Promise<any>;
|
|
86
|
+
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
87
|
+
private isValidFastsetAddress;
|
|
88
|
+
private encodeFunctionData;
|
|
89
|
+
private executeFastsetQuery;
|
|
90
|
+
signMessage(message: string, privateKey: string): Promise<string>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare class WarpFastsetExplorer implements AdapterWarpExplorer {
|
|
94
|
+
private readonly chainInfo;
|
|
95
|
+
private readonly chainName;
|
|
96
|
+
constructor(chainInfo: WarpChainInfo, chainName?: string);
|
|
97
|
+
getAccountUrl(address: string): string;
|
|
98
|
+
getTransactionUrl(hash: string): string;
|
|
99
|
+
getBlockUrl(blockNumber: string | number): string;
|
|
100
|
+
getContractUrl(address: string): string;
|
|
101
|
+
getTokenUrl(address: string): string;
|
|
102
|
+
private getDefaultExplorerUrl;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare class WarpFastsetResults implements AdapterWarpResults {
|
|
106
|
+
private readonly config;
|
|
107
|
+
private readonly serializer;
|
|
108
|
+
constructor(config: WarpClientConfig);
|
|
109
|
+
getTransactionExecutionResults(warp: Warp, tx: any): Promise<WarpExecution>;
|
|
110
|
+
extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
111
|
+
values: any[];
|
|
112
|
+
results: WarpExecutionResults;
|
|
113
|
+
}>;
|
|
114
|
+
private isTransactionSuccessful;
|
|
115
|
+
private extractGasUsed;
|
|
116
|
+
private extractGasPrice;
|
|
117
|
+
private extractBlockNumber;
|
|
118
|
+
private extractTransactionHash;
|
|
119
|
+
private extractLogs;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare class WarpFastsetSerializer implements AdapterWarpSerializer {
|
|
123
|
+
readonly coreSerializer: WarpSerializer;
|
|
124
|
+
constructor();
|
|
125
|
+
typedToString(value: any): string;
|
|
126
|
+
typedToNative(value: any): [WarpActionInputType, WarpNativeValue];
|
|
127
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): any;
|
|
128
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
129
|
+
stringToTyped(value: string): any;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { WarpFastsetBuilder, WarpFastsetConstants, WarpFastsetExecutor, WarpFastsetExplorer, WarpFastsetResults, WarpFastsetSerializer, getFastsetAdapter };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { AdapterFactory, CombinedWarpBuilder, WarpClientConfig, Warp, BaseWarpBuilder, WarpAction, AdapterWarpExecutor, WarpExecutable, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, WarpExecution, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
|
|
2
|
+
|
|
3
|
+
declare const WarpFastsetConstants: {
|
|
4
|
+
ChainName: string;
|
|
5
|
+
ChainPrefix: string;
|
|
6
|
+
Pi: {
|
|
7
|
+
Identifier: string;
|
|
8
|
+
DisplayName: string;
|
|
9
|
+
Decimals: number;
|
|
10
|
+
};
|
|
11
|
+
GasLimit: {
|
|
12
|
+
Default: number;
|
|
13
|
+
ContractCall: number;
|
|
14
|
+
ContractDeploy: number;
|
|
15
|
+
Transfer: number;
|
|
16
|
+
Approve: number;
|
|
17
|
+
Swap: number;
|
|
18
|
+
};
|
|
19
|
+
GasPrice: {
|
|
20
|
+
Default: string;
|
|
21
|
+
Low: string;
|
|
22
|
+
Medium: string;
|
|
23
|
+
High: string;
|
|
24
|
+
};
|
|
25
|
+
Network: {
|
|
26
|
+
Mainnet: {
|
|
27
|
+
ChainId: string;
|
|
28
|
+
Name: string;
|
|
29
|
+
BlockTime: number;
|
|
30
|
+
};
|
|
31
|
+
Testnet: {
|
|
32
|
+
ChainId: string;
|
|
33
|
+
Name: string;
|
|
34
|
+
BlockTime: number;
|
|
35
|
+
};
|
|
36
|
+
Devnet: {
|
|
37
|
+
ChainId: string;
|
|
38
|
+
Name: string;
|
|
39
|
+
BlockTime: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
Validation: {
|
|
43
|
+
AddressLength: number;
|
|
44
|
+
HexPrefix: string;
|
|
45
|
+
MinGasLimit: number;
|
|
46
|
+
MaxGasLimit: number;
|
|
47
|
+
};
|
|
48
|
+
Timeouts: {
|
|
49
|
+
DefaultRpcTimeout: number;
|
|
50
|
+
GasEstimationTimeout: number;
|
|
51
|
+
QueryTimeout: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare const getFastsetAdapter: AdapterFactory;
|
|
56
|
+
|
|
57
|
+
declare class WarpFastsetBuilder implements CombinedWarpBuilder {
|
|
58
|
+
private readonly config;
|
|
59
|
+
private warp;
|
|
60
|
+
private actions;
|
|
61
|
+
constructor(config: WarpClientConfig);
|
|
62
|
+
createFromRaw(encoded: string): Promise<Warp>;
|
|
63
|
+
setTitle(title: string): BaseWarpBuilder;
|
|
64
|
+
setDescription(description: string): BaseWarpBuilder;
|
|
65
|
+
setPreview(preview: string): BaseWarpBuilder;
|
|
66
|
+
setActions(actions: WarpAction[]): BaseWarpBuilder;
|
|
67
|
+
addAction(action: WarpAction): BaseWarpBuilder;
|
|
68
|
+
build(): Promise<Warp>;
|
|
69
|
+
createInscriptionTransaction(warp: Warp): any;
|
|
70
|
+
createFromTransaction(tx: any, validate?: boolean): Promise<Warp>;
|
|
71
|
+
createFromTransactionHash(hash: string, cache?: any): Promise<Warp | null>;
|
|
72
|
+
private generateHash;
|
|
73
|
+
private validateWarp;
|
|
74
|
+
private fetchTransaction;
|
|
75
|
+
private getApiUrl;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare class WarpFastsetExecutor implements AdapterWarpExecutor {
|
|
79
|
+
private readonly config;
|
|
80
|
+
private readonly serializer;
|
|
81
|
+
constructor(config: WarpClientConfig);
|
|
82
|
+
createTransaction(executable: WarpExecutable): Promise<any>;
|
|
83
|
+
createTransferTransaction(executable: WarpExecutable): Promise<any>;
|
|
84
|
+
createContractCallTransaction(executable: WarpExecutable): Promise<any>;
|
|
85
|
+
executeQuery(executable: WarpExecutable): Promise<any>;
|
|
86
|
+
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
87
|
+
private isValidFastsetAddress;
|
|
88
|
+
private encodeFunctionData;
|
|
89
|
+
private executeFastsetQuery;
|
|
90
|
+
signMessage(message: string, privateKey: string): Promise<string>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare class WarpFastsetExplorer implements AdapterWarpExplorer {
|
|
94
|
+
private readonly chainInfo;
|
|
95
|
+
private readonly chainName;
|
|
96
|
+
constructor(chainInfo: WarpChainInfo, chainName?: string);
|
|
97
|
+
getAccountUrl(address: string): string;
|
|
98
|
+
getTransactionUrl(hash: string): string;
|
|
99
|
+
getBlockUrl(blockNumber: string | number): string;
|
|
100
|
+
getContractUrl(address: string): string;
|
|
101
|
+
getTokenUrl(address: string): string;
|
|
102
|
+
private getDefaultExplorerUrl;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare class WarpFastsetResults implements AdapterWarpResults {
|
|
106
|
+
private readonly config;
|
|
107
|
+
private readonly serializer;
|
|
108
|
+
constructor(config: WarpClientConfig);
|
|
109
|
+
getTransactionExecutionResults(warp: Warp, tx: any): Promise<WarpExecution>;
|
|
110
|
+
extractQueryResults(warp: Warp, typedValues: any[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
111
|
+
values: any[];
|
|
112
|
+
results: WarpExecutionResults;
|
|
113
|
+
}>;
|
|
114
|
+
private isTransactionSuccessful;
|
|
115
|
+
private extractGasUsed;
|
|
116
|
+
private extractGasPrice;
|
|
117
|
+
private extractBlockNumber;
|
|
118
|
+
private extractTransactionHash;
|
|
119
|
+
private extractLogs;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare class WarpFastsetSerializer implements AdapterWarpSerializer {
|
|
123
|
+
readonly coreSerializer: WarpSerializer;
|
|
124
|
+
constructor();
|
|
125
|
+
typedToString(value: any): string;
|
|
126
|
+
typedToNative(value: any): [WarpActionInputType, WarpNativeValue];
|
|
127
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): any;
|
|
128
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
129
|
+
stringToTyped(value: string): any;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { WarpFastsetBuilder, WarpFastsetConstants, WarpFastsetExecutor, WarpFastsetExplorer, WarpFastsetResults, WarpFastsetSerializer, getFastsetAdapter };
|