Skip to content

Commit 7405729

Browse files
authored
Merge pull request #565 from InjectiveLabs/feat/rainbow-wallet-canary
chore: add support for rainbow wallet
2 parents 2c15bac + 6c9f823 commit 7405729

File tree

13 files changed

+440
-146
lines changed

13 files changed

+440
-146
lines changed

.github/workflows/canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
publish-canary:
1111
runs-on: ubuntu-latest
1212
permissions: write-all
13-
if: ${{ contains(github.ref_name, 'canary') || contains(github.event.commits[0].message, 'canary') }}
13+
if: ${{ contains(github.event.commits[0].message, 'canary') }}
1414
steps:
1515
- name: 'Checkout'
1616
uses: actions/checkout@v4

.github/workflows/dev.yaml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
publish:
1010
if: true
1111
runs-on: ubuntu-latest
12-
1312
permissions: write-all
1413

1514
steps:
@@ -62,10 +61,24 @@ jobs:
6261
SLACK_API: ${{ secrets.SLACK_API }}
6362
GIT_LATEST_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
6463

64+
package-bump-layer:
65+
name: 'Package bump layer'
66+
runs-on: ubuntu-latest
67+
needs: publish
68+
69+
steps:
70+
- name: Package bump layer
71+
uses: InjectiveLabs/github-package-bump@master
72+
with:
73+
gh_token: ${{ secrets.GH_TOKEN }}
74+
folder_path: layer
75+
repository_url: injectiveLabs/injective-ui
76+
repository_branch: master
77+
6578
package-bump-hub:
6679
name: 'Package bump hub'
6780
runs-on: ubuntu-latest
68-
needs: publish
81+
needs: package-bump-layer
6982

7083
steps:
7184
- name: Package bump Hub
@@ -78,7 +91,7 @@ jobs:
7891
package-bump-helix:
7992
name: 'Package bump Helix'
8093
runs-on: ubuntu-latest
81-
needs: publish
94+
needs: package-bump-layer
8295

8396
steps:
8497
- name: Package bump Helix
@@ -88,23 +101,23 @@ jobs:
88101
repository_url: injectiveLabs/injective-helix
89102
repository_branch: dev
90103

91-
package-bump-bridge:
92-
name: 'Package bump Bridge'
93-
runs-on: ubuntu-latest
94-
needs: publish
104+
# package-bump-bridge:
105+
# name: 'Package bump Bridge'
106+
# runs-on: ubuntu-latest
107+
# needs: package-bump-layer
95108

96-
steps:
97-
- name: Package bump Bridge
98-
uses: InjectiveLabs/github-package-bump@master
99-
with:
100-
gh_token: ${{ secrets.GH_TOKEN }}
101-
repository_url: injectiveLabs/injective-bridge
102-
repository_branch: dev
109+
# steps:
110+
# - name: Package bump Bridge
111+
# uses: InjectiveLabs/github-package-bump@master
112+
# with:
113+
# gh_token: ${{ secrets.GH_TOKEN }}
114+
# repository_url: injectiveLabs/injective-bridge
115+
# repository_branch: dev
103116

104117
package-bump-explorer:
105118
name: 'Package bump Explorer'
106119
runs-on: ubuntu-latest
107-
needs: publish
120+
needs: package-bump-layer
108121

109122
steps:
110123
- name: Package bump Explorer
@@ -117,7 +130,7 @@ jobs:
117130
package-bump-trading-ui:
118131
name: 'Package bump Trading UI'
119132
runs-on: ubuntu-latest
120-
needs: publish
133+
needs: package-bump-layer
121134

122135
steps:
123136
- name: Package bump Trading UI
@@ -130,7 +143,7 @@ jobs:
130143
package-bump-mito:
131144
name: 'Package bump Mito'
132145
runs-on: ubuntu-latest
133-
needs: publish
146+
needs: package-bump-layer
134147

135148
steps:
136149
- name: Package bump Mito
@@ -143,7 +156,7 @@ jobs:
143156
package-bump-ui-api:
144157
name: 'Package bump UI API'
145158
runs-on: ubuntu-latest
146-
needs: publish
159+
needs: package-bump-layer
147160

