@proofchain/sdk 2.1.0 → 2.1.1
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 +34 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +27 -0
- package/dist/index.mjs +27 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1051,6 +1051,25 @@ interface WalletStats {
|
|
|
1051
1051
|
by_type: Record<string, number>;
|
|
1052
1052
|
by_network: Record<string, number>;
|
|
1053
1053
|
}
|
|
1054
|
+
interface Transaction {
|
|
1055
|
+
hash: string;
|
|
1056
|
+
type: 'sent' | 'received';
|
|
1057
|
+
from: string;
|
|
1058
|
+
to: string;
|
|
1059
|
+
value: number | string;
|
|
1060
|
+
asset: string;
|
|
1061
|
+
category: string;
|
|
1062
|
+
block_num: string;
|
|
1063
|
+
timestamp: string;
|
|
1064
|
+
}
|
|
1065
|
+
interface TransactionHistory {
|
|
1066
|
+
address: string;
|
|
1067
|
+
network: string;
|
|
1068
|
+
total_sent: number;
|
|
1069
|
+
total_received: number;
|
|
1070
|
+
transactions: Transaction[];
|
|
1071
|
+
error?: string;
|
|
1072
|
+
}
|
|
1054
1073
|
interface ComprehensiveWalletInfo {
|
|
1055
1074
|
wallet_id: string;
|
|
1056
1075
|
address: string;
|
|
@@ -1284,6 +1303,21 @@ declare class WalletClient {
|
|
|
1284
1303
|
* Add an NFT to wallet tracking
|
|
1285
1304
|
*/
|
|
1286
1305
|
addNFT(walletId: string, nft: AddNFTRequest): Promise<NFT>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Get transaction history for a wallet.
|
|
1308
|
+
*
|
|
1309
|
+
* Returns both sent and received transactions including:
|
|
1310
|
+
* - Token transfers (ETH, ERC20)
|
|
1311
|
+
* - NFT transfers
|
|
1312
|
+
* - Contract interactions
|
|
1313
|
+
*
|
|
1314
|
+
* @param walletId - Wallet ID to query
|
|
1315
|
+
* @param options - Pagination options
|
|
1316
|
+
*/
|
|
1317
|
+
getTransactions(walletId: string, options?: {
|
|
1318
|
+
limit?: number;
|
|
1319
|
+
offset?: number;
|
|
1320
|
+
}): Promise<TransactionHistory>;
|
|
1287
1321
|
}
|
|
1288
1322
|
|
|
1289
1323
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1051,6 +1051,25 @@ interface WalletStats {
|
|
|
1051
1051
|
by_type: Record<string, number>;
|
|
1052
1052
|
by_network: Record<string, number>;
|
|
1053
1053
|
}
|
|
1054
|
+
interface Transaction {
|
|
1055
|
+
hash: string;
|
|
1056
|
+
type: 'sent' | 'received';
|
|
1057
|
+
from: string;
|
|
1058
|
+
to: string;
|
|
1059
|
+
value: number | string;
|
|
1060
|
+
asset: string;
|
|
1061
|
+
category: string;
|
|
1062
|
+
block_num: string;
|
|
1063
|
+
timestamp: string;
|
|
1064
|
+
}
|
|
1065
|
+
interface TransactionHistory {
|
|
1066
|
+
address: string;
|
|
1067
|
+
network: string;
|
|
1068
|
+
total_sent: number;
|
|
1069
|
+
total_received: number;
|
|
1070
|
+
transactions: Transaction[];
|
|
1071
|
+
error?: string;
|
|
1072
|
+
}
|
|
1054
1073
|
interface ComprehensiveWalletInfo {
|
|
1055
1074
|
wallet_id: string;
|
|
1056
1075
|
address: string;
|
|
@@ -1284,6 +1303,21 @@ declare class WalletClient {
|
|
|
1284
1303
|
* Add an NFT to wallet tracking
|
|
1285
1304
|
*/
|
|
1286
1305
|
addNFT(walletId: string, nft: AddNFTRequest): Promise<NFT>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Get transaction history for a wallet.
|
|
1308
|
+
*
|
|
1309
|
+
* Returns both sent and received transactions including:
|
|
1310
|
+
* - Token transfers (ETH, ERC20)
|
|
1311
|
+
* - NFT transfers
|
|
1312
|
+
* - Contract interactions
|
|
1313
|
+
*
|
|
1314
|
+
* @param walletId - Wallet ID to query
|
|
1315
|
+
* @param options - Pagination options
|
|
1316
|
+
*/
|
|
1317
|
+
getTransactions(walletId: string, options?: {
|
|
1318
|
+
limit?: number;
|
|
1319
|
+
offset?: number;
|
|
1320
|
+
}): Promise<TransactionHistory>;
|
|
1287
1321
|
}
|
|
1288
1322
|
|
|
1289
1323
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1007,6 +1007,33 @@ var WalletClient = class {
|
|
|
1007
1007
|
async addNFT(walletId, nft) {
|
|
1008
1008
|
return this.http.post(`/wallets/${walletId}/nfts`, nft);
|
|
1009
1009
|
}
|
|
1010
|
+
// ---------------------------------------------------------------------------
|
|
1011
|
+
// Transaction History
|
|
1012
|
+
// ---------------------------------------------------------------------------
|
|
1013
|
+
/**
|
|
1014
|
+
* Get transaction history for a wallet.
|
|
1015
|
+
*
|
|
1016
|
+
* Returns both sent and received transactions including:
|
|
1017
|
+
* - Token transfers (ETH, ERC20)
|
|
1018
|
+
* - NFT transfers
|
|
1019
|
+
* - Contract interactions
|
|
1020
|
+
*
|
|
1021
|
+
* @param walletId - Wallet ID to query
|
|
1022
|
+
* @param options - Pagination options
|
|
1023
|
+
*/
|
|
1024
|
+
async getTransactions(walletId, options = {}) {
|
|
1025
|
+
const params = new URLSearchParams();
|
|
1026
|
+
if (options.limit !== void 0) {
|
|
1027
|
+
params.set("limit", String(options.limit));
|
|
1028
|
+
}
|
|
1029
|
+
if (options.offset !== void 0) {
|
|
1030
|
+
params.set("offset", String(options.offset));
|
|
1031
|
+
}
|
|
1032
|
+
const query = params.toString();
|
|
1033
|
+
return this.http.get(
|
|
1034
|
+
`/wallets/${walletId}/transactions${query ? `?${query}` : ""}`
|
|
1035
|
+
);
|
|
1036
|
+
}
|
|
1010
1037
|
};
|
|
1011
1038
|
|
|
1012
1039
|
// src/users.ts
|
package/dist/index.mjs
CHANGED
|
@@ -955,6 +955,33 @@ var WalletClient = class {
|
|
|
955
955
|
async addNFT(walletId, nft) {
|
|
956
956
|
return this.http.post(`/wallets/${walletId}/nfts`, nft);
|
|
957
957
|
}
|
|
958
|
+
// ---------------------------------------------------------------------------
|
|
959
|
+
// Transaction History
|
|
960
|
+
// ---------------------------------------------------------------------------
|
|
961
|
+
/**
|
|
962
|
+
* Get transaction history for a wallet.
|
|
963
|
+
*
|
|
964
|
+
* Returns both sent and received transactions including:
|
|
965
|
+
* - Token transfers (ETH, ERC20)
|
|
966
|
+
* - NFT transfers
|
|
967
|
+
* - Contract interactions
|
|
968
|
+
*
|
|
969
|
+
* @param walletId - Wallet ID to query
|
|
970
|
+
* @param options - Pagination options
|
|
971
|
+
*/
|
|
972
|
+
async getTransactions(walletId, options = {}) {
|
|
973
|
+
const params = new URLSearchParams();
|
|
974
|
+
if (options.limit !== void 0) {
|
|
975
|
+
params.set("limit", String(options.limit));
|
|
976
|
+
}
|
|
977
|
+
if (options.offset !== void 0) {
|
|
978
|
+
params.set("offset", String(options.offset));
|
|
979
|
+
}
|
|
980
|
+
const query = params.toString();
|
|
981
|
+
return this.http.get(
|
|
982
|
+
`/wallets/${walletId}/transactions${query ? `?${query}` : ""}`
|
|
983
|
+
);
|
|
984
|
+
}
|
|
958
985
|
};
|
|
959
986
|
|
|
960
987
|
// src/users.ts
|
package/package.json
CHANGED