-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
445 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@starknet-react-chains-6cff9d60-4b51-4d9f-9970-5ab722cec095.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "add details about controller, add new providers for cartridge and slot, improve docs around controller", | ||
"packageName": "@starknet-react/chains", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@starknet-react-core-a5326e27-2902-41a3-9439-03dedb8486d0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "add details about controller, add new providers for cartridge and slot, improve docs around controller", | ||
"packageName": "@starknet-react/core", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@starknet-react-kakarot-84d8c637-c0fb-4193-a873-621b68fe05c8.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "none", | ||
"packageName": "@starknet-react/kakarot", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@starknet-react-typescript-config-f85b58bf-fa13-449e-9a3d-2dc3ceea15e2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "none", | ||
"packageName": "@starknet-react/typescript-config", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/create-starknet-734b3cbb-795d-4b2a-904a-e0f9cc731e2f.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "none", | ||
"packageName": "create-starknet", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { Chain } from "./types"; | ||
|
||
export function getSlotChain(projectId: string) { | ||
return { | ||
id: BigInt(projectId), | ||
network: `slot-${projectId}`, | ||
name: `${projectId}`, | ||
nativeCurrency: { | ||
address: | ||
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", | ||
name: "Ether", | ||
symbol: "ETH", | ||
decimals: 18, | ||
}, | ||
testnet: true, | ||
rpcUrls: { | ||
default: { | ||
http: [], | ||
}, | ||
public: { | ||
http: [`https://api.cartridge.gg/x/${projectId}/katana`], | ||
}, | ||
}, | ||
} as const satisfies Chain; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { jsonRpcProvider } from "./jsonrpc"; | ||
|
||
/** Configure the Cartridge provider. */ | ||
export function cartridgeProvider() { | ||
return jsonRpcProvider({ | ||
rpc: (chain) => { | ||
const nodeUrl = chain.rpcUrls["cartridge"]?.http[0]; | ||
if (!nodeUrl) return null; | ||
return { nodeUrl }; | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { getSlotChain } from "@starknet-react/chains"; | ||
import { jsonRpcProvider } from "./jsonrpc"; | ||
|
||
/** Arguments for `slotProvider`. */ | ||
export type SlotProviderArgs = { | ||
/** The name of your slot instance. */ | ||
projectId: string; | ||
}; | ||
|
||
/** Configure the Slot provider using the provided Project ID. */ | ||
export function slotProvider({ projectId }: SlotProviderArgs) { | ||
return jsonRpcProvider({ | ||
rpc: () => { | ||
const chain = getSlotChain(projectId); | ||
const nodeUrl = chain.rpcUrls.public.http[0]; | ||
return { nodeUrl }; | ||
}, | ||
}); | ||
} |
Oops, something went wrong.