starknet 11.0.0 → 11.0.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +29 -3
- package/dist/index.global.js +15 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -7
package/dist/index.mjs
CHANGED
|
@@ -20068,10 +20068,10 @@ function supportedWalletApi3(walletWSF) {
|
|
|
20068
20068
|
function subscribeWalletEvent2(walletWSF, callback) {
|
|
20069
20069
|
return walletWSF.features["standard:events"].on("change", callback);
|
|
20070
20070
|
}
|
|
20071
|
-
function strk20Balances(walletWSF, tokens) {
|
|
20071
|
+
function strk20Balances(walletWSF, tokens, valid_until) {
|
|
20072
20072
|
return walletWSF.features["starknet:walletApi"].request({
|
|
20073
20073
|
type: "wallet_strk20Balances",
|
|
20074
|
-
params: { tokens }
|
|
20074
|
+
params: { tokens, valid_until }
|
|
20075
20075
|
});
|
|
20076
20076
|
}
|
|
20077
20077
|
function strk20PrepareInvoke(walletWSF, actions, simulate) {
|
|
@@ -20124,16 +20124,26 @@ var WalletAccountV6 = class _WalletAccountV6 extends WalletAccountV5 {
|
|
|
20124
20124
|
}
|
|
20125
20125
|
/**
|
|
20126
20126
|
* Get the private balances held by the user inside the STRK20 privacy pool.
|
|
20127
|
+
*
|
|
20128
|
+
* Reading a shielded balance requires the user approval, and this approval is time
|
|
20129
|
+
* limited : `validUntil` requests when it expires. When it is omitted, the wallet applies
|
|
20130
|
+
* its own default window.
|
|
20127
20131
|
* @param {Address[]} tokens - The tokens to get the private balance of. An empty array returns every shielded token.
|
|
20132
|
+
* @param {number} [validUntil] - Requested expiry of the balance read authorization, as a Unix timestamp in seconds. Omit it to let the wallet apply its default window.
|
|
20128
20133
|
* @returns {Promise<STRK20_BALANCE_ENTRY[]>} One entry per token.
|
|
20129
20134
|
* @example
|
|
20130
20135
|
* ```typescript
|
|
20131
20136
|
* const balances = await myWalletAccount.strk20Balances([strkAddress]);
|
|
20132
|
-
* // balances = [{ token: '0x4718...',
|
|
20137
|
+
* // balances = [{ token: '0x4718...', balance: '0x2386f26fc10000' }]
|
|
20138
|
+
*
|
|
20139
|
+
* // Asking for a 5 minutes authorization window :
|
|
20140
|
+
* const expiry = Math.floor(Date.now() / 1000) + 300;
|
|
20141
|
+
* const fresh = await myWalletAccount.strk20Balances([strkAddress], expiry);
|
|
20142
|
+
* // fresh = [{ token: '0x4718...', balance: '0x2386f26fc10000' }]
|
|
20133
20143
|
* ```
|
|
20134
20144
|
*/
|
|
20135
|
-
strk20Balances(tokens) {
|
|
20136
|
-
return strk20Balances(this.v6Provider, tokens);
|
|
20145
|
+
strk20Balances(tokens, validUntil) {
|
|
20146
|
+
return strk20Balances(this.v6Provider, tokens, validUntil);
|
|
20137
20147
|
}
|
|
20138
20148
|
/**
|
|
20139
20149
|
* Build the Starknet call and the SNIP-36 zero-knowledge proof of a STRK20 transaction,
|