1
1
import { Repo } from "./repo/Repo" ;
2
- import { TokenScript } from "./TokenScript" ;
2
+ import { FullTokenScript , TokenScript } from "./TokenScript" ;
3
3
import { IWalletAdapter } from "./wallet/IWalletAdapter" ;
4
4
import { ITokenDiscoveryAdapter } from "./tokens/ITokenDiscoveryAdapter" ;
5
5
import { IViewBinding } from "./view/IViewBinding" ;
@@ -9,7 +9,7 @@ import {AttestationDefinition} from "./tokenScript/attestation/AttestationDefini
9
9
import { TrustedKey } from "./security/TrustedKeyResolver" ;
10
10
import { ILocalStorageAdapter } from "./view/data/ILocalStorageAdapter" ;
11
11
import { ITxValidationInfo } from "./security/TransactionValidator" ;
12
- import { ResolvedScriptData , ScriptInfo } from "./repo/sources/SourceInterface" ;
12
+ import { ScriptInfo } from "./repo/sources/SourceInterface" ;
13
13
14
14
export interface IEngineConfig {
15
15
ipfsGateway ?: string
@@ -32,15 +32,22 @@ export enum ScriptSourceType {
32
32
}
33
33
34
34
export interface TokenScriptEngine {
35
- getWalletAdapter : ( ) => Promise < IWalletAdapter > ;
36
- readonly config ?: IEngineConfig
37
-
38
- processIpfsUrl ( uri : string ) : string ;
39
- getScriptUris ( chain : string | number , contractAddr : string ) : Promise < string [ ] | null > ;
40
- getTokenScriptFromUrl ( url : string ) : Promise < TokenScript > ;
41
- loadTokenScript ( xml : string ) : Promise < TokenScript > ;
42
-
43
- resolveAllScripts ( tsPath : string , forceReload ?: boolean ) : Promise < ScriptInfo [ ] > ;
35
+ getWalletAdapter : ( ) => Promise < IWalletAdapter > ;
36
+ readonly config ?: IEngineConfig ;
37
+
38
+ processIpfsUrl ( uri : string ) : string ;
39
+ getScriptUris ( chain : string | number , contractAddr : string ) : Promise < string [ ] | null > ;
40
+ getTokenScriptFromUrl ( url : string ) : Promise < TokenScript > ;
41
+ loadTokenScript ( xml : string ) : Promise < TokenScript > ;
42
+
43
+ resolveAllScripts ( tsPath : string , forceReload ?: boolean ) : Promise < ScriptInfo [ ] > ;
44
+
45
+ // Only for FullTokenScriptEngine
46
+ getTokenDiscoveryAdapter ?: ( ) => Promise < ITokenDiscoveryAdapter > ;
47
+ getAttestationStorageAdapter ?: ( ) => IAttestationStorageAdapter ;
48
+ getLocalStorageAdapter ?: ( ) => ILocalStorageAdapter ;
49
+ getAttestationManager ( ) : AttestationManager ;
50
+ signPersonalMessage ( data : string ) : Promise < string > ;
44
51
}
45
52
46
53
/**
@@ -212,7 +219,7 @@ export class FullTokenScriptEngine implements TokenScriptEngine {
212
219
}
213
220
let tokenXml = parser . parseFromString ( xml , "text/xml" ) ;
214
221
215
- return new TokenScript ( this , tokenXml , xml , source , sourceId , sourceUrl , scriptInfo , viewBinding ) ;
222
+ return new FullTokenScript ( this , tokenXml , xml , source , sourceId , sourceUrl , scriptInfo , viewBinding ) ;
216
223
} catch ( e ) {
217
224
throw new Error ( "Failed to parse tokenscript definition: " + e . message ) ;
218
225
}
0 commit comments