@@ -0,0 +1,3167 @@
+package foundation.omni.money;%0A%0A%0Aimport java.math.BigDecimal;%0A%0Aimport javax.money.convert.ConversionQuery;%0Aimport javax.money.convert.ExchangeRate;%0Aimport javax.money.convert.ProviderContext;%0Aimport javax.money.convert.ProviderContextBuilder;%0Aimport javax.money.convert.RateType;%0A%0Aimport com.msgilligan.bitcoinj.money.CurrencyUnitPair;%0Aimport com.msgilligan.bitcoinj.money.ExchangeRateObserver;%0Aimport com.msgilligan.bitcoinj.money.ObservableExchangeRateProvider;%0Aimport org.javamoney.moneta.ExchangeRateBuilder;%0Aimport org.javamoney.moneta.spi.AbstractRateProvider;%0Aimport org.javamoney.moneta.spi.DefaultNumberValue;%0A%0A/**%0A * Based on Moneta Identity provider licensed under Apache license%0A */%0Apublic class TetherUSDIdentityProvider extends AbstractRateProvider implements ObservableExchangeRateProvider %7B%0A%0A    /**%0A     * The %7B@link javax.money.convert.ConversionContext%7D of this provider.%0A     */%0A    private static final ProviderContext CONTEXT =%0A            ProviderContextBuilder.of(%22TETHERIDENT%22, RateType.OTHER).set(%22providerDescription%22, %22Tether Identity Provider%22).build();%0A%0A    /**%0A     * Constructor, also loads initial data.%0A     */%0A    public TetherUSDIdentityProvider() %7B%0A        super(CONTEXT);%0A    %7D%0A%0A    /**%0A     * Check if this provider can provide a rate, which is only the case if base and term are equal.%0A     *%0A     * @param conversionQuery the required %7B@link ConversionQuery%7D, not %7B@code null%7D%0A     * @return true, if the contained base and term currencies are known to this provider.%0A     */%0A    @Override%0A    public boolean isAvailable(ConversionQuery conversionQuery) %7B%0A        return conversionQuery.getBaseCurrency().getCurrencyCode().equals(%22USDT%22) &&%0A                conversionQuery.getCurrency().getCurrencyCode().equals(%22USD%22);%0A    %7D%0A%0A    @Override%0A    public ExchangeRate getExchangeRate(ConversionQuery conversionQuery) %7B%0A        if (isAvailable(conversionQuery)) %7B%0A            ExchangeRateBuilder builder = new ExchangeRateBuilder(getContext().getProviderName(), RateType.OTHER)%0A                    .setBase(conversionQuery.getBaseCurrency());%0A            builder.setTerm(conversionQuery.getCurrency());%0A            builder.setFactor(DefaultNumberValue.of(BigDecimal.ONE));%0A            return builder.build();%0A        %7D%0A        return null;%0A    %7D%0A%0A    /*%0A     * (non-Javadoc)%0A%09 *%0A%09 * @see%0A%09 * javax.money.convert.ExchangeRateProvider#getReversed(javax.money.convert%0A%09 * .ExchangeRate)%0A%09 */%0A    @Override%0A    public ExchangeRate getReversed(ExchangeRate rate) %7B%0A        if (rate.getContext().getProviderName().equals(CONTEXT.getProviderName())) %7B%0A            return new ExchangeRateBuilder(rate.getContext()).setTerm(rate.getBaseCurrency())%0A                    .setBase(rate.getCurrency()).setFactor(new DefaultNumberValue(BigDecimal.ONE)).build();%0A        %7D%0A        return null;%0A    %7D%0A%0A    @Override%0A    public void registerExchangeRateObserver(CurrencyUnitPair pair, ExchangeRateObserver observer) %7B%0A        // NOOP because rate never changes%0A    %7D%0A%0A    @Override%0A    public void start() %7B%0A        // NOOP because rate never changes%0A    %7D%0A%0A    @Override%0A    public void stop() %7B%0A        // NOOP because rate never changes%0A    %7D%0A%7D%0A

Add TetherUSDIdentityProvider