starknet 10.6.8 → 10.7.0
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 +36 -36
- package/dist/index.global.js +15 -15
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -12927,7 +12927,7 @@ function fromWalletApiCall(call) {
|
|
|
12927
12927
|
}
|
|
12928
12928
|
function toWalletApiActions(actions) {
|
|
12929
12929
|
return actions.map(
|
|
12930
|
-
(action) => action.type === "
|
|
12930
|
+
(action) => action.type === "shadow_account_invoke" ? { ...action, calls: action.calls.map(toWalletApiCall) } : action
|
|
12931
12931
|
);
|
|
12932
12932
|
}
|
|
12933
12933
|
|
|
@@ -12946,7 +12946,7 @@ __export(connectV6_exports, {
|
|
|
12946
12946
|
strk20Balances: () => strk20Balances,
|
|
12947
12947
|
strk20InvokeTransaction: () => strk20InvokeTransaction,
|
|
12948
12948
|
strk20PrepareInvoke: () => strk20PrepareInvoke,
|
|
12949
|
-
|
|
12949
|
+
strk20ShadowAccountCommitment: () => strk20ShadowAccountCommitment,
|
|
12950
12950
|
subscribeWalletEvent: () => subscribeWalletEvent2,
|
|
12951
12951
|
supportedSpecs: () => supportedSpecs3,
|
|
12952
12952
|
supportedWalletApi: () => supportedWalletApi3,
|
|
@@ -13034,9 +13034,9 @@ function strk20InvokeTransaction(walletWSF, actions) {
|
|
|
13034
13034
|
params: { actions }
|
|
13035
13035
|
});
|
|
13036
13036
|
}
|
|
13037
|
-
function
|
|
13037
|
+
function strk20ShadowAccountCommitment(walletWSF, dapp_name, nonce) {
|
|
13038
13038
|
return walletWSF.features["starknet:walletApi"].request({
|
|
13039
|
-
type: "
|
|
13039
|
+
type: "wallet_strk20ShadowAccountCommitment",
|
|
13040
13040
|
params: { dapp_name, nonce }
|
|
13041
13041
|
});
|
|
13042
13042
|
}
|
|
@@ -13128,25 +13128,25 @@ var WalletAccountV6 = class _WalletAccountV6 extends WalletAccountV5 {
|
|
|
13128
13128
|
return strk20InvokeTransaction(this.v6Provider, toWalletApiActions(actions));
|
|
13129
13129
|
}
|
|
13130
13130
|
/**
|
|
13131
|
-
* Compute the commitment of a DAPP STRK20
|
|
13131
|
+
* Compute the commitment of a DAPP STRK20 shadow account. The commitment is computed
|
|
13132
13132
|
* locally by the wallet from the user private state ; no transaction is sent.
|
|
13133
13133
|
*
|
|
13134
|
-
* When `nonce` is given, the full commitment of this single
|
|
13134
|
+
* When `nonce` is given, the full commitment of this single shadow account is returned.
|
|
13135
13135
|
* When `nonce` is omitted, the partial (nonce independent) commitment is returned
|
|
13136
|
-
* instead : it is shared by every
|
|
13137
|
-
* be published once to let a DAPP recognize all the
|
|
13138
|
-
* learning any individual nonce.
|
|
13139
|
-
* @param {STRK20_DAPP_NAME} dappName - The DAPP that scopes the
|
|
13140
|
-
* @param {FELT} [nonce] - The
|
|
13141
|
-
* @returns {Promise<FELT>} The
|
|
13136
|
+
* instead : it is shared by every shadow account the user derives for this DAPP, so it
|
|
13137
|
+
* can be published once to let a DAPP recognize all the shadow accounts of a user
|
|
13138
|
+
* without learning any individual nonce.
|
|
13139
|
+
* @param {STRK20_DAPP_NAME} dappName - The DAPP that scopes the shadow account(s).
|
|
13140
|
+
* @param {FELT} [nonce] - The shadow account nonce ; each nonce selects a distinct shadow account for this user + DAPP. Omit it to get the partial commitment.
|
|
13141
|
+
* @returns {Promise<FELT>} The shadow account commitment.
|
|
13142
13142
|
* @example
|
|
13143
13143
|
* ```typescript
|
|
13144
|
-
* const commitment = await myWalletAccount.
|
|
13144
|
+
* const commitment = await myWalletAccount.strk20ShadowAccountCommitment('myDapp', '0x0');
|
|
13145
13145
|
* // commitment = '0x5f2e...'
|
|
13146
13146
|
* ```
|
|
13147
13147
|
*/
|
|
13148
|
-
|
|
13149
|
-
return
|
|
13148
|
+
strk20ShadowAccountCommitment(dappName, nonce) {
|
|
13149
|
+
return strk20ShadowAccountCommitment(this.v6Provider, dappName, nonce);
|
|
13150
13150
|
}
|
|
13151
13151
|
static async connect(provider, walletProvider, cairoVersion, paymaster, silentMode = false) {
|
|
13152
13152
|
const { accounts } = await standardConnect2(walletProvider, silentMode);
|