Skip to content

Commit 07b7146

Browse files
committed
Rename APIInfo to ApiInfo
1 parent 19e3351 commit 07b7146

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

cardano-wasm/cardano-wasm.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ executable cardano-wasm
3737
ghc-options:
3838
-no-hs-main
3939
-optl-mexec-model=reactor
40-
"-optl-Wl,--strip-all,--export=getAPIInfo,--export=newConwayTx,--export=addTxInput,--export=addSimpleTxOut,--export=setFee,--export=addSigningKey,--export=signTx,--export=txToCbor"
40+
"-optl-Wl,--strip-all,--export=getApiInfo,--export=newConwayTx,--export=addTxInput,--export=addSimpleTxOut,--export=setFee,--export=addSigningKey,--export=signTx,--export=txToCbor"
4141
other-modules:
4242
Cardano.Wasm.Internal.Api.Info
4343
Cardano.Wasm.Internal.Api.Tx

cardano-wasm/example/cardano-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function initialize() {
3737
}
3838

3939
// Dynamically build the API
40-
const apiInfo = await instance.exports.getAPIInfo();
40+
const apiInfo = await instance.exports.getApiInfo();
4141
let makers = {};
4242
let cardanoAPI = { objectType: "cardano-api" };
4343
// Create maker functions for each virtual object type

cardano-wasm/src/Cardano/Wasm/Internal/Api/Info.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ instance Aeson.ToJSON VirtualObjectInfo where
5656
]
5757

5858
-- | Aggregate type for all API information.
59-
data APIInfo = APIInfo
59+
data ApiInfo = ApiInfo
6060
{ staticMethods :: [MethodInfo]
6161
, virtualObjects :: [VirtualObjectInfo]
6262
}
6363
deriving (Show, Eq)
6464

65-
instance Aeson.ToJSON APIInfo where
66-
toJSON :: APIInfo -> Aeson.Value
67-
toJSON (APIInfo staticObjs virtualObjs) =
65+
instance Aeson.ToJSON ApiInfo where
66+
toJSON :: ApiInfo -> Aeson.Value
67+
toJSON (ApiInfo staticObjs virtualObjs) =
6868
Aeson.object
6969
[ "staticMethods" Aeson..= staticObjs
7070
, "virtualObjects" Aeson..= virtualObjs
7171
]
7272

7373
-- | Provides metadata about the "virtual objects" and their methods.
7474
-- This is intended to help generate JavaScript wrappers.
75-
apiInfo :: APIInfo
75+
apiInfo :: ApiInfo
7676
apiInfo =
7777
let unsignedTxObjectName = "UnsignedTx"
7878
signedTxObjectName = "SignedTx"
@@ -128,7 +128,7 @@ apiInfo =
128128
}
129129
]
130130
}
131-
in APIInfo
131+
in ApiInfo
132132
{ staticMethods = staticApiMethods
133133
, virtualObjects = [unsignedTxObj, signedTxObj]
134134
}

cardano-wasm/src/Cardano/Wasm/Internal/JavaScript/Bridge.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jsValToType expectedType val = do
8888

8989
-- * Type Synonyms for JSVal representations
9090

91-
type JSAPIInfo = JSVal
91+
type JSApiInfo = JSVal
9292

9393
type JSUnsignedTx = JSVal
9494

@@ -224,10 +224,10 @@ txToCbor jsSignedTx =
224224

225225
-- * API Information
226226

227-
foreign export javascript "getAPIInfo"
228-
getAPIInfo :: IO JSAPIInfo
227+
foreign export javascript "getApiInfo"
228+
getApiInfo :: IO JSApiInfo
229229

230-
getAPIInfo :: IO JSAPIInfo
231-
getAPIInfo = toJSVal apiInfo
230+
getApiInfo :: IO JSApiInfo
231+
getApiInfo = toJSVal apiInfo
232232

233233
#endif

0 commit comments

Comments
 (0)