@nostra-dev/sdk 0.9.3 → 0.9.5

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/deployments.json CHANGED
@@ -6,7 +6,8 @@
6
6
  "MarketFactory": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
7
7
  "ResolutionOracle": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
8
8
  "CTFExchange": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
9
- "MockUSDC": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
9
+ "MockUSDC": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
10
+ "AleaToken": ""
10
11
  }
11
12
  },
12
13
  "polygon": {
@@ -25,7 +26,8 @@
25
26
  "MarketFactory": "",
26
27
  "CTFExchange": "",
27
28
  "ResolutionOracle": "",
28
- "MockUSDC": ""
29
+ "MockUSDC": "",
30
+ "AleaToken": ""
29
31
  }
30
32
  },
31
33
  "bsc": {
@@ -40,11 +42,12 @@
40
42
  "bscTestnet": {
41
43
  "chainId": 97,
42
44
  "contracts": {
43
- "ConditionalTokens": "0x940FAeD69a0a2f6feD56003AA1Ea7593550769d1",
44
- "MarketFactory": "0xf9E5C2344266e857006156b7207acc9F86170df3",
45
- "ResolutionOracle": "0x651500Aff9E13E71F84150DAEBA472935BAbE8Cd",
46
- "CTFExchange": "0x221CFeE5F50BaD1e6820ECb63Af3C4F40dd9b296",
47
- "MockUSDC": "0xaC81b7939c5bbADC221de6A5bF860FBFD0619F3c"
45
+ "ConditionalTokens": "0x336076382dCcE42BccE75f8B4edA123CC55C7BdE",
46
+ "MarketFactory": "0xCe410990cFD8e5001252e31f7dCE5B0cE0be61A1",
47
+ "ResolutionOracle": "0xA7fc909A7FcA521ce18bBa09F1040311f5C57A29",
48
+ "CTFExchange": "0xfA3B9C0283344620445dbcC054b964D8B3515Db1",
49
+ "MockUSDC": "0xc0F61Bc87f6a1C07BB4BE6bdd150b106B4C5DC22",
50
+ "AleaToken": "0x6ff8d0a154126A0d62ad46D065bB801aa057cF89"
48
51
  }
49
52
  }
50
53
  }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Token constants for Nostra SDK
