File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
src/lib/importer/statement/provider Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1
1
import agora from './agora' ;
2
2
import karmahq from './karmahq' ;
3
+ import safe from './safe' ;
3
4
import tally from './tally' ;
4
5
5
6
export const PROVIDERS = {
6
7
tally,
7
8
karmahq,
8
- agora
9
+ agora,
10
+ safe
9
11
} ;
Original file line number Diff line number Diff line change
1
+ import snapshot from '@snapshot-labs/snapshot.js' ;
2
+ import { Provider } from './Provider' ;
3
+
4
+ export default class Safe extends Provider {
5
+ static readonly MAPPING = {
6
+ 's:safe.eth' : 'https://safe-claiming-app-data.safe.global/guardians/guardians.json'
7
+ } ;
8
+
9
+ static readonly ID = 'safe' ;
10
+
11
+ async _fetch ( ) {
12
+ const results = await snapshot . utils . getJSON ( Safe . MAPPING [ this . spaceId ] ) ;
13
+
14
+ const delegates = results . map ( ( result : any ) => {
15
+ return this . formatDelegate ( {
16
+ delegate : result . address ,
17
+ statement : `${ result . reason } \n\n${ result . contribution } ` . trim ( )
18
+ } ) ;
19
+ } ) ;
20
+
21
+ await this . afterFetchPage ( 0 , delegates ) ;
22
+ }
23
+
24
+ getId ( ) : string {
25
+ return Safe . ID ;
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments