@vleap/warps-adapter-fastset 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +124 -0
- package/dist/index.d.ts +108 -116
- package/dist/index.js +539 -437
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +534 -432
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -5
- package/dist/index.d.mts +0 -132
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, AdapterWarpExecutor, WarpChainInfo, WarpExecutable, AdapterWarpWallet, WarpAdapterGenericTransaction, WarpWalletDetails } from '@vleap/warps';
|
|
2
|
+
|
|
3
|
+
declare const NativeTokenSet: WarpChainAsset;
|
|
4
|
+
declare const getFastsetAdapter: AdapterFactory;
|
|
5
|
+
|
|
6
|
+
interface TransactionData {
|
|
7
|
+
sender: number[] | Uint8Array;
|
|
8
|
+
recipient: any;
|
|
9
|
+
nonce: number;
|
|
10
|
+
timestamp_nanos: bigint;
|
|
11
|
+
claim: any;
|
|
12
|
+
}
|
|
13
|
+
declare class Transaction {
|
|
14
|
+
private sender;
|
|
15
|
+
private recipient;
|
|
16
|
+
private nonce;
|
|
17
|
+
private claim;
|
|
18
|
+
private timestamp;
|
|
19
|
+
constructor(sender: Uint8Array, recipient: {
|
|
20
|
+
FastSet: Uint8Array;
|
|
21
|
+
} | {
|
|
22
|
+
External: Uint8Array;
|
|
23
|
+
}, nonce: number, claim: any, timestamp?: bigint);
|
|
24
|
+
toTransaction(): {
|
|
25
|
+
sender: Uint8Array<ArrayBufferLike>;
|
|
26
|
+
recipient: {
|
|
27
|
+
FastSet: Uint8Array;
|
|
28
|
+
} | {
|
|
29
|
+
External: Uint8Array;
|
|
30
|
+
};
|
|
31
|
+
nonce: number;
|
|
32
|
+
timestamp_nanos: bigint;
|
|
33
|
+
claim: any;
|
|
34
|
+
};
|
|
35
|
+
getRecipientAddress(): {
|
|
36
|
+
FastSet: Uint8Array;
|
|
37
|
+
} | {
|
|
38
|
+
External: Uint8Array;
|
|
39
|
+
};
|
|
40
|
+
getAmount(): any;
|
|
41
|
+
getUserData(): any;
|
|
42
|
+
}
|
|
43
|
+
interface AccountInfoResponse {
|
|
44
|
+
sender: number[];
|
|
45
|
+
balance: string;
|
|
46
|
+
next_nonce: number;
|
|
47
|
+
pending_confirmation?: any;
|
|
48
|
+
requested_certificate?: any;
|
|
49
|
+
requested_validated_transaction?: any;
|
|
50
|
+
requested_received_transfers: any[];
|
|
51
|
+
token_balance: Array<[number[], string]>;
|
|
52
|
+
requested_claim_by_id?: any;
|
|
53
|
+
requested_claims: any[];
|
|
54
|
+
}
|
|
55
|
+
interface AccountInfoResponse {
|
|
56
|
+
sender: number[];
|
|
57
|
+
balance: string;
|
|
58
|
+
next_nonce: number;
|
|
59
|
+
pending_confirmation?: any;
|
|
60
|
+
requested_certificate?: any;
|
|
61
|
+
requested_validated_transaction?: any;
|
|
62
|
+
requested_received_transfers: any[];
|
|
63
|
+
token_balance: Array<[number[], string]>;
|
|
64
|
+
requested_claim_by_id?: any;
|
|
65
|
+
requested_claims: any[];
|
|
66
|
+
}
|
|
67
|
+
declare class FastsetClient {
|
|
68
|
+
private proxyUrl;
|
|
69
|
+
constructor(config?: WarpClientConfig | {
|
|
70
|
+
proxyUrl: string;
|
|
71
|
+
}, chain?: any);
|
|
72
|
+
private makeRequest;
|
|
73
|
+
getAccountInfo(address: number[]): Promise<AccountInfoResponse>;
|
|
74
|
+
getNextNonce(address: string | number[]): Promise<number>;
|
|
75
|
+
submitTransaction(transaction: TransactionData, signature: number[] | Uint8Array): Promise<string>;
|
|
76
|
+
faucetDrip(recipient: number[] | Uint8Array, amount: string): Promise<any>;
|
|
77
|
+
private addressToBytes;
|
|
78
|
+
generateNewWallet(): Wallet;
|
|
79
|
+
createWallet(privateKeyHex: string): Wallet;
|
|
80
|
+
static decodeBech32Address(address: string): Uint8Array;
|
|
81
|
+
static encodeBech32Address(publicKey: Uint8Array): string;
|
|
82
|
+
}
|
|
83
|
+
declare class Wallet {
|
|
84
|
+
readonly publicKey: Uint8Array;
|
|
85
|
+
private readonly privateKey;
|
|
86
|
+
constructor(privateKeyHex: string);
|
|
87
|
+
toBech32(): string;
|
|
88
|
+
signTransactionRaw(data: Uint8Array): Uint8Array;
|
|
89
|
+
getPrivateKey(): Uint8Array;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare class WarpFastsetExecutor implements AdapterWarpExecutor {
|
|
93
|
+
private readonly config;
|
|
94
|
+
private readonly chain;
|
|
95
|
+
private readonly fastsetClient;
|
|
96
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
97
|
+
createTransaction(executable: WarpExecutable): Promise<any>;
|
|
98
|
+
createTransferTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
99
|
+
createContractCallTransaction(executable: WarpExecutable): Promise<any>;
|
|
100
|
+
executeQuery(executable: WarpExecutable): Promise<any>;
|
|
101
|
+
executeTransfer(executable: WarpExecutable): Promise<any>;
|
|
102
|
+
executeTransferWithKey(executable: WarpExecutable, privateKey: string): Promise<any>;
|
|
103
|
+
private signTransaction;
|
|
104
|
+
private serializeTransaction;
|
|
105
|
+
private executeFastsetQuery;
|
|
106
|
+
private fromBase64;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare class WarpFastsetWallet implements AdapterWarpWallet {
|
|
110
|
+
private config;
|
|
111
|
+
private chain;
|
|
112
|
+
private wallet;
|
|
113
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
114
|
+
private initializeWallet;
|
|
115
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
116
|
+
signMessage(message: string): Promise<string>;
|
|
117
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
118
|
+
create(mnemonic: string): WarpWalletDetails;
|
|
119
|
+
generate(): WarpWalletDetails;
|
|
120
|
+
getAddress(): string | null;
|
|
121
|
+
private serializeTransaction;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { FastsetClient, NativeTokenSet, Transaction, Wallet, WarpFastsetExecutor, WarpFastsetWallet, getFastsetAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,132 +1,124 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WarpChainAsset, AdapterFactory, WarpClientConfig, AdapterWarpExecutor, WarpChainInfo, WarpExecutable, AdapterWarpWallet, WarpAdapterGenericTransaction, WarpWalletDetails } from '@vleap/warps';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
Testnet: {
|
|
32
|
-
ChainId: string;
|
|
33
|
-
Name: string;
|
|
34
|
-
BlockTime: number;
|
|
35
|
-
};
|
|
36
|
-
Devnet: {
|
|
37
|
-
ChainId: string;
|
|
38
|
-
Name: string;
|
|
39
|
-
BlockTime: number;
|
|
3
|
+
declare const NativeTokenSet: WarpChainAsset;
|
|
4
|
+
declare const getFastsetAdapter: AdapterFactory;
|
|
5
|
+
|
|
6
|
+
interface TransactionData {
|
|
7
|
+
sender: number[] | Uint8Array;
|
|
8
|
+
recipient: any;
|
|
9
|
+
nonce: number;
|
|
10
|
+
timestamp_nanos: bigint;
|
|
11
|
+
claim: any;
|
|
12
|
+
}
|
|
13
|
+
declare class Transaction {
|
|
14
|
+
private sender;
|
|
15
|
+
private recipient;
|
|
16
|
+
private nonce;
|
|
17
|
+
private claim;
|
|
18
|
+
private timestamp;
|
|
19
|
+
constructor(sender: Uint8Array, recipient: {
|
|
20
|
+
FastSet: Uint8Array;
|
|
21
|
+
} | {
|
|
22
|
+
External: Uint8Array;
|
|
23
|
+
}, nonce: number, claim: any, timestamp?: bigint);
|
|
24
|
+
toTransaction(): {
|
|
25
|
+
sender: Uint8Array<ArrayBufferLike>;
|
|
26
|
+
recipient: {
|
|
27
|
+
FastSet: Uint8Array;
|
|
28
|
+
} | {
|
|
29
|
+
External: Uint8Array;
|
|
40
30
|
};
|
|
31
|
+
nonce: number;
|
|
32
|
+
timestamp_nanos: bigint;
|
|
33
|
+
claim: any;
|
|
41
34
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
MaxGasLimit: number;
|
|
47
|
-
};
|
|
48
|
-
Timeouts: {
|
|
49
|
-
DefaultRpcTimeout: number;
|
|
50
|
-
GasEstimationTimeout: number;
|
|
51
|
-
QueryTimeout: number;
|
|
35
|
+
getRecipientAddress(): {
|
|
36
|
+
FastSet: Uint8Array;
|
|
37
|
+
} | {
|
|
38
|
+
External: Uint8Array;
|
|
52
39
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
40
|
+
getAmount(): any;
|
|
41
|
+
getUserData(): any;
|
|
42
|
+
}
|
|
43
|
+
interface AccountInfoResponse {
|
|
44
|
+
sender: number[];
|
|
45
|
+
balance: string;
|
|
46
|
+
next_nonce: number;
|
|
47
|
+
pending_confirmation?: any;
|
|
48
|
+
requested_certificate?: any;
|
|
49
|
+
requested_validated_transaction?: any;
|
|
50
|
+
requested_received_transfers: any[];
|
|
51
|
+
token_balance: Array<[number[], string]>;
|
|
52
|
+
requested_claim_by_id?: any;
|
|
53
|
+
requested_claims: any[];
|
|
54
|
+
}
|
|
55
|
+
interface AccountInfoResponse {
|
|
56
|
+
sender: number[];
|
|
57
|
+
balance: string;
|
|
58
|
+
next_nonce: number;
|
|
59
|
+
pending_confirmation?: any;
|
|
60
|
+
requested_certificate?: any;
|
|
61
|
+
requested_validated_transaction?: any;
|
|
62
|
+
requested_received_transfers: any[];
|
|
63
|
+
token_balance: Array<[number[], string]>;
|
|
64
|
+
requested_claim_by_id?: any;
|
|
65
|
+
requested_claims: any[];
|
|
66
|
+
}
|
|
67
|
+
declare class FastsetClient {
|
|
68
|
+
private proxyUrl;
|
|
69
|
+
constructor(config?: WarpClientConfig | {
|
|
70
|
+
proxyUrl: string;
|
|
71
|
+
}, chain?: any);
|
|
72
|
+
private makeRequest;
|
|
73
|
+
getAccountInfo(address: number[]): Promise<AccountInfoResponse>;
|
|
74
|
+
getNextNonce(address: string | number[]): Promise<number>;
|
|
75
|
+
submitTransaction(transaction: TransactionData, signature: number[] | Uint8Array): Promise<string>;
|
|
76
|
+
faucetDrip(recipient: number[] | Uint8Array, amount: string): Promise<any>;
|
|
77
|
+
private addressToBytes;
|
|
78
|
+
generateNewWallet(): Wallet;
|
|
79
|
+
createWallet(privateKeyHex: string): Wallet;
|
|
80
|
+
static decodeBech32Address(address: string): Uint8Array;
|
|
81
|
+
static encodeBech32Address(publicKey: Uint8Array): string;
|
|
82
|
+
}
|
|
83
|
+
declare class Wallet {
|
|
84
|
+
readonly publicKey: Uint8Array;
|
|
85
|
+
private readonly privateKey;
|
|
86
|
+
constructor(privateKeyHex: string);
|
|
87
|
+
toBech32(): string;
|
|
88
|
+
signTransactionRaw(data: Uint8Array): Uint8Array;
|
|
89
|
+
getPrivateKey(): Uint8Array;
|
|
76
90
|
}
|
|
77
91
|
|
|
78
92
|
declare class WarpFastsetExecutor implements AdapterWarpExecutor {
|
|
79
93
|
private readonly config;
|
|
80
|
-
private readonly
|
|
81
|
-
|
|
94
|
+
private readonly chain;
|
|
95
|
+
private readonly fastsetClient;
|
|
96
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
82
97
|
createTransaction(executable: WarpExecutable): Promise<any>;
|
|
83
|
-
createTransferTransaction(executable: WarpExecutable): Promise<
|
|
98
|
+
createTransferTransaction(executable: WarpExecutable): Promise<Transaction>;
|
|
84
99
|
createContractCallTransaction(executable: WarpExecutable): Promise<any>;
|
|
85
100
|
executeQuery(executable: WarpExecutable): Promise<any>;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
private
|
|
101
|
+
executeTransfer(executable: WarpExecutable): Promise<any>;
|
|
102
|
+
executeTransferWithKey(executable: WarpExecutable, privateKey: string): Promise<any>;
|
|
103
|
+
private signTransaction;
|
|
104
|
+
private serializeTransaction;
|
|
89
105
|
private executeFastsetQuery;
|
|
90
|
-
|
|
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;
|
|
106
|
+
private fromBase64;
|
|
120
107
|
}
|
|
121
108
|
|
|
122
|
-
declare class
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
109
|
+
declare class WarpFastsetWallet implements AdapterWarpWallet {
|
|
110
|
+
private config;
|
|
111
|
+
private chain;
|
|
112
|
+
private wallet;
|
|
113
|
+
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
114
|
+
private initializeWallet;
|
|
115
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
116
|
+
signMessage(message: string): Promise<string>;
|
|
117
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
118
|
+
create(mnemonic: string): WarpWalletDetails;
|
|
119
|
+
generate(): WarpWalletDetails;
|
|
120
|
+
getAddress(): string | null;
|
|
121
|
+
private serializeTransaction;
|
|
130
122
|
}
|
|
131
123
|
|
|
132
|
-
export {
|
|
124
|
+
export { FastsetClient, NativeTokenSet, Transaction, Wallet, WarpFastsetExecutor, WarpFastsetWallet, getFastsetAdapter };
|