@imtbl/sdk 0.28.10-alpha.1 → 0.29.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -0
- package/dist/blockchain_data.d.ts +14 -5
- package/dist/blockchain_data.js +4 -4
- package/dist/browser/checkout/sdk.js +2 -2
- package/dist/browser/checkout/widgets.js +51 -51
- package/dist/checkout_sdk.d.ts +462 -216
- package/dist/checkout_sdk.js +6 -24
- package/dist/config.d.ts +18 -6
- package/dist/config.js +21 -20
- package/dist/immutablex_client.d.ts +14 -5
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +10 -10
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +174 -122
- package/dist/index.d.ts +471 -216
- package/dist/index.js +174 -122
- package/dist/orderbook.d.ts +14 -5
- package/dist/passport.d.ts +14 -5
- package/dist/passport.js +146 -98
- package/dist/provider.d.ts +14 -5
- package/package.json +1 -1
package/dist/checkout_sdk.d.ts
CHANGED
|
@@ -10103,16 +10103,25 @@ declare class ImmutableConfiguration {
|
|
|
10103
10103
|
readonly environment: Environment;
|
|
10104
10104
|
readonly rateLimitingKey?: string;
|
|
10105
10105
|
readonly apiKey?: string;
|
|
10106
|
-
readonly
|
|
10106
|
+
readonly publishableKey?: string;
|
|
10107
10107
|
constructor(options: {
|
|
10108
10108
|
environment: Environment;
|
|
10109
|
-
rateLimitingKey?: string;
|
|
10110
|
-
apiKey?: string;
|
|
10111
|
-
clientAppId?: string;
|
|
10112
10109
|
});
|
|
10113
10110
|
}
|
|
10111
|
+
type ImmutableConfigurationWithRequireableFields<T> = ImmutableConfiguration & (T extends {
|
|
10112
|
+
apiKey: 'required';
|
|
10113
|
+
} ? Required<{
|
|
10114
|
+
apiKey: string;
|
|
10115
|
+
}> : {}) & (T extends {
|
|
10116
|
+
publishableKey: 'required';
|
|
10117
|
+
} ? Required<{
|
|
10118
|
+
publishableKey: string;
|
|
10119
|
+
}> : {});
|
|
10120
|
+
type ImmutableConfigurationWithOmitableFields<T> = (T extends {
|
|
10121
|
+
apiKey: 'omit';
|
|
10122
|
+
} ? Omit<ImmutableConfigurationWithRequireableFields<T>, 'apiKey'> : ImmutableConfigurationWithRequireableFields<T>);
|
|
10114
10123
|
interface ModuleConfiguration<T> {
|
|
10115
|
-
baseConfig:
|
|
10124
|
+
baseConfig: ImmutableConfigurationWithOmitableFields<T>;
|
|
10116
10125
|
overrides?: T;
|
|
10117
10126
|
}
|
|
10118
10127
|
|
|
@@ -10729,85 +10738,107 @@ interface FeePercentage {
|
|
|
10729
10738
|
type BuyResult = BuyResultSuccess | BuyResultFailed | BuyResultInsufficientFunds;
|
|
10730
10739
|
/**
|
|
10731
10740
|
* Represents the result of {@link Checkout.buy}
|
|
10732
|
-
* @property {CheckoutStatus.SUCCESS} status
|
|
10733
|
-
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
10741
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
10742
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
10734
10743
|
*/
|
|
10735
10744
|
type BuyResultSuccess = {
|
|
10745
|
+
/** The status to indicate success */
|
|
10736
10746
|
status: CheckoutStatus.SUCCESS;
|
|
10747
|
+
/** The sufficient result of smart checkout */
|
|
10737
10748
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
10738
10749
|
};
|
|
10739
10750
|
/**
|
|
10740
10751
|
* Represents the result of {@link Checkout.buy}
|
|
10741
|
-
* @property {CheckoutStatus.FAILED} status
|
|
10742
|
-
* @property {string} transactionHash
|
|
10743
|
-
* @property {string} reason
|
|
10744
|
-
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
10752
|
+
* @property {CheckoutStatus.FAILED} status
|
|
10753
|
+
* @property {string} transactionHash
|
|
10754
|
+
* @property {string} reason
|
|
10755
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
10745
10756
|
*/
|
|
10746
10757
|
type BuyResultFailed = {
|
|
10758
|
+
/** The status to indicate failure */
|
|
10747
10759
|
status: CheckoutStatus.FAILED;
|
|
10760
|
+
/** The transaction hash of the failed transaction */
|
|
10748
10761
|
transactionHash: string;
|
|
10762
|
+
/** The reason for the failure */
|
|
10749
10763
|
reason: string;
|
|
10764
|
+
/** The sufficient result of smart checkout */
|
|
10750
10765
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
10751
10766
|
};
|
|
10752
10767
|
/**
|
|
10753
10768
|
* Represents the result of {@link Checkout.buy}
|
|
10754
|
-
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
10755
|
-
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
10769
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
10770
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
10756
10771
|
*/
|
|
10757
10772
|
type BuyResultInsufficientFunds = {
|
|
10773
|
+
/** The status to indicate insufficient funds */
|
|
10758
10774
|
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
10775
|
+
/** The insufficient result of smart checkout */
|
|
10759
10776
|
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
10760
10777
|
};
|
|
10761
10778
|
type SellResult = SellResultSuccess | SellResultFailed | SellResultInsufficientFunds;
|
|
10762
10779
|
/**
|
|
10763
10780
|
* Represents the result of {@link Checkout.sell}
|
|
10764
|
-
* @property {CheckoutStatus.SUCCESS} status
|
|
10765
|
-
* @property {
|
|
10781
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
10782
|
+
* @property {string[]} orderIds
|
|
10783
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
10766
10784
|
*/
|
|
10767
10785
|
type SellResultSuccess = {
|
|
10786
|
+
/** The status to indicate success */
|
|
10768
10787
|
status: CheckoutStatus.SUCCESS;
|
|
10788
|
+
/** The orders' ids */
|
|
10769
10789
|
orderIds: string[];
|
|
10790
|
+
/** The sufficient result of smart checkout */
|
|
10770
10791
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
10771
10792
|
};
|
|
10772
10793
|
/**
|
|
10773
10794
|
* Represents the result of {@link Checkout.sell}
|
|
10774
|
-
* @property {CheckoutStatus.FAILED} status
|
|
10775
|
-
* @property {string} transactionHash
|
|
10776
|
-
* @property {string} reason
|
|
10777
|
-
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
10795
|
+
* @property {CheckoutStatus.FAILED} status
|
|
10796
|
+
* @property {string} transactionHash
|
|
10797
|
+
* @property {string} reason
|
|
10798
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
10778
10799
|
*/
|
|
10779
10800
|
type SellResultFailed = {
|
|
10801
|
+
/** The status to indicate failure */
|
|
10780
10802
|
status: CheckoutStatus.FAILED;
|
|
10803
|
+
/** The transaction hash of the failed transaction */
|
|
10781
10804
|
transactionHash: string;
|
|
10805
|
+
/** The reason for the failure */
|
|
10782
10806
|
reason: string;
|
|
10807
|
+
/** The sufficient result of smart checkout */
|
|
10783
10808
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
10784
10809
|
};
|
|
10785
10810
|
/**
|
|
10786
10811
|
* Represents the result of {@link Checkout.sell}
|
|
10787
|
-
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
10788
|
-
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
10812
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
10813
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
10789
10814
|
*/
|
|
10790
10815
|
type SellResultInsufficientFunds = {
|
|
10816
|
+
/** The status to indicate insufficient funds */
|
|
10791
10817
|
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
10818
|
+
/** The insufficient result of smart checkout */
|
|
10792
10819
|
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
10793
10820
|
};
|
|
10794
10821
|
type CancelResult = CancelResultSuccess | CancelResultFailed;
|
|
10795
10822
|
/**
|
|
10796
10823
|
* Represents the result of {@link Checkout.cancel}
|
|
10797
|
-
* @property {CheckoutStatus.SUCCESS} status
|
|
10824
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
10798
10825
|
*/
|
|
10799
10826
|
type CancelResultSuccess = {
|
|
10827
|
+
/** The status to indicate success */
|
|
10800
10828
|
status: CheckoutStatus.SUCCESS;
|
|
10801
10829
|
};
|
|
10802
10830
|
/**
|
|
10803
10831
|
* Represents the result of {@link Checkout.cancel}
|
|
10804
|
-
* @property {CheckoutStatus.FAILED} status
|
|
10805
|
-
* @property {string} transactionHash
|
|
10806
|
-
* @property {string} reason
|
|
10832
|
+
* @property {CheckoutStatus.FAILED} status
|
|
10833
|
+
* @property {string} transactionHash
|
|
10834
|
+
* @property {string} reason
|
|
10807
10835
|
*/
|
|
10808
10836
|
type CancelResultFailed = {
|
|
10837
|
+
/** The status to indicate failure */
|
|
10809
10838
|
status: CheckoutStatus.FAILED;
|
|
10839
|
+
/** The transaction hash of the failed transaction */
|
|
10810
10840
|
transactionHash: string;
|
|
10841
|
+
/** The reason for the failure */
|
|
10811
10842
|
reason: string;
|
|
10812
10843
|
};
|
|
10813
10844
|
/**
|
|
@@ -10824,22 +10855,27 @@ declare enum CheckoutStatus {
|
|
|
10824
10855
|
}
|
|
10825
10856
|
/**
|
|
10826
10857
|
* The type representing the order to buy
|
|
10827
|
-
* @property {string} orderId
|
|
10828
|
-
* @property {Array<OrderFee>} takerFees
|
|
10858
|
+
* @property {string} orderId
|
|
10859
|
+
* @property {Array<OrderFee>} takerFees
|
|
10829
10860
|
*/
|
|
10830
10861
|
type BuyOrder = {
|
|
10862
|
+
/** the id of the order to buy */
|
|
10831
10863
|
id: string;
|
|
10864
|
+
/** array of order fees to apply to the order */
|
|
10832
10865
|
takerFees?: OrderFee[];
|
|
10833
10866
|
};
|
|
10834
10867
|
/**
|
|
10835
10868
|
* The type representing the sell order to create a listing from
|
|
10836
|
-
* @property {SellToken} sellToken
|
|
10837
|
-
* @property {BuyToken} buyToken
|
|
10838
|
-
* @property {OrderFee[]} makerFees
|
|
10869
|
+
* @property {SellToken} sellToken
|
|
10870
|
+
* @property {BuyToken} buyToken
|
|
10871
|
+
* @property {OrderFee[]} makerFees
|
|
10839
10872
|
*/
|
|
10840
10873
|
type SellOrder = {
|
|
10874
|
+
/** the token to be listed for sale */
|
|
10841
10875
|
sellToken: SellToken;
|
|
10876
|
+
/** the token info of the price of the item */
|
|
10842
10877
|
buyToken: BuyToken;
|
|
10878
|
+
/** option array of makerFees to be applied to the listing */
|
|
10843
10879
|
makerFees?: OrderFee[];
|
|
10844
10880
|
};
|
|
10845
10881
|
/**
|
|
@@ -10849,77 +10885,97 @@ type SellOrder = {
|
|
|
10849
10885
|
type BuyToken = NativeBuyToken | ERC20BuyToken;
|
|
10850
10886
|
/**
|
|
10851
10887
|
* Represents a native buy token
|
|
10852
|
-
* @property {ItemType} type
|
|
10853
|
-
* @property {string} amount
|
|
10888
|
+
* @property {ItemType} type
|
|
10889
|
+
* @property {string} amount
|
|
10854
10890
|
*/
|
|
10855
10891
|
type NativeBuyToken = {
|
|
10892
|
+
/** The type indicate this is a native token. */
|
|
10856
10893
|
type: ItemType.NATIVE;
|
|
10894
|
+
/** The amount of native token. */
|
|
10857
10895
|
amount: string;
|
|
10858
10896
|
};
|
|
10859
10897
|
/**
|
|
10860
10898
|
* Represents a ERC20 buy token
|
|
10861
|
-
* @property {ItemType} type
|
|
10862
|
-
* @property {string} amount
|
|
10863
|
-
* @property {string} contractAddress
|
|
10899
|
+
* @property {ItemType} type
|
|
10900
|
+
* @property {string} amount
|
|
10901
|
+
* @property {string} contractAddress
|
|
10864
10902
|
*/
|
|
10865
10903
|
type ERC20BuyToken = {
|
|
10904
|
+
/** The type indicate this is a ERC20 token. */
|
|
10866
10905
|
type: ItemType.ERC20;
|
|
10906
|
+
/** The amount of native token. */
|
|
10867
10907
|
amount: string;
|
|
10908
|
+
/** The contract address of the ERC20. */
|
|
10868
10909
|
contractAddress: string;
|
|
10869
10910
|
};
|
|
10870
10911
|
/**
|
|
10871
10912
|
* The SellToken type
|
|
10872
|
-
* @property {string} id
|
|
10873
|
-
* @property {string} collectionAddress
|
|
10913
|
+
* @property {string} id
|
|
10914
|
+
* @property {string} collectionAddress
|
|
10874
10915
|
*/
|
|
10875
10916
|
type SellToken = {
|
|
10917
|
+
/** The ERC721 token id */
|
|
10876
10918
|
id: string;
|
|
10919
|
+
/** The ERC721 collection address */
|
|
10877
10920
|
collectionAddress: string;
|
|
10878
10921
|
};
|
|
10879
10922
|
/**
|
|
10880
10923
|
* Interface representing the parameters for {@link Checkout.smartCheckout}
|
|
10881
|
-
* @property {Web3Provider} provider
|
|
10882
|
-
* @property {ItemRequirement[]} itemRequirements
|
|
10883
|
-
* @property {FulfillmentTransaction | GasAmount} transactionOrGasAmount
|
|
10924
|
+
* @property {Web3Provider} provider
|
|
10925
|
+
* @property {ItemRequirement[]} itemRequirements
|
|
10926
|
+
* @property {FulfillmentTransaction | GasAmount} transactionOrGasAmount
|
|
10884
10927
|
*/
|
|
10885
10928
|
interface SmartCheckoutParams {
|
|
10929
|
+
/** The provider to use for smart checkout. */
|
|
10886
10930
|
provider: Web3Provider;
|
|
10931
|
+
/** The item requirements for the transaction. */
|
|
10887
10932
|
itemRequirements: (NativeItemRequirement | ERC20ItemRequirement | ERC721ItemRequirement)[];
|
|
10933
|
+
/** The transaction or gas amount. */
|
|
10888
10934
|
transactionOrGasAmount: FulfillmentTransaction | GasAmount;
|
|
10889
10935
|
}
|
|
10890
10936
|
/**
|
|
10891
10937
|
* Represents a native item requirement for a transaction.
|
|
10892
|
-
* @property {ItemType.NATIVE} type
|
|
10893
|
-
* @property {string} amount
|
|
10938
|
+
* @property {ItemType.NATIVE} type
|
|
10939
|
+
* @property {string} amount
|
|
10894
10940
|
*/
|
|
10895
10941
|
type NativeItemRequirement = {
|
|
10942
|
+
/** The type to indicate this is a native item requirement. */
|
|
10896
10943
|
type: ItemType.NATIVE;
|
|
10944
|
+
/** The amount of the item. */
|
|
10897
10945
|
amount: string;
|
|
10898
10946
|
};
|
|
10899
10947
|
/**
|
|
10900
10948
|
* Represents an ERC20 item requirement for a transaction.
|
|
10901
|
-
* @property {ItemType.ERC20} type
|
|
10902
|
-
* @property {string} amount
|
|
10903
|
-
* @property {string} contractAddress
|
|
10904
|
-
* @property {string} spenderAddress
|
|
10949
|
+
* @property {ItemType.ERC20} type
|
|
10950
|
+
* @property {string} amount
|
|
10951
|
+
* @property {string} contractAddress
|
|
10952
|
+
* @property {string} spenderAddress
|
|
10905
10953
|
*/
|
|
10906
10954
|
type ERC20ItemRequirement = {
|
|
10955
|
+
/** The type to indicate this is a ERC20 item requirement. */
|
|
10907
10956
|
type: ItemType.ERC20;
|
|
10957
|
+
/** The amount of the item. */
|
|
10908
10958
|
contractAddress: string;
|
|
10959
|
+
/** The contract address of the ERC20. */
|
|
10909
10960
|
amount: string;
|
|
10961
|
+
/** The contract address of the approver. */
|
|
10910
10962
|
spenderAddress: string;
|
|
10911
10963
|
};
|
|
10912
10964
|
/**
|
|
10913
10965
|
* Represents an ERC721 item requirement for a transaction.
|
|
10914
|
-
* @property {ItemType.ERC721} type
|
|
10915
|
-
* @property {string} contractAddress
|
|
10916
|
-
* @property {string} id
|
|
10917
|
-
* @property {string} spenderAddress
|
|
10966
|
+
* @property {ItemType.ERC721} type
|
|
10967
|
+
* @property {string} contractAddress
|
|
10968
|
+
* @property {string} id
|
|
10969
|
+
* @property {string} spenderAddress
|
|
10918
10970
|
*/
|
|
10919
10971
|
type ERC721ItemRequirement = {
|
|
10972
|
+
/** The type to indicate this is a ERC721 item requirement. */
|
|
10920
10973
|
type: ItemType.ERC721;
|
|
10974
|
+
/** The contract address of the ERC721 collection. */
|
|
10921
10975
|
contractAddress: string;
|
|
10976
|
+
/** The ID of this ERC721 in the collection. */
|
|
10922
10977
|
id: string;
|
|
10978
|
+
/** The contract address of the approver. */
|
|
10923
10979
|
spenderAddress: string;
|
|
10924
10980
|
};
|
|
10925
10981
|
/**
|
|
@@ -10946,20 +11002,24 @@ declare enum TransactionOrGasType {
|
|
|
10946
11002
|
}
|
|
10947
11003
|
/**
|
|
10948
11004
|
* The fulfillment transaction which contains the transaction to send.
|
|
10949
|
-
* @property {TransactionOrGasType} type
|
|
10950
|
-
* @property {TransactionRequest} transaction
|
|
11005
|
+
* @property {TransactionOrGasType} type
|
|
11006
|
+
* @property {TransactionRequest} transaction
|
|
10951
11007
|
*/
|
|
10952
11008
|
type FulfillmentTransaction = {
|
|
11009
|
+
/** The type to indicate this is a fulfillment transaction. */
|
|
10953
11010
|
type: TransactionOrGasType.TRANSACTION;
|
|
11011
|
+
/** The transaction to send. */
|
|
10954
11012
|
transaction: TransactionRequest;
|
|
10955
11013
|
};
|
|
10956
11014
|
/**
|
|
10957
11015
|
* The gas amount which contains the gas token and the gas limit.
|
|
10958
|
-
* @property {TransactionOrGasType} type
|
|
10959
|
-
* @property {GasToken} gasToken
|
|
11016
|
+
* @property {TransactionOrGasType} type
|
|
11017
|
+
* @property {GasToken} gasToken
|
|
10960
11018
|
*/
|
|
10961
11019
|
type GasAmount = {
|
|
11020
|
+
/** The type to indicate this is a gas amount. */
|
|
10962
11021
|
type: TransactionOrGasType.GAS;
|
|
11022
|
+
/** The gas token. */
|
|
10963
11023
|
gasToken: GasToken;
|
|
10964
11024
|
};
|
|
10965
11025
|
/**
|
|
@@ -10978,22 +11038,27 @@ declare enum GasTokenType {
|
|
|
10978
11038
|
}
|
|
10979
11039
|
/**
|
|
10980
11040
|
* Represents a native gas token.
|
|
10981
|
-
* @property {GasTokenType} type
|
|
10982
|
-
* @property {BigNumber} limit
|
|
11041
|
+
* @property {GasTokenType} type
|
|
11042
|
+
* @property {BigNumber} limit
|
|
10983
11043
|
*/
|
|
10984
11044
|
type NativeGas = {
|
|
11045
|
+
/** The type to indicate this is a native gas token. */
|
|
10985
11046
|
type: GasTokenType.NATIVE;
|
|
11047
|
+
/** The gas limit. */
|
|
10986
11048
|
limit: BigNumber;
|
|
10987
11049
|
};
|
|
10988
11050
|
/**
|
|
10989
11051
|
* Represents an ERC20 gas token.
|
|
10990
|
-
* @property {GasTokenType} type
|
|
10991
|
-
* @property {string} contractAddress
|
|
10992
|
-
* @property {BigNumber} limit
|
|
11052
|
+
* @property {GasTokenType} type
|
|
11053
|
+
* @property {string} contractAddress
|
|
11054
|
+
* @property {BigNumber} limit
|
|
10993
11055
|
*/
|
|
10994
11056
|
type ERC20Gas = {
|
|
11057
|
+
/** The type to indicate this is an ERC20 gas token. */
|
|
10995
11058
|
type: GasTokenType.ERC20;
|
|
11059
|
+
/** The contract address of the ERC20. */
|
|
10996
11060
|
contractAddress: string;
|
|
11061
|
+
/** The gas limit. */
|
|
10997
11062
|
limit: BigNumber;
|
|
10998
11063
|
};
|
|
10999
11064
|
/**
|
|
@@ -11002,34 +11067,38 @@ type ERC20Gas = {
|
|
|
11002
11067
|
type SmartCheckoutResult = SmartCheckoutSufficient | SmartCheckoutInsufficient;
|
|
11003
11068
|
/**
|
|
11004
11069
|
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is sufficient.
|
|
11005
|
-
* @property {boolean} sufficient
|
|
11006
|
-
* @property {TransactionRequirement[]} transactionRequirements
|
|
11007
|
-
* determined were required for the transaction.
|
|
11070
|
+
* @property {boolean} sufficient
|
|
11071
|
+
* @property {TransactionRequirement[]} transactionRequirements
|
|
11008
11072
|
*/
|
|
11009
11073
|
type SmartCheckoutSufficient = {
|
|
11074
|
+
/** Indicates that smart checkout determined the user had sufficient funds. */
|
|
11010
11075
|
sufficient: true;
|
|
11076
|
+
/** The transaction requirements smart checkout determined were required for the transaction. */
|
|
11011
11077
|
transactionRequirements: TransactionRequirement[];
|
|
11012
11078
|
};
|
|
11013
11079
|
/**
|
|
11014
11080
|
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is insufficient.
|
|
11015
|
-
* @property {boolean} sufficient
|
|
11016
|
-
* @property {TransactionRequirement[]} transactionRequirements
|
|
11017
|
-
*
|
|
11018
|
-
* @property {SmartCheckoutRouter} router - The type containing the funding routes the user can take to fulfill the transaction requirements
|
|
11081
|
+
* @property {boolean} sufficient
|
|
11082
|
+
* @property {TransactionRequirement[]} transactionRequirements
|
|
11083
|
+
* @property {SmartCheckoutRouter} router
|
|
11019
11084
|
*/
|
|
11020
11085
|
type SmartCheckoutInsufficient = {
|
|
11086
|
+
/** Indicates that smart checkout determined the user has insufficient funds */
|
|
11021
11087
|
sufficient: false;
|
|
11088
|
+
/** The transaction requirements smart checkout determined were required for the transaction. */
|
|
11022
11089
|
transactionRequirements: TransactionRequirement[];
|
|
11090
|
+
/** The type containing the funding routes the user can take to fulfill the transaction requirements */
|
|
11023
11091
|
router: SmartCheckoutRouter;
|
|
11024
11092
|
};
|
|
11025
11093
|
/**
|
|
11026
11094
|
* Represents the routing outcome for a transaction.
|
|
11027
|
-
* @property {AvailableRoutingOptions} availableRoutingOptions
|
|
11028
|
-
* @property {RoutingOutcome} routingOutcome
|
|
11029
|
-
* includes the funding routes if routes were found
|
|
11095
|
+
* @property {AvailableRoutingOptions} availableRoutingOptions
|
|
11096
|
+
* @property {RoutingOutcome} routingOutcome
|
|
11030
11097
|
*/
|
|
11031
11098
|
type SmartCheckoutRouter = {
|
|
11099
|
+
/** The routing options available to the user */
|
|
11032
11100
|
availableRoutingOptions: AvailableRoutingOptions;
|
|
11101
|
+
/** The routing outcome for the transaction which includes the funding routes if routes were found */
|
|
11033
11102
|
routingOutcome: RoutingOutcome;
|
|
11034
11103
|
};
|
|
11035
11104
|
/**
|
|
@@ -11047,109 +11116,137 @@ declare enum RoutingOutcomeType {
|
|
|
11047
11116
|
type RoutingOutcome = RoutesFound | NoRoutesFound | NoRouteOptions;
|
|
11048
11117
|
/**
|
|
11049
11118
|
* Represents a routing outcome where funding routes were found.
|
|
11050
|
-
* @property {RoutingOutcomeType.ROUTES_FOUND} type
|
|
11051
|
-
* @property {AvailableRoutingOptions} fundingRoutes
|
|
11119
|
+
* @property {RoutingOutcomeType.ROUTES_FOUND} type
|
|
11120
|
+
* @property {AvailableRoutingOptions} fundingRoutes
|
|
11052
11121
|
*/
|
|
11053
11122
|
type RoutesFound = {
|
|
11123
|
+
/** Indicates that funding routes were found for the transaction. */
|
|
11054
11124
|
type: RoutingOutcomeType.ROUTES_FOUND;
|
|
11125
|
+
/** The funding routes found for the transaction. */
|
|
11055
11126
|
fundingRoutes: FundingRoute[];
|
|
11056
11127
|
};
|
|
11057
11128
|
/**
|
|
11058
11129
|
* Represents a routing outcome where no funding routes were found.
|
|
11059
|
-
* @property {RoutingOutcomeType.NO_ROUTES_FOUND} type
|
|
11060
|
-
* @property {string} message
|
|
11130
|
+
* @property {RoutingOutcomeType.NO_ROUTES_FOUND} type
|
|
11131
|
+
* @property {string} message
|
|
11061
11132
|
*/
|
|
11062
11133
|
type NoRoutesFound = {
|
|
11134
|
+
/** Indicates that no funding routes were found for the transaction. */
|
|
11063
11135
|
type: RoutingOutcomeType.NO_ROUTES_FOUND;
|
|
11136
|
+
/** The message indicating why no funding routes were found. */
|
|
11064
11137
|
message: string;
|
|
11065
11138
|
};
|
|
11066
11139
|
/**
|
|
11067
11140
|
* Represents a routing outcome where no routing options were available for the transaction.
|
|
11068
|
-
* @property {RoutingOutcomeType.NO_ROUTE_OPTIONS} type
|
|
11069
|
-
* @property {string} message
|
|
11141
|
+
* @property {RoutingOutcomeType.NO_ROUTE_OPTIONS} type
|
|
11142
|
+
* @property {string} message
|
|
11070
11143
|
*/
|
|
11071
11144
|
type NoRouteOptions = {
|
|
11145
|
+
/** Indicates that no routing options were available for the transaction. */
|
|
11072
11146
|
type: RoutingOutcomeType.NO_ROUTE_OPTIONS;
|
|
11147
|
+
/** The message indicating why no routing options were available. */
|
|
11073
11148
|
message: string;
|
|
11074
11149
|
};
|
|
11075
11150
|
/**
|
|
11076
11151
|
* Represents a funding route
|
|
11077
|
-
* @property {number} priority
|
|
11078
|
-
* @property {FundingStep[]} steps
|
|
11152
|
+
* @property {number} priority
|
|
11153
|
+
* @property {FundingStep[]} steps
|
|
11079
11154
|
*/
|
|
11080
11155
|
type FundingRoute = {
|
|
11156
|
+
/** The priority of the route */
|
|
11081
11157
|
priority: number;
|
|
11158
|
+
/** The steps associated with this funding route */
|
|
11082
11159
|
steps: FundingStep[];
|
|
11083
11160
|
};
|
|
11084
11161
|
/**
|
|
11085
11162
|
* Represents a fee
|
|
11086
|
-
* @property {BigNumber} amount
|
|
11087
|
-
* @property {string} formatted
|
|
11088
|
-
* @property {TokenInfo | undefined} token
|
|
11163
|
+
* @property {BigNumber} amount
|
|
11164
|
+
* @property {string} formatted
|
|
11165
|
+
* @property {TokenInfo | undefined} token
|
|
11089
11166
|
*/
|
|
11090
11167
|
type Fee = {
|
|
11168
|
+
/** The amount of the fee */
|
|
11091
11169
|
amount: BigNumber;
|
|
11170
|
+
/** The formatted amount of the fee */
|
|
11092
11171
|
formattedAmount: string;
|
|
11172
|
+
/** The token info for the fee */
|
|
11093
11173
|
token?: TokenInfo;
|
|
11094
11174
|
};
|
|
11095
11175
|
type FundingStep = BridgeFundingStep | SwapFundingStep | OnRampFundingStep;
|
|
11096
11176
|
/**
|
|
11097
11177
|
* Represents a bridge funding route
|
|
11098
|
-
* @property {FundingStepType.BRIDGE} type
|
|
11099
|
-
* @property {number} chainId
|
|
11100
|
-
* @property {FundingItem} fundingItem
|
|
11101
|
-
* @property {BridgeFees} fees
|
|
11178
|
+
* @property {FundingStepType.BRIDGE} type
|
|
11179
|
+
* @property {number} chainId
|
|
11180
|
+
* @property {FundingItem} fundingItem
|
|
11181
|
+
* @property {BridgeFees} fees
|
|
11102
11182
|
*/
|
|
11103
11183
|
type BridgeFundingStep = {
|
|
11184
|
+
/** Indicates that this is a bridge funding step */
|
|
11104
11185
|
type: FundingStepType.BRIDGE;
|
|
11186
|
+
/** The chain id the bridge should be executed on */
|
|
11105
11187
|
chainId: number;
|
|
11188
|
+
/** The funding item for the bridge */
|
|
11106
11189
|
fundingItem: FundingItem;
|
|
11190
|
+
/** The fees for the bridge */
|
|
11107
11191
|
fees: BridgeFees;
|
|
11108
11192
|
};
|
|
11109
11193
|
/**
|
|
11110
11194
|
* Represents the fees for a bridge funding step
|
|
11111
|
-
* @property {Fee} approvalGasFees
|
|
11112
|
-
* @property {Fee} bridgeGasFees
|
|
11113
|
-
* @property {Fee[]} bridgeFees
|
|
11195
|
+
* @property {Fee} approvalGasFees
|
|
11196
|
+
* @property {Fee} bridgeGasFees
|
|
11197
|
+
* @property {Fee[]} bridgeFees
|
|
11114
11198
|
*/
|
|
11115
11199
|
type BridgeFees = {
|
|
11200
|
+
/** The approval gas fees for the bridge */
|
|
11116
11201
|
approvalGasFees: Fee;
|
|
11202
|
+
/** The bridge gas fees for the bridge */
|
|
11117
11203
|
bridgeGasFees: Fee;
|
|
11204
|
+
/** Additional bridge fees for the bridge */
|
|
11118
11205
|
bridgeFees: Fee[];
|
|
11119
11206
|
};
|
|
11120
11207
|
/**
|
|
11121
11208
|
* Represents a swap funding route
|
|
11122
|
-
* @property {FundingStepType.SWAP} type
|
|
11123
|
-
* @property {number} chainId
|
|
11124
|
-
* @property {FundingItem} fundingItem
|
|
11125
|
-
* @property {SwapFees} fees
|
|
11209
|
+
* @property {FundingStepType.SWAP} type
|
|
11210
|
+
* @property {number} chainId
|
|
11211
|
+
* @property {FundingItem} fundingItem
|
|
11212
|
+
* @property {SwapFees} fees
|
|
11126
11213
|
*/
|
|
11127
11214
|
type SwapFundingStep = {
|
|
11215
|
+
/** Indicates that this is a swap funding step */
|
|
11128
11216
|
type: FundingStepType.SWAP;
|
|
11217
|
+
/** The chain id the swap should be executed on */
|
|
11129
11218
|
chainId: number;
|
|
11219
|
+
/** The funding item for the swap */
|
|
11130
11220
|
fundingItem: FundingItem;
|
|
11221
|
+
/** The fees for the swap */
|
|
11131
11222
|
fees: SwapFees;
|
|
11132
11223
|
};
|
|
11133
11224
|
/**
|
|
11134
11225
|
* Represents the fees for a swap funding step
|
|
11135
|
-
* @property {Fee} approvalGasFees
|
|
11136
|
-
* @property {Fee} swapGasFees
|
|
11137
|
-
* @property {Fee[]} swapFees
|
|
11226
|
+
* @property {Fee} approvalGasFees
|
|
11227
|
+
* @property {Fee} swapGasFees
|
|
11228
|
+
* @property {Fee[]} swapFees
|
|
11138
11229
|
*/
|
|
11139
11230
|
type SwapFees = {
|
|
11231
|
+
/** The approval gas fees for the swap */
|
|
11140
11232
|
approvalGasFees: Fee;
|
|
11233
|
+
/** The swap gas fees for the swap */
|
|
11141
11234
|
swapGasFees: Fee;
|
|
11235
|
+
/** Additional swap fees for the swap */
|
|
11142
11236
|
swapFees: Fee[];
|
|
11143
11237
|
};
|
|
11144
11238
|
/**
|
|
11145
11239
|
* Represents an onramp funding route
|
|
11146
|
-
* @property {FundingStepType.ONRAMP} type
|
|
11147
|
-
* @property {number} chainId
|
|
11148
|
-
* @property {FundingItem} fundingItem
|
|
11240
|
+
* @property {FundingStepType.ONRAMP} type
|
|
11241
|
+
* @property {number} chainId
|
|
11242
|
+
* @property {FundingItem} fundingItem
|
|
11149
11243
|
*/
|
|
11150
11244
|
type OnRampFundingStep = {
|
|
11245
|
+
/** Indicates that this is an onramp funding step */
|
|
11151
11246
|
type: FundingStepType.ONRAMP;
|
|
11247
|
+
/** The chain id the onramp should provide funds to */
|
|
11152
11248
|
chainId: number;
|
|
11249
|
+
/** The item to be onramped */
|
|
11153
11250
|
fundingItem: FundingItem;
|
|
11154
11251
|
};
|
|
11155
11252
|
/**
|
|
@@ -11166,76 +11263,98 @@ declare enum FundingStepType {
|
|
|
11166
11263
|
}
|
|
11167
11264
|
/**
|
|
11168
11265
|
* Represents a funding item
|
|
11169
|
-
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
11170
|
-
* @property {FundsRequired} fundsRequired
|
|
11171
|
-
* @property {UserBalance} userBalance
|
|
11172
|
-
* @property {TokenInfo} token
|
|
11266
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
11267
|
+
* @property {FundsRequired} fundsRequired
|
|
11268
|
+
* @property {UserBalance} userBalance
|
|
11269
|
+
* @property {TokenInfo} token
|
|
11173
11270
|
*/
|
|
11174
11271
|
type FundingItem = {
|
|
11272
|
+
/** The type of the funding item */
|
|
11175
11273
|
type: ItemType.NATIVE | ItemType.ERC20;
|
|
11274
|
+
/** The amount of funds required of this funding item */
|
|
11176
11275
|
fundsRequired: FundsRequired;
|
|
11276
|
+
/** The current user balance of this funding item */
|
|
11177
11277
|
userBalance: UserBalance;
|
|
11278
|
+
/** The token info for the funding item */
|
|
11178
11279
|
token: TokenInfo;
|
|
11179
11280
|
};
|
|
11180
11281
|
/**
|
|
11181
11282
|
* Represents the funds required of a funding item
|
|
11182
|
-
* @property {BigNumber} amount
|
|
11183
|
-
* @property {string} formattedAmount
|
|
11283
|
+
* @property {BigNumber} amount
|
|
11284
|
+
* @property {string} formattedAmount
|
|
11184
11285
|
*/
|
|
11185
11286
|
type FundsRequired = {
|
|
11287
|
+
/** The amount of funds required */
|
|
11186
11288
|
amount: BigNumber;
|
|
11289
|
+
/** The formatted amount of funds required */
|
|
11187
11290
|
formattedAmount: string;
|
|
11188
11291
|
};
|
|
11189
11292
|
/**
|
|
11190
11293
|
* Represents the user balance of a funding item
|
|
11191
|
-
* @property {BigNumber} balance
|
|
11192
|
-
* @property {string} formattedBalance
|
|
11294
|
+
* @property {BigNumber} balance
|
|
11295
|
+
* @property {string} formattedBalance
|
|
11193
11296
|
*/
|
|
11194
11297
|
type UserBalance = {
|
|
11298
|
+
/** The balance of the funding item */
|
|
11195
11299
|
balance: BigNumber;
|
|
11300
|
+
/** The formatted balance of the funding item */
|
|
11196
11301
|
formattedBalance: string;
|
|
11197
11302
|
};
|
|
11198
11303
|
/**
|
|
11199
11304
|
* Represents the transaction requirement for a transaction.
|
|
11200
|
-
* @property {ItemType} type
|
|
11201
|
-
* @property {boolean} sufficient
|
|
11202
|
-
* @property {ItemBalance} required
|
|
11203
|
-
* @property {ItemBalance} current
|
|
11204
|
-
* @property {BalanceDelta} delta
|
|
11305
|
+
* @property {ItemType} type
|
|
11306
|
+
* @property {boolean} sufficient
|
|
11307
|
+
* @property {ItemBalance} required
|
|
11308
|
+
* @property {ItemBalance} current
|
|
11309
|
+
* @property {BalanceDelta} delta
|
|
11205
11310
|
*/
|
|
11206
11311
|
type TransactionRequirement = {
|
|
11312
|
+
/** The type of the transaction requirement. */
|
|
11207
11313
|
type: ItemType;
|
|
11314
|
+
/** If the user address has sufficient funds to cover the transaction. */
|
|
11208
11315
|
sufficient: boolean;
|
|
11316
|
+
/** The required item balance. */
|
|
11209
11317
|
required: ItemBalance;
|
|
11318
|
+
/** The current item balance. */
|
|
11210
11319
|
current: ItemBalance;
|
|
11320
|
+
/** The delta between the required and current balances. */
|
|
11211
11321
|
delta: BalanceDelta;
|
|
11212
11322
|
};
|
|
11213
11323
|
/**
|
|
11214
11324
|
* Represents the balance for either a native or ERC20 token.
|
|
11215
|
-
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
11216
|
-
* @property {BigNumber} balance
|
|
11217
|
-
* @property {string}
|
|
11218
|
-
* @property {TokenInfo} token
|
|
11325
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
11326
|
+
* @property {BigNumber} balance
|
|
11327
|
+
* @property {string} formattedBalanc
|
|
11328
|
+
* @property {TokenInfo} token
|
|
11219
11329
|
*/
|
|
11220
11330
|
type TokenBalance = {
|
|
11331
|
+
/** Type to indicate this is a native or ERC20 token. */
|
|
11221
11332
|
type: ItemType.NATIVE | ItemType.ERC20;
|
|
11333
|
+
/** The balance of the item. */
|
|
11222
11334
|
balance: BigNumber;
|
|
11335
|
+
/** The formatted balance of the item. */
|
|
11223
11336
|
formattedBalance: string;
|
|
11337
|
+
/** The token info of the item. */
|
|
11224
11338
|
token: TokenInfo;
|
|
11225
11339
|
};
|
|
11226
11340
|
/**
|
|
11227
11341
|
* Represents the balance for an ERC721.
|
|
11228
|
-
* @property {ItemType.ERC721} type
|
|
11229
|
-
* @property {BigNumber} balance
|
|
11230
|
-
* @property {string} formattedBalance
|
|
11231
|
-
* @property {string} contractAddress
|
|
11232
|
-
* @property {string} id
|
|
11342
|
+
* @property {ItemType.ERC721} type
|
|
11343
|
+
* @property {BigNumber} balance
|
|
11344
|
+
* @property {string} formattedBalance
|
|
11345
|
+
* @property {string} contractAddress
|
|
11346
|
+
* @property {string} id
|
|
11233
11347
|
*/
|
|
11234
11348
|
type ERC721Balance = {
|
|
11349
|
+
/** Type to indicate this is an ERC721 token. */
|
|
11235
11350
|
type: ItemType.ERC721;
|
|
11351
|
+
/** The balance of the item. */
|
|
11236
11352
|
balance: BigNumber;
|
|
11353
|
+
/** The formatted balance of the item. */
|
|
11237
11354
|
formattedBalance: string;
|
|
11355
|
+
/** The contract address of the ERC721 collection. */
|
|
11238
11356
|
contractAddress: string;
|
|
11357
|
+
/** The ID of the ERC721 in the collection */
|
|
11239
11358
|
id: string;
|
|
11240
11359
|
};
|
|
11241
11360
|
/**
|
|
@@ -11244,23 +11363,28 @@ type ERC721Balance = {
|
|
|
11244
11363
|
type ItemBalance = ERC721Balance | TokenBalance;
|
|
11245
11364
|
/**
|
|
11246
11365
|
* Represents the delta between two balances.
|
|
11247
|
-
* @property {BigNumber} balance
|
|
11248
|
-
* @property {string} formattedBalance
|
|
11366
|
+
* @property {BigNumber} balance
|
|
11367
|
+
* @property {string} formattedBalance
|
|
11249
11368
|
*/
|
|
11250
11369
|
type BalanceDelta = {
|
|
11370
|
+
/** The delta of the balance. */
|
|
11251
11371
|
balance: BigNumber;
|
|
11372
|
+
/** The formatted balance of the delta. */
|
|
11252
11373
|
formattedBalance: string;
|
|
11253
11374
|
};
|
|
11254
11375
|
/**
|
|
11255
11376
|
* A type representing the Smart Checkout routing options available for a user
|
|
11256
11377
|
* if they are configured and enabled (not geo-blocked etc.)
|
|
11257
|
-
* @property {boolean | undefined} onRamp
|
|
11258
|
-
* @property {boolean | undefined} swap
|
|
11259
|
-
* @property {boolean | undefined} bridge
|
|
11378
|
+
* @property {boolean | undefined} onRamp
|
|
11379
|
+
* @property {boolean | undefined} swap
|
|
11380
|
+
* @property {boolean | undefined} bridge
|
|
11260
11381
|
*/
|
|
11261
11382
|
type AvailableRoutingOptions = {
|
|
11383
|
+
/** If the user can use onramp */
|
|
11262
11384
|
onRamp?: boolean;
|
|
11385
|
+
/** If the user can use swap */
|
|
11263
11386
|
swap?: boolean;
|
|
11387
|
+
/** If the user can use bridge */
|
|
11264
11388
|
bridge?: boolean;
|
|
11265
11389
|
};
|
|
11266
11390
|
|
|
@@ -11363,69 +11487,88 @@ interface CheckoutModuleConfiguration extends ModuleConfiguration<CheckoutOverri
|
|
|
11363
11487
|
/**
|
|
11364
11488
|
* A type representing various remotely defined configurations which are
|
|
11365
11489
|
* accessible via the Checkout config and configured based on the Environment.
|
|
11366
|
-
* @property {DexConfig} dex
|
|
11367
|
-
* @property {OnRampConfig} onramp
|
|
11368
|
-
* @property {
|
|
11369
|
-
* @property {
|
|
11490
|
+
* @property {DexConfig} dex
|
|
11491
|
+
* @property {OnRampConfig} onramp
|
|
11492
|
+
* @property {BridgeConfig} bridge
|
|
11493
|
+
* @property {AllowedNetworkConfig[]} allowedNetworks
|
|
11494
|
+
* @property {GasEstimateTokenConfig | undefined} gasEstimateTokens
|
|
11495
|
+
* @property {ImxAddressConfig | undefined} imxAddressMapping
|
|
11370
11496
|
*/
|
|
11371
11497
|
type RemoteConfiguration = {
|
|
11498
|
+
/** The config used for the DEX. */
|
|
11372
11499
|
dex: DexConfig;
|
|
11500
|
+
/** The config used for the OnRamp */
|
|
11373
11501
|
onramp: OnRampConfig;
|
|
11502
|
+
/** The config used for the Bridge. */
|
|
11374
11503
|
bridge: BridgeConfig;
|
|
11504
|
+
/** An array representing the allowed networks. */
|
|
11375
11505
|
allowedNetworks: AllowedNetworkConfig[];
|
|
11506
|
+
/** The config for the tokens used to estimate gas. */
|
|
11376
11507
|
gasEstimateTokens?: GasEstimateTokenConfig;
|
|
11508
|
+
/** The IMX address mappings across available networks. */
|
|
11377
11509
|
imxAddressMapping?: ImxAddressConfig;
|
|
11378
11510
|
};
|
|
11379
11511
|
/**
|
|
11380
11512
|
* A type representing the fee structure for an OnRamp provider
|
|
11381
|
-
* @property {string | undefined} minPercentage
|
|
11382
|
-
* @property {string | undefined} maxPercentage
|
|
11383
|
-
* @property {string | undefined} feePercentage
|
|
11513
|
+
* @property {string | undefined} minPercentage
|
|
11514
|
+
* @property {string | undefined} maxPercentage
|
|
11515
|
+
* @property {string | undefined} feePercentage
|
|
11384
11516
|
*/
|
|
11385
11517
|
type OnRampProviderFees = {
|
|
11518
|
+
/** The minimum percentage fee shown if a fee range is provided */
|
|
11386
11519
|
minPercentage?: string;
|
|
11520
|
+
/** The maximum percentage fee shown if a fee range is provided */
|
|
11387
11521
|
maxPercentage?: string;
|
|
11522
|
+
/** The specific fee percentage shown if there is no range provided */
|
|
11388
11523
|
feePercentage?: string;
|
|
11389
11524
|
};
|
|
11390
11525
|
/**
|
|
11391
11526
|
* A type representing the configuration for the OnRamp for a specific provider.
|
|
11392
|
-
* @property {string} publishableApiKey
|
|
11393
|
-
* @property {TokenInfo[]} tokens
|
|
11394
|
-
* @property {OnRampProviderFees} fees
|
|
11527
|
+
* @property {string} publishableApiKey
|
|
11528
|
+
* @property {TokenInfo[]} tokens
|
|
11529
|
+
* @property {OnRampProviderFees} fees
|
|
11395
11530
|
*/
|
|
11396
11531
|
type OnRampProviderConfig = {
|
|
11532
|
+
/** The on ramp provider publishable api-key */
|
|
11397
11533
|
publishableApiKey: string;
|
|
11534
|
+
/** The allowed tokens for the OnRamp provider */
|
|
11398
11535
|
tokens: TokenInfo[];
|
|
11536
|
+
/** The on ramp provider transaction fees */
|
|
11399
11537
|
fees: OnRampProviderFees;
|
|
11400
11538
|
};
|
|
11401
11539
|
/**
|
|
11402
11540
|
* A type representing the configuration for the OnRamp.
|
|
11403
|
-
* @property {OnRampProviderConfig} transak
|
|
11541
|
+
* @property {OnRampProviderConfig} transak
|
|
11404
11542
|
*/
|
|
11405
11543
|
type OnRampConfig = {
|
|
11544
|
+
/** OnRamp config for Transak provider */
|
|
11406
11545
|
[key: string]: OnRampProviderConfig;
|
|
11407
11546
|
};
|
|
11408
11547
|
/**
|
|
11409
11548
|
* A type representing the configuration for the DEX.
|
|
11410
|
-
* @property {ExchangeOverrides | undefined} overrides
|
|
11411
|
-
* @property {TokenInfo[] | undefined} tokens
|
|
11549
|
+
* @property {ExchangeOverrides | undefined} overrides
|
|
11550
|
+
* @property {TokenInfo[] | undefined} tokens
|
|
11412
11551
|
*/
|
|
11413
11552
|
type DexConfig = {
|
|
11553
|
+
/** The DEX overrides. */
|
|
11414
11554
|
overrides?: ExchangeOverrides;
|
|
11555
|
+
/** An array of tokens compatible with the DEX. */
|
|
11415
11556
|
tokens?: TokenInfo[];
|
|
11416
11557
|
};
|
|
11417
11558
|
/**
|
|
11418
11559
|
* A type representing the configuration for the Bridge.
|
|
11419
|
-
* @property {TokenInfo[] | undefined} tokens
|
|
11560
|
+
* @property {TokenInfo[] | undefined} tokens
|
|
11420
11561
|
*/
|
|
11421
11562
|
type BridgeConfig = {
|
|
11563
|
+
/** An array of tokens compatible with the Bridge. */
|
|
11422
11564
|
tokens?: TokenInfo[];
|
|
11423
11565
|
};
|
|
11424
11566
|
/**
|
|
11425
11567
|
* A type representing an allowed network.
|
|
11426
|
-
* @property {number} chainId
|
|
11568
|
+
* @property {number} chainId
|
|
11427
11569
|
*/
|
|
11428
11570
|
type AllowedNetworkConfig = {
|
|
11571
|
+
/** The network chain id. */
|
|
11429
11572
|
chainId: number;
|
|
11430
11573
|
};
|
|
11431
11574
|
/**
|
|
@@ -11440,40 +11583,47 @@ type ImxAddressConfig = {
|
|
|
11440
11583
|
* @type {{ [key: string]: { bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig, swapAddresses?: GasEstimateSwapTokenConfig } }}
|
|
11441
11584
|
* - A map of addresses for estimating gas keyed by the network chain id.
|
|
11442
11585
|
* @property {GasEstimateBridgeToL2TokenConfig | undefined} bridgeToL2Addresses
|
|
11443
|
-
*
|
|
11444
|
-
* @property {GasEstimateSwapTokenConfig | undefined} swapAddresses - The type representing the addresses for a swap gas estimate
|
|
11586
|
+
* @property {GasEstimateSwapTokenConfig | undefined} swapAddresses
|
|
11445
11587
|
*/
|
|
11446
11588
|
type GasEstimateTokenConfig = {
|
|
11447
11589
|
[key: string]: {
|
|
11590
|
+
/** The type representing the addresses for a bridge to layer 2 gas estimate. */
|
|
11448
11591
|
bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig;
|
|
11592
|
+
/** The type representing the addresses for a swap gas estimate */
|
|
11449
11593
|
swapAddresses?: GasEstimateSwapTokenConfig;
|
|
11450
11594
|
};
|
|
11451
11595
|
};
|
|
11452
11596
|
/**
|
|
11453
11597
|
* A type representing the config for a bridge to layer 2 gas estimate.
|
|
11454
|
-
* @property {string | 'NATIVE'} gasTokenAddress
|
|
11455
|
-
* @property {string} fromAddress
|
|
11598
|
+
* @property {string | 'NATIVE'} gasTokenAddress
|
|
11599
|
+
* @property {string} fromAddress
|
|
11456
11600
|
*/
|
|
11457
11601
|
type GasEstimateBridgeToL2TokenConfig = {
|
|
11602
|
+
/** The address of the gas token. */
|
|
11458
11603
|
gasTokenAddress: string | 'NATIVE';
|
|
11604
|
+
/** The address of the token being bridged. */
|
|
11459
11605
|
fromAddress: string;
|
|
11460
11606
|
};
|
|
11461
11607
|
/**
|
|
11462
11608
|
* A type representing the config for a swap gas estimate.
|
|
11463
|
-
* @property {string} inAddress
|
|
11464
|
-
* @property {string} outAddress
|
|
11609
|
+
* @property {string} inAddress
|
|
11610
|
+
* @property {string} outAddress
|
|
11465
11611
|
*/
|
|
11466
11612
|
type GasEstimateSwapTokenConfig = {
|
|
11613
|
+
/** The in token address. */
|
|
11467
11614
|
inAddress: string;
|
|
11615
|
+
/** The out token address. */
|
|
11468
11616
|
outAddress: string;
|
|
11469
11617
|
};
|
|
11470
11618
|
/**
|
|
11471
11619
|
* A type representing all the feature flags available.
|
|
11472
|
-
* @property {TokenInfo[] | undefined} allowed -
|
|
11473
|
-
* @property {boolean | undefined} blockscout -
|
|
11620
|
+
* @property {TokenInfo[] | undefined} allowed -
|
|
11621
|
+
* @property {boolean | undefined} blockscout -
|
|
11474
11622
|
*/
|
|
11475
11623
|
type ChainTokensConfig = {
|
|
11624
|
+
/** List of allowed tokens for a given chain. */
|
|
11476
11625
|
allowed?: TokenInfo[];
|
|
11626
|
+
/** Feature flag to enable/disable blockscout integration. */
|
|
11477
11627
|
blockscout?: boolean;
|
|
11478
11628
|
};
|
|
11479
11629
|
|
|
@@ -11888,10 +12038,11 @@ declare enum WidgetTheme {
|
|
|
11888
12038
|
}
|
|
11889
12039
|
|
|
11890
12040
|
/**
|
|
11891
|
-
*
|
|
11892
|
-
* @property {WidgetTheme | undefined} theme
|
|
12041
|
+
* Widget Configuration represents the shared configuration options for the Checkout Widgets.
|
|
12042
|
+
* @property {WidgetTheme | undefined} theme
|
|
11893
12043
|
*/
|
|
11894
12044
|
type WidgetConfiguration = {
|
|
12045
|
+
/** The theme of the Checkout Widget (default: "DARK") */
|
|
11895
12046
|
theme?: WidgetTheme;
|
|
11896
12047
|
};
|
|
11897
12048
|
|
|
@@ -11930,18 +12081,21 @@ declare enum ConnectEventType {
|
|
|
11930
12081
|
}
|
|
11931
12082
|
/**
|
|
11932
12083
|
* Represents a successful connection.
|
|
11933
|
-
* @property {Web3Provider} provider
|
|
11934
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
12084
|
+
* @property {Web3Provider} provider
|
|
12085
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
11935
12086
|
*/
|
|
11936
12087
|
type ConnectionSuccess = {
|
|
12088
|
+
/** The connected provider. */
|
|
11937
12089
|
provider: Web3Provider;
|
|
12090
|
+
/** The wallet provider name of the connected provider. */
|
|
11938
12091
|
walletProviderName: WalletProviderName | undefined;
|
|
11939
12092
|
};
|
|
11940
12093
|
/**
|
|
11941
12094
|
* Represents a connection failure with a reason.
|
|
11942
|
-
* @property {string} reason
|
|
12095
|
+
* @property {string} reason
|
|
11943
12096
|
*/
|
|
11944
12097
|
type ConnectionFailed = {
|
|
12098
|
+
/** The reason for the failed connection. */
|
|
11945
12099
|
reason: string;
|
|
11946
12100
|
};
|
|
11947
12101
|
|
|
@@ -11955,13 +12109,16 @@ declare enum WalletEventType {
|
|
|
11955
12109
|
}
|
|
11956
12110
|
/**
|
|
11957
12111
|
* Represents an event that is triggered when the user switches the network in their wallet.
|
|
11958
|
-
* @property {string} network
|
|
11959
|
-
* @property {number} chainId
|
|
11960
|
-
* @property {Web3Provider} provider
|
|
12112
|
+
* @property {string} network
|
|
12113
|
+
* @property {number} chainId
|
|
12114
|
+
* @property {Web3Provider} provider
|
|
11961
12115
|
*/
|
|
11962
12116
|
type WalletNetworkSwitch = {
|
|
12117
|
+
/** The name of the network that the user switched to. */
|
|
11963
12118
|
network: string;
|
|
12119
|
+
/** The chain ID of the network that the user switched to. */
|
|
11964
12120
|
chainId: number;
|
|
12121
|
+
/** The Web3 provider object for the switched network. */
|
|
11965
12122
|
provider: Web3Provider;
|
|
11966
12123
|
};
|
|
11967
12124
|
/**
|
|
@@ -11980,27 +12137,32 @@ declare enum SwapEventType {
|
|
|
11980
12137
|
}
|
|
11981
12138
|
/**
|
|
11982
12139
|
* Represents a successful swap transaction.
|
|
11983
|
-
* @property {string} transactionHash
|
|
12140
|
+
* @property {string} transactionHash
|
|
11984
12141
|
*/
|
|
11985
12142
|
type SwapSuccess = {
|
|
12143
|
+
/** The hash of the successful transaction. */
|
|
11986
12144
|
transactionHash: string;
|
|
11987
12145
|
};
|
|
11988
12146
|
/**
|
|
11989
12147
|
* Type representing a Swap Widget with type FAILURE.
|
|
11990
|
-
* @property {string} reason
|
|
11991
|
-
* @property {number} timestamp
|
|
12148
|
+
* @property {string} reason
|
|
12149
|
+
* @property {number} timestamp
|
|
11992
12150
|
*/
|
|
11993
12151
|
type SwapFailed = {
|
|
12152
|
+
/** The reason why the swap failed. */
|
|
11994
12153
|
reason: string;
|
|
12154
|
+
/** The timestamp of the failed swap. */
|
|
11995
12155
|
timestamp: number;
|
|
11996
12156
|
};
|
|
11997
12157
|
/**
|
|
11998
12158
|
* Type representing a Swap Widget with type REJECTED.
|
|
11999
|
-
* @property {string} reason -
|
|
12000
|
-
* @property {number} timestamp -
|
|
12159
|
+
* @property {string} reason -
|
|
12160
|
+
* @property {number} timestamp -
|
|
12001
12161
|
*/
|
|
12002
12162
|
type SwapRejected = {
|
|
12163
|
+
/** The reason why the swap failed. */
|
|
12003
12164
|
reason: string;
|
|
12165
|
+
/** The timestamp of the failed swap. */
|
|
12004
12166
|
timestamp: number;
|
|
12005
12167
|
};
|
|
12006
12168
|
|
|
@@ -12016,9 +12178,10 @@ declare enum SaleEventType {
|
|
|
12016
12178
|
}
|
|
12017
12179
|
/**
|
|
12018
12180
|
* Represents a successful Sale transaction.
|
|
12019
|
-
* @property {Array} transactions -
|
|
12181
|
+
* @property {Array} transactions -
|
|
12020
12182
|
*/
|
|
12021
12183
|
type SaleSuccess = {
|
|
12184
|
+
/** The executed transactions */
|
|
12022
12185
|
transactions: {
|
|
12023
12186
|
method: string;
|
|
12024
12187
|
hash: string | undefined;
|
|
@@ -12027,13 +12190,16 @@ type SaleSuccess = {
|
|
|
12027
12190
|
};
|
|
12028
12191
|
/**
|
|
12029
12192
|
* Type representing a Sale Widget with type FAILURE.
|
|
12030
|
-
* @property {string} reason
|
|
12031
|
-
* @property {number} timestamp
|
|
12032
|
-
* @property {Array} transactions
|
|
12193
|
+
* @property {string} reason
|
|
12194
|
+
* @property {number} timestamp
|
|
12195
|
+
* @property {Array} transactions
|
|
12033
12196
|
*/
|
|
12034
12197
|
type SaleFailed = {
|
|
12198
|
+
/** The reason why the swap failed. */
|
|
12035
12199
|
reason: string;
|
|
12200
|
+
/** The timestamp of the failed swap. */
|
|
12036
12201
|
timestamp: number;
|
|
12202
|
+
/** The executed transactions */
|
|
12037
12203
|
transactions: {
|
|
12038
12204
|
method: string;
|
|
12039
12205
|
hash: string | undefined;
|
|
@@ -12041,9 +12207,10 @@ type SaleFailed = {
|
|
|
12041
12207
|
};
|
|
12042
12208
|
/**
|
|
12043
12209
|
* Type representing a Sale Widget with type TRANSACTION_SUCCESS.
|
|
12044
|
-
* @property {Object} transactions
|
|
12210
|
+
* @property {Object} transactions
|
|
12045
12211
|
*/
|
|
12046
12212
|
type SaleTransactionSuccess = {
|
|
12213
|
+
/** The executed transactions */
|
|
12047
12214
|
transactions: {
|
|
12048
12215
|
method: string;
|
|
12049
12216
|
hash: string | undefined;
|
|
@@ -12060,18 +12227,21 @@ declare enum BridgeEventType {
|
|
|
12060
12227
|
}
|
|
12061
12228
|
/**
|
|
12062
12229
|
* Represents a successful bridge transaction.
|
|
12063
|
-
* @property {string} transactionHash
|
|
12230
|
+
* @property {string} transactionHash
|
|
12064
12231
|
*/
|
|
12065
12232
|
type BridgeSuccess = {
|
|
12233
|
+
/** The hash of the successful transaction. */
|
|
12066
12234
|
transactionHash: string;
|
|
12067
12235
|
};
|
|
12068
12236
|
/**
|
|
12069
12237
|
* Represents a failed bridge transaction.
|
|
12070
|
-
* @property {string} reason
|
|
12071
|
-
* @property {number} timestamp
|
|
12238
|
+
* @property {string} reason
|
|
12239
|
+
* @property {number} timestamp
|
|
12072
12240
|
*/
|
|
12073
12241
|
type BridgeFailed = {
|
|
12242
|
+
/** The reason for the failed transaction. */
|
|
12074
12243
|
reason: string;
|
|
12244
|
+
/** The timestamp of the failed transaction. */
|
|
12075
12245
|
timestamp: number;
|
|
12076
12246
|
};
|
|
12077
12247
|
|
|
@@ -12087,45 +12257,54 @@ declare enum OrchestrationEventType {
|
|
|
12087
12257
|
}
|
|
12088
12258
|
/**
|
|
12089
12259
|
* Represents the connect event object when the connect widget is requested.
|
|
12090
|
-
* @property {string} walletProviderName
|
|
12260
|
+
* @property {string} walletProviderName
|
|
12091
12261
|
*/
|
|
12092
12262
|
type RequestConnectEvent = {
|
|
12263
|
+
/** The wallet provider name. */
|
|
12093
12264
|
walletProviderName: string;
|
|
12094
12265
|
};
|
|
12095
12266
|
/**
|
|
12096
12267
|
* Represents the wallet event object when the wallet widget is requested.
|
|
12097
|
-
* @property {string} walletProviderName
|
|
12268
|
+
* @property {string} walletProviderName
|
|
12098
12269
|
*/
|
|
12099
12270
|
type RequestWalletEvent = {
|
|
12271
|
+
/** The wallet provider name. */
|
|
12100
12272
|
walletProviderName: string;
|
|
12101
12273
|
};
|
|
12102
12274
|
/**
|
|
12103
12275
|
* Represents the swap event object when the swap widget is requested.
|
|
12104
|
-
* @property {string} fromTokenAddress
|
|
12105
|
-
* @property {string} toTokenAddress
|
|
12106
|
-
* @property {string} amount
|
|
12276
|
+
* @property {string} fromTokenAddress
|
|
12277
|
+
* @property {string} toTokenAddress
|
|
12278
|
+
* @property {string} amount
|
|
12107
12279
|
*/
|
|
12108
12280
|
type RequestSwapEvent = {
|
|
12281
|
+
/** The address of the token to swap from. */
|
|
12109
12282
|
fromTokenAddress: string;
|
|
12283
|
+
/** The address of the token to swap to. */
|
|
12110
12284
|
toTokenAddress: string;
|
|
12285
|
+
/** The amount of from tokens to swap. */
|
|
12111
12286
|
amount: string;
|
|
12112
12287
|
};
|
|
12113
12288
|
/**
|
|
12114
12289
|
* Represents the bridge event object when the bridge widget is requested.
|
|
12115
|
-
* @property {string} tokenAddress
|
|
12116
|
-
* @property {string} amount
|
|
12290
|
+
* @property {string} tokenAddress
|
|
12291
|
+
* @property {string} amount
|
|
12117
12292
|
*/
|
|
12118
12293
|
type RequestBridgeEvent = {
|
|
12294
|
+
/** The address of the token to bridge. */
|
|
12119
12295
|
tokenAddress: string;
|
|
12296
|
+
/** The amount of tokens to bridge. */
|
|
12120
12297
|
amount: string;
|
|
12121
12298
|
};
|
|
12122
12299
|
/**
|
|
12123
12300
|
* Represents the onramp event object when the onramp widget is requested.
|
|
12124
|
-
* @property {string} tokenAddress
|
|
12125
|
-
* @property {string} amount
|
|
12301
|
+
* @property {string} tokenAddress
|
|
12302
|
+
* @property {string} amount
|
|
12126
12303
|
*/
|
|
12127
12304
|
type RequestOnrampEvent = {
|
|
12305
|
+
/** The address of the token to be used for onramp. */
|
|
12128
12306
|
tokenAddress: string;
|
|
12307
|
+
/** The amount of tokens to onramp. */
|
|
12129
12308
|
amount: string;
|
|
12130
12309
|
};
|
|
12131
12310
|
type OrchestrationEventData = RequestConnectEvent | RequestWalletEvent | RequestSwapEvent | RequestBridgeEvent | RequestOnrampEvent;
|
|
@@ -12140,18 +12319,21 @@ declare enum OnRampEventType {
|
|
|
12140
12319
|
}
|
|
12141
12320
|
/**
|
|
12142
12321
|
* Represents a successful on-ramp transaction.
|
|
12143
|
-
* @property {string} transactionHash
|
|
12322
|
+
* @property {string} transactionHash
|
|
12144
12323
|
*/
|
|
12145
12324
|
type OnRampSuccess = {
|
|
12325
|
+
/** The transaction hash of the successful transaction. */
|
|
12146
12326
|
transactionHash: string;
|
|
12147
12327
|
};
|
|
12148
12328
|
/**
|
|
12149
12329
|
* Type representing a On-ramp Widget with type FAILURE.
|
|
12150
|
-
* @property {string} reason
|
|
12151
|
-
* @property {number} timestamp
|
|
12330
|
+
* @property {string} reason
|
|
12331
|
+
* @property {number} timestamp
|
|
12152
12332
|
*/
|
|
12153
12333
|
type OnRampFailed = {
|
|
12334
|
+
/** The reason why the on-ramp failed. */
|
|
12154
12335
|
reason: string;
|
|
12336
|
+
/** The timestamp of the failed transaction. */
|
|
12155
12337
|
timestamp: number;
|
|
12156
12338
|
};
|
|
12157
12339
|
|
|
@@ -12163,82 +12345,128 @@ type ConnectWidgetParams = {};
|
|
|
12163
12345
|
|
|
12164
12346
|
/**
|
|
12165
12347
|
* Bridge Widget parameters
|
|
12166
|
-
* @property {string | undefined} fromContractAddress
|
|
12167
|
-
* @property {string | undefined} amount
|
|
12168
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
12348
|
+
* @property {string | undefined} fromContractAddress
|
|
12349
|
+
* @property {string | undefined} amount
|
|
12350
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
12169
12351
|
*/
|
|
12170
12352
|
type BridgeWidgetParams = {
|
|
12353
|
+
/** The contract address of the token to bridge from, used to populate the bridge form token field */
|
|
12171
12354
|
fromContractAddress?: string;
|
|
12355
|
+
/** The formatted amount to bridge, used to populate the bridge form amount field */
|
|
12172
12356
|
amount?: string;
|
|
12357
|
+
/** The wallet provider name to use for the bridge widget */
|
|
12173
12358
|
walletProviderName?: WalletProviderName;
|
|
12174
12359
|
};
|
|
12175
12360
|
|
|
12176
12361
|
/**
|
|
12177
12362
|
* Wallet Widget parameters
|
|
12178
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
12179
|
-
* @property {Web3Provider | undefined} web3Provider - The ethers Web3Provider
|
|
12363
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
12180
12364
|
*/
|
|
12181
12365
|
type WalletWidgetParams = {
|
|
12366
|
+
/** The wallet provider name to use for the wallet widget */
|
|
12182
12367
|
walletProviderName?: WalletProviderName;
|
|
12183
12368
|
};
|
|
12184
12369
|
|
|
12185
12370
|
/**
|
|
12186
12371
|
* Swap Widget parameters
|
|
12187
|
-
* @property {string | undefined} amount
|
|
12188
|
-
* @property {string | undefined} fromContractAddress
|
|
12189
|
-
* @property {string | undefined} toContractAddress
|
|
12190
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
12372
|
+
* @property {string | undefined} amount
|
|
12373
|
+
* @property {string | undefined} fromContractAddress
|
|
12374
|
+
* @property {string | undefined} toContractAddress
|
|
12375
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
12191
12376
|
*/
|
|
12192
|
-
|
|
12377
|
+
type SwapWidgetParams = {
|
|
12378
|
+
/** The formatted amount to swap, used to populate the swap from amount field */
|
|
12193
12379
|
amount?: string;
|
|
12380
|
+
/** The contract address of the token to swap from */
|
|
12194
12381
|
fromContractAddress?: string;
|
|
12382
|
+
/** The contract address of the token to swap to */
|
|
12195
12383
|
toContractAddress?: string;
|
|
12384
|
+
/** The wallet provider name to use for the swap widget */
|
|
12196
12385
|
walletProviderName?: WalletProviderName;
|
|
12197
|
-
}
|
|
12386
|
+
};
|
|
12198
12387
|
|
|
12199
12388
|
/**
|
|
12200
12389
|
* OnRamp Widget parameters
|
|
12201
|
-
* @property {string | undefined} contractAddress
|
|
12202
|
-
* @property {string | undefined} amount
|
|
12203
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
12390
|
+
* @property {string | undefined} contractAddress
|
|
12391
|
+
* @property {string | undefined} amount
|
|
12392
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
12204
12393
|
*/
|
|
12205
12394
|
type OnRampWidgetParams = {
|
|
12395
|
+
/** The contract address of the token to onramp */
|
|
12206
12396
|
contractAddress?: string;
|
|
12397
|
+
/** The formatted amount to onramp, used to populate the onramp form amount field */
|
|
12207
12398
|
amount?: string;
|
|
12399
|
+
/** The wallet provider name to use for the onramp widget */
|
|
12208
12400
|
walletProviderName?: WalletProviderName;
|
|
12209
12401
|
};
|
|
12210
12402
|
|
|
12211
12403
|
/**
|
|
12212
12404
|
* Sale Widget parameters
|
|
12213
|
-
* @property {string} amount
|
|
12214
|
-
* @property {
|
|
12215
|
-
* @property {
|
|
12405
|
+
* @property {string} amount
|
|
12406
|
+
* @property {string} environmentId
|
|
12407
|
+
* @property {string} fromContractAddress
|
|
12408
|
+
* @property {SaleItem[]} items
|
|
12409
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
12216
12410
|
*/
|
|
12217
12411
|
type SaleWidgetParams = {
|
|
12412
|
+
/** The total price to pay for the items in the sale */
|
|
12218
12413
|
amount?: string;
|
|
12219
12414
|
environmentId?: string;
|
|
12220
12415
|
fromContractAddress?: string;
|
|
12416
|
+
/** The list of products to be purchased */
|
|
12221
12417
|
items?: SaleItem[];
|
|
12418
|
+
/** The wallet provider name to default to if no web3Provider is passed */
|
|
12222
12419
|
walletProviderName?: WalletProviderName;
|
|
12223
12420
|
};
|
|
12421
|
+
/**
|
|
12422
|
+
* A product to be purchased
|
|
12423
|
+
* @property {string} productId
|
|
12424
|
+
* @property {number} qty
|
|
12425
|
+
* @property {string} name
|
|
12426
|
+
* @property {string} image
|
|
12427
|
+
* @property {string} description
|
|
12428
|
+
*/
|
|
12224
12429
|
type SaleItem = {
|
|
12430
|
+
/** The id of the product */
|
|
12225
12431
|
productId: string;
|
|
12432
|
+
/** The quantity to be purchased */
|
|
12226
12433
|
qty: number;
|
|
12434
|
+
/** The name of the item */
|
|
12227
12435
|
name: string;
|
|
12436
|
+
/** The image url of the item */
|
|
12228
12437
|
image: string;
|
|
12438
|
+
/** The description of the item */
|
|
12229
12439
|
description: string;
|
|
12230
12440
|
};
|
|
12231
12441
|
|
|
12442
|
+
/**
|
|
12443
|
+
* Connect Widget Configuration represents the configuration options for the Connect Widget.
|
|
12444
|
+
*/
|
|
12232
12445
|
type ConnectWidgetConfiguration = {} & WidgetConfiguration;
|
|
12233
12446
|
|
|
12447
|
+
/**
|
|
12448
|
+
* Bridge Widget Configuration represents the configuration options for the Bridge Widget.
|
|
12449
|
+
*/
|
|
12234
12450
|
type BridgeWidgetConfiguration = {} & WidgetConfiguration;
|
|
12235
12451
|
|
|
12452
|
+
/**
|
|
12453
|
+
* Wallet Widget Configuration represents the configuration options for the Wallet Widget.
|
|
12454
|
+
*/
|
|
12236
12455
|
type WalletWidgetConfiguration = {} & WidgetConfiguration;
|
|
12237
12456
|
|
|
12457
|
+
/**
|
|
12458
|
+
* Swap Widget Configuration represents the configuration options for the Swap Widget.
|
|
12459
|
+
*/
|
|
12238
12460
|
type SwapWidgetConfiguration = {} & WidgetConfiguration;
|
|
12239
12461
|
|
|
12462
|
+
/**
|
|
12463
|
+
* Onramp Widget Configuration represents the configuration options for the Onramp Widget.
|
|
12464
|
+
*/
|
|
12240
12465
|
type OnrampWidgetConfiguration = {} & WidgetConfiguration;
|
|
12241
12466
|
|
|
12467
|
+
/**
|
|
12468
|
+
* Sale Widget Configuration represents the configuration options for the Sale Widget.
|
|
12469
|
+
*/
|
|
12242
12470
|
type SaleWidgetConfiguration = {} & WidgetConfiguration;
|
|
12243
12471
|
|
|
12244
12472
|
/**
|
|
@@ -12353,21 +12581,25 @@ type WidgetEvent<T extends WidgetType, KEventName extends keyof WidgetEventData[
|
|
|
12353
12581
|
/**
|
|
12354
12582
|
* Represents an event emitted by a widget.
|
|
12355
12583
|
* @template KEventName - The orchestration event name.
|
|
12356
|
-
* @property {KEventName} type
|
|
12357
|
-
* @property {OrchestrationMapping[KEventName]} data
|
|
12584
|
+
* @property {KEventName} type
|
|
12585
|
+
* @property {OrchestrationMapping[KEventName]} data
|
|
12358
12586
|
*/
|
|
12359
12587
|
type OrchestrationEvent<KEventName extends keyof OrchestrationMapping> = {
|
|
12588
|
+
/** The type of the event. */
|
|
12360
12589
|
type: KEventName;
|
|
12590
|
+
/** The data associated with the event. */
|
|
12361
12591
|
data: OrchestrationMapping[KEventName];
|
|
12362
12592
|
};
|
|
12363
12593
|
/**
|
|
12364
12594
|
* Represents an event emitted by a widget.
|
|
12365
12595
|
* @template KEventName - The provider event name.
|
|
12366
|
-
* @property {KEventName} type
|
|
12367
|
-
* @property {ProviderEventMapping[KEventName]} data
|
|
12596
|
+
* @property {KEventName} type
|
|
12597
|
+
* @property {ProviderEventMapping[KEventName]} data
|
|
12368
12598
|
*/
|
|
12369
12599
|
type ProviderEvent<KEventName extends keyof ProviderEventMapping> = {
|
|
12600
|
+
/** The type of the event. */
|
|
12370
12601
|
type: KEventName;
|
|
12602
|
+
/** The data associated with the event. */
|
|
12371
12603
|
data: ProviderEventMapping[KEventName];
|
|
12372
12604
|
};
|
|
12373
12605
|
interface IWidgetsFactory {
|
|
@@ -12379,7 +12611,7 @@ interface IWidgetsFactory {
|
|
|
12379
12611
|
create<T extends WidgetType>(type: T, props?: WidgetProperties<T>): Widget<T>;
|
|
12380
12612
|
/**
|
|
12381
12613
|
* Update the widgets provider instance.
|
|
12382
|
-
* @param provider provider
|
|
12614
|
+
* @param provider the provider instance to update all widgets.
|
|
12383
12615
|
*/
|
|
12384
12616
|
updateProvider(provider: Web3Provider): void;
|
|
12385
12617
|
}
|
|
@@ -12416,11 +12648,11 @@ interface Widget<T extends WidgetType> {
|
|
|
12416
12648
|
}
|
|
12417
12649
|
/**
|
|
12418
12650
|
* Represents the version of the Checkout Widgets to use defaults to (0.1.9-alpha)
|
|
12419
|
-
* @property {number} major
|
|
12420
|
-
* @property {number | undefined} minor
|
|
12421
|
-
* @property {number | undefined} patch
|
|
12422
|
-
* @property {'alpha' | undefined} prerelease
|
|
12423
|
-
* @property {number | undefined} build
|
|
12651
|
+
* @property {number} major
|
|
12652
|
+
* @property {number | undefined} minor
|
|
12653
|
+
* @property {number | undefined} patch
|
|
12654
|
+
* @property {'alpha' | undefined} prerelease
|
|
12655
|
+
* @property {number | undefined} build
|
|
12424
12656
|
*
|
|
12425
12657
|
* @example
|
|
12426
12658
|
* { major: 0 } - use default version 0.1.9-alpha
|
|
@@ -12429,27 +12661,38 @@ interface Widget<T extends WidgetType> {
|
|
|
12429
12661
|
* { major: 1, minor: 2, patch: 3 } - use version 1.2.3 specifically
|
|
12430
12662
|
*/
|
|
12431
12663
|
type SemanticVersion = {
|
|
12664
|
+
/** The major version of the widgets, must specify a major version even if it is 0. */
|
|
12432
12665
|
major: number;
|
|
12666
|
+
/** The minor version of the widgets, leaving this blank will use the latest minor based on major */
|
|
12433
12667
|
minor?: number;
|
|
12668
|
+
/** The patch version of the widgets, leaving this blank will use the latest minor based on minor */
|
|
12434
12669
|
patch?: number;
|
|
12670
|
+
/** The prerelease version of the widgets, can only be 'alpha'. Do not use in production. */
|
|
12435
12671
|
prerelease?: 'alpha';
|
|
12672
|
+
/** The build version of the widgets. Do not use in production. */
|
|
12436
12673
|
build?: number;
|
|
12437
12674
|
};
|
|
12438
12675
|
/**
|
|
12439
12676
|
* Represents the global configuration options for the Checkout Widgets.
|
|
12440
|
-
* @property {WidgetTheme | undefined} theme
|
|
12441
|
-
* @property {Environment | undefined} environment
|
|
12442
|
-
* @property {SemanticVersion | undefined} version
|
|
12443
|
-
* @property {boolean | undefined} isOnRampEnabled
|
|
12444
|
-
* @property {boolean | undefined} isSwapEnabled
|
|
12445
|
-
* @property {boolean | undefined} isBridgeEnabled
|
|
12677
|
+
* @property {WidgetTheme | undefined} theme
|
|
12678
|
+
* @property {Environment | undefined} environment
|
|
12679
|
+
* @property {SemanticVersion | undefined} version
|
|
12680
|
+
* @property {boolean | undefined} isOnRampEnabled
|
|
12681
|
+
* @property {boolean | undefined} isSwapEnabled
|
|
12682
|
+
* @property {boolean | undefined} isBridgeEnabled
|
|
12446
12683
|
*/
|
|
12447
12684
|
type CheckoutWidgetsConfig = {
|
|
12685
|
+
/** The theme of the Checkout Widget (default: "DARK") */
|
|
12448
12686
|
theme?: WidgetTheme;
|
|
12687
|
+
/** The environment configuration (default: "SANDBOX") */
|
|
12449
12688
|
environment?: Environment;
|
|
12689
|
+
/** The version of the checkout widgets js file to use (default: "0.1.x") */
|
|
12450
12690
|
version?: SemanticVersion;
|
|
12691
|
+
/** Enable on-ramp top-up method (default: "true") */
|
|
12451
12692
|
isOnRampEnabled?: boolean;
|
|
12693
|
+
/** Enable swap top-up method (default: "true") */
|
|
12452
12694
|
isSwapEnabled?: boolean;
|
|
12695
|
+
/** Enable bridge top-up method (default: "true") */
|
|
12453
12696
|
isBridgeEnabled?: boolean;
|
|
12454
12697
|
};
|
|
12455
12698
|
|
|
@@ -12705,13 +12948,16 @@ declare enum CheckoutErrorType {
|
|
|
12705
12948
|
}
|
|
12706
12949
|
/**
|
|
12707
12950
|
* Represents an error object with a specific type, optional message, and optional data.
|
|
12708
|
-
* @property {CheckoutErrorType} type
|
|
12709
|
-
* @property {string | undefined} [message]
|
|
12710
|
-
* @property {Object.<string, string> | undefined} [data]
|
|
12951
|
+
* @property {CheckoutErrorType} type
|
|
12952
|
+
* @property {string | undefined} [message]
|
|
12953
|
+
* @property {Object.<string, string> | undefined} [data]
|
|
12711
12954
|
*/
|
|
12712
12955
|
type ErrorType = {
|
|
12956
|
+
/** The type of the error. */
|
|
12713
12957
|
type: CheckoutErrorType;
|
|
12958
|
+
/** The error message. */
|
|
12714
12959
|
message?: string;
|
|
12960
|
+
/** Additional data associated with the error. */
|
|
12715
12961
|
data?: {
|
|
12716
12962
|
[key: string]: string;
|
|
12717
12963
|
};
|