3
+ * Use these instead of calling decimals() on contracts for efficiency
4
+ */
5
+ /**
6
+ * Alea Token (StablePoint) decimals
7
+ * The stable token for trading in Nostra prediction market
8
+ */
9
+ export declare const ALEA_DECIMALS = 18;
10
+ /**
11
+ * MockUSDC decimals (for testing)
12
+ */
13
+ export declare const MOCK_USDC_DECIMALS = 6;
14
+ /**
15
+ * Alias for ALEA_DECIMALS
16
+ * Generic reference for the stable trading token
17
+ */
18
+ export declare const STABLE_POINT_DECIMALS = 18;
19
+ /**
20
+ * Token metadata
21
+ */
22
+ export declare const ALEA_TOKEN: {
23
+ readonly name: "Alea";
24
+ readonly symbol: "ALEA";
25
+ readonly decimals: 18;
26
+ };
27
+ export declare const MOCK_USDC_TOKEN: {
28
+ readonly name: "Mock USD Coin";
29
+ readonly symbol: "mUSDC";
30
+ readonly decimals: 6;
31
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /**
3
+ * Token constants for Nostra SDK
4
+ * Use these instead of calling decimals() on contracts for efficiency
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.MOCK_USDC_TOKEN = exports.ALEA_TOKEN = exports.STABLE_POINT_DECIMALS = exports.MOCK_USDC_DECIMALS = exports.ALEA_DECIMALS = void 0;
8
+ /**
9
+ * Alea Token (StablePoint) decimals
10
+ * The stable token for trading in Nostra prediction market
11
+ */
12
+ exports.ALEA_DECIMALS = 18;
13
+ /**
14
+ * MockUSDC decimals (for testing)
15
+ */
16
+ exports.MOCK_USDC_DECIMALS = 6;
17
+ /**
18
+ * Alias for ALEA_DECIMALS
19
+ * Generic reference for the stable trading token
20
+ */
21
+ exports.STABLE_POINT_DECIMALS = exports.ALEA_DECIMALS;
22
+ /**
23
+ * Token metadata
24
+ */
25
+ exports.ALEA_TOKEN = {
26
+ name: 'Alea',
27
+ symbol: 'ALEA',
28
+ decimals: exports.ALEA_DECIMALS,
29
+ };
30
+ exports.MOCK_USDC_TOKEN = {
31
+ name: 'Mock USD Coin',
32
+ symbol: 'mUSDC',
33
+ decimals: exports.MOCK_USDC_DECIMALS,
34
+ };
@@ -13,7 +13,8 @@ export declare const MarketFactoryABI: any[];
13
13
  export declare const CTFExchangeABI: any[];
14
14
  export declare const ResolutionOracleABI: any[];
15
15
  export declare const MockUSDCABI: any[];
16
+ export declare const AleaTokenABI: any[];
16
17
  /**
17
18
  * Get ABI for a contract
18
19
  */
19
- export declare function getContractABI(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC'): any[];
20
+ export declare function getContractABI(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC' | 'AleaToken'): any[];
@@ -6,7 +6,7 @@
6
6
  * DO NOT EDIT MANUALLY.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.MockUSDCABI = exports.ResolutionOracleABI = exports.CTFExchangeABI = exports.MarketFactoryABI = exports.ConditionalTokensABI = void 0;
9
+ exports.AleaTokenABI = exports.MockUSDCABI = exports.ResolutionOracleABI = exports.CTFExchangeABI = exports.MarketFactoryABI = exports.ConditionalTokensABI = void 0;
10
10
  exports.getContractABI = getContractABI;
11
11
  /**
12
12
  * Placeholder for contract ABIs
@@ -17,6 +17,7 @@ exports.MarketFactoryABI = [];
17
17
  exports.CTFExchangeABI = [];
18
18
  exports.ResolutionOracleABI = [];
19
19
  exports.MockUSDCABI = [];
20
+ exports.AleaTokenABI = [];
20
21
  /**
21
22
  * Get ABI for a contract
22
23
  */
@@ -32,6 +33,8 @@ function getContractABI(contractName) {
32
33
  return exports.ResolutionOracleABI;
33
34
  case 'MockUSDC':
34
35
  return exports.MockUSDCABI;
36
+ case 'AleaToken':
37
+ return exports.AleaTokenABI;
35
38
  default:
36
39
  throw new Error(`Unknown contract: ${contractName}`);
37
40
  }
@@ -16,7 +16,7 @@ export declare const deployments: Deployments;
16
16
  /**
17
17
  * Get contract address for a specific network
18
18
  */
19
- export declare function getContractAddress(network: Network, contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC'): string | undefined;
19
+ export declare function getContractAddress(network: Network, contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC' | 'AleaToken'): string | undefined;
20
20
  /**
21
21
  * Get all contract addresses for a network
22
22
  */
@@ -26,6 +26,7 @@ export declare function getNetworkAddresses(network: Network): {
26
26
  CTFExchange: ContractDeployment;
27
27
  ResolutionOracle: ContractDeployment;
28
28
  MockUSDC?: ContractDeployment;
29
+ AleaToken?: ContractDeployment;
29
30
  } | undefined;
30
31
  /**
31
32
  * Check if a network has deployments
@@ -72,6 +72,9 @@ function buildDeployments() {
72
72
  ...(deployment.contracts.MockUSDC && {
73
73
  MockUSDC: createDeployment(deployment.contracts.MockUSDC),
74
74
  }),
75
+ ...(deployment.contracts.AleaToken && {
76
+ AleaToken: createDeployment(deployment.contracts.AleaToken),
77
+ }),
75
78
  },
76
79
  };
77
80
  }
package/dist/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from './generated/addresses';
9
9
  export * from './generated/abis';
10
10
  export * from './utils/contracts';
11
11
  export * from './types';
12
+ export * from './constants';
package/dist/index.js CHANGED
@@ -25,3 +25,4 @@ __exportStar(require("./generated/addresses"), exports);
25
25
  __exportStar(require("./generated/abis"), exports);
26
26
  __exportStar(require("./utils/contracts"), exports);
27
27
  __exportStar(require("./types"), exports);
28
+ __exportStar(require("./constants"), exports);
package/dist/types.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface NetworkDeployment {
28
28
  CTFExchange: ContractDeployment;
29
29
  ResolutionOracle: ContractDeployment;
30
30
  MockUSDC?: ContractDeployment;
31
+ AleaToken?: ContractDeployment;
31
32
  };
32
33
  }
33
34
  /**
@@ -6,7 +6,7 @@ import { Network } from '../types';
6
6
  /**
7
7
  * Get a contract instance
8
8
  */
9
- export declare function getContract(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC', network: Network, signerOrProvider: Signer | Provider): Contract;
9
+ export declare function getContract(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC' | 'AleaToken', network: Network, signerOrProvider: Signer | Provider): Contract;
10
10
  /**
11
11
  * Get ConditionalTokens contract instance
12
12
  */
@@ -27,3 +27,13 @@ export declare function getResolutionOracle(network: Network, signerOrProvider:
27
27
  * Get MockUSDC contract instance (only available on test networks)
28
28
  */
29
29
  export declare function getMockUSDC(network: Network, signerOrProvider: Signer | Provider): Contract;
30
+ /**
31
+ * Get AleaToken contract instance
32
+ * Alea is the stable token for trading in Nostra prediction market (18 decimals)
33
+ */
34
+ export declare function getAleaToken(network: Network, signerOrProvider: Signer | Provider): Contract;
35
+ /**
36
+ * Get StablePoint (AleaToken) contract instance
37
+ * Alias for getAleaToken - provides a generic reference for the stable trading token
38
+ */
39
+ export declare function getStablePoint(network: Network, signerOrProvider: Signer | Provider): Contract;
@@ -9,6 +9,8 @@ exports.getMarketFactory = getMarketFactory;
9
9
  exports.getCTFExchange = getCTFExchange;
10
10
  exports.getResolutionOracle = getResolutionOracle;
11
11
  exports.getMockUSDC = getMockUSDC;
12
+ exports.getAleaToken = getAleaToken;
13
+ exports.getStablePoint = getStablePoint;
12
14
  const ethers_1 = require("ethers");
13
15
  const addresses_1 = require("../generated/addresses");
14
16
  const abis_1 = require("../generated/abis");
@@ -53,3 +55,17 @@ function getResolutionOracle(network, signerOrProvider) {
53
55
  function getMockUSDC(network, signerOrProvider) {
54
56
  return getContract('MockUSDC', network, signerOrProvider);
55
57
  }
58
+ /**
59
+ * Get AleaToken contract instance
60
+ * Alea is the stable token for trading in Nostra prediction market (18 decimals)
61
+ */
62
+ function getAleaToken(network, signerOrProvider) {
63
+ return getContract('AleaToken', network, signerOrProvider);
64
+ }
65
+ /**
66
+ * Get StablePoint (AleaToken) contract instance
67
+ * Alias for getAleaToken - provides a generic reference for the stable trading token
68
+ */
69
+ function getStablePoint(network, signerOrProvider) {
70
+ return getAleaToken(network, signerOrProvider);
71
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nostra-dev/sdk",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "TypeScript SDK for interacting with Nostra Prediction Market contracts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",