wowok 1.4.22 → 1.4.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wowok",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
4
4
  "description": "Create, collaborate, and transact on your own terms with the AI-driven web3 collaboration protocol.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -13,4 +13,5 @@ export * from './service'
13
13
  export * from './graphql'
14
14
  export * from './entity'
15
15
  export * from './wowok'
16
- export * from './resource'
16
+ export * from './resource'
17
+ export * from './treasury'
package/src/treasury.ts CHANGED
@@ -99,7 +99,7 @@ export class Treasury {
99
99
  if (from_object && !IsValidAddress(from_object)) {
100
100
  ERROR(Errors.IsValidAddress, 'deposit.from_object')
101
101
  }
102
- if (index !== undefined && IsValidU64(index)) {
102
+ if (index !== undefined && !IsValidU64(index)) {
103
103
  ERROR(Errors.InvalidParam, 'deposit.index')
104
104
  }
105
105
  const for_obj = this.txb.pure.option('address', for_object ?? undefined);
@@ -116,7 +116,7 @@ export class Treasury {
116
116
  })
117
117
  } else {
118
118
  return this.txb.moveCall({
119
- target:Protocol.Instance().TreasuryFn('deposit_with_passport') as FnCallType,
119
+ target:Protocol.Instance().TreasuryFn('deposit') as FnCallType,
120
120
  arguments:[Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, coin),
121
121
  this.txb.pure.string(tips), for_obj, idx, from_obj, this.txb.object(clock), Protocol.TXB_OBJECT(this.txb, this.permission)],
122
122
  typeArguments:[this.token_type],
@@ -137,7 +137,7 @@ export class Treasury {
137
137
  if (from_object && !IsValidAddress(from_object)) {
138
138
  ERROR(Errors.IsValidAddress, 'free_deposit.from_object')
139
139
  }
140
- if (index !== undefined && IsValidU64(index)) {
140
+ if (index !== undefined && !IsValidU64(index)) {
141
141
  ERROR(Errors.InvalidParam, 'free_deposit.index')
142
142
  }
143
143
  const for_obj = this.txb.pure.option('address', for_object ?? undefined);
@@ -166,7 +166,7 @@ export class Treasury {
166
166
  if (to_object && !IsValidAddress(to_object)) {
167
167
  ERROR(Errors.IsValidAddress, 'withdraw.to_object')
168
168
  }
169
- if (index !== undefined && IsValidU64(index)) {
169
+ if (index !== undefined && !IsValidU64(index)) {
170
170
  ERROR(Errors.InvalidParam, 'withdraw.index')
171
171
  }
172
172
  const for_obj = this.txb.pure.option('address', for_object ?? undefined);