@misofm/sdk 0.1.0

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 (78) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +248 -0
  3. package/dist/catalog.d.ts +31 -0
  4. package/dist/catalog.d.ts.map +1 -0
  5. package/dist/catalog.js +45 -0
  6. package/dist/catalog.js.map +1 -0
  7. package/dist/client.d.ts +134 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +113 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/contracts/miso_pressing/certificate.d.ts +78 -0
  12. package/dist/contracts/miso_pressing/certificate.d.ts.map +1 -0
  13. package/dist/contracts/miso_pressing/certificate.js +91 -0
  14. package/dist/contracts/miso_pressing/certificate.js.map +1 -0
  15. package/dist/contracts/miso_pressing/deps/std/type_name.d.ts +18 -0
  16. package/dist/contracts/miso_pressing/deps/std/type_name.d.ts.map +1 -0
  17. package/dist/contracts/miso_pressing/deps/std/type_name.js +20 -0
  18. package/dist/contracts/miso_pressing/deps/std/type_name.js.map +1 -0
  19. package/dist/contracts/miso_pressing/listing.d.ts +449 -0
  20. package/dist/contracts/miso_pressing/listing.d.ts.map +1 -0
  21. package/dist/contracts/miso_pressing/listing.js +416 -0
  22. package/dist/contracts/miso_pressing/listing.js.map +1 -0
  23. package/dist/contracts/miso_pressing/pressing.d.ts +365 -0
  24. package/dist/contracts/miso_pressing/pressing.d.ts.map +1 -0
  25. package/dist/contracts/miso_pressing/pressing.js +335 -0
  26. package/dist/contracts/miso_pressing/pressing.js.map +1 -0
  27. package/dist/contracts/utils/index.d.ts +31 -0
  28. package/dist/contracts/utils/index.d.ts.map +1 -0
  29. package/dist/contracts/utils/index.js +162 -0
  30. package/dist/contracts/utils/index.js.map +1 -0
  31. package/dist/execute.d.ts +17 -0
  32. package/dist/execute.d.ts.map +1 -0
  33. package/dist/execute.js +21 -0
  34. package/dist/execute.js.map +1 -0
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +27 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/pressing.d.ts +223 -0
  40. package/dist/pressing.d.ts.map +1 -0
  41. package/dist/pressing.js +280 -0
  42. package/dist/pressing.js.map +1 -0
  43. package/dist/queries.d.ts +2 -0
  44. package/dist/queries.d.ts.map +1 -0
  45. package/dist/queries.js +8 -0
  46. package/dist/queries.js.map +1 -0
  47. package/dist/release-graph.d.ts +93 -0
  48. package/dist/release-graph.d.ts.map +1 -0
  49. package/dist/release-graph.js +143 -0
  50. package/dist/release-graph.js.map +1 -0
  51. package/dist/share-template.d.ts +3 -0
  52. package/dist/share-template.d.ts.map +1 -0
  53. package/dist/share-template.js +46 -0
  54. package/dist/share-template.js.map +1 -0
  55. package/dist/share.d.ts +66 -0
  56. package/dist/share.d.ts.map +1 -0
  57. package/dist/share.js +156 -0
  58. package/dist/share.js.map +1 -0
  59. package/dist/transactions.d.ts +177 -0
  60. package/dist/transactions.d.ts.map +1 -0
  61. package/dist/transactions.js +237 -0
  62. package/dist/transactions.js.map +1 -0
  63. package/package.json +99 -0
  64. package/src/catalog.ts +77 -0
  65. package/src/client.ts +249 -0
  66. package/src/contracts/miso_pressing/certificate.ts +129 -0
  67. package/src/contracts/miso_pressing/deps/std/type_name.ts +22 -0
  68. package/src/contracts/miso_pressing/listing.ts +621 -0
  69. package/src/contracts/miso_pressing/pressing.ts +454 -0
  70. package/src/contracts/utils/index.ts +229 -0
  71. package/src/execute.ts +34 -0
  72. package/src/index.ts +29 -0
  73. package/src/pressing.ts +497 -0
  74. package/src/queries.ts +9 -0
  75. package/src/release-graph.ts +279 -0
  76. package/src/share-template.ts +55 -0
  77. package/src/share.ts +258 -0
  78. package/src/transactions.ts +440 -0
