@rhinestone/sdk 1.0.40 → 1.0.41-alpha.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/package.json +1 -1
- package/dist/src/accounts/error.d.ts +0 -114
- package/dist/src/accounts/error.d.ts.map +0 -1
- package/dist/src/accounts/error.js +0 -174
- package/dist/src/accounts/index.d.ts +0 -50
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/index.js +0 -669
- package/dist/src/accounts/index.test.d.ts +0 -2
- package/dist/src/accounts/index.test.d.ts.map +0 -1
- package/dist/src/accounts/index.test.js +0 -33
- package/dist/src/accounts/json-rpc/index.d.ts +0 -5
- package/dist/src/accounts/json-rpc/index.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/index.js +0 -20
- package/dist/src/accounts/json-rpc/index.test.d.ts +0 -2
- package/dist/src/accounts/json-rpc/index.test.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/index.test.js +0 -33
- package/dist/src/accounts/json-rpc/providers.d.ts +0 -5
- package/dist/src/accounts/json-rpc/providers.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/providers.js +0 -22
- package/dist/src/accounts/json-rpc/providers.test.d.ts +0 -2
- package/dist/src/accounts/json-rpc/providers.test.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/providers.test.js +0 -43
- package/dist/src/accounts/kernel.d.ts +0 -29
- package/dist/src/accounts/kernel.d.ts.map +0 -1
- package/dist/src/accounts/kernel.js +0 -297
- package/dist/src/accounts/kernel.test.d.ts +0 -2
- package/dist/src/accounts/kernel.test.d.ts.map +0 -1
- package/dist/src/accounts/kernel.test.js +0 -132
- package/dist/src/accounts/nexus.d.ts +0 -35
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/nexus.js +0 -471
- package/dist/src/accounts/nexus.test.d.ts +0 -2
- package/dist/src/accounts/nexus.test.d.ts.map +0 -1
- package/dist/src/accounts/nexus.test.js +0 -118
- package/dist/src/accounts/passport.d.ts +0 -12
- package/dist/src/accounts/passport.d.ts.map +0 -1
- package/dist/src/accounts/passport.js +0 -173
- package/dist/src/accounts/safe.d.ts +0 -35
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/safe.js +0 -365
- package/dist/src/accounts/safe.test.d.ts +0 -2
- package/dist/src/accounts/safe.test.d.ts.map +0 -1
- package/dist/src/accounts/safe.test.js +0 -118
- package/dist/src/accounts/signing/common.d.ts +0 -27
- package/dist/src/accounts/signing/common.d.ts.map +0 -1
- package/dist/src/accounts/signing/common.js +0 -183
- package/dist/src/accounts/signing/message.d.ts +0 -5
- package/dist/src/accounts/signing/message.d.ts.map +0 -1
- package/dist/src/accounts/signing/message.js +0 -47
- package/dist/src/accounts/signing/passkeys.d.ts +0 -36
- package/dist/src/accounts/signing/passkeys.d.ts.map +0 -1
- package/dist/src/accounts/signing/passkeys.js +0 -125
- package/dist/src/accounts/signing/passkeys.test.d.ts +0 -2
- package/dist/src/accounts/signing/passkeys.test.d.ts.map +0 -1
- package/dist/src/accounts/signing/passkeys.test.js +0 -88
- package/dist/src/accounts/signing/typedData.d.ts +0 -5
- package/dist/src/accounts/signing/typedData.d.ts.map +0 -1
- package/dist/src/accounts/signing/typedData.js +0 -35
- package/dist/src/accounts/startale.d.ts +0 -27
- package/dist/src/accounts/startale.d.ts.map +0 -1
- package/dist/src/accounts/startale.js +0 -116
- package/dist/src/accounts/startale.test.d.ts +0 -2
- package/dist/src/accounts/startale.test.d.ts.map +0 -1
- package/dist/src/accounts/startale.test.js +0 -92
- package/dist/src/accounts/utils.d.ts +0 -33
- package/dist/src/accounts/utils.d.ts.map +0 -1
- package/dist/src/accounts/utils.js +0 -201
- package/dist/src/accounts/utils.test.d.ts +0 -2
- package/dist/src/accounts/utils.test.d.ts.map +0 -1
- package/dist/src/accounts/utils.test.js +0 -49
- package/dist/src/accounts/walletClient.d.ts +0 -34
- package/dist/src/accounts/walletClient.d.ts.map +0 -1
- package/dist/src/accounts/walletClient.js +0 -121
- package/dist/src/actions/compact.d.ts +0 -13
- package/dist/src/actions/compact.d.ts.map +0 -1
- package/dist/src/actions/compact.js +0 -210
- package/dist/src/actions/deployment.d.ts +0 -19
- package/dist/src/actions/deployment.d.ts.map +0 -1
- package/dist/src/actions/deployment.js +0 -78
- package/dist/src/actions/ecdsa.d.ts +0 -35
- package/dist/src/actions/ecdsa.d.ts.map +0 -1
- package/dist/src/actions/ecdsa.js +0 -114
- package/dist/src/actions/ecdsa.test.d.ts +0 -2
- package/dist/src/actions/ecdsa.test.d.ts.map +0 -1
- package/dist/src/actions/ecdsa.test.js +0 -99
- package/dist/src/actions/index.d.ts +0 -17
- package/dist/src/actions/index.d.ts.map +0 -1
- package/dist/src/actions/index.js +0 -53
- package/dist/src/actions/mfa.d.ts +0 -37
- package/dist/src/actions/mfa.d.ts.map +0 -1
- package/dist/src/actions/mfa.js +0 -133
- package/dist/src/actions/passkeys.d.ts +0 -37
- package/dist/src/actions/passkeys.d.ts.map +0 -1
- package/dist/src/actions/passkeys.js +0 -129
- package/dist/src/actions/passkeys.test.d.ts +0 -2
- package/dist/src/actions/passkeys.test.d.ts.map +0 -1
- package/dist/src/actions/passkeys.test.js +0 -54
- package/dist/src/actions/recovery.d.ts +0 -33
- package/dist/src/actions/recovery.d.ts.map +0 -1
- package/dist/src/actions/recovery.js +0 -193
- package/dist/src/actions/recovery.test.d.ts +0 -2
- package/dist/src/actions/recovery.test.d.ts.map +0 -1
- package/dist/src/actions/recovery.test.js +0 -168
- package/dist/src/actions/smart-sessions.d.ts +0 -14
- package/dist/src/actions/smart-sessions.d.ts.map +0 -1
- package/dist/src/actions/smart-sessions.js +0 -16
- package/dist/src/errors/index.d.ts +0 -5
- package/dist/src/errors/index.d.ts.map +0 -1
- package/dist/src/errors/index.js +0 -53
- package/dist/src/execution/compact.d.ts +0 -151
- package/dist/src/execution/compact.d.ts.map +0 -1
- package/dist/src/execution/compact.js +0 -122
- package/dist/src/execution/error.d.ts +0 -61
- package/dist/src/execution/error.d.ts.map +0 -1
- package/dist/src/execution/error.js +0 -87
- package/dist/src/execution/index.d.ts +0 -41
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/index.js +0 -233
- package/dist/src/execution/permit2.d.ts +0 -148
- package/dist/src/execution/permit2.d.ts.map +0 -1
- package/dist/src/execution/permit2.js +0 -291
- package/dist/src/execution/singleChainOps.d.ts +0 -28
- package/dist/src/execution/singleChainOps.d.ts.map +0 -1
- package/dist/src/execution/singleChainOps.js +0 -32
- package/dist/src/execution/smart-session.d.ts +0 -13
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -178
- package/dist/src/execution/types.d.ts +0 -36
- package/dist/src/execution/types.d.ts.map +0 -1
- package/dist/src/execution/types.js +0 -2
- package/dist/src/execution/utils.d.ts +0 -83
- package/dist/src/execution/utils.d.ts.map +0 -1
- package/dist/src/execution/utils.js +0 -705
- package/dist/src/index.d.ts +0 -74
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -317
- package/dist/src/modules/abi/smart-sessions.d.ts +0 -104
- package/dist/src/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.js +0 -131
- package/dist/src/modules/chain-abstraction.d.ts +0 -5
- package/dist/src/modules/chain-abstraction.d.ts.map +0 -1
- package/dist/src/modules/chain-abstraction.js +0 -7
- package/dist/src/modules/common.d.ts +0 -30
- package/dist/src/modules/common.d.ts.map +0 -1
- package/dist/src/modules/common.js +0 -42
- package/dist/src/modules/index.d.ts +0 -10
- package/dist/src/modules/index.d.ts.map +0 -1
- package/dist/src/modules/index.js +0 -94
- package/dist/src/modules/index.test.d.ts +0 -2
- package/dist/src/modules/index.test.d.ts.map +0 -1
- package/dist/src/modules/index.test.js +0 -81
- package/dist/src/modules/legacy.d.ts +0 -10
- package/dist/src/modules/legacy.d.ts.map +0 -1
- package/dist/src/modules/legacy.js +0 -65
- package/dist/src/modules/read.d.ts +0 -9
- package/dist/src/modules/read.d.ts.map +0 -1
- package/dist/src/modules/read.js +0 -125
- package/dist/src/modules/validators/core.d.ts +0 -29
- package/dist/src/modules/validators/core.d.ts.map +0 -1
- package/dist/src/modules/validators/core.js +0 -278
- package/dist/src/modules/validators/core.test.d.ts +0 -2
- package/dist/src/modules/validators/core.test.d.ts.map +0 -1
- package/dist/src/modules/validators/core.test.js +0 -101
- package/dist/src/modules/validators/index.d.ts +0 -4
- package/dist/src/modules/validators/index.d.ts.map +0 -1
- package/dist/src/modules/validators/index.js +0 -15
- package/dist/src/modules/validators/smart-sessions.d.ts +0 -96
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -497
- package/dist/src/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/src/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.test.js +0 -219
- package/dist/src/orchestrator/client.d.ts +0 -27
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -354
- package/dist/src/orchestrator/consts.d.ts +0 -5
- package/dist/src/orchestrator/consts.d.ts.map +0 -1
- package/dist/src/orchestrator/consts.js +0 -9
- package/dist/src/orchestrator/error.d.ts +0 -232
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/error.js +0 -268
- package/dist/src/orchestrator/index.d.ts +0 -10
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -57
- package/dist/src/orchestrator/registry.d.ts +0 -22
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -121
- package/dist/src/orchestrator/registry.test.d.ts +0 -2
- package/dist/src/orchestrator/registry.test.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.test.js +0 -150
- package/dist/src/orchestrator/types.d.ts +0 -295
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/types.js +0 -17
- package/dist/src/orchestrator/utils.d.ts +0 -3
- package/dist/src/orchestrator/utils.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.js +0 -24
- package/dist/src/types.d.ts +0 -278
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/utils/index.d.ts +0 -26
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js +0 -63
- package/dist/test/consts.d.ts +0 -10
- package/dist/test/consts.d.ts.map +0 -1
- package/dist/test/consts.js +0 -22
- package/dist/test/utils/utils.d.ts +0 -5
- package/dist/test/utils/utils.d.ts.map +0 -1
- package/dist/test/utils/utils.js +0 -20
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.walletClientToAccount = walletClientToAccount;
|
|
4
|
-
exports.wrapParaAccount = wrapParaAccount;
|
|
5
|
-
const error_1 = require("./error");
|
|
6
|
-
/**
|
|
7
|
-
* Adapts a Viem/Wagmi WalletClient into an Account-like signer that the SDK can consume.
|
|
8
|
-
* Ensures address is set and routes sign methods through the provided client.
|
|
9
|
-
*/
|
|
10
|
-
function walletClientToAccount(walletClient) {
|
|
11
|
-
const address = walletClient.account?.address;
|
|
12
|
-
if (!address) {
|
|
13
|
-
throw new error_1.WalletClientNoConnectedAccountError();
|
|
14
|
-
}
|
|
15
|
-
const account = {
|
|
16
|
-
address,
|
|
17
|
-
// EIP-191 message signing
|
|
18
|
-
async signMessage({ message, }) {
|
|
19
|
-
return walletClient.signMessage({ account: address, message });
|
|
20
|
-
},
|
|
21
|
-
// EIP-712 typed data signing
|
|
22
|
-
async signTypedData(parameters) {
|
|
23
|
-
const def = parameters;
|
|
24
|
-
const signature = walletClient.signTypedData({
|
|
25
|
-
account: address,
|
|
26
|
-
...def,
|
|
27
|
-
});
|
|
28
|
-
return signature;
|
|
29
|
-
},
|
|
30
|
-
// Raw transaction signing (not currently used by the SDK paths, but provided for completeness)
|
|
31
|
-
async signTransaction(transaction) {
|
|
32
|
-
return walletClient.signTransaction({
|
|
33
|
-
account: address,
|
|
34
|
-
...transaction,
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
// Preserve reference to the wallet client
|
|
38
|
-
// This can be helpful to e.g. get the client's transport
|
|
39
|
-
client: walletClient,
|
|
40
|
-
};
|
|
41
|
-
return account;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Wraps a Para viem account with custom signing for Rhinestone compatibility.
|
|
45
|
-
*
|
|
46
|
-
* Para's MPC signatures use 0/1 v-byte recovery, but Rhinestone/Smart wallets
|
|
47
|
-
* expect 27/28 v-byte recovery. This wrapper adjusts Para signatures automatically.
|
|
48
|
-
*
|
|
49
|
-
* @param viemAccount - The Para viem account to wrap
|
|
50
|
-
* @param walletId - Optional wallet ID for Para signing operations
|
|
51
|
-
* @returns Account compatible with Rhinestone SDK
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* const paraAccount = // ... Para viem account
|
|
56
|
-
* const wrappedAccount = wrapParaAccount(paraAccount, wallet.id)
|
|
57
|
-
*
|
|
58
|
-
* const rhinestoneAccount = await rhinestone.createAccount({
|
|
59
|
-
* owners: {
|
|
60
|
-
* type: "ecdsa",
|
|
61
|
-
* accounts: [wrappedAccount],
|
|
62
|
-
* },
|
|
63
|
-
* })
|
|
64
|
-
*
|
|
65
|
-
* // Also works for EIP-7702 (signAuthorization uses original 0/1 v-byte)
|
|
66
|
-
* const authorization = await wrappedAccount.signAuthorization?.({ ... })
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
function wrapParaAccount(viemAccount, walletId) {
|
|
70
|
-
// Store the wallet ID for signing operations (for debugging purposes)
|
|
71
|
-
const effectiveWalletId = walletId || viemAccount.walletId || viemAccount._walletId;
|
|
72
|
-
// Store reference for potential debugging
|
|
73
|
-
if (effectiveWalletId) {
|
|
74
|
-
;
|
|
75
|
-
viemAccount._paraWalletId = effectiveWalletId;
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
...viemAccount,
|
|
79
|
-
// Override signMessage to adjust v-byte for smart wallet compatibility
|
|
80
|
-
signMessage: async ({ message }) => {
|
|
81
|
-
if (!viemAccount.signMessage) {
|
|
82
|
-
throw new Error('Account does not support signMessage');
|
|
83
|
-
}
|
|
84
|
-
const originalSignature = await viemAccount.signMessage({ message });
|
|
85
|
-
return adjustVByte(originalSignature);
|
|
86
|
-
},
|
|
87
|
-
// Override signTypedData to adjust v-byte for smart wallet compatibility
|
|
88
|
-
signTypedData: async (typedData) => {
|
|
89
|
-
if (!viemAccount.signTypedData) {
|
|
90
|
-
throw new Error('Account does not support signTypedData');
|
|
91
|
-
}
|
|
92
|
-
const originalSignature = await viemAccount.signTypedData(typedData);
|
|
93
|
-
return adjustVByte(originalSignature);
|
|
94
|
-
},
|
|
95
|
-
// Keep signAuthorization as is for EIP-7702
|
|
96
|
-
signAuthorization: viemAccount.signAuthorization
|
|
97
|
-
? viemAccount.signAuthorization.bind(viemAccount)
|
|
98
|
-
: undefined,
|
|
99
|
-
// Preserve reference to the wallet client
|
|
100
|
-
// This can be helpful to e.g. get the client's transport
|
|
101
|
-
client: viemAccount.client,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Adjusts the v-byte in a signature from Para's 0/1 format to Ethereum's 27/28 format.
|
|
106
|
-
* @internal
|
|
107
|
-
*/
|
|
108
|
-
function adjustVByte(signature) {
|
|
109
|
-
const V_OFFSET_FOR_ETHEREUM = 27;
|
|
110
|
-
const cleanSig = signature.startsWith('0x') ? signature.slice(2) : signature;
|
|
111
|
-
const r = cleanSig.slice(0, 64);
|
|
112
|
-
const s = cleanSig.slice(64, 128);
|
|
113
|
-
let v = parseInt(cleanSig.slice(128, 130), 16);
|
|
114
|
-
if (v < 27) {
|
|
115
|
-
v += V_OFFSET_FOR_ETHEREUM;
|
|
116
|
-
}
|
|
117
|
-
const adjustedSignature = `0x${r}${s}${v
|
|
118
|
-
.toString(16)
|
|
119
|
-
.padStart(2, '0')}`;
|
|
120
|
-
return adjustedSignature;
|
|
121
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Address } from 'viem';
|
|
2
|
-
import type { CalldataInput, LazyCallInput } from '../types';
|
|
3
|
-
declare function depositEther(value: bigint): LazyCallInput;
|
|
4
|
-
declare function enableEtherWithdrawal(): CalldataInput;
|
|
5
|
-
declare function disableEtherWithdrawal(): CalldataInput;
|
|
6
|
-
declare function withdrawEther(value: bigint): LazyCallInput;
|
|
7
|
-
declare function depositErc20(tokenAddress: Address, amount: bigint): LazyCallInput;
|
|
8
|
-
declare function enableErc20Withdrawal(tokenAddress: Address): CalldataInput;
|
|
9
|
-
declare function disableErc20Withdrawal(tokenAddress: Address): CalldataInput;
|
|
10
|
-
declare function withdrawErc20(tokenAddress: Address, amount: bigint): LazyCallInput;
|
|
11
|
-
declare function approveErc20(tokenAddress: Address, amount: bigint): CalldataInput;
|
|
12
|
-
export { depositEther, enableEtherWithdrawal, disableEtherWithdrawal, withdrawEther, depositErc20, enableErc20Withdrawal, disableErc20Withdrawal, withdrawErc20, approveErc20, };
|
|
13
|
-
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../actions/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAMb,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAkB5D,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CA2BlD;AAED,iBAAS,qBAAqB,IAAI,aAAa,CAG9C;AAED,iBAAS,sBAAsB,IAAI,aAAa,CAG/C;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAOnD;AAED,iBAAS,YAAY,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CA6B1E;AAED,iBAAS,qBAAqB,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,CAGnE;AAED,iBAAS,sBAAsB,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,CAGpE;AAED,iBAAS,aAAa,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAO3E;AAsED,iBAAS,YAAY,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAU1E;AAoCD,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,YAAY,GACb,CAAA"}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.depositEther = depositEther;
|
|
4
|
-
exports.enableEtherWithdrawal = enableEtherWithdrawal;
|
|
5
|
-
exports.disableEtherWithdrawal = disableEtherWithdrawal;
|
|
6
|
-
exports.withdrawEther = withdrawEther;
|
|
7
|
-
exports.depositErc20 = depositErc20;
|
|
8
|
-
exports.enableErc20Withdrawal = enableErc20Withdrawal;
|
|
9
|
-
exports.disableErc20Withdrawal = disableErc20Withdrawal;
|
|
10
|
-
exports.withdrawErc20 = withdrawErc20;
|
|
11
|
-
exports.approveErc20 = approveErc20;
|
|
12
|
-
const viem_1 = require("viem");
|
|
13
|
-
const compact_1 = require("../execution/compact");
|
|
14
|
-
const ALLOCATOR_ADDRESS = '0xd93ed1dd9f1f0b523e4d77233809dc2ee22928c6';
|
|
15
|
-
const DEFAULT_RESET_PERIOD = 6;
|
|
16
|
-
const DEFAULT_SCOPE = 0;
|
|
17
|
-
function depositEther(value) {
|
|
18
|
-
return {
|
|
19
|
-
async resolve({ accountAddress }) {
|
|
20
|
-
return {
|
|
21
|
-
to: compact_1.COMPACT_ADDRESS,
|
|
22
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
23
|
-
abi: [
|
|
24
|
-
{
|
|
25
|
-
type: 'function',
|
|
26
|
-
name: 'depositNative',
|
|
27
|
-
inputs: [
|
|
28
|
-
{ name: 'lockTag', type: 'bytes12', internalType: 'bytes12' },
|
|
29
|
-
{ name: 'recipient', type: 'address', internalType: 'address' },
|
|
30
|
-
],
|
|
31
|
-
outputs: [
|
|
32
|
-
{ name: 'id', type: 'uint256', internalType: 'uint256' },
|
|
33
|
-
],
|
|
34
|
-
stateMutability: 'payable',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
functionName: 'depositNative',
|
|
38
|
-
args: [lockTag(), accountAddress],
|
|
39
|
-
}),
|
|
40
|
-
value,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function enableEtherWithdrawal() {
|
|
46
|
-
const id = (0, viem_1.concat)([lockTag(), viem_1.zeroAddress]);
|
|
47
|
-
return enableForcedWithdrawal(BigInt(id));
|
|
48
|
-
}
|
|
49
|
-
function disableEtherWithdrawal() {
|
|
50
|
-
const id = (0, viem_1.concat)([lockTag(), viem_1.zeroAddress]);
|
|
51
|
-
return disableForcedWithdrawal(BigInt(id));
|
|
52
|
-
}
|
|
53
|
-
function withdrawEther(value) {
|
|
54
|
-
return {
|
|
55
|
-
async resolve({ accountAddress }) {
|
|
56
|
-
const id = (0, viem_1.concat)([lockTag(), viem_1.zeroAddress]);
|
|
57
|
-
return forcedWithdrawal(BigInt(id), accountAddress, value);
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function depositErc20(tokenAddress, amount) {
|
|
62
|
-
return {
|
|
63
|
-
async resolve({ accountAddress }) {
|
|
64
|
-
return {
|
|
65
|
-
to: compact_1.COMPACT_ADDRESS,
|
|
66
|
-
value: 0n,
|
|
67
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
68
|
-
abi: [
|
|
69
|
-
{
|
|
70
|
-
type: 'function',
|
|
71
|
-
name: 'depositERC20',
|
|
72
|
-
inputs: [
|
|
73
|
-
{ name: 'token', type: 'address', internalType: 'address' },
|
|
74
|
-
{ name: 'lockTag', type: 'bytes12', internalType: 'bytes12' },
|
|
75
|
-
{ name: 'amount', type: 'uint256', internalType: 'uint256' },
|
|
76
|
-
{ name: 'recipient', type: 'address', internalType: 'address' },
|
|
77
|
-
],
|
|
78
|
-
outputs: [
|
|
79
|
-
{ name: 'id', type: 'uint256', internalType: 'uint256' },
|
|
80
|
-
],
|
|
81
|
-
stateMutability: 'nonpayable',
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
functionName: 'depositERC20',
|
|
85
|
-
args: [tokenAddress, lockTag(), amount, accountAddress],
|
|
86
|
-
}),
|
|
87
|
-
};
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function enableErc20Withdrawal(tokenAddress) {
|
|
92
|
-
const id = (0, viem_1.concat)([lockTag(), tokenAddress]);
|
|
93
|
-
return enableForcedWithdrawal(BigInt(id));
|
|
94
|
-
}
|
|
95
|
-
function disableErc20Withdrawal(tokenAddress) {
|
|
96
|
-
const id = (0, viem_1.concat)([lockTag(), tokenAddress]);
|
|
97
|
-
return disableForcedWithdrawal(BigInt(id));
|
|
98
|
-
}
|
|
99
|
-
function withdrawErc20(tokenAddress, amount) {
|
|
100
|
-
return {
|
|
101
|
-
async resolve({ accountAddress }) {
|
|
102
|
-
const id = (0, viem_1.concat)([lockTag(), tokenAddress]);
|
|
103
|
-
return forcedWithdrawal(BigInt(id), accountAddress, amount);
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function enableForcedWithdrawal(id) {
|
|
108
|
-
return {
|
|
109
|
-
to: compact_1.COMPACT_ADDRESS,
|
|
110
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
111
|
-
abi: [
|
|
112
|
-
{
|
|
113
|
-
type: 'function',
|
|
114
|
-
name: 'enableForcedWithdrawal',
|
|
115
|
-
inputs: [{ name: 'id', type: 'uint256', internalType: 'uint256' }],
|
|
116
|
-
outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
|
|
117
|
-
stateMutability: 'nonpayable',
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
functionName: 'enableForcedWithdrawal',
|
|
121
|
-
args: [id],
|
|
122
|
-
}),
|
|
123
|
-
value: 0n,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function disableForcedWithdrawal(id) {
|
|
127
|
-
return {
|
|
128
|
-
to: compact_1.COMPACT_ADDRESS,
|
|
129
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
130
|
-
abi: [
|
|
131
|
-
{
|
|
132
|
-
type: 'function',
|
|
133
|
-
name: 'disableForcedWithdrawal',
|
|
134
|
-
inputs: [{ name: 'id', type: 'uint256', internalType: 'uint256' }],
|
|
135
|
-
outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
|
|
136
|
-
stateMutability: 'nonpayable',
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
functionName: 'disableForcedWithdrawal',
|
|
140
|
-
args: [id],
|
|
141
|
-
}),
|
|
142
|
-
value: 0n,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function forcedWithdrawal(id, recipient, amount) {
|
|
146
|
-
return {
|
|
147
|
-
to: compact_1.COMPACT_ADDRESS,
|
|
148
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
149
|
-
abi: [
|
|
150
|
-
{
|
|
151
|
-
type: 'function',
|
|
152
|
-
name: 'forcedWithdrawal',
|
|
153
|
-
inputs: [
|
|
154
|
-
{ name: 'id', type: 'uint256', internalType: 'uint256' },
|
|
155
|
-
{ name: 'recipient', type: 'address', internalType: 'address' },
|
|
156
|
-
{ name: 'amount', type: 'uint256', internalType: 'uint256' },
|
|
157
|
-
],
|
|
158
|
-
outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
|
|
159
|
-
stateMutability: 'nonpayable',
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
functionName: 'forcedWithdrawal',
|
|
163
|
-
args: [id, recipient, amount],
|
|
164
|
-
}),
|
|
165
|
-
value: 0n,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
function approveErc20(tokenAddress, amount) {
|
|
169
|
-
return {
|
|
170
|
-
to: tokenAddress,
|
|
171
|
-
value: 0n,
|
|
172
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
173
|
-
abi: viem_1.erc20Abi,
|
|
174
|
-
functionName: 'approve',
|
|
175
|
-
args: [compact_1.COMPACT_ADDRESS, amount],
|
|
176
|
-
}),
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function toCompactFlag(allocator) {
|
|
180
|
-
const addrBytes = Buffer.from(allocator.slice(2), 'hex');
|
|
181
|
-
let leadingZeroNibbles = 0;
|
|
182
|
-
for (const byte of addrBytes) {
|
|
183
|
-
if (byte === 0) {
|
|
184
|
-
leadingZeroNibbles += 2;
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
if (byte >> 4 === 0)
|
|
188
|
-
leadingZeroNibbles += 1;
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
if (leadingZeroNibbles >= 18)
|
|
193
|
-
return 15;
|
|
194
|
-
if (leadingZeroNibbles >= 4)
|
|
195
|
-
return leadingZeroNibbles - 3;
|
|
196
|
-
return 0;
|
|
197
|
-
}
|
|
198
|
-
function usingAllocatorId(allocator = ALLOCATOR_ADDRESS) {
|
|
199
|
-
const compactFlag = BigInt(toCompactFlag(allocator));
|
|
200
|
-
const last88Bits = BigInt(`0x${allocator.slice(-22)}`); // Extract last 88 bits (11 bytes * 2 hex chars per byte)
|
|
201
|
-
return (compactFlag << 88n) | last88Bits;
|
|
202
|
-
}
|
|
203
|
-
function lockTag() {
|
|
204
|
-
const allocatorId = usingAllocatorId(ALLOCATOR_ADDRESS);
|
|
205
|
-
const tagBig = (BigInt(DEFAULT_SCOPE) << 255n) |
|
|
206
|
-
(BigInt(DEFAULT_RESET_PERIOD) << 252n) |
|
|
207
|
-
(allocatorId << 160n);
|
|
208
|
-
const hex = tagBig.toString(16).slice(0, 24);
|
|
209
|
-
return `0x${hex}`;
|
|
210
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Address, Chain } from 'viem';
|
|
2
|
-
import type { AccountProviderConfig, RhinestoneSDKConfig } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Deploy smart accounts for multiple users from a backend using a sponsor wallet.
|
|
5
|
-
* The sponsor pays for gas, but users own and control their accounts.
|
|
6
|
-
*/
|
|
7
|
-
declare function deployAccountsForOwners(params: {
|
|
8
|
-
sponsorAccount: import('viem').Account;
|
|
9
|
-
ownerAddresses: Address[];
|
|
10
|
-
accountConfig: AccountProviderConfig;
|
|
11
|
-
chain: Chain;
|
|
12
|
-
sdkConfig?: RhinestoneSDKConfig;
|
|
13
|
-
sponsored?: boolean;
|
|
14
|
-
}): Promise<Array<{
|
|
15
|
-
owner: Address;
|
|
16
|
-
account: Address;
|
|
17
|
-
}>>;
|
|
18
|
-
export { deployAccountsForOwners };
|
|
19
|
-
//# sourceMappingURL=deployment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../../actions/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAO,MAAM,MAAM,CAAA;AAQ/C,OAAO,KAAK,EACV,qBAAqB,EAErB,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAyCjB;;;GAGG;AACH,iBAAe,uBAAuB,CAAC,MAAM,EAAE;IAC7C,cAAc,EAAE,OAAO,MAAM,EAAE,OAAO,CAAA;IACtC,cAAc,EAAE,OAAO,EAAE,CAAA;IACzB,aAAa,EAAE,qBAAqB,CAAA;IACpC,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,CAmDvD;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deployAccountsForOwners = deployAccountsForOwners;
|
|
4
|
-
const viem_1 = require("viem");
|
|
5
|
-
const accounts_1 = require("../accounts");
|
|
6
|
-
const utils_1 = require("../accounts/utils");
|
|
7
|
-
async function deployWithCustomFactory(sponsorConfig, chain, factoryArgs) {
|
|
8
|
-
const sponsorOwners = sponsorConfig.owners;
|
|
9
|
-
if (!sponsorOwners ||
|
|
10
|
-
sponsorOwners.type !== 'ecdsa' ||
|
|
11
|
-
sponsorOwners.accounts.length === 0) {
|
|
12
|
-
throw new Error('Sponsor must have an ECDSA account');
|
|
13
|
-
}
|
|
14
|
-
const sponsorAccount = sponsorOwners.accounts[0];
|
|
15
|
-
if (!('signTransaction' in sponsorAccount)) {
|
|
16
|
-
throw new Error('Sponsor account must be able to sign transactions');
|
|
17
|
-
}
|
|
18
|
-
const publicClient = (0, viem_1.createPublicClient)({
|
|
19
|
-
chain,
|
|
20
|
-
transport: (0, utils_1.createTransport)(chain, sponsorConfig.provider),
|
|
21
|
-
});
|
|
22
|
-
const walletClient = (0, viem_1.createWalletClient)({
|
|
23
|
-
account: sponsorAccount,
|
|
24
|
-
chain,
|
|
25
|
-
transport: (0, utils_1.createTransport)(chain, sponsorConfig.provider),
|
|
26
|
-
});
|
|
27
|
-
const hash = await walletClient.sendTransaction({
|
|
28
|
-
to: factoryArgs.factory,
|
|
29
|
-
data: factoryArgs.factoryData,
|
|
30
|
-
value: 0n,
|
|
31
|
-
});
|
|
32
|
-
await publicClient.waitForTransactionReceipt({ hash });
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Deploy smart accounts for multiple users from a backend using a sponsor wallet.
|
|
36
|
-
* The sponsor pays for gas, but users own and control their accounts.
|
|
37
|
-
*/
|
|
38
|
-
async function deployAccountsForOwners(params) {
|
|
39
|
-
const { sponsorAccount, ownerAddresses, accountConfig, chain, sdkConfig } = params;
|
|
40
|
-
const results = [];
|
|
41
|
-
for (const ownerAddress of ownerAddresses) {
|
|
42
|
-
const ownerAccountRef = {
|
|
43
|
-
address: ownerAddress,
|
|
44
|
-
type: 'json-rpc',
|
|
45
|
-
};
|
|
46
|
-
const userConfig = {
|
|
47
|
-
account: accountConfig,
|
|
48
|
-
owners: {
|
|
49
|
-
type: 'ecdsa',
|
|
50
|
-
accounts: [ownerAccountRef],
|
|
51
|
-
threshold: 1,
|
|
52
|
-
},
|
|
53
|
-
...sdkConfig,
|
|
54
|
-
};
|
|
55
|
-
const accountAddress = (0, accounts_1.getAddress)(userConfig);
|
|
56
|
-
const isAlreadyDeployed = await (0, accounts_1.isDeployed)(userConfig, chain);
|
|
57
|
-
if (isAlreadyDeployed) {
|
|
58
|
-
results.push({ owner: ownerAddress, account: accountAddress });
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
const sponsorConfig = {
|
|
62
|
-
account: accountConfig,
|
|
63
|
-
owners: {
|
|
64
|
-
type: 'ecdsa',
|
|
65
|
-
accounts: [sponsorAccount],
|
|
66
|
-
threshold: 1,
|
|
67
|
-
},
|
|
68
|
-
...sdkConfig,
|
|
69
|
-
};
|
|
70
|
-
const initCode = (0, accounts_1.getInitCode)(userConfig);
|
|
71
|
-
if (!initCode || !('factory' in initCode)) {
|
|
72
|
-
throw new Error('Failed to get init code for account deployment');
|
|
73
|
-
}
|
|
74
|
-
await deployWithCustomFactory(sponsorConfig, chain, initCode);
|
|
75
|
-
results.push({ owner: ownerAddress, account: accountAddress });
|
|
76
|
-
}
|
|
77
|
-
return results;
|
|
78
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type Address } from 'viem';
|
|
2
|
-
import type { CalldataInput, LazyCallInput } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Enable ECDSA authentication
|
|
5
|
-
* @param owners Owners to use for authentication
|
|
6
|
-
* @param threshold Threshold for the owners
|
|
7
|
-
* @returns Calls to enable ECDSA authentication
|
|
8
|
-
*/
|
|
9
|
-
declare function enable(owners: Address[], threshold?: number): LazyCallInput;
|
|
10
|
-
/**
|
|
11
|
-
* Disable ECDSA authentication
|
|
12
|
-
* @returns Calls to disable ECDSA authentication
|
|
13
|
-
*/
|
|
14
|
-
declare function disable(): LazyCallInput;
|
|
15
|
-
/**
|
|
16
|
-
* Add an ECDSA owner
|
|
17
|
-
* @param owner Owner address
|
|
18
|
-
* @returns Call to add the owner
|
|
19
|
-
*/
|
|
20
|
-
declare function addOwner(owner: Address): CalldataInput;
|
|
21
|
-
/**
|
|
22
|
-
* Remove an ECDSA owner
|
|
23
|
-
* @param prevOwner Previous owner address
|
|
24
|
-
* @param ownerToRemove Owner to remove
|
|
25
|
-
* @returns Call to remove the owner
|
|
26
|
-
*/
|
|
27
|
-
declare function removeOwner(prevOwner: Address, ownerToRemove: Address): CalldataInput;
|
|
28
|
-
/**
|
|
29
|
-
* Change an account's signer threshold (ECDSA)
|
|
30
|
-
* @param newThreshold New threshold
|
|
31
|
-
* @returns Call to change the threshold
|
|
32
|
-
*/
|
|
33
|
-
declare function changeThreshold(newThreshold: number): CalldataInput;
|
|
34
|
-
export { addOwner, removeOwner, changeThreshold, disable, enable };
|
|
35
|
-
//# sourceMappingURL=ecdsa.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../../actions/ecdsa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,MAAM,CAAA;AASvD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE5D;;;;;GAKG;AACH,iBAAS,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,SAAS,SAAI,GAAG,aAAa,CAO/D;AAED;;;GAGG;AACH,iBAAS,OAAO,IAAI,aAAa,CAOhC;AAED;;;;GAIG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAkB/C;AAED;;;;;GAKG;AACH,iBAAS,WAAW,CAClB,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,OAAO,GACrB,aAAa,CAqBf;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAoB5D;AAED,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addOwner = addOwner;
|
|
4
|
-
exports.removeOwner = removeOwner;
|
|
5
|
-
exports.changeThreshold = changeThreshold;
|
|
6
|
-
exports.disable = disable;
|
|
7
|
-
exports.enable = enable;
|
|
8
|
-
const viem_1 = require("viem");
|
|
9
|
-
const accounts_1 = require("../accounts");
|
|
10
|
-
const core_1 = require("../modules/validators/core");
|
|
11
|
-
/**
|
|
12
|
-
* Enable ECDSA authentication
|
|
13
|
-
* @param owners Owners to use for authentication
|
|
14
|
-
* @param threshold Threshold for the owners
|
|
15
|
-
* @returns Calls to enable ECDSA authentication
|
|
16
|
-
*/
|
|
17
|
-
function enable(owners, threshold = 1) {
|
|
18
|
-
const module = (0, core_1.getOwnableValidator)(threshold, owners);
|
|
19
|
-
return {
|
|
20
|
-
async resolve({ config }) {
|
|
21
|
-
return (0, accounts_1.getModuleInstallationCalls)(config, module);
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Disable ECDSA authentication
|
|
27
|
-
* @returns Calls to disable ECDSA authentication
|
|
28
|
-
*/
|
|
29
|
-
function disable() {
|
|
30
|
-
const module = (0, core_1.getOwnableValidator)(1, []);
|
|
31
|
-
return {
|
|
32
|
-
async resolve({ config }) {
|
|
33
|
-
return (0, accounts_1.getModuleUninstallationCalls)(config, module);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Add an ECDSA owner
|
|
39
|
-
* @param owner Owner address
|
|
40
|
-
* @returns Call to add the owner
|
|
41
|
-
*/
|
|
42
|
-
function addOwner(owner) {
|
|
43
|
-
return {
|
|
44
|
-
to: core_1.OWNABLE_VALIDATOR_ADDRESS,
|
|
45
|
-
value: 0n,
|
|
46
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
47
|
-
abi: [
|
|
48
|
-
{
|
|
49
|
-
inputs: [{ internalType: 'address', name: 'owner', type: 'address' }],
|
|
50
|
-
name: 'addOwner',
|
|
51
|
-
outputs: [],
|
|
52
|
-
stateMutability: 'nonpayable',
|
|
53
|
-
type: 'function',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
functionName: 'addOwner',
|
|
57
|
-
args: [owner],
|
|
58
|
-
}),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Remove an ECDSA owner
|
|
63
|
-
* @param prevOwner Previous owner address
|
|
64
|
-
* @param ownerToRemove Owner to remove
|
|
65
|
-
* @returns Call to remove the owner
|
|
66
|
-
*/
|
|
67
|
-
function removeOwner(prevOwner, ownerToRemove) {
|
|
68
|
-
return {
|
|
69
|
-
to: core_1.OWNABLE_VALIDATOR_ADDRESS,
|
|
70
|
-
value: 0n,
|
|
71
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
72
|
-
abi: [
|
|
73
|
-
{
|
|
74
|
-
inputs: [
|
|
75
|
-
{ internalType: 'address', name: 'prevOwner', type: 'address' },
|
|
76
|
-
{ internalType: 'address', name: 'owner', type: 'address' },
|
|
77
|
-
],
|
|
78
|
-
name: 'removeOwner',
|
|
79
|
-
outputs: [],
|
|
80
|
-
stateMutability: 'nonpayable',
|
|
81
|
-
type: 'function',
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
functionName: 'removeOwner',
|
|
85
|
-
args: [prevOwner, ownerToRemove],
|
|
86
|
-
}),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Change an account's signer threshold (ECDSA)
|
|
91
|
-
* @param newThreshold New threshold
|
|
92
|
-
* @returns Call to change the threshold
|
|
93
|
-
*/
|
|
94
|
-
function changeThreshold(newThreshold) {
|
|
95
|
-
return {
|
|
96
|
-
to: core_1.OWNABLE_VALIDATOR_ADDRESS,
|
|
97
|
-
value: 0n,
|
|
98
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
99
|
-
abi: [
|
|
100
|
-
{
|
|
101
|
-
inputs: [
|
|
102
|
-
{ internalType: 'uint256', name: '_threshold', type: 'uint256' },
|
|
103
|
-
],
|
|
104
|
-
name: 'setThreshold',
|
|
105
|
-
outputs: [],
|
|
106
|
-
stateMutability: 'nonpayable',
|
|
107
|
-
type: 'function',
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
functionName: 'setThreshold',
|
|
111
|
-
args: [BigInt(newThreshold)],
|
|
112
|
-
}),
|
|
113
|
-
};
|
|
114
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ecdsa.test.d.ts","sourceRoot":"","sources":["../../../actions/ecdsa.test.ts"],"names":[],"mappings":""}
|