@vela-ventures/aosync-sdk-react 1.0.5 → 1.0.6

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/README.md CHANGED
@@ -91,16 +91,16 @@ export default WalletComponent;
91
91
 
92
92
  The `useWallet` hook provides the following methods and properties:
93
93
 
94
- | Method/Property | Description |
95
- | -------------------------------------------- | ---------------------------------------------- |
96
- | `isConnected` | Boolean indicating if the wallet is connected. |
97
- | `connect()` | Connects to the wallet. |
98
- | `disconnect()` | Disconnects from the wallet. |
99
- | `getAddress()` | Returns the currently active wallet address. |
100
- | `getAllAddresses()` | Returns all wallet addresses. |
101
- | `sendAR(recipient, quantity)` | Sends AR to the specified address. |
102
- | `sign(transaction)` | Signs a transaction using the wallet. |
103
- | `signAOMessage(target, recipient, quantity)` | Signs a custom AO message. |
94
+ | Method/Property | Description |
95
+ | -------------------------------------------------- | ---------------------------------------------- |
96
+ | `isConnected` | Boolean indicating if the wallet is connected. |
97
+ | `connect()` | Connects to the wallet. |
98
+ | `disconnect()` | Disconnects from the wallet. |
99
+ | `getAddress()` | Returns the currently active wallet address. |
100
+ | `getAllAddresses()` | Returns all wallet addresses. |
101
+ | `sendAR(recipient, quantity)` | Sends AR to the specified address. |
102
+ | `sign(transaction)` | Signs a transaction using the wallet. |
103
+ | `signAOMessage(target, tags, data)` | Signs an ANS-104 Data Item. |
104
104
 
105
105
  ## License
106
106
 
package/dist/types.d.ts CHANGED
@@ -6,6 +6,9 @@ export interface AOSyncSDKContext {
6
6
  getAllAddresses: () => Promise<string[]>;
7
7
  getAddress: () => Promise<string | undefined>;
8
8
  sendAR: (recipient: string, quantity: string) => Promise<any>;
9
- signAOMessage: (target: string, recipient: string, quantity: string) => Promise<any>;
9
+ signAOMessage: (target: string, tags: {
10
+ name: string;
11
+ value: string;
12
+ }[], data: string) => Promise<any>;
10
13
  sign: (transaction: Transaction) => Promise<Transaction>;
11
14
  }
@@ -81,19 +81,18 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
81
81
  throw error;
82
82
  }
83
83
  });
84
- const signAOMessage = (target, recipient, quantity) => __awaiter(this, void 0, void 0, function* () {
84
+ const signAOMessage = (target, tags, data) => __awaiter(this, void 0, void 0, function* () {
85
85
  try {
86
86
  const dataItem = {
87
- data: "",
87
+ data: data,
88
88
  target,
89
89
  tags: [
90
90
  { name: "Action", value: "Transfer" },
91
- { name: "Recipient", value: recipient },
92
- { name: "Quantity", value: quantity },
93
91
  { name: "SDK", value: "Beacon Wallet" },
94
92
  { name: "Data-Protocol", value: "ao" },
95
93
  { name: "Variant", value: "ao.TN.1" },
96
94
  { name: "Type", value: "Message" },
95
+ ...tags,
97
96
  ],
98
97
  };
99
98
  const signedDataItem = yield walletRef.current.signDataItem(dataItem);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vela-ventures/aosync-sdk-react",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"