@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.
Files changed (101) hide show
  1. package/README.md +7 -19
  2. package/dist/accounts/index.d.ts +15535 -0
  3. package/dist/accounts/index.d.ts.map +1 -0
  4. package/dist/accounts/index.js +242 -0
  5. package/dist/accounts/nexus.d.ts +23281 -0
  6. package/dist/accounts/nexus.d.ts.map +1 -0
  7. package/dist/accounts/nexus.js +230 -0
  8. package/dist/accounts/safe.d.ts +15 -0
  9. package/dist/accounts/safe.d.ts.map +1 -0
  10. package/dist/{services/account → accounts}/safe.js +36 -37
  11. package/dist/accounts/utils.d.ts +27 -0
  12. package/dist/accounts/utils.d.ts.map +1 -0
  13. package/dist/accounts/utils.js +155 -0
  14. package/dist/examples/abi/weth.d.ts +214 -0
  15. package/dist/examples/abi/weth.d.ts.map +1 -0
  16. package/dist/examples/abi/weth.js +279 -0
  17. package/dist/examples/cross-chain-ss.d.ts +1 -0
  18. package/dist/examples/cross-chain-ss.d.ts.map +1 -0
  19. package/dist/{example.js → examples/cross-chain-ss.js} +70 -44
  20. package/dist/examples/omni-account.d.ts +1 -0
  21. package/dist/examples/omni-account.d.ts.map +1 -0
  22. package/dist/examples/omni-account.js +169 -0
  23. package/dist/examples/smart-sessions.d.ts +1 -0
  24. package/dist/examples/smart-sessions.d.ts.map +1 -0
  25. package/dist/examples/smart-sessions.js +216 -0
  26. package/dist/execution/index.d.ts +31 -0
  27. package/dist/execution/index.d.ts.map +1 -0
  28. package/dist/execution/index.js +222 -0
  29. package/dist/execution/smart-session.d.ts +14 -0
  30. package/dist/execution/smart-session.d.ts.map +1 -0
  31. package/dist/execution/smart-session.js +83 -0
  32. package/dist/index.d.ts +15 -4
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +11 -11
  35. package/dist/modules/abi/smart-sessions.d.ts +42 -0
  36. package/dist/modules/abi/smart-sessions.d.ts.map +1 -0
  37. package/dist/modules/abi/smart-sessions.js +128 -0
  38. package/dist/modules/common.d.ts +16 -0
  39. package/dist/modules/common.d.ts.map +1 -0
  40. package/dist/modules/common.js +5 -0
  41. package/dist/modules/index.d.ts +33 -0
  42. package/dist/modules/index.d.ts.map +1 -0
  43. package/dist/modules/index.js +129 -0
  44. package/dist/modules/omni-account.d.ts +9 -0
  45. package/dist/modules/omni-account.d.ts.map +1 -0
  46. package/dist/modules/omni-account.js +7 -0
  47. package/dist/modules/validators.d.ts +31 -0
  48. package/dist/modules/validators.d.ts.map +1 -0
  49. package/dist/modules/validators.js +518 -0
  50. package/dist/{services/orchestrator → orchestrator}/client.d.ts +2 -5
  51. package/dist/orchestrator/client.d.ts.map +1 -0
  52. package/dist/orchestrator/consts.d.ts +4 -0
  53. package/dist/orchestrator/consts.d.ts.map +1 -0
  54. package/dist/orchestrator/consts.js +3 -0
  55. package/dist/orchestrator/error.d.ts.map +1 -0
  56. package/dist/orchestrator/index.d.ts +9 -0
  57. package/dist/orchestrator/index.d.ts.map +1 -0
  58. package/dist/orchestrator/index.js +10 -0
  59. package/dist/orchestrator/registry.d.ts +5 -0
  60. package/dist/orchestrator/registry.d.ts.map +1 -0
  61. package/dist/orchestrator/registry.js +187 -0
  62. package/dist/{services/orchestrator → orchestrator}/types.d.ts +39 -23
  63. package/dist/orchestrator/types.d.ts.map +1 -0
  64. package/dist/orchestrator/types.js +7 -0
  65. package/dist/orchestrator/utils.d.ts +11 -0
  66. package/dist/orchestrator/utils.d.ts.map +1 -0
  67. package/dist/{services/orchestrator → orchestrator}/utils.js +20 -6
  68. package/dist/types.d.ts +70 -8
  69. package/dist/types.d.ts.map +1 -1
  70. package/package.json +3 -3
  71. package/dist/example.d.ts +0 -1
  72. package/dist/example.d.ts.map +0 -1
  73. package/dist/services/account/index.d.ts +0 -13
  74. package/dist/services/account/index.d.ts.map +0 -1
  75. package/dist/services/account/index.js +0 -54
  76. package/dist/services/account/nexus.d.ts +0 -9
  77. package/dist/services/account/nexus.d.ts.map +0 -1
  78. package/dist/services/account/nexus.js +0 -67
  79. package/dist/services/account/safe.d.ts +0 -9
  80. package/dist/services/account/safe.d.ts.map +0 -1
  81. package/dist/services/modules.d.ts +0 -32
  82. package/dist/services/modules.d.ts.map +0 -1
  83. package/dist/services/modules.js +0 -166
  84. package/dist/services/orchestrator/client.d.ts.map +0 -1
  85. package/dist/services/orchestrator/consts.d.ts +0 -6
  86. package/dist/services/orchestrator/consts.d.ts.map +0 -1
  87. package/dist/services/orchestrator/consts.js +0 -4
  88. package/dist/services/orchestrator/error.d.ts.map +0 -1
  89. package/dist/services/orchestrator/index.d.ts +0 -8
  90. package/dist/services/orchestrator/index.d.ts.map +0 -1
  91. package/dist/services/orchestrator/index.js +0 -9
  92. package/dist/services/orchestrator/types.d.ts.map +0 -1
  93. package/dist/services/orchestrator/types.js +0 -6
  94. package/dist/services/orchestrator/utils.d.ts +0 -7
  95. package/dist/services/orchestrator/utils.d.ts.map +0 -1
  96. package/dist/services/transaction.d.ts +0 -6
  97. package/dist/services/transaction.d.ts.map +0 -1
  98. package/dist/services/transaction.js +0 -93
  99. /package/dist/{services/orchestrator → orchestrator}/client.js +0 -0
  100. /package/dist/{services/orchestrator → orchestrator}/error.d.ts +0 -0
  101. /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
- ### Quick Start
25
+ ## Quickstart
26
26
 
27
- You'll need a Rhinestone API key, as well as an existing account with some testnet tokens.
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
- You can get some testnet USDC using a [Circle Faucet](https://faucet.circle.com). Make sure you have the testnet ETH on the source chain as well.
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: 'safe',
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
- ## Funding the Account
93
+ ### Funding the Account
96
94
 
97
- We will send some tokens from the funding account to the Safe account.
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
- ## Sending a Cross-chain Transaction
122
+ ### Sending a Cross-chain Transaction
135
123
 
136
124
  Finally, let's make a cross-chain token transfer:
137
125