@rhinestone/sdk 0.2.0 → 0.3.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/README.md +7 -19
- package/dist/accounts/index.d.ts +15535 -0
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/accounts/index.js +242 -0
- package/dist/accounts/nexus.d.ts +23281 -0
- package/dist/accounts/nexus.d.ts.map +1 -0
- package/dist/accounts/nexus.js +230 -0
- package/dist/accounts/safe.d.ts +15 -0
- package/dist/accounts/safe.d.ts.map +1 -0
- package/dist/{services/account → accounts}/safe.js +36 -37
- package/dist/accounts/utils.d.ts +27 -0
- package/dist/accounts/utils.d.ts.map +1 -0
- package/dist/accounts/utils.js +155 -0
- package/dist/examples/abi/weth.d.ts +214 -0
- package/dist/examples/abi/weth.d.ts.map +1 -0
- package/dist/examples/abi/weth.js +279 -0
- package/dist/examples/cross-chain-ss.d.ts +1 -0
- package/dist/examples/cross-chain-ss.d.ts.map +1 -0
- package/dist/{example.js → examples/cross-chain-ss.js} +70 -44
- package/dist/examples/omni-account.d.ts +1 -0
- package/dist/examples/omni-account.d.ts.map +1 -0
- package/dist/examples/omni-account.js +169 -0
- package/dist/examples/smart-sessions.d.ts +1 -0
- package/dist/examples/smart-sessions.d.ts.map +1 -0
- package/dist/examples/smart-sessions.js +216 -0
- package/dist/execution/index.d.ts +31 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +222 -0
- package/dist/execution/smart-session.d.ts +14 -0
- package/dist/execution/smart-session.d.ts.map +1 -0
- package/dist/execution/smart-session.js +83 -0
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/modules/abi/smart-sessions.d.ts +42 -0
- package/dist/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/modules/abi/smart-sessions.js +128 -0
- package/dist/modules/common.d.ts +16 -0
- package/dist/modules/common.d.ts.map +1 -0
- package/dist/modules/common.js +5 -0
- package/dist/modules/index.d.ts +33 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +129 -0
- package/dist/modules/omni-account.d.ts +9 -0
- package/dist/modules/omni-account.d.ts.map +1 -0
- package/dist/modules/omni-account.js +7 -0
- package/dist/modules/validators.d.ts +31 -0
- package/dist/modules/validators.d.ts.map +1 -0
- package/dist/modules/validators.js +518 -0
- package/dist/{services/orchestrator → orchestrator}/client.d.ts +2 -5
- package/dist/orchestrator/client.d.ts.map +1 -0
- package/dist/orchestrator/consts.d.ts +4 -0
- package/dist/orchestrator/consts.d.ts.map +1 -0
- package/dist/orchestrator/consts.js +3 -0
- package/dist/orchestrator/error.d.ts.map +1 -0
- package/dist/orchestrator/index.d.ts +9 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +10 -0
- package/dist/orchestrator/registry.d.ts +5 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/orchestrator/registry.js +187 -0
- package/dist/{services/orchestrator → orchestrator}/types.d.ts +39 -23
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +7 -0
- package/dist/orchestrator/utils.d.ts +11 -0
- package/dist/orchestrator/utils.d.ts.map +1 -0
- package/dist/{services/orchestrator → orchestrator}/utils.js +20 -6
- package/dist/types.d.ts +70 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/example.d.ts +0 -1
- package/dist/example.d.ts.map +0 -1
- package/dist/services/account/index.d.ts +0 -13
- package/dist/services/account/index.d.ts.map +0 -1
- package/dist/services/account/index.js +0 -54
- package/dist/services/account/nexus.d.ts +0 -9
- package/dist/services/account/nexus.d.ts.map +0 -1
- package/dist/services/account/nexus.js +0 -67
- package/dist/services/account/safe.d.ts +0 -9
- package/dist/services/account/safe.d.ts.map +0 -1
- package/dist/services/modules.d.ts +0 -32
- package/dist/services/modules.d.ts.map +0 -1
- package/dist/services/modules.js +0 -166
- package/dist/services/orchestrator/client.d.ts.map +0 -1
- package/dist/services/orchestrator/consts.d.ts +0 -6
- package/dist/services/orchestrator/consts.d.ts.map +0 -1
- package/dist/services/orchestrator/consts.js +0 -4
- package/dist/services/orchestrator/error.d.ts.map +0 -1
- package/dist/services/orchestrator/index.d.ts +0 -8
- package/dist/services/orchestrator/index.d.ts.map +0 -1
- package/dist/services/orchestrator/index.js +0 -9
- package/dist/services/orchestrator/types.d.ts.map +0 -1
- package/dist/services/orchestrator/types.js +0 -6
- package/dist/services/orchestrator/utils.d.ts +0 -7
- package/dist/services/orchestrator/utils.d.ts.map +0 -1
- package/dist/services/transaction.d.ts +0 -6
- package/dist/services/transaction.d.ts.map +0 -1
- package/dist/services/transaction.js +0 -93
- /package/dist/{services/orchestrator → orchestrator}/client.js +0 -0
- /package/dist/{services/orchestrator → orchestrator}/error.d.ts +0 -0
- /package/dist/{services/orchestrator → orchestrator}/error.js +0 -0
package/README.md
CHANGED
|
@@ -22,13 +22,11 @@ yarn add viem @rhinestone/sdk
|
|
|
22
22
|
bun install viem @rhinestone/sdk
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## Quickstart
|
|
26
26
|
|
|
27
|
-
You'll need a Rhinestone API key, as well as an existing account with some testnet
|
|
27
|
+
You'll need a Rhinestone API key, as well as an existing account with some testnet ETH on the source chain.
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Creating a Wallet
|
|
29
|
+
### Creating a Wallet
|
|
32
30
|
|
|
33
31
|
Let's create a single-owner Safe account:
|
|
34
32
|
|
|
@@ -79,7 +77,7 @@ const account = privateKeyToAccount(privateKey)
|
|
|
79
77
|
|
|
80
78
|
const rhinestoneAccount = await createRhinestoneAccount({
|
|
81
79
|
account: {
|
|
82
|
-
type: '
|
|
80
|
+
type: 'nexus',
|
|
83
81
|
},
|
|
84
82
|
owners: {
|
|
85
83
|
type: 'ecdsa',
|
|
@@ -92,9 +90,9 @@ const address = await rhinestoneAccount.getAddress(sourceChain)
|
|
|
92
90
|
console.log(address)
|
|
93
91
|
```
|
|
94
92
|
|
|
95
|
-
|
|
93
|
+
### Funding the Account
|
|
96
94
|
|
|
97
|
-
We will send some
|
|
95
|
+
We will send some ETH from the funding account to the created Safe account. The Orchestrator will use some of that ETH to deploy the account on the target chain, as well as convert it to USDC for a transfer transaction.
|
|
98
96
|
|
|
99
97
|
```ts
|
|
100
98
|
const usdc = getTokenAddress(sourceChain)
|
|
@@ -107,16 +105,6 @@ const txHash = await fundingClient.sendTransaction({
|
|
|
107
105
|
})
|
|
108
106
|
await publicClient.waitForTransactionReceipt({ hash: txHash })
|
|
109
107
|
|
|
110
|
-
const txHash2 = await fundingClient.sendTransaction({
|
|
111
|
-
to: usdcSource,
|
|
112
|
-
data: encodeFunctionData({
|
|
113
|
-
abi: erc20Abi,
|
|
114
|
-
functionName: 'transfer',
|
|
115
|
-
args: [address, usdcAmount],
|
|
116
|
-
}),
|
|
117
|
-
})
|
|
118
|
-
await publicClient.waitForTransactionReceipt({ hash: txHash2 })
|
|
119
|
-
|
|
120
108
|
function getTokenAddress(chain: Chain) {
|
|
121
109
|
switch (chain.id) {
|
|
122
110
|
case baseSepolia.id:
|
|
@@ -131,7 +119,7 @@ function getTokenAddress(chain: Chain) {
|
|
|
131
119
|
}
|
|
132
120
|
```
|
|
133
121
|
|
|
134
|
-
|
|
122
|
+
### Sending a Cross-chain Transaction
|
|
135
123
|
|
|
136
124
|
Finally, let's make a cross-chain token transfer:
|
|
137
125
|
|