@openfort/openfort-js 0.7.13 → 0.7.14

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.
Files changed (3) hide show
  1. package/dist/index.cjs +130 -35
  2. package/dist/index.js +130 -35
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -467,7 +467,7 @@ const AccountsApiAxiosParamCreator = function (configuration) {
467
467
  };
468
468
  },
469
469
  /**
470
- * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
470
+ * **Custodial Accounts only** - Signs the typed repositories value with types repositories structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
471
471
  * @summary Sign a given payload
472
472
  * @param {string} id Specifies the unique account ID (starts with acc_).
473
473
  * @param {SignPayloadRequest} signPayloadRequest
@@ -668,7 +668,7 @@ const AccountsApiFp = function (configuration) {
668
668
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
669
669
  },
670
670
  /**
671
- * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
671
+ * **Custodial Accounts only** - Signs the typed repositories value with types repositories structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
672
672
  * @summary Sign a given payload
673
673
  * @param {string} id Specifies the unique account ID (starts with acc_).
674
674
  * @param {SignPayloadRequest} signPayloadRequest
@@ -789,7 +789,7 @@ class AccountsApi extends BaseAPI {
789
789
  return AccountsApiFp(this.configuration).requestTransferOwnership(requestParameters.id, requestParameters.transferOwnershipRequest, options).then((request) => request(this.axios, this.basePath));
790
790
  }
791
791
  /**
792
- * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
792
+ * **Custodial Accounts only** - Signs the typed repositories value with types repositories structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
793
793
  * @summary Sign a given payload
794
794
  * @param {AccountsApiSignPayloadRequest} requestParameters Request parameters.
795
795
  * @param {*} [options] Override http request option.
@@ -847,6 +847,7 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
847
847
  * @summary Authenticate player with oauth token.
848
848
  * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
849
849
  * @param {*} [options] Override http request option.
850
+ * @deprecated
850
851
  * @throws {RequiredError}
851
852
  */
852
853
  authenticateOAuth: async (authenticateOAuthRequest, options = {}) => {
@@ -908,6 +909,38 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
908
909
  options: localVarRequestOptions,
909
910
  };
910
911
  },
912
+ /**
913
+ *
914
+ * @param {AuthorizePlayerRequest} authorizePlayerRequest
915
+ * @param {*} [options] Override http request option.
916
+ * @throws {RequiredError}
917
+ */
918
+ authorize: async (authorizePlayerRequest, options = {}) => {
919
+ // verify required parameter 'authorizePlayerRequest' is not null or undefined
920
+ assertParamExists('authorize', 'authorizePlayerRequest', authorizePlayerRequest);
921
+ const localVarPath = `/iam/v1/authorize`;
922
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
923
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
924
+ let baseOptions;
925
+ if (configuration) {
926
+ baseOptions = configuration.baseOptions;
927
+ }
928
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
929
+ const localVarHeaderParameter = {};
930
+ const localVarQueryParameter = {};
931
+ // authentication sk required
932
+ // http bearer authentication required
933
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
934
+ localVarHeaderParameter['Content-Type'] = 'application/json';
935
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
936
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
937
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
938
+ localVarRequestOptions.data = serializeDataIfNeeded(authorizePlayerRequest, localVarRequestOptions, configuration);
939
+ return {
940
+ url: toPathString(localVarUrlObj),
941
+ options: localVarRequestOptions,
942
+ };
943
+ },
911
944
  /**
912
945
  * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
913
946
  * @summary Authorize player with token.
@@ -982,10 +1015,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
982
1015
  *
983
1016
  * @summary Initialize OAuth.
984
1017
  * @param {OAuthInitRequest} oAuthInitRequest
1018
+ * @param {string} [xGame]
985
1019
  * @param {*} [options] Override http request option.
986
1020
  * @throws {RequiredError}
987
1021
  */
