@fastnear/borsh-schema 0.6.2 → 0.7.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.
@@ -1,5 +1,6 @@
1
- /* ⋈ 🏃🏻💨 FastNEAR Borsh Schema - IIFE/UMD (@fastnear/borsh-schema version 0.6.1) */
2
- /* https://www.npmjs.com/package/@fastnear/borsh-schema/v/0.6.1 */
1
+ /* ⋈ 🏃🏻💨 FastNEAR Borsh Schema - IIFE/UMD (@fastnear/borsh-schema version 0.6.3) */
2
+ /* https://www.npmjs.com/package/@fastnear/borsh-schema/v/0.6.3 */
3
+ "use strict";
3
4
  var NearBorshSchema = (() => {
4
5
  var __defProp = Object.defineProperty;
5
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -23,182 +24,176 @@ var NearBorshSchema = (() => {
23
24
  // src/index.ts
24
25
  var src_exports = {};
25
26
  __export(src_exports, {
26
- getBorshSchema: () => getBorshSchema
27
+ getBorshSchema: () => getBorshSchema,
28
+ nearChainSchema: () => nearChainSchema
27
29
  });
28
- var getBorshSchema = (() => {
29
- class BorshSchema {
30
- static {
31
- __name(this, "BorshSchema");
32
- }
33
- Ed25519Signature = {
34
- struct: {
35
- data: { array: { type: "u8", len: 64 } }
36
- }
37
- };
38
- Secp256k1Signature = {
39
- struct: {
40
- data: { array: { type: "u8", len: 65 } }
41
- }
42
- };
43
- Signature = {
44
- enum: [
45
- { struct: { ed25519Signature: this.Ed25519Signature } },
46
- { struct: { secp256k1Signature: this.Secp256k1Signature } }
47
- ]
48
- };
49
- Ed25519Data = {
50
- struct: {
51
- data: { array: { type: "u8", len: 32 } }
52
- }
53
- };
54
- Secp256k1Data = {
55
- struct: {
56
- data: { array: { type: "u8", len: 64 } }
57
- }
58
- };
59
- PublicKey = {
60
- enum: [
61
- { struct: { ed25519Key: this.Ed25519Data } },
62
- { struct: { secp256k1Key: this.Secp256k1Data } }
63
- ]
64
- };
65
- FunctionCallPermission = {
66
- struct: {
67
- allowance: { option: "u128" },
68
- receiverId: "string",
69
- methodNames: { array: { type: "string" } }
70
- }
71
- };
72
- FullAccessPermission = {
73
- struct: {}
74
- };
75
- AccessKeyPermission = {
76
- enum: [
77
- { struct: { functionCall: this.FunctionCallPermission } },
78
- { struct: { fullAccess: this.FullAccessPermission } }
79
- ]
80
- };
81
- AccessKey = {
82
- struct: {
83
- nonce: "u64",
84
- permission: this.AccessKeyPermission
85
- }
86
- };
87
- CreateAccount = {
88
- struct: {}
89
- };
90
- DeployContract = {
91
- struct: {
92
- code: { array: { type: "u8" } }
93
- }
94
- };
95
- FunctionCall = {
96
- struct: {
97
- methodName: "string",
98
- args: { array: { type: "u8" } },
99
- gas: "u64",
100
- deposit: "u128"
101
- }
102
- };
103
- Transfer = {
104
- struct: {
105
- deposit: "u128"
106
- }
107
- };
108
- Stake = {
109
- struct: {
110
- stake: "u128",
111
- publicKey: this.PublicKey
112
- }
113
- };
114
- AddKey = {
115
- struct: {
116
- publicKey: this.PublicKey,
117
- accessKey: this.AccessKey
118
- }
119
- };
120
- DeleteKey = {
121
- struct: {
122
- publicKey: this.PublicKey
123
- }
124
- };
125
- DeleteAccount = {
126
- struct: {
127
- beneficiaryId: "string"
128
- }
129
- };
130
- ClassicAction = {
131
- enum: [
132
- { struct: { createAccount: this.CreateAccount } },
133
- { struct: { deployContract: this.DeployContract } },
134
- { struct: { functionCall: this.FunctionCall } },
135
- { struct: { transfer: this.Transfer } },
136
- { struct: { stake: this.Stake } },
137
- { struct: { addKey: this.AddKey } },
138
- { struct: { deleteKey: this.DeleteKey } },
139
- { struct: { deleteAccount: this.DeleteAccount } }
140
- ]
141
- };
142
- DelegateAction = {
143
- struct: {
144
- senderId: "string",
145
- receiverId: "string",
146
- actions: { array: { type: this.ClassicAction } },
147
- nonce: "u64",
148
- maxBlockHeight: "u64",
149
- publicKey: this.PublicKey
150
- }
151
- };
152
- SignedDelegate = {
153
- struct: {
154
- delegateAction: this.DelegateAction,
155
- signature: this.Signature
156
- }
157
- };
158
- Action = {
159
- enum: [
160
- { struct: { createAccount: this.CreateAccount } },
161
- { struct: { deployContract: this.DeployContract } },
162
- { struct: { functionCall: this.FunctionCall } },
163
- { struct: { transfer: this.Transfer } },
164
- { struct: { stake: this.Stake } },
165
- { struct: { addKey: this.AddKey } },
166
- { struct: { deleteKey: this.DeleteKey } },
167
- { struct: { deleteAccount: this.DeleteAccount } },
168
- { struct: { signedDelegate: this.SignedDelegate } }
169
- ]
170
- };
171
- Transaction = {
172
- struct: {
173
- signerId: "string",
174
- publicKey: this.PublicKey,
175
- nonce: "u64",
176
- receiverId: "string",
177
- blockHash: { array: { type: "u8", len: 32 } },
178
- actions: { array: { type: this.Action } }
179
- }
180
- };
181
- SignedTransaction = {
182
- struct: {
183
- transaction: this.Transaction,
184
- signature: this.Signature
185
- }
186
- };
30
+ var nearChainSchema = new class BorshSchema {
31
+ static {
32
+ __name(this, "BorshSchema");
187
33
  }
188
- return new BorshSchema();
189
- })();
34
+ Ed25519Signature = {
35
+ struct: {
36
+ data: { array: { type: "u8", len: 64 } }
37
+ }
38
+ };
39
+ Secp256k1Signature = {
40
+ struct: {
41
+ data: { array: { type: "u8", len: 65 } }
42
+ }
43
+ };
44
+ Signature = {
45
+ enum: [
46
+ { struct: { ed25519Signature: this.Ed25519Signature } },
47
+ { struct: { secp256k1Signature: this.Secp256k1Signature } }
48
+ ]
49
+ };
50
+ Ed25519Data = {
51
+ struct: {
52
+ data: { array: { type: "u8", len: 32 } }
53
+ }
54
+ };
55
+ Secp256k1Data = {
56
+ struct: {
57
+ data: { array: { type: "u8", len: 64 } }
58
+ }
59
+ };
60
+ PublicKey = {
61
+ enum: [
62
+ { struct: { ed25519Key: this.Ed25519Data } },
63
+ { struct: { secp256k1Key: this.Secp256k1Data } }
64
+ ]
65
+ };
66
+ FunctionCallPermission = {
67
+ struct: {
68
+ allowance: { option: "u128" },
69
+ receiverId: "string",
70
+ methodNames: { array: { type: "string" } }
71
+ }
72
+ };
73
+ FullAccessPermission = {
74
+ struct: {}
75
+ };
76
+ AccessKeyPermission = {
77
+ enum: [
78
+ { struct: { functionCall: this.FunctionCallPermission } },
79
+ { struct: { fullAccess: this.FullAccessPermission } }
80
+ ]
81
+ };
82
+ AccessKey = {
83
+ struct: {
84
+ nonce: "u64",
85
+ permission: this.AccessKeyPermission
86
+ }
87
+ };
88
+ CreateAccount = {
89
+ struct: {}
90
+ };
91
+ DeployContract = {
92
+ struct: {
93
+ code: { array: { type: "u8" } }
94
+ }
95
+ };
96
+ FunctionCall = {
97
+ struct: {
98
+ methodName: "string",
99
+ args: { array: { type: "u8" } },
100
+ gas: "u64",
101
+ deposit: "u128"
102
+ }
103
+ };
104
+ Transfer = {
105
+ struct: {
106
+ deposit: "u128"
107
+ }
108
+ };
109
+ Stake = {
110
+ struct: {
111
+ stake: "u128",
112
+ publicKey: this.PublicKey
113
+ }
114
+ };
115
+ AddKey = {
116
+ struct: {
117
+ publicKey: this.PublicKey,
118
+ accessKey: this.AccessKey
119
+ }
120
+ };
121
+ DeleteKey = {
122
+ struct: {
123
+ publicKey: this.PublicKey
124
+ }
125
+ };
126
+ DeleteAccount = {
127
+ struct: {
128
+ beneficiaryId: "string"
129
+ }
130
+ };
131
+ ClassicAction = {
132
+ enum: [
133
+ { struct: { createAccount: this.CreateAccount } },
134
+ { struct: { deployContract: this.DeployContract } },
135
+ { struct: { functionCall: this.FunctionCall } },
136
+ { struct: { transfer: this.Transfer } },
137
+ { struct: { stake: this.Stake } },
138
+ { struct: { addKey: this.AddKey } },
139
+ { struct: { deleteKey: this.DeleteKey } },
140
+ { struct: { deleteAccount: this.DeleteAccount } }
141
+ ]
142
+ };
143
+ DelegateAction = {
144
+ struct: {
145
+ senderId: "string",
146
+ receiverId: "string",
147
+ actions: { array: { type: this.ClassicAction } },
148
+ nonce: "u64",
149
+ maxBlockHeight: "u64",
150
+ publicKey: this.PublicKey
151
+ }
152
+ };
153
+ SignedDelegate = {
154
+ struct: {
155
+ delegateAction: this.DelegateAction,
156
+ signature: this.Signature
157
+ }
158
+ };
159
+ Action = {
160
+ enum: [
161
+ { struct: { createAccount: this.CreateAccount } },
162
+ { struct: { deployContract: this.DeployContract } },
163
+ { struct: { functionCall: this.FunctionCall } },
164
+ { struct: { transfer: this.Transfer } },
165
+ { struct: { stake: this.Stake } },
166
+ { struct: { addKey: this.AddKey } },
167
+ { struct: { deleteKey: this.DeleteKey } },
168
+ { struct: { deleteAccount: this.DeleteAccount } },
169
+ { struct: { signedDelegate: this.SignedDelegate } }
170
+ ]
171
+ };
172
+ Transaction = {
173
+ struct: {
174
+ signerId: "string",
175
+ publicKey: this.PublicKey,
176
+ nonce: "u64",
177
+ receiverId: "string",
178
+ blockHash: { array: { type: "u8", len: 32 } },
179
+ actions: { array: { type: this.Action } }
180
+ }
181
+ };
182
+ SignedTransaction = {
183
+ struct: {
184
+ transaction: this.Transaction,
185
+ signature: this.Signature
186
+ }
187
+ };
188
+ }();
189
+ var getBorshSchema = /* @__PURE__ */ __name(() => nearChainSchema, "getBorshSchema");
190
190
  return __toCommonJS(src_exports);
191
191
  })();
192
192
 
193
- if (typeof globalThis.NearBorshSchema === 'undefined') {
194
- console.warn('No globalThis.NearBorshSchema');
195
- } else {
196
- Object.defineProperty(globalThis, 'NearBorshSchema', {
197
- value: globalThis.NearBorshSchema,
198
- writable: false,
199
- enumerable: true,
200
- configurable: false,
201
- });
202
- }
193
+ Object.defineProperty(globalThis, 'NearBorshSchema', {
194
+ value: NearBorshSchema,
195
+ enumerable: true,
196
+ configurable: false,
197
+ });
203
198
 
204
199
  //# sourceMappingURL=browser.global.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export const getBorshSchema = (() => {\n class BorshSchema {\n Ed25519Signature = {\n struct: {\n data: { array: { type: \"u8\", len: 64 } },\n },\n };\n Secp256k1Signature = {\n struct: {\n data: { array: { type: \"u8\", len: 65 } },\n },\n };\n Signature = {\n enum: [\n { struct: { ed25519Signature: this.Ed25519Signature } },\n { struct: { secp256k1Signature: this.Secp256k1Signature } },\n ],\n };\n Ed25519Data = {\n struct: {\n data: { array: { type: \"u8\", len: 32 } },\n },\n };\n Secp256k1Data = {\n struct: {\n data: { array: { type: \"u8\", len: 64 } },\n },\n };\n PublicKey = {\n enum: [\n { struct: { ed25519Key: this.Ed25519Data } },\n { struct: { secp256k1Key: this.Secp256k1Data } },\n ],\n };\n FunctionCallPermission = {\n struct: {\n allowance: { option: \"u128\" },\n receiverId: \"string\",\n methodNames: { array: { type: \"string\" } },\n },\n };\n FullAccessPermission = {\n struct: {},\n };\n AccessKeyPermission = {\n enum: [\n { struct: { functionCall: this.FunctionCallPermission } },\n { struct: { fullAccess: this.FullAccessPermission } },\n ],\n };\n AccessKey = {\n struct: {\n nonce: \"u64\",\n permission: this.AccessKeyPermission,\n },\n };\n CreateAccount = {\n struct: {},\n };\n DeployContract = {\n struct: {\n code: { array: { type: \"u8\" } },\n },\n };\n FunctionCall = {\n struct: {\n methodName: \"string\",\n args: { array: { type: \"u8\" } },\n gas: \"u64\",\n deposit: \"u128\",\n },\n };\n Transfer = {\n struct: {\n deposit: \"u128\",\n },\n };\n Stake = {\n struct: {\n stake: \"u128\",\n publicKey: this.PublicKey,\n },\n };\n AddKey = {\n struct: {\n publicKey: this.PublicKey,\n accessKey: this.AccessKey,\n },\n };\n DeleteKey = {\n struct: {\n publicKey: this.PublicKey,\n },\n };\n DeleteAccount = {\n struct: {\n beneficiaryId: \"string\",\n },\n };\n ClassicAction = {\n enum: [\n { struct: { createAccount: this.CreateAccount } },\n { struct: { deployContract: this.DeployContract } },\n { struct: { functionCall: this.FunctionCall } },\n { struct: { transfer: this.Transfer } },\n { struct: { stake: this.Stake } },\n { struct: { addKey: this.AddKey } },\n { struct: { deleteKey: this.DeleteKey } },\n { struct: { deleteAccount: this.DeleteAccount } },\n ],\n };\n DelegateAction = {\n struct: {\n senderId: \"string\",\n receiverId: \"string\",\n actions: { array: { type: this.ClassicAction } },\n nonce: \"u64\",\n maxBlockHeight: \"u64\",\n publicKey: this.PublicKey,\n },\n };\n SignedDelegate = {\n struct: {\n delegateAction: this.DelegateAction,\n signature: this.Signature,\n },\n };\n Action = {\n enum: [\n { struct: { createAccount: this.CreateAccount } },\n { struct: { deployContract: this.DeployContract } },\n { struct: { functionCall: this.FunctionCall } },\n { struct: { transfer: this.Transfer } },\n { struct: { stake: this.Stake } },\n { struct: { addKey: this.AddKey } },\n { struct: { deleteKey: this.DeleteKey } },\n { struct: { deleteAccount: this.DeleteAccount } },\n { struct: { signedDelegate: this.SignedDelegate } },\n ],\n };\n Transaction = {\n struct: {\n signerId: \"string\",\n publicKey: this.PublicKey,\n nonce: \"u64\",\n receiverId: \"string\",\n blockHash: { array: { type: \"u8\", len: 32 } },\n actions: { array: { type: this.Action } },\n },\n };\n SignedTransaction = {\n struct: {\n transaction: this.Transaction,\n signature: this.Signature,\n },\n };\n }\n return new BorshSchema();\n})();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,kBAAkB,MAAM;AAAA,IACnC,MAAM,YAAY;AAAA,MADpB,OACoB;AAAA;AAAA;AAAA,MAChB,mBAAmB;AAAA,QACjB,QAAQ;AAAA,UACN,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,KAAK,GAAG,EAAE;AAAA,QACzC;AAAA,MACF;AAAA,MACA,qBAAqB;AAAA,QACnB,QAAQ;AAAA,UACN,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,KAAK,GAAG,EAAE;AAAA,QACzC;AAAA,MACF;AAAA,MACA,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,EAAE,QAAQ,EAAE,kBAAkB,KAAK,iBAAiB,EAAE;AAAA,UACtD,EAAE,QAAQ,EAAE,oBAAoB,KAAK,mBAAmB,EAAE;AAAA,QAC5D;AAAA,MACF;AAAA,MACA,cAAc;AAAA,QACZ,QAAQ;AAAA,UACN,MAAM,EAAE,OAAO,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AS;AAAA,QACP,MAAM;AAAA,UACJ,EAAE,QAAQ,EAAE,eAAe,KAAK,cAAc,EAAE;AAAA,UAChD,EAAE,QAAQ,EAAE,gBAAgB,KAAK,eAAe,EAAE;AAAA,UAClD,EAAE,QAAQ,EAAE,cAAc,KAAK,aAAa,EAAE;AAAA,UAC9C,EAAE,QAAQ,EAAE,UAAU,KAAK,SAAS,EAAE;AAAA,UACtC,EAAE,QAAQ,EAAE,OAAO,KAAK,MAAM,EAAE;AAAA,UAChC,EAAE,QAAQ,EAAE,QAAQ,KAAK,OAAO,EAAE;AAAA,UAClC,EAAE,QAAQ,EAAE,WAAW,KAAK,UAAU,EAAE;AAAA,UACxC,EAAE,QAAQ,EAAE,eAAe,KAAK,cAAc,EAAE;AAAA,UAChD,EAAE,QAAQ,EAAE,gBAAgB,KAAK,eAAe,EAAE;AAAA,QACpD;AAAA,MACF;AAAA,MACA,cAAc;AAAA,QACZ,QAAQ;AAAA,UACN,UAAU;AAAA,UACV,WAAW,KAAK;AAAA,UAChB,OAAO;AAAA,UACP,YAAY;AAAA,UACZ,WAAW,EAAE,OAAO,EAAE,MAAM,MAAM,KAAK,GAAG,EAAE;AAAA,UAC5C,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,EAAE;AAAA,QAC1C;AAAA,MACF;AAAA,MACA,oBAAoB;AAAA,QAClB,QAAQ;AAAA,UACN,aAAa,KAAK;AAAA,UAClB,WAAW,KAAK;AAAA,QAClB;AAAA,MACF;AAAA,IACF;AACA,WAAO,IAAI,YAAY;AAAA,EACzB,GAAG;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import { Schema } from \"borsh\"\n\nexport const nearChainSchema = new (class BorshSchema {\n Ed25519Signature: Schema = {\n struct: {\n data: { array: { type: \"u8\", len: 64 } },\n },\n };\n Secp256k1Signature: Schema = {\n struct: {\n data: { array: { type: \"u8\", len: 65 } },\n },\n };\n Signature: Schema = {\n enum: [\n { struct: { ed25519Signature: this.Ed25519Signature } },\n { struct: { secp256k1Signature: this.Secp256k1Signature } },\n ],\n };\n Ed25519Data: Schema = {\n struct: {\n data: { array: { type: \"u8\", len: 32 } },\n },\n };\n Secp256k1Data: Schema = {\n struct: {\n data: { array: { type: \"u8\", len: 64 } },\n },\n };\n PublicKey: Schema = {\n enum: [\n { struct: { ed25519Key: this.Ed25519Data } },\n { struct: { secp256k1Key: this.Secp256k1Data } },\n ],\n };\n FunctionCallPermission: Schema = {\n struct: {\n allowance: { option: \"u128\" },\n receiverId: \"string\",\n methodNames: { array: { type: \"string\" } },\n },\n };\n FullAccessPermission: Schema = {\n struct: {},\n };\n AccessKeyPermission: Schema = {\n enum: [\n { struct: { functionCall: this.FunctionCallPermission } },\n { struct: { fullAccess: this.FullAccessPermission } },\n ],\n };\n AccessKey: Schema = {\n struct: {\n nonce: \"u64\",\n permission: this.AccessKeyPermission,\n },\n };\n CreateAccount: Schema = {\n struct: {},\n };\n DeployContract: Schema = {\n struct: {\n code: { array: { type: \"u8\" } },\n },\n };\n FunctionCall: Schema = {\n struct: {\n methodName: \"string\",\n args: { array: { type: \"u8\" } },\n gas: \"u64\",\n deposit: \"u128\",\n },\n };\n Transfer: Schema = {\n struct: {\n deposit: \"u128\",\n },\n };\n Stake: Schema = {\n struct: {\n stake: \"u128\",\n publicKey: this.PublicKey,\n },\n };\n AddKey: Schema = {\n struct: {\n publicKey: this.PublicKey,\n accessKey: this.AccessKey,\n },\n };\n DeleteKey: Schema = {\n struct: {\n publicKey: this.PublicKey,\n },\n };\n DeleteAccount: Schema = {\n struct: {\n beneficiaryId: \"string\",\n },\n };\n ClassicAction: Schema = {\n enum: [\n { struct: { createAccount: this.CreateAccount } },\n { struct: { deployContract: this.DeployContract } },\n { struct: { functionCall: this.FunctionCall } },\n { struct: { transfer: this.Transfer } },\n { struct: { stake: this.Stake } },\n { struct: { addKey: this.AddKey } },\n { struct: { deleteKey: this.DeleteKey } },\n { struct: { deleteAccount: this.DeleteAccount } },\n ],\n };\n DelegateAction: Schema = {\n struct: {\n senderId: \"string\",\n receiverId: \"string\",\n actions: { array: { type: this.ClassicAction } },\n nonce: \"u64\",\n maxBlockHeight: \"u64\",\n publicKey: this.PublicKey,\n },\n };\n SignedDelegate: Schema = {\n struct: {\n delegateAction: this.DelegateAction,\n signature: this.Signature,\n },\n };\n Action: Schema = {\n enum: [\n { struct: { createAccount: this.CreateAccount } },\n { struct: { deployContract: this.DeployContract } },\n { struct: { functionCall: this.FunctionCall } },\n { struct: { transfer: this.Transfer } },\n { struct: { stake: this.Stake } },\n { struct: { addKey: this.AddKey } },\n { struct: { deleteKey: this.DeleteKey } },\n { struct: { deleteAccount: this.DeleteAccount } },\n { struct: { signedDelegate: this.SignedDelegate } },\n ],\n };\n Transaction: Schema = {\n struct: {\n signerId: \"string\",\n publicKey: this.PublicKey,\n nonce: \"u64\",\n receiverId: \"string\",\n blockHash: { array: { type: \"u8\", len: 32 } },\n actions: { array: { type: this.Action } },\n },\n };\n SignedTransaction: Schema = {\n struct: {\n transaction: this.Transaction,\n signature: this.Signature,\n },\n };\n})();\n\nexport const getBorshSchema = () => nearChainSchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,kBAAkB,IAAK,MAAM,YAAY;AAAA,IAFtD,OAEsD;AAAA;AAAA;AAAA,IACpD,mBAA2B;AAAA,MACzB,QAAQ;AAAA,QACN,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,KAAK,GAAG,EAAE;AAAA,MACzC;AAAA,IACF;AAAA,IACA,qBAA6B;AAAA,MAC3B,QAAQ;AAAA,QACN,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,KAAK,GAAG,EAAE;AAAA,MACzC;AAAA,IACF;AAAA,IACA,YAAoB;AAAA,MAClB,MAAM;AAAA,QACJ,EAAE,QAAQ,EAAE,kBAAkB,KAAK,iBAAiB,EAAE;AAAA,QACtD,EAAE,QAAQ,EAAE,oBAAoB,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;AAAA,IACF;AAAA,IACA,iBAAyB;AAAA,MACvB,QAAQ;AAAA,QACN,gBAAgB,KAAK;AAAA,QACrB,WAAW,KAAK;AAAA,MAClB;AAAA,IACF;AAAA,IACA,SAAiB;AAAA,MACf,MAAM;AAAA,QACJ,EAAE,QAAQ,EAAE,eAAe,KAAK,cAAc,EAAE;AAAA,QAChD,EAAE,QAAQ,EAAE,gBAAgB,KAAK,eAAe,EAAE;AAAA,QAClD,EAAE,QAAQ,EAAE,cAAc,KAAK,aAAa,EAAE;AAAA,QAC9C,EAAE,QAAQ,EAAE,UAAU,KAAK,SAAS,EAAE;AAAA,QACtC,EAAE,QAAQ,EAAE,OAAO,KAAK,MAAM,EAAE;AAAA,QAChC,EAAE,QAAQ,EAAE,QAAQ,KAAK,OAAO,EAAE;AAAA,QAClC,EAAE,QAAQ,EAAE,WAAW,KAAK,UAAU,EAAE;AAAA,QACxC,EAAE,QAAQ,EAAE,eAAe,KAAK,cAAc,EAAE;AAAA,QAChD,EAAE,QAAQ,EAAE,gBAAgB,KAAK,eAAe,EAAE;AAAA,MACpD;AAAA,IACF;AAAA,IACA,cAAsB;AAAA,MACpB,QAAQ;AAAA,QACN,UAAU;AAAA,QACV,WAAW,KAAK;AAAA,QAChB,OAAO;AAAA,QACP,YAAY;AAAA,QACZ,WAAW,EAAE,OAAO,EAAE,MAAM,MAAM,KAAK,GAAG,EAAE;AAAA,QAC5C,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,EAAE;AAAA,MAC1C;AAAA,IACF;AAAA,IACA,oBAA4B;AAAA,MAC1B,QAAQ;AAAA,QACN,aAAa,KAAK;AAAA,QAClB,WAAW,KAAK;AAAA,MAClB;AAAA,IACF;AAAA,EACF,EAAG;AAEI,MAAM,iBAAiB,6BAAM,iBAAN;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fastnear/borsh-schema",
3
- "version": "0.6.2",
4
- "description": "Single export of NEAR Protocol's borsh schema for common applications",
3
+ "version": "0.7.0",
4
+ "description": "NEAR Protocol's borsh schema for common applications",
5
5
  "type": "module",
6
6
  "types": "./dist/esm/index.d.ts",
7
7
  "main": "./dist/cjs/index.cjs",
@@ -29,6 +29,7 @@
29
29
  }
30
30
  },
31
31
  "devDependencies": {
32
+ "@types/node": "*",
32
33
  "rimraf": "*",
33
34
  "tsup": "*",
34
35
  "typescript": "*"