@@ -0,0 +1,129 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * The pressing's certificate on a record.
8
+ *
9
+ * One struct holds everything the sale fixed about a copy: where it sits in the
10
+ * run, and what was paid for it. These were two dynamic fields — a certificate and
11
+ * a receipt — and separating them bought nothing: both are written once, in the
12
+ * same transaction, by the same call, and neither is meaningful without the other.
13
+ *
14
+ * A serial is only meaningful inside the sequence that issued it — a different
15
+ * production package counts from 1 again — so the number never travels alone. It
16
+ * does not need to carry its pressing's id to say which sequence it means: a
17
+ * release has exactly one pressing, at a derived address, so
18
+ * `pressing::derive_id( record.release_id())` recomputes it from the record
19
+ * itself. Storing it would be storing a value that is pure arithmetic on values
20
+ * already present.
21
+ */
22
+
23
+ import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
24
+ import { bcs } from '@mysten/sui/bcs';
25
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
26
+ import * as type_name from './deps/std/type_name.js';
27
+ const $moduleName = '@local-pkg/miso_pressing::certificate';
28
+ export const CertificateKey = new MoveTuple({ name: `${$moduleName}::CertificateKey`, fields: [bcs.bool()] });
29
+ export const Certificate = new MoveStruct({ name: `${$moduleName}::Certificate`, fields: {
30
+ /** Position in the pressing's run (1-based). */
31
+ number: bcs.u64(),
32
+ /** The currency type the buyer paid in. */
33
+ purchase_currency: type_name.TypeName,
34
+ /** The exact amount paid. Under a floor price this includes any tip above it. */
35
+ purchase_price: bcs.u64()
36
+ } });
37
+ export interface OfArguments {
38
+ record: RawTransactionArgument<string>;
39
+ }
40
+ export interface OfOptions {
41
+ package?: string;
42
+ arguments: OfArguments | [
43
+ record: RawTransactionArgument<string>
44
+ ];
45
+ }
46
+ /**
47
+ * The certificate on `record`, or `none` for a record minted by some other
48
+ * package. The only way to read the field, since only this module can construct
49
+ * its key.
50
+ */
51
+ export function _of(options: OfOptions) {
52
+ const packageAddress = options.package ?? '@local-pkg/miso_pressing';
53
+ const argumentsTypes = [
54
+ null
55
+ ] satisfies (string | null)[];
56
+ const parameterNames = ["record"];
57
+ return (tx: Transaction) => tx.moveCall({
58
+ package: packageAddress,
59
+ module: 'certificate',
60
+ function: 'of',
61
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
62
+ });
63
+ }
64
+ export interface NumberArguments {
65
+ self: TransactionArgument;
66
+ }
67
+ export interface NumberOptions {
68
+ package?: string;
69
+ arguments: NumberArguments | [
70
+ self: TransactionArgument
71
+ ];
72
+ }
73
+ export function number(options: NumberOptions) {
74
+ const packageAddress = options.package ?? '@local-pkg/miso_pressing';
75
+ const argumentsTypes = [
76
+ null
77
+ ] satisfies (string | null)[];
78
+ const parameterNames = ["self"];
79
+ return (tx: Transaction) => tx.moveCall({
80
+ package: packageAddress,
81
+ module: 'certificate',
82
+ function: 'number',
83
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
84
+ });
85
+ }
86
+ export interface PurchaseCurrencyArguments {
87
+ self: TransactionArgument;
88
+ }
89
+ export interface PurchaseCurrencyOptions {
90
+ package?: string;
91
+ arguments: PurchaseCurrencyArguments | [
92
+ self: TransactionArgument
93
+ ];
94
+ }
95
+ export function purchaseCurrency(options: PurchaseCurrencyOptions) {
96
+ const packageAddress = options.package ?? '@local-pkg/miso_pressing';
97
+ const argumentsTypes = [
98
+ null
99
+ ] satisfies (string | null)[];
100
+ const parameterNames = ["self"];
101
+ return (tx: Transaction) => tx.moveCall({
102
+ package: packageAddress,
103
+ module: 'certificate',
104
+ function: 'purchase_currency',
105
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
106
+ });
107
+ }
108
+ export interface PurchasePriceArguments {
109
+ self: TransactionArgument;
110
+ }
111
+ export interface PurchasePriceOptions {
112
+ package?: string;
113
+ arguments: PurchasePriceArguments | [
114
+ self: TransactionArgument
115
+ ];
116
+ }
117
+ export function purchasePrice(options: PurchasePriceOptions) {
118
+ const packageAddress = options.package ?? '@local-pkg/miso_pressing';
119
+ const argumentsTypes = [
120
+ null
121
+ ] satisfies (string | null)[];
122
+ const parameterNames = ["self"];
123
+ return (tx: Transaction) => tx.moveCall({
124
+ package: packageAddress,
125
+ module: 'certificate',
126
+ function: 'purchase_price',
127
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
128
+ });
129
+ }
@@ -0,0 +1,22 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /** Functionality for converting Move types into values. Use with care! */
7
+
8
+ import { MoveStruct } from '../../../utils/index.js';
9
+ import { bcs } from '@mysten/sui/bcs';
10
+ const $moduleName = 'std::type_name';
11
+ export const TypeName = new MoveStruct({ name: `${$moduleName}::TypeName`, fields: {
12
+ /**
13
+ * String representation of the type. All types are represented using their source
14
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
15
+ * Struct types are represented as fully qualified type names; e.g.
16
+ * `00000000000000000000000000000001::string::String` or
17
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
18
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
19
+ * 32 depending on the Move platform)
20
+ */
21
+ name: bcs.string()
22
+ } });