Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: starknet-io/get-starknet
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @starknet-io/[email protected]
Choose a base ref
...
head repository: starknet-io/get-starknet
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
20 changes: 13 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: PR
name: PR integration

on:
pull_request:
branches:
@@ -11,20 +12,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.2.2

- uses: pnpm/action-setup@v4
with:
version: 8

- name: setup node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: install dependencies
run: pnpm install
- name: run tests
run: pnpm test

- name: check formatting
run: pnpm format:check

- name: run tests
run: pnpm test
40 changes: 30 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,62 @@
name: Release

on:
push:
branches:
- master
- develop

jobs:
version:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.2.2

- uses: pnpm/action-setup@v4
with:
version: 8

- name: setup node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Setup npmrc
run:
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN
}}" >> .npmrc
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" >> .npmrc
- name: install dependencies
run: pnpm install

- name: run tests
run: pnpm test

- name: copy readme to every package
run: echo "./packages/core/ ./packages/ui/" | xargs -n 1 cp README.md
- name: create and publish versions

- name: Create Master Release
if: github.ref == 'refs/heads/master'
uses: changesets/action@v1
with:
version: pnpm run version
commit: "chore: update versions"
title: "chore: update versions"
commit: "chore: version bump"
title: "Master branch version bump"
publish: pnpm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Develop Release
if: github.ref == 'refs/heads/develop'
uses: changesets/action@v1
with:
version: pnpm run version
commit: "chore: version bump"
title: "Develop branch version bump"
publish: pnpm run publish:next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# get-starknet-example

## 2.1.4

### Patch Changes

- bd3e8ec: added mobile os store links support
- Updated dependencies [bd3e8ec]
- get-starknet@3.3.3

## 2.1.3

### Patch Changes

- 53469c7: Implement eip 6963 support
- Updated dependencies [53469c7]
- get-starknet@3.3.2

## 2.1.2

### Patch Changes
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "get-starknet-example",
"version": "2.1.2",
"version": "2.1.4",
"private": true,
"type": "module",
"scripts": {
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"get-starknet": "workspace:^3.0.1",
"get-starknet": "workspace:^3.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
"format": "prettier --ignore-path .gitignore --plugin-search-dir=. --write '**/*.{js,cjs,ts,tsx,svelte,md,yml,json}'",
"format:check": "prettier --ignore-path .gitignore --plugin-search-dir=. --check '**/*.{js,cjs,ts,tsx,svelte,md,yml,json}'",
"prepare": "pnpm run build && husky install",
"publish": "pnpm publish -r --no-git-checks",
"publish": "pnpm publish -r --no-git-checks && changeset tag",
"publish:next": "pnpm publish -r --no-git-checks --tag next && changeset tag",
"test": "CI=true pnpm run -r test",
"version": "changeset version && pnpm install --lockfile-only"
},
31 changes: 31 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# get-starknet-core

## 3.3.4

### Patch Changes

- 2ae401b: Support Keplr wallet

## 3.3.3

### Patch Changes

- bd3e8ec: added mobile os store links support

## 3.3.2

### Patch Changes

- 53469c7: Implement eip 6963 support

## 3.3.1

### Patch Changes

- 3d64355: Implement eip 6963 support

## 3.3.0

### Minor Changes

- 042997b: Support OKX wallet
- 042997b: Support MetaMask Starknet snap

## 3.2.0

### Minor Changes
2 changes: 2 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# get-starknet

[![npm](https://img.shields.io/npm/v/get-starknet.svg)](https://www.npmjs.com/package/get-starknet)
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=StarkNet)](https://twitter.com/Starknet)
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.com/invite/qypnmzkhbc)

## Goals

