@rhinestone/sdk 1.0.0-alpha.23 → 1.0.0-alpha.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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Account, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Adapts a Viem/Wagmi WalletClient into an Account-like signer that the SDK can consume.
|
|
4
|
+
* Ensures address is set and routes sign methods through the provided client.
|
|
5
|
+
*/
|
|
6
|
+
export declare function walletClientToAccount(walletClient: WalletClient): Account;
|
|
7
|
+
//# sourceMappingURL=walletClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletClient.d.ts","sourceRoot":"","sources":["../../../accounts/walletClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAMP,YAAY,EACb,MAAM,MAAM,CAAA;AAEb;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CA4CzE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.walletClientToAccount = walletClientToAccount;
|
|
4
|
+
/**
|
|
5
|
+
* Adapts a Viem/Wagmi WalletClient into an Account-like signer that the SDK can consume.
|
|
6
|
+
* Ensures address is set and routes sign methods through the provided client.
|
|
7
|
+
*/
|
|
8
|
+
function walletClientToAccount(walletClient) {
|
|
9
|
+
const address = walletClient.account?.address;
|
|
10
|
+
if (!address) {
|
|
11
|
+
throw new Error('WalletClient is missing a default account. Ensure the wallet is connected and the client has an account.');
|
|
12
|
+
}
|
|
13
|
+
const account = {
|
|
14
|
+
address,
|
|
15
|
+
// EIP-191 message signing
|
|
16
|
+
async signMessage({ message, }) {
|
|
17
|
+
return walletClient.signMessage({ account: address, message });
|
|
18
|
+
},
|
|
19
|
+
// EIP-712 typed data signing
|
|
20
|
+
async signTypedData(parameters) {
|
|
21
|
+
const def = parameters;
|
|
22
|
+
return walletClient.signTypedData({
|
|
23
|
+
account: address,
|
|
24
|
+
...def,
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
// Raw transaction signing (not currently used by the SDK paths, but provided for completeness)
|
|
28
|
+
async signTransaction(transaction) {
|
|
29
|
+
return walletClient.signTransaction({
|
|
30
|
+
account: address,
|
|
31
|
+
...transaction,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
return account;
|
|
36
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Address, Chain, HashTypedDataParameters, Hex, SignableMessage, SignedAuthorizationList, TypedData } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
3
|
import { AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, SmartSessionsNotEnabledError } from './accounts';
|
|
4
|
+
import { walletClientToAccount } from './accounts/walletClient';
|
|
4
5
|
import { addOwner, addPasskeyOwner, changeMultiFactorThreshold, changePasskeyThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery } from './actions';
|
|
5
|
-
import type
|
|
6
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './execution';
|
|
6
|
+
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, type TransactionResult, UserOperationRequiredForSmartSessionsError } from './execution';
|
|
7
7
|
import { type SessionDetails } from './execution/smart-session';
|
|
8
8
|
import { type IntentData, type PreparedTransactionData, type SignedTransactionData } from './execution/utils';
|
|
9
9
|
import { AuthenticationRequiredError, getSupportedTokens, getTokenAddress, InsufficientBalanceError, type IntentCost, type IntentInput, IntentNotFoundError, type IntentOp, type IntentOpStatus, type IntentResult, type IntentRoute, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, type Portfolio, type SettlementSystem, type SignedIntentOp, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './orchestrator';
|
|
@@ -38,6 +38,6 @@ interface RhinestoneAccount {
|
|
|
38
38
|
* @returns account
|
|
39
39
|
*/
|
|
40
40
|
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
41
|
-
export { createRhinestoneAccount, addOwner, addPasskeyOwner, changeMultiFactorThreshold, changeThreshold, changePasskeyThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, Eip7702NotSupportedForAccountError, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getSupportedTokens, getTokenAddress, };
|
|
41
|
+
export { createRhinestoneAccount, walletClientToAccount, addOwner, addPasskeyOwner, changeMultiFactorThreshold, changeThreshold, changePasskeyThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, Eip7702NotSupportedForAccountError, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getSupportedTokens, getTokenAddress, };
|
|
42
42
|
export type { RhinestoneAccount, Session, Call, IntentData, PreparedTransactionData, SignedTransactionData, TransactionResult, IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, Portfolio, };
|
|
43
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACV,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAEZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,qCAAqC,EACrC,4BAA4B,EAE7B,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACd,MAAM,WAAW,CAAA;AAClB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACV,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAEZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,qCAAqC,EACrC,4BAA4B,EAE7B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EACL,QAAQ,EACR,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAA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B,uBAAuB,EACvB,qBAAqB,EAErB,kBAAkB,EAClB,eAAe,GAChB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.getTokenAddress = void 0;
|
|
3
|
+
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.isOrchestratorError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = exports.IntentFailedError = exports.isExecutionError = exports.Eip7702NotSupportedForAccountError = exports.SignMessageNotSupportedByAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountError = exports.isAccountError = exports.setUpRecovery = exports.setSubValidator = exports.removeSubValidator = exports.removePasskeyOwner = exports.removeOwner = exports.recoverPasskeyOwnership = exports.recoverEcdsaOwnership = exports.recover = exports.encodeSmartSessionSignature = exports.enablePasskeys = exports.enableMultiFactor = exports.enableEcdsa = exports.disablePasskeys = exports.disableMultiFactor = exports.disableEcdsa = exports.changePasskeyThreshold = exports.changeThreshold = exports.changeMultiFactorThreshold = exports.addPasskeyOwner = exports.addOwner = exports.walletClientToAccount = void 0;
|
|
4
|
+
exports.getTokenAddress = exports.getSupportedTokens = void 0;
|
|
5
5
|
exports.createRhinestoneAccount = createRhinestoneAccount;
|
|
6
6
|
const accounts_1 = require("./accounts");
|
|
7
7
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
|
|
@@ -13,6 +13,8 @@ Object.defineProperty(exports, "isAccountError", { enumerable: true, get: functi
|
|
|
13
13
|
Object.defineProperty(exports, "SigningNotSupportedForAccountError", { enumerable: true, get: function () { return accounts_1.SigningNotSupportedForAccountError; } });
|
|
14
14
|
Object.defineProperty(exports, "SignMessageNotSupportedByAccountError", { enumerable: true, get: function () { return accounts_1.SignMessageNotSupportedByAccountError; } });
|
|
15
15
|
Object.defineProperty(exports, "SmartSessionsNotEnabledError", { enumerable: true, get: function () { return accounts_1.SmartSessionsNotEnabledError; } });
|
|
16
|
+
const walletClient_1 = require("./accounts/walletClient");
|
|
17
|
+
Object.defineProperty(exports, "walletClientToAccount", { enumerable: true, get: function () { return walletClient_1.walletClientToAccount; } });
|
|
16
18
|
const actions_1 = require("./actions");
|
|
17
19
|
Object.defineProperty(exports, "addOwner", { enumerable: true, get: function () { return actions_1.addOwner; } });
|
|
18
20
|
Object.defineProperty(exports, "addPasskeyOwner", { enumerable: true, get: function () { return actions_1.addPasskeyOwner; } });
|