@zubari/sdk 0.5.3 → 0.5.5
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/{PayoutsProtocol-B5z8SEA-.d.ts → PayoutsProtocol-DAa-9A5C.d.ts} +8 -1
- package/dist/{PayoutsProtocol-CLiMFe54.d.mts → PayoutsProtocol-DKEQhwYH.d.mts} +8 -1
- package/dist/{TransactionService-Lr_WS6iR.d.mts → TransactionService-Cmw33HXX.d.mts} +21 -7
- package/dist/{TransactionService-BtWUjKt_.d.ts → TransactionService-DbNDRzXh.d.ts} +21 -7
- package/dist/{WalletManager-DQQwVkoa.d.ts → WalletManager-CeLlZo2y.d.ts} +23 -2
- package/dist/{WalletManager-Sbpx4E1-.d.mts → WalletManager-DIx8nENh.d.mts} +23 -2
- package/dist/{contracts-B842YprC.d.mts → contracts-JfZDzaV7.d.ts} +11 -2
- package/dist/{contracts-s_CDIruh.d.ts → contracts-pugJnFzl.d.mts} +11 -2
- package/dist/{index-CTyZlHKg.d.mts → index-c90msmwW.d.mts} +2 -1
- package/dist/{index-CTyZlHKg.d.ts → index-c90msmwW.d.ts} +2 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +202 -195
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +189 -182
- package/dist/index.mjs.map +1 -1
- package/dist/protocols/index.d.mts +2 -2
- package/dist/protocols/index.d.ts +2 -2
- package/dist/protocols/index.js +24 -11
- package/dist/protocols/index.js.map +1 -1
- package/dist/protocols/index.mjs +24 -11
- package/dist/protocols/index.mjs.map +1 -1
- package/dist/react/index.d.mts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +167 -154
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +154 -141
- package/dist/react/index.mjs.map +1 -1
- package/dist/services/index.d.mts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +145 -125
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs +132 -112
- package/dist/services/index.mjs.map +1 -1
- package/dist/storage/index.js +5 -2
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/index.mjs +5 -2
- package/dist/storage/index.mjs.map +1 -1
- package/dist/wallet/index.d.mts +3 -3
- package/dist/wallet/index.d.ts +3 -3
- package/dist/wallet/index.js +176 -184
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs +163 -171
- package/dist/wallet/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as CreateVoucherParams, L as LazyMintVoucher, g as NFTMetadata, T as TxResult, j as ListingParams, i as NFT, B as BuyParams, k as Listing, o as Tip, S as SubscriptionPlan, a as Subscription, E as EarningsBreakdown, t as EarningsResponse, P as PayoutHistoryResponse, u as BreakdownResponse, v as PlatformFeeResponse, w as ClaimResult, R as RevenueSplit } from './index-
|
|
1
|
+
import { h as CreateVoucherParams, L as LazyMintVoucher, g as NFTMetadata, T as TxResult, j as ListingParams, i as NFT, B as BuyParams, k as Listing, o as Tip, S as SubscriptionPlan, a as Subscription, E as EarningsBreakdown, t as EarningsResponse, P as PayoutHistoryResponse, u as BreakdownResponse, v as PlatformFeeResponse, w as ClaimResult, R as RevenueSplit } from './index-c90msmwW.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ZubariNFTProtocol - NFT creation and marketplace operations
|
|
@@ -422,7 +422,14 @@ declare class ZubariSubscriptionProtocol {
|
|
|
422
422
|
private readonly contractAddress;
|
|
423
423
|
private readonly chainId;
|
|
424
424
|
private readonly abi;
|
|
425
|
+
/** Cached ethers Interface instance (lazy-initialized) */
|
|
426
|
+
private _iface;
|
|
425
427
|
constructor(contractAddress: string, chainId: number);
|
|
428
|
+
/**
|
|
429
|
+
* Get or create the cached ethers Interface for encoding/decoding contract calls.
|
|
430
|
+
* The Interface is created once on first use and reused for all subsequent calls.
|
|
431
|
+
*/
|
|
432
|
+
private getInterface;
|
|
426
433
|
/**
|
|
427
434
|
* Get the contract ABI
|
|
428
435
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as CreateVoucherParams, L as LazyMintVoucher, g as NFTMetadata, T as TxResult, j as ListingParams, i as NFT, B as BuyParams, k as Listing, o as Tip, S as SubscriptionPlan, a as Subscription, E as EarningsBreakdown, t as EarningsResponse, P as PayoutHistoryResponse, u as BreakdownResponse, v as PlatformFeeResponse, w as ClaimResult, R as RevenueSplit } from './index-
|
|
1
|
+
import { h as CreateVoucherParams, L as LazyMintVoucher, g as NFTMetadata, T as TxResult, j as ListingParams, i as NFT, B as BuyParams, k as Listing, o as Tip, S as SubscriptionPlan, a as Subscription, E as EarningsBreakdown, t as EarningsResponse, P as PayoutHistoryResponse, u as BreakdownResponse, v as PlatformFeeResponse, w as ClaimResult, R as RevenueSplit } from './index-c90msmwW.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ZubariNFTProtocol - NFT creation and marketplace operations
|
|
@@ -422,7 +422,14 @@ declare class ZubariSubscriptionProtocol {
|
|
|
422
422
|
private readonly contractAddress;
|
|
423
423
|
private readonly chainId;
|
|
424
424
|
private readonly abi;
|
|
425
|
+
/** Cached ethers Interface instance (lazy-initialized) */
|
|
426
|
+
private _iface;
|
|
425
427
|
constructor(contractAddress: string, chainId: number);
|
|
428
|
+
/**
|
|
429
|
+
* Get or create the cached ethers Interface for encoding/decoding contract calls.
|
|
430
|
+
* The Interface is created once on first use and reused for all subsequent calls.
|
|
431
|
+
*/
|
|
432
|
+
private getInterface;
|
|
426
433
|
/**
|
|
427
434
|
* Get the contract ABI
|
|
428
435
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as SwapQuote, T as TxResult, x as TokenInfo, b as NetworkType } from './index-
|
|
1
|
+
import { p as SwapQuote, T as TxResult, x as TokenInfo, b as NetworkType } from './index-c90msmwW.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* SwapService - DEX integration via Uniswap V3
|
|
@@ -66,6 +66,8 @@ declare class SwapService {
|
|
|
66
66
|
interface WdkApiConfig {
|
|
67
67
|
baseUrl: string;
|
|
68
68
|
timeout?: number;
|
|
69
|
+
/** Optional auth token for authenticated API requests */
|
|
70
|
+
authToken?: string;
|
|
69
71
|
}
|
|
70
72
|
interface DeriveAddressResponse {
|
|
71
73
|
success: boolean;
|
|
@@ -148,6 +150,14 @@ interface TransactionStatusResponse {
|
|
|
148
150
|
declare class WdkApiClient {
|
|
149
151
|
private config;
|
|
150
152
|
constructor(config: WdkApiConfig);
|
|
153
|
+
/**
|
|
154
|
+
* Set or update the auth token for authenticated requests
|
|
155
|
+
*/
|
|
156
|
+
setAuthToken(token: string | undefined): void;
|
|
157
|
+
/**
|
|
158
|
+
* Build headers for API requests, including Authorization when available
|
|
159
|
+
*/
|
|
160
|
+
private getHeaders;
|
|
151
161
|
/**
|
|
152
162
|
* Generate a new BIP-39 seed phrase using Tether WDK
|
|
153
163
|
*/
|
|
@@ -182,7 +192,7 @@ declare class WdkApiClient {
|
|
|
182
192
|
/**
|
|
183
193
|
* Get or create the WDK API client instance
|
|
184
194
|
*/
|
|
185
|
-
declare function getWdkApiClient(baseUrl?: string): WdkApiClient;
|
|
195
|
+
declare function getWdkApiClient(baseUrl?: string, authToken?: string): WdkApiClient;
|
|
186
196
|
|
|
187
197
|
/**
|
|
188
198
|
* Browser-Compatible Address Derivation
|
|
@@ -197,6 +207,10 @@ declare function getWdkApiClient(baseUrl?: string): WdkApiClient;
|
|
|
197
207
|
* - TON: ed25519 derivation with TON address format
|
|
198
208
|
* - TRON: secp256k1 + base58check
|
|
199
209
|
* - Spark: Bitcoin-based with custom derivation
|
|
210
|
+
*
|
|
211
|
+
* NOTE: All @scure/* and @noble/* packages are loaded via dynamic import()
|
|
212
|
+
* to prevent CJS require() of ESM-only modules. This ensures compatibility
|
|
213
|
+
* with Next.js and other bundlers that may load the CJS build.
|
|
200
214
|
*/
|
|
201
215
|
|
|
202
216
|
interface ChainAddress$1 {
|
|
@@ -220,7 +234,7 @@ declare function deriveEthereumAddress(seed: string): string;
|
|
|
220
234
|
* Derive Bitcoin address from seed phrase (BIP-84 native SegWit)
|
|
221
235
|
* Uses @scure libraries for browser compatibility
|
|
222
236
|
*/
|
|
223
|
-
declare function deriveBitcoinAddress(seed: string, network?: 'mainnet' | 'testnet'): string
|
|
237
|
+
declare function deriveBitcoinAddress(seed: string, network?: 'mainnet' | 'testnet'): Promise<string>;
|
|
224
238
|
/**
|
|
225
239
|
* Derive Solana address from seed phrase using SLIP-0010 (ed25519)
|
|
226
240
|
*/
|
|
@@ -235,13 +249,13 @@ declare function deriveTonAddress(seed: string): Promise<string>;
|
|
|
235
249
|
* TRON uses secp256k1 like Ethereum but with base58check encoding
|
|
236
250
|
* Uses @scure/base for browser compatibility
|
|
237
251
|
*/
|
|
238
|
-
declare function deriveTronAddress(seed: string): string
|
|
252
|
+
declare function deriveTronAddress(seed: string): Promise<string>;
|
|
239
253
|
/**
|
|
240
254
|
* Derive Spark address from seed phrase
|
|
241
255
|
* Spark uses its own derivation path and bech32 format
|
|
242
256
|
* Uses @scure libraries for browser compatibility
|
|
243
257
|
*/
|
|
244
|
-
declare function deriveSparkAddress(seed: string, network?: 'mainnet' | 'testnet'): string
|
|
258
|
+
declare function deriveSparkAddress(seed: string, network?: 'mainnet' | 'testnet'): Promise<string>;
|
|
245
259
|
/**
|
|
246
260
|
* Derive addresses for all supported chains
|
|
247
261
|
*/
|
|
@@ -249,11 +263,11 @@ declare function deriveAllAddresses(seed: string, network?: 'mainnet' | 'testnet
|
|
|
249
263
|
/**
|
|
250
264
|
* Validate a BIP-39 seed phrase using @scure/bip39
|
|
251
265
|
*/
|
|
252
|
-
declare function isValidSeed(seed: string): boolean
|
|
266
|
+
declare function isValidSeed(seed: string): Promise<boolean>;
|
|
253
267
|
/**
|
|
254
268
|
* Generate a random BIP-39 seed phrase using @scure/bip39
|
|
255
269
|
*/
|
|
256
|
-
declare function generateSeedPhrase(): string
|
|
270
|
+
declare function generateSeedPhrase(): Promise<string>;
|
|
257
271
|
|
|
258
272
|
type BrowserAddressDerivation_BrowserMultiChainAddresses = BrowserMultiChainAddresses;
|
|
259
273
|
declare const BrowserAddressDerivation_deriveAllAddresses: typeof deriveAllAddresses;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as SwapQuote, T as TxResult, x as TokenInfo, b as NetworkType } from './index-
|
|
1
|
+
import { p as SwapQuote, T as TxResult, x as TokenInfo, b as NetworkType } from './index-c90msmwW.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* SwapService - DEX integration via Uniswap V3
|
|
@@ -66,6 +66,8 @@ declare class SwapService {
|
|
|
66
66
|
interface WdkApiConfig {
|
|
67
67
|
baseUrl: string;
|
|
68
68
|
timeout?: number;
|
|
69
|
+
/** Optional auth token for authenticated API requests */
|
|
70
|
+
authToken?: string;
|
|
69
71
|
}
|
|
70
72
|
interface DeriveAddressResponse {
|
|
71
73
|
success: boolean;
|
|
@@ -148,6 +150,14 @@ interface TransactionStatusResponse {
|
|
|
148
150
|
declare class WdkApiClient {
|
|
149
151
|
private config;
|
|
150
152
|
constructor(config: WdkApiConfig);
|
|
153
|
+
/**
|
|
154
|
+
* Set or update the auth token for authenticated requests
|
|
155
|
+
*/
|
|
156
|
+
setAuthToken(token: string | undefined): void;
|
|
157
|
+
/**
|
|
158
|
+
* Build headers for API requests, including Authorization when available
|
|
159
|
+
*/
|
|
160
|
+
private getHeaders;
|
|
151
161
|
/**
|
|
152
162
|
* Generate a new BIP-39 seed phrase using Tether WDK
|
|
153
163
|
*/
|
|
@@ -182,7 +192,7 @@ declare class WdkApiClient {
|
|
|
182
192
|
/**
|
|
183
193
|
* Get or create the WDK API client instance
|
|
184
194
|
*/
|
|
185
|
-
declare function getWdkApiClient(baseUrl?: string): WdkApiClient;
|
|
195
|
+
declare function getWdkApiClient(baseUrl?: string, authToken?: string): WdkApiClient;
|
|
186
196
|
|
|
187
197
|
/**
|
|
188
198
|
* Browser-Compatible Address Derivation
|
|
@@ -197,6 +207,10 @@ declare function getWdkApiClient(baseUrl?: string): WdkApiClient;
|
|
|
197
207
|
* - TON: ed25519 derivation with TON address format
|
|
198
208
|
* - TRON: secp256k1 + base58check
|
|
199
209
|
* - Spark: Bitcoin-based with custom derivation
|
|
210
|
+
*
|
|
211
|
+
* NOTE: All @scure/* and @noble/* packages are loaded via dynamic import()
|
|
212
|
+
* to prevent CJS require() of ESM-only modules. This ensures compatibility
|
|
213
|
+
* with Next.js and other bundlers that may load the CJS build.
|
|
200
214
|
*/
|
|
201
215
|
|
|
202
216
|
interface ChainAddress$1 {
|
|
@@ -220,7 +234,7 @@ declare function deriveEthereumAddress(seed: string): string;
|
|
|
220
234
|
* Derive Bitcoin address from seed phrase (BIP-84 native SegWit)
|
|
221
235
|
* Uses @scure libraries for browser compatibility
|
|
222
236
|
*/
|
|
223
|
-
declare function deriveBitcoinAddress(seed: string, network?: 'mainnet' | 'testnet'): string
|
|
237
|
+
declare function deriveBitcoinAddress(seed: string, network?: 'mainnet' | 'testnet'): Promise<string>;
|
|
224
238
|
/**
|
|
225
239
|
* Derive Solana address from seed phrase using SLIP-0010 (ed25519)
|
|
226
240
|
*/
|
|
@@ -235,13 +249,13 @@ declare function deriveTonAddress(seed: string): Promise<string>;
|
|
|
235
249
|
* TRON uses secp256k1 like Ethereum but with base58check encoding
|
|
236
250
|
* Uses @scure/base for browser compatibility
|
|
237
251
|
*/
|
|
238
|
-
declare function deriveTronAddress(seed: string): string
|
|
252
|
+
declare function deriveTronAddress(seed: string): Promise<string>;
|
|
239
253
|
/**
|
|
240
254
|
* Derive Spark address from seed phrase
|
|
241
255
|
* Spark uses its own derivation path and bech32 format
|
|
242
256
|
* Uses @scure libraries for browser compatibility
|
|
243
257
|
*/
|
|
244
|
-
declare function deriveSparkAddress(seed: string, network?: 'mainnet' | 'testnet'): string
|
|
258
|
+
declare function deriveSparkAddress(seed: string, network?: 'mainnet' | 'testnet'): Promise<string>;
|
|
245
259
|
/**
|
|
246
260
|
* Derive addresses for all supported chains
|
|
247
261
|
*/
|
|
@@ -249,11 +263,11 @@ declare function deriveAllAddresses(seed: string, network?: 'mainnet' | 'testnet
|
|
|
249
263
|
/**
|
|
250
264
|
* Validate a BIP-39 seed phrase using @scure/bip39
|
|
251
265
|
*/
|
|
252
|
-
declare function isValidSeed(seed: string): boolean
|
|
266
|
+
declare function isValidSeed(seed: string): Promise<boolean>;
|
|
253
267
|
/**
|
|
254
268
|
* Generate a random BIP-39 seed phrase using @scure/bip39
|
|
255
269
|
*/
|
|
256
|
-
declare function generateSeedPhrase(): string
|
|
270
|
+
declare function generateSeedPhrase(): Promise<string>;
|
|
257
271
|
|
|
258
272
|
type BrowserAddressDerivation_BrowserMultiChainAddresses = BrowserMultiChainAddresses;
|
|
259
273
|
declare const BrowserAddressDerivation_deriveAllAddresses: typeof deriveAllAddresses;
|
|
@@ -2,7 +2,7 @@ import * as abitype from 'abitype';
|
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { HDNodeWallet } from 'ethers';
|
|
4
4
|
import { S as SecureStorageAdapter } from './SecureStorage-jO783AhC.js';
|
|
5
|
-
import { b as NetworkType } from './index-
|
|
5
|
+
import { b as NetworkType } from './index-c90msmwW.js';
|
|
6
6
|
|
|
7
7
|
interface NetworkConfig {
|
|
8
8
|
name: string;
|
|
@@ -19,6 +19,16 @@ interface NetworkConfig {
|
|
|
19
19
|
}
|
|
20
20
|
declare const NETWORKS: Record<NetworkType, NetworkConfig>;
|
|
21
21
|
declare const TESTNET_NETWORKS: Partial<Record<NetworkType, Partial<NetworkConfig>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Canonical derivation paths for all supported chains.
|
|
24
|
+
* This is the single source of truth -- all other files must import from here.
|
|
25
|
+
*
|
|
26
|
+
* These are *base* paths (without the address index). Append `/0` (or `/n`)
|
|
27
|
+
* for the final derivation step where applicable.
|
|
28
|
+
*
|
|
29
|
+
* Bitcoin uses BIP-84 (native SegWit) rather than BIP-44 legacy.
|
|
30
|
+
* TON uses hardened indices per Tether WDK convention.
|
|
31
|
+
*/
|
|
22
32
|
declare const DERIVATION_PATHS: Record<NetworkType, string>;
|
|
23
33
|
declare function getNetworkConfig(network: NetworkType, isTestnet?: boolean): NetworkConfig;
|
|
24
34
|
|
|
@@ -148,6 +158,16 @@ declare class WalletManager {
|
|
|
148
158
|
}>;
|
|
149
159
|
/**
|
|
150
160
|
* Lock wallet (clear seed from memory)
|
|
161
|
+
*
|
|
162
|
+
* SECURITY NOTE: JavaScript strings are immutable and cannot be overwritten
|
|
163
|
+
* in place. Setting `this.currentSeed = null` removes the reference, but
|
|
164
|
+
* the original string may persist in memory until garbage collected.
|
|
165
|
+
* There is no reliable way to zero out a JS string.
|
|
166
|
+
*
|
|
167
|
+
* TODO: In a future version, store the seed as a Uint8Array instead of a
|
|
168
|
+
* string. Uint8Array contents can be explicitly zeroed (e.g.,
|
|
169
|
+
* `seedBytes.fill(0)`) before releasing the reference, which provides
|
|
170
|
+
* stronger guarantees that sensitive material is scrubbed from memory.
|
|
151
171
|
*/
|
|
152
172
|
lock(): void;
|
|
153
173
|
/**
|
|
@@ -6045,7 +6065,8 @@ declare class WalletManager {
|
|
|
6045
6065
|
*/
|
|
6046
6066
|
fetchBalanceForChain(chain: NetworkType): Promise<ChainBalance>;
|
|
6047
6067
|
/**
|
|
6048
|
-
* Fetch balances for all enabled chains
|
|
6068
|
+
* Fetch balances for all enabled chains in parallel.
|
|
6069
|
+
* Uses Promise.allSettled so that one chain failing does not block others.
|
|
6049
6070
|
*/
|
|
6050
6071
|
fetchAllBalances(): Promise<ChainBalance[]>;
|
|
6051
6072
|
/**
|
|
@@ -2,7 +2,7 @@ import * as abitype from 'abitype';
|
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { HDNodeWallet } from 'ethers';
|
|
4
4
|
import { S as SecureStorageAdapter } from './SecureStorage-jO783AhC.mjs';
|
|
5
|
-
import { b as NetworkType } from './index-
|
|
5
|
+
import { b as NetworkType } from './index-c90msmwW.mjs';
|
|
6
6
|
|
|
7
7
|
interface NetworkConfig {
|
|
8
8
|
name: string;
|
|
@@ -19,6 +19,16 @@ interface NetworkConfig {
|
|
|
19
19
|
}
|
|
20
20
|
declare const NETWORKS: Record<NetworkType, NetworkConfig>;
|
|
21
21
|
declare const TESTNET_NETWORKS: Partial<Record<NetworkType, Partial<NetworkConfig>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Canonical derivation paths for all supported chains.
|
|
24
|
+
* This is the single source of truth -- all other files must import from here.
|
|
25
|
+
*
|
|
26
|
+
* These are *base* paths (without the address index). Append `/0` (or `/n`)
|
|
27
|
+
* for the final derivation step where applicable.
|
|
28
|
+
*
|
|
29
|
+
* Bitcoin uses BIP-84 (native SegWit) rather than BIP-44 legacy.
|
|
30
|
+
* TON uses hardened indices per Tether WDK convention.
|
|
31
|
+
*/
|
|
22
32
|
declare const DERIVATION_PATHS: Record<NetworkType, string>;
|
|
23
33
|
declare function getNetworkConfig(network: NetworkType, isTestnet?: boolean): NetworkConfig;
|
|
24
34
|
|
|
@@ -148,6 +158,16 @@ declare class WalletManager {
|
|
|
148
158
|
}>;
|
|
149
159
|
/**
|
|
150
160
|
* Lock wallet (clear seed from memory)
|
|
161
|
+
*
|
|
162
|
+
* SECURITY NOTE: JavaScript strings are immutable and cannot be overwritten
|
|
163
|
+
* in place. Setting `this.currentSeed = null` removes the reference, but
|
|
164
|
+
* the original string may persist in memory until garbage collected.
|
|
165
|
+
* There is no reliable way to zero out a JS string.
|
|
166
|
+
*
|
|
167
|
+
* TODO: In a future version, store the seed as a Uint8Array instead of a
|
|
168
|
+
* string. Uint8Array contents can be explicitly zeroed (e.g.,
|
|
169
|
+
* `seedBytes.fill(0)`) before releasing the reference, which provides
|
|
170
|
+
* stronger guarantees that sensitive material is scrubbed from memory.
|
|
151
171
|
*/
|
|
152
172
|
lock(): void;
|
|
153
173
|
/**
|
|
@@ -6045,7 +6065,8 @@ declare class WalletManager {
|
|
|
6045
6065
|
*/
|
|
6046
6066
|
fetchBalanceForChain(chain: NetworkType): Promise<ChainBalance>;
|
|
6047
6067
|
/**
|
|
6048
|
-
* Fetch balances for all enabled chains
|
|
6068
|
+
* Fetch balances for all enabled chains in parallel.
|
|
6069
|
+
* Uses Promise.allSettled so that one chain failing does not block others.
|
|
6049
6070
|
*/
|
|
6050
6071
|
fetchAllBalances(): Promise<ChainBalance[]>;
|
|
6051
6072
|
/**
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { Z as ZubariWalletConfig, b as NetworkType, A as Account, c as NetworkBalance, e as SendParams, T as TxResult } from './index-
|
|
2
|
-
import './WalletManager-
|
|
1
|
+
import { Z as ZubariWalletConfig, b as NetworkType, A as Account, c as NetworkBalance, e as SendParams, T as TxResult } from './index-c90msmwW.js';
|
|
2
|
+
import './WalletManager-CeLlZo2y.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ZubariWallet - Multi-chain self-custodial wallet
|
|
6
6
|
*
|
|
7
7
|
* Core wallet class that manages accounts across multiple blockchain networks
|
|
8
8
|
* using Tether WDK as the underlying infrastructure layer via ZubariWdkService.
|
|
9
|
+
*
|
|
10
|
+
* TODO: The `seed` field is stored as a plaintext string for the entire
|
|
11
|
+
* lifetime of this object. This is an architectural security concern.
|
|
12
|
+
* In a future version, the seed should be encrypted at rest (e.g., using
|
|
13
|
+
* AES-256-GCM with a session key derived from the user's password) and
|
|
14
|
+
* only decrypted into a Uint8Array when needed for signing operations.
|
|
15
|
+
* The decrypted bytes should be zeroed immediately after use.
|
|
9
16
|
*/
|
|
10
17
|
declare class ZubariWallet {
|
|
11
18
|
private readonly seed;
|
|
@@ -13,6 +20,8 @@ declare class ZubariWallet {
|
|
|
13
20
|
private readonly accounts;
|
|
14
21
|
private readonly wdkService;
|
|
15
22
|
private initialized;
|
|
23
|
+
/** Mapping from NetworkType to SupportedChain (identity map, shared across methods) */
|
|
24
|
+
private static readonly CHAIN_MAP;
|
|
16
25
|
constructor(seed: string, config: ZubariWalletConfig);
|
|
17
26
|
/**
|
|
18
27
|
* Initialize the wallet by deriving accounts for all enabled networks
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { Z as ZubariWalletConfig, b as NetworkType, A as Account, c as NetworkBalance, e as SendParams, T as TxResult } from './index-
|
|
2
|
-
import './WalletManager-
|
|
1
|
+
import { Z as ZubariWalletConfig, b as NetworkType, A as Account, c as NetworkBalance, e as SendParams, T as TxResult } from './index-c90msmwW.mjs';
|
|
2
|
+
import './WalletManager-DIx8nENh.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ZubariWallet - Multi-chain self-custodial wallet
|
|
6
6
|
*
|
|
7
7
|
* Core wallet class that manages accounts across multiple blockchain networks
|
|
8
8
|
* using Tether WDK as the underlying infrastructure layer via ZubariWdkService.
|
|
9
|
+
*
|
|
10
|
+
* TODO: The `seed` field is stored as a plaintext string for the entire
|
|
11
|
+
* lifetime of this object. This is an architectural security concern.
|
|
12
|
+
* In a future version, the seed should be encrypted at rest (e.g., using
|
|
13
|
+
* AES-256-GCM with a session key derived from the user's password) and
|
|
14
|
+
* only decrypted into a Uint8Array when needed for signing operations.
|
|
15
|
+
* The decrypted bytes should be zeroed immediately after use.
|
|
9
16
|
*/
|
|
10
17
|
declare class ZubariWallet {
|
|
11
18
|
private readonly seed;
|
|
@@ -13,6 +20,8 @@ declare class ZubariWallet {
|
|
|
13
20
|
private readonly accounts;
|
|
14
21
|
private readonly wdkService;
|
|
15
22
|
private initialized;
|
|
23
|
+
/** Mapping from NetworkType to SupportedChain (identity map, shared across methods) */
|
|
24
|
+
private static readonly CHAIN_MAP;
|
|
16
25
|
constructor(seed: string, config: ZubariWalletConfig);
|
|
17
26
|
/**
|
|
18
27
|
* Initialize the wallet by deriving accounts for all enabled networks
|
|
@@ -66,7 +66,8 @@ interface NFTMetadata {
|
|
|
66
66
|
externalUrl?: string;
|
|
67
67
|
animationUrl?: string;
|
|
68
68
|
attributes?: NFTAttribute[];
|
|
69
|
-
|
|
69
|
+
/** Royalty in basis points (e.g. 500 = 5%). Defaults to 500 if omitted. */
|
|
70
|
+
royaltyBps?: number;
|
|
70
71
|
}
|
|
71
72
|
interface WatermarkingData {
|
|
72
73
|
contentHash: string;
|
|
@@ -66,7 +66,8 @@ interface NFTMetadata {
|
|
|
66
66
|
externalUrl?: string;
|
|
67
67
|
animationUrl?: string;
|
|
68
68
|
attributes?: NFTAttribute[];
|
|
69
|
-
|
|
69
|
+
/** Royalty in basis points (e.g. 500 = 5%). Defaults to 500 if omitted. */
|
|
70
|
+
royaltyBps?: number;
|
|
70
71
|
}
|
|
71
72
|
interface WatermarkingData {
|
|
72
73
|
contentHash: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-
|
|
2
|
-
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-
|
|
1
|
+
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-pugJnFzl.mjs';
|
|
2
|
+
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-DIx8nENh.mjs';
|
|
3
3
|
export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.mjs';
|
|
4
|
-
export { a as ZubariMarketProtocol, Z as ZubariNFTProtocol, d as ZubariPayoutsProtocol, c as ZubariSubscriptionProtocol, b as ZubariTipsProtocol } from './PayoutsProtocol-
|
|
5
|
-
export { A as Account, B as BuyParams, h as CreateVoucherParams, E as EarningsBreakdown, L as LazyMintVoucher, k as Listing, j as ListingParams, i as NFT, f as NFTAttribute, N as NFTCurrency, g as NFTMetadata, c as NetworkBalance, b as NetworkType, R as RevenueSplit, e as SendParams, a as Subscription, S as SubscriptionPlan, q as SwapParams, p as SwapQuote, o as Tip, l as TipData, m as TipResult, n as TipStats, d as TokenBalance, T as TxResult, W as WatermarkingData, s as ZubariError, r as ZubariErrorCode, Z as ZubariWalletConfig } from './index-
|
|
6
|
-
export { B as BrowserAddressDerivation, l as ChainAddress, m as ChainBalance, w as FeeEstimate, F as FeeRates, M as MultiChainAddresses, k as SupportedChain, S as SwapService, v as TransactionHistoryItem, t as TransactionParams, u as TransactionResult, q as TransactionService, x as TransactionServiceConfig, W as WdkApiClient, Z as ZubariWdkService, p as ZubariWdkServiceConfig, s as createTransactionService, i as createZubariWdkService, r as getTransactionService, g as getWdkApiClient, h as getZubariWdkService, j as isBrowser } from './TransactionService-
|
|
4
|
+
export { a as ZubariMarketProtocol, Z as ZubariNFTProtocol, d as ZubariPayoutsProtocol, c as ZubariSubscriptionProtocol, b as ZubariTipsProtocol } from './PayoutsProtocol-DKEQhwYH.mjs';
|
|
5
|
+
export { A as Account, B as BuyParams, h as CreateVoucherParams, E as EarningsBreakdown, L as LazyMintVoucher, k as Listing, j as ListingParams, i as NFT, f as NFTAttribute, N as NFTCurrency, g as NFTMetadata, c as NetworkBalance, b as NetworkType, R as RevenueSplit, e as SendParams, a as Subscription, S as SubscriptionPlan, q as SwapParams, p as SwapQuote, o as Tip, l as TipData, m as TipResult, n as TipStats, d as TokenBalance, T as TxResult, W as WatermarkingData, s as ZubariError, r as ZubariErrorCode, Z as ZubariWalletConfig } from './index-c90msmwW.mjs';
|
|
6
|
+
export { B as BrowserAddressDerivation, l as ChainAddress, m as ChainBalance, w as FeeEstimate, F as FeeRates, M as MultiChainAddresses, k as SupportedChain, S as SwapService, v as TransactionHistoryItem, t as TransactionParams, u as TransactionResult, q as TransactionService, x as TransactionServiceConfig, W as WdkApiClient, Z as ZubariWdkService, p as ZubariWdkServiceConfig, s as createTransactionService, i as createZubariWdkService, r as getTransactionService, g as getWdkApiClient, h as getZubariWdkService, j as isBrowser } from './TransactionService-Cmw33HXX.mjs';
|
|
7
7
|
import 'abitype';
|
|
8
8
|
import 'viem';
|
|
9
9
|
import 'ethers';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-
|
|
2
|
-
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-
|
|
1
|
+
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-JfZDzaV7.js';
|
|
2
|
+
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-CeLlZo2y.js';
|
|
3
3
|
export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.js';
|
|
4
|
-
export { a as ZubariMarketProtocol, Z as ZubariNFTProtocol, d as ZubariPayoutsProtocol, c as ZubariSubscriptionProtocol, b as ZubariTipsProtocol } from './PayoutsProtocol-
|
|
5
|
-
export { A as Account, B as BuyParams, h as CreateVoucherParams, E as EarningsBreakdown, L as LazyMintVoucher, k as Listing, j as ListingParams, i as NFT, f as NFTAttribute, N as NFTCurrency, g as NFTMetadata, c as NetworkBalance, b as NetworkType, R as RevenueSplit, e as SendParams, a as Subscription, S as SubscriptionPlan, q as SwapParams, p as SwapQuote, o as Tip, l as TipData, m as TipResult, n as TipStats, d as TokenBalance, T as TxResult, W as WatermarkingData, s as ZubariError, r as ZubariErrorCode, Z as ZubariWalletConfig } from './index-
|
|
6
|
-
export { B as BrowserAddressDerivation, l as ChainAddress, m as ChainBalance, w as FeeEstimate, F as FeeRates, M as MultiChainAddresses, k as SupportedChain, S as SwapService, v as TransactionHistoryItem, t as TransactionParams, u as TransactionResult, q as TransactionService, x as TransactionServiceConfig, W as WdkApiClient, Z as ZubariWdkService, p as ZubariWdkServiceConfig, s as createTransactionService, i as createZubariWdkService, r as getTransactionService, g as getWdkApiClient, h as getZubariWdkService, j as isBrowser } from './TransactionService-
|
|
4
|
+
export { a as ZubariMarketProtocol, Z as ZubariNFTProtocol, d as ZubariPayoutsProtocol, c as ZubariSubscriptionProtocol, b as ZubariTipsProtocol } from './PayoutsProtocol-DAa-9A5C.js';
|
|
5
|
+
export { A as Account, B as BuyParams, h as CreateVoucherParams, E as EarningsBreakdown, L as LazyMintVoucher, k as Listing, j as ListingParams, i as NFT, f as NFTAttribute, N as NFTCurrency, g as NFTMetadata, c as NetworkBalance, b as NetworkType, R as RevenueSplit, e as SendParams, a as Subscription, S as SubscriptionPlan, q as SwapParams, p as SwapQuote, o as Tip, l as TipData, m as TipResult, n as TipStats, d as TokenBalance, T as TxResult, W as WatermarkingData, s as ZubariError, r as ZubariErrorCode, Z as ZubariWalletConfig } from './index-c90msmwW.js';
|
|
6
|
+
export { B as BrowserAddressDerivation, l as ChainAddress, m as ChainBalance, w as FeeEstimate, F as FeeRates, M as MultiChainAddresses, k as SupportedChain, S as SwapService, v as TransactionHistoryItem, t as TransactionParams, u as TransactionResult, q as TransactionService, x as TransactionServiceConfig, W as WdkApiClient, Z as ZubariWdkService, p as ZubariWdkServiceConfig, s as createTransactionService, i as createZubariWdkService, r as getTransactionService, g as getWdkApiClient, h as getZubariWdkService, j as isBrowser } from './TransactionService-DbNDRzXh.js';
|
|
7
7
|
import 'abitype';
|
|
8
8
|
import 'viem';
|
|
9
9
|
import 'ethers';
|