7 changes: 5 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "get-starknet-core",
"version": "3.2.0",
"version": "3.3.4",
"keywords": [
"starknet",
"starkware",
@@ -29,6 +29,9 @@
"dev": "vite build --watch",
"test": "vitest"
},
"dependencies": {
"@module-federation/runtime": "^0.1.2"
},
"devDependencies": {
"c8": "^7.12.0",
"happy-dom": "^6.0.4",
@@ -37,7 +40,7 @@
"typescript": "^4.6.4",
"vite": "^3.0.0",
"vite-plugin-dts": "^1.4.0",
"vitest": "^0.19.1"
"vitest": "^2.1.3"
},
"peerDependencies": {
"starknet": "^5.18.0"
2 changes: 2 additions & 0 deletions packages/core/src/StarknetWindowObject.ts
Original file line number Diff line number Diff line change
@@ -94,6 +94,7 @@ export interface IStarknetWindowObject {
provider?: ProviderInterface | ProviderInterfaceV4
selectedAddress?: string
chainId?: string
isConnected: boolean
}

export interface ConnectedStarknetWindowObject extends IStarknetWindowObject {
@@ -118,6 +119,7 @@ declare global {
starknet?: StarknetWindowObject
starknet_braavos?: StarknetWindowObject
starknet_argentX?: StarknetWindowObject
starknet_metamask?: StarknetWindowObject
[key: `starknet_${string}`]: StarknetWindowObject | undefined
}
}
20 changes: 17 additions & 3 deletions packages/core/src/__test__/main.test.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ import { mockStorageFunction } from "./storage.mock"
import {
ArgentXMock,
BraavosMock,
KeplrMock,
OKXMock,
UnknownWalletAMock,
UnknownWalletBMock,
makePreAuthorized,
@@ -31,11 +33,15 @@ describe("getAvailableWallets()", () => {
},
starknet: ArgentXMock,
"starknet-braavos": BraavosMock,
starknet_okxwallet: OKXMock,
starknet_keplr: KeplrMock,
})
const availableWallets = await sn.getAvailableWallets()
expect(availableWallets.length).toBe(2)
expect(availableWallets.length).toBe(4)
expect(availableWallets).toContainEqual(ArgentXMock)
expect(availableWallets).toContainEqual(BraavosMock)
expect(availableWallets).toContainEqual(OKXMock)
expect(availableWallets).toContainEqual(KeplrMock)
})
it("should return one injected wallet", async () => {
const sn = getWallet({
@@ -110,16 +116,22 @@ describe("getPreAuthorizedWallets()", () => {
const sn = getWallet({
"starknet-argent": makePreAuthorized(true)(ArgentXMock),
"starknet-braavos": makePreAuthorized(true)(BraavosMock),
starknet_okxwallet: makePreAuthorized(true)(OKXMock),
starknet_keplr: makePreAuthorized(true)(KeplrMock),
})
const preauthorizedWallets = await sn.getPreAuthorizedWallets()
expect(preauthorizedWallets.length).toBe(2)
expect(preauthorizedWallets.length).toBe(4)
expect(preauthorizedWallets.map((w) => w.id)).contains(ArgentXMock.id)
expect(preauthorizedWallets.map((w) => w.id)).contains(BraavosMock.id)
expect(preauthorizedWallets.map((w) => w.id)).contains(OKXMock.id)
expect(preauthorizedWallets.map((w) => w.id)).contains(KeplrMock.id)
})
it("should return one preauthorized wallet", async () => {
const sn = getWallet({
"starknet-argent": makePreAuthorized(true)(ArgentXMock),
"starknet-braavos": makePreAuthorized(false)(BraavosMock),
starknet_okxwallet: makePreAuthorized(false)(OKXMock),
starknet_keplr: makePreAuthorized(false)(KeplrMock),
})
const preauthorizedWallets = await sn.getPreAuthorizedWallets()
expect(preauthorizedWallets.length).toBe(1)
@@ -131,8 +143,10 @@ describe("getDiscoveryWallets()", () => {
it("should return all discovery wallets", async () => {
const sn = getWallet({})
const discoveryWallets = await sn.getDiscoveryWallets()
expect(discoveryWallets.length).toBe(2)
expect(discoveryWallets.length).toBe(5)
expect(discoveryWallets.map((w) => w.id)).contains(ArgentXMock.id)
expect(discoveryWallets.map((w) => w.id)).contains(BraavosMock.id)
expect(discoveryWallets.map((w) => w.id)).contains(OKXMock.id)
expect(discoveryWallets.map((w) => w.id)).contains(KeplrMock.id)
})
})
Loading