@dimcool/sdk 0.1.21 → 0.1.24
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/README.md +4 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2978,6 +2978,10 @@ try {
|
|
|
2978
2978
|
}
|
|
2979
2979
|
```
|
|
2980
2980
|
|
|
2981
|
+
### Maintenance mode
|
|
2982
|
+
|
|
2983
|
+
When the platform is in maintenance, the API returns **503 Service Unavailable** for non-allowlisted endpoints. Clients should handle 503 by showing a user-facing message (e.g. “Maintenance — come back later”) rather than only retrying. The SDK’s retry utility treats 503 as retryable; for maintenance, prefer showing the message and optionally retrying with backoff. Check `error.statusCode === 503` (or response status) to detect maintenance and surface it to users.
|
|
2984
|
+
|
|
2981
2985
|
---
|
|
2982
2986
|
|
|
2983
2987
|
## Examples
|
package/dist/index.cjs
CHANGED
|
@@ -22216,6 +22216,17 @@ var Admin = class {
|
|
|
22216
22216
|
`/admin/escrow/sweeps?limit=${limit}`
|
|
22217
22217
|
);
|
|
22218
22218
|
}
|
|
22219
|
+
/**
|
|
22220
|
+
* Get QR code as a data URL for a wallet address.
|
|
22221
|
+
* Used in the admin dashboard for sweep/feeps/escrow wallets to scan and add funds.
|
|
22222
|
+
*/
|
|
22223
|
+
async getWalletQrDataUrl(address) {
|
|
22224
|
+
const params = new URLSearchParams({ address });
|
|
22225
|
+
const res = await this.http.get(
|
|
22226
|
+
`/admin/wallets/qr?${params.toString()}`
|
|
22227
|
+
);
|
|
22228
|
+
return res.qrDataUrl;
|
|
22229
|
+
}
|
|
22219
22230
|
async executeEscrowSweep(amountUsdcMinor, idempotencyKey) {
|
|
22220
22231
|
return this.http.post("/admin/escrow/sweep", {
|
|
22221
22232
|
amountUsdcMinor,
|
|
@@ -23116,6 +23127,14 @@ var Wallet = class {
|
|
|
23116
23127
|
this.logger.debug("Signing transaction");
|
|
23117
23128
|
return this.signer.signTransaction(transaction);
|
|
23118
23129
|
}
|
|
23130
|
+
/**
|
|
23131
|
+
* Get QR code as a data URL for the current user's wallet address.
|
|
23132
|
+
* Use as <img src={url} /> in the deposit / add-funds section.
|
|
23133
|
+
*/
|
|
23134
|
+
async getMyWalletQrDataUrl() {
|
|
23135
|
+
const res = await this.http.get("/wallets/me/qr");
|
|
23136
|
+
return res.qrDataUrl;
|
|
23137
|
+
}
|
|
23119
23138
|
/**
|
|
23120
23139
|
* Get SOL and USDC balances
|
|
23121
23140
|
*/
|
package/dist/index.d.cts
CHANGED
|
@@ -873,6 +873,11 @@ declare class Wallet {
|
|
|
873
873
|
* @returns The signed transaction
|
|
874
874
|
*/
|
|
875
875
|
signTransaction(transaction: Transaction): Promise<Transaction>;
|
|
876
|
+
/**
|
|
877
|
+
* Get QR code as a data URL for the current user's wallet address.
|
|
878
|
+
* Use as <img src={url} /> in the deposit / add-funds section.
|
|
879
|
+
*/
|
|
880
|
+
getMyWalletQrDataUrl(): Promise<string>;
|
|
876
881
|
/**
|
|
877
882
|
* Get SOL and USDC balances
|
|
878
883
|
*/
|
|
@@ -966,6 +971,11 @@ declare class Admin {
|
|
|
966
971
|
getAdminDailyStats(days?: number): Promise<AdminDailyStats>;
|
|
967
972
|
getEscrowSweepPreview(): Promise<EscrowSweepPreview>;
|
|
968
973
|
getEscrowSweeps(limit?: number): Promise<EscrowSweepRecord[]>;
|
|
974
|
+
/**
|
|
975
|
+
* Get QR code as a data URL for a wallet address.
|
|
976
|
+
* Used in the admin dashboard for sweep/feeps/escrow wallets to scan and add funds.
|
|
977
|
+
*/
|
|
978
|
+
getWalletQrDataUrl(address: string): Promise<string>;
|
|
969
979
|
executeEscrowSweep(amountUsdcMinor: number, idempotencyKey?: string): Promise<EscrowSweepRecord>;
|
|
970
980
|
banUser(userId: string, reason?: string): Promise<User>;
|
|
971
981
|
unbanUser(userId: string): Promise<User>;
|
package/dist/index.d.ts
CHANGED
|
@@ -873,6 +873,11 @@ declare class Wallet {
|
|
|
873
873
|
* @returns The signed transaction
|
|
874
874
|
*/
|
|
875
875
|
signTransaction(transaction: Transaction): Promise<Transaction>;
|
|
876
|
+
/**
|
|
877
|
+
* Get QR code as a data URL for the current user's wallet address.
|
|
878
|
+
* Use as <img src={url} /> in the deposit / add-funds section.
|
|
879
|
+
*/
|
|
880
|
+
getMyWalletQrDataUrl(): Promise<string>;
|
|
876
881
|
/**
|
|
877
882
|
* Get SOL and USDC balances
|
|
878
883
|
*/
|
|
@@ -966,6 +971,11 @@ declare class Admin {
|
|
|
966
971
|
getAdminDailyStats(days?: number): Promise<AdminDailyStats>;
|
|
967
972
|
getEscrowSweepPreview(): Promise<EscrowSweepPreview>;
|
|
968
973
|
getEscrowSweeps(limit?: number): Promise<EscrowSweepRecord[]>;
|
|
974
|
+
/**
|
|
975
|
+
* Get QR code as a data URL for a wallet address.
|
|
976
|
+
* Used in the admin dashboard for sweep/feeps/escrow wallets to scan and add funds.
|
|
977
|
+
*/
|
|
978
|
+
getWalletQrDataUrl(address: string): Promise<string>;
|
|
969
979
|
executeEscrowSweep(amountUsdcMinor: number, idempotencyKey?: string): Promise<EscrowSweepRecord>;
|
|
970
980
|
banUser(userId: string, reason?: string): Promise<User>;
|
|
971
981
|
unbanUser(userId: string): Promise<User>;
|
package/dist/index.js
CHANGED
|
@@ -22175,6 +22175,17 @@ var Admin = class {
|
|
|
22175
22175
|
`/admin/escrow/sweeps?limit=${limit}`
|
|
22176
22176
|
);
|
|
22177
22177
|
}
|
|
22178
|
+
/**
|
|
22179
|
+
* Get QR code as a data URL for a wallet address.
|
|
22180
|
+
* Used in the admin dashboard for sweep/feeps/escrow wallets to scan and add funds.
|
|
22181
|
+
*/
|
|
22182
|
+
async getWalletQrDataUrl(address) {
|
|
22183
|
+
const params = new URLSearchParams({ address });
|
|
22184
|
+
const res = await this.http.get(
|
|
22185
|
+
`/admin/wallets/qr?${params.toString()}`
|
|
22186
|
+
);
|
|
22187
|
+
return res.qrDataUrl;
|
|
22188
|
+
}
|
|
22178
22189
|
async executeEscrowSweep(amountUsdcMinor, idempotencyKey) {
|
|
22179
22190
|
return this.http.post("/admin/escrow/sweep", {
|
|
22180
22191
|
amountUsdcMinor,
|
|
@@ -23075,6 +23086,14 @@ var Wallet = class {
|
|
|
23075
23086
|
this.logger.debug("Signing transaction");
|
|
23076
23087
|
return this.signer.signTransaction(transaction);
|
|
23077
23088
|
}
|
|
23089
|
+
/**
|
|
23090
|
+
* Get QR code as a data URL for the current user's wallet address.
|
|
23091
|
+
* Use as <img src={url} /> in the deposit / add-funds section.
|
|
23092
|
+
*/
|
|
23093
|
+
async getMyWalletQrDataUrl() {
|
|
23094
|
+
const res = await this.http.get("/wallets/me/qr");
|
|
23095
|
+
return res.qrDataUrl;
|
|
23096
|
+
}
|
|
23078
23097
|
/**
|
|
23079
23098
|
* Get SOL and USDC balances
|
|
23080
23099
|
*/
|