148161
steps:
149162
- name: Package bump UI API
@@ -153,24 +166,10 @@ jobs:
153166
repository_url: injectiveLabs/injective-ui-api
154167
repository_branch: staging
155168

156-
package-bump-layer:
157-
name: 'Package bump layer'
158-
runs-on: ubuntu-latest
159-
needs: publish
160-
161-
steps:
162-
- name: Package bump layer
163-
uses: InjectiveLabs/github-package-bump@master
164-
with:
165-
gh_token: ${{ secrets.GH_TOKEN }}
166-
folder_path: layer
167-
repository_url: injectiveLabs/injective-ui
168-
repository_branch: master
169-
170169
package-bump-admin-ui:
171170
name: 'Package bump Admin UI'
172171
runs-on: ubuntu-latest
173-
needs: publish
172+
needs: package-bump-layer
174173

175174
steps:
176175
- name: Package bump Admin UI
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { ConcreteException } from '../base.js'
2+
import { ErrorContext, ErrorType } from '../types/index.js'
3+
import { mapMetamaskMessage } from '../utils/maps.js'
4+
5+
const removeMetamaskFromErrorString = (message: string): string =>
6+
message
7+
.replaceAll('Rainbow', '')
8+
.replaceAll('RainBow', '')
9+
.replaceAll('Rainbow:', '')
10+
11+
export class RainbowWalletException extends ConcreteException {
12+
public static errorClass: string = 'RainbowWalletException'
13+
14+
constructor(error: Error, context?: ErrorContext) {
15+
super(error, context)
16+
17+
this.type = ErrorType.WalletError
18+
}
19+
20+
public parse(): void {
21+
const { message } = this
22+
23+
this.setMessage(mapMetamaskMessage(removeMetamaskFromErrorString(message)))
24+
25+
this.setName(RainbowWalletException.errorClass)
26+
}
27+
}
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
1-
import { GrpcUnaryRequestException } from './GrpcUnaryRequestException.js'
2-
import { HttpRequestException } from './HttpRequestException.js'
31
import { Web3Exception } from './Web3Exception.js'
4-
import { GeneralException } from './GeneralException.js'
52
import { LedgerException } from './LedgerException.js'
6-
import { LedgerCosmosException } from './LedgerCosmosException.js'
7-
import { MetamaskException } from './MetamaskException.js'
8-
import { TrustWalletException } from './TrustWalletException.js'
9-
import { OkxWalletException } from './OkxWalletException.js'
103
import { TrezorException } from './TrezorException.js'
11-
import { CosmosWalletException } from './CosmosWalletException.js'
12-
import { TransactionException } from './TransactionException.js'
134
import { WalletException } from './WalletException.js'
145
import { BitGetException } from './BitGetException.js'
6+
import { GeneralException } from './GeneralException.js'
7+
import { MetamaskException } from './MetamaskException.js'
8+
import { OkxWalletException } from './OkxWalletException.js'
9+
import { HttpRequestException } from './HttpRequestException.js'
10+
import { TrustWalletException } from './TrustWalletException.js'
11+
import { TransactionException } from './TransactionException.js'
12+
import { LedgerCosmosException } from './LedgerCosmosException.js'
13+
import { CosmosWalletException } from './CosmosWalletException.js'
14+
import { RainbowWalletException } from './RainbowWalletException.js'
15+
import { GrpcUnaryRequestException } from './GrpcUnaryRequestException.js'
1516
import { TurnkeyWalletSessionException } from './TurnkeyWalletSessionException.js'
1617

1718
export {
1819
Web3Exception,
1920
LedgerException,
2021
TrezorException,
2122
WalletException,
22-
GeneralException,
2323
BitGetException,
24+
GeneralException,
2425
MetamaskException,
26+
OkxWalletException,
2527
TransactionException,
2628
TrustWalletException,
27-
OkxWalletException,
2829
HttpRequestException,
2930
LedgerCosmosException,
3031
CosmosWalletException,
32+
RainbowWalletException,
3133
GrpcUnaryRequestException,
3234
TurnkeyWalletSessionException,
3335
}

0 commit comments

Comments
 (0)