@rhinestone/deposit-modal 0.1.15 → 0.1.16

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 CHANGED
@@ -76,6 +76,7 @@ Notes:
76
76
  | `defaultAmount` | `string` | No | Pre-filled amount |
77
77
  | `recipient` | `Address` | No | Custom recipient address |
78
78
  | `backendUrl` | `string` | No | Backend URL |
79
+ | `rhinestoneApiKey` | `string` | No | Optional SDK api key forwarded to `RhinestoneSDK` during smart-account setup |
79
80
  | `signerAddress` | `Address` | No | Session signer address |
80
81
  | `waitForFinalTx` | `boolean` | No | Wait for destination tx (default: true) |
81
82
  | `onRequestConnect` | `() => void` | No | Called when wallet connection needed |
package/dist/index.cjs CHANGED
@@ -816,8 +816,10 @@ function buildSession(chain, signerAddress) {
816
816
  chain
817
817
  };
818
818
  }
819
- async function createSmartAccount(userSigner, sessionSigner) {
820
- const rhinestone = new import_sdk.RhinestoneSDK();
819
+ async function createSmartAccount(userSigner, sessionSigner, sdkApiKey) {
820
+ const rhinestone = new import_sdk.RhinestoneSDK({
821
+ apiKey: sdkApiKey ?? ""
822
+ });
821
823
  const ownerAccounts = sessionSigner ? [userSigner, sessionSigner] : [userSigner];
822
824
  const config = {
823
825
  account: {
@@ -886,7 +888,10 @@ async function getSessionDetails(rhinestoneAccount, targetChain, signerAddress,
886
888
  }
887
889
  }
888
890
  if (targetToken) {
889
- const targetSymbol = getTokenSymbol(targetToken, targetChain.id).toUpperCase();
891
+ const targetSymbol = getTokenSymbol(
892
+ targetToken,
893
+ targetChain.id
894
+ ).toUpperCase();
890
895
  if (targetSymbol && targetSymbol !== "TOKEN") {
891
896
  const chainsForToken = selectedChains.filter(
892
897
  (chain) => getSupportedTokenSymbolsForChain(chain.id).includes(targetSymbol)
@@ -1004,6 +1009,7 @@ function SetupStep({
1004
1009
  targetChain,
1005
1010
  targetChainObj,
1006
1011
  targetToken,
1012
+ rhinestoneApiKey,
1007
1013
  signerAddress,
1008
1014
  sessionChainIds,
1009
1015
  recipient,
@@ -1028,7 +1034,8 @@ function SetupStep({
1028
1034
  const sessionOwner = await resolveSessionOwner(address);
1029
1035
  const account = await createSmartAccount(
1030
1036
  signerAccount,
1031
- sessionOwner.account
1037
+ sessionOwner.account,
1038
+ rhinestoneApiKey
1032
1039
  );
1033
1040
  const smartAccount = getAccountAddress(account);
1034
1041
  setState({ type: "checking" });
@@ -1082,6 +1089,7 @@ function SetupStep({
1082
1089
  targetChainObj,
1083
1090
  targetChain,
1084
1091
  targetToken,
1092
+ rhinestoneApiKey,
1085
1093
  signerAddress,
1086
1094
  sessionChainIds,
1087
1095
  recipient,
@@ -3531,6 +3539,7 @@ function DepositFlow({
3531
3539
  sourceToken: defaultSourceToken,
3532
3540
  amount: defaultAmount,
3533
3541
  recipient,
3542
+ rhinestoneApiKey,
3534
3543
  signerAddress = DEFAULT_SIGNER_ADDRESS,
3535
3544
  sessionChainIds,
3536
3545
  forceRegister = false,
@@ -3851,6 +3860,7 @@ function DepositFlow({
3851
3860
  targetChain,
3852
3861
  targetChainObj,
3853
3862
  targetToken,
3863
+ rhinestoneApiKey,
3854
3864
  signerAddress,
3855
3865
  sessionChainIds,
3856
3866
  recipient,
@@ -3911,6 +3921,7 @@ function DepositFlow({
3911
3921
  targetChain,
3912
3922
  targetChainObj,
3913
3923
  targetToken,
3924
+ rhinestoneApiKey,
3914
3925
  signerAddress,
3915
3926
  sessionChainIds,
3916
3927
  recipient,
@@ -4190,6 +4201,7 @@ function DepositModalInner({
4190
4201
  defaultAmount,
4191
4202
  recipient,
4192
4203
  backendUrl = DEFAULT_BACKEND_URL,
4204
+ rhinestoneApiKey,
4193
4205
  signerAddress = DEFAULT_SIGNER_ADDRESS,
4194
4206
  sessionChainIds,
4195
4207
  forceRegister = false,
@@ -4358,6 +4370,7 @@ function DepositModalInner({
4358
4370
  sourceToken,
4359
4371
  amount: defaultAmount,
4360
4372
  recipient,
4373
+ rhinestoneApiKey,
4361
4374
  signerAddress,
4362
4375
  sessionChainIds,
4363
4376
  forceRegister,
@@ -5158,6 +5171,7 @@ function WithdrawFlow({
5158
5171
  recipient: defaultRecipient,
5159
5172
  amount: defaultAmount,
5160
5173
  service,
5174
+ rhinestoneApiKey,
5161
5175
  signerAddress = DEFAULT_SIGNER_ADDRESS,
5162
5176
  sessionChainIds,
5163
5177
  forceRegister = false,
@@ -5334,7 +5348,8 @@ function WithdrawFlow({
5334
5348
  const sessionOwner = await resolveSessionOwner2(ownerAddress2);
5335
5349
  const account = await createSmartAccount(
5336
5350
  signerAccount,
5337
- sessionOwner.account
5351
+ sessionOwner.account,
5352
+ rhinestoneApiKey
5338
5353
  );
5339
5354
  const smartAccount = getAccountAddress(account);
5340
5355
  const checkResult = await service.checkAccount(smartAccount);
@@ -5423,6 +5438,7 @@ function WithdrawFlow({
5423
5438
  targetChain,
5424
5439
  targetToken,
5425
5440
  service,
5441
+ rhinestoneApiKey,
5426
5442
  handleConnected,
5427
5443
  asset.decimals,
5428
5444
  safeAddress,
@@ -5642,6 +5658,7 @@ function WithdrawModalInner({
5642
5658
  onClose,
5643
5659
  inline,
5644
5660
  backendUrl = DEFAULT_BACKEND_URL,
5661
+ rhinestoneApiKey,
5645
5662
  signerAddress = DEFAULT_SIGNER_ADDRESS,
5646
5663
  sessionChainIds,
5647
5664
  forceRegister = false,
@@ -5809,6 +5826,7 @@ function WithdrawModalInner({
5809
5826
  recipient,
5810
5827
  amount: defaultAmount,
5811
5828
  service,
5829
+ rhinestoneApiKey,
5812
5830
  signerAddress,
5813
5831
  sessionChainIds,
5814
5832
  forceRegister,
package/dist/index.d.cts CHANGED
@@ -73,6 +73,7 @@ interface DepositModalProps {
73
73
  defaultAmount?: string;
74
74
  recipient?: Address;
75
75
  backendUrl?: string;
76
+ rhinestoneApiKey?: string;
76
77
  signerAddress?: Address;
77
78
  sessionChainIds?: number[];
78
79
  forceRegister?: boolean;
@@ -114,6 +115,7 @@ interface WithdrawModalProps {
114
115
  onClose: () => void;
115
116
  inline?: boolean;
116
117
  backendUrl?: string;
118
+ rhinestoneApiKey?: string;
117
119
  signerAddress?: Address;
118
120
  sessionChainIds?: number[];
119
121
  forceRegister?: boolean;
package/dist/index.d.ts CHANGED
@@ -73,6 +73,7 @@ interface DepositModalProps {
73
73
  defaultAmount?: string;
74
74
  recipient?: Address;
75
75
  backendUrl?: string;
76
+ rhinestoneApiKey?: string;
76
77
  signerAddress?: Address;
77
78
  sessionChainIds?: number[];
78
79
  forceRegister?: boolean;
@@ -114,6 +115,7 @@ interface WithdrawModalProps {
114
115
  onClose: () => void;
115
116
  inline?: boolean;
116
117
  backendUrl?: string;
118
+ rhinestoneApiKey?: string;
117
119
  signerAddress?: Address;
118
120
  sessionChainIds?: number[];
119
121
  forceRegister?: boolean;
package/dist/index.mjs CHANGED
@@ -805,8 +805,10 @@ function buildSession(chain, signerAddress) {
805
805
  chain
806
806
  };
807
807
  }
808
- async function createSmartAccount(userSigner, sessionSigner) {
809
- const rhinestone = new RhinestoneSDK();
808
+ async function createSmartAccount(userSigner, sessionSigner, sdkApiKey) {
809
+ const rhinestone = new RhinestoneSDK({
810
+ apiKey: sdkApiKey ?? ""
811
+ });
810
812
  const ownerAccounts = sessionSigner ? [userSigner, sessionSigner] : [userSigner];
811
813
  const config = {
812
814
  account: {
@@ -875,7 +877,10 @@ async function getSessionDetails(rhinestoneAccount, targetChain, signerAddress,
875
877
  }
876
878
  }
877
879
  if (targetToken) {
878
- const targetSymbol = getTokenSymbol(targetToken, targetChain.id).toUpperCase();
880
+ const targetSymbol = getTokenSymbol(
881
+ targetToken,
882
+ targetChain.id
883
+ ).toUpperCase();
879
884
  if (targetSymbol && targetSymbol !== "TOKEN") {
880
885
  const chainsForToken = selectedChains.filter(
881
886
  (chain) => getSupportedTokenSymbolsForChain(chain.id).includes(targetSymbol)
@@ -995,6 +1000,7 @@ function SetupStep({
995
1000
  targetChain,
996
1001
  targetChainObj,
997
1002
  targetToken,
1003
+ rhinestoneApiKey,
998
1004
  signerAddress,
999
1005
  sessionChainIds,
1000
1006
  recipient,
@@ -1019,7 +1025,8 @@ function SetupStep({
1019
1025
  const sessionOwner = await resolveSessionOwner(address);
1020
1026
  const account = await createSmartAccount(
1021
1027
  signerAccount,
1022
- sessionOwner.account
1028
+ sessionOwner.account,
1029
+ rhinestoneApiKey
1023
1030
  );
1024
1031
  const smartAccount = getAccountAddress(account);
1025
1032
  setState({ type: "checking" });
@@ -1073,6 +1080,7 @@ function SetupStep({
1073
1080
  targetChainObj,
1074
1081
  targetChain,
1075
1082
  targetToken,
1083
+ rhinestoneApiKey,
1076
1084
  signerAddress,
1077
1085
  sessionChainIds,
1078
1086
  recipient,
@@ -3516,6 +3524,7 @@ function DepositFlow({
3516
3524
  sourceToken: defaultSourceToken,
3517
3525
  amount: defaultAmount,
3518
3526
  recipient,
3527
+ rhinestoneApiKey,
3519
3528
  signerAddress = DEFAULT_SIGNER_ADDRESS,
3520
3529
  sessionChainIds,
3521
3530
  forceRegister = false,
@@ -3836,6 +3845,7 @@ function DepositFlow({
3836
3845
  targetChain,
3837
3846
  targetChainObj,
3838
3847
  targetToken,
3848
+ rhinestoneApiKey,
3839
3849
  signerAddress,
3840
3850
  sessionChainIds,
3841
3851
  recipient,
@@ -3896,6 +3906,7 @@ function DepositFlow({
3896
3906
  targetChain,
3897
3907
  targetChainObj,
3898
3908
  targetToken,
3909
+ rhinestoneApiKey,
3899
3910
  signerAddress,
3900
3911
  sessionChainIds,
3901
3912
  recipient,
@@ -4188,6 +4199,7 @@ function DepositModalInner({
4188
4199
  defaultAmount,
4189
4200
  recipient,
4190
4201
  backendUrl = DEFAULT_BACKEND_URL,
4202
+ rhinestoneApiKey,
4191
4203
  signerAddress = DEFAULT_SIGNER_ADDRESS,
4192
4204
  sessionChainIds,
4193
4205
  forceRegister = false,
@@ -4356,6 +4368,7 @@ function DepositModalInner({
4356
4368
  sourceToken,
4357
4369
  amount: defaultAmount,
4358
4370
  recipient,
4371
+ rhinestoneApiKey,
4359
4372
  signerAddress,
4360
4373
  sessionChainIds,
4361
4374
  forceRegister,
@@ -5165,6 +5178,7 @@ function WithdrawFlow({
5165
5178
  recipient: defaultRecipient,
5166
5179
  amount: defaultAmount,
5167
5180
  service,
5181
+ rhinestoneApiKey,
5168
5182
  signerAddress = DEFAULT_SIGNER_ADDRESS,
5169
5183
  sessionChainIds,
5170
5184
  forceRegister = false,
@@ -5341,7 +5355,8 @@ function WithdrawFlow({
5341
5355
  const sessionOwner = await resolveSessionOwner2(ownerAddress2);
5342
5356
  const account = await createSmartAccount(
5343
5357
  signerAccount,
5344
- sessionOwner.account
5358
+ sessionOwner.account,
5359
+ rhinestoneApiKey
5345
5360
  );
5346
5361
  const smartAccount = getAccountAddress(account);
5347
5362
  const checkResult = await service.checkAccount(smartAccount);
@@ -5430,6 +5445,7 @@ function WithdrawFlow({
5430
5445
  targetChain,
5431
5446
  targetToken,
5432
5447
  service,
5448
+ rhinestoneApiKey,
5433
5449
  handleConnected,
5434
5450
  asset.decimals,
5435
5451
  safeAddress,
@@ -5653,6 +5669,7 @@ function WithdrawModalInner({
5653
5669
  onClose,
5654
5670
  inline,
5655
5671
  backendUrl = DEFAULT_BACKEND_URL,
5672
+ rhinestoneApiKey,
5656
5673
  signerAddress = DEFAULT_SIGNER_ADDRESS,
5657
5674
  sessionChainIds,
5658
5675
  forceRegister = false,
@@ -5820,6 +5837,7 @@ function WithdrawModalInner({
5820
5837
  recipient,
5821
5838
  amount: defaultAmount,
5822
5839
  service,
5840
+ rhinestoneApiKey,
5823
5841
  signerAddress,
5824
5842
  sessionChainIds,
5825
5843
  forceRegister,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/deposit-modal",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "React modal component for Rhinestone cross-chain deposits",
5
5
  "author": "Rhinestone <dev@rhinestone.wtf>",
6
6
  "bugs": {
@@ -39,7 +39,7 @@
39
39
  "react-dom": ">=18"
40
40
  },
41
41
  "dependencies": {
42
- "@rhinestone/sdk": "^1.2.10",
42
+ "@rhinestone/sdk": "^1.2.11",
43
43
  "@rhinestone/shared-configs": "^1.4.93",
44
44
  "@reown/appkit": "^1.8.17",
45
45
  "@reown/appkit-adapter-wagmi": "^1.8.17",