Migration Guide.
SDK to v3.0.0
-
Due to security concerns, the refresh token is no longer automatically kept in localStorage. You must manage it yourself. It can be accessed from
bearerProfilethrough theMoneriumClientinstance. You must then provide it to thegetAccessmethod. -
getAccessno longer acceptsclientIdnorredirectUrias parameters. These are now set in theMoneriumClientconstructor. -
getBalancesnow only returns the balance for a specified address+chain. Defaults to only 'eur' currency, optional parameter accepts a list of currency codes. -
getOrdersnow returns anordersobject which contains a list of orders. Preparing for pagination. -
getAuthContextremoved, usegetProfilesinstead. -
Use
redirectUriinstead ofredirectUrlfor consistency with OAuth 2.0. -
Networkinterface has been completely removed. You will find occasionalnetworkin responses, but it's in the process of being removed. -
arbitrumandnoblesupport added. -
placeOrderMessagenow has a shortened IBAN format. -
linkAddressnow only creates an account for a single specified chain and has been simplified to:{
profile: "profile-id-that-owns-address", // optional
address: "0x1234...7890",
signature: "0x12341234...78907890",
chain: "ethereum"
} -
skipCreateAccountadded toauthorizemethod to skip the account creation step in the auth flow. -
skipKycadded toauthorizemethod to skip KYC in the auth flow.Ye -
Simplified websockets
Renamed subscribeToOrderNotificationsto subscribeOrderNotifications and unsubscribeFromOrderNotifications to unsubscribeOrderNotifications.
const monerium = new MoneriumClient({...});
// Subscribe to all order events
monerium.subscribeOrderNotifications();
// Subscribe to specific order events
monerium.subscribeOrderNotifications({
filter: {
state: OrderState.pending,
profile: 'my-profile-id',
},
// optional callback functions
onMessage: (order) => console.log(order)
onError: (error) => console.error(error)
});
// Unsubscribe from specific order events
monerium.unsubscribeOrderNotifications({
state: OrderState.pending,
profile: 'my-profile-id'
});
- Interface
ClientCredentialsRequestrenamed toClientCredentialsPayload - Interface
AuthCodeRequestrenamed toAuthCodePayload - Interface
RefreshTokenRequestrenamed toRefreshTokenPayload - Interface
Balancerenamed toCurrencyBalance. - Interface
IBANrenamed toIBANIdentifier. - Interface
SCANrenamed toSCANIdentifier. - Interface
CrossChainrenamed toCrossChainIdentifier.
New
- getAddresses
- getAddress
- getProfile
- getProfiles
- getIban
- getIbans
- moveIban
- requestIban
- CurrencyCode type
Beta:
- submitProfileDetails
React Provider to v1.0.0
- Due to security concerns, the refresh token is no longer automatically kept in localStorage. You must manage it yourself. It can be accessed from accessed and provided through the
MoneriumProvider.
<MoneriumProvider
clientId="f99e629b-6dca-11ee-8aa6-5273f65ed03b"
redirectUri={'http://example.com'}
environment="sandbox"
debug={true}
refreshToken={refreshToken}
onRefreshTokenUpdate={(token) => storeToken(token)}>
{children}
</MoneriumProvider>
- All query hooks now return the data response as
data:
const { data, isLoading, isError } = useProfile();
-
useAuthContextremoved, useuseProfileinstead. -
useBalancesnow only returns the balance for a specified address+chain. Defaults to only 'eur' currency, optional parameter accepts a list of currency codes. -
useLinkAddressmutation,linkAddressnow only creates an account for a single specified chain and has been simplified to:{
profile: "profile-id-that-owns-address", // optional
address: "0x1234...7890",
signature: "0x12341234...78907890",
chain: "ethereum"
}
New:
- useAddress
- useAddresses
- useIban
- useIbans
- useRequestIban
- useMoveIban
- useSubscribeOrderNotification
Beta:
- useSubmitProfileDetails