@vleap/warps-adapter-multiversx 0.2.0-alpha.7 → 0.2.0-alpha.71
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.cts +291 -0
- package/dist/index.d.ts +173 -42
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +18 -11
- package/dist/index.d.mts +0 -160
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import * as _vleap_warps from '@vleap/warps';
|
|
2
|
+
import { WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterFactory, WarpChainAsset, WarpRegistryInfo, WarpRegistryConfigInfo, WarpNativeValue, AdapterWarpAbiBuilder, WarpAbiContents, WarpAdapterGenericTransaction, WarpAbi, WarpCacheConfig, WarpContractAction, WarpQueryAction, WarpBrand, WarpBuilder, AdapterWarpBuilder, Warp, WarpContract, WarpContractVerification, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpActionExecution, AdapterWarpExplorer, AdapterWarpRegistry, AdapterWarpResults, AdapterTypeRegistry as AdapterTypeRegistry$1, WarpActionIndex, WarpAdapterGenericRemoteTransaction, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, BaseWarpActionInputType, WarpAdapterGenericType, AdapterWarpWallet } from '@vleap/warps';
|
|
3
|
+
import { NetworkEntrypoint, TypedValue, Type, OptionValue, OptionalValue, List, VariadicValue, CompositeValue, StringValue, U8Value, U16Value, U32Value, U64Value, BigUIntValue, BooleanValue, AddressValue, TokenIdentifierValue, BytesValue, TokenTransfer, Struct, CodeMetadataValue, NothingValue, TransactionOnNetwork, AbiRegistry, Transaction } from '@multiversx/sdk-core';
|
|
4
|
+
import { WarpAdapterGenericTransaction as WarpAdapterGenericTransaction$1, AdapterTypeRegistry } from '@vleap/warps/src/types';
|
|
5
|
+
|
|
6
|
+
declare const getAllMultiversxAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
7
|
+
declare const getAllMultiversxChainNames: () => WarpChain[];
|
|
8
|
+
|
|
9
|
+
declare const createMultiversxAdapter: (chainName: string, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => AdapterFactory;
|
|
10
|
+
|
|
11
|
+
declare const NativeTokenEgld: WarpChainAsset;
|
|
12
|
+
declare const getMultiversxAdapter: _vleap_warps.AdapterFactory;
|
|
13
|
+
|
|
14
|
+
declare const NativeTokenVibe: WarpChainAsset;
|
|
15
|
+
declare const getVibechainAdapter: _vleap_warps.AdapterFactory;
|
|
16
|
+
|
|
17
|
+
declare const getMultiversxRegistryAddress: (env: WarpChainEnv) => "erd1qqqqqqqqqqqqqpgqje2f99vr6r7sk54thg03c9suzcvwr4nfl3tsfkdl36" | "erd1qqqqqqqqqqqqqpgq3mrpj3u6q7tejv6d7eqhnyd27n9v5c5tl3ts08mffe";
|
|
18
|
+
|
|
19
|
+
declare const WarpMultiversxConstants: {
|
|
20
|
+
Egld: {
|
|
21
|
+
Identifier: string;
|
|
22
|
+
EsdtIdentifier: string;
|
|
23
|
+
DisplayName: string;
|
|
24
|
+
Decimals: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare const WarpMultiversxInputTypes: {
|
|
28
|
+
Null: string;
|
|
29
|
+
Optional: string;
|
|
30
|
+
List: string;
|
|
31
|
+
Token: string;
|
|
32
|
+
CodeMeta: string;
|
|
33
|
+
};
|
|
34
|
+
declare enum MultiversxExplorers {
|
|
35
|
+
MultiversxExplorer = "multiversx_explorer",
|
|
36
|
+
MultiversxExplorerDevnet = "multiversx_explorer_devnet",
|
|
37
|
+
MultiversxExplorerTestnet = "multiversx_explorer_testnet"
|
|
38
|
+
}
|
|
39
|
+
declare enum VibechainExplorers {
|
|
40
|
+
VibechainExplorer = "vibechain_explorer",
|
|
41
|
+
VibechainExplorerDevnet = "vibechain_explorer_devnet",
|
|
42
|
+
VibechainExplorerTestnet = "vibechain_explorer_testnet"
|
|
43
|
+
}
|
|
44
|
+
type ExplorerName = MultiversxExplorers | VibechainExplorers;
|
|
45
|
+
declare const MultiversxExplorersConfig: {
|
|
46
|
+
readonly multiversx: {
|
|
47
|
+
readonly mainnet: readonly [MultiversxExplorers.MultiversxExplorer];
|
|
48
|
+
readonly testnet: readonly [MultiversxExplorers.MultiversxExplorerTestnet];
|
|
49
|
+
readonly devnet: readonly [MultiversxExplorers.MultiversxExplorerDevnet];
|
|
50
|
+
};
|
|
51
|
+
readonly vibechain: {
|
|
52
|
+
readonly mainnet: readonly [VibechainExplorers.VibechainExplorer];
|
|
53
|
+
readonly testnet: readonly [VibechainExplorers.VibechainExplorerTestnet];
|
|
54
|
+
readonly devnet: readonly [VibechainExplorers.VibechainExplorerDevnet];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
58
|
+
|
|
59
|
+
declare const isNativeToken: (identifier: string) => boolean;
|
|
60
|
+
declare const getNormalizedTokenIdentifier: (identifier: string) => string;
|
|
61
|
+
declare const getMultiversxEntrypoint: (chainInfo: WarpChainInfo, env: WarpChainEnv, config?: WarpClientConfig) => NetworkEntrypoint;
|
|
62
|
+
|
|
63
|
+
declare const toTypedRegistryInfo: (registryInfo: any) => WarpRegistryInfo;
|
|
64
|
+
declare const toTypedConfigInfo: (configInfo: any) => WarpRegistryConfigInfo;
|
|
65
|
+
|
|
66
|
+
declare const KnownTokens: Record<WarpChain, Record<WarpChainEnv, WarpChainAsset[]>>;
|
|
67
|
+
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
68
|
+
declare const getKnownTokensForChain: (chain: WarpChain, env: WarpChainEnv) => WarpChainAsset[];
|
|
69
|
+
|
|
70
|
+
declare const token: (value: WarpNativeValue) => string;
|
|
71
|
+
declare const codemeta: (value: WarpNativeValue) => string;
|
|
72
|
+
declare const optional: <T extends WarpNativeValue>(codecFunc: (value: T) => string, value: T | null) => string;
|
|
73
|
+
declare const list: (values: WarpNativeValue[]) => string;
|
|
74
|
+
|
|
75
|
+
declare const option_value: (value: TypedValue | null, type?: Type) => OptionValue;
|
|
76
|
+
declare const optional_value: (value: TypedValue | null, type?: Type) => OptionalValue;
|
|
77
|
+
declare const list_value: (values: TypedValue[]) => List;
|
|
78
|
+
declare const variadic_value: (values: TypedValue[]) => VariadicValue;
|
|
79
|
+
declare const composite_value: (values: TypedValue[]) => CompositeValue;
|
|
80
|
+
declare const string_value: (value: string) => StringValue;
|
|
81
|
+
declare const u8_value: (value: number) => U8Value;
|
|
82
|
+
declare const u16_value: (value: number) => U16Value;
|
|
83
|
+
declare const u32_value: (value: number) => U32Value;
|
|
84
|
+
declare const u64_value: (value: bigint) => U64Value;
|
|
85
|
+
declare const biguint_value: (value: bigint | string | number) => BigUIntValue;
|
|
86
|
+
declare const boolean_value: (value: boolean) => BooleanValue;
|
|
87
|
+
declare const address_value: (value: string) => AddressValue;
|
|
88
|
+
declare const token_value: (value: string) => TokenIdentifierValue;
|
|
89
|
+
declare const hex_value: (value: string) => BytesValue;
|
|
90
|
+
declare const asset_value: (value: TokenTransfer) => Struct;
|
|
91
|
+
declare const codemeta_value: (hexString: string) => CodeMetadataValue;
|
|
92
|
+
declare const nothing_value: () => NothingValue;
|
|
93
|
+
|
|
94
|
+
declare class WarpMultiversxAbiBuilder implements AdapterWarpAbiBuilder {
|
|
95
|
+
private readonly config;
|
|
96
|
+
private readonly chain;
|
|
97
|
+
private readonly contractLoader;
|
|
98
|
+
private readonly cache;
|
|
99
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
100
|
+
createInscriptionTransaction(abi: WarpAbiContents): Promise<WarpAdapterGenericTransaction>;
|
|
101
|
+
createFromRaw(encoded: string): Promise<WarpAbi>;
|
|
102
|
+
createFromTransaction(tx: TransactionOnNetwork): Promise<WarpAbi>;
|
|
103
|
+
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<WarpAbi | null>;
|
|
104
|
+
getAbiForAction(action: WarpContractAction | WarpQueryAction): Promise<AbiRegistry>;
|
|
105
|
+
fetchAbi(action: WarpContractAction | WarpQueryAction): Promise<AbiRegistry>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class WarpMultiversxBrandBuilder {
|
|
109
|
+
private readonly config;
|
|
110
|
+
private readonly chain;
|
|
111
|
+
private readonly core;
|
|
112
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
113
|
+
createInscriptionTransaction(brand: WarpBrand): Promise<Transaction>;
|
|
114
|
+
createFromTransaction(tx: TransactionOnNetwork, validateSchema?: boolean): Promise<WarpBrand>;
|
|
115
|
+
createFromTransactionHash(hash: string): Promise<WarpBrand | null>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class WarpMultiversxBuilder extends WarpBuilder implements AdapterWarpBuilder {
|
|
119
|
+
protected readonly config: WarpClientConfig;
|
|
120
|
+
private readonly chain;
|
|
121
|
+
private readonly cache;
|
|
122
|
+
private readonly core;
|
|
123
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
124
|
+
createInscriptionTransaction(warp: Warp): Promise<WarpAdapterGenericTransaction$1>;
|
|
125
|
+
createFromTransaction(tx: TransactionOnNetwork, validate?: boolean): Promise<Warp>;
|
|
126
|
+
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
declare class WarpMultiversxContractLoader {
|
|
130
|
+
private readonly config;
|
|
131
|
+
constructor(config: WarpClientConfig);
|
|
132
|
+
getContract(address: string, chain: WarpChainInfo): Promise<WarpContract | null>;
|
|
133
|
+
getVerificationInfo(address: string, chain: WarpChainInfo): Promise<WarpContractVerification | null>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare class WarpMultiversxDataLoader implements AdapterWarpDataLoader {
|
|
137
|
+
private readonly config;
|
|
138
|
+
private readonly chain;
|
|
139
|
+
private cache;
|
|
140
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
141
|
+
getAccount(address: string): Promise<WarpChainAccount>;
|
|
142
|
+
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
143
|
+
getAsset(identifier: string): Promise<WarpChainAsset | null>;
|
|
144
|
+
getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
|
|
145
|
+
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
146
|
+
private toActionStatus;
|
|
147
|
+
private toActionCreatedAt;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare class WarpMultiversxExecutor implements AdapterWarpExecutor {
|
|
151
|
+
private readonly config;
|
|
152
|
+
private readonly chain;
|
|
153
|
+
private readonly typeRegistry;
|
|
154
|
+
private readonly serializer;
|
|
155
|
+
private readonly abi;
|
|
156
|
+
private readonly results;
|
|
157
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo, typeRegistry: AdapterTypeRegistry);
|
|
158
|
+
createTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
159
|
+
createTransferTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
160
|
+
createContractCallTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
161
|
+
executeQuery(executable: WarpExecutable): Promise<WarpActionExecution>;
|
|
162
|
+
private toTokenTransfers;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
declare class WarpMultiversxExplorer implements AdapterWarpExplorer {
|
|
166
|
+
private readonly chain;
|
|
167
|
+
private readonly config;
|
|
168
|
+
constructor(chain: WarpChain, config: WarpClientConfig);
|
|
169
|
+
private getExplorers;
|
|
170
|
+
private getPrimaryExplorer;
|
|
171
|
+
private getExplorerUrlByName;
|
|
172
|
+
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
173
|
+
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
174
|
+
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
175
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
176
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
177
|
+
getAllExplorers(): readonly ExplorerName[];
|
|
178
|
+
getExplorerByName(name: string): ExplorerName | undefined;
|
|
179
|
+
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
180
|
+
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare class WarpMultiversxRegistry implements AdapterWarpRegistry {
|
|
184
|
+
private config;
|
|
185
|
+
private chain;
|
|
186
|
+
private cache;
|
|
187
|
+
private userWallet;
|
|
188
|
+
registryConfig: WarpRegistryConfigInfo;
|
|
189
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
190
|
+
init(): Promise<void>;
|
|
191
|
+
getRegistryConfig(): WarpRegistryConfigInfo;
|
|
192
|
+
createWarpRegisterTransaction(txHash: string, alias?: string | null, brand?: string | null): Promise<Transaction>;
|
|
193
|
+
createWarpUnregisterTransaction(txHash: string): Promise<Transaction>;
|
|
194
|
+
createWarpUpgradeTransaction(alias: string, txHash: string, brand?: string | null): Promise<Transaction>;
|
|
195
|
+
createWarpAliasSetTransaction(txHash: string, alias: string): Promise<Transaction>;
|
|
196
|
+
createWarpVerifyTransaction(txHash: string): Promise<Transaction>;
|
|
197
|
+
createWarpTransferOwnershipTransaction(txHash: string, newOwner: string): Promise<Transaction>;
|
|
198
|
+
createBrandRegisterTransaction(txHash: string): Promise<Transaction>;
|
|
199
|
+
createWarpBrandingTransaction(warpHash: string, brandHash: string): Promise<Transaction>;
|
|
200
|
+
getInfoByAlias(alias: string, cache?: WarpCacheConfig): Promise<{
|
|
201
|
+
registryInfo: WarpRegistryInfo | null;
|
|
202
|
+
brand: WarpBrand | null;
|
|
203
|
+
}>;
|
|
204
|
+
getInfoByHash(hash: string, cache?: WarpCacheConfig): Promise<{
|
|
205
|
+
registryInfo: WarpRegistryInfo | null;
|
|
206
|
+
brand: WarpBrand | null;
|
|
207
|
+
}>;
|
|
208
|
+
getUserWarpRegistryInfos(user?: string): Promise<WarpRegistryInfo[]>;
|
|
209
|
+
getUserBrands(user?: string): Promise<WarpBrand[]>;
|
|
210
|
+
fetchBrand(hash: string, cache?: WarpCacheConfig): Promise<WarpBrand | null>;
|
|
211
|
+
private loadRegistryConfigs;
|
|
212
|
+
private getFactory;
|
|
213
|
+
private getController;
|
|
214
|
+
private isCurrentUserAdmin;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
declare class WarpMultiversxResults implements AdapterWarpResults {
|
|
218
|
+
private readonly config;
|
|
219
|
+
private readonly chain;
|
|
220
|
+
private readonly typeRegistry;
|
|
221
|
+
private readonly abi;
|
|
222
|
+
private readonly serializer;
|
|
223
|
+
private readonly cache;
|
|
224
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo, typeRegistry: AdapterTypeRegistry$1);
|
|
225
|
+
getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecution>;
|
|
226
|
+
extractContractResults(warp: Warp, actionIndex: WarpActionIndex, tx: TransactionOnNetwork, inputs: ResolvedInput[]): Promise<{
|
|
227
|
+
values: {
|
|
228
|
+
string: string[];
|
|
229
|
+
native: any[];
|
|
230
|
+
};
|
|
231
|
+
results: WarpExecutionResults;
|
|
232
|
+
}>;
|
|
233
|
+
extractQueryResults(warp: Warp, typedValues: TypedValue[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
234
|
+
values: {
|
|
235
|
+
string: string[];
|
|
236
|
+
native: any[];
|
|
237
|
+
};
|
|
238
|
+
results: WarpExecutionResults;
|
|
239
|
+
}>;
|
|
240
|
+
resolveWarpResultsRecursively(props: {
|
|
241
|
+
warp: Warp;
|
|
242
|
+
entryActionIndex: number;
|
|
243
|
+
executor: {
|
|
244
|
+
executeQuery: Function;
|
|
245
|
+
executeCollect: Function;
|
|
246
|
+
};
|
|
247
|
+
inputs: ResolvedInput[];
|
|
248
|
+
meta?: Record<string, any>;
|
|
249
|
+
}): Promise<any>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
declare class WarpMultiversxSerializer implements AdapterWarpSerializer {
|
|
253
|
+
readonly coreSerializer: WarpSerializer;
|
|
254
|
+
constructor(options?: {
|
|
255
|
+
typeRegistry?: AdapterTypeRegistry;
|
|
256
|
+
});
|
|
257
|
+
typedToString(value: TypedValue): string;
|
|
258
|
+
typedToNative(value: TypedValue): [WarpActionInputType, WarpNativeValue];
|
|
259
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): TypedValue;
|
|
260
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
261
|
+
stringToTyped(value: string): TypedValue;
|
|
262
|
+
private splitTupleStrings;
|
|
263
|
+
typeToString(type: Type): WarpActionInputType;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare class WarpMultiversxWallet implements AdapterWarpWallet {
|
|
267
|
+
private config;
|
|
268
|
+
private chain;
|
|
269
|
+
private entry;
|
|
270
|
+
private provider;
|
|
271
|
+
private cache;
|
|
272
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
273
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
274
|
+
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
275
|
+
signMessage(message: string): Promise<string>;
|
|
276
|
+
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
277
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
278
|
+
create(mnemonic: string): {
|
|
279
|
+
address: string;
|
|
280
|
+
privateKey: string;
|
|
281
|
+
mnemonic: string;
|
|
282
|
+
};
|
|
283
|
+
generate(): {
|
|
284
|
+
address: string;
|
|
285
|
+
privateKey: string;
|
|
286
|
+
mnemonic: string;
|
|
287
|
+
};
|
|
288
|
+
getAddress(): string | null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export { type ExplorerName, ExplorerUrls, KnownTokens, MultiversxExplorers, MultiversxExplorersConfig, NativeTokenEgld, NativeTokenVibe, VibechainExplorers, WarpMultiversxAbiBuilder, WarpMultiversxBrandBuilder, WarpMultiversxBuilder, WarpMultiversxConstants, WarpMultiversxContractLoader, WarpMultiversxDataLoader, WarpMultiversxExecutor, WarpMultiversxExplorer, WarpMultiversxInputTypes, WarpMultiversxRegistry, WarpMultiversxResults, WarpMultiversxSerializer, WarpMultiversxWallet, address_value, asset_value, biguint_value, boolean_value, codemeta, codemeta_value, composite_value, createMultiversxAdapter, findKnownTokenById, getAllMultiversxAdapters, getAllMultiversxChainNames, getKnownTokensForChain, getMultiversxAdapter, getMultiversxEntrypoint, getMultiversxRegistryAddress, getNormalizedTokenIdentifier, getVibechainAdapter, hex_value, isNativeToken, list, list_value, nothing_value, option_value, optional, optional_value, string_value, toTypedConfigInfo, toTypedRegistryInfo, token, token_value, u16_value, u32_value, u64_value, u8_value, variadic_value };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as _vleap_warps from '@vleap/warps';
|
|
2
|
+
import { WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterFactory, WarpChainAsset, WarpRegistryInfo, WarpRegistryConfigInfo, WarpNativeValue, AdapterWarpAbiBuilder, WarpAbiContents, WarpAdapterGenericTransaction, WarpAbi, WarpCacheConfig, WarpContractAction, WarpQueryAction, WarpBrand, WarpBuilder, AdapterWarpBuilder, Warp, WarpContract, WarpContractVerification, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpActionExecution, AdapterWarpExplorer, AdapterWarpRegistry, AdapterWarpResults, AdapterTypeRegistry as AdapterTypeRegistry$1, WarpActionIndex, WarpAdapterGenericRemoteTransaction, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, BaseWarpActionInputType, WarpAdapterGenericType, AdapterWarpWallet } from '@vleap/warps';
|
|
3
|
+
import { NetworkEntrypoint, TypedValue, Type, OptionValue, OptionalValue, List, VariadicValue, CompositeValue, StringValue, U8Value, U16Value, U32Value, U64Value, BigUIntValue, BooleanValue, AddressValue, TokenIdentifierValue, BytesValue, TokenTransfer, Struct, CodeMetadataValue, NothingValue, TransactionOnNetwork, AbiRegistry, Transaction } from '@multiversx/sdk-core';
|
|
4
|
+
import { WarpAdapterGenericTransaction as WarpAdapterGenericTransaction$1, AdapterTypeRegistry } from '@vleap/warps/src/types';
|
|
5
|
+
|
|
6
|
+
declare const getAllMultiversxAdapters: (config: WarpClientConfig, fallback?: Adapter) => Adapter[];
|
|
7
|
+
declare const getAllMultiversxChainNames: () => WarpChain[];
|
|
8
|
+
|
|
9
|
+
declare const createMultiversxAdapter: (chainName: string, chainInfos: Record<WarpChainEnv, WarpChainInfo>) => AdapterFactory;
|
|
10
|
+
|
|
11
|
+
declare const NativeTokenEgld: WarpChainAsset;
|
|
12
|
+
declare const getMultiversxAdapter: _vleap_warps.AdapterFactory;
|
|
13
|
+
|
|
14
|
+
declare const NativeTokenVibe: WarpChainAsset;
|
|
15
|
+
declare const getVibechainAdapter: _vleap_warps.AdapterFactory;
|
|
16
|
+
|
|
17
|
+
declare const getMultiversxRegistryAddress: (env: WarpChainEnv) => "erd1qqqqqqqqqqqqqpgqje2f99vr6r7sk54thg03c9suzcvwr4nfl3tsfkdl36" | "erd1qqqqqqqqqqqqqpgq3mrpj3u6q7tejv6d7eqhnyd27n9v5c5tl3ts08mffe";
|
|
3
18
|
|
|
4
19
|
declare const WarpMultiversxConstants: {
|
|
5
20
|
Egld: {
|
|
@@ -9,8 +24,53 @@ declare const WarpMultiversxConstants: {
|
|
|
9
24
|
Decimals: number;
|
|
10
25
|
};
|
|
11
26
|
};
|
|
27
|
+
declare const WarpMultiversxInputTypes: {
|
|
28
|
+
Null: string;
|
|
29
|
+
Optional: string;
|
|
30
|
+
List: string;
|
|
31
|
+
Token: string;
|
|
32
|
+
CodeMeta: string;
|
|
33
|
+
};
|
|
34
|
+
declare enum MultiversxExplorers {
|
|
35
|
+
MultiversxExplorer = "multiversx_explorer",
|
|
36
|
+
MultiversxExplorerDevnet = "multiversx_explorer_devnet",
|
|
37
|
+
MultiversxExplorerTestnet = "multiversx_explorer_testnet"
|
|
38
|
+
}
|
|
39
|
+
declare enum VibechainExplorers {
|
|
40
|
+
VibechainExplorer = "vibechain_explorer",
|
|
41
|
+
VibechainExplorerDevnet = "vibechain_explorer_devnet",
|
|
42
|
+
VibechainExplorerTestnet = "vibechain_explorer_testnet"
|
|
43
|
+
}
|
|
44
|
+
type ExplorerName = MultiversxExplorers | VibechainExplorers;
|
|
45
|
+
declare const MultiversxExplorersConfig: {
|
|
46
|
+
readonly multiversx: {
|
|
47
|
+
readonly mainnet: readonly [MultiversxExplorers.MultiversxExplorer];
|
|
48
|
+
readonly testnet: readonly [MultiversxExplorers.MultiversxExplorerTestnet];
|
|
49
|
+
readonly devnet: readonly [MultiversxExplorers.MultiversxExplorerDevnet];
|
|
50
|
+
};
|
|
51
|
+
readonly vibechain: {
|
|
52
|
+
readonly mainnet: readonly [VibechainExplorers.VibechainExplorer];
|
|
53
|
+
readonly testnet: readonly [VibechainExplorers.VibechainExplorerTestnet];
|
|
54
|
+
readonly devnet: readonly [VibechainExplorers.VibechainExplorerDevnet];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
declare const ExplorerUrls: Record<ExplorerName, string>;
|
|
58
|
+
|
|
59
|
+
declare const isNativeToken: (identifier: string) => boolean;
|
|
60
|
+
declare const getNormalizedTokenIdentifier: (identifier: string) => string;
|
|
61
|
+
declare const getMultiversxEntrypoint: (chainInfo: WarpChainInfo, env: WarpChainEnv, config?: WarpClientConfig) => NetworkEntrypoint;
|
|
62
|
+
|
|
63
|
+
declare const toTypedRegistryInfo: (registryInfo: any) => WarpRegistryInfo;
|
|
64
|
+
declare const toTypedConfigInfo: (configInfo: any) => WarpRegistryConfigInfo;
|
|
12
65
|
|
|
13
|
-
declare const
|
|
66
|
+
declare const KnownTokens: Record<WarpChain, Record<WarpChainEnv, WarpChainAsset[]>>;
|
|
67
|
+
declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
|
|
68
|
+
declare const getKnownTokensForChain: (chain: WarpChain, env: WarpChainEnv) => WarpChainAsset[];
|
|
69
|
+
|
|
70
|
+
declare const token: (value: WarpNativeValue) => string;
|
|
71
|
+
declare const codemeta: (value: WarpNativeValue) => string;
|
|
72
|
+
declare const optional: <T extends WarpNativeValue>(codecFunc: (value: T) => string, value: T | null) => string;
|
|
73
|
+
declare const list: (values: WarpNativeValue[]) => string;
|
|
14
74
|
|
|
15
75
|
declare const option_value: (value: TypedValue | null, type?: Type) => OptionValue;
|
|
16
76
|
declare const optional_value: (value: TypedValue | null, type?: Type) => OptionalValue;
|
|
@@ -27,15 +87,17 @@ declare const boolean_value: (value: boolean) => BooleanValue;
|
|
|
27
87
|
declare const address_value: (value: string) => AddressValue;
|
|
28
88
|
declare const token_value: (value: string) => TokenIdentifierValue;
|
|
29
89
|
declare const hex_value: (value: string) => BytesValue;
|
|
30
|
-
declare const
|
|
90
|
+
declare const asset_value: (value: TokenTransfer) => Struct;
|
|
31
91
|
declare const codemeta_value: (hexString: string) => CodeMetadataValue;
|
|
32
92
|
declare const nothing_value: () => NothingValue;
|
|
33
93
|
|
|
34
|
-
declare class
|
|
94
|
+
declare class WarpMultiversxAbiBuilder implements AdapterWarpAbiBuilder {
|
|
35
95
|
private readonly config;
|
|
96
|
+
private readonly chain;
|
|
36
97
|
private readonly contractLoader;
|
|
37
98
|
private readonly cache;
|
|
38
|
-
constructor(config:
|
|
99
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
100
|
+
createInscriptionTransaction(abi: WarpAbiContents): Promise<WarpAdapterGenericTransaction>;
|
|
39
101
|
createFromRaw(encoded: string): Promise<WarpAbi>;
|
|
40
102
|
createFromTransaction(tx: TransactionOnNetwork): Promise<WarpAbi>;
|
|
41
103
|
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<WarpAbi | null>;
|
|
@@ -44,59 +106,97 @@ declare class WarpMultiversxAbi {
|
|
|
44
106
|
}
|
|
45
107
|
|
|
46
108
|
declare class WarpMultiversxBrandBuilder {
|
|
47
|
-
private config;
|
|
48
|
-
private
|
|
49
|
-
|
|
50
|
-
|
|
109
|
+
private readonly config;
|
|
110
|
+
private readonly chain;
|
|
111
|
+
private readonly core;
|
|
112
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
113
|
+
createInscriptionTransaction(brand: WarpBrand): Promise<Transaction>;
|
|
51
114
|
createFromTransaction(tx: TransactionOnNetwork, validateSchema?: boolean): Promise<WarpBrand>;
|
|
52
115
|
createFromTransactionHash(hash: string): Promise<WarpBrand | null>;
|
|
53
116
|
}
|
|
54
117
|
|
|
55
|
-
declare class WarpMultiversxBuilder implements AdapterWarpBuilder {
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
private
|
|
59
|
-
|
|
60
|
-
|
|
118
|
+
declare class WarpMultiversxBuilder extends WarpBuilder implements AdapterWarpBuilder {
|
|
119
|
+
protected readonly config: WarpClientConfig;
|
|
120
|
+
private readonly chain;
|
|
121
|
+
private readonly cache;
|
|
122
|
+
private readonly core;
|
|
123
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
124
|
+
createInscriptionTransaction(warp: Warp): Promise<WarpAdapterGenericTransaction$1>;
|
|
61
125
|
createFromTransaction(tx: TransactionOnNetwork, validate?: boolean): Promise<Warp>;
|
|
62
126
|
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
|
|
63
127
|
}
|
|
64
128
|
|
|
65
129
|
declare class WarpMultiversxContractLoader {
|
|
66
130
|
private readonly config;
|
|
67
|
-
constructor(config:
|
|
131
|
+
constructor(config: WarpClientConfig);
|
|
68
132
|
getContract(address: string, chain: WarpChainInfo): Promise<WarpContract | null>;
|
|
69
133
|
getVerificationInfo(address: string, chain: WarpChainInfo): Promise<WarpContractVerification | null>;
|
|
70
134
|
}
|
|
71
135
|
|
|
136
|
+
declare class WarpMultiversxDataLoader implements AdapterWarpDataLoader {
|
|
137
|
+
private readonly config;
|
|
138
|
+
private readonly chain;
|
|
139
|
+
private cache;
|
|
140
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
141
|
+
getAccount(address: string): Promise<WarpChainAccount>;
|
|
142
|
+
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
143
|
+
getAsset(identifier: string): Promise<WarpChainAsset | null>;
|
|
144
|
+
getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
|
|
145
|
+
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
146
|
+
private toActionStatus;
|
|
147
|
+
private toActionCreatedAt;
|
|
148
|
+
}
|
|
149
|
+
|
|
72
150
|
declare class WarpMultiversxExecutor implements AdapterWarpExecutor {
|
|
73
151
|
private readonly config;
|
|
152
|
+
private readonly chain;
|
|
153
|
+
private readonly typeRegistry;
|
|
74
154
|
private readonly serializer;
|
|
75
155
|
private readonly abi;
|
|
76
156
|
private readonly results;
|
|
77
|
-
constructor(config:
|
|
157
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo, typeRegistry: AdapterTypeRegistry);
|
|
78
158
|
createTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
79
159
|
createTransferTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
80
160
|
createContractCallTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
81
|
-
executeQuery(executable: WarpExecutable): Promise<
|
|
82
|
-
|
|
83
|
-
|
|
161
|
+
executeQuery(executable: WarpExecutable): Promise<WarpActionExecution>;
|
|
162
|
+
private toTokenTransfers;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
declare class WarpMultiversxExplorer implements AdapterWarpExplorer {
|
|
166
|
+
private readonly chain;
|
|
167
|
+
private readonly config;
|
|
168
|
+
constructor(chain: WarpChain, config: WarpClientConfig);
|
|
169
|
+
private getExplorers;
|
|
170
|
+
private getPrimaryExplorer;
|
|
171
|
+
private getExplorerUrlByName;
|
|
172
|
+
getAccountUrl(address: string, explorer?: ExplorerName): string;
|
|
173
|
+
getTransactionUrl(hash: string, explorer?: ExplorerName): string;
|
|
174
|
+
getBlockUrl(blockNumber: string | number, explorer?: ExplorerName): string;
|
|
175
|
+
getAssetUrl(identifier: string, explorer?: ExplorerName): string;
|
|
176
|
+
getContractUrl(address: string, explorer?: ExplorerName): string;
|
|
177
|
+
getAllExplorers(): readonly ExplorerName[];
|
|
178
|
+
getExplorerByName(name: string): ExplorerName | undefined;
|
|
179
|
+
getAccountUrls(address: string): Record<ExplorerName, string>;
|
|
180
|
+
getTransactionUrls(hash: string): Record<ExplorerName, string>;
|
|
84
181
|
}
|
|
85
182
|
|
|
86
183
|
declare class WarpMultiversxRegistry implements AdapterWarpRegistry {
|
|
87
184
|
private config;
|
|
185
|
+
private chain;
|
|
88
186
|
private cache;
|
|
187
|
+
private userWallet;
|
|
89
188
|
registryConfig: WarpRegistryConfigInfo;
|
|
90
|
-
constructor(config:
|
|
189
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
91
190
|
init(): Promise<void>;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
191
|
+
getRegistryConfig(): WarpRegistryConfigInfo;
|
|
192
|
+
createWarpRegisterTransaction(txHash: string, alias?: string | null, brand?: string | null): Promise<Transaction>;
|
|
193
|
+
createWarpUnregisterTransaction(txHash: string): Promise<Transaction>;
|
|
194
|
+
createWarpUpgradeTransaction(alias: string, txHash: string, brand?: string | null): Promise<Transaction>;
|
|
195
|
+
createWarpAliasSetTransaction(txHash: string, alias: string): Promise<Transaction>;
|
|
196
|
+
createWarpVerifyTransaction(txHash: string): Promise<Transaction>;
|
|
197
|
+
createWarpTransferOwnershipTransaction(txHash: string, newOwner: string): Promise<Transaction>;
|
|
198
|
+
createBrandRegisterTransaction(txHash: string): Promise<Transaction>;
|
|
199
|
+
createWarpBrandingTransaction(warpHash: string, brandHash: string): Promise<Transaction>;
|
|
100
200
|
getInfoByAlias(alias: string, cache?: WarpCacheConfig): Promise<{
|
|
101
201
|
registryInfo: WarpRegistryInfo | null;
|
|
102
202
|
brand: WarpBrand | null;
|
|
@@ -107,12 +207,7 @@ declare class WarpMultiversxRegistry implements AdapterWarpRegistry {
|
|
|
107
207
|
}>;
|
|
108
208
|
getUserWarpRegistryInfos(user?: string): Promise<WarpRegistryInfo[]>;
|
|
109
209
|
getUserBrands(user?: string): Promise<WarpBrand[]>;
|
|
110
|
-
getChainInfos(cache?: WarpCacheConfig): Promise<WarpChainInfo[]>;
|
|
111
|
-
getChainInfo(chain: WarpChain, cache?: WarpCacheConfig): Promise<WarpChainInfo | null>;
|
|
112
|
-
setChain(info: WarpChainInfo): Promise<Transaction>;
|
|
113
|
-
removeChain(chain: WarpChain): Promise<Transaction>;
|
|
114
210
|
fetchBrand(hash: string, cache?: WarpCacheConfig): Promise<WarpBrand | null>;
|
|
115
|
-
getRegistryContractAddress(): Address;
|
|
116
211
|
private loadRegistryConfigs;
|
|
117
212
|
private getFactory;
|
|
118
213
|
private getController;
|
|
@@ -121,17 +216,25 @@ declare class WarpMultiversxRegistry implements AdapterWarpRegistry {
|
|
|
121
216
|
|
|
122
217
|
declare class WarpMultiversxResults implements AdapterWarpResults {
|
|
123
218
|
private readonly config;
|
|
219
|
+
private readonly chain;
|
|
220
|
+
private readonly typeRegistry;
|
|
124
221
|
private readonly abi;
|
|
125
222
|
private readonly serializer;
|
|
126
223
|
private readonly cache;
|
|
127
|
-
constructor(config:
|
|
128
|
-
|
|
129
|
-
extractContractResults(warp: Warp, tx: TransactionOnNetwork, inputs: ResolvedInput[]): Promise<{
|
|
130
|
-
values:
|
|
224
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo, typeRegistry: AdapterTypeRegistry$1);
|
|
225
|
+
getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecution>;
|
|
226
|
+
extractContractResults(warp: Warp, actionIndex: WarpActionIndex, tx: TransactionOnNetwork, inputs: ResolvedInput[]): Promise<{
|
|
227
|
+
values: {
|
|
228
|
+
string: string[];
|
|
229
|
+
native: any[];
|
|
230
|
+
};
|
|
131
231
|
results: WarpExecutionResults;
|
|
132
232
|
}>;
|
|
133
233
|
extractQueryResults(warp: Warp, typedValues: TypedValue[], actionIndex: number, inputs: ResolvedInput[]): Promise<{
|
|
134
|
-
values:
|
|
234
|
+
values: {
|
|
235
|
+
string: string[];
|
|
236
|
+
native: any[];
|
|
237
|
+
};
|
|
135
238
|
results: WarpExecutionResults;
|
|
136
239
|
}>;
|
|
137
240
|
resolveWarpResultsRecursively(props: {
|
|
@@ -148,13 +251,41 @@ declare class WarpMultiversxResults implements AdapterWarpResults {
|
|
|
148
251
|
|
|
149
252
|
declare class WarpMultiversxSerializer implements AdapterWarpSerializer {
|
|
150
253
|
readonly coreSerializer: WarpSerializer;
|
|
151
|
-
constructor(
|
|
254
|
+
constructor(options?: {
|
|
255
|
+
typeRegistry?: AdapterTypeRegistry;
|
|
256
|
+
});
|
|
152
257
|
typedToString(value: TypedValue): string;
|
|
153
258
|
typedToNative(value: TypedValue): [WarpActionInputType, WarpNativeValue];
|
|
154
259
|
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): TypedValue;
|
|
155
260
|
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
156
261
|
stringToTyped(value: string): TypedValue;
|
|
262
|
+
private splitTupleStrings;
|
|
157
263
|
typeToString(type: Type): WarpActionInputType;
|
|
158
264
|
}
|
|
159
265
|
|
|
160
|
-
|
|
266
|
+
declare class WarpMultiversxWallet implements AdapterWarpWallet {
|
|
267
|
+
private config;
|
|
268
|
+
private chain;
|
|
269
|
+
private entry;
|
|
270
|
+
private provider;
|
|
271
|
+
private cache;
|
|
272
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
273
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
274
|
+
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
275
|
+
signMessage(message: string): Promise<string>;
|
|
276
|
+
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
277
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
278
|
+
create(mnemonic: string): {
|
|
279
|
+
address: string;
|
|
280
|
+
privateKey: string;
|
|
281
|
+
mnemonic: string;
|
|
282
|
+
};
|
|
283
|
+
generate(): {
|
|
284
|
+
address: string;
|
|
285
|
+
privateKey: string;
|
|
286
|
+
mnemonic: string;
|
|
287
|
+
};
|
|
288
|
+
getAddress(): string | null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export { type ExplorerName, ExplorerUrls, KnownTokens, MultiversxExplorers, MultiversxExplorersConfig, NativeTokenEgld, NativeTokenVibe, VibechainExplorers, WarpMultiversxAbiBuilder, WarpMultiversxBrandBuilder, WarpMultiversxBuilder, WarpMultiversxConstants, WarpMultiversxContractLoader, WarpMultiversxDataLoader, WarpMultiversxExecutor, WarpMultiversxExplorer, WarpMultiversxInputTypes, WarpMultiversxRegistry, WarpMultiversxResults, WarpMultiversxSerializer, WarpMultiversxWallet, address_value, asset_value, biguint_value, boolean_value, codemeta, codemeta_value, composite_value, createMultiversxAdapter, findKnownTokenById, getAllMultiversxAdapters, getAllMultiversxChainNames, getKnownTokensForChain, getMultiversxAdapter, getMultiversxEntrypoint, getMultiversxRegistryAddress, getNormalizedTokenIdentifier, getVibechainAdapter, hex_value, isNativeToken, list, list_value, nothing_value, option_value, optional, optional_value, string_value, toTypedConfigInfo, toTypedRegistryInfo, token, token_value, u16_value, u32_value, u64_value, u8_value, variadic_value };
|