988
- initOAuth: async (oAuthInitRequest, options = {}) => {
1022
+ initOAuth: async (oAuthInitRequest, xGame, options = {}) => {
989
1023
  // verify required parameter 'oAuthInitRequest' is not null or undefined
990
1024
  assertParamExists('initOAuth', 'oAuthInitRequest', oAuthInitRequest);
991
1025
  const localVarPath = `/iam/v1/oauth/init`;
@@ -1001,6 +1035,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1001
1035
  // authentication pk required
1002
1036
  // http bearer authentication required
1003
1037
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1038
+ if (xGame != null) {
1039
+ localVarHeaderParameter['x-game'] = String(xGame);
1040
+ }
1004
1041
  localVarHeaderParameter['Content-Type'] = 'application/json';
1005
1042
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1006
1043
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1015,10 +1052,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1015
1052
  * Create a challenge to link external wallet to the player.
1016
1053
  * @summary Initialize SIWE.
1017
1054
  * @param {SIWERequest} sIWERequest
1055
+ * @param {string} [xGame]
1018
1056
  * @param {*} [options] Override http request option.
1019
1057
  * @throws {RequiredError}
1020
1058
  */
1021
- initSIWE: async (sIWERequest, options = {}) => {
1059
+ initSIWE: async (sIWERequest, xGame, options = {}) => {
1022
1060
  // verify required parameter 'sIWERequest' is not null or undefined
1023
1061
  assertParamExists('initSIWE', 'sIWERequest', sIWERequest);
1024
1062
  const localVarPath = `/iam/v1/siwe/init`;
@@ -1034,6 +1072,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1034
1072
  // authentication pk required
1035
1073
  // http bearer authentication required
1036
1074
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1075
+ if (xGame != null) {
1076
+ localVarHeaderParameter['x-game'] = String(xGame);
1077
+ }
1037
1078
  localVarHeaderParameter['Content-Type'] = 'application/json';
1038
1079
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1039
1080
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1047,10 +1088,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1047
1088
  /**
1048
1089
  *
1049
1090
  * @param {LoginRequest} loginRequest
1091
+ * @param {string} [xGame]
1050
1092
  * @param {*} [options] Override http request option.
1051
1093
  * @throws {RequiredError}
1052
1094
  */
1053
- linkEmail: async (loginRequest, options = {}) => {
1095
+ linkEmail: async (loginRequest, xGame, options = {}) => {
1054
1096
  // verify required parameter 'loginRequest' is not null or undefined
1055
1097
  assertParamExists('linkEmail', 'loginRequest', loginRequest);
1056
1098
  const localVarPath = `/iam/v1/password/link`;
@@ -1063,6 +1105,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1063
1105
  const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1064
1106
  const localVarHeaderParameter = {};
1065
1107
  const localVarQueryParameter = {};
1108
+ if (xGame != null) {
1109
+ localVarHeaderParameter['x-game'] = String(xGame);
1110
+ }
1066
1111
  localVarHeaderParameter['Content-Type'] = 'application/json';
1067
1112
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1068
1113
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1077,10 +1122,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1077
1122
  *
1078
1123
  * @summary Initialize Link OAuth.
1079
1124
  * @param {OAuthInitRequest} oAuthInitRequest
1125
+ * @param {string} [xGame]
1080
1126
  * @param {*} [options] Override http request option.
1081
1127
  * @throws {RequiredError}
1082
1128
  */
1083
- linkOAuth: async (oAuthInitRequest, options = {}) => {
1129
+ linkOAuth: async (oAuthInitRequest, xGame, options = {}) => {
1084
1130
  // verify required parameter 'oAuthInitRequest' is not null or undefined
1085
1131
  assertParamExists('linkOAuth', 'oAuthInitRequest', oAuthInitRequest);
1086
1132
  const localVarPath = `/iam/v1/oauth/init_link`;
@@ -1093,6 +1139,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1093
1139
  const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1094
1140
  const localVarHeaderParameter = {};
1095
1141
  const localVarQueryParameter = {};
1142
+ if (xGame != null) {
1143
+ localVarHeaderParameter['x-game'] = String(xGame);
1144
+ }
1096
1145
  localVarHeaderParameter['Content-Type'] = 'application/json';
1097
1146
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1098
1147
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1137,10 +1186,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1137
1186
  * Authenticate a player based on email and password.
1138
1187
  * @summary Email and password login.
1139
1188
  * @param {LoginRequest} loginRequest
1189
+ * @param {string} [xGame]
1140
1190
  * @param {*} [options] Override http request option.
1141
1191
  * @throws {RequiredError}
1142
1192
  */
1143
- loginEmailPassword: async (loginRequest, options = {}) => {
1193
+ loginEmailPassword: async (loginRequest, xGame, options = {}) => {
1144
1194
  // verify required parameter 'loginRequest' is not null or undefined
1145
1195
  assertParamExists('loginEmailPassword', 'loginRequest', loginRequest);
1146
1196
  const localVarPath = `/iam/v1/password/login`;
@@ -1156,6 +1206,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1156
1206
  // authentication pk required
1157
1207
  // http bearer authentication required
1158
1208
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1209
+ if (xGame != null) {
1210
+ localVarHeaderParameter['x-game'] = String(xGame);
1211
+ }
1159
1212
  localVarHeaderParameter['Content-Type'] = 'application/json';
1160
1213
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1161
1214
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1390,10 +1443,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1390
1443
  * Create and authenticate a player based on email and password.
1391
1444
  * @summary Email and password signup.
1392
1445
  * @param {SignupRequest} signupRequest
1446
+ * @param {string} [xGame]
1393
1447
  * @param {*} [options] Override http request option.
1394
1448
  * @throws {RequiredError}
1395
1449
  */
1396
- signupEmailPassword: async (signupRequest, options = {}) => {
1450
+ signupEmailPassword: async (signupRequest, xGame, options = {}) => {
1397
1451
  // verify required parameter 'signupRequest' is not null or undefined
1398
1452
  assertParamExists('signupEmailPassword', 'signupRequest', signupRequest);
1399
1453
  const localVarPath = `/iam/v1/password/signup`;
@@ -1409,6 +1463,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1409
1463
  // authentication pk required
1410
1464
  // http bearer authentication required
1411
1465
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1466
+ if (xGame != null) {
1467
+ localVarHeaderParameter['x-game'] = String(xGame);
1468
+ }
1412
1469
  localVarHeaderParameter['Content-Type'] = 'application/json';
1413
1470
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1414
1471
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1423,10 +1480,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1423
1480
  *
1424
1481
  * @summary Verify oauth token of a third party auth provider.
1425
1482
  * @param {ThirdPartyOAuthRequest} thirdPartyOAuthRequest
1483
+ * @param {string} [xGame]
1426
1484
  * @param {*} [options] Override http request option.
1427
1485
  * @throws {RequiredError}
1428
1486
  */
1429
- thirdParty: async (thirdPartyOAuthRequest, options = {}) => {
1487
+ thirdParty: async (thirdPartyOAuthRequest, xGame, options = {}) => {
1430
1488
  // verify required parameter 'thirdPartyOAuthRequest' is not null or undefined
1431
1489
  assertParamExists('thirdParty', 'thirdPartyOAuthRequest', thirdPartyOAuthRequest);
1432
1490
  const localVarPath = `/iam/v1/oauth/third_party`;
@@ -1442,6 +1500,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1442
1500
  // authentication pk required
1443
1501
  // http bearer authentication required
1444
1502
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1503
+ if (xGame != null) {
1504
+ localVarHeaderParameter['x-game'] = String(xGame);
1505
+ }
1445
1506
  localVarHeaderParameter['Content-Type'] = 'application/json';
1446
1507
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1447
1508
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1659,6 +1720,7 @@ const AuthenticationApiFp = function (configuration) {
1659
1720
  * @summary Authenticate player with oauth token.
1660
1721
  * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
1661
1722
  * @param {*} [options] Override http request option.
1723
+ * @deprecated
1662
1724
  * @throws {RequiredError}
1663
1725
  */
1664
1726
  async authenticateOAuth(authenticateOAuthRequest, options) {
@@ -1676,6 +1738,16 @@ const AuthenticationApiFp = function (configuration) {
1676
1738
  const localVarAxiosArgs = await localVarAxiosParamCreator.authenticateSIWE(sIWEAuthenticateRequest, options);
1677
1739
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1678
1740
  },
1741
+ /**
1742
+ *
1743
+ * @param {AuthorizePlayerRequest} authorizePlayerRequest
1744
+ * @param {*} [options] Override http request option.
1745
+ * @throws {RequiredError}
1746
+ */
1747
+ async authorize(authorizePlayerRequest, options) {
1748
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authorize(authorizePlayerRequest, options);
1749
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1750
+ },
1679
1751
  /**
1680
1752
  * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
1681
1753
  * @summary Authorize player with token.
@@ -1704,43 +1776,47 @@ const AuthenticationApiFp = function (configuration) {
1704
1776
  *
1705
1777
  * @summary Initialize OAuth.
1706
1778
  * @param {OAuthInitRequest} oAuthInitRequest
1779
+ * @param {string} [xGame]
1707
1780
  * @param {*} [options] Override http request option.
1708
1781
  * @throws {RequiredError}
1709
1782
  */
1710
- async initOAuth(oAuthInitRequest, options) {
1711
- const localVarAxiosArgs = await localVarAxiosParamCreator.initOAuth(oAuthInitRequest, options);
1783
+ async initOAuth(oAuthInitRequest, xGame, options) {
1784
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initOAuth(oAuthInitRequest, xGame, options);
1712
1785
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1713
1786
  },
1714
1787
  /**
1715
1788
  * Create a challenge to link external wallet to the player.
1716
1789
  * @summary Initialize SIWE.
1717
1790
  * @param {SIWERequest} sIWERequest
1791
+ * @param {string} [xGame]
1718
1792
  * @param {*} [options] Override http request option.
1719
1793
  * @throws {RequiredError}
1720
1794
  */
1721
- async initSIWE(sIWERequest, options) {
1722
- const localVarAxiosArgs = await localVarAxiosParamCreator.initSIWE(sIWERequest, options);
1795
+ async initSIWE(sIWERequest, xGame, options) {
1796
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initSIWE(sIWERequest, xGame, options);
1723
1797
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1724
1798
  },
1725
1799
  /**
1726
1800
  *
1727
1801
  * @param {LoginRequest} loginRequest
1802
+ * @param {string} [xGame]
1728
1803
  * @param {*} [options] Override http request option.
1729
1804
  * @throws {RequiredError}
1730
1805
  */
1731
- async linkEmail(loginRequest, options) {
1732
- const localVarAxiosArgs = await localVarAxiosParamCreator.linkEmail(loginRequest, options);
1806
+ async linkEmail(loginRequest, xGame, options) {
1807
+ const localVarAxiosArgs = await localVarAxiosParamCreator.linkEmail(loginRequest, xGame, options);
1733
1808
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1734
1809
  },
1735
1810
  /**
1736
1811
  *
1737
1812
  * @summary Initialize Link OAuth.
1738
1813
  * @param {OAuthInitRequest} oAuthInitRequest
1814
+ * @param {string} [xGame]
1739
1815
  * @param {*} [options] Override http request option.
1740
1816
  * @throws {RequiredError}
1741
1817
  */
1742
- async linkOAuth(oAuthInitRequest, options) {
1743
- const localVarAxiosArgs = await localVarAxiosParamCreator.linkOAuth(oAuthInitRequest, options);
1818
+ async linkOAuth(oAuthInitRequest, xGame, options) {
1819
+ const localVarAxiosArgs = await localVarAxiosParamCreator.linkOAuth(oAuthInitRequest, xGame, options);
1744
1820
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1745
1821
  },
1746
1822
  /**
@@ -1758,11 +1834,12 @@ const AuthenticationApiFp = function (configuration) {
1758
1834
  * Authenticate a player based on email and password.
1759
1835
  * @summary Email and password login.
1760
1836
  * @param {LoginRequest} loginRequest
1837
+ * @param {string} [xGame]
1761
1838
  * @param {*} [options] Override http request option.
1762
1839
  * @throws {RequiredError}
1763
1840
  */
1764
- async loginEmailPassword(loginRequest, options) {
1765
- const localVarAxiosArgs = await localVarAxiosParamCreator.loginEmailPassword(loginRequest, options);
1841
+ async loginEmailPassword(loginRequest, xGame, options) {
1842
+ const localVarAxiosArgs = await localVarAxiosParamCreator.loginEmailPassword(loginRequest, xGame, options);
1766
1843
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1767
1844
  },
1768
1845
  /**
@@ -1844,22 +1921,24 @@ const AuthenticationApiFp = function (configuration) {
1844
1921
  * Create and authenticate a player based on email and password.
1845
1922
  * @summary Email and password signup.
1846
1923
  * @param {SignupRequest} signupRequest
1924
+ * @param {string} [xGame]
1847
1925
  * @param {*} [options] Override http request option.
1848
1926
  * @throws {RequiredError}
1849
1927
  */
1850
- async signupEmailPassword(signupRequest, options) {
1851
- const localVarAxiosArgs = await localVarAxiosParamCreator.signupEmailPassword(signupRequest, options);
1928
+ async signupEmailPassword(signupRequest, xGame, options) {
1929
+ const localVarAxiosArgs = await localVarAxiosParamCreator.signupEmailPassword(signupRequest, xGame, options);
1852
1930
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1853
1931
  },
1854
1932
  /**
1855
1933
  *
1856
1934
  * @summary Verify oauth token of a third party auth provider.
1857
1935
  * @param {ThirdPartyOAuthRequest} thirdPartyOAuthRequest
1936
+ * @param {string} [xGame]
1858
1937
  * @param {*} [options] Override http request option.
1859
1938
  * @throws {RequiredError}
1860
1939
  */
1861
- async thirdParty(thirdPartyOAuthRequest, options) {
1862
- const localVarAxiosArgs = await localVarAxiosParamCreator.thirdParty(thirdPartyOAuthRequest, options);
1940
+ async thirdParty(thirdPartyOAuthRequest, xGame, options) {
1941
+ const localVarAxiosArgs = await localVarAxiosParamCreator.thirdParty(thirdPartyOAuthRequest, xGame, options);
1863
1942
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1864
1943
  },
1865
1944
  /**
@@ -1943,6 +2022,7 @@ class AuthenticationApi extends BaseAPI {
1943
2022
  * @summary Authenticate player with oauth token.
1944
2023
  * @param {AuthenticationApiAuthenticateOAuthRequest} requestParameters Request parameters.
1945
2024
  * @param {*} [options] Override http request option.
2025
+ * @deprecated
1946
2026
  * @throws {RequiredError}
1947
2027
  * @memberof AuthenticationApi
1948
2028
  */
@@ -1960,6 +2040,16 @@ class AuthenticationApi extends BaseAPI {
1960
2040
  authenticateSIWE(requestParameters, options) {
1961
2041
  return AuthenticationApiFp(this.configuration).authenticateSIWE(requestParameters.sIWEAuthenticateRequest, options).then((request) => request(this.axios, this.basePath));
1962
2042
  }
2043
+ /**
2044
+ *
2045
+ * @param {AuthenticationApiAuthorizeRequest} requestParameters Request parameters.
2046
+ * @param {*} [options] Override http request option.
2047
+ * @throws {RequiredError}
2048
+ * @memberof AuthenticationApi
2049
+ */
2050
+ authorize(requestParameters, options) {
2051
+ return AuthenticationApiFp(this.configuration).authorize(requestParameters.authorizePlayerRequest, options).then((request) => request(this.axios, this.basePath));
2052
+ }
1963
2053
  /**
1964
2054
  * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
1965
2055
  * @summary Authorize player with token.
@@ -1992,7 +2082,7 @@ class AuthenticationApi extends BaseAPI {
1992
2082
  * @memberof AuthenticationApi
1993
2083
  */
1994
2084
  initOAuth(requestParameters, options) {
1995
- return AuthenticationApiFp(this.configuration).initOAuth(requestParameters.oAuthInitRequest, options).then((request) => request(this.axios, this.basePath));
2085
+ return AuthenticationApiFp(this.configuration).initOAuth(requestParameters.oAuthInitRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
1996
2086
  }
1997
2087
  /**
1998
2088
  * Create a challenge to link external wallet to the player.
@@ -2003,7 +2093,7 @@ class AuthenticationApi extends BaseAPI {
2003
2093
  * @memberof AuthenticationApi
2004
2094
  */
2005
2095
  initSIWE(requestParameters, options) {
2006
- return AuthenticationApiFp(this.configuration).initSIWE(requestParameters.sIWERequest, options).then((request) => request(this.axios, this.basePath));
2096
+ return AuthenticationApiFp(this.configuration).initSIWE(requestParameters.sIWERequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2007
2097
  }
2008
2098
  /**
2009
2099
  *
@@ -2013,7 +2103,7 @@ class AuthenticationApi extends BaseAPI {
2013
2103
  * @memberof AuthenticationApi
2014
2104
  */
2015
2105
  linkEmail(requestParameters, options) {
2016
- return AuthenticationApiFp(this.configuration).linkEmail(requestParameters.loginRequest, options).then((request) => request(this.axios, this.basePath));
2106
+ return AuthenticationApiFp(this.configuration).linkEmail(requestParameters.loginRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2017
2107
  }
2018
2108
  /**
2019
2109
  *
@@ -2024,7 +2114,7 @@ class AuthenticationApi extends BaseAPI {
2024
2114
  * @memberof AuthenticationApi
2025
2115
  */
2026
2116
  linkOAuth(requestParameters, options) {
2027
- return AuthenticationApiFp(this.configuration).linkOAuth(requestParameters.oAuthInitRequest, options).then((request) => request(this.axios, this.basePath));
2117
+ return AuthenticationApiFp(this.configuration).linkOAuth(requestParameters.oAuthInitRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2028
2118
  }
2029
2119
  /**
2030
2120
  *
@@ -2046,7 +2136,7 @@ class AuthenticationApi extends BaseAPI {
2046
2136
  * @memberof AuthenticationApi
2047
2137
  */
2048
2138
  loginEmailPassword(requestParameters, options) {
2049
- return AuthenticationApiFp(this.configuration).loginEmailPassword(requestParameters.loginRequest, options).then((request) => request(this.axios, this.basePath));
2139
+ return AuthenticationApiFp(this.configuration).loginEmailPassword(requestParameters.loginRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2050
2140
  }
2051
2141
  /**
2052
2142
  * When using Openfort Auth, the endpoint logs out the player.
@@ -2132,7 +2222,7 @@ class AuthenticationApi extends BaseAPI {
2132
2222
  * @memberof AuthenticationApi
2133
2223
  */
2134
2224
  signupEmailPassword(requestParameters, options) {
2135
- return AuthenticationApiFp(this.configuration).signupEmailPassword(requestParameters.signupRequest, options).then((request) => request(this.axios, this.basePath));
2225
+ return AuthenticationApiFp(this.configuration).signupEmailPassword(requestParameters.signupRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2136
2226
  }
2137
2227
  /**
2138
2228
  *
@@ -2143,7 +2233,7 @@ class AuthenticationApi extends BaseAPI {
2143
2233
  * @memberof AuthenticationApi
2144
2234
  */
2145
2235
  thirdParty(requestParameters, options) {
2146
- return AuthenticationApiFp(this.configuration).thirdParty(requestParameters.thirdPartyOAuthRequest, options).then((request) => request(this.axios, this.basePath));
2236
+ return AuthenticationApiFp(this.configuration).thirdParty(requestParameters.thirdPartyOAuthRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2147
2237
  }
2148
2238
  /**
2149
2239
  *
@@ -2583,10 +2673,11 @@ const TransactionIntentsApiAxiosParamCreator = function (configuration) {
2583
2673
  * Creates a TransactionIntent. A pending TransactionIntent has the `response` attribute as undefined. After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail). When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.
2584
2674
  * @summary Create a transaction intent object.
2585
2675
  * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2676
+ * @param {string} [xBehalfOfProject]
2586
2677
  * @param {*} [options] Override http request option.
2587
2678
  * @throws {RequiredError}
2588
2679
  */
2589
- createTransactionIntent: async (createTransactionIntentRequest, options = {}) => {
2680
+ createTransactionIntent: async (createTransactionIntentRequest, xBehalfOfProject, options = {}) => {
2590
2681
  // verify required parameter 'createTransactionIntentRequest' is not null or undefined
2591
2682
  assertParamExists('createTransactionIntent', 'createTransactionIntentRequest', createTransactionIntentRequest);
2592
2683
  const localVarPath = `/v1/transaction_intents`;
@@ -2602,6 +2693,9 @@ const TransactionIntentsApiAxiosParamCreator = function (configuration) {
2602
2693
  // authentication sk required
2603
2694
  // http bearer authentication required
2604
2695
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
2696
+ if (xBehalfOfProject != null) {
2697
+ localVarHeaderParameter['X-Behalf-Of-Project'] = String(xBehalfOfProject);
2698
+ }
2605
2699
  localVarHeaderParameter['Content-Type'] = 'application/json';
2606
2700
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2607
2701
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -2798,11 +2892,12 @@ const TransactionIntentsApiFp = function (configuration) {
2798
2892
  * Creates a TransactionIntent. A pending TransactionIntent has the `response` attribute as undefined. After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail). When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.
2799
2893
  * @summary Create a transaction intent object.
2800
2894
  * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2895
+ * @param {string} [xBehalfOfProject]
2801
2896
  * @param {*} [options] Override http request option.
2802
2897
  * @throws {RequiredError}
2803
2898
  */
2804
- async createTransactionIntent(createTransactionIntentRequest, options) {
2805
- const localVarAxiosArgs = await localVarAxiosParamCreator.createTransactionIntent(createTransactionIntentRequest, options);
2899
+ async createTransactionIntent(createTransactionIntentRequest, xBehalfOfProject, options) {
2900
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTransactionIntent(createTransactionIntentRequest, xBehalfOfProject, options);
2806
2901
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2807
2902
  },
2808
2903
  /**
@@ -2877,7 +2972,7 @@ class TransactionIntentsApi extends BaseAPI {
2877
2972
  * @memberof TransactionIntentsApi
2878
2973
  */
2879
2974
  createTransactionIntent(requestParameters, options) {
2880
- return TransactionIntentsApiFp(this.configuration).createTransactionIntent(requestParameters.createTransactionIntentRequest, options).then((request) => request(this.axios, this.basePath));
2975
+ return TransactionIntentsApiFp(this.configuration).createTransactionIntent(requestParameters.createTransactionIntentRequest, requestParameters.xBehalfOfProject, options).then((request) => request(this.axios, this.basePath));
2881
2976
  }
2882
2977
  /**
2883
2978
  * Estimate the gas cost of broadcasting a TransactionIntent. This is a simulation, it does not send the transaction on-chain. If a Policy ID is used that includes payment of gas in ERC-20 tokens, an extra field `estimatedTXGasFeeToken` is returned with the estimated amount of tokens that will be used.
package/dist/index.js CHANGED
@@ -444,7 +444,7 @@ const AccountsApiAxiosParamCreator = function (configuration) {
444
444
  };
445
445
  },
446
446
  /**
447
- * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
447
+ * **Custodial Accounts only** - Signs the typed repositories value with types repositories structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
448
448
  * @summary Sign a given payload
449
449
  * @param {string} id Specifies the unique account ID (starts with acc_).
450
450
  * @param {SignPayloadRequest} signPayloadRequest
@@ -645,7 +645,7 @@ const AccountsApiFp = function (configuration) {
645
645
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
646
646
  },
647
647
  /**
648
- * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
648
+ * **Custodial Accounts only** - Signs the typed repositories value with types repositories structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
649
649
  * @summary Sign a given payload
650
650
  * @param {string} id Specifies the unique account ID (starts with acc_).
651
651
  * @param {SignPayloadRequest} signPayloadRequest
@@ -766,7 +766,7 @@ class AccountsApi extends BaseAPI {
766
766
  return AccountsApiFp(this.configuration).requestTransferOwnership(requestParameters.id, requestParameters.transferOwnershipRequest, options).then((request) => request(this.axios, this.basePath));
767
767
  }
768
768
  /**
769
- * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
769
+ * **Custodial Accounts only** - Signs the typed repositories value with types repositories structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
770
770
  * @summary Sign a given payload
771
771
  * @param {AccountsApiSignPayloadRequest} requestParameters Request parameters.
772
772
  * @param {*} [options] Override http request option.
@@ -824,6 +824,7 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
824
824
  * @summary Authenticate player with oauth token.
825
825
  * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
826
826
  * @param {*} [options] Override http request option.
827
+ * @deprecated
827
828
  * @throws {RequiredError}
828
829
  */
829
830
  authenticateOAuth: async (authenticateOAuthRequest, options = {}) => {
@@ -885,6 +886,38 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
885
886
  options: localVarRequestOptions,
886
887
  };
887
888
  },
889
+ /**
890
+ *
891
+ * @param {AuthorizePlayerRequest} authorizePlayerRequest
892
+ * @param {*} [options] Override http request option.
893
+ * @throws {RequiredError}
894
+ */
895
+ authorize: async (authorizePlayerRequest, options = {}) => {
896
+ // verify required parameter 'authorizePlayerRequest' is not null or undefined
897
+ assertParamExists('authorize', 'authorizePlayerRequest', authorizePlayerRequest);
898
+ const localVarPath = `/iam/v1/authorize`;
899
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
900
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
901
+ let baseOptions;
902
+ if (configuration) {
903
+ baseOptions = configuration.baseOptions;
904
+ }
905
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
906
+ const localVarHeaderParameter = {};
907
+ const localVarQueryParameter = {};
908
+ // authentication sk required
909
+ // http bearer authentication required
910
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
911
+ localVarHeaderParameter['Content-Type'] = 'application/json';
912
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
913
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
914
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
915
+ localVarRequestOptions.data = serializeDataIfNeeded(authorizePlayerRequest, localVarRequestOptions, configuration);
916
+ return {
917
+ url: toPathString(localVarUrlObj),
918
+ options: localVarRequestOptions,
919
+ };
920
+ },
888
921
  /**
889
922
  * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
890
923
  * @summary Authorize player with token.
@@ -959,10 +992,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
959
992
  *
960
993
  * @summary Initialize OAuth.
961
994
  * @param {OAuthInitRequest} oAuthInitRequest
995
+ * @param {string} [xGame]
962
996
  * @param {*} [options] Override http request option.
963
997
  * @throws {RequiredError}
964
998
  */
965
- initOAuth: async (oAuthInitRequest, options = {}) => {
999
+ initOAuth: async (oAuthInitRequest, xGame, options = {}) => {
966
1000
  // verify required parameter 'oAuthInitRequest' is not null or undefined
967
1001
  assertParamExists('initOAuth', 'oAuthInitRequest', oAuthInitRequest);
968
1002
  const localVarPath = `/iam/v1/oauth/init`;
@@ -978,6 +1012,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
978
1012
  // authentication pk required
979
1013
  // http bearer authentication required
980
1014
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1015
+ if (xGame != null) {
1016
+ localVarHeaderParameter['x-game'] = String(xGame);
1017
+ }
981
1018
  localVarHeaderParameter['Content-Type'] = 'application/json';
982
1019
  setSearchParams(localVarUrlObj, localVarQueryParameter);
983
1020
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -992,10 +1029,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
992
1029
  * Create a challenge to link external wallet to the player.
993
1030
  * @summary Initialize SIWE.
994
1031
  * @param {SIWERequest} sIWERequest
1032
+ * @param {string} [xGame]
995
1033
  * @param {*} [options] Override http request option.
996
1034
  * @throws {RequiredError}
997
1035
  */
998
- initSIWE: async (sIWERequest, options = {}) => {
1036
+ initSIWE: async (sIWERequest, xGame, options = {}) => {
999
1037
  // verify required parameter 'sIWERequest' is not null or undefined
1000
1038
  assertParamExists('initSIWE', 'sIWERequest', sIWERequest);
1001
1039
  const localVarPath = `/iam/v1/siwe/init`;
@@ -1011,6 +1049,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1011
1049
  // authentication pk required
1012
1050
  // http bearer authentication required
1013
1051
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1052
+ if (xGame != null) {
1053
+ localVarHeaderParameter['x-game'] = String(xGame);
1054
+ }
1014
1055
  localVarHeaderParameter['Content-Type'] = 'application/json';
1015
1056
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1016
1057
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1024,10 +1065,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1024
1065
  /**
1025
1066
  *
1026
1067
  * @param {LoginRequest} loginRequest
1068
+ * @param {string} [xGame]
1027
1069
  * @param {*} [options] Override http request option.
1028
1070
  * @throws {RequiredError}
1029
1071
  */
1030
- linkEmail: async (loginRequest, options = {}) => {
1072
+ linkEmail: async (loginRequest, xGame, options = {}) => {
1031
1073
  // verify required parameter 'loginRequest' is not null or undefined
1032
1074
  assertParamExists('linkEmail', 'loginRequest', loginRequest);
1033
1075
  const localVarPath = `/iam/v1/password/link`;
@@ -1040,6 +1082,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1040
1082
  const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1041
1083
  const localVarHeaderParameter = {};
1042
1084
  const localVarQueryParameter = {};
1085
+ if (xGame != null) {
1086
+ localVarHeaderParameter['x-game'] = String(xGame);
1087
+ }
1043
1088
  localVarHeaderParameter['Content-Type'] = 'application/json';
1044
1089
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1045
1090
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1054,10 +1099,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1054
1099
  *
1055
1100
  * @summary Initialize Link OAuth.
1056
1101
  * @param {OAuthInitRequest} oAuthInitRequest
1102
+ * @param {string} [xGame]
1057
1103
  * @param {*} [options] Override http request option.
1058
1104
  * @throws {RequiredError}
1059
1105
  */
1060
- linkOAuth: async (oAuthInitRequest, options = {}) => {
1106
+ linkOAuth: async (oAuthInitRequest, xGame, options = {}) => {
1061
1107
  // verify required parameter 'oAuthInitRequest' is not null or undefined
1062
1108
  assertParamExists('linkOAuth', 'oAuthInitRequest', oAuthInitRequest);
1063
1109
  const localVarPath = `/iam/v1/oauth/init_link`;
@@ -1070,6 +1116,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1070
1116
  const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1071
1117
  const localVarHeaderParameter = {};
1072
1118
  const localVarQueryParameter = {};
1119
+ if (xGame != null) {
1120
+ localVarHeaderParameter['x-game'] = String(xGame);
1121
+ }
1073
1122
  localVarHeaderParameter['Content-Type'] = 'application/json';
1074
1123
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1075
1124
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1114,10 +1163,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1114
1163
  * Authenticate a player based on email and password.
1115
1164
  * @summary Email and password login.
1116
1165
  * @param {LoginRequest} loginRequest
1166
+ * @param {string} [xGame]
1117
1167
  * @param {*} [options] Override http request option.
1118
1168
  * @throws {RequiredError}
1119
1169
  */
1120
- loginEmailPassword: async (loginRequest, options = {}) => {
1170
+ loginEmailPassword: async (loginRequest, xGame, options = {}) => {
1121
1171
  // verify required parameter 'loginRequest' is not null or undefined
1122
1172
  assertParamExists('loginEmailPassword', 'loginRequest', loginRequest);
1123
1173
  const localVarPath = `/iam/v1/password/login`;
@@ -1133,6 +1183,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1133
1183
  // authentication pk required
1134
1184
  // http bearer authentication required
1135
1185
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1186
+ if (xGame != null) {
1187
+ localVarHeaderParameter['x-game'] = String(xGame);
1188
+ }
1136
1189
  localVarHeaderParameter['Content-Type'] = 'application/json';
1137
1190
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1138
1191
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1367,10 +1420,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1367
1420
  * Create and authenticate a player based on email and password.
1368
1421
  * @summary Email and password signup.
1369
1422
  * @param {SignupRequest} signupRequest
1423
+ * @param {string} [xGame]
1370
1424
  * @param {*} [options] Override http request option.
1371
1425
  * @throws {RequiredError}
1372
1426
  */
1373
- signupEmailPassword: async (signupRequest, options = {}) => {
1427
+ signupEmailPassword: async (signupRequest, xGame, options = {}) => {
1374
1428
  // verify required parameter 'signupRequest' is not null or undefined
1375
1429
  assertParamExists('signupEmailPassword', 'signupRequest', signupRequest);
1376
1430
  const localVarPath = `/iam/v1/password/signup`;
@@ -1386,6 +1440,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1386
1440
  // authentication pk required
1387
1441
  // http bearer authentication required
1388
1442
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1443
+ if (xGame != null) {
1444
+ localVarHeaderParameter['x-game'] = String(xGame);
1445
+ }
1389
1446
  localVarHeaderParameter['Content-Type'] = 'application/json';
1390
1447
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1391
1448
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1400,10 +1457,11 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1400
1457
  *
1401
1458
  * @summary Verify oauth token of a third party auth provider.
1402
1459
  * @param {ThirdPartyOAuthRequest} thirdPartyOAuthRequest
1460
+ * @param {string} [xGame]
1403
1461
  * @param {*} [options] Override http request option.
1404
1462
  * @throws {RequiredError}
1405
1463
  */
1406
- thirdParty: async (thirdPartyOAuthRequest, options = {}) => {
1464
+ thirdParty: async (thirdPartyOAuthRequest, xGame, options = {}) => {
1407
1465
  // verify required parameter 'thirdPartyOAuthRequest' is not null or undefined
1408
1466
  assertParamExists('thirdParty', 'thirdPartyOAuthRequest', thirdPartyOAuthRequest);
1409
1467
  const localVarPath = `/iam/v1/oauth/third_party`;
@@ -1419,6 +1477,9 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
1419
1477
  // authentication pk required
1420
1478
  // http bearer authentication required
1421
1479
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
1480
+ if (xGame != null) {
1481
+ localVarHeaderParameter['x-game'] = String(xGame);
1482
+ }
1422
1483
  localVarHeaderParameter['Content-Type'] = 'application/json';
1423
1484
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1424
1485
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1636,6 +1697,7 @@ const AuthenticationApiFp = function (configuration) {
1636
1697
  * @summary Authenticate player with oauth token.
1637
1698
  * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
1638
1699
  * @param {*} [options] Override http request option.
1700
+ * @deprecated
1639
1701
  * @throws {RequiredError}
1640
1702
  */
1641
1703
  async authenticateOAuth(authenticateOAuthRequest, options) {
@@ -1653,6 +1715,16 @@ const AuthenticationApiFp = function (configuration) {
1653
1715
  const localVarAxiosArgs = await localVarAxiosParamCreator.authenticateSIWE(sIWEAuthenticateRequest, options);
1654
1716
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1655
1717
  },
1718
+ /**
1719
+ *
1720
+ * @param {AuthorizePlayerRequest} authorizePlayerRequest
1721
+ * @param {*} [options] Override http request option.
1722
+ * @throws {RequiredError}
1723
+ */
1724
+ async authorize(authorizePlayerRequest, options) {
1725
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authorize(authorizePlayerRequest, options);
1726
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1727
+ },
1656
1728
  /**
1657
1729
  * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
1658
1730
  * @summary Authorize player with token.
@@ -1681,43 +1753,47 @@ const AuthenticationApiFp = function (configuration) {
1681
1753
  *
1682
1754
  * @summary Initialize OAuth.
1683
1755
  * @param {OAuthInitRequest} oAuthInitRequest
1756
+ * @param {string} [xGame]
1684
1757
  * @param {*} [options] Override http request option.
1685
1758
  * @throws {RequiredError}
1686
1759
  */
1687
- async initOAuth(oAuthInitRequest, options) {
1688
- const localVarAxiosArgs = await localVarAxiosParamCreator.initOAuth(oAuthInitRequest, options);
1760
+ async initOAuth(oAuthInitRequest, xGame, options) {
1761
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initOAuth(oAuthInitRequest, xGame, options);
1689
1762
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1690
1763
  },
1691
1764
  /**
1692
1765
  * Create a challenge to link external wallet to the player.
1693
1766
  * @summary Initialize SIWE.
1694
1767
  * @param {SIWERequest} sIWERequest
1768
+ * @param {string} [xGame]
1695
1769
  * @param {*} [options] Override http request option.
1696
1770
  * @throws {RequiredError}
1697
1771
  */
1698
- async initSIWE(sIWERequest, options) {
1699
- const localVarAxiosArgs = await localVarAxiosParamCreator.initSIWE(sIWERequest, options);
1772
+ async initSIWE(sIWERequest, xGame, options) {
1773
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initSIWE(sIWERequest, xGame, options);
1700
1774
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1701
1775
  },
1702
1776
  /**
1703
1777
  *
1704
1778
  * @param {LoginRequest} loginRequest
1779
+ * @param {string} [xGame]
1705
1780
  * @param {*} [options] Override http request option.
1706
1781
  * @throws {RequiredError}
1707
1782
  */
1708
- async linkEmail(loginRequest, options) {
1709
- const localVarAxiosArgs = await localVarAxiosParamCreator.linkEmail(loginRequest, options);
1783
+ async linkEmail(loginRequest, xGame, options) {
1784
+ const localVarAxiosArgs = await localVarAxiosParamCreator.linkEmail(loginRequest, xGame, options);
1710
1785
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1711
1786
  },
1712
1787
  /**
1713
1788
  *
1714
1789
  * @summary Initialize Link OAuth.
1715
1790
  * @param {OAuthInitRequest} oAuthInitRequest
1791
+ * @param {string} [xGame]
1716
1792
  * @param {*} [options] Override http request option.
1717
1793
  * @throws {RequiredError}
1718
1794
  */
1719
- async linkOAuth(oAuthInitRequest, options) {
1720
- const localVarAxiosArgs = await localVarAxiosParamCreator.linkOAuth(oAuthInitRequest, options);
1795
+ async linkOAuth(oAuthInitRequest, xGame, options) {
1796
+ const localVarAxiosArgs = await localVarAxiosParamCreator.linkOAuth(oAuthInitRequest, xGame, options);
1721
1797
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1722
1798
  },
1723
1799
  /**
@@ -1735,11 +1811,12 @@ const AuthenticationApiFp = function (configuration) {
1735
1811
  * Authenticate a player based on email and password.
1736
1812
  * @summary Email and password login.
1737
1813
  * @param {LoginRequest} loginRequest
1814
+ * @param {string} [xGame]
1738
1815
  * @param {*} [options] Override http request option.
1739
1816
  * @throws {RequiredError}
1740
1817
  */
1741
- async loginEmailPassword(loginRequest, options) {
1742
- const localVarAxiosArgs = await localVarAxiosParamCreator.loginEmailPassword(loginRequest, options);
1818
+ async loginEmailPassword(loginRequest, xGame, options) {
1819
+ const localVarAxiosArgs = await localVarAxiosParamCreator.loginEmailPassword(loginRequest, xGame, options);
1743
1820
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1744
1821
  },
1745
1822
  /**
@@ -1821,22 +1898,24 @@ const AuthenticationApiFp = function (configuration) {
1821
1898
  * Create and authenticate a player based on email and password.
1822
1899
  * @summary Email and password signup.
1823
1900
  * @param {SignupRequest} signupRequest
1901
+ * @param {string} [xGame]
1824
1902
  * @param {*} [options] Override http request option.
1825
1903
  * @throws {RequiredError}
1826
1904
  */
1827
- async signupEmailPassword(signupRequest, options) {
1828
- const localVarAxiosArgs = await localVarAxiosParamCreator.signupEmailPassword(signupRequest, options);
1905
+ async signupEmailPassword(signupRequest, xGame, options) {
1906
+ const localVarAxiosArgs = await localVarAxiosParamCreator.signupEmailPassword(signupRequest, xGame, options);
1829
1907
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1830
1908
  },
1831
1909
  /**
1832
1910
  *
1833
1911
  * @summary Verify oauth token of a third party auth provider.
1834
1912
  * @param {ThirdPartyOAuthRequest} thirdPartyOAuthRequest
1913
+ * @param {string} [xGame]
1835
1914
  * @param {*} [options] Override http request option.
1836
1915
  * @throws {RequiredError}
1837
1916
  */
1838
- async thirdParty(thirdPartyOAuthRequest, options) {
1839
- const localVarAxiosArgs = await localVarAxiosParamCreator.thirdParty(thirdPartyOAuthRequest, options);
1917
+ async thirdParty(thirdPartyOAuthRequest, xGame, options) {
1918
+ const localVarAxiosArgs = await localVarAxiosParamCreator.thirdParty(thirdPartyOAuthRequest, xGame, options);
1840
1919
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1841
1920
  },
1842
1921
  /**
@@ -1920,6 +1999,7 @@ class AuthenticationApi extends BaseAPI {
1920
1999
  * @summary Authenticate player with oauth token.
1921
2000
  * @param {AuthenticationApiAuthenticateOAuthRequest} requestParameters Request parameters.
1922
2001
  * @param {*} [options] Override http request option.
2002
+ * @deprecated
1923
2003
  * @throws {RequiredError}
1924
2004
  * @memberof AuthenticationApi
1925
2005
  */
@@ -1937,6 +2017,16 @@ class AuthenticationApi extends BaseAPI {
1937
2017
  authenticateSIWE(requestParameters, options) {
1938
2018
  return AuthenticationApiFp(this.configuration).authenticateSIWE(requestParameters.sIWEAuthenticateRequest, options).then((request) => request(this.axios, this.basePath));
1939
2019
  }
2020
+ /**
2021
+ *
2022
+ * @param {AuthenticationApiAuthorizeRequest} requestParameters Request parameters.
2023
+ * @param {*} [options] Override http request option.
2024
+ * @throws {RequiredError}
2025
+ * @memberof AuthenticationApi
2026
+ */
2027
+ authorize(requestParameters, options) {
2028
+ return AuthenticationApiFp(this.configuration).authorize(requestParameters.authorizePlayerRequest, options).then((request) => request(this.axios, this.basePath));
2029
+ }
1940
2030
  /**
1941
2031
  * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
1942
2032
  * @summary Authorize player with token.
@@ -1969,7 +2059,7 @@ class AuthenticationApi extends BaseAPI {
1969
2059
  * @memberof AuthenticationApi
1970
2060
  */
1971
2061
  initOAuth(requestParameters, options) {
1972
- return AuthenticationApiFp(this.configuration).initOAuth(requestParameters.oAuthInitRequest, options).then((request) => request(this.axios, this.basePath));
2062
+ return AuthenticationApiFp(this.configuration).initOAuth(requestParameters.oAuthInitRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
1973
2063
  }
1974
2064
  /**
1975
2065
  * Create a challenge to link external wallet to the player.
@@ -1980,7 +2070,7 @@ class AuthenticationApi extends BaseAPI {
1980
2070
  * @memberof AuthenticationApi
1981
2071
  */
1982
2072
  initSIWE(requestParameters, options) {
1983
- return AuthenticationApiFp(this.configuration).initSIWE(requestParameters.sIWERequest, options).then((request) => request(this.axios, this.basePath));
2073
+ return AuthenticationApiFp(this.configuration).initSIWE(requestParameters.sIWERequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
1984
2074
  }
1985
2075
  /**
1986
2076
  *
@@ -1990,7 +2080,7 @@ class AuthenticationApi extends BaseAPI {
1990
2080
  * @memberof AuthenticationApi
1991
2081
  */
1992
2082
  linkEmail(requestParameters, options) {
1993
- return AuthenticationApiFp(this.configuration).linkEmail(requestParameters.loginRequest, options).then((request) => request(this.axios, this.basePath));
2083
+ return AuthenticationApiFp(this.configuration).linkEmail(requestParameters.loginRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
1994
2084
  }
1995
2085
  /**
1996
2086
  *
@@ -2001,7 +2091,7 @@ class AuthenticationApi extends BaseAPI {
2001
2091
  * @memberof AuthenticationApi
2002
2092
  */
2003
2093
  linkOAuth(requestParameters, options) {
2004
- return AuthenticationApiFp(this.configuration).linkOAuth(requestParameters.oAuthInitRequest, options).then((request) => request(this.axios, this.basePath));
2094
+ return AuthenticationApiFp(this.configuration).linkOAuth(requestParameters.oAuthInitRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2005
2095
  }
2006
2096
  /**
2007
2097
  *
@@ -2023,7 +2113,7 @@ class AuthenticationApi extends BaseAPI {
2023
2113
  * @memberof AuthenticationApi
2024
2114
  */
2025
2115
  loginEmailPassword(requestParameters, options) {
2026
- return AuthenticationApiFp(this.configuration).loginEmailPassword(requestParameters.loginRequest, options).then((request) => request(this.axios, this.basePath));
2116
+ return AuthenticationApiFp(this.configuration).loginEmailPassword(requestParameters.loginRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2027
2117
  }
2028
2118
  /**
2029
2119
  * When using Openfort Auth, the endpoint logs out the player.
@@ -2109,7 +2199,7 @@ class AuthenticationApi extends BaseAPI {
2109
2199
  * @memberof AuthenticationApi
2110
2200
  */
2111
2201
  signupEmailPassword(requestParameters, options) {
2112
- return AuthenticationApiFp(this.configuration).signupEmailPassword(requestParameters.signupRequest, options).then((request) => request(this.axios, this.basePath));
2202
+ return AuthenticationApiFp(this.configuration).signupEmailPassword(requestParameters.signupRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2113
2203
  }
2114
2204
  /**
2115
2205
  *
@@ -2120,7 +2210,7 @@ class AuthenticationApi extends BaseAPI {
2120
2210
  * @memberof AuthenticationApi
2121
2211
  */
2122
2212
  thirdParty(requestParameters, options) {
2123
- return AuthenticationApiFp(this.configuration).thirdParty(requestParameters.thirdPartyOAuthRequest, options).then((request) => request(this.axios, this.basePath));
2213
+ return AuthenticationApiFp(this.configuration).thirdParty(requestParameters.thirdPartyOAuthRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
2124
2214
  }
2125
2215
  /**
2126
2216
  *
@@ -2560,10 +2650,11 @@ const TransactionIntentsApiAxiosParamCreator = function (configuration) {
2560
2650
  * Creates a TransactionIntent. A pending TransactionIntent has the `response` attribute as undefined. After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail). When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.
2561
2651
  * @summary Create a transaction intent object.
2562
2652
  * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2653
+ * @param {string} [xBehalfOfProject]
2563
2654
  * @param {*} [options] Override http request option.
2564
2655
  * @throws {RequiredError}
2565
2656
  */
2566
- createTransactionIntent: async (createTransactionIntentRequest, options = {}) => {
2657
+ createTransactionIntent: async (createTransactionIntentRequest, xBehalfOfProject, options = {}) => {
2567
2658
  // verify required parameter 'createTransactionIntentRequest' is not null or undefined
2568
2659
  assertParamExists('createTransactionIntent', 'createTransactionIntentRequest', createTransactionIntentRequest);
2569
2660
  const localVarPath = `/v1/transaction_intents`;
@@ -2579,6 +2670,9 @@ const TransactionIntentsApiAxiosParamCreator = function (configuration) {
2579
2670
  // authentication sk required
2580
2671
  // http bearer authentication required
2581
2672
  await setBearerAuthToObject(localVarHeaderParameter, configuration);
2673
+ if (xBehalfOfProject != null) {
2674
+ localVarHeaderParameter['X-Behalf-Of-Project'] = String(xBehalfOfProject);
2675
+ }
2582
2676
  localVarHeaderParameter['Content-Type'] = 'application/json';
2583
2677
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2584
2678
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -2775,11 +2869,12 @@ const TransactionIntentsApiFp = function (configuration) {
2775
2869
  * Creates a TransactionIntent. A pending TransactionIntent has the `response` attribute as undefined. After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail). When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.
2776
2870
  * @summary Create a transaction intent object.
2777
2871
  * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2872
+ * @param {string} [xBehalfOfProject]
2778
2873
  * @param {*} [options] Override http request option.
2779
2874
  * @throws {RequiredError}
2780
2875
  */
2781
- async createTransactionIntent(createTransactionIntentRequest, options) {
2782
- const localVarAxiosArgs = await localVarAxiosParamCreator.createTransactionIntent(createTransactionIntentRequest, options);
2876
+ async createTransactionIntent(createTransactionIntentRequest, xBehalfOfProject, options) {
2877
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTransactionIntent(createTransactionIntentRequest, xBehalfOfProject, options);
2783
2878
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2784
2879
  },
2785
2880
  /**
@@ -2854,7 +2949,7 @@ class TransactionIntentsApi extends BaseAPI {
2854
2949
  * @memberof TransactionIntentsApi
2855
2950
  */
2856
2951
  createTransactionIntent(requestParameters, options) {
2857
- return TransactionIntentsApiFp(this.configuration).createTransactionIntent(requestParameters.createTransactionIntentRequest, options).then((request) => request(this.axios, this.basePath));
2952
+ return TransactionIntentsApiFp(this.configuration).createTransactionIntent(requestParameters.createTransactionIntentRequest, requestParameters.xBehalfOfProject, options).then((request) => request(this.axios, this.basePath));
2858
2953
  }
2859
2954
  /**
2860
2955
  * Estimate the gas cost of broadcasting a TransactionIntent. This is a simulation, it does not send the transaction on-chain. If a Policy ID is used that includes payment of gas in ERC-20 tokens, an extra field `estimatedTXGasFeeToken` is returned with the estimated amount of tokens that will be used.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/openfort-js",
3
- "version": "0.7.13",
3
+ "version": "0.7.14",
4
4
  "author": "Openfort (https://www.openfort.xyz)",
5
5
  "bugs": "https://github.com/openfort-xyz/openfort-js/issues",
6
6
  "repository": "openfort-xyz/openfort